This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/7726: Fails to produce the correct implementation-dependantoutput for loop optimization under x86 -> optimizes away a loop that shouldcomplete
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: <bangerth at dealii dot org>, <carlos at baldric dot uwo dot ca>, <gcc-bugs at gcc dot gnu dot org>, <gcc-prs at gcc dot gnu dot org>, <nobody at gcc dot gnu dot org>, <gcc-gnats at gcc dot gnu dot org>
- Date: Fri, 6 Dec 2002 22:22:46 +0100 (CET)
- Subject: Re: optimization/7726: Fails to produce the correct implementation-dependantoutput for loop optimization under x86 -> optimizes away a loop that shouldcomplete
On 6 Dec 2002 bangerth@dealii.org wrote:
> Hm, the code goes into an endless loop on my system also without
> optimization and with all the compilers I have (i.e. gcc2.95, 3.0,
> 3.2, 3.2.2pre, 3.3pre, and icc7). Are you sure that the overflow you
> are exploiting is really defined in ISO C?
Reading the value of a union member other than the last one stored into is
undefined (at least in C99), so it could be easily argued that this is not
a bug. However, gcc seems to support this in some other places (see the
info entry about aliasing). So IMHO this should either be "fixed", or it
should be documented exactly which union type punning tricks are OK.
Falk