This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a warning to implement


Robert writes:
> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]