http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46665
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-26
12:19:54 UTC ---
The -O[2s] -fipa-pta -fno-tree-ccp -fno-tree-forwprop failure goes away
with -fno-schedule-insns2.
restrict support really depends on CCP and CSE, -fipa-pta doesn't
recompute it after CSE. But there isn't anything obviously wrong
in the .optimized alias info.
Fails with -fdbg-cnt=sched_insn:218, ok with -fdbg-cnt=sched_insn:217
--- array_alloc_3.s.good 2010-11-26 13:04:58.000000000 +0100
+++ array_alloc_3.s.bad 2010-11-26 13:04:48.000000000 +0100
@@ -151,6 +151,7 @@
.p2align 4,,10
.p2align 3
.L11:
+ movq (%rcx), %rdx
movq $1, 144(%rsp)
movq %rbp, 152(%rsp)
movq $1, 168(%rsp)
@@ -159,7 +160,6 @@
movq $1, 192(%rsp)
movq %r11, 200(%rsp)
movq %r10, 184(%rsp)
- movq (%rcx), %rdx
subq -8(%rcx), %rdx
addq $1, %rdx
cmovs %r9, %rdx
which is
(insn 264 263 267 15 (set (mem/s:DI (plus:DI (reg/f:DI 7 sp)
(const_int 184 [0xb8])) [5 parm.16.dim[2].stride+0 S8 A64])
(reg:DI 39 r10 [orig:227 D.1900 ] [227]))
/space/rguenther/src/svn/trunk/gcc/testsuite/gfortran.dg/array_alloc_3.f90:12
62 {*movdi_internal_rex64}
(nil))
(and similar accesses to parm.16) vs.
(insn:TI 267 264 268 15 (set (reg:DI 1 dx [323])
(mem:DI (reg:DI 2 cx [orig:251 ivtmp.92 ] [251]) [3 MEM[(struct
array3_integer(kind=4) *)D.2016_21]+0 S8 A64]))
/space/rguenther/src/svn/trunk/gcc/testsuite/gfortran.dg/array_alloc_3.f90:12
62 {*movdi_internal_rex64}
(nil))
# PT = { parm.16ptD.1610ptD.1610 }
D.2016_21 = (void *) ivtmp.92_128;
I found the bug and have a patch.