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]

[patch] gcse.patch: Revert my recent patch.


Hi,

Attached is a patch to revert my recent patch to gcse.c.  Committed as
obvious because the patch has been reported to break several
platforms.

Kazu Hirata

2003-02-25  Kazu Hirata  <kazu at cs dot umass dot edu>

	* gcse.c (cprop_jump): Revert the 2003-02-23 change.

Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.237
diff -c -r1.237 gcse.c
*** gcse.c	23 Feb 2003 20:52:44 -0000	1.237
--- gcse.c	25 Feb 2003 22:50:38 -0000
***************
*** 4058,4090 ****
        && !modified_between_p (src, setcc, jump))
      {
        rtx setcc_set = single_set (setcc);
-       rtx note = find_reg_equal_equiv_note (setcc);
-       /* Use REG_EQUAL note if available.  */
-       rtx setcc_set_src = (note == 0) ? SET_SRC (setcc_set) : XEXP (note, 0);
- 
        new_set = simplify_replace_rtx (SET_SRC (set),
  				      SET_DEST (setcc_set),
! 				      setcc_set_src);
      }
    else
      new_set = set;
  
!   /* If NEW_SET is simplified down to either a label or a no-op, we
!      don't have to replace FROM with SRC, but we still have to either
!      turn JUMP to an unconditional branch or remove the no-op.  This
!      can happen if JUMP is simplified using the REG_EQUAL note in
!      SETCC.  */
!   if (GET_CODE (new_set) == LABEL_REF || new_set == pc_rtx)
!     new = new_set;
!   else
!     {
!       new = simplify_replace_rtx (new_set, from, src);
  
!       /* If no simplification can be made, then try the next
! 	 register.  */
!       if (rtx_equal_p (new, new_set) || rtx_equal_p (new, SET_SRC (set)))
! 	return 0;
!     }
  
    /* If this is now a no-op delete it, otherwise this must be a valid insn.  */
    if (new == pc_rtx)
--- 4058,4076 ----
        && !modified_between_p (src, setcc, jump))
      {
        rtx setcc_set = single_set (setcc);
        new_set = simplify_replace_rtx (SET_SRC (set),
  				      SET_DEST (setcc_set),
! 				      SET_SRC (setcc_set));
      }
    else
      new_set = set;
  
!   new = simplify_replace_rtx (new_set, from, src);
  
!   /* If no simplification can be made, then try the next
!      register.  */
!   if (rtx_equal_p (new, new_set) || rtx_equal_p (new, SET_SRC (set)))
!     return 0;
  
    /* If this is now a no-op delete it, otherwise this must be a valid insn.  */
    if (new == pc_rtx)


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