[LLVMbugs] [Bug 12079] New: crash with opaque member
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Feb 25 00:48:19 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=12079
Bug #: 12079
Summary: crash with opaque member
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
AssignedTo: unassignedbugs at nondot.org
ReportedBy: nicholas at mxc.ca
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Testcase 1:
%struct.B = type opaque
%struct.A = type {i32, %struct.B, i8}
define i32* @test(%struct.A* %x) {
%A = bitcast %struct.A* %x to i32*
ret i32* %A
}
and testcase 2:
%struct.B = type opaque
%struct.A = type {i32, %struct.B, i8}
@gv = global %struct.A zeroinitializer
define i32* @test() {
%A = bitcast %struct.A* @gv to i32*
ret i32* %A
}
both crash trying to build a getelementptr, the first in instcombine and the
second in early-cse (in inst-simplify, in constant folding).
Are all-zero GEPs supposed to be valid on partially-opaque types? Is that type
supposed to be rejected? If you use %struct.B for the test then you'll find
that it stays a bitcast (instruction or constant expression) thus avoiding the
crash. Should that logic be extended?
--
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