linux-mips
[Top] [All Lists]

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

To: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Subject: Re: [patch] Prevent dead code/data removal with gcc 3.4
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Tue, 17 Feb 2004 13:50:41 +0100 (CET)
Cc: David Daney <ddaney@avtrex.com>, Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
In-reply-to: <20040213224959.GB20118@rembrandt.csv.ica.uni-stuttgart.de>
Organization: Technical University of Gdansk
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.55.0402131453360.15042@jurand.ds.pg.gda.pl> <20040213145316.GA23810@linux-mips.org> <20040213222253.GA20118@rembrandt.csv.ica.uni-stuttgart.de> <402D513F.8080205@avtrex.com> <20040213224959.GB20118@rembrandt.csv.ica.uni-stuttgart.de>
Sender: linux-mips-bounce@linux-mips.org
On Fri, 13 Feb 2004, Thiemo Seufer wrote:

> The inline version isn't dead code, and gcc isn't allowed to reschedule
> code around a __asm__ __volatile__, so the patch should be ok.

 Note that it's a valid point gcc can do whatever it wants in the prologue
as long as it conforms to the ABI.  Wrt static registers it only needs to
make sure they are restored in the epilogue (and that's exactly what
happens for "s8"); then after saving them in the prologue, it can use
them, possibly destructibly, as we don't express (nor have a way to) the
need to have them preserved from the entry point.

 I think we could have a gcc extension to express certain function 
arguments are the entry values of registers (e.g. by specifying 
"asm("foo")" like it can be done for variables), but currently there's no 
such option.

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

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