This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] PR 20331: modified_between_p always returns 0 forread-only memory


Richard Henderson <rth@redhat.com> wrote:
>> 	* rtlanal.c (modified_between_p): Check its address first for MEM.
> 
> Ok with a similar change to modified_in_p.

Thanks.  I've checked in the patch below on mainline.

Regards,
	kaz
--
2005-03-11  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR rtl-optimization/20331
	* rtlanal.c (modified_between_p): Check its address first for MEM.
	(modified_in_p): Likewise.

diff -uprN ORIG/gcc/gcc/rtlanal.c LOCAL/gcc/gcc/rtlanal.c
--- ORIG/gcc/gcc/rtlanal.c	2005-01-25 08:53:39.000000000 +0900
+++ LOCAL/gcc/gcc/rtlanal.c	2005-03-10 16:04:04.000000000 +0900
@@ -817,10 +817,10 @@ modified_between_p (rtx x, rtx start, rt
       return 1;
 
     case MEM:
-      if (MEM_READONLY_P (x))
-	return 0;
       if (modified_between_p (XEXP (x, 0), start, end))
 	return 1;
+      if (MEM_READONLY_P (x))
+	return 0;
       for (insn = NEXT_INSN (start); insn != end; insn = NEXT_INSN (insn))
 	if (memory_modified_in_insn_p (x, insn))
 	  return 1;
@@ -875,10 +875,10 @@ modified_in_p (rtx x, rtx insn)
       return 1;
 
     case MEM:
-      if (MEM_READONLY_P (x))
-	return 0;
       if (modified_in_p (XEXP (x, 0), insn))
 	return 1;
+      if (MEM_READONLY_P (x))
+	return 0;
       if (memory_modified_in_insn_p (x, insn))
 	return 1;
       return 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]