re PR middle-end/30751 (internal compiler error: in extract_insn, at recog.c:2108)
authorIan Lance Taylor <iant@google.com>
Tue, 13 Feb 2007 22:18:26 +0000 (22:18 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 13 Feb 2007 22:18:26 +0000 (22:18 +0000)
PR middle-end/30751
* lower-subreg.c (resolve_simple_move): Decompose subregs in
addresses.

From-SVN: r121894

gcc/ChangeLog
gcc/lower-subreg.c

index a4bd60e8e4dabaef55b53a76280a71330ae359b9..d504109f8c6bef40951d82d2e9395ea90ac6e895 100644 (file)
@@ -1,3 +1,9 @@
+2007-02-13  Ian Lance Taylor  <iant@google.com>
+
+       PR middle-end/30751
+       * lower-subreg.c (resolve_simple_move): Decompose subregs in
+       addresses.
+
 2007-02-13  Stuart Hastings  <stuart@apple.com>
 
        * gcc/config/i386/i386.md (fixuns_truncdfhi2): Require SSE2.
index fbb506c572e686fe2376b54d49f62e863ba0aa06..908b10e4e06caafa9fe20735a24e0e93c79c20e2 100644 (file)
@@ -501,7 +501,7 @@ resolve_subreg_use (rtx *px, void *data)
         that the note must be removed.  */
       if (!x)
        {
-         gcc_assert(!insn);
+         gcc_assert (!insn);
          return 1;
        }
 
@@ -711,6 +711,23 @@ resolve_simple_move (rtx set, rtx insn)
       return insn;
     }
 
+  /* It's possible for the code to use a subreg of a decomposed
+     register while forming an address.  We need to handle that before
+     passing the address to emit_move_insn.  We pass NULL_RTX as the
+     insn parameter to resolve_subreg_use because we can not validate
+     the insn yet.  */
+  if (MEM_P (src) || MEM_P (dest))
+    {
+      int acg;
+
+      if (MEM_P (src))
+       for_each_rtx (&XEXP (src, 0), resolve_subreg_use, NULL_RTX);
+      if (MEM_P (dest))
+       for_each_rtx (&XEXP (dest, 0), resolve_subreg_use, NULL_RTX);
+      acg = apply_change_group ();
+      gcc_assert (acg);
+    }
+
   /* If SRC is a register which we can't decompose, or has side
      effects, we need to move via a temporary register.  */