<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - clang crashes on valid code at -O3 with debugging enabled: fatal error: error in backend: Broken function found, compilation aborted!"
href="https://bugs.llvm.org/show_bug.cgi?id=40479">40479</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang crashes on valid code at -O3 with debugging enabled: fatal error: error in backend: Broken function found, compilation aborted!
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>su@cs.ucdavis.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Tested with trunk revision 352264, and looks like a recent regression.
$ cltrunk -v
clang version 9.0.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
8a558a52a96fc5411834e6e015219513a9986bdc) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
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 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
8a558a52a96fc5411834e6e015219513a9986bdc) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
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
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> 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;
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>