This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
S/390: Backport string expander fix to 3.3
- From: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 6 Mar 2004 20:22:19 +0100 (CET)
- Subject: S/390: Backport string expander fix to 3.3
Hello,
this backports a 3.4/mainline fix to the 3.3 branch: the string insn
expanders would initialize a double-word register by moving to the
high and low parts separately without clobbering the whole register
first, confusion flow analysis.
This caused an ICE in flow.c on the hammer-3_3 branch; while I do
not have a test case that ICEs for 3.3 itself, I've seen invalid
flow info in 3.3 dumps as well ...
Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux;
applied to the 3.3 branch.
Bye,
Ulrich
ChangeLog:
* config/s390/s390.c (s390_expand_movstr): Clobber double-word
register before initializing high and low parts separately.
(s390_expand_clrstr): Likewise.
(s390_expand_cmpstr): Likewise.
Index: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.67.2.17
diff -c -p -r1.67.2.17 s390.c
*** gcc/config/s390/s390.c 28 Jan 2004 17:25:17 -0000 1.67.2.17
--- gcc/config/s390/s390.c 5 Mar 2004 17:23:11 -0000
*************** s390_expand_movstr (dst, src, len)
*** 2878,2883 ****
--- 2878,2886 ----
rtx reg0 = gen_reg_rtx (double_mode);
rtx reg1 = gen_reg_rtx (double_mode);
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
+
emit_move_insn (gen_highpart (single_mode, reg0),
force_operand (XEXP (dst, 0), NULL_RTX));
emit_move_insn (gen_highpart (single_mode, reg1),
*************** s390_expand_clrstr (dst, len)
*** 2974,2979 ****
--- 2977,2985 ----
rtx reg0 = gen_reg_rtx (double_mode);
rtx reg1 = gen_reg_rtx (double_mode);
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
+
emit_move_insn (gen_highpart (single_mode, reg0),
force_operand (XEXP (dst, 0), NULL_RTX));
convert_move (gen_lowpart (single_mode, reg0), len, 1);
*************** s390_expand_cmpstr (target, op0, op1, le
*** 3077,3082 ****
--- 3083,3091 ----
enum machine_mode single_mode = TARGET_64BIT ? DImode : SImode;
rtx reg0 = gen_reg_rtx (double_mode);
rtx reg1 = gen_reg_rtx (double_mode);
+
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
emit_move_insn (gen_highpart (single_mode, reg0),
force_operand (XEXP (op0, 0), NULL_RTX));
--
Dr. Ulrich Weigand
weigand@informatik.uni-erlangen.de