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

Eli Friedman eli.friedman at gmail.com
Sun Aug 1 09:40:59 PDT 2010


On Sun, Aug 1, 2010 at 7:52 AM, Edward Meewis
<ed at extraordinarymachine.nl> wrote:
>  On 31-07-10 1:20, Eli Friedman wrote:
>>
>> Could you attach the generated .o file with and without the --32 option?
>> -Eli
>
> Turns out the --32 doesn't matter.
>
> However, my system has two versions of binutils and gcc uses the one
> delivered with FreeBSD-8.0 and clang uses the one installed through ports.
> clang somehow produces asm that the newer version of as doesn't like. gcc
> produces something that works correctly in both cases:

Random guess: does the following patch help?

Index: lib/Target/X86/X86MCAsmInfo.cpp
===================================================================
--- lib/Target/X86/X86MCAsmInfo.cpp	(revision 109940)
+++ lib/Target/X86/X86MCAsmInfo.cpp	(working copy)
@@ -92,7 +92,7 @@

   // OpenBSD has buggy support for .quad in 32-bit mode, just split into two
   // .words.
-  if (T.getOS() == Triple::OpenBSD && T.getArch() == Triple::x86)
+  if (T.getArch() == Triple::x86)
     Data64bitsDirective = 0;
 }

-Eli




More information about the cfe-dev mailing list