LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 977 - LCSSA code crash on unreachable block.
Summary: LCSSA code crash on unreachable block.
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Transformation Utilities (show other bugs)
Version: trunk
Hardware: All All
: P normal
Assignee: Chris Lattner
URL:
Keywords: compile-fail
Depends on:
Blocks:
 
Reported: 2006-10-31 11:34 PST by John T. Criswell
Modified: 2010-02-22 12:48 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments
Test case reduced from net/network.o from Linux 2.4.22 (41.53 KB, text/plain)
2006-10-31 11:35 PST, John T. Criswell
Details
New testcase for similar problem (27.22 KB, text/plain)
2006-10-31 12:42 PST, John T. Criswell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John T. Criswell 2006-10-31 11:34:09 PST
When run on the attached test case, the opt tool crases from a SEGFAULT. 
Initial investigation shows that LCSSA::GetValueForBlock is being passed a NULL
pointer for the BB operand and attempts to dereference it.
Comment 1 John T. Criswell 2006-10-31 11:35:31 PST
Created attachment 429 [details]
Test case reduced from net/network.o from Linux 2.4.22

The crash can be reproduced as follows:

llvm-as bugpoint-reduced-simplified.ll
opt -loop-unroll bugpoint-reduced-simplified.bc
Comment 2 Chris Lattner 2006-10-31 11:53:24 PST
Fixed, patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061030/039276.html

Testcase here:
Transforms/LCSSA/2006-10-31-UnreachableBlock.ll

Thanks,

-Chris
Comment 3 John T. Criswell 2006-10-31 12:42:34 PST
Created attachment 430 [details]
New testcase for similar problem

This is another testcase from the Linux 2.4.22 kernel (drivers/char/char.o).
Comment 4 John T. Criswell 2006-10-31 12:43:04 PST
Chris,

I believe the new testcase is another form of the same bug.
Comment 5 Chris Lattner 2006-10-31 12:57:25 PST
Fixed.  Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061030/039278.html

Testcase here:
Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll

-Chris