How to downgrade from gcc-4.4 to gcc-4.3

Asked by Mark Fortescue

I have identified that GCC-4.4 mis-compiles code when building Linux kernels for Intel Core2 and Pentium4.

I rebuilt processor optimised builds for uBuntu LTS 10.04.1 linux-source-2.6.32-26 to two systems. Both became unstable with seemingly random kernel and code failures. In one case (rmmod 8250_pci) the code was identified as clearly mis-compiled. Instruction scheduling in GCC had incorrectly reordered a read of a structure element to after the following write resulting in a NULL pointer dereference error on module removal.

Looking through the GCC bugzilla regressions for GCC-4.4, it looks like this is one of the many similar aliasing regressions that can be found.

I decided to downgrade to GCC-4.3 to see if this generated more stable code by doing the following;

  Installing gcc-4.3 and g++-4.3.
  Un-installing gcc-4.4 and g++-4.3.
  Sym-linking gcc and cc to gcc-4.3 and c++ and g++ to g++-4.3.

This seems to result in a stable kernel build (no failures so far).

Given that GCC-4.3 seems to work correctly for my target CPUs, how do I downgrade to gcc-4.3 properly?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu build-essential Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :
#1

What you did seems reasonable. However, rather than forcing the symlinks, you may just want to setup your environment variables for the kernel build to point to the compilers of interest.

If you are certain gcc-4.4 is generating incorrect code, then you should submit this to the gcc bugzilla -- incorrect code generation is pretty bad. However, don't be surprised if you get flamed for posting if you are wrong -- the attitudes of devs on gcc bugzilla is pretty harsh.

Can you help with this problem?

Provide an answer of your own, or ask Mark Fortescue for more information if necessary.

To post a message you must log in.