[llvm-bugs] [Bug 30504] New: crash on at -O1 and above in both 32-bit ad 64-bit modes on x86_64-linux-gnu (Segmentation fault, Early GVN Hoisting of Expressions)
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Sep 23 08:40:49 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=30504
Bug ID: 30504
Summary: crash on at -O1 and above in both 32-bit ad 64-bit
modes on x86_64-linux-gnu (Segmentation fault, Early
GVN Hoisting of Expressions)
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
$ clang-trunk -v
clang version 4.0.0 (trunk 282170) (llvm/trunk 282169)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
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.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.3.0
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clang-trunk -O3 small.c
#0 0x0000000001c9e585 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c9e585)
#1 0x0000000001c9c52e llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-4.0+0x1c9c52e)
#2 0x0000000001c9c692 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c9c692)
#3 0x00007f1be8e61340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x0000000001b41e41 (anonymous
namespace)::GVNHoist::hasEHOrLoadsOnPath(llvm::Instruction const*,
llvm::MemoryDef*, int&) (/usr/local/clang-trunk/bin/clang-4.0+0x1b41e41)
#5 0x0000000001b439fc (anonymous
namespace)::GVNHoist::safeToHoistLdSt(llvm::Instruction const*,
llvm::Instruction const*, llvm::MemoryUseOrDef*, (anonymous
namespace)::GVNHoist::InsKind, int&) [clone .constprop.450]
(/usr/local/clang-trunk/bin/clang-4.0+0x1b439fc)
#6 0x0000000001b43e8c (anonymous
namespace)::GVNHoist::computeInsertionPoints(llvm::DenseMap<std::pair<unsigned
int, unsigned int>, llvm::SmallVector<llvm::Instruction*, 4u>,
llvm::DenseMapInfo<std::pair<unsigned int, unsigned int> >,
llvm::detail::DenseMapPair<std::pair<unsigned int, unsigned int>,
llvm::SmallVector<llvm::Instruction*, 4u> > > const&,
llvm::SmallVector<std::pair<llvm::BasicBlock*,
llvm::SmallVector<llvm::Instruction*, 4u> >, 4u>&, (anonymous
namespace)::GVNHoist::InsKind) [clone .constprop.444]
(/usr/local/clang-trunk/bin/clang-4.0+0x1b43e8c)
#7 0x0000000001b44ad7 (anonymous namespace)::GVNHoist::run(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1b44ad7)
#8 0x0000000001b45dcb (anonymous
namespace)::GVNHoistLegacyPass::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1b45dcb)
#9 0x000000000191ad13 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x191ad13)
#10 0x000000000191ae77
llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x191ae77)
#11 0x000000000191af44 llvm::legacy::FunctionPassManager::run(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x191af44)
#12 0x0000000001dfd7b2 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/local/clang-trunk/bin/clang-4.0+0x1dfd7b2)
#13 0x00000000023fd6c8
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-4.0+0x23fd6c8)
#14 0x00000000027d5462 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x27d5462)
#15 0x00000000023fdabe clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-4.0+0x23fdabe)
#16 0x0000000002110d46 clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-4.0+0x2110d46)
#17 0x00000000020eb44e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-4.0+0x20eb44e)
#18 0x0000000002198936
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-4.0+0x2198936)
#19 0x0000000000a8ca78 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-4.0+0xa8ca78)
#20 0x0000000000a35691 main (/usr/local/clang-trunk/bin/clang-4.0+0xa35691)
#21 0x00007f1be7c3dec5 __libc_start_main
/build/eglibc-3GlaMS/eglibc-2.19/csu/libc-start.c:321:0
#22 0x0000000000a88a9e _start (/usr/local/clang-trunk/bin/clang-4.0+0xa88a9e)
Stack dump:
0. Program arguments: /usr/local/clang-trunk/bin/clang-4.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
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/4.0.0 -c-isystem . -c-isystem
/usr/local/include/csmith -c-isystem /usr/local/include/csmith
-internal-isystem /usr/local/include -internal-isystem
/usr/local/clang-trunk/bin/../lib/clang/4.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/cnsun/ramdisk/hermes/run-4/res/20160922-clang-trunk-m32-g-O3-build-223212/delta
-ferror-limit 19 -fmessage-length 259 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-37220b.o -x c small.c
1. <eof> parser at end of file
2. Per-function optimization
3. Running pass 'Early GVN Hoisting of Expressions' on function '@main'
clang-4.0: error: unable to execute command: Segmentation fault (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (trunk 282170) (llvm/trunk 282169)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-4.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-4.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-4.0: note: diagnostic msg: /tmp/small-40e110.c
clang-4.0: note: diagnostic msg: /tmp/small-40e110.sh
clang-4.0: note: diagnostic msg:
********************
$
$ cat small.c
int a;
char b;
int main() {
int *c = &a, *d = &a, *e = &a;
*d = 5;
if (b)
a || (*e = *c);
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/20160923/77c8740b/attachment-0001.html>
More information about the llvm-bugs
mailing list