target/3506: weird behaviour when incrementing volatile ints

Herbert Xu herbert@gondor.apana.org.au
Wed Apr 3 02:30:00 GMT 2002


On Fri, Mar 29, 2002 at 10:42:35AM -0000, rth@gcc.gnu.org wrote:
> Synopsis: weird behaviour when incrementing volatile ints
> 
> State-Changed-From-To: open->closed
> State-Changed-By: rth
> State-Changed-When: Fri Mar 29 02:42:35 2002
> State-Changed-Why:
>     GCC doesn't know what constitutes a reference to a volatile memory,
>     so it never performs operations on them directly.  It will always
>     pull the value into a register first.

This breaks C99 wrt sig_atomic_t.  The increment has to be a single
instruction.
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



More information about the Gcc-bugs mailing list