[cfe-dev] clang bug? Miscompilation of array of unsigned long long

Edward Meewis ed at extraordinarymachine.nl
Sun Aug 1 13:02:54 PDT 2010


  On 01-08-10 19:49, Dimitry Andric wrote:
> This looks like a bug in GNU as 2.20.1, at least on FreeBSD.
Eli - (Not so) Randomly guessed right!
Dimitry - Nail on the head - binutils on FreeBSD (and OpenBSD) is at fault.

Here's the output for the various cases:
clang direct:
FFFFFFFD00000000, 18446744060824649728
0000FFFD00000000, 0281462091808768

Eli's clang direct:
FFFFFFFD00000000, 18446744060824649728
FFFFFFFD00000000, 18446744060824649728

clang asm with new as:
FFFFFFFD00000000, 18446744060824649728
0000FFFD00000000, 0281462091808768

Eli's clang asm - arrTest-clang-newas-eli
FFFFFFFD00000000, 18446744060824649728
FFFFFFFD00000000, 18446744060824649728

The compiler-rt tests also pass with 100%.

So, obviously I need to file a binutils bug (couldn't find one), but how 
do we handle the clang case.Working around bugs in external programs 
doesn't seem the way to go. Any ideas?

I guess we could add Triple::FreeBSD to the test, if  it is available.

-- Ed



More information about the cfe-dev mailing list