re PR target/23196 (ICE instantiate_virtual_regs_in_insn when -fforce-addr used)
authorRichard Henderson <rth@redhat.com>
Tue, 2 Aug 2005 20:39:24 +0000 (13:39 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 2 Aug 2005 20:39:24 +0000 (13:39 -0700)
        PR 23196
        * explow.c (memory_address): Remove special-case for
        virtual_stack_vars_rtx and virtual_incoming_args_rtx.

From-SVN: r102668

gcc/ChangeLog
gcc/explow.c
gcc/testsuite/gcc.c-torture/compile/20050802-1.c [new file with mode: 0644]

index a323b8fbeec51ff9d66172f9783314a2d7774894..cf11cc3ffd98a4dd20bb69ed02b8a60f9d947d8c 100644 (file)
@@ -1,3 +1,9 @@
+2005-08-02  Richard Henderson  <rth@redhat.com>
+
+       PR 23196
+       * explow.c (memory_address): Remove special-case for 
+       virtual_stack_vars_rtx and virtual_incoming_args_rtx.
+
 2005-08-02  Diego Novillo  <dnovillo@redhat.com>
 
        PR 23164
index 23b124fbbb596fef8e55f42344254d3c832d9ccd..eea0e562289eba0c9045a00ce6f6b189e612e5d3 100644 (file)
@@ -477,16 +477,10 @@ memory_address (enum machine_mode mode, rtx x)
     win2:
       x = oldx;
     win:
-      if (flag_force_addr && ! cse_not_expected && !REG_P (x)
-         /* Don't copy an addr via a reg if it is one of our stack slots.  */
-         && ! (GET_CODE (x) == PLUS
-               && (XEXP (x, 0) == virtual_stack_vars_rtx
-                   || XEXP (x, 0) == virtual_incoming_args_rtx)))
+      if (flag_force_addr && ! cse_not_expected && !REG_P (x))
        {
-         if (general_operand (x, Pmode))
-           x = force_reg (Pmode, x);
-         else
-           x = force_operand (x, NULL_RTX);
+         x = force_operand (x, NULL_RTX);
+         x = force_reg (Pmode, x);
        }
     }
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/20050802-1.c b/gcc/testsuite/gcc.c-torture/compile/20050802-1.c
new file mode 100644 (file)
index 0000000..abd0b51
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR 23196 */
+/* { dg-options "-fforce-addr" } */
+
+void foo()
+{
+  char c;
+
+  c |= 1;
+  bar(&c);
+}