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 905 - [instcombine] assertion error (Invalid structure index) with empty struct
Summary: [instcombine] assertion error (Invalid structure index) with empty struct
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Scalar Optimizations (show other bugs)
Version: 1.0
Hardware: All All
: P release blocker
Assignee: Chris Lattner
URL:
Keywords: compile-fail
Depends on:
Blocks:
 
Reported: 2006-09-11 14:07 PDT by Eric van Riet Paap
Modified: 2018-11-07 00:17 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments
bugpoint reduced bytecode (731 bytes, application/octet-stream)
2006-09-11 14:09 PDT, Eric van Riet Paap
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric van Riet Paap 2006-09-11 14:07:07 PDT
While working on emplementing some new feature in PyPy's LLVM backend (garbage collection 
framework) we encountered a blocker. I've ran bugpoint on it and it came with a rather small reduced 
case, which I have attached. The traceback I get is this:....

opt: Type.cpp:375: virtual const llvm::Type* llvm::StructType::getTypeAtIndex(const llvm::Value*) const: 
Assertion `indexValid(V) && "Invalid structure index!"' failed.
/home/ericvrp/projects/llvm/Release/bin/opt((anonymous 
namespace)::PrintStackTrace()+0x1f)[0x83c7e0f]/lib/libc.so.6(abort+0xeb)[0xb7dc30f3]
/lib/libc.so.6(__assert_fail+0xeb)[0xb7dbb4af]
/home/ericvrp/projects/llvm/Release/bin/opt(llvm::StructType::getTypeAtIndex(llvm::Value const*) 
const+0x6a)[0x837b1fa]
./crash.sh: line 1: 21353 Aborted                 ~/projects/llvm/Release/bin/opt bugpoint-reduced-
simplified.bc -instcombine
Comment 1 Eric van Riet Paap 2006-09-11 14:09:35 PDT
Created attachment 383 [details]
bugpoint reduced bytecode

run with: opt bugpoint-reduced-simplified.bc -instcombine
Comment 2 Chris Lattner 2006-09-11 16:43:56 PDT
Fixed.  Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060911/037721.html

Testcase here:
Transforms/InstCombine/2006-09-11-EmptyStructCrash.ll

-Chris
Comment 3 Eric van Riet Paap 2006-09-11 16:58:53 PDT
great job! very fast response! thank you