]> gcc.gnu.org Git - gcc.git/commitdiff
re PR rtl-optimization/25115 (Segmentation fault in pre_insert_copy_insn)
authorRoger Sayle <roger@eyesopen.com>
Tue, 20 Dec 2005 17:06:14 +0000 (17:06 +0000)
committerPaolo Bonzini <bonzini@gcc.gnu.org>
Tue, 20 Dec 2005 17:06:14 +0000 (17:06 +0000)
2005-12-20  Roger Sayle  <roger@eyesopen.com>
    Paolo Bonzini  <bonzini@gnu.org>

PR rtl-optimization/25115
* gcse.c (pre_insert_copy_insn): Fall back to the sole
SET in the insn if there is no SET for an
expression that is equivalent to EXPR.

Co-Authored-By: Paolo Bonzini <bonzini@gnu.org>
From-SVN: r108855

gcc/ChangeLog
gcc/gcse.c

index 3c7451058f2a5604739fc81214616b4b15faccae..300c0f748bfe4edd4bf50c6ae814b0938f6d25a9 100644 (file)
@@ -1,3 +1,11 @@
+2005-12-20  Roger Sayle  <roger@eyesopen.com>
+           Paolo Bonzini  <bonzini@gnu.org>
+
+       PR rtl-optimization/25115
+       * gcse.c (pre_insert_copy_insn): Fall back to the sole
+       SET in the insn if there is no SET for an
+       expression that is equivalent to EXPR.
+
 2005-12-20  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/24306
index df6e48436a165fea0ea80099d6bed6fde849f89c..8e4dbecb672fef309947445e1184315e5acf5bd5 100644 (file)
@@ -4219,7 +4219,7 @@ pre_insert_copy_insn (struct expr *expr, rtx insn)
   int regno = REGNO (reg);
   int indx = expr->bitmap_index;
   rtx pat = PATTERN (insn);
-  rtx set, new_insn;
+  rtx set, first_set, new_insn;
   rtx old_reg;
   int i;
 
@@ -4233,17 +4233,29 @@ pre_insert_copy_insn (struct expr *expr, rtx insn)
     case PARALLEL:
       /* Search through the parallel looking for the set whose
         source was the expression that we're interested in.  */
+      first_set = NULL_RTX;
       set = NULL_RTX;
       for (i = 0; i < XVECLEN (pat, 0); i++)
        {
          rtx x = XVECEXP (pat, 0, i);
-         if (GET_CODE (x) == SET
-             && expr_equiv_p (SET_SRC (x), expr->expr))
+         if (GET_CODE (x) == SET)
            {
-             set = x;
-             break;
+             /* If the source was a REG_EQUAL or REG_EQUIV note, we
+                may not find an equivalent expression, but in this
+                case the PARALLEL will have a single set.  */
+             if (first_set == NULL_RTX)
+               first_set = x;
+             if (expr_equiv_p (SET_SRC (x), expr->expr))
+               {
+                 set = x;
+                 break;
+               }
            }
        }
+
+      gcc_assert (first_set);
+      if (set == NULL_RTX)
+        set = first_set;
       break;
 
     default:
This page took 0.081719 seconds and 5 git commands to generate.