Bug#701138: clang-3.2: fatal error: error in backend: Cannot select: 0x2a4c890: i32 = fabs 0x2a51390

Ben Longbons brlongbons at gmail.com
Fri Feb 22 00:56:11 UTC 2013


Package: clang-3.2
Version: 1:3.2-1~exp7
Severity: normal

Dear Maintainer,

I'm almost completely certain that this regressed after upgrading
from 3.2-1~exp5 to 1:3.2-1~exp7

I *am* certain that clang 3.2 on another system (Gentoo) does not
experience this problem.

The complete error message is:
fatal error: error in backend: Cannot select: 0x1e09520: i32 = fabs 0x1e0e020
      [ORD=16] [ID=31]
  0x1e0e020: i32 = zero_extend 0x1e0db20 [ID=30]
    0x1e0db20: i8 = X86ISD::SETCC 0x1e0da20, 0x1e05c80:1 [ID=28]
      0x1e0da20: i8 = Constant<9> [ID=13]
      0x1e05c80: i32,i32 = X86ISD::SUB 0x1e09920, 0x1e05a80 [ID=26]
        0x1e09920: i32 = add 0x1e05e80, 0x1e09b20 [ORD=12] [ID=24]
          0x1e05e80: i32,ch = load 0x1e09320, 0x1e05980, 0x1e06280<LD4[%33](align=8)(tbaa=!"any pointer")> [ORD=11] [ID=23]
            0x1e05980: i32 = FrameIndex<5> [ORD=8] [ID=3]
            0x1e06280: i32 = undef [ORD=10] [ID=5]
          0x1e09b20: i32 = Constant<-12> [ORD=12] [ID=8]
        0x1e05a80: i32 = X86ISD::Wrapper 0x1e09620 [ID=18]
          0x1e09620: i32 = TargetGlobalAddress<[0 x i32]* @_ZNSs4_Rep20_S_empty_rep_storageE> 0 [ID=16]
In function: _Z9term_funcv

Compiling to .ll first succeeds, but then gives a slightly different message when compiling that to .o:
ladmin.ll:38:18: error: invalid forward reference to function 'llvm.fabs.i32'
      with wrong type!
  %16 = call i32 @llvm.fabs.i32(i32 %15, i32 0) nounwind

Preprocessing with gcc 4.6, 4.7, or 4.8 makes no difference.

Command line:
$ clang++ -m32 -std=c++0x -O2 -c -o ladmin.o ladmin.cpp

/// BEGIN ladmin.cpp
#include <string>

struct const_string
{
    const_string(const std::string& s);
    const_string(std::string&&) = delete;
};

void ladmin_log(const_string);

void term_func(void)
{
    ladmin_log(
        static_cast<const std::string&>(
            (
                std::string()
            )
        )
    );
}
/// END ladmin.cpp

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages clang-3.2 depends on:
ii  compiler-rt          1:3.2-1~exp7
ii  libc6                2.16-0experimental1
ii  libclang-common-dev  1:3.2-1~exp7
ii  libffi5              3.0.10-3
ii  libgcc-4.7-dev       4.7.2-14
ii  libgcc1              1:4.8-20130105-1
ii  libllvm3.2           3.2~rc3-1~exp1
ii  libobjc-4.7-dev      4.7.2-14
ii  libstdc++6           4.8-20130105-1
ii  libstdc++6-4.7-dev   4.7.2-14

Versions of packages clang-3.2 recommends:
ii  llvm-3.2-dev  3.2~rc3-1~exp1
ii  python        2.7.3-4

clang-3.2 suggests no packages.

-- no debconf information



More information about the Pkg-llvm-team mailing list