<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - Infinite loop at -O2"
   href="http://llvm.org/bugs/show_bug.cgi?id=16067">16067</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Infinite loop at -O2
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>antoine.balestrat@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>baldrick@free.fr, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>LLVM/Clang 3.4 as of r182207 fails to compile the following testcase at -O2.
This reminds me of the testcase of PR13021, but since the related pass is
supposed to be disabled, I'm filling a new bug report.

$ cat inf.c
int a;

void f(void)
{
    int i;

    while(a)
        for(i = 0; i < 32; i++)
            a *= a;
}

$ ulimit -t 30

$ clong -w -O2 inf.c
0  clang           0x0000000001a384f5 llvm::sys::PrintStackTrace(_IO_FILE*) +
37
1  clang           0x0000000001a389e3
2  libpthread.so.0 0x0000003000c10910
3  libc.so.6       0x000000300048d374
4  libc.so.6       0x000000300048725d
5  clang           0x00000000018c6d5e
6  clang           0x00000000018c683f
7  clang           0x00000000018c6729
8  clang           0x00000000018b13b9
9  clang           0x00000000018a81e0
llvm::ScalarEvolution::getMulExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&,
llvm::SCEV::NoWrapFlags) + 464
10 clang           0x00000000018a850f
llvm::ScalarEvolution::getMulExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&,
llvm::SCEV::NoWrapFlags) + 1279
11 clang           0x00000000018b53d6
llvm::ScalarEvolution::createSCEV(llvm::Value*) + 3094
12 clang           0x00000000018b40ef
llvm::ScalarEvolution::getSCEV(llvm::Value*) + 143
13 clang           0x00000000018b4bc5
llvm::ScalarEvolution::createSCEV(llvm::Value*) + 1029
14 clang           0x00000000018b40ef
llvm::ScalarEvolution::getSCEV(llvm::Value*) + 143
15 clang           0x00000000018b4bc5
llvm::ScalarEvolution::createSCEV(llvm::Value*) + 1029
16 clang           0x00000000018b40ef
llvm::ScalarEvolution::getSCEV(llvm::Value*) + 143
17 clang           0x00000000018b4bc5
llvm::ScalarEvolution::createSCEV(llvm::Value*) + 1029
18 clang           0x00000000018b40ef
llvm::ScalarEvolution::getSCEV(llvm::Value*) + 143
19 clang           0x00000000018b4bc5
llvm::ScalarEvolution::createSCEV(llvm::Value*) + 1029
20 clang           0x00000000018b40ef
llvm::ScalarEvolution::getSCEV(llvm::Value*) + 143
21 clang           0x00000000018b4bc5
llvm::ScalarEvolution::createSCEV(llvm::Value*) + 1029
87 clang           0x00000000018b40ef
llvm::ScalarEvolution::getSCEV(llvm::Value*) + 143
88 clang           0x00000000018b4bc5
llvm::ScalarEvolution::createSCEV(llvm::Value*) + 1029
89 clang           0x00000000018b40ef
llvm::ScalarEvolution::getSCEV(llvm::Value*) + 143
90 clang           0x00000000018b4bc5
llvm::ScalarEvolution::createSCEV(llvm::Value*) + 1029
91 clang           0x00000000018b40ef
llvm::ScalarEvolution::getSCEV(llvm::Value*) + 143
92 clang           0x00000000018b4bc5
llvm::ScalarEvolution::createSCEV(llvm::Value*) + 1029
93 clang           0x00000000018b40ef
llvm::ScalarEvolution::getSCEV(llvm::Value*) + 143
94 clang           0x00000000018baac9
llvm::ScalarEvolution::ComputeExitLimitFromICmp(llvm::Loop const*,
llvm::ICmpInst*, llvm::BasicBlock*, llvm::BasicBlock*) + 
345
95 clang           0x00000000018ba40f
llvm::ScalarEvolution::ComputeExitLimitFromCond(llvm::Loop const*,
llvm::Value*, llvm::BasicBlock*, llvm::BasicBlock*) + 
591
96 clang           0x00000000018ba116
llvm::ScalarEvolution::ComputeExitLimit(llvm::Loop const*, llvm::BasicBlock*) +
550
97 clang           0x00000000018b935a
llvm::ScalarEvolution::ComputeBackedgeTakenCount(llvm::Loop const*) + 250
98 clang           0x00000000018b8b8d
llvm::ScalarEvolution::getBackedgeTakenInfo(llvm::Loop const*) + 269
99 clang           0x00000000018b9169
llvm::ScalarEvolution::getBackedgeTakenCount(llvm::Loop const*) + 9
100 clang           0x00000000016a7f7a
101 clang           0x0000000001863360
llvm::LPPassManager::runOnFunction(llvm::Function&) + 784
102 clang           0x00000000019e029c
llvm::FPPassManager::runOnFunction(llvm::Function&) + 364
103 clang           0x00000000017e7155
104 clang           0x00000000019e086e
llvm::MPPassManager::runOnModule(llvm::Module&) + 430
105 clang           0x00000000019e0dbb
llvm::PassManagerImpl::run(llvm::Module&) + 203
106 clang           0x00000000019e0f3a llvm::PassManager::run(llvm::Module&) +
10
107 clang           0x00000000007c67e0
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, 
clang::LangOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 6016
108 clang           0x00000000007c4303
109 clang           0x00000000008f7223 clang::ParseAST(clang::Sema&, bool,
bool) + 515
110 clang           0x00000000007c3732 clang::CodeGenAction::ExecuteAction() +
530
111 clang           0x0000000000664881 clang::FrontendAction::Execute() + 113
112 clang           0x00000000006449ad
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 957
113 clang           0x000000000062b770
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3760
114 clang           0x0000000000622ab7 cc1_main(char const**, char const**,
char const*, void*) + 663
115 clang           0x00000000006289f8 main + 6440
116 libc.so.6       0x0000003000424985 __libc_start_main + 245
117 clang           0x000000000062275d
Stack dump:
0.    Program arguments: /home/merkil/git/clang/build/Release+Asserts/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name 
inf.c -mrelocation-model static -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-linker-version 
2.23.1 -momit-leaf-frame-pointer -resource-dir
/home/merkil/git/clang/build/Release+Asserts/bin/../lib/clang/3.4
-internal-isystem /usr/local/include 
-internal-isystem
/home/merkil/git/clang/build/Release+Asserts/bin/../lib/clang/3.4/include
-internal-externc-isystem /include -internal-externc-isystem 
/usr/include -O2 -w -fdebug-compilation-dir /home/merkil -ferror-limit 19
-fmessage-length 169 -mstackrealign -fobjc-runtime=gcc 
-fobjc-default-synthesize-properties -fdiagnostics-show-option
-fcolor-diagnostics -backend-option -vectorize-loops -o /tmp/inf-APH9cF.o -x c
inf.c 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'CallGraph Pass Manager' on module 'inf.c'.
4.    Running pass 'Loop Pass Manager' on function '@f'
5.    Running pass 'Induction Variable Simplification' on basic block
'%for.cond.preheader'
clang: error: unable to execute command: CPU time limit exceeded
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (trunk 182207)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.</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>