[llvm-bugs] [Bug 27135] New: SelectionDAGBuilder::visitSwitch() creates disconnected MBB
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Mar 30 11:00:38 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=27135
Bug ID: 27135
Summary: SelectionDAGBuilder::visitSwitch() creates
disconnected MBB
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Common Code Generator Code
Assignee: unassignedbugs at nondot.org
Reporter: paulsson at linux.vnet.ibm.com
CC: congh at google.com, hans at hanshq.net,
llvm-bugs at lists.llvm.org
Classification: Unclassified
Created attachment 16130
--> https://llvm.org/bugs/attachment.cgi?id=16130&action=edit
Input for compilation
visitSwitch() seems to create an MBB whithout predecessors / successors.
The attached test case is not minimized, but the verifier gives the exact spot.
If you are lucky, you can get there in gdb with:
b MachineFunction:247 // in CreateMachineBasicBlock()
condition [BP] (bb && strcmp(bb->getName().Data,"if.then72")==0)
c // continue once
u // go up the stack a few times, and that should be the SelectionDAGBuilder
handling bb:
if.then72: ; preds = %land.lhs.true71
%24 = inttoptr i64 %in.addr.sroa.0.0 to %struct.rtx_def*
%arrayidx74 = getelementptr inbounds %struct.rtx_def, %struct.rtx_def* %24,
i64 0, i32 1, i64 0
%25 = bitcast %union.rtunion_def* %arrayidx74 to i32**
%26 = load i32*, i32** %25, align 8, !tbaa !5
%bf.load75 = load i32, i32* %26, align 8
%bf.lshr76 = lshr i32 %bf.load75, 16
switch i32 %bf.lshr76, label %if.end92 [
i32 99, label %sw.bb
i32 98, label %sw.bb
i32 101, label %sw.bb
i32 97, label %sw.bb84
i32 96, label %sw.bb84
i32 100, label %sw.bb84
]
(gdb) run -cc1 -triple s390x-ibm-linux -S -disable-free -main-file-name
reload.c -mrelocation-model static -mthread-model posix -fmath-errno
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu z13
-momit-leaf-frame-pointer -v -dwarf-column-info -debugger-tuning=gdb -O3
-ferror-limit 19 -fmessage-length 238 -funroll-loops -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o reload.s -x ir ./reload.bc
Add -mllvm -verify-machineinstrs to see the error message:
...
BB#524: derived from LLVM BB %if.then72
Predecessors according to CFG: BB#17
%vreg455<def> = LHIMux 1; GR32Bit:%vreg455
%vreg456<def,tied1> = SLL %vreg455<tied0>, %vreg453, 0;
GR32Bit:%vreg456,%vreg455 ADDR32Bit:%vreg453
TMLMux %vreg456<kill>, 19, %CC<imp-def>; GR32Bit:%vreg456
BRC 15, 7, <BB#19>, %CC<imp-use>
J <BB#18>
Successors according to CFG: BB#19(0x40000000 / 0x80000000 = 50.00%)
BB#18(0x40000000 / 0x80000000 = 50.00%)
BB#525: derived from LLVM BB %if.then72 <<<<<<<<< Not connected!!
BB#18: derived from LLVM BB %sw.bb
...
*** Bad machine code: PHI operand is not in the CFG ***
- function: push_reload
- basic block: BB#20 if.end92 (0x85a2f140)
- instruction: %vreg17<def> = PHI
- operand 16: <BB#525>
*** Bad machine code: PHI operand is not in the CFG ***
- function: push_reload
- basic block: BB#20 if.end92 (0x85a2f140)
- instruction: %vreg18<def> = PHI
- operand 16: <BB#525>
fatal error: error in backend: Found 2 machine code errors.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160330/1b685c42/attachment-0001.html>
More information about the llvm-bugs
mailing list