]> gcc.gnu.org Git - gcc.git/commitdiff
gcse.c (hoist_expr_reaches_here_p): Stop once expr_bb is reached.
authorJan Hubicka <jh@suse.cz>
Thu, 18 Jul 2002 07:40:16 +0000 (09:40 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 18 Jul 2002 07:40:16 +0000 (07:40 +0000)
* gcse.c (hoist_expr_reaches_here_p):  Stop once expr_bb is reached.

* gcse.c (try_replace_reg): Do not return false positives.

From-SVN: r55553

gcc/ChangeLog
gcc/gcse.c

index f99c294f9c136f170b4c7b997cc5fac48ca01b19..48a3607c20bc6a1fc3332ed3ab904e898b8db023 100644 (file)
@@ -1,3 +1,9 @@
+Thu Jul 18 09:38:59 CEST 2002  Jan Hubicka  <jh@suse.cz>
+
+       * gcse.c (hoist_expr_reaches_here_p):  Stop once expr_bb is reached.
+
+       * gcse.c (try_replace_reg): Do not return false positives.
+
 2002-07-18  Alan Modra  <amodra@bigpond.net.au>
 
        * prefix.c: (update_path): Strip ".." components when prior dir
index 665be1fd9a35d2b22b1230fa5fd2ce181b23d59c..bb362118b2137b30a3be8e62b07437fc853f87f8 100644 (file)
@@ -3971,24 +3971,27 @@ try_replace_reg (from, to, insn)
   int success = 0;
   rtx set = single_set (insn);
 
-  success = validate_replace_src (from, to, insn);
+  if (reg_mentioned_p (from, PATTERN (insn)))
+    {
+      success = validate_replace_src (from, to, insn);
+    }
 
-  /* If above failed and this is a single set, try to simplify the source of
-     the set given our substitution.  We could perhaps try this for multiple
-     SETs, but it probably won't buy us anything.  */
-  if (!success && set != 0)
+  if (!success && set && reg_mentioned_p (from, SET_SRC (set)))
     {
+      /* If above failed and this is a single set, try to simplify the source of
+        the set given our substitution.  We could perhaps try this for multiple
+        SETs, but it probably won't buy us anything.  */
       src = simplify_replace_rtx (SET_SRC (set), from, to);
 
       if (!rtx_equal_p (src, SET_SRC (set))
          && validate_change (insn, &SET_SRC (set), src, 0))
        success = 1;
-    }
 
-  /* If we've failed to do replacement, have a single SET, and don't already
-     have a note, add a REG_EQUAL note to not lose information.  */
-  if (!success && note == 0 && set != 0)
-    note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
+      /* If we've failed to do replacement, have a single SET, and don't already
+        have a note, add a REG_EQUAL note to not lose information.  */
+      if (!success && note == 0 && set != 0)
+       note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
+    }
 
   /* If there is already a NOTE, update the expression in it with our
      replacement.  */
@@ -5879,6 +5882,8 @@ hoist_expr_reaches_here_p (expr_bb, expr_index, bb, visited)
 
       if (pred->src == ENTRY_BLOCK_PTR)
        break;
+      else if (pred_bb == expr_bb)
+       continue;
       else if (visited[pred_bb->index])
        continue;
 
This page took 0.088866 seconds and 5 git commands to generate.