This is the mail archive of the
mailing list for the GCC project.
Re: a warning to implement
- From: Joe Buck <jbuck at synopsys dot COM>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: gdr at codesourcery dot com, jbuck at synopsys dot COM, aoliva at redhat dot com,dewar at gnat dot com, gcc at gcc dot gnu dot org, phil at jaj dot com
- Date: Wed, 6 Feb 2002 12:20:55 -0800 (PST)
- Subject: Re: a warning to implement
> But Gaby, right now, the construct
> int a = a;
> produces an undefined result, so no one can use it. It might suppress
> warnings in one version of gcc, but then someone might submit a patch
> that causes it to have some disastrous effect, and no one would have
> a right to complain, since if they are using this, they are using an
> undocumented behavior, and have no right to count on it.
One possible disasterous effect is that
float a = a;
with debugging off might generate an actual load and store, and if it
reads stack noise that looks like a signalling NaN, boom. The compiler
could avoid this by optimizing away the assignment even at -O0.