lkml.org 
[lkml]   [2007]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][RFC] getting rid of stupid loop in BUG()
On Tue, Jul 24, 2007 at 09:56:21AM -0700, Jeremy Fitzhardinge wrote:
> Al Viro wrote:
> > AFAICS, the patch below should do it for i386; instead of
> > using a dummy loop to tell gcc that this sucker never returns,
> > we do
> > static void __always_inline __noreturn __BUG(const char *file, int line);
> > containing the actual asm we want to insert and define BUG() as
> > __BUG(__FILE__, __LINE__). It looks safe, but I don't claim enough
> > experience with gcc __asm__ potential nastiness, so...
> >
> > Comments, objections?
> >
>
> Does it work? When I wrote the BUG code I tried this, but gcc kept
> warning about "noreturn function returns". I couldn't work out a way to
> convince gcc that the asm is the end of the line.

Works here...

> I'm actually in favour of dropping the loop and the noreturn stuff
> altogether. It means that gcc thinks everything is live at the time of
> the BUG, and the debugging info at the point of the ud2a is more useful.

It also means that gcc doesn't eliminate a bunch of codepaths. It means
even more cretinous warnings about something being used uninitialized,
etc.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-24 19:17    [W:0.077 / U:6.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site