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

           Summary: malformed program causes infinite loop in InstCombiner
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Given this (simplified from the original and thus sort of nonsensical) code:

%vec2x2 = type { <2 x double>, <2 x double> }

define %vec2x2 @__split(double) nounwind alwaysinline {
  %vba = insertelement <2 x double> undef, double %0, i32 2
  ret <2 x double> %vba, <2 x double> %vba
}

If I run opt on it as follows:

% ~/llvm-dev/bin/opt -O3 bug.ll -o /dev/null

I get an infinite loop (or at least an extremely long runtime); the stack
suggests that it's gotten stuck in InstCombiner.

Note that the insertelement instruction is trying to insert into offset 2 of a
2 element vector--i.e. it's out of bounds.  If I change that "i32 2" to "i32
1", then it runs fine.

Beyond fixing the issue in InstCombiner, it would probably be nice to have the
verifier note this error; if I run opt with just -verify, it doesn't issue any
errors for this code.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to