This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
fwprop not propagating
- From: "Paulo J. Matos" <paulo at matos-sorge dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 09 May 2012 14:40:02 +0100
- Subject: fwprop not propagating
Hi,
While debugging an issue related to my movmem rule, I noticed that
fwprop seems to be doing some really strange.
The problem occurs when setting the argument to the block copy
instruction. The full C code is:
int **
t25 (int *d, int **s)
{
memcpy (d, *s, 16);
return s;
}
Before fwprop I have the following chain:
(insn 7 4 8 2 (parallel [
(set (reg/f:QI 24 [ *s_1(D) ])
(mem/f:QI (reg/v/f:QI 23 [ s ]) [2 *s_1(D)+0 S1 A16]))
(clobber (reg:CC 13 CC))
]) memcpy.i:4 6 {*movqi}
(nil))
(insn 8 7 9 2 (parallel [
(set (reg:QI 25)
(const_int 16 [0x10]))
(clobber (reg:CC 13 CC))
]) memcpy.i:4 6 {*movqi}
(nil))
(insn 9 8 10 2 (parallel [
(set (reg/f:QI 26 [ d ])
(reg/v/f:QI 22 [ d ]))
(clobber (reg:CC 13 CC))
]) memcpy.i:4 6 {*movqi}
(nil))
(insn 10 9 11 2 (parallel [
(set (reg/f:QI 27 [ *s_1(D) ])
(reg/f:QI 24 [ *s_1(D) ]))
(clobber (reg:CC 13 CC))
]) memcpy.i:4 6 {*movqi}
(nil))
(insn 11 10 12 2 (parallel [
(set (reg:QI 25)
(const_int 0 [0]))
(set (mem:BLK (reg/v/f:QI 22 [ d ]) [0 A16])
(mem:BLK (reg/f:QI 24 [ *s_1(D) ]) [0 A16]))
(set (reg/f:QI 26 [ d ])
(plus:QI (reg/v/f:QI 22 [ d ])
(reg:QI 25)))
(set (reg/f:QI 27 [ *s_1(D) ])
(plus:QI (reg/f:QI 24 [ *s_1(D) ])
(reg:QI 25)))
]) memcpy.i:4 21 {bc2}
(nil))
After fwprop I have:
(insn 2 5 3 2 (parallel [
(set (reg/v/f:QI 22 [ d ])
(reg:QI 1 AL [ d ]))
(clobber (reg:CC 13 CC))
]) memcpy.i:3 6 {*movqi}
(expr_list:REG_DEAD (reg:QI 1 AL [ d ])
(expr_list:REG_UNUSED (reg:CC 13 CC)
(nil))))
(insn 3 2 4 2 (parallel [
(set (reg/v/f:QI 23 [ s ])
(reg:QI 0 AH [ s ]))
(clobber (reg:CC 13 CC))
]) memcpy.i:3 6 {*movqi}
(expr_list:REG_DEAD (reg:QI 0 AH [ s ])
(expr_list:REG_UNUSED (reg:CC 13 CC)
(nil))))
(note 4 3 7 2 NOTE_INSN_FUNCTION_BEG)
(insn 7 4 8 2 (parallel [
(set (reg/f:QI 24 [ *s_1(D) ])
(mem/f:QI (reg/v/f:QI 23 [ s ]) [2 *s_1(D)+0 S1 A16]))
(clobber (reg:CC 13 CC))
]) memcpy.i:4 6 {*movqi}
(expr_list:REG_UNUSED (reg:CC 13 CC)
(nil)))
(insn 8 7 11 2 (parallel [
(set (reg:QI 25)
(const_int 16 [0x10]))
(clobber (reg:CC 13 CC))
]) memcpy.i:4 6 {*movqi}
(expr_list:REG_UNUSED (reg:CC 13 CC)
(nil)))
(insn 11 8 16 2 (parallel [
(set (reg:QI 25)
(const_int 0 [0]))
(set (mem:BLK (reg/v/f:QI 22 [ d ]) [0 A16])
(mem:BLK (reg/f:QI 24 [ *s_1(D) ]) [0 A16]))
(set (reg/f:QI 26 [ d ])
(plus:QI (reg/v/f:QI 22 [ d ])
(reg:QI 25)))
(set (reg/f:QI 27 [ *s_1(D) ])
(plus:QI (reg/f:QI 24 [ *s_1(D) ])
(reg:QI 25)))
]) memcpy.i:4 21 {bc2}
(expr_list:REG_DEAD (reg/f:QI 24 [ *s_1(D) ])
(expr_list:REG_DEAD (reg/v/f:QI 22 [ d ])
(expr_list:REG_UNUSED (reg/f:QI 27 [ *s_1(D) ])
(expr_list:REG_UNUSED (reg/f:QI 26 [ d ])
(expr_list:REG_UNUSED (reg:QI 25)
(nil)))))))
I understand that fwprop can delete insn 9 and 10, but shouldn't it then
update insn 11 so that references to reg:QI 26 and reg:QI 27 now
reference reg:QI 22 and reg:QI 24 respectively?
Cheers,
--
PMatos