This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-2.92.02 19980905 (m68k-next-nextstep3): Address of hoisted load clobbered
- To: rth at cygnus dot com
- Subject: Re: egcs-2.92.02 19980905 (m68k-next-nextstep3): Address of hoisted load clobbered
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Thu, 10 Sep 1998 00:37:44 +0100 (BST)
- Cc: toon at moene dot indiv dot nluug dot nl, egcs at cygnus dot com, egcs-patches at cygnus dot com
> * 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.