<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - PHINode containing itself causes segfault in LLVM when compiling Blender OpenCL kernel with R600 backend"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=84232#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - PHINode containing itself causes segfault in LLVM when compiling Blender OpenCL kernel with R600 backend"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=84232">bug 84232</a>
              from <span class="vcard"><a class="email" href="mailto:vitalif@yourcmc.ru" title="Vitaliy Filippov <vitalif@yourcmc.ru>"> <span class="fn">Vitaliy Filippov</span></a>
</span></b>
        <pre>Hm, I've tried to reproduce your testcase and got another bug:

int main()
{
  int i;
  for (i = 0; i < 100; i++)
  {
    if (!(i%10))
    {
      i = i%50;
      if (i%2 == 0)
        break;
    }
  }
  return i;
}

clang-3.5 -S -emit-llvm test.c
llc-3.5 -march=r600 -mcpu=oland test.ll 

<span class="quote">>>>></span >

Program received signal SIGSEGV, Segmentation fault.
llvm::BasicBlock::getTerminator (this=0x471f08) at
/var/home/vitali/setup/llvm/llvm-toolchain-3.5-3.5/lib/IR/BasicBlock.cpp:126
126       return dyn_cast<TerminatorInst>(&InstList.back());
(gdb) bt
#0  llvm::BasicBlock::getTerminator (this=0x471f08) at
/var/home/vitali/setup/llvm/llvm-toolchain-3.5-3.5/lib/IR/BasicBlock.cpp:126
#1  0x00007ffff7442c9a in (anonymous
namespace)::SIAnnotateControlFlow::handleLoopCondition
(this=this@entry=0x44c960, Cond=0x471eb0, Broken=Broken@entry=
    0x486a50) at
/var/home/vitali/setup/llvm/llvm-toolchain-3.5-3.5/lib/Target/R600/SIAnnotateControlFlow.cpp:271
#2  0x00007ffff7443d6c in handleLoop (Term=0x486af8, this=0x44c960)
    at
/var/home/vitali/setup/llvm/llvm-toolchain-3.5-3.5/lib/Target/R600/SIAnnotateControlFlow.cpp:288
#3  (anonymous namespace)::SIAnnotateControlFlow::runOnFunction (this=0x44c960,
F=...)
    at
/var/home/vitali/setup/llvm/llvm-toolchain-3.5-3.5/lib/Target/R600/SIAnnotateControlFlow.cpp:325
#4  0x00007ffff662a3d7 in llvm::FPPassManager::runOnFunction (this=0x43e930,
F=...)
    at
/var/home/vitali/setup/llvm/llvm-toolchain-3.5-3.5/lib/IR/LegacyPassManager.cpp:1545
#5  0x00007ffff662a45b in llvm::FPPassManager::runOnModule (this=0x43e930,
M=...)
    at
/var/home/vitali/setup/llvm/llvm-toolchain-3.5-3.5/lib/IR/LegacyPassManager.cpp:1565
#6  0x00007ffff662ce19 in runOnModule (M=..., this=0x431140) at
/var/home/vitali/setup/llvm/llvm-toolchain-3.5-3.5/lib/IR/LegacyPassManager.cpp:1623
#7  llvm::legacy::PassManagerImpl::run (this=0x430e50, M=...) at
/var/home/vitali/setup/llvm/llvm-toolchain-3.5-3.5/lib/IR/LegacyPassManager.cpp:1730
#8  0x0000000000411a11 in ?? ()
#9  0x000000000040cd98 in main ()</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>