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]
Other format: [Raw text]

[new-ra] Fix rematerialization


Hi,

with my method of adding spill code we weren't anymore rematerializing
webs.  This activates it again.  Bootstrapped on x86+amd64, all langs
(with Ada), with MICHAEL #defined.


Ciao,
Michael.
-- 

        * ra-rewrite.c (emit_loads): Do loads from rematerializable webs.

Index: ra-rewrite.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-rewrite.c,v
retrieving revision 1.1.2.25
diff -u -p -r1.1.2.25 ra-rewrite.c
--- ra-rewrite.c	29 Oct 2003 13:59:24 -0000	1.1.2.25
+++ ra-rewrite.c	10 Nov 2003 09:41:25 -0000
@@ -1087,13 +1087,30 @@ emit_loads (struct rewrite_info *ri, int
       aweb = alias (supweb);
       aweb->changed = 1;
       start_sequence ();
-      allocate_spill_web (aweb);
-      slot = aweb->stack_slot;
+#ifdef MICHAEL
+      if (supweb->pattern)
+	{
+	  /* XXX If we later allow non-constant sources for rematerialization
+	     we must also disallow coalescing _to_ rematerialized webs
+	     (at least then disallow spilling them, which we already ensure
+	     when flag_ra_break_aliases), or not take the pattern but a
+	     stackslot.  */
+	  if (aweb != supweb)
+	    abort ();
+	  slot = copy_rtx (supweb->pattern);
+	  innermode = GET_MODE (supweb->orig_x);
+	}
+      else
+#endif
+	{
+	  allocate_spill_web (aweb);
+	  slot = aweb->stack_slot;
+	  innermode = GET_MODE (slot);
+	}
 #ifdef SPILLING_STATISTICS
       if (REG_P (slot))
 	bitmap_set_bit (rewrite_spill_slots, REGNO (slot));
 #endif
-      innermode = GET_MODE (slot);
       /* If we don't copy the RTL there might be some SUBREG
 	 rtx shared in the next iteration although being in
 	 different webs, which leads to wrong code.  */


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