[LLVMbugs] [Bug 7318] New: opt assertion failure after doing a simple loop unroll

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 8 11:58:25 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7318

           Summary: opt assertion failure after doing a simple loop unroll
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jgu222 at gmail.com
                CC: llvmbugs at cs.uiuc.edu


A simple program (below) had an assertin when using opt -O3 -unroll-count=2.
Without -unroll-count=2, opt compiled fine.
I am using TOT llvm-gcc/llvm (6/7/2010).

%opt -version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.8svn
  DEBUG build with assertions.
  Built Jun  2 2010 (14:55:38).
  Host: x86_64-unknown-linux-gnu
  Host CPU: penryn

  Registered Targets:
    (none)

% llvm-gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../llvm-gcc-4.2/configure --prefix=/work/llvm_commit/install64
--enable-checking --disable-multilib --program-prefix=llvm-
--enable-llvm=/work/llvm_commit/llvm_obj64 --disable-bootstrap
--enable-languages=c,c++ : (reconfigured) ../llvm-gcc-4.2/configure
--prefix=/work/llvm_commit/install64 --enable-checking --disable-multilib
--program-prefix=llvm- --enable-llvm=/work/llvm_commit/llvm_obj64
--disable-bootstrap --enable-languages=c,c++ --no-create --no-recursion :
(reconfigured) ../llvm-gcc-4.2/configure --prefix=/work/llvm_commit/install64
--enable-checking --disable-multilib --program-prefix=llvm-
--enable-llvm=/work/llvm_commit/llvm_obj64 --disable-bootstrap
--enable-languages=c,c++ --no-create --no-recursion
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build)

-------------------------------------

%cat b.c
int foo (int *p, int n)
{
  int s=0, i;

  for(i=0; i < n; ++i) {
    s += p[i];
  }
  return s;
}

%llvm-gcc -c b.c --emit-llvm

%opt -O3 -unroll-count=2 b.bc -o out.bc
Instruction does not dominate all uses!
  %4 = add nsw i32 %3, %2                         ; <i32> [#uses=3]
  %s.0.lcssa = phi i32 [ 0, %entry ], [ %4, %bb.1 ], [ %4, %bb ] ; <i32>
[#uses=1]
Instruction does not dominate all uses!
  %s.0.lcssa = phi i32 [ 0, %entry ], [ %4, %bb.1 ], [ %4, %bb ] ; <i32>
[#uses=1]
  ret i32 %s.0.lcssa
Broken module found, compilation aborted!
0  opt             0x0000000000c1685c
1  opt             0x0000000000c16720
2  libpthread.so.0 0x00007f60e23f2190
3  libc.so.6       0x00007f60e16f74b5 gsignal + 53
4  libc.so.6       0x00007f60e16faf50 abort + 384
5  opt             0x0000000000bb58b9
6  opt             0x0000000000bb55d0
7  opt             0x0000000000b8ac7f
llvm::FPPassManager::runOnFunction(llvm::Function&) + 405
8  opt             0x0000000000b8ae9c
llvm::FPPassManager::runOnModule(llvm::Module&) + 102
9  opt             0x0000000000b8b1cf
llvm::MPPassManager::runOnModule(llvm::Module&) + 459
10 opt             0x0000000000b8b70f llvm::PassManagerImpl::run(llvm::Module&)
+ 125
11 opt             0x0000000000b8bc1b llvm::PassManager::run(llvm::Module&) +
39
12 opt             0x00000000007b8eb5 main + 3597
13 libc.so.6       0x00007f60e16e2abd __libc_start_main + 253
14 opt             0x00000000007aa789
Stack dump:
0.    Program arguments: opt -O3 -unroll-count=2 b.bc -o out.bc 
1.    Running pass 'Function Pass Manager' on module 'b.bc'.
2.    Running pass 'Module Verifier' on function '@foo'
Aborted (core dumped)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list