This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: An alias bug
- To: hjl at lucon dot org (H.J. Lu)
- Subject: Re: An alias bug
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sat, 11 Jul 1998 23:43:07 -0600
- cc: egcs-bugs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <m0yv93A-000266C@ocean.lucon.org>you write:
> Here is a C testcase from Richard. The binary aborts when compiled with
> -O2. I have another 500 line C++ testcase which results in an infinite
> loop when compiled with -O2. The problems with loop and alias are
I believe this testcase is bogus.
> H.J.
> --
> H.J. Lu (hjl@gnu.org)
> ----
> long A [2] = {0};
> long B [2] = {2, 0};
>
> typedef union
> {
> long long ll;
> long l[2];
> } long_long_type;
>
> main ()
> {
> unsigned int i;
> long long u = -1;
> for (i = 0; i < 2; i+=2)
> {
> u = A [i] + B [i];
> u = ((long_long_type *) &u)->l [1] + A [i+1] + B [i+1];
"u" is a "long long", I don't think casting it to "long_long_type"
is valid C or C++.
jeff