egcs-2.92.02 19980905 (m68k-next-nextstep3): Address of hoisted load clobbered

Richard Henderson rth@cygnus.com
Wed Sep 9 05:52:00 GMT 1998


On Tue, Sep 08, 1998 at 07:20:25PM +0200, Toon Moene wrote:
> An excerpt from the assmebly output, around the unrolled inner loop:
> 
>         fmoved a4@,fp1		<-- Load hoisted
>         movel d4,d0
>         movel sp@(60),a4	<-- Bleeeccchhhh
>         mulsl a4@,d0
> 	...
>         fmoved fp1,a4@		<-- Store sunk
> 
> which, of course, results in a Segmentation Violation.

I'm not sure who is at fault here, and request guidance from the 
gods of reload.  The problem is shared rtl.  It may be solved with
the following patch

	* 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.


r~



More information about the Gcc mailing list