------- Comment #8 from dave at hiauly1 dot hia dot nrc dot ca 2005-12-28 04:18 ------- 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 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25586