<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Compiler crash"
   href="https://bugs.llvm.org/show_bug.cgi?id=36143">36143</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Compiler crash
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ishiura-compiler@ml.kwansei.ac.jp
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19770" name="attach_19770" title="program and script">attachment 19770</a> <a href="attachment.cgi?id=19770&action=edit" title="program and script">[details]</a></span>
program and script

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

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

int main (void)
{
  int e = 1;
  volatile int v = 1;
  int f = 3/(a&&e+1)+b+b+v+v+v+v+v+v+v+v+v+v+v+v+v+v+v+v+(c/v)+(v/a);
  if (f != 23) __builtin_abort();
  return 0;
}

% clang-7.0 test.c -O1
#0 0x0000000001eeec0a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x1eeec0a)
#1 0x0000000001eeccee llvm::sys::RunSignalHandlers()
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x1eeccee)
#2 0x0000000001eece3c SignalHandler(int)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x1eece3c)
#3 0x00007f866c5c7390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x000000000177bcab llvm::MachineRegisterInfo::constrainRegClass(unsigned
int, llvm::TargetRegisterClass const*, unsigned int)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x177bcab)
#5 0x000000000275e967
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)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x275e967)
#6 0x000000000275f098
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)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x275f098)
#7 0x000000000276203a llvm::InstrEmitter::EmitMachineNode(llvm::SDNode*, bool,
bool, llvm::DenseMap<llvm::SDValue, unsigned int,
llvm::DenseMapInfo<llvm::SDValue>, llvm::detail::DenseMapPair<llvm::SDValue,
unsigned int> >&) (/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x276203a)
#8 0x0000000002756791
llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::MachineInstrBundleIterator<llvm::MachineInstr,
false>&) (/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x2756791)
#9 0x00000000026de03e llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x26de03e)
#10 0x00000000026e7af3
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x26e7af3)
#11 0x00000000026e98bb
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x26e98bb)
#12 0x00000000012cd154 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x12cd154)
#13 0x00000000017201c1
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x17201c1)
#14 0x00000000019fe32a llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x19fe32a)
#15 0x00000000019fe3d3 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x19fe3d3)
#16 0x00000000019fdee4 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x19fdee4)
#17 0x00000000020bc24e (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x20bc24e)
#18 0x00000000020be332 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/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x20be332)
#19 0x000000000279d084
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x279d084)
#20 0x0000000002b54da8 clang::ParseAST(clang::Sema&, bool, bool)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x2b54da8)
#21 0x000000000279c667 clang::CodeGenAction::ExecuteAction()
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x279c667)
#22 0x000000000246cb3e clang::FrontendAction::Execute()
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x246cb3e)
#23 0x00000000024381e6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x24381e6)
#24 0x00000000024ff5c2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x24ff5c2)
#25 0x0000000000991558 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x991558)
#26 0x0000000000906627 main
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x906627)
#27 0x00007f866b324830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#28 0x000000000098eaa9 _start
(/home/hiroki-maeda/opt/clang-7.0/bin/clang-7.0+0x98eaa9)
Stack dump:
0.      Program arguments: /home/hiroki-maeda/opt/clang-7.0/bin/clang-7.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
/home/hiroki-maeda/opt/clang-7.0/lib/clang/7.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/hiroki-maeda/opt/clang-7.0/lib/clang/7.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/hiroki-maeda/expression/20180122-141020/MINI
-ferror-limit 19 -fmessage-length 80 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/test-33a10d.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-7.0: error: unable to execute command: Segmentation fault (core dumped)
clang-7.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (trunk 323624)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/hiroki-maeda/opt/clang-7.0/bin
clang-7.0: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang-7.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-7.0: note: diagnostic msg: /tmp/test-878d8f.c
clang-7.0: note: diagnostic msg: /tmp/test-878d8f.sh
clang-7.0: note: diagnostic msg:

********************
% clang-7.0 -v
clang version 7.0.0 (trunk 323624)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/hiroki-maeda/opt/clang-7.0/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.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
Selected multilib: .;@m64</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>