[llvm-bugs] [Bug 40479] New: clang crashes on valid code at -O3 with debugging enabled: fatal error: error in backend: Broken function found, compilation aborted!

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jan 26 04:25:03 PST 2019


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

            Bug ID: 40479
           Summary: clang crashes on valid code at -O3 with debugging
                    enabled: fatal error: error in backend: Broken
                    function found, compilation aborted!
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Tested with trunk revision 352264, and looks like a recent regression. 

$ cltrunk -v
clang version 9.0.0 (http://llvm.org/git/clang.git
8a558a52a96fc5411834e6e015219513a9986bdc) (http://llvm.org/git/llvm.git
6033f8c97abfccb3d9367694f62570ea980ccd81)
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 -O3 -g small.c
llvm.dbg.label intrinsic requires a !dbg attachment
  call void @llvm.dbg.label(metadata !26) #3
label %L1.outer.us.preheader.i.split.us
i32 ()* @main
llvm.dbg.label intrinsic requires a !dbg attachment
  call void @llvm.dbg.label(metadata !27) #3
label %L1.outer.us.preheader.i.split.us
i32 ()* @main
llvm.dbg.label intrinsic requires a !dbg attachment
  call void @llvm.dbg.label(metadata !26) #3
label %L1.outer.us.preheader.i.split.us
i32 ()* @main
llvm.dbg.label intrinsic requires a !dbg attachment
  call void @llvm.dbg.label(metadata !27) #3
label %L1.outer.us.preheader.i.split.us
i32 ()* @main
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
8a558a52a96fc5411834e6e015219513a9986bdc) (http://llvm.org/git/llvm.git
6033f8c97abfccb3d9367694f62570ea980ccd81)
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-bc8f7f.c
clang-8: note: diagnostic msg: /tmp/small-bc8f7f.sh
clang-8: note: diagnostic msg: 

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


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


int printf (const char *, ...);

struct
{
  int a:10;
} b;

int c, d;

void e ()
{
  int f, g;
  short h;
  g = c;
  h = f = ~g;
L1:
  b.a = (~g || d) - 1;
  if (f)
    goto L1;
L2:
  if (h)
    {
      g = h;
      goto L1;
    }
  if (c)
    {
      printf ("%d\n", c);
      goto L2;
    }
}

int main ()
{
  if (c)
    e ();
  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/20190126/ba074355/attachment.html>


More information about the llvm-bugs mailing list