[Committed] S/390: Fix bootstrap comparison failure with --with-arch=z10
Andreas Krebbel
krebbel@linux.vnet.ibm.com
Fri Oct 16 10:24:00 GMT 2009
Hi,
in the machine dependent reorg pass we walk through the insn stream in
order to do some modifications avoiding problematic situations for the
z10 CPU. While looking at previous and next insns we do not skip over
insn notes. This unfortunately makes the code generation dependent on
the presence of NOTEs.
So bootstrapping with --with-arch=z10 currently fails with a
comparison failure since the additional notes added for variable
locations when debug info is enabled actually lead to different code
to be generated.
Fixed with the attached patch.
z10 default bootstrap is fixed with that change.
Committed to mainline
Bye,
-Andreas-
2009-10-16 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (s390_z10_optimize_cmp): Skip notes when
investigating previous or next insns.
Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig 2009-10-16 10:17:13.000000000 +0200
--- gcc/config/s390/s390.c 2009-10-16 10:24:40.000000000 +0200
*************** s390_z10_optimize_cmp (rtx insn)
*** 9866,9872 ****
/* Swap the COMPARE arguments and its mask if there is a
conflicting access in the previous insn. */
! prev_insn = PREV_INSN (insn);
if (prev_insn != NULL_RTX && INSN_P (prev_insn)
&& reg_referenced_p (*op1, PATTERN (prev_insn)))
s390_swap_cmp (cond, op0, op1, insn);
--- 9866,9872 ----
/* Swap the COMPARE arguments and its mask if there is a
conflicting access in the previous insn. */
! prev_insn = prev_nonnote_insn (insn);
if (prev_insn != NULL_RTX && INSN_P (prev_insn)
&& reg_referenced_p (*op1, PATTERN (prev_insn)))
s390_swap_cmp (cond, op0, op1, insn);
*************** s390_z10_optimize_cmp (rtx insn)
*** 9877,9883 ****
the operands, or if swapping them would cause a conflict
with the previous insn, issue a NOP after the COMPARE in
order to separate the two instuctions. */
! next_insn = NEXT_INSN (insn);
if (next_insn != NULL_RTX && INSN_P (next_insn)
&& s390_non_addr_reg_read_p (*op1, next_insn))
{
--- 9877,9883 ----
the operands, or if swapping them would cause a conflict
with the previous insn, issue a NOP after the COMPARE in
order to separate the two instuctions. */
! next_insn = next_nonnote_insn (insn);
if (next_insn != NULL_RTX && INSN_P (next_insn)
&& s390_non_addr_reg_read_p (*op1, next_insn))
{
More information about the Gcc-patches
mailing list