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

            Bug ID: 15417
           Summary: small code triggers assert with un-constant-foldable
                    extractvalue
           Product: libraries
           Version: 3.2
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

The following code is a (contrived) example of a use of a constant extractvalue
which cannot be constant folded. It triggers an assert in code which can only
handle cases it can fold. Under similar circumstances, other constant
expression cases fall back to building unfolded constants. Perhaps extractvalue
should do something similar. 

@0 = global i8 extractvalue ([1 x i8] select (i1 ptrtoint (i32* @1 to i1), [1 x
i8] [ i8 1 ], [1 x i8] [ i8 2 ]), 0)
@1 = external global i32

Assertion failed: (FC && "ExtractValue constant expr couldn't be folded!"),
function getExtractValue, file Constants.cpp, line 1926

This case is contrived. I concocted it (and other cases like it which work for
other constant expressions) deliberately not to constant fold. As such it might
be considered lower priority, depending on how you prioritize such things. On
the other hand less contrived examples may exist.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to