https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72827

--- Comment #14 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
Confirmed that the frame pointer dance is where the issue is.  Prior to dse2:

(insn 3854 144 4133 2 (set (reg:DI 9 9 [1674])
        (const_int 1208 [0x4b8]))
/home/wschmidt/gcc/gcc-mainline-base/gcc/ada/\
make.adb:6327 565 {*movdi_internal64}
     (expr_list:REG_EQUIV (const_int 1208 [0x4b8])
        (nil)))
(insn 4133 3854 4135 2 (set (reg/f:DI 31 31)
        (plus:DI (reg/f:DI 31 31)
            (reg:DI 9 9 [1674])))
/home/wschmidt/gcc/gcc-mainline-base/gcc/ada/\
make.adb:6327 75 {*adddi3}
     (nil))
(insn 4135 4133 4136 2 (set (mem/j/c:DI (reg/f:DI 31 31) [1137
FRAME.2381.M1944\
b+0 S8 A64])
        (reg:DI 3 3))
/home/wschmidt/gcc/gcc-mainline-base/gcc/ada/make.adb:632\
7 565 {*movdi_internal64}
     (nil))
(insn 4136 4135 4134 2 (set (mem/j/c:DI (plus:DI (reg/f:DI 31 31)
                (const_int 8 [0x8])) [1137 FRAME.2381.M1944b+8 S8 A64])
        (reg:DI 4 4 [+8 ]))
/home/wschmidt/gcc/gcc-mainline-base/gcc/ada/make.a\
db:6327 565 {*movdi_internal64}
     (nil))
(insn 4134 4136 3868 2 (set (reg/f:DI 31 31)
        (minus:DI (reg/f:DI 31 31)
            (reg:DI 9 9 [1674])))
/home/wschmidt/gcc/gcc-mainline-base/gcc/ada/\
make.adb:6327 102 {*subfdi3}
     (nil))

You can see the "mark" being established with the stores from r3 and r4.

Following dse2:

(insn 3854 144 4133 2 (set (reg:DI 9 9 [1674])
        (const_int 1208 [0x4b8]))
/home/wschmidt/gcc/gcc-mainline-base/gcc/ada/\
make.adb:6327 565 {*movdi_internal64}
     (expr_list:REG_EQUIV (const_int 1208 [0x4b8])
        (nil)))
(insn 4133 3854 4134 2 (set (reg/f:DI 31 31)
        (plus:DI (reg/f:DI 31 31)
            (reg:DI 9 9 [1674])))
/home/wschmidt/gcc/gcc-mainline-base/gcc/ada/\
make.adb:6327 75 {*adddi3}
     (nil))
(insn 4134 4133 3868 2 (set (reg/f:DI 31 31)
        (minus:DI (reg/f:DI 31 31)
            (reg:DI 9 9 [1674])))
/home/wschmidt/gcc/gcc-mainline-base/gcc/ada/\
make.adb:6327 102 {*subfdi3}
     (expr_list:REG_DEAD (reg:DI 9 9 [1674])
        (nil)))

DSE thought the two stores were dead and nuked them.

Is this kind of frame pointer adjustment a common occurrence with Ada code gen,
or do you think this is related to POWER code gen somehow?  I've never seen
this sort of thing before.

Reply via email to