2 new testcases

H.J. Lu hjl@lucon.org
Wed Jul 1 10:40:00 GMT 1998


>   Ooops. I forgot about endian. We can move it to gcc.dg and
>   test it on little endian machines only, like x86. As for
>   -fstrict-aliasing, I have submitted a patch for the bug.
>   It works with -fstrict-aliasing.
> 
> It may at the moment.  But, your code is not conforming ANSI C, even
> assuming the existence of long long.  You are referencing a variable of
> type `long long' (namely `u') through a pointer of type `long'.
> That's a no-no.  If you want to submit this test case, you should
> explicitly add -fno-strict-aliasing to the compiler options.  IMO, you

The bug is in loop.c. It may or may not have anything to do with
alias. From what I have seen, it may happen in other cases. Please
refer to my previous analysis and patch for details.

> should write this code differently.  The only even semi-portable way
> to do what you are doing is to use type-punning through unions.
> 

That is what I have done.

-- 
H.J. Lu (hjl@gnu.org)



More information about the Gcc-patches mailing list