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] Fix reg_eq notes handling in loop-iv.c


Hello,

this patch fixes the problem with handling reg_equal/equiv notes in
loop-iv.c, where we did not take the expression out of the
expr_list wrapper.

Bootstrapped (with -funroll-loops) & regtested on i686.

Zdenek

	* loop-iv.c (mark_single_set, get_biv_step_1, iv_analyze,
	simplify_using_assignment): Take the expression out of
	the expr_list wrapper.

Index: loop-iv.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-iv.c,v
retrieving revision 2.7
diff -c -3 -p -r2.7 loop-iv.c
*** loop-iv.c	18 Mar 2004 16:42:31 -0000	2.7
--- loop-iv.c	26 Apr 2004 11:55:17 -0000
*************** mark_single_set (rtx insn, rtx set)
*** 254,260 ****
    unsigned regno, uid;
  
    src = find_reg_equal_equiv_note (insn);
!   if (!src)
      src = SET_SRC (set);
  
    if (!simple_set_p (SET_DEST (set), src))
--- 254,262 ----
    unsigned regno, uid;
  
    src = find_reg_equal_equiv_note (insn);
!   if (src)
!     src = XEXP (src, 0);
!   else
      src = SET_SRC (set);
  
    if (!simple_set_p (SET_DEST (set), src))
*************** get_biv_step_1 (rtx insn, rtx reg,
*** 603,609 ****
  
    set = single_set (insn);
    rhs = find_reg_equal_equiv_note (insn);
!   if (!rhs)
      rhs = SET_SRC (set);
    lhs = SET_DEST (set);
  
--- 605,613 ----
  
    set = single_set (insn);
    rhs = find_reg_equal_equiv_note (insn);
!   if (rhs)
!     rhs = XEXP (rhs, 0);
!   else
      rhs = SET_SRC (set);
    lhs = SET_DEST (set);
  
*************** iv_analyze (rtx insn, rtx def, struct rt
*** 979,985 ****
  
    set = single_set (insn);
    rhs = find_reg_equal_equiv_note (insn);
!   if (!rhs)
      rhs = SET_SRC (set);
    code = GET_CODE (rhs);
  
--- 983,991 ----
  
    set = single_set (insn);
    rhs = find_reg_equal_equiv_note (insn);
!   if (rhs)
!     rhs = XEXP (rhs, 0);
!   else
      rhs = SET_SRC (set);
    code = GET_CODE (rhs);
  
*************** simplify_using_assignment (rtx insn, rtx
*** 1337,1343 ****
      return;
  
    rhs = find_reg_equal_equiv_note (insn);
!   if (!rhs)
      rhs = SET_SRC (set);
  
    if (!simple_rhs_p (rhs))
--- 1343,1351 ----
      return;
  
    rhs = find_reg_equal_equiv_note (insn);
!   if (rhs)
!     rhs = XEXP (rhs, 0);
!   else
      rhs = SET_SRC (set);
  
    if (!simple_rhs_p (rhs))


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