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]

[PATCH] Fix another problem with RTX_UNCHANGING_P (take 2)


On Mon, Dec 15, 2003 at 07:51:58AM +0100, Eric Botcazou wrote:
> > The patch is not sufficient because it clears the /u flag on only one of
> > the MEMs.  Your testcase fails on SPARC with your patch applied, but
> > didn't fail without your patch so we have a regression.
> 
> Jakub, do you plan to do anything about this regression? It is present on the 
> 3.3 branch too.

There are I think two alternatives.

store_constructor makes the whole constructor /u if there are read-only
fields in it for clear_storage, so one alternative is not to do this as
in the patch below.  My 2003-12-03 patch made RTX_UNCHANGING_P not to be
set if cleared != 1 (set exactly by this code).  I believe this is the only
way to match RTX_UNCHANGING_P description in tm.texi, because otherwise
we end up with the same /u memory set multiple times (in both cases with
/u flag, but still).

Another alternative is to fix IA-32 backend (and likely others too).
There are many places where i386.md has chunks like:
   (set (mem:BLK (match_dup 3))
        (const_int 0))
The code would need changing, so that at least the RTX_UNCHANGING_P flag
is propagated from ix86_expand_* memory argument(s) to the patterns.
This matters for clrstr, movstr, cmpstr etc.
I'm not posting a patch for this one right now, but it would certainly not
be a very short patch.

Or both changes can be done together.

2003-12-15  Jakub Jelinek  <jakub@redhat.com>

	* expr.c (store_constructor): Don't set RTX_UNCHANGING_P for
	clear_storage's argument.

--- expr.c.jj	2003-12-15 09:37:32.000000000 +0100
+++ expr.c	2003-12-15 10:20:17.000000000 +0100
@@ -4563,15 +4563,7 @@ store_constructor (tree exp, rtx target,
 		   || ((HOST_WIDE_INT) GET_MODE_SIZE (GET_MODE (target))
 		       == size)))
 	{
-	  rtx xtarget = target;
-
-	  if (readonly_fields_p (type))
-	    {
-	      xtarget = copy_rtx (xtarget);
-	      RTX_UNCHANGING_P (xtarget) = 1;
-	    }
-
-	  clear_storage (xtarget, GEN_INT (size));
+	  clear_storage (target, GEN_INT (size));
 	  cleared = 1;
 	}
 


	Jakub


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