[LLVMbugs] [Bug 9218] New: malformed program causes infinite loop in InstCombiner

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 14 08:58:35 PST 2011


           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: unassignedbugs at nondot.org
        ReportedBy: matt at pharr.org
                CC: llvmbugs at cs.uiuc.edu

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.

More information about the llvm-bugs mailing list