LLVM 3.0rc3 Testing Beginning

Hi Dave,

Thanks for the results. What platform is this on? And do these failures occur with 2.9?

-bw

Hi,

I just downloaded 3.0 and have a try on in-line assembly code and the problem is still there. I think it is not a critical issue for 3.0 release anyway.

It seems clang doesnt support “A” constraint in in-line assembly template under 64-bit mode, which basically load an 128bit data from memory to RDX:RAX, with the following error during the compiling:

clang -g -Wall -m64 -mcx16 try.c -o try
fatal error: error in backend: Cannot select: 0x1e92f20: i64 = build_pair 0x1e92d20, 0x1e92e20 [ORD=81]
… (ignore the rest dump)

gcc can correctly do this. I tried clang/llvm 2.9 on both Apple and Debian unstable, and clang-3.0rc3 binary build, all failed.

Best Regards

Huaxia Zhao

P.S.

The test code part:

typedef __int128_t int128_t;

int128_t
atomic_compare_and_swap128(
volatile int128_t * Mem,
int128_t Swp,
int128_t Cmp)
{
assert(Mem != NULL);
int128_t Out = 0;
int64_t low64 = int128__low64(Swp); // get low and high 64-bit separately.
int64_t high64 = int128__high64(Swp);

/* the *Mem MUST BE 16-byte Aligned. */

asm volatile
(
“pushq %%rbx \n”
“movq %[low64], %%rbx \n”
“lock cmpxchg16b (%[Mem]) \n”
“popq %%rbx \n”
: [Mem] “+D” (Mem), “=A” (Out)
: “A” (Cmp), [low64] “m” (low64), “c” (high64)
);
return Out;
}

For the record, I had a closer look at this. It seems to be a bug in
my system compiler on Ubuntu 11.04, gcc (Ubuntu/Linaro 4.5.2-8ubuntu4)
4.5.2.

In this code from unittests/AST/APValueTest.cpp:

  template<typename T>
  std::string operator()(const T& value) {
    Diag.Report(diag_just_format) << value;
    return LastDiagnostic.get().str();
  }

... the compiler is failing to call the destructor for the temporary
DiagnosticBuilder returned from Diag.Report(diag_just_format).

If I compile the test with gcc 4.6.1 (which I built from source) the
problem goes away.

Jay.

Bill Wendling <wendling@apple.com> writes:

Hi Dave,

Thanks for the results. What platform is this on? And do these failures occur with 2.9?

Platform is Debian Linux testing, x86_64.

clang is a disaster with 2.9 unfortunately, so I can't test it:

/bin/cp Output/sse.expandfft.llvm.o.compile.time Output/sse.expandfft.simple.compile.time
/home/greened/src/llvm-2.9/build/Release/bin/clang++ -o Output/sse.expandfft.simple Output/sse.expandfft.llvm.o -lm -msse2
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

                                  -Dave

Add some symlinks to clean up the multilib mess Debian created.

Joerg

You'd need to edit the files that have the include and link paths.

-eric

Tested on RHEL 6.1 workstation and was successful.
[deleisha@deleisha ~]$ lsb_release -ai
LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseWorkstation
Description: Red Hat Enterprise Linux Workstation release 6.1 (Santiago)
Release: 6.1
Codename: Santiago
[deleisha@deleisha ~]$ gcc --version
gcc (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[deleisha@deleisha ~]$

Eric Christopher <echristo@apple.com> writes:

clang is a disaster with 2.9 unfortunately, so I can't test it:

/bin/cp Output/sse.expandfft.llvm.o.compile.time Output/sse.expandfft.simple.compile.time
/home/greened/src/llvm-2.9/build/Release/bin/clang++ -o Output/sse.expandfft.simple Output/sse.expandfft.llvm.o -lm -msse2
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

You'd need to edit the files that have the include and link paths.

Which files?

                                   -Dave

Please file a bug at http://llvm.org/bugs/

-Eli

It's supported, but it looks like there's a bug. Please file a bug with this test case (but slightly fixed up so that it compiles).

Thanks!

-eric