[Top] [All Lists]

Re: [patch] Prevent dead code/data removal with gcc 3.4

To: Ralf Baechle <>
Subject: Re: [patch] Prevent dead code/data removal with gcc 3.4
From: "Maciej W. Rozycki" <>
Date: Mon, 16 Feb 2004 10:18:17 +0100 (CET)
Cc: Jun Sun <>,
In-reply-to: <>
Organization: Technical University of Gdansk
Original-recipient: rfc822;
References: <> <> <> <> <>
On Fri, 13 Feb 2004, Ralf Baechle wrote:

> >  If we want to tolerate performance loss, then it's easily doable.  That 
> > can be done with the current setup, with a jump instruction to the 
> > referred function added at the end and "__attribute__((used))" or perhaps 
> > "asm("foo")" added to the function declaration.
> > 
> >  I can choose this path if we agree on it.
> The inline version is fundemantally fragile.  The outline version has
> problems with getting reordered by later gcc which can be solved by
> putting a jump to the C function at the end; the C function also needs
> the right __attribute__s so it won't get eleminated by gcc.

 This is exactly what I'm writing of ("the current setup" == what we now
have in the kernel; sorry for being ambiguous) -- except that I'd go for
the "asm("foo")" variant which does not require any additional
__attribute__s and should work at least since gcc 2.95 (and which I like

+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+        e-mail:, PGP key available        +

<Prev in Thread] Current Thread [Next in Thread>