[llvm-bugs] [Bug 36045] New: clang crashes on valid code at -O3 on x86_64-linux-gnu while running pass 'Simplify the CFG'
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Jan 22 15:51:50 PST 2018
https://bugs.llvm.org/show_bug.cgi?id=36045
Bug ID: 36045
Summary: clang crashes on valid code at -O3 on x86_64-linux-gnu
while running pass 'Simplify the CFG'
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: llvm-bugs at lists.llvm.org
Tested with trunk revision 323144.
$ clangpolly -v
clang version 7.0.0 (http://llvm.org/git/clang.git
39491d7b6098f96eb1f88d68068eb654c1e2bd81) (http://llvm.org/git/llvm.git
c127e0c9742f746fe7198222bf6442b81787292e)
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
$
$ clangpolly -O2 small.c
$
$ clangpolly -O3 small.c
#0 0x000000000215ee5a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:402:0
#1 0x000000000215ccee llvm::sys::RunSignalHandlers()
/home/su/software/tmp/polly/llvm/lib/Support/Signals.cpp:50:0
#2 0x000000000215ce62 SignalHandler(int)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:242:0
#3 0x00007f3d82974390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x0000000001864998 llvm::matchSelectPattern(llvm::Value*, llvm::Value*&,
llvm::Value*&, llvm::Instruction::CastOps*)
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4573:0
#5 0x0000000001863a1c matchMinMaxOfMinMax
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4173:0
#6 0x0000000001863a1c matchMinMax
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4271:0
#7 0x0000000001863a1c matchSelectPattern(llvm::CmpInst::Predicate,
llvm::FastMathFlags, llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*,
llvm::Value*&, llvm::Value*&)
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4451:0
#8 0x0000000001864aeb llvm::matchSelectPattern(llvm::Value*, llvm::Value*&,
llvm::Value*&, llvm::Instruction::CastOps*)
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4614:0
#9 0x0000000001863a1c matchMinMaxOfMinMax
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4173:0
#10 0x0000000001863a1c matchMinMax
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4271:0
#11 0x0000000001863a1c matchSelectPattern(llvm::CmpInst::Predicate,
llvm::FastMathFlags, llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*,
llvm::Value*&, llvm::Value*&)
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4451:0
...
#504 0x0000000001864aeb llvm::matchSelectPattern(llvm::Value*, llvm::Value*&,
llvm::Value*&, llvm::Instruction::CastOps*)
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4614:0
#505 0x0000000001863a1c matchMinMaxOfMinMax
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4173:0
#506 0x0000000001863a1c matchMinMax
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4271:0
#507 0x0000000001863a1c matchSelectPattern(llvm::CmpInst::Predicate,
llvm::FastMathFlags, llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*,
llvm::Value*&, llvm::Value*&)
/home/su/software/tmp/polly/llvm/lib/Analysis/ValueTracking.cpp:4451:0
Stack dump:
0. Program arguments: /home/su/software/tmp/polly/llvm_build/bin/clang-6.0
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
small.c -mrelocation-model static -mthread-model posix -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -resource-dir
/home/su/software/tmp/polly/llvm_build/lib/clang/7.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/su/software/tmp/polly/llvm_build/lib/clang/7.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-fdebug-compilation-dir
/home/su/specres/good/20180122-clangpolly-m32-O3-Wall-g-build-055229
-ferror-limit 19 -fmessage-length 116 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-e560ef.o -x c small.c
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'CallGraph Pass Manager' on module 'small.c'.
4. Running pass 'Simplify the CFG' on function '@j'
clang-6.0: error: unable to execute command: Segmentation fault (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (http://llvm.org/git/clang.git
39491d7b6098f96eb1f88d68068eb654c1e2bd81) (http://llvm.org/git/llvm.git
c127e0c9742f746fe7198222bf6442b81787292e)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
clang-6.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-6.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-6.0: note: diagnostic msg: /tmp/small-b940f3.c
clang-6.0: note: diagnostic msg: /tmp/small-b940f3.sh
clang-6.0: note: diagnostic msg:
********************
$
-----------------------------------------------
int a, b, c, e;
unsigned d;
int f (int g, int h)
{
return (g > 0 && -h) || g < 0 ? g : g + h;
}
char i (int g, int h)
{
return g + h;
}
void j ()
{
int k = 5, m = 3;
while (1)
{
int l;
if (!e)
break;
k = 1;
}
while (1)
{
if (k)
break;
for (d = 0; d < 21; d = f (d, 2))
{
m = 5;
if (b)
break;
}
if (i (c & 7, 1) && m)
b = d = a;
}
}
int main ()
{
j ();
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/20180122/e71742c5/attachment.html>
More information about the llvm-bugs
mailing list