public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Drop TYPE_NEEDS_CONSTRUCTING checks from ipa-pure-const and tree-inline
@ 2015-06-14 22:38 Jan Hubicka
  2015-06-16 13:58 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Hubicka @ 2015-06-14 22:38 UTC (permalink / raw)
  To: gcc-patches, rguenther

Hi,
this patch removes last two remaining uses of TYPE_NEEDS_CONSTRUCTING
in the back-end.  I believe those are remainders from the time we did not
gimplify as much as we do now. Alias analysis machinery already skips
checks of TYPE_NEEDS_CONSTRUCTING and thus we need to mark tree correctly
as non-readonly if it is constructed.

Incrementally I would like to remove TYPE_NEEDS_CONSTRUCTING streaming
and clear it in free_lang_data.

Bootstrapped/regtested ppc64le-linux, OK?

Honza

	* ipa-pure-const.c (check_decl): Do not check TYPE_NEEDS_CONSTRUCTING.
	* tree-inline.c (setup_one_parameter): Likewise.
Index: ipa-pure-const.c
===================================================================
--- ipa-pure-const.c	(revision 224463)
+++ ipa-pure-const.c	(working copy)
@@ -335,7 +335,7 @@
   if (DECL_EXTERNAL (t) || TREE_PUBLIC (t))
     {
       /* Readonly reads are safe.  */
-      if (TREE_READONLY (t) && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (t)))
+      if (TREE_READONLY (t))
 	return; /* Read of a constant, do not change the function state.  */
       else
 	{
Index: tree-inline.c
===================================================================
--- tree-inline.c	(revision 224463)
+++ tree-inline.c	(working copy)
@@ -3151,18 +3151,6 @@
      automatically replaced by the VAR_DECL.  */
   insert_decl_map (id, p, var);
 
-  /* Even if P was TREE_READONLY, the new VAR should not be.
-     In the original code, we would have constructed a
-     temporary, and then the function body would have never
-     changed the value of P.  However, now, we will be
-     constructing VAR directly.  The constructor body may
-     change its value multiple times as it is being
-     constructed.  Therefore, it must not be TREE_READONLY;
-     the back-end assumes that TREE_READONLY variable is
-     assigned to only once.  */
-  if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (p)))
-    TREE_READONLY (var) = 0;
-
   /* If there is no setup required and we are in SSA, take the easy route
      replacing all SSA names representing the function parameter by the
      SSA name passed to function.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-16 22:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-14 22:38 Drop TYPE_NEEDS_CONSTRUCTING checks from ipa-pure-const and tree-inline Jan Hubicka
2015-06-16 13:58 ` Richard Biener
2015-06-16 23:22   ` Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).