[llvm-bugs] [Bug 35799] New: clang crashes on valid code at -O2 and -O3 on x86_64-linux-gnu in 32-bit mode: Assertion `ScaledReg == nullptr' failed
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Jan 2 15:34:19 PST 2018
https://bugs.llvm.org/show_bug.cgi?id=35799
Bug ID: 35799
Summary: clang crashes on valid code at -O2 and -O3 on
x86_64-linux-gnu in 32-bit mode: Assertion `ScaledReg
== nullptr' failed
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
This is tested with trunk revision 321681 and appears to be a recent
regression.
$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
d9551a3cb4a454e0818e345bdba510e1cb6dbbdd) (http://llvm.org/git/llvm.git
2714c01fbbdd69ba530d0246508618abeefa3328)
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 -m32 -Os -c small.c
$ clangpolly -m64 -O2 -c small.c
$
$ clangpolly -m32 -O2 -c small.c
clang-6.0:
/home/su/software/tmp/polly/llvm/lib/CodeGen/CodeGenPrepare.cpp:1963: void
{anonymous}::ExtAddrMode::SetCombinedField({anonymous}::ExtAddrMode::FieldName,
llvm::Value*, const llvm::SmallVectorImpl<{anonymous}::ExtAddrMode>&):
Assertion `ScaledReg == nullptr' failed.
#0 0x0000000002142aca llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:402:0
#1 0x000000000214095e llvm::sys::RunSignalHandlers()
/home/su/software/tmp/polly/llvm/lib/Support/Signals.cpp:50:0
#2 0x0000000002140ad2 SignalHandler(int)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:242:0
#3 0x00007ff07111c390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007ff06fe8e428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007ff06fe9002a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007ff06fe86bd7 __assert_fail_base
/build/glibc-bfm8X4/glibc-2.23/assert/assert.c:92:0
#7 0x00007ff06fe86c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x000000000189538a compare
/home/su/software/tmp/polly/llvm/lib/CodeGen/CodeGenPrepare.cpp:1883:0
#9 0x000000000189538a addNewAddrMode
/home/su/software/tmp/polly/llvm/lib/CodeGen/CodeGenPrepare.cpp:2691:0
#10 0x000000000189538a (anonymous
namespace)::CodeGenPrepare::optimizeMemoryInst(llvm::Instruction*,
llvm::Value*, llvm::Type*, unsigned int) [clone .constprop.1207]
/home/su/software/tmp/polly/llvm/lib/CodeGen/CodeGenPrepare.cpp:4234:0
#11 0x000000000189633d (anonymous
namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&) [clone
.constprop.1187]
/home/su/software/tmp/polly/llvm/lib/CodeGen/CodeGenPrepare.cpp:6231:0
#12 0x0000000001898766 optimizeBlock
/home/su/software/tmp/polly/llvm/lib/CodeGen/CodeGenPrepare.cpp:6325:0
#13 0x0000000001898766 (anonymous
namespace)::CodeGenPrepare::runOnFunction(llvm::Function&) [clone .part.1165]
[clone .constprop.1184]
/home/su/software/tmp/polly/llvm/lib/CodeGen/CodeGenPrepare.cpp:420:0
#14 0x0000000001c76f7b llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1520:0
#15 0x0000000001c7703c llvm::FPPassManager::runOnModule(llvm::Module&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1541:0
#16 0x0000000001c76b7d llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1597:0
#17 0x00000000022f50c7 llvm::PrettyStackTraceString::~PrettyStackTraceString()
/home/su/software/tmp/polly/llvm/include/llvm/Support/PrettyStackTrace.h:52:0
#18 0x00000000022f50c7 EmitAssembly
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:814:0
#19 0x00000000022f50c7 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, 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> >)
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1181:0
#20 0x0000000002b27fc7 std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >::~unique_ptr()
/usr/include/c++/5/bits/unique_ptr.h:235:0
#21 0x0000000002b27fc7
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:292:0
#22 0x0000000002cfbf08 void std::swap<bool>(bool&, bool&)
/usr/include/c++/5/bits/move.h:187:0
#23 0x0000000002cfbf08 clang::ParseAST(clang::Sema&, bool, bool)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#24 0x0000000002b2745f clang::CodeGenAction::ExecuteAction()
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#25 0x00000000026b3d56 clang::FrontendAction::Execute()
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:897:0
#26 0x0000000002683186
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#27 0x0000000002743902
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#28 0x0000000000aa8978 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#29 0x0000000000a1fe37 ExecuteCC1Tool
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:309:0
#30 0x0000000000a1fe37 main
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:388:0
#31 0x00007ff06fe79830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#32 0x0000000000aa4ef9 _start
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0xaa4ef9)
Stack dump:
0. Program arguments: /home/su/software/tmp/polly/llvm_build/bin/clang-6.0
-cc1 -triple i386-unknown-linux-gnu -emit-obj -disable-free -main-file-name
small.c -mrelocation-model static -mthread-model posix -fmath-errno
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu pentium4
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer
-coverage-notes-file /home/su/small.gcno -resource-dir
/home/su/software/tmp/polly/llvm_build/lib/clang/6.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/su/software/tmp/polly/llvm_build/lib/clang/6.0.0/include
-internal-externc-isystem /usr/include/i386-linux-gnu -internal-externc-isystem
/include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir
/home/su -ferror-limit 19 -fmessage-length 116 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o small.o -x c small.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'small.c'.
4. Running pass 'CodeGen Prepare' on function '@f'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (http://llvm.org/git/clang.git
d9551a3cb4a454e0818e345bdba510e1cb6dbbdd) (http://llvm.org/git/llvm.git
2714c01fbbdd69ba530d0246508618abeefa3328)
Target: i386-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-2f877e.c
clang-6.0: note: diagnostic msg: /tmp/small-2f877e.sh
clang-6.0: note: diagnostic msg:
********************
$
------------------------------
int a, b, c;
char d[1][4];
void f ()
{
while (a)
for (b = 2; b; b--)
if (d[c][b + 1])
{
a = b + 1 + c;
d[c][b + 1] = 0;
return;
}
}
--
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/20180102/6478f542/attachment.html>
More information about the llvm-bugs
mailing list