[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in throw.c

From: Christopher Cramer
Subject: Re: bug in throw.c
Date: Tue, 8 Apr 2003 01:31:06 -0500
User-agent: Mutt/1.2.5i

On Sun, Apr 06, 2003 at 05:01:36PM -0700, David Mosberger-Tang wrote:
> #if 0/*def __GNUC__*/
>   /* Dirk:FIXME:: This bugfix should be removed some time. */
>   /* GCC 2.95.2 has a bug in its optimizer that makes it generate
>      incorrect code sometimes.  This barrier stops it from being too
>      clever. */
>   asm volatile ("" : "=g" (winds));
> #endif
> This is clearly bogus: the asm statement claims that it's writing the
> "winds" variable, which isn't true.  On ia64, this has the effect that
> the "winds" gets corrupted and comes out with value "1".  Just

Now, I haven't checked up on the changes in recent GCC versions, but
that behavior seems really odd to me. How does it change the value of a
variable if you put in an empty asm statement that only claims to change
the variable?

This is a common tactic to defeat the optimizer. I don't understand
why GCC would suddenly have problems with this.

Christopher Cramer <address@hidden> <>
"People said it couldn't be that our soldiers would do such things. Now
you read worse things in the mainstream media and people don't care. We
used to say that if only people know about it, it would stop. Now they
know about it, and it hasn't stopped." - Adam Keller

reply via email to

[Prev in Thread] Current Thread [Next in Thread]