[llvm-bugs] [Bug 41004] New: clang crashes on valid code at -O2 and -O3: fatal error: error in backend: Broken function found, compilation aborted!

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 8 01:25:51 PST 2019


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

            Bug ID: 41004
           Summary: clang crashes on valid code at -O2 and -O3: fatal
                    error: error in backend: Broken function found,
                    compilation aborted!
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

This appears to be a recent regression (tested with trunk revision 355665). 

$ cltrunk -v
clang version 9.0.0 (http://llvm.org/git/clang.git
60510251f0c7e121e59a5477103c53e69833ca56) (http://llvm.org/git/llvm.git
bbf63cf4c3d836f8aa59d84cd010b80896d37493)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
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.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.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.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ cltrunk -Os small.c
$
$ cltrunk -O2 small.c
Instruction does not dominate all uses!
  %math = extractvalue { i32, i1 } %6, 0
  %add.i = add i32 %math, %mul.i
in function main
fatal error: error in backend: Broken function found, compilation aborted!
clang-8: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 9.0.0 (http://llvm.org/git/clang.git
60510251f0c7e121e59a5477103c53e69833ca56) (http://llvm.org/git/llvm.git
bbf63cf4c3d836f8aa59d84cd010b80896d37493)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
clang-8: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-8: note: diagnostic msg:
********************

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

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


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


int a, *c = &a, d, e;
unsigned b;

void f ()
{ 
  int g = 1, *h[2] = { &g };
  *c = e;
  if (*c)
    { 
      int i = d % 2 * ((1 && g) / b) + ~-a;
      if (a < 1)
        { 
          i = a;
          if (i)
            goto L;
        }
      a = i;
    L:
      ;
    }
}

int main ()
{ 
  f ();
  return 0;
}

-- 
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/20190308/18002c52/attachment.html>


More information about the llvm-bugs mailing list