From patchwork Fri Jul 14 16:51:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 788633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3x8Jc94HfGz9s76 for ; Sat, 15 Jul 2017 02:51:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="eeuFqPWV"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=NVEbFgfMsQiEk3YqI 4oVXOH8IyEb9fToHCNbwi09qZorO7tsrfuAb3Qw9m3tVOwE5TbyoH44Ovr3udslv 19iUx3PLOCrPvzEaJjAXmdlR3W1gvFxsFtUJUEDgaGNbielGRbLRrzCbg33Ii4oN eekOVyw0IS952ACx8uryESsMmM= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=G8Du5eR0f11Mg8WmG99Po75 fZUk=; b=eeuFqPWV3p0qIAx5FIy+FhQofSt9h/qm/kTZ2oLwsMmIJRk7p6hNVO1 IQGq5BJfrZhPEixKsXPCTvKcd9/onR9eq+r6sQ524PkwlYRWyV7JCDF6xuIPnzP1 c6qlTK5iBlt7gDLK59koa5k6L4N/UctY2Cq/KEe+d8cvEwcnBgsw= Received: (qmail 72822 invoked by alias); 14 Jul 2017 16:51:14 -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 72811 invoked by uid 89); 14 Jul 2017 16:51:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2666 X-HELO: mail-it0-f43.google.com Received: from mail-it0-f43.google.com (HELO mail-it0-f43.google.com) (209.85.214.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Jul 2017 16:51:12 +0000 Received: by mail-it0-f43.google.com with SMTP id m68so24610018ith.1 for ; Fri, 14 Jul 2017 09:51:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to; bh=a83DpUyKKwDZ8ZJ7LYzZB+kL3DnZXPzqMaO2yER/SQ8=; b=Rt3RZJ0g0tMDKpCYMtgDwLi4UPgD2+9w66Byo1As7EpodjCkS2tgiWYLhmVZ21PiJz qmya1/mHa4/xjCBWUNP5DL4WfOa2NWfqFHkI9MT9U7opgfBOI/GmMidpz/J/HkS/ry+z kgUmzU9DR19MsCH9jhy5OrNW3/QkSdt+CuQybddOAMGGq+k/AdVZhbIw3RcfkEnzhb1b PGKYDoJoZ73g2bVyD0yYdhGawS7D1e4h0tt6vPnAVF4u6TlVNv15RZhTnRvClZI3RplF uz0jEVDDbBLuFY8hfk6kQeoJ0n0KprYUykgL4tt1dFyc+bHJ5b0vJVvSPwGMN5wazSQF YuAg== X-Gm-Message-State: AIVw112Sf7AS6PPcT16XFnW1eh1iY7RMiijFXLjkNk/qeWFw8q2NbhOQ V/nP+R+/oswsZQ== X-Received: by 10.36.76.7 with SMTP id a7mr4268620itb.67.1500051070324; Fri, 14 Jul 2017 09:51:10 -0700 (PDT) Received: from [100.64.209.104] (public-120-7.nat.utoronto.ca. [138.51.120.7]) by smtp.googlemail.com with ESMTPSA id 125sm1511040itz.7.2017.07.14.09.51.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 09:51:09 -0700 (PDT) Subject: Re: [PATCH] Kill TYPE_METHODS ipa 2/9 To: GCC Patches References: <8377f2cd-577c-60b2-63ac-f2619ebe63aa@acm.org> Cc: Jason Merrill , Richard Guenther , Jim Wilson , Jan Hubicka From: Nathan Sidwell Message-ID: Date: Fri, 14 Jul 2017 12:51:09 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <8377f2cd-577c-60b2-63ac-f2619ebe63aa@acm.org> This patch changes ipa-devirt. It contains a loop checking all the member functions are 'the same'. However, as the comment says, we've already zapped TYPE_METHODS, so the loop is never entered. I've added equivalent zapping in this patch series, as the rationale appears to be reducing memory footprint. It didn't seem appropriate to merge into the TYPE_FIELDS loop, given it's never exercised. I'd appreciate review. nathan Index: gcc/ipa-devirt.c =================================================================== --- gcc/ipa-devirt.c (revision 250160) +++ gcc/ipa-devirt.c (working copy) @@ -1602,62 +1602,6 @@ odr_types_equivalent_p (tree t1, tree t2 return false; } - if ((TYPE_MAIN_VARIANT (t1) == t1 || TYPE_MAIN_VARIANT (t2) == t2) - && COMPLETE_TYPE_P (TYPE_MAIN_VARIANT (t1)) - && COMPLETE_TYPE_P (TYPE_MAIN_VARIANT (t2)) - && odr_type_p (TYPE_MAIN_VARIANT (t1)) - && odr_type_p (TYPE_MAIN_VARIANT (t2)) - && (TYPE_METHODS (TYPE_MAIN_VARIANT (t1)) - != TYPE_METHODS (TYPE_MAIN_VARIANT (t2)))) - { - /* Currently free_lang_data sets TYPE_METHODS to error_mark_node - if it is non-NULL so this loop will never realy execute. */ - if (TYPE_METHODS (TYPE_MAIN_VARIANT (t1)) != error_mark_node - && TYPE_METHODS (TYPE_MAIN_VARIANT (t2)) != error_mark_node) - for (f1 = TYPE_METHODS (TYPE_MAIN_VARIANT (t1)), - f2 = TYPE_METHODS (TYPE_MAIN_VARIANT (t2)); - f1 && f2 ; f1 = DECL_CHAIN (f1), f2 = DECL_CHAIN (f2)) - { - if (DECL_ASSEMBLER_NAME (f1) != DECL_ASSEMBLER_NAME (f2)) - { - warn_odr (t1, t2, f1, f2, warn, warned, - G_("a different method of same type " - "is defined in another " - "translation unit")); - return false; - } - if (DECL_VIRTUAL_P (f1) != DECL_VIRTUAL_P (f2)) - { - warn_odr (t1, t2, f1, f2, warn, warned, - G_("a definition that differs by virtual " - "keyword in another translation unit")); - return false; - } - if (DECL_VINDEX (f1) != DECL_VINDEX (f2)) - { - warn_odr (t1, t2, f1, f2, warn, warned, - G_("virtual table layout differs " - "in another translation unit")); - return false; - } - if (odr_subtypes_equivalent_p (TREE_TYPE (f1), - TREE_TYPE (f2), visited, - loc1, loc2)) - { - warn_odr (t1, t2, f1, f2, warn, warned, - G_("method with incompatible type is " - "defined in another translation unit")); - return false; - } - } - if ((f1 == NULL) != (f2 == NULL)) - { - warn_odr (t1, t2, NULL, NULL, warn, warned, - G_("a type with different number of methods " - "is defined in another translation unit")); - return false; - } - } } break; }