[llvm-bugs] [Bug 26308] New: clang crashes on valid code at -O1 and above on x86_64-linux-gnu with no diagnostic msg

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 25 21:44:16 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26308

            Bug ID: 26308
           Summary: clang crashes on valid code at -O1 and above on
                    x86_64-linux-gnu with no diagnostic msg
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: helloqirun at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The current clang trunk crashes when compiling the following valid code at -O1
and above on x86_64-linux-gnu in 64-bit mode. The 32-bit mode and -O0 level
work fine.

It might be a regression from 3.7.0.


$ clang-trunk -v
clang version 3.9.0 (trunk 258673)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.3
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.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.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64


$ clang-trunk -Wall -Wpedantic -Wextra -O0 -c abc.c
$ clang-trunk -O1 -c abc.c
clang-3.9: error: unable to execute command: Segmentation fault (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 258673)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-3.9: 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-3.9: note: diagnostic msg:
********************

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

********************


----
 cat abc.c
# 2 "" 3
int a, b, c;
fn1() {
  int d = "";
  while (fn1) {
    int *e;
    {
      int f;
      if (!memcmp(f, c, 0))
        continue;
    }
    for (;;) {
      b = e;
      for (; d; b = a)
        ;
      e++;
    }
  }
}

-- 
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/20160126/e3f66ab4/attachment.html>


More information about the llvm-bugs mailing list