[llvm-bugs] [Bug 35258] New: Compiler crash

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 8 19:50:38 PST 2017


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

            Bug ID: 35258
           Summary: Compiler crash
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ishiura-compiler at ml.kwansei.ac.jp
                CC: llvm-bugs at lists.llvm.org

Created attachment 19390
  --> https://bugs.llvm.org/attachment.cgi?id=19390&action=edit
error program

LLVM + clang 6.0 for x86_64 ICEs on the following code.

% cat test.c
int a = 1;
int b = 1;
int c = 1;
int d;
int e;

int main (void)
{
  volatile int f = 0;
  volatile int g = 1;
  volatile int h;
  int i = 0;

  if(g) {
    h = a%g;
    d = f%b;
    h = f;
    h = 1;
    h = f;
    h = f;
    h = f/g;
    h = f;
    h = f;
    e = 0;
    i = c%g;
    h = f;
    d = f%b;
  }
  if (i != 0) __builtin_abort();
  return 0;
}

% clang-6.0 test.c -O1
#0 0x0000000001e301ba llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/bin/clang-6.0+0x1e301ba)
#1 0x0000000001e2e2ae llvm::sys::RunSignalHandlers()
(/usr/local/bin/clang-6.0+0x1e2e2ae)
#2 0x0000000001e2e3fc SignalHandler(int) (/usr/local/bin/clang-6.0+0x1e2e3fc)
#3 0x00007f1cc387c390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x0000000002660658 llvm::InstrEmitter::getVR(llvm::SDValue,
llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>,
llvm::detail::DenseMapPair<llvm::SDValue, unsigned int> >&)
(/usr/local/bin/clang-6.0+0x2660658)
#5 0x00000000026606ea
llvm::InstrEmitter::AddRegisterOperand(llvm::MachineInstrBuilder&,
llvm::SDValue, unsigned int, llvm::MCInstrDesc const*,
llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>,
llvm::detail::DenseMapPair<llvm::SDValue, unsigned int> >&, bool, bool, bool)
(/usr/local/bin/clang-6.0+0x26606ea)
#6 0x0000000002661048
llvm::InstrEmitter::AddOperand(llvm::MachineInstrBuilder&, llvm::SDValue,
unsigned int, llvm::MCInstrDesc const*, llvm::DenseMap<llvm::SDValue, unsigned
int, llvm::DenseMapInfo<llvm::SDValue>,
llvm::detail::DenseMapPair<llvm::SDValue, unsigned int> >&, bool, bool, bool)
(/usr/local/bin/clang-6.0+0x2661048)
#7 0x000000000266401a llvm::InstrEmitter::EmitMachineNode(llvm::SDNode*, bool,
bool, llvm::DenseMap<llvm::SDValue, unsigned int,
llvm::DenseMapInfo<llvm::SDValue>, llvm::detail::DenseMapPair<llvm::SDValue,
unsigned int> >&) (/usr/local/bin/clang-6.0+0x266401a)
#8 0x0000000002658741
llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::MachineInstrBundleIterator<llvm::MachineInstr,
false>&) (/usr/local/bin/clang-6.0+0x2658741)
#9 0x00000000025e0ebe llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/usr/local/bin/clang-6.0+0x25e0ebe)
#10 0x00000000025eaceb
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/usr/local/bin/clang-6.0+0x25eaceb)
#11 0x00000000025ec8a7
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/usr/local/bin/clang-6.0+0x25ec8a7)
#12 0x00000000012521e4 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/usr/local/bin/clang-6.0+0x12521e4)
#13 0x000000000168e9b1
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/local/bin/clang-6.0+0x168e9b1)
#14 0x00000000019599ea llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/bin/clang-6.0+0x19599ea)
#15 0x0000000001959a93 llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/local/bin/clang-6.0+0x1959a93)
#16 0x00000000019595a4 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/bin/clang-6.0+0x19595a4)
#17 0x0000000001fe8335 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> >)
(/usr/local/bin/clang-6.0+0x1fe8335)
#18 0x000000000269ee34
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/bin/clang-6.0+0x269ee34)
#19 0x0000000002a1f258 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/bin/clang-6.0+0x2a1f258)
#20 0x000000000269e417 clang::CodeGenAction::ExecuteAction()
(/usr/local/bin/clang-6.0+0x269e417)
#21 0x000000000237a57e clang::FrontendAction::Execute()
(/usr/local/bin/clang-6.0+0x237a57e)
#22 0x0000000002347a16
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/bin/clang-6.0+0x2347a16)
#23 0x000000000240bb32
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/bin/clang-6.0+0x240bb32)
#24 0x0000000000972108 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/bin/clang-6.0+0x972108)
#25 0x00000000008ed81a main (/usr/local/bin/clang-6.0+0x8ed81a)
#26 0x00007f1cc25d9830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#27 0x000000000096fb69 _start (/usr/local/bin/clang-6.0+0x96fb69)
Stack dump:
0.      Program arguments: /usr/local/bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name test.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
/usr/local/lib/clang/6.0.0 -internal-isystem /usr/local/include
-internal-isystem /usr/local/lib/clang/6.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O1 -fdebug-compilation-dir /home/maeda
-ferror-limit 19 -fmessage-length 169 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/test-995470.o -x c test.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'test.c'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'
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 6.0.0 (trunk 317078)
Target: x86_64-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/test-289d45.c
clang-6.0: note: diagnostic msg: /tmp/test-289d45.sh
clang-6.0: note: diagnostic msg:

********************
% clang-6.0 -v
clang version 6.0.0 (trunk 317078)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
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

-- 
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/20171109/004323d1/attachment.html>


More information about the llvm-bugs mailing list