[LLVMbugs] [Bug 19721] New: clang crashes on valid code at -O2 and -O3 on x86_64-linux-gnu in 32-bit mode

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 11 23:00:06 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19721

            Bug ID: 19721
           Summary: clang crashes on valid code at -O2 and -O3 on
                    x86_64-linux-gnu in 32-bit mode
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The current clang trunk crashes when compiling the following code at -O2 and
-O3 on x86_64-linux-gnu in 32-bit (but not 64-bit) mode. 

This is a regression from clang 3.4.

$ clang-trunk -v
clang version 3.5.0 (trunk 208493)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.1
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
$ 
$ clang-trunk -m32 -Os -c small.c
$ clang-3.4 -m32 -O2 -c small.c
$ clang-trunk -m64 -O2 -c small.c
$ 
$ clang-trunk -m32 -O2 -c small.c
fatal error: error in backend: Cannot select: 0x3a50650: v4i32 =
X86ISD::INSERTPS 0x3a50860, 0x3a50860, 0x3a78ad8
      [ORD=4] [ID=5]
  0x3a50860: v4i32,ch = CopyFromReg 0x39fdd10, 0x3a50230 [ORD=2] [ID=4]
    0x3a50230: v4i32 = Register %vreg0 [ID=1]
  0x3a50860: v4i32,ch = CopyFromReg 0x39fdd10, 0x3a50230 [ORD=2] [ID=4]
    0x3a50230: v4i32 = Register %vreg0 [ID=1]
  0x3a78ad8: i32 = Constant<81> [ID=3]
In function: fn2
clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 3.5.0 (trunk 208493)
Target: i386-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/small-b9eaee.c
clang: note: diagnostic msg: /tmp/small-b9eaee.sh
clang: note: diagnostic msg: 

********************
$ 


--------------------------------


struct S
{
  int f0;
  int f1;
};

volatile struct S a, b;

int c, d;

void
fn1 ()
{
  int e[4];
  for (c = 0; c < 4; c++)
    e[c] = 1;
  for (; b.f0;)
    if (a.f1)
      e[0] = 0;
  d = e[0];
}

void
fn2 ()
{
  fn1 ();
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140512/1065c8c9/attachment.html>


More information about the llvm-bugs mailing list