Re: [PATCH][RFC] getting rid of stupid loop in BUG()

From: Linus Torvalds
Date: Wed Jul 25 2007 - 14:26:02 EST




On Wed, 25 Jul 2007, Al Viro wrote:
>
> Umm... Actually, we might be able to do something like
> {
> l: __builtin_trap();
> static struct ... v __attribute__((section(...))) = { &&l, n, file };

No.

A C-level label is a pointer to a C-level construct.

The compiler may have reasons to put other instructions in between the
label and the final end result of the __builtin_trap. The above may work
for some trivial test-case, but in the end, the label and the __builtin
are *not* atomic, and the compiler may well end up having register spills
etc in there, or having CSE'd two traps, or any number of details meaning
that the label doesn't point to the exact ud2 instruction.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/