From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59823 invoked by alias); 22 Jun 2016 06:02:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 59805 invoked by uid 89); 22 Jun 2016 06:02:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 22 Jun 2016 06:02:19 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D5BE6317F; Wed, 22 Jun 2016 06:02:18 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-51.ams2.redhat.com [10.36.116.51]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5M62G0D009426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 22 Jun 2016 02:02:17 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u5M62ELm028482; Wed, 22 Jun 2016 08:02:14 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u5M62B79028481; Wed, 22 Jun 2016 08:02:11 +0200 Date: Wed, 22 Jun 2016 06:02:00 -0000 From: Jakub Jelinek To: Jeff Law Cc: Andrew Burgess , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 1/2] gcc: Remove unneeded global flag. Message-ID: <20160622060211.GT7387@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <512a967c-39c4-44f5-6f24-d75ef543979d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <512a967c-39c4-44f5-6f24-d75ef543979d@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg01570.txt.bz2 On Tue, Jun 21, 2016 at 08:55:15PM -0600, Jeff Law wrote: > user_defined_section_attribute was introduced as part of the hot/cold > partitioning changes. > > https://gcc.gnu.org/ml/gcc-patches/2004-07/msg01545.html > > > What's supposed to happen is hot/cold partitioning is supposed to be turned > off for the function which has the a user defined section attribute. The flag has been added before we had -funit-at-a-time, and IMNSHO it couldn't work properly even when it has been introduced, because if you had void foo (void) __attribute__((section ("..."))); void bar (void) { ... } void foo (void) { ... } then it would mistakenly apply to bar rather than foo. So, either we can reconstruct whether the current function decl has user section attribute, then perhaps during expansion we should set the flag to that or use such a test directly in the gate (e.g. would lookup_attribute ("section", DECL_ATTRIBUTES (current_function_decl)) DTRT?) and drop the flag, or we need some way to preserve that information per function. Jakub