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]

Re: egcs-current: Major optimizer bug


Hi,

H.J. Lu:
> Hi,
> 
> Can you try this patch for your bug?
> 
That does the job. Thanks!!!

(Interestingly, the bug also vanishes if you use -O3.)

> -- 
> H.J. Lu (hjl@gnu.org)
> ---
> Tue Jun 30 07:37:48 1998  H.J. Lu  (hjl@gnu.org)
> 
> 	* local-alloc.c (update_equiv_regs): Check if a REG_EQUIV note
> 	is valid.
> 
> Index: local-alloc.c
> ===================================================================
> RCS file: /home/work/cvs/gnu/egcs/gcc/local-alloc.c,v
> retrieving revision 1.1.1.14
> diff -u -p -r1.1.1.14 local-alloc.c
> --- local-alloc.c	1998/06/25 15:54:37	1.1.1.14
> +++ local-alloc.c	1998/06/30 18:36:18
> @@ -874,7 +874,11 @@ update_equiv_regs ()
>  	 If we don't have a REG_EQUIV note, see if this insn is loading
>  	 a register used only in one basic block from a MEM.  If so, and the
>  	 MEM remains unchanged for the life of the register, add a REG_EQUIV
> -	 note.  */
> +	 note.
> +
> +	 We should double check if the REG_EQUIV note is suitable for
> +	 our purpose. The REG_EQUIV note may not be valid across
> +	 a CALL_INSN insn.  */
>  	 
>        note = find_reg_note (insn, REG_EQUIV, NULL_RTX);
>  
> @@ -883,6 +887,9 @@ update_equiv_regs ()
>  	  && validate_equiv_mem (insn, dest, SET_SRC (set)))
>  	REG_NOTES (insn) = note = gen_rtx_EXPR_LIST (REG_EQUIV, SET_SRC (set),
>  						     REG_NOTES (insn));
> +      else if (note && GET_CODE (XEXP (note, 0)) == MEM
> +	       && !validate_equiv_mem (insn, dest, XEXP (note, 0)))
> +	note = NULL_RTX;
>  
>        if (note)
>  	{

-- 
Matthias Urlichs
noris network GmbH


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