function.h (struct emit_status): Clarify potential contents of regno_reg_rtx array.
authorJan Hubicka <jh@suse.cz>
Sun, 23 Jun 2002 15:57:53 +0000 (17:57 +0200)
committerJeff Law <law@gcc.gnu.org>
Sun, 23 Jun 2002 15:57:53 +0000 (09:57 -0600)
        * function.h (struct emit_status): Clarify potential contents
        of regno_reg_rtx array.
        * integrate.c (copy_rtx_and_substitute): Update comments.  Make
        sure entry in regno_reg_rtx is a REG before checking REG_POINTER.

Co-Authored-By: Jeff Law <law@redhat.com>
From-SVN: r54924

gcc/ChangeLog
gcc/function.h
gcc/integrate.c

index 8d31820a2f76d08d67bd546817cf1770b93bd7ad..640962500b998d26a794daac497fdb3682189095 100644 (file)
@@ -1,4 +1,10 @@
 2002-06-23  Jan Hubicka  <jh@suse.cz>
+           Jeff Law <law@redhat.com>
+
+       * function.h (struct emit_status): Clarify potential contents
+       of regno_reg_rtx array.
+       * integrate.c (copy_rtx_and_substitute): Update comments.  Make
+       sure entry in regno_reg_rtx is a REG before checking REG_POINTER.
 
        * reg-stack.c (convert_regs_exit): Push the registers to stack in
        proper order.
index 1c6337c9176b4d8e90c61945309b067ab49d106d..3dbd6fd4abd69b6e9c212371611a32da74e1e972 100644 (file)
@@ -105,7 +105,10 @@ struct emit_status GTY(())
   tree * GTY ((length ("%h.regno_pointer_align_length"))) regno_decl;
 
   /* Indexed by pseudo register number, gives the rtx for that pseudo.
-     Allocated in parallel with regno_pointer_align.  */
+     Allocated in parallel with regno_pointer_align. 
+
+     Note MEM expressions can appear in this array due to the actions
+     of put_var_into_stack.  */
   rtx * GTY ((length ("%h.regno_pointer_align_length"))) x_regno_reg_rtx;
 };
 
index 4bbfcea42fcf53fed4bbbb8a10366514c7d579f4..ead6d31df80643a019b1c9511cfa3f362f195213 100644 (file)
@@ -2062,7 +2062,17 @@ copy_rtx_and_substitute (orig, map, for_lhs)
          RTX_UNCHANGING_P (map->reg_map[regno]) = RTX_UNCHANGING_P (temp);
          /* A reg with REG_FUNCTION_VALUE_P true will never reach here.  */
 
-         if (REG_POINTER (map->x_regno_reg_rtx[regno]))
+         /* Objects may initially be represented as registers, but
+            but turned into a MEM if their address is taken by
+            put_var_into_stack.  Therefore, the register table may have
+            entries which are MEMs.
+
+            We briefly tried to clear such entries, but that ended up
+            cascading into many changes due to the optimizers not being
+            prepared for empty entries in the register table.  So we've
+            decided to allow the MEMs in the register table for now.  */
+         if (REG_P (map->x_regno_reg_rtx[regno])
+             && REG_POINTER (map->x_regno_reg_rtx[regno]))
            mark_reg_pointer (map->reg_map[regno],
                              map->regno_pointer_align[regno]);
          regno = REGNO (map->reg_map[regno]);