This is the mail archive of the gcc-patches@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]

Re: 2 new testcases


>   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)


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