This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Committed] S/390: Fix bootstrap comparison failure with --with-arch=z10


On Fri, Oct 16, 2009 at 12:06:49PM +0200, Andreas Krebbel wrote:
> 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);

Shouldn't you skip over DEBUG_INSNs as well?  prev_nonnote_insn
may give you a DEBUG_INSN, in which case it would be a -fcompare-debug
bug.  I don't see a helper function which would skip over both nonnotes
and DEBUG_INSNs though, except for prev_active_insn (but that one
skips over USE and CLOBBER INSN patterns as well, not sure if that is
desirable or not in this case).

> *************** 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))
>       {

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]