This is the mail archive of the 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: GCC Status Report (2004-03-09)

> Well, so, let's remove that chunk of code; it should no longer be needed.

No, not the whole chunk of code.  The pessimization was introduced by:

2003-04-07  Glen Nakamura  <>

	PR opt/8634
	* explow.c (maybe_set_unchanging): Don't flag non-static const
	aggregate type initializers with RTX_UNCHANGING_P.

RCS file: /cvs/gcc/gcc/gcc/explow.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- gcc/gcc/explow.c	2003/03/20 22:51:39	1.107
+++ gcc/gcc/explow.c	2003/04/07 22:57:41	1.108
@@ -657,8 +657,18 @@
   /* We can set RTX_UNCHANGING_P from TREE_READONLY for decls whose
      initialization is only executed once, or whose initializer always
      has the same value.  Currently we simplify this to PARM_DECLs in the
-     first case, and decls with TREE_CONSTANT initializers in the second.  
+     first case, and decls with TREE_CONSTANT initializers in the second.
+     We cannot do this for non-static aggregates, because of the double
+     writes that can be generated by store_constructor, depending on the
+     contents of the initializer.  Yes, this does eliminate a good fraction
+     of the number of uses of RTX_UNCHANGING_P for a language like Ada.
+     It also eliminates a good quantity of bugs.  Let this be incentive to
+     eliminate RTX_UNCHANGING_P entirely in favour of a more reliable
+     solution, perhaps based on alias sets.  */
   if ((TREE_READONLY (t) && DECL_P (t)
+       && (TREE_STATIC (t) || ! AGGREGATE_TYPE_P (TREE_TYPE (t)))
        && (TREE_CODE (t) == PARM_DECL
       || TREE_CODE_CLASS (TREE_CODE (t)) == 'c')

Do you want me to revert that patch?

> Eric, I can tell you're unhappy with this approach, and so you're
> casting about for something better.  That's good, but I think we've come
> as far as we can for 3.4.0.

Yes, I'm pretty frustrated because we're (again) chasing down a far-reaching 
bug just days before a release.

> If all this is sufficiently annoyhing to you, maybe you can work on ripping
> out RTX_UNCHANGING_P for 3.5 and replacing it with something better!

Before I start thinking about a replacement, I'd like to understand what I'll 
be trying the replace.  It appears that no-bo-dy can tell what is the 
purpose of RTX_UNCHANGING_P.

Eric Botcazou

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