From patchwork Tue Aug 21 21:05:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 960722 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-484137-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Ufnk0jpN"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41w3BF1Phfz9s4Z for ; Wed, 22 Aug 2018 07:06:11 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=bHHp8Ok6grd476sRf8gQNnGfSeB7ABCzkakAjB/0OnKm1lThxlqE9 Wycquxf9px78hBBvHT5iDHpMDhlde8Es/9giNB//WCR384qSHEeNBR4Rlb0qcg3f hKR1NjX5vpQTKVpy4BFMMqR0arlR/nrc8+do4AujLTopHEoLLj3x/0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=nASvZaz6j7K7iN4PRdCAJbGw05A=; b=Ufnk0jpNhYLTwT4iOruo hEiGAscMFF84qq1R4Xq1Qbp7+/2A9KOScgAwtv1Zxa/0TwrgOxujC8fbpTV/pn51 fmtkd2HUT2L4ZFDY9AljKiA6xTMC2OmGqu1IdnX1bwoy/0dwwFetTgVTcoRfMSHr UPV4siuzC8de5uyBoRvgzj4= Received: (qmail 52338 invoked by alias); 21 Aug 2018 21:06:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 52322 invoked by uid 89); 21 Aug 2018 21:06:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=fld, sk:find_de, honza, *ws X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Aug 2018 21:06:01 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 39093540BC1; Tue, 21 Aug 2018 23:05:57 +0200 (CEST) Date: Tue, 21 Aug 2018 23:05:57 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Walk pointer_to and reference_to chain in free_lang_data Message-ID: <20180821210557.GA30630@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) 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. */