Skip to content

Commit

Permalink
[PATCH] gcc-4.1.0 is bust
Browse files Browse the repository at this point in the history
Keith says

Compiling 2.6.19-rc6 with gcc version 4.1.0 (SUSE Linux), wait_hpet_tick is
optimized away to a never ending loop and the kernel hangs on boot in timer
setup.

0000001a <wait_hpet_tick>:
  1a:   55                      push   %ebp
  1b:   89 e5                   mov    %esp,%ebp
  1d:   eb fe                   jmp    1d <wait_hpet_tick+0x3>

This is not a problem with gcc 3.3.5.  Adding barrier() calls to
wait_hpet_tick does not help, making the variables volatile does.

And the consensus is that gcc-4.1.0 is busted.  Suse went and shipped
gcc-4.1.0 so we cannot ban it.  Add a warning.

Cc: Keith Owens <kaos@ocs.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Dec 7, 2006
1 parent a4ed06a commit f1a60db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
#error Sorry, your GCC is too old. It builds incorrect kernels.
#endif

#if __GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 0
#warning gcc-4.1.0 is known to miscompile the kernel. A different compiler version is recommended.
#endif

static int init(void *);

extern void init_IRQ(void);
Expand Down

0 comments on commit f1a60db

Please sign in to comment.