llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.11k stars 12.01k forks source link

ice: This target-independent node should have been selected! #3354

Closed regehr closed 16 years ago

regehr commented 16 years ago
Bugzilla Link 2982
Resolution FIXED
Resolved on Nov 03, 2008 21:53
Version unspecified
OS Linux
CC @isanbard,@sunfishcode

Extended Description

Seen on Ubuntu Hardy on x86 using LLVM r58399.

regehr@john-home:~/volatile/tmp54$ llvm-gcc -O3 small.c 0x8e392f4: i32 = and 0x8e391e4, 0x8e397bccc1: ScheduleDAGEmit.cpp:545: void llvm::ScheduleDAG::EmitNode(llvm::SDNode*, bool, llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo, llvm::DenseMapInfo >&): Assertion `0 && "This target-independent node should have been selected!"' failed. small.c:13: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions.

regehr@john-home:~/volatile/tmp54$ cat small.c

char g_3; int g_265; int g_279;

void foo (char p_56) { rshift_u_u (p_56 * (g_279 & 1) + g_265 + g_3, 0); }

void bar (void) { foo (2); }

isanbard commented 16 years ago

Dan fixed this with this patch:

http://llvm.org/viewvc/llvm-project?rev=58655&view=rev

isanbard commented 16 years ago

Bugpoint reduced testcase:

$ llvm-dis -o - bugpoint-reduced-simplified.bc ; ModuleID = 'bugpoint-reduced-simplified.bc' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin9.5" @​g_279 = external global i32 ; <i32> [#uses=1] @​g_265 = external global i32 ; <i32> [#uses=1] @​g_3 = external global i8 ; <i8*> [#uses=1]

declare i32 @​rshift_u_u(...)

define void @​bar() nounwind { entry: %0 = load i32 @​g_279, align 4 ; [#uses=1] %1 = shl i32 %0, 1 ; [#uses=1] %2 = and i32 %1, 2 ; [#uses=1] %3 = load i32 @​g_265, align 4 ; [#uses=1] %4 = load i8 @​g_3, align 1 ; [#uses=1] %5 = sext i8 %4 to i32 ; [#uses=1] %6 = add i32 %2, %3 ; [#uses=1] %7 = add i32 %6, %5 ; [#uses=1] %8 = tail call i32 (...) @​rshift_u_u(i32 %7, i32 0) nounwind ; [#uses=0] ret void }