This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Improvement for update_equiv_regs
- To: law at cygnus dot com
- Subject: Re: Improvement for update_equiv_regs
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Tue, 9 Feb 1999 21:20:47 +0000 (GMT)
- Cc: amylaar at cygnus dot co dot uk, wilson at cygnus dot com, egcs-patches at egcs dot cygnus dot com
> Tue Feb 9 18:23:29 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
...
> * optabs.c (expand_binop): Also add REG_EQUAL note to single-insn
> sequence.
That in turn triggered an alias bug. When faced with
(insn 78 76 79 (set (reg:SI 41)
(plus:SI (reg/v:SI 26)
(const_int 1))) -1 (nil)
(expr_list:REG_EQUAL (plus:SI (reg:SI 41)
(const_int 1))
(nil)))
init_aliaas_analysis will set reg_known_value[41] to
(plus:SI (reg:SI 41) (const_int 1)) , thus causing infinite recursion of
canon_rtx. Here is a fix:
Tue Feb 9 21:14:03 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* alias.c (init_alias_analysis): Avoid self-referential value
when setting reg_known_value from REG_EQUAL notes.
Index: alias.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/alias.c,v
retrieving revision 1.21
diff -p -r1.21 alias.c
*** alias.c 1999/01/20 17:50:17 1.21
--- alias.c 1999/02/09 21:15:11
*************** init_alias_analysis ()
*** 1465,1471 ****
&& (((note = find_reg_note (insn, REG_EQUAL, 0)) != 0
&& REG_N_SETS (REGNO (SET_DEST (set))) == 1)
|| (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != 0)
! && GET_CODE (XEXP (note, 0)) != EXPR_LIST)
{
int regno = REGNO (SET_DEST (set));
reg_known_value[regno] = XEXP (note, 0);
--- 1465,1472 ----
&& (((note = find_reg_note (insn, REG_EQUAL, 0)) != 0
&& REG_N_SETS (REGNO (SET_DEST (set))) == 1)
|| (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != 0)
! && GET_CODE (XEXP (note, 0)) != EXPR_LIST
! && ! reg_overlap_mentioned_p (SET_DEST (set), XEXP (note, 0)))
{
int regno = REGNO (SET_DEST (set));
reg_known_value[regno] = XEXP (note, 0);