emit-rtl.c (copy_rtx_if_shared): A MEM which references virtual_stack_vars_rtx or...
authorJeffrey A Law <law@cygnus.com>
Tue, 31 Aug 1999 06:28:16 +0000 (06:28 +0000)
committerJeff Law <law@gcc.gnu.org>
Tue, 31 Aug 1999 06:28:16 +0000 (00:28 -0600)
        * emit-rtl.c (copy_rtx_if_shared): A MEM which references
        virtual_stack_vars_rtx or virtual_incoming_args_rtx can not
        be shared.

From-SVN: r29001

gcc/ChangeLog
gcc/emit-rtl.c

index 0279ec0628959e4e0574d11fd0604e5c6ca449c2..caf5c004d45f38ff3eb542b094c351340c511d93 100644 (file)
@@ -42,10 +42,6 @@ Mon Aug 30 16:07:49 1999  Richard Henderson  <rth@cygnus.com>
        * flow.c (new_insn_dead_notes): Use sets_reg_or_subreg not
        mark_set_resources.
 
-Mon Aug 30 16:36:33 1999  Jeffrey A Law  (law@cygnus.com)
-
-       * invoke.texi: Fix typo.
-
 Mon Aug 30 12:23:53 1999  Jim Wilson  <wilson@cygnus.com>
 
        * fixinc/Makefile.in (subdir): New.
@@ -54,6 +50,12 @@ Mon Aug 30 12:23:53 1999  Jim Wilson  <wilson@cygnus.com>
        
 Mon Aug 30 01:02:09 1999  Jeffrey A Law  (law@cygnus.com)
 
+       * emit-rtl.c (copy_rtx_if_shared): A MEM which references
+       virtual_stack_vars_rtx or virtual_incoming_args_rtx can not
+       be shared.
+
+       * invoke.texi: Fix typo.
+
        * dwarf2out.c (mem_loc_descriptor): New argument MODE.  All callers
        changed.  Handle autoincrement addressing modes.
 
index b028556cb162f8e0613ed9da2ec2667efa028494..79c179ceb63d77aac685a51b2e0fb2da3b5e373c 100644 (file)
@@ -1678,16 +1678,18 @@ copy_rtx_if_shared (orig)
       return x;
 
     case MEM:
-      /* A MEM is allowed to be shared if its address is constant
-        or is a constant plus one of the special registers.  */
-      if (CONSTANT_ADDRESS_P (XEXP (x, 0))
-         || XEXP (x, 0) == virtual_stack_vars_rtx
-         || XEXP (x, 0) == virtual_incoming_args_rtx)
+      /* A MEM is allowed to be shared if its address is constant.
+
+        We used to allow sharing of MEMs which referenced 
+        virtual_stack_vars_rtx or virtual_incoming_args_rtx, but
+        that can lose.  instantiate_virtual_regs will not unshare
+        the MEMs, and combine may change the structure of the address
+        because it looks safe and profitable in one context, but
+        in some other context it creates unrecognizable RTL.  */
+      if (CONSTANT_ADDRESS_P (XEXP (x, 0)))
        return x;
 
       if (GET_CODE (XEXP (x, 0)) == PLUS
-         && (XEXP (XEXP (x, 0), 0) == virtual_stack_vars_rtx
-             || XEXP (XEXP (x, 0), 0) == virtual_incoming_args_rtx)
          && CONSTANT_ADDRESS_P (XEXP (XEXP (x, 0), 1)))
        {
          /* This MEM can appear in more than one place,