[llvm-bugs] [Bug 28719] New: clang crashes on valid code at -O3 on x86_64-linux-gnu with "error in backend: Broken function found, compilation aborted!"

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 26 11:39:48 PDT 2016


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

            Bug ID: 28719
           Summary: clang crashes on valid code at -O3 on x86_64-linux-gnu
                    with "error in backend: Broken function found,
                    compilation aborted!"
           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 at -O3 when compiling the following test case
on x86_64-linux-gnu in both 32-bit and 64-bit modes. 



$ clang-trunk -v
clang version 4.0.0 (trunk 276735)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
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/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/3.4.6
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.5
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
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/6.1.0
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0
Selected GCC installation: /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/6.1.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64



$ clang-trunk -O3 abc.c
Instruction does not dominate all uses!
  %indvars.iv.next = add i64 %indvars.iv, 1
  %3 = add i64 %indvars.iv.next, -1
fatal error: error in backend: Broken function found, compilation aborted!
clang-4.0: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 4.0.0 (trunk 276735)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-4.0: 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-4.0: note: diagnostic msg: 
********************

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

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



$ cat abc.c
int a;
char b;
char c[4];
void abort();
int main() {
  int i;
  for (; a < 4; i++)
    if (b * i || c[i] != i)
      abort();
}

-- 
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/20160726/ca2707be/attachment.html>


More information about the llvm-bugs mailing list