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-2.92.02 19980905 (m68k-next-nextstep3): Address of hoisted load clobbered


> 	* loop.c (load_mems): Copy rtx for output mem.
> 
> Index: loop.c
> ===================================================================
> RCS file: /egcs/carton/cvsfiles/egcs/gcc/loop.c,v
> retrieving revision 1.74
> diff -c -p -d -u -r1.74 loop.c
> --- loop.c	1998/09/04 10:37:49	1.74
> +++ loop.c	1998/09/09 07:46:32
> @@ -8802,7 +8802,7 @@ load_mems (scan_start, end, loop_top, st
>  
>  		  /* Store the memory immediately after END, which is
>  		   the NOTE_LOOP_END.  */
> -		  set = gen_rtx_SET (GET_MODE (reg), mem, reg); 
> +		  set = gen_rtx_SET (GET_MODE (reg), copy_rtx (mem), reg); 
>  		  emit_insn_after (set, label);
>  		}
>  
> But I'm unclear on the rules of shared rtl.  I would have thought
> that would have had to handle something like this already.

No, memory expressions may not be shared.
We indeed use copy_rtx and change_address in lots of places to avoid sharing
of MEMs.
For a primer on what may and what may not be shared, look at unshare_all_rtl .

So your patch seems to make sense to me.


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