From: Willy Tarreau <w@1wt.eu>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Keith Owens <kaos@ocs.com.au>,
Nicholas Miell <nmiell@comcast.net>,
linux-kernel@vger.kernel.org, davem@davemloft.net
Subject: Re: [patch 2.6.19-rc6] Stop gcc 4.1.0 optimizing wait_hpet_tick away
Date: Wed, 29 Nov 2006 21:14:10 +0100 [thread overview]
Message-ID: <20061129201410.GB1736@1wt.eu> (raw)
In-Reply-To: <20061129090800.GI6570@devserv.devel.redhat.com>
On Wed, Nov 29, 2006 at 04:08:00AM -0500, Jakub Jelinek wrote:
> On Wed, Nov 29, 2006 at 02:56:20PM +1100, Keith Owens wrote:
> > Nicholas Miell (on Tue, 28 Nov 2006 19:08:25 -0800) wrote:
> > >On Wed, 2006-11-29 at 13:22 +1100, Keith Owens wrote:
> > >> 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.
> > >>
> > >> Signed-off-by: Keith Owens <kaos@ocs.com.au>
> > >>
> > >> ---
> > >> arch/i386/kernel/time_hpet.c | 2 +-
> > >> 1 file changed, 1 insertion(+), 1 deletion(-)
> > >>
> > >> Index: linux-2.6/arch/i386/kernel/time_hpet.c
> > >> ===================================================================
> > >> --- linux-2.6.orig/arch/i386/kernel/time_hpet.c
> > >> +++ linux-2.6/arch/i386/kernel/time_hpet.c
> > >> @@ -51,7 +51,7 @@ static void hpet_writel(unsigned long d,
> > >> */
> > >> static void __devinit wait_hpet_tick(void)
> > >> {
> > >> - unsigned int start_cmp_val, end_cmp_val;
> > >> + unsigned volatile int start_cmp_val, end_cmp_val;
> > >>
> > >> start_cmp_val = hpet_readl(HPET_T0_CMP);
> > >> do {
> > >
> > >When you examine the inlined functions involved, this looks an awful lot
> > >like http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22278
> > >
> > >Perhaps SUSE should fix their gcc instead of working around compiler
> > >problems in the kernel?
> >
> > Firstly, the fix for 22278 is included in gcc 4.1.0.
>
> This actually sounds more like http://gcc.gnu.org/PR27236
> And that one is broken in 4.1.0, fixed in 4.1.1.
Then why not simply check for gcc 4.1.0 in compiler.h and refuse to build
with 4.1.0 if it's known to produce bad code ? I find it a bit annoying
that we start fixing every place affected by buggy compiler versions,
especially when the fix is already available.
> Jakub
Regards,
Willy
next prev parent reply other threads:[~2006-11-29 20:14 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-29 2:22 [patch 2.6.19-rc6] Stop gcc 4.1.0 optimizing wait_hpet_tick away Keith Owens
2006-11-29 3:08 ` Nicholas Miell
2006-11-29 3:56 ` Keith Owens
2006-11-29 4:04 ` David Miller
2006-11-29 4:30 ` Keith Owens
2006-11-29 4:57 ` Nicholas Miell
2006-11-30 1:04 ` David Schwartz
2006-12-01 5:50 ` Kyle Moffett
2006-12-01 11:24 ` David Schwartz
2006-12-01 12:08 ` Kyle Moffett
2006-12-01 13:52 ` David Schwartz
2006-12-02 9:02 ` Jan Engelhardt
2006-12-01 12:31 ` Andreas Schwab
2006-12-01 14:03 ` David Schwartz
2006-12-02 10:39 ` Kyle Moffett
2006-12-03 4:29 ` David Schwartz
2006-12-07 14:02 ` Kyle Moffett
2006-12-08 4:22 ` David Schwartz
2006-11-29 9:08 ` Jakub Jelinek
2006-11-29 20:14 ` Willy Tarreau [this message]
2006-12-01 5:05 ` Andrew Morton
2006-12-01 5:14 ` Keith Owens
2006-12-01 5:26 ` Willy Tarreau
2006-12-01 6:32 ` Keith Owens
2006-12-01 7:28 ` Willy Tarreau
2006-12-01 7:57 ` Jakub Jelinek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061129201410.GB1736@1wt.eu \
--to=w@1wt.eu \
--cc=davem@davemloft.net \
--cc=jakub@redhat.com \
--cc=kaos@ocs.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=nmiell@comcast.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox