4 GCC regressions, 2 new, with your patch on 2002-07-18T09:56:17Z.

Richard Henderson rth@redhat.com
Tue Jul 30 15:17:00 GMT 2002


On Mon, Jul 22, 2002 at 10:25:41PM +0200, Jan Hubicka wrote:
> 	* ifcvt.c (noce_process_if_block): Verify that X is not
> 	modified.

I like the following better.  First it doesn't imply modified,
and second it does (mostly) the right thing with mems.

This by itself fixes the regression.  I'm still looking at the
gcse change.  I think if we're careful it's a Good Thing, since
there are several places in which if conditions are expected to
be in sequential instructions.


r~


        * ifcvt.c (noce_get_alt_condition): Use reg_overlap_mentioned_p.
        (noce_process_if_block): Likewise.

Index: ifcvt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ifcvt.c,v
retrieving revision 1.99
diff -c -p -d -u -r1.99 ifcvt.c
--- ifcvt.c	30 Jul 2002 21:48:13 -0000	1.99
+++ ifcvt.c	30 Jul 2002 22:12:49 -0000
@@ -1368,7 +1368,7 @@ noce_get_alt_condition (if_info, target,
 
   /* 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).  */



More information about the Gcc-regression mailing list