]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR rtl-optimization/13060 ([g77] ICE in fixup_var_refs_1, at function...
authorEric Botcazou <ebotcazou@libertysurf.fr>
Thu, 11 Dec 2003 07:58:00 +0000 (08:58 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 11 Dec 2003 07:58:00 +0000 (07:58 +0000)
Backport from mainline:

2003-12-07  Eric Botcazou  <ebotcazou@libertysurf.fr>

PR optimization/13060
* function.c (fixup_var_refs_1) [SUBREG]: Recognize even if a
replacement already exists.  Fix again the whole insn if that fails.

From-SVN: r74531

gcc/ChangeLog
gcc/function.c
gcc/testsuite/ChangeLog

index 69c4bbb3e9a0b49e924ef62443c3af4adce5220e..44955b318e69ffa6d24913f01f5d411c391756a7 100644 (file)
@@ -1,3 +1,13 @@
+2003-12-11  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       Backport from mainline:
+
+       2003-12-07  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR optimization/13060
+       * function.c (fixup_var_refs_1) [SUBREG]: Recognize even if a
+       replacement already exists.  Fix again the whole insn if that fails.
+
 2003-12-11  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        Backport from mainline:
index 3d2440a849be04b5aabc04d4d4f3ffa57305eca8..eedd909c43630ffed660653f0a2140f2e6c891f8 100644 (file)
@@ -2180,7 +2180,23 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements, no_share)
          replacement = find_fixup_replacement (replacements, x);
          if (replacement->new)
            {
+             enum machine_mode mode = GET_MODE (x);
              *loc = replacement->new;
+
+             /* Careful!  We may have just replaced a SUBREG by a MEM, which
+                means that the insn may have become invalid again.  We can't
+                in this case make a new replacement since we already have one
+                and we must deal with MATCH_DUPs.  */
+             if (GET_CODE (replacement->new) == MEM)
+               {
+                 INSN_CODE (insn) = -1;
+                 if (recog_memoized (insn) >= 0)
+                   return;
+
+                 fixup_var_refs_1 (replacement->new, mode, &PATTERN (insn),
+                                   insn, replacements, no_share);
+               }
+
              return;
            }
 
index b36c36ca24d02418c835f90fa853005d66bde59c..5577bcd748961076b02f5550fd3088a0733b3809 100644 (file)
@@ -1,3 +1,11 @@
+2003-12-11  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       Backport from mainline:
+
+       2003-12-07  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * g77.f-torture/compile/13060.f: New test.
+
 2003-12-11  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        Backport from mainline: