[LLVMbugs] [Bug 14379] New: Buggy phi instruction crashes opt, lli, llc, but not llvm-as.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 19 01:01:13 PST 2012


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

             Bug #: 14379
           Summary: Buggy phi instruction crashes opt, lli, llc, but not
                    llvm-as.
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: kunshan.wang at anu.edu.au
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9567
  --> http://llvm.org/bugs/attachment.cgi?id=9567
Crasher code.

LLVM version: SVN trunk version. Cloned from the git mirror.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168294
91177308-0d34-0410-b5e6-96231b3b80d8

The attached crasher.ll has a bug, but will crash some llvm command-line tools.

How to reproduce:

1. Download the attached crasher.ll

2. Compile the SVN version of llvm.

3. Go to the generated bin directory.

./opt -S /path/to/crasher.ll

Then opt prints:

============================================= FROM opt ======
PHI node entries do not match predecessors!
  %x = phi i32 [ 1, %entry ], [ 2, %lab2 ]
label %lab2
label %lab3
Broken module found, compilation aborted!
0  opt             0x0000000001655c71
1  opt             0x000000000165594a
2  libpthread.so.0 0x00007fc53f303cb0
3  libc.so.6       0x00007fc53e756425 gsignal + 53
4  libc.so.6       0x00007fc53e759b8b abort + 379
5  opt             0x0000000001581def
6  opt             0x0000000001581b33
7  opt             0x000000000155fb62
llvm::FPPassManager::runOnFunction(llvm::Function&) + 380
8  opt             0x000000000155fd62
llvm::FPPassManager::runOnModule(llvm::Module&) + 102
9  opt             0x0000000001560045
llvm::MPPassManager::runOnModule(llvm::Module&) + 397
10 opt             0x00000000015606e8 llvm::PassManagerImpl::run(llvm::Module&)
+ 120
11 opt             0x000000000156088f llvm::PassManager::run(llvm::Module&) +
39
12 opt             0x000000000088a578 main + 5614
13 libc.so.6       0x00007fc53e74176d __libc_start_main + 237
14 opt             0x000000000087a0e9
Stack dump:
0.      Program arguments: ./opt -S /home/wks/code/llvm-junks/crasher.ll 
1.      Running pass 'Function Pass Manager' on module
'/home/wks/code/llvm-junks/crasher.ll'.
2.      Running pass 'Module Verifier' on function '@crasher'
Aborted (core dumped)
============================================= END FROM opt ==

Using llc and lli also results in core-dump. But llvm-as can indicate the error
in crasher.ll without crashing itself.

./llvm-as /path/to/crasher.ll -o crasher.bc

============================================= FROM llvm-as ======
./llvm-as: assembly parsed, but does not verify as correct!
PHI node entries do not match predecessors!
  %x = phi i32 [ 1, %entry ], [ 2, %lab2 ]
label %lab2
label %lab3
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
============================================= END FROM llvm-as ==

-- 
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