public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Walk pointer_to and reference_to chain in free_lang_data
@ 2018-08-21 21:06 Jan Hubicka
  2018-08-22  7:11 ` Richard Biener
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Hubicka @ 2018-08-21 21:06 UTC (permalink / raw)
  To: gcc-patches, rguenther

Hi,
extra sanity checking I am going to send in followup patch noticed that we
stream pointer types that was never seen by free_lang_data.  This is because
they are referenced by TYPE_POINTER_TO list and are inserted into the gimple
statements later when we wrap everything in MEM_REF (by make_pointer_type).

Bootstrapped/regtested x86_64-linux, OK?

Honza

	* tree.c (find_decls_types_r): Walk also TYPE_NEXT_PTR_TO and
	TYPE_NEXT_REF_TO.
Index: tree.c
===================================================================
--- tree.c	(revision 263699)
+++ tree.c	(working copy)
@@ -5525,9 +5525,14 @@ find_decls_types_r (tree *tp, int *ws, v
       fld_worklist_push (TYPE_POINTER_TO (t), fld);
       fld_worklist_push (TYPE_REFERENCE_TO (t), fld);
       fld_worklist_push (TYPE_NAME (t), fld);
-      /* Do not walk TYPE_NEXT_PTR_TO or TYPE_NEXT_REF_TO.  We do not stream
-	 them and thus do not and want not to reach unused pointer types
-	 this way.  */
+      /* While we do not stream TYPE_POINTER_TO and TYPE_REFERENCE_TO
+	 lists, we may look types up in these lists and use them while
+	 optimizing the function body.  Thus we need to free lang data
+	 in them.  */
+      if (TREE_CODE (t) == POINTER_TYPE)
+        fld_worklist_push (TYPE_NEXT_PTR_TO (t), fld);
+      if (TREE_CODE (t) == REFERENCE_TYPE)
+        fld_worklist_push (TYPE_NEXT_REF_TO (t), fld);
       if (!POINTER_TYPE_P (t))
 	fld_worklist_push (TYPE_MIN_VALUE_RAW (t), fld);
       /* TYPE_MAX_VALUE_RAW is TYPE_BINFO for record types.  */

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

end of thread, other threads:[~2018-08-23 12:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-21 21:06 Walk pointer_to and reference_to chain in free_lang_data Jan Hubicka
2018-08-22  7:11 ` Richard Biener
2018-08-22  7:23   ` Jan Hubicka
2018-08-22  7:31     ` Richard Biener
2018-08-22  8:00       ` Jan Hubicka
2018-08-23 12:00       ` Jan Hubicka
2018-08-23 12:06         ` Richard Biener
2018-08-23 12:06       ` Jan Hubicka
2018-08-23 12:20         ` Richard Biener
2018-08-23 12:26           ` 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).