[llvm-bugs] [Bug 26364] New: Segmentation fault at -Os and above on x86_64-linux-gnu in 32-bit and 64-bit modes
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Jan 28 16:38:12 PST 2016
https://llvm.org/bugs/show_bug.cgi?id=26364
Bug ID: 26364
Summary: Segmentation fault at -Os and above on
x86_64-linux-gnu in 32-bit and 64-bit modes
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: chengniansun at gmail.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
The following code causes a segmentation fault in clang-trunk at -Os and above
on x86_64-linux-gnu in 32-bit and 64-bit modes.
$: clang-trunk -v
clang version 3.9.0 (trunk 258958)
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.3.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.3
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.4
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.3.0
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.3
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.4
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.2
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$:
$: clang-trunk -Os small.c
small.c:20:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
small.c:22:29: warning: control reaches end of non-void function
[-Wreturn-type]
static short fn2() { fn1(); }
^
clang-3.9: error: unable to execute command: Segmentation fault (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 258958)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-3.9: 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-3.9: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/small-8cb392.c
clang-3.9: note: diagnostic msg: /tmp/small-8cb392.sh
clang-3.9: note: diagnostic msg:
********************
$: clang-trunk -O2 small.c
small.c:20:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
small.c:22:29: warning: control reaches end of non-void function
[-Wreturn-type]
static short fn2() { fn1(); }
^
clang-3.9: error: unable to execute command: Segmentation fault (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 258958)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-3.9: 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-3.9: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/small-f9ae95.c
clang-3.9: note: diagnostic msg: /tmp/small-f9ae95.sh
clang-3.9: note: diagnostic msg:
********************
$: clang-trunk -O3 small.c
small.c:20:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
small.c:22:29: warning: control reaches end of non-void function
[-Wreturn-type]
static short fn2() { fn1(); }
^
clang-3.9: error: unable to execute command: Segmentation fault (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 258958)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-3.9: 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-3.9: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/small-4ba728.c
clang-3.9: note: diagnostic msg: /tmp/small-4ba728.sh
clang-3.9: note: diagnostic msg:
********************
$:
$: cat small.c
static int a;
int b;
int c;
int d;
static int fn1() {
int k;
for (; b;) {
int e = 1;
for (; c;) {
for (; d;) {
e = k = 0;
for (; k < 8; k++)
;
break;
}
e &= c;
short f = k;
}
}
}
static short fn2() { fn1(); }
int main() {
a = 8;
for (; a == 3;)
fn2();
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/20160129/ae533632/attachment.html>
More information about the llvm-bugs
mailing list