[llvm-bugs] [Bug 34179] New: clang crashes at -Os: Assertion `I->getType()->isIntegerTy() && "Trivializing a non-integer value?"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Aug 13 13:14:54 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34179

            Bug ID: 34179
           Summary: clang crashes at -Os: Assertion
                    `I->getType()->isIntegerTy() && "Trivializing a
                    non-integer value?"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: helloqirun at gmail.com
                CC: llvm-bugs at lists.llvm.org

The following code crashes the current trunk version at "-Os" in 32-bit mode.
The 64-bit mode works fine.


$ clang-trunk --version
clang version 6.0.0 (trunk 310787)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin



$ clang-trunk -m32 -Os abc.c
abc.c:8:5: warning: incompatible pointer to integer conversion assigning to
'char' from 'int [a]' [-Wint-conversion]
  c = k;
    ^ ~
clang-6.0: /home/absozero/trunk/llvm/lib/Transforms/Scalar/BDCE.cpp:48: auto
clearAssumptionsOfUsers(llvm::Instruction *, llvm::DemandedBits &)::(anonymous
class)::operator()(llvm::Instruction *, llvm::DemandedBits &) const: Assertion
`I->getType()->isIntegerTy() && "Trivializing a non-integer value?"' failed.
#0 0x0000000001cf5134 PrintStackTraceSignalHandler(void*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1cf5134)
#1 0x0000000001cf5456 SignalHandler(int)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1cf5456)
#2 0x00007ff8714de330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#3 0x00007ff87005bc37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#4 0x00007ff87005f028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#5 0x00007ff870054bf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#6 0x00007ff870054ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#7 0x0000000001ad6177 bitTrackingDCE(llvm::Function&, llvm::DemandedBits&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1ad6177)
#8 0x0000000001862c4f llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1862c4f)
#9 0x000000000132edc9 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x132edc9)
#10 0x0000000001863386 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1863386)
#11 0x0000000001e7354b 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/absozero/trunk/root-clang/bin/clang-6.0+0x1e7354b)
#12 0x00000000025c5702
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x25c5702)
#13 0x0000000002a45da6 clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2a45da6)
#14 0x00000000022721d8 clang::FrontendAction::Execute()
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x22721d8)
#15 0x00000000022217b1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x22217b1)
#16 0x00000000022fd5a7
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x22fd5a7)
#17 0x000000000085ff69 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/root-clang/bin/clang-6.0+0x85ff69)
#18 0x000000000085dab1 main
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x85dab1)
#19 0x00007ff870046f45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#20 0x000000000085abc9 _start
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x85abc9)
Stack dump:
0.      Program arguments: /home/absozero/trunk/root-clang/bin/clang-6.0 -cc1
-triple i386-unknown-linux-gnu -emit-obj -disable-free -main-file-name abc.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu pentium4
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/home/absozero/trunk/root-clang/lib/clang/6.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/absozero/trunk/root-clang/lib/clang/6.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -Os
-fdebug-compilation-dir /home/absozero/projects/reduction/crash -ferror-limit
19 -fmessage-length 172 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/abc-fe2ad8.o -x c
abc.c
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'abc.c'.
4.      Running pass 'Bit-Tracking Dead Code Elimination' on function '@fn2'
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 (trunk 310787)
Target: i386-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/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/abc-0a42e9.c
clang-6.0: note: diagnostic msg: /tmp/abc-0a42e9.sh
clang-6.0: note: diagnostic msg:

********************



$ cat abc.c
volatile int a;
short b;
short(fn1)(short p1, int p2) { return p1 << p2; }
void fn2() {
  char c;
  short d, e;
  int k[a];
  c = k;
  d = fn1(c && 1, 2);
  e = 9 >> d;
  b = 9 | e;
}

-- 
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/20170813/651babde/attachment.html>


More information about the llvm-bugs mailing list