From patchwork Fri Jul 14 16:54:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 788634 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 3x8Jgj4Y9bz9s76 for ; Sat, 15 Jul 2017 02:54:25 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="APBCJFMy"; 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=ykZCrl9W8RfJXd3dy yJB9IMAVIoAjDrr+xh6dzDguWPMtEPr82P2FQQ7rWgy2u2dxxwY6Sg5Yt2WEVdrn DxuuUgLVMa8FWJ1YpUbqaBkqB0XLHjIASLl36LZknL5T00vAo6o2NdfxKpPBQ3+9 nH3IozLdHSAZlrzhv0mgP4NASQ= 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=nA95raAxmEXlsZMqs/fL8xh xCt8=; b=APBCJFMyRn0+OZJkrmPhF1rhQvj8oqqKlzbEcTT7YkBJMm39sWVA+TR dUU6FoJ6/+/Vmwph8evJaSQTJ6eck6tXlYMS6SPPtK3qGMfhxqN3fsxs9cAvSBow oS+Bz+avaNASByCDVPjuW54ln87VVLDIvu8PKjb+usGIXSkkYIcM= Received: (qmail 79569 invoked by alias); 14 Jul 2017 16:54:18 -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 79534 invoked by uid 89); 14 Jul 2017 16:54:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=zap, Hx-languages-length:1591, cares X-HELO: mail-io0-f181.google.com Received: from mail-io0-f181.google.com (HELO mail-io0-f181.google.com) (209.85.223.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Jul 2017 16:54:15 +0000 Received: by mail-io0-f181.google.com with SMTP id h134so17489124iof.2 for ; Fri, 14 Jul 2017 09:54:15 -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=SJmB3R+YoilKiuLbQ3a47CwfmmH22MkPvrvoPQyBzYM=; b=idzXgxkL1BdruVUVAb0LroEe1jwHlCF4VS03UDhxtR3dNYAEYDGqbOS44IIhoWnr2n qqBTc9OYXt3U33shDCynLbl4Y/AnLHUqTX3LXGvDxPRKEdWxwOEyFz6hf9EpQZR3ZwZZ lYrvLrIsf+K67K9S53ZmWXIfiGX0oBOwveXUHmgWOoGgVVx4XPUpbnTe5MJW8k89j4IF K+3iTK7sMKAWRt38T/1X5gWr6ovXyc9OavY5o6P0lQFuu4sjeK4piXq2s3Ti+OrNJqiv eGuCb5K7z+M4O3xqk+ig5tUEwI/pwmFcxHeIGeobQKQIJk3gX/h1UQJXYU+WppU/8zFF wbZg== X-Gm-Message-State: AIVw111t8aVI/OI9z01jqAzPwPCKAbpIFf7Pp9YBMa8ZorYga+TEYxWJ FirtbbOJ05Ueow== X-Received: by 10.107.12.21 with SMTP id w21mr9477626ioi.61.1500051254043; Fri, 14 Jul 2017 09:54:14 -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 a6sm4875128ioa.16.2017.07.14.09.54.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 09:54:13 -0700 (PDT) Subject: Re: [PATCH] Kill TYPE_METHODS rtl 3/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:54:12 -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 was the most surprising check of TYPE_METHODS. When not optimizing we use the non-nullness of TYPE_METHODS to figure out if we want to place a non BLKmode structure into a register. On the grounds that one can't call a member function with a register-located object. That seems overly enthusiastic -- if we're not optimizing, who cares? (When we zap TYHPE_METHODS we currently set it to error_mark_node, if it was non-null, so that this above check will work). I'd appreciate comment. nathan Index: gcc/function.c =================================================================== --- gcc/function.c (revision 250160) +++ gcc/function.c (working copy) @@ -2218,20 +2218,11 @@ use_register_for_decl (const_tree decl) if (!DECL_REGISTER (decl)) return false; - switch (TREE_CODE (TREE_TYPE (decl))) - { - case RECORD_TYPE: - case UNION_TYPE: - case QUAL_UNION_TYPE: - /* When not optimizing, disregard register keyword for variables with - types containing methods, otherwise the methods won't be callable - from the debugger. */ - if (TYPE_METHODS (TYPE_MAIN_VARIANT (TREE_TYPE (decl)))) - return false; - break; - default: - break; - } + /* When not optimizing, disregard register keyword for types that + could have methods, otherwise the methods won't be callable from + the debugger. */ + if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (decl))) + return false; return true; }