[llvm-bugs] [Bug 32291] New: [PowerPC] codegen problem in loop, results in run-time SIGSEGV in application
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Mar 15 15:04:36 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=32291
Bug ID: 32291
Summary: [PowerPC] codegen problem in loop, results in run-time
SIGSEGV in application
Product: new-bugs
Version: 4.0
Hardware: Other
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: eric.schweitz at pgroup.com
CC: llvm-bugs at lists.llvm.org
Created attachment 18103
--> https://bugs.llvm.org/attachment.cgi?id=18103&action=edit
reduced test case
In the (bugpoint reduced) test case, I've marked a basic block with the label
"L.bug_here", which is where I found the SIGSEGV was happening in the original
program.
Here is the LLVM IR:
L.bug_here: ; preds = %L.bug_here,
%L.LB2_5666.prol.preheader
%z00go = phi i64 [ 0, %L.LB2_5666.prol.preheader ], [ %696, %L.bug_here ]
%z00gp = phi i64 [ %z00fr, %L.LB2_5666.prol.preheader ], [ %z00gq,
%L.bug_here ]
%695 = load i8*, i8** %445, align 8, !dbg !1187, !tbaa !1157
%696 = add nuw nsw i64 %z00go, 1, !dbg !1187
%697 = mul i64 %z00gn, %696, !dbg !1187
%698 = add i64 %694, %697, !dbg !1187
%699 = mul i64 %698, %z00gl, !dbg !1187
%700 = getelementptr i8, i8* %695, i64 %699, !dbg !1187
%701 = bitcast i8* %700 to i64*, !dbg !1187
%702 = load i64, i64* %701, align 8, !dbg !1187, !tbaa !1157
%z00gr = shl i64 %z00go, 32, !dbg !1187
%703 = ashr exact i64 %z00gr, 32, !dbg !1187
%704 = getelementptr double, double* %693, i64 %703, !dbg !1187
%705 = bitcast double* %704 to i64*, !dbg !1187
store i64 %702, i64* %705, align 8, !dbg !1187, !tbaa !1240
%z00gq = add i64 %z00gp, -1, !dbg !1187
%z00gs = icmp eq i64 %z00gq, 0, !dbg !1187
br i1 %z00gs, label %L.LB2_5666.prol.loopexit.unr-lcssa, label %L.bug_here,
!dbg !1187, !llvm.loop !1242
Using llc v3.9, this basic block does NOT suffer a SIGSEGV and appears as:
.LBB1_83: # %L.bug_here
# Parent Loop BB1_26 Depth=1
# Parent Loop BB1_42 Depth=2
# => This Inner Loop Header: Depth=3
.loc 1 107 1 # z000002b9:107:1
ld 11, 0(20)
sldi 0, 28, 32
sradi 12, 10, 29
addi 7, 7, 1
add 10, 10, 0
ldx 11, 11, 8
add 8, 8, 9
stdx 11, 3, 12
bdnz .LBB1_83
Using llc v4.0, this basic block appears as:
.LBB1_88: # %L.bug_here
# Parent Loop BB1_29 Depth=1
# Parent Loop BB1_47 Depth=2
# => This Inner Loop Header: Depth=3
.loc 1 107 1 is_stmt 1 # z000002b9:107:1
ld 11, 0(25)
addi 7, 7, 1
ldx 11, 11, 9
add 9, 9, 10
stdu 11, 8(8)
bdnz .LBB1_88
In this latter asm, r8 is loaded with an unmapped memory address and the
program takes a signal on the stdu insn.
The command used to compile the .ll file was simply:
% llc -o simplified.s simplified.ll
PS: It appears that the master branch generates a code pattern much like v3.9.
--
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/20170315/b3026bcd/attachment.html>
More information about the llvm-bugs
mailing list