ifcvt.c (noce_get_alt_condition): Use reg_overlap_mentioned_p.
authorRichard Henderson <rth@redhat.com>
Tue, 30 Jul 2002 22:13:50 +0000 (15:13 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 30 Jul 2002 22:13:50 +0000 (15:13 -0700)
        * ifcvt.c (noce_get_alt_condition): Use reg_overlap_mentioned_p.
        (noce_process_if_block): Likewise.

From-SVN: r55886

gcc/ChangeLog
gcc/ifcvt.c

index 472465f59a5847e0dab41969cae9881c3e41f743..c9b9f703ddb6a4671a282eaf0c5de5b6d68a95d8 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-30  Richard Henderson  <rth@redhat.com>
+
+       * ifcvt.c (noce_get_alt_condition): Use reg_overlap_mentioned_p.
+       (noce_process_if_block): Likewise.
+
 2002-07-30  Bernd Schmidt  <bernds@redhat.com>
 
        * ifcvt.c (cond_exec_process_if_block): Fix a merging error.
index 3ce996f8edde5d37b8e69806a659d4532b1e5a14..ecf0f77c39ccaf3676318e7e75011dd9df94100f 100644 (file)
@@ -1368,7 +1368,7 @@ noce_get_alt_condition (if_info, target, earliest)
 
   /* X may not be mentioned in the range (cond_earliest, jump].  */
   for (insn = if_info->jump; insn != *earliest; insn = PREV_INSN (insn))
-    if (INSN_P (insn) && reg_mentioned_p (if_info->x, insn))
+    if (INSN_P (insn) && reg_overlap_mentioned_p (if_info->x, PATTERN (insn)))
       return NULL;
 
   /* A and B may not be modified in the range [cond_earliest, jump).  */
@@ -1774,16 +1774,18 @@ noce_process_if_block (ce_info)
          || GET_CODE (insn_b) != INSN
          || (set_b = single_set (insn_b)) == NULL_RTX
          || ! rtx_equal_p (x, SET_DEST (set_b))
-         || reg_mentioned_p (x, cond)
-         || reg_mentioned_p (x, a)
-         || reg_mentioned_p (x, SET_SRC (set_b)))
+         || reg_overlap_mentioned_p (x, cond)
+         || reg_overlap_mentioned_p (x, a)
+         || reg_overlap_mentioned_p (x, SET_SRC (set_b)))
        insn_b = set_b = NULL_RTX;
     }
   b = (set_b ? SET_SRC (set_b) : x);
 
-  /* X may not be mentioned in the range (cond_earliest, jump].  */
+  /* X may not be mentioned in the range (cond_earliest, jump]. 
+     Note the use of reg_overlap_mentioned_p, which handles memories
+     properly, as opposed to reg_mentioned_p, which doesn't.  */
   for (insn = jump; insn != if_info.cond_earliest; insn = PREV_INSN (insn))
-    if (INSN_P (insn) && reg_mentioned_p (x, insn))
+    if (INSN_P (insn) && reg_overlap_mentioned_p (x, PATTERN (insn)))
       return FALSE;
 
   /* A and B may not be modified in the range [cond_earliest, jump).  */