<html>
    <head>
      <base href="https://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 --- - crash at -Os in 32-bit and 64-bit mode on x86_64-linux-gnu (`L->isRecursivelyLCSSAForm(*DT) && "LCSSA required to run indvars!"')"
   href="https://llvm.org/bugs/show_bug.cgi?id=28048">28048</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>crash at -Os in 32-bit and 64-bit mode on x86_64-linux-gnu (`L->isRecursivelyLCSSAForm(*DT) && "LCSSA required to run indvars!"')
          </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>Windows NT
          </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>chengniansun@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$: clang-trunk -v
clang version 3.9.0 (trunk 271696)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
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.3.0
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$: 
$: clang-trunk -Os small.c
clang-3.9:
/tmp/llvm-builder/llvm-source-trunk/lib/Transforms/Scalar/IndVarSimplify.cpp:2105:
bool {anonymous}::IndVarSimplify::run(llvm::Loop*): Assertion
`L->isRecursivelyLCSSAForm(*DT) && "LCSSA required to run indvars!"' failed.
0  clang-3.9       0x0000000001c42545
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  clang-3.9       0x0000000001c402f6 llvm::sys::RunSignalHandlers() + 54
2  clang-3.9       0x0000000001c40521
3  libpthread.so.0 0x00007fd5aaf75340
4  libc.so.6       0x00007fd5aa193cc9 gsignal + 57
5  libc.so.6       0x00007fd5aa1970d8 abort + 328
6  libc.so.6       0x00007fd5aa18cb86
7  libc.so.6       0x00007fd5aa18cc32
8  clang-3.9       0x0000000001af8693
9  clang-3.9       0x00000000024b7157
llvm::LPPassManager::runOnFunction(llvm::Function&) + 1431
10 clang-3.9       0x00000000018d4463
llvm::FPPassManager::runOnFunction(llvm::Function&) + 643
11 clang-3.9       0x0000000002497d70
12 clang-3.9       0x00000000018d4b2f
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 751
13 clang-3.9       0x0000000001d79938
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*) + 3640
14 clang-3.9       0x0000000002398936
15 clang-3.9       0x00000000026d806b clang::ParseAST(clang::Sema&, bool, bool)
+ 571
16 clang-3.9       0x0000000002398cfe clang::CodeGenAction::ExecuteAction() +
78
17 clang-3.9       0x000000000207c066 clang::FrontendAction::Execute() + 518
18 clang-3.9       0x000000000205772e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 318
19 clang-3.9       0x0000000002100fac
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2300
20 clang-3.9       0x0000000000a0cf98 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 2296
21 clang-3.9       0x00000000009c0778 main + 6456
22 libc.so.6       0x00007fd5aa17eec5 __libc_start_main + 245
23 clang-3.9       0x0000000000a08f54
Stack dump:
0.    Program arguments: /usr/local/clang-trunk/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/3.9.0 -c-isystem . -c-isystem
/usr/local/include/csmith -internal-isystem /usr/local/include
-internal-isystem /usr/local/clang-trunk/bin/../lib/clang/3.9.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -Os
-fdebug-compilation-dir
/home/cnsun/ramdisk/reduction/20160607-clang-trunk-m64-g-O3-build-145239/delta-first
-ferror-limit 19 -fmessage-length 132 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-97277d.o -x c small.c 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'CallGraph Pass Manager' on module 'small.c'.
4.    Running pass 'Loop Pass Manager' on function '@main'
5.    Running pass 'Induction Variable Simplification' on basic block
'%for.cond'
clang-3.9: error: unable to execute command: Aborted (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 271696)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-3.9: 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.
clang-3.9: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/small-ba2e74.c
clang-3.9: note: diagnostic msg: /tmp/small-ba2e74.sh
clang-3.9: note: diagnostic msg: 

********************
$: 
$: cat small.c
int a[15];
int b, e, h, g;
int main() {
  for (;;) {
    char i = h = 2;
    if (!g) {
      for (e = 0; e < 10; e++)
        a[e] = 1;
      continue;
    }
    for (; b;) {
      for (i = 0; i <= 1; i++) {
        for (; b;) {
          a[i + 2] = h;
          h = 0;
        }
        if (g)
          break;
      }
    }
  }
  return 0;
}
$:</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>