[LLVMbugs] [Bug 6577] New: Assertion `Emitted && "Unable to issue a copy instruction!\n"'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 10 19:02:51 PST 2010


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

           Summary: Assertion `Emitted && "Unable to issue a copy
                    instruction!\n"'
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ddneff at hotmail.com
                CC: llvmbugs at cs.uiuc.edu


I am getting an assertion when jitting the code below on x86_64 linux compiled
with gcc 4.3.2.  It looks like one of the registers is GR64 and the other is
FR64.  The instruction looks like a conditional move.  The LLVM assembly passes
through the verifier correctly (at least before I started stripping stuff out
to make it a bit more manageable for the bug).

/lib/CodeGen/SelectionDAG/InstrEmitter.cpp:292: void
llvm::InstrEmitter::AddRegisterOperand(llvm::MachineInstr*, llvm::SDValue,
unsigned int, const llvm::TargetInstrDesc*, llvm::DenseMap<llvm::SDValue,
unsigned int, llvm::DenseMapInfo<llvm::SDValue>, llvm::DenseMapInfo<unsigned
int> >&): Assertion `Emitted && "Unable to issue a copy instruction!\n"'
failed.
Stack dump:
0.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@on4'
Aborted

Here is the llvm assembly, which was stripped down from a significantly larger
program to just the offending function:

; ModuleID = 'Q'

%0 = type { i384, i64, i64, i64, i32, i32, i64, i32, i32, i64, i32, i32, i64,
i32, i32, i64, i32, i32, i64, i32, i32, i64, i32, i32, i64, i32, i32, i64, i32,
i32, i64, i32, i32, i64, i32, i32, i64, i64, i64 }
%1 = type { i64, double }
%2 = type { i64, i64, [2 x double] }
%3 = type { i64, i64, [2 x %1] }
%4 = type { double, double, i1, i1 }
%5 = type { %GEvent, i1, double, %1, i64, i1, i1, i1, i1, i1 }
%6 = type { %GEvent, i1, i1, i64, i1, i1, i1, i1 }
%7 = type opaque
%GEvent = type %0*

@global_subject109_151691824 = internal hidden global %1 zeroinitializer
@global_subMeta_0_153989360 = internal hidden global i1 false
@global_subject159_147021872 = internal hidden global double 0.000000e+00
@global_subMeta_1_153989392 = internal hidden global i1 false
@global_subject167_152731376 = internal hidden global i1 false
@global_subMeta_3_153991696 = internal hidden global i1 false
@global_subject203_153263040 = internal hidden global %2 zeroinitializer
@global_subject207_153163808 = internal hidden global %3 zeroinitializer
@global_subject218_153259872.b = internal global i1 false
@global_subMeta_7_153997040 = internal hidden global i1 false
@global_reflex_ticks = internal hidden global i64 0
@.str = internal constant [6 x i8] c"XXXXX\00"
@.str1 = internal constant [52 x i8]
c"XXXX~XXXXXXXX=XXXX~XXXXXX=XXXX~XXXXXXXX=P~XXXXXX=A\00"
@.str2 = internal constant [52 x i8]
cXXXX~XXXXXXXX=XXXX~XXXXXX=XXXX~XXXXXXXX=P~XXXXXX=A\00"
@.str3 = internal constant [26 x i8] c"XXXXX~XXXXXX=XXX~XXXXXXXX\00"
@.str4 = internal constant [49 x i8]
c"XXXXXX-XXXXX~XXXX=XXXXX~XXX-XXXXX=-X~XXX-XXXXX=X\00"


define void @on4(%GEvent %VALUE_0) {
dependentGraph243.exit:
  %0 = alloca %5, align 8
  %1 = alloca %6, align 8
  %subject34_149825680 = alloca %1, align 8
  store %1 zeroinitializer, %1* %subject34_149825680
  %2 = load i64* @global_reflex_ticks
  %3 = add i64 %2, 1
  store i64 %3, i64* @global_reflex_ticks
  %4 = load i1* @global_subMeta_3_153991696
  %5 = load i1* @global_subject167_152731376
  %6 = call %GEvent @OnMerge(%7* inttoptr (i64 154167792 to %7*), %GEvent
%VALUE_0)
  %MyStatusPtr.i = getelementptr inbounds %GEvent %6, i64 0, i32 2
  %MyStatus.i = load i64* %MyStatusPtr.i
  %NewEvent.i = and i64 %MyStatus.i, 1
  %7 = icmp ne i64 %NewEvent.i, 0
  %subject168_146437360.0 = and i1 %4, %5
  %8 = getelementptr inbounds %6* %1, i64 0, i32 0
  store %GEvent %6, %GEvent* %8
  %9 = getelementptr inbounds %6* %1, i64 0, i32 1
  store i1 %7, i1* %9, align 8
  %10 = getelementptr inbounds %6* %1, i64 0, i32 2
  store i1 true, i1* %10
  %11 = getelementptr inbounds %6* %1, i64 0, i32 3
  store i64 1, i64* %11
  %12 = getelementptr inbounds %6* %1, i64 0, i32 4
  store i1 true, i1* %12, align 8
  %13 = getelementptr inbounds %6* %1, i64 0, i32 5
  store i1 true, i1* %13
  %14 = getelementptr inbounds %6* %1, i64 0, i32 6
  store i1 true, i1* %14, align 2
  %15 = getelementptr inbounds %6* %1, i64 0, i32 7
  store i1 true, i1* %15
  %brmerge.demorgan = and i1 %4, %subject168_146437360.0
  %subject16_153602432.0.i = select i1 %7, %GEvent %6, %GEvent null
  store i1 true, i1* @global_subMeta_7_153997040
  store i1 true, i1* @global_subject218_153259872.b
  br i1 %brmerge.demorgan, label %on170.i, label %on231.i

on170.i:                                          ; preds =
%dependentGraph243.exit
  %16 = call i64 @AbsTimeUSec()
  %17 = sitofp i64 %16 to double
  %18 = fmul double %17, 1.000000e-03
  %19 = fptosi double %18 to i64
  br label %on231.i

on231.i:                                          ; preds = %on170.i,
%dependentGraph243.exit
  %20 = phi i64 [ %19, %on170.i ], [ 0, %dependentGraph243.exit ]
  %subMeta_44_154194224.0.i = phi i1 [ true, %on170.i ], [ false,
%dependentGraph243.exit ]
  br i1 %7, label %on204.i, label %dependentGraph240.exit

on204.i:                                          ; preds = %on231.i
  %MyStatusPtr.i28 = getelementptr inbounds %GEvent %subject16_153602432.0.i,
i64 0, i32 2
  %MyStatus.i29 = load i64* %MyStatusPtr.i28
  %NewEvent.i30 = and i64 %MyStatus.i29, 1
  %21 = icmp ne i64 %NewEvent.i30, 0
  %LastPtr.i = getelementptr inbounds %GEvent %subject16_153602432.0.i, i64 0,
i32 33
  %Last.i = load i64* %LastPtr.i
  %DivisorPtr.i = getelementptr inbounds %GEvent %subject16_153602432.0.i, i64
0, i32 1
  %Divisor.i = load i64* %DivisorPtr.i
  %22 = sitofp i64 %Divisor.i to double
  %23 = sitofp i64 %Last.i to double
  %24 = fdiv double %23, %22
  %25 = call i64 @UptimeUSec()
  %26 = load i64* @global_reflex_ticks
  store i64 %26, i64* getelementptr inbounds (%2* @global_subject203_153263040,
i64 0, i32 1)
  %history_element.i31 = load i64* getelementptr inbounds (%2*
@global_subject203_153263040, i64 0, i32 0)
  %27 = add i64 %history_element.i31, 1
  store i64 %27, i64* getelementptr inbounds (%2* @global_subject203_153263040,
i64 0, i32 0)
  %index.i32 = and i64 %history_element.i31, 1
  %28 = getelementptr %2* @global_subject203_153263040, i64 0, i32 2, i64
%index.i32
  store double %24, double* %28
  %29 = insertvalue %1 undef, i64 %25, 0
  %30 = insertvalue %1 %29, double 0.000000e+00, 1
  br label %dependentGraph240.exit

dependentGraph240.exit:                           ; preds = %on231.i, %on204.i
  %subject25_153661808.0.i = phi i1 [ %21, %on204.i ], [ false, %on231.i ]
  %subMeta_43_154193600.0.i = phi i1 [ true, %on204.i ], [ false, %on231.i ]
  %subject26_153662064.0.i = phi double [ %24, %on204.i ], [ 0.000000e+00,
%on231.i ]
  %subject34_153662224.0.i = phi %1 [ %30, %on204.i ], [ zeroinitializer,
%on231.i ]
  %31 = getelementptr inbounds %5* %0, i64 0, i32 0
  store %GEvent %subject16_153602432.0.i, %GEvent* %31
  %32 = getelementptr inbounds %5* %0, i64 0, i32 1
  store i1 %subject25_153661808.0.i, i1* %32, align 8
  %33 = getelementptr inbounds %5* %0, i64 0, i32 2
  store double %subject26_153662064.0.i, double* %33
  %34 = getelementptr inbounds %5* %0, i64 0, i32 3
  store %1 %subject34_153662224.0.i, %1* %34
  %35 = getelementptr inbounds %5* %0, i64 0, i32 4
  store i64 %20, i64* %35
  %36 = getelementptr inbounds %5* %0, i64 0, i32 5
  store i1 %7, i1* %36, align 8
  %37 = getelementptr inbounds %5* %0, i64 0, i32 6
  store i1 %subMeta_43_154193600.0.i, i1* %37
  %38 = getelementptr inbounds %5* %0, i64 0, i32 7
  store i1 %subMeta_43_154193600.0.i, i1* %38, align 2
  %39 = getelementptr inbounds %5* %0, i64 0, i32 8
  store i1 %subMeta_43_154193600.0.i, i1* %39
  %40 = getelementptr inbounds %5* %0, i64 0, i32 9
  store i1 %subMeta_44_154194224.0.i, i1* %40, align 4
  store %1 %subject34_153662224.0.i, %1* %subject34_149825680
  %41 = load i1* @global_subMeta_1_153989392
  %42 = and i1 %brmerge.demorgan, %41
  %43 = and i1 %subMeta_44_154194224.0.i, %42
  br i1 %43, label %on203, label %on235

on203:                                            ; preds =
%dependentGraph240.exit
  %44 = load double* @global_subject159_147021872
  %45 = fmul double %44, 2.000000e-01
  %reflex_ticks = load i64* @global_reflex_ticks
  call void @output_integer(i8* inttoptr (i64 153975296 to i8*), i64 1, i64
%reflex_ticks, i64 %20)
  %reflex_ticks11 = load i64* @global_reflex_ticks
  call void @output_float(i8* inttoptr (i64 153975056 to i8*), i64 1, i64
%reflex_ticks11, double %45)
  %reflex_ticks12 = load i64* @global_reflex_ticks
  call void @output_flush(i8* inttoptr (i64 153974592 to i8*), i64 1, i64
%reflex_ticks12)
  br label %on235

on235:                                            ; preds =
%dependentGraph240.exit, %on203
  %46 = and i1 %subMeta_43_154193600.0.i, %7
  %47 = and i1 %subMeta_43_154193600.0.i, %46
  %48 = and i1 %subMeta_43_154193600.0.i, %47
  %49 = load i1* @global_subMeta_7_153997040
  %50 = and i1 %49, %48
  br i1 %50, label %hold.i, label %dependentGraph241.exit

hold.i:                                           ; preds = %on235
  %.b = load i1* @global_subject218_153259872.b
  %51 = zext i1 %.b to i64
  %52 = load i64* @global_reflex_ticks
  %history_element = load i64* getelementptr inbounds (%2*
@global_subject203_153263040, i64 0, i32 1)
  %history_element15 = load i64* getelementptr inbounds (%2*
@global_subject203_153263040, i64 0, i32 0)
  %53 = icmp eq i64 %52, %history_element
  %54 = zext i1 %53 to i64
  %55 = sub i64 %history_element15, %51
  %56 = add i64 %55, %54
  %index = and i64 %56, 1
  %57 = getelementptr %2* @global_subject203_153263040, i64 0, i32 2, i64
%index
  %subject = load double* %57
  %history_element16 = load i64* getelementptr inbounds (%3*
@global_subject207_153163808, i64 0, i32 1)
  %history_element17 = load i64* getelementptr inbounds (%3*
@global_subject207_153163808, i64 0, i32 0)
  %58 = icmp eq i64 %52, %history_element16
  %59 = zext i1 %58 to i64
  %60 = sub i64 %history_element17, %51
  %61 = add i64 %60, %59
  %index18 = and i64 %61, 1
  %62 = getelementptr %3* @global_subject207_153163808, i64 0, i32 2, i64
%index18
  %subject19 = load %1* %62
  %q_equal = fcmp oeq double %subject26_153662064.0.i, %subject
  %63 = extractvalue %1 %subject19, 1
  %64 = getelementptr inbounds %1* %subject34_149825680, i64 0, i32 0
  %65 = load i64* %64
  %66 = select i1 %q_equal, i64 0, i64 %65
  %67 = getelementptr inbounds %1* %subject34_149825680, i64 0, i32 1
  %68 = load double* %67
  %69 = select i1 %q_equal, double %63, double %68
  %70 = select i1 %subject25_153661808.0.i, i64 %66, i64 0
  %71 = insertvalue %1 undef, i64 %70, 0
  %72 = select i1 %subject25_153661808.0.i, double %69, double %63
  %73 = insertvalue %1 %71, double %72, 1
  store i1 true, i1* @global_subMeta_0_153989360
  store %1 %73, %1* @global_subject109_151691824
  store i64 %52, i64* getelementptr inbounds (%3* @global_subject207_153163808,
i64 0, i32 1)
  %74 = add i64 %history_element17, 1
  store i64 %74, i64* getelementptr inbounds (%3* @global_subject207_153163808,
i64 0, i32 0)
  %index.i = and i64 %history_element17, 1
  %75 = getelementptr %3* @global_subject207_153163808, i64 0, i32 2, i64
%index.i
  store %1 %73, %1* %75
  ret void

dependentGraph241.exit:                           ; preds = %on235
  ret void
}


declare %GEvent @OnMerge(%7*, %GEvent) nounwind

declare i64 @AbsTimeUSec() nounwind

declare i64 @UptimeUSec() nounwind

declare void @output_integer(i8*, i64, i64, i64) nounwind

declare void @output_float(i8*, i64, i64, double) nounwind

declare void @output_flush(i8*, i64, i64) nounwind

-- 
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