Summary: | FAIL: gfortran.dg/cray_pointers_2.f90 at -O2 and above | ||
---|---|---|---|
Product: | gcc | Reporter: | John David Anglin <danglin> |
Component: | middle-end | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, sje |
Priority: | P3 | Keywords: | wrong-code |
Version: | 4.1.0 | ||
Target Milestone: | --- | ||
Host: | hppa64-hp-hpux11.11 | Target: | hppa64-hp-hpux11.11 |
Build: | hppa64-hp-hpux11.11 | Known to work: | |
Known to fail: | Last reconfirmed: | ||
Attachments: | cray_pointers_2.f90.t95.vars |
Description
John David Anglin
2005-12-27 23:30:58 UTC
These fails don't occur on 4.2. Can you attach the dump from -fdump-tree-vars? I suspect that cray_pointers are a bit weird on targets like HPPA since we might not record if it is a pointer or not in the integer. Subject: Re: FAIL: gfortran.dg/cray_pointers_2.f90 at -O2 and above
> Can you attach the dump from -fdump-tree-vars? I suspect that cray_pointers
> are a bit weird on targets like HPPA since we might not record if it is a
> pointer or not in the integer.
Will do. I can see that register r19 has the frame-related flag set
and r1 in .greg:
(insn 1558 191 195 9 (set (reg:DI 1 %r1)
(mem/f/c:DI (plus:DI (reg/f:DI 30 %r30)
(const_int -432 [0xfffffffffffffe50])) [538 S8 A64])) 119 {*pa.md:4136} (nil)
(nil))
(insn 1559 195 187 9 (set (reg/f:DI 19 %r19)
(mem/f/c:DI (plus:DI (reg/f:DI 30 %r30)
(const_int -600 [0xfffffffffffffda8])) [517 ivtmp___4698+0 S8 A64])) 119 {*pa.md:4136} (nil)
(nil))
(insn 187 1559 192 9 (set (reg:DI 6 %r6 [250])
(plus:DI (reg/f:DI 19 %r19)
(reg:DI 1 %r1))) 158 {*pa.md:4941} (nil)
(nil))
(insn 192 187 199 9 (set (mem/s:SF (reg:DI 6 %r6 [250]) [18 S4 A32])
(reg:SF 50 %fr22 [254])) 123 {*pa.md:4342} (insn_list:REG_DEP_TRUE 191 (insn_list:REG_DEP_TRUE 187 (nil)))
(nil))
This allows the peephole2 optimization to form the insn that causes the segv.
Dave
Subject: Re: FAIL: gfortran.dg/cray_pointers_2.f90 at -O2 and above Here's the dump. Dave Created attachment 10559 [details]
cray_pointers_2.f90.t95.vars
Subject: Re: FAIL: gfortran.dg/cray_pointers_2.f90 at -O2 and above
> Can you attach the dump from -fdump-tree-vars? I suspect that cray_pointers
> are a bit weird on targets like HPPA since we might not record if it is a
> pointer or not in the integer.
<L9>:;
D.1846 = (real4) i;
D.14918 = (real4 *) ivtmp___4698;
MEM[index: D.14918 + (real4 *) pretmp___4503] = D.1846 * 5.0e+0;
It I'm reading this correctly, we appear to have the sum of two
real4* pointers in the MEM.
Dave
(In reply to comment #6) > It I'm reading this correctly, we appear to have the sum of two > real4* pointers in the MEM. You are reading this correctly. PRE is only run at -O2 but I don't think this is a PRE bug. Can you try -fno-ivopts -O2 -fcray-pointer and see if that works and if it does attach the dump provided by -fdump-tree-vars. I almost think IV-OPTS is going wrong here. D.6538 = (real4 *) ivtmp___1132; MEM[index: D.6538 + (real4 *) pretmp___1055] = D.4409 * 5.0e+0; IV-OPTS produces ivtmp___1132 which is a void* and it just increments that. Subject: Re: FAIL: gfortran.dg/cray_pointers_2.f90 at -O2 and above
> (In reply to comment #6)
> > It I'm reading this correctly, we appear to have the sum of two
> > real4* pointers in the MEM.
>
> You are reading this correctly. PRE is only run at -O2 but I don't think this
> is a PRE bug.
>
> Can you try -fno-ivopts -O2 -fcray-pointer and see if that works and if it does
> attach the dump provided by -fdump-tree-vars. I almost think IV-OPTS is going
> wrong here.
>
> D.6538 = (real4 *) ivtmp___1132;
> MEM[index: D.6538 + (real4 *) pretmp___1055] = D.4409 * 5.0e+0;
>
> IV-OPTS produces ivtmp___1132 which is a void* and it just increments that.
It does change things. The code still seg faults but a little further
on:
Program received signal SIGSEGV, Segmentation fault0x400000000000e0d4 in ptr5_ ()
at /test/gnu/gcc-4.1/gcc/gcc/testsuite/gfortran.dg/cray_pointers_2.f90:1312
1312 dpte2(j,i)%r1=1.0
(gdb) disass 0x400000000000e0c4 0x400000000000e0e4
Dump of assembler code from 0x400000000000e0c4 to 0x400000000000e0e4:
0x400000000000e0c4 <ptr5_+1364>: ldd -170(sp),r19
0x400000000000e0c8 <ptr5_+1368>: ldd -1a8(sp),r20
0x400000000000e0cc <ptr5_+1372>: copy dp,r4
0x400000000000e0d0 <ptr5_+1376>: add,l r20,r19,r5
0x400000000000e0d4 <ptr5_+1380>: fstw fr16R,r20(r19)
0x400000000000e0d8 <ptr5_+1384>: copy r5,r26
0x400000000000e0dc <ptr5_+1388>: ldo -30(sp),ret1
0x400000000000e0e0 <ptr5_+1392>: b,l 0x40000000000033e0 <realne_>,rp
End of assembler dump.
(gdb) p/x $r20
$1 = 0x800003fffeff13ac
(gdb) p/x $r19
$2 = 0x0
Again, we have a base/index register mixup in .greg.
(insn 1537 454 1538 22 /test/gnu/gcc-4.1/gcc/gcc/testsuite/gfortran.dg/cray_poin
ters_2.f90:1312 (set (reg/f:DI 19 %r19)
(mem/f/c:DI (plus:DI (reg/f:DI 30 %r30)
(const_int -368 [0xfffffffffffffe90])) [475 S8 A64])) 119 {*pa.md:4136} (nil)
(nil))
(insn 1538 1537 433 22 /test/gnu/gcc-4.1/gcc/gcc/testsuite/gfortran.dg/cray_poin
ters_2.f90:1312 (set (reg:DI 20 %r20)
(mem/f/c:DI (plus:DI (reg/f:DI 30 %r30)
(const_int -424 [0xfffffffffffffe58])) [468 S8 A64])) 119 {*pa.md:4136} (nil)
(nil))
(insn 433 1538 437 22 /test/gnu/gcc-4.1/gcc/gcc/testsuite/gfortran.dg/cray_pointers_2.f90:1312 (set (reg/f:DI 5 %r5 [354])
(plus:DI (reg/f:DI 19 %r19)
(reg:DI 20 %r20))) 158 {*pa.md:4941} (nil)
(nil))
(insn 437 433 438 22 /test/gnu/gcc-4.1/gcc/gcc/testsuite/gfortran.dg/cray_pointers_2.f90:1312 (set (mem/s:SF (reg/f:DI 5 %r5 [354]) [18 <variable>.r1+0 S4 A32])
(reg:SF 44 %fr16 [357])) 123 {*pa.md:4342} (insn_list:REG_DEP_TRUE 433 (nil))
(expr_list:REG_EQUAL (const_double:SF 1.0e+0 [0x0.8p+1])
(nil)))
Reloads for insn # 433
Reload 0: reload_in (DI) = (reg:DI 679)
GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 1)
reload_in_reg: (reg:DI 679)
reload_reg_rtx: (reg/f:DI 19 %r19)
Reload 1: reload_in (DI) = (reg/f:DI 632)
GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 2)
reload_in_reg: (reg/f:DI 632)
reload_reg_rtx: (reg:DI 20 %r20)
Dave
Subject: Bug 25586 Author: danglin Date: Fri Dec 30 05:44:16 2005 New Revision: 109166 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109166 Log: PR fortran/25586 * pa.md: Remove REG_POINTER check from REG+REG peephole2 floating-point store patterns. Modified: trunk/gcc/ChangeLog trunk/gcc/config/pa/pa.md Subject: Bug 25586 Author: danglin Date: Fri Dec 30 05:47:53 2005 New Revision: 109167 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109167 Log: PR fortran/25586 * pa.md: Remove REG_POINTER check from REG+REG peephole2 floating-point store patterns. Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/config/pa/pa.md Subject: Bug 25586 Author: danglin Date: Fri Dec 30 05:50:44 2005 New Revision: 109168 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109168 Log: PR fortran/25586 * pa.md: Remove REG_POINTER check from REG+REG peephole2 floating-point store patterns. Modified: branches/gcc-4_0-branch/gcc/ChangeLog branches/gcc-4_0-branch/gcc/config/pa/pa.md Subject: Bug 25586 Author: danglin Date: Fri Dec 30 05:54:17 2005 New Revision: 109169 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109169 Log: PR fortran/25586 * pa.md: Remove REG_POINTER check from REG+REG peephole2 floating-point store patterns. Modified: branches/gcc-3_4-branch/gcc/ChangeLog branches/gcc-3_4-branch/gcc/config/pa/pa.md Dave, it looks like this defect has been fixed. Is there any reason not to close the defect? Fixed by patch 3.4 and leter. |