From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 725 invoked by alias); 8 Dec 2014 21:07:00 -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 716 invoked by uid 89); 8 Dec 2014 21:06:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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; Mon, 08 Dec 2014 21:06:58 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB8L6vEV024354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 8 Dec 2014 16:06:57 -0500 Received: from [10.3.113.190] (ovpn-113-190.phx2.redhat.com [10.3.113.190]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sB8L6u8R020444; Mon, 8 Dec 2014 16:06:57 -0500 Message-ID: <548612F0.8050209@redhat.com> Date: Mon, 08 Dec 2014 21:07:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Caroline Tice , GCC Patches Subject: Re: [PATCH] Fix size & type for cold partition names (hot-cold function partitioning) References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00710.txt.bz2 On 12/05/14 15:41, Caroline Tice wrote: > When hot/cold function splitting occurs, a symbol is generated for the > cold partition, and gets output in the assembly & debug info, but the > symbol currently gets a size of 0 and a type of NOTYPE, as in this > example (on x86_64-linux) from the cold_partition_label test in the > testsuite: > > $ readelf -sW cold_partition_label.x02 | grep foo > 36: 0000000000400450 0 NOTYPE LOCAL DEFAULT 12 foo.cold.0 > 58: 0000000000400490 43 FUNC GLOBAL DEFAULT 12 foo > $ > > This patch fixes this by calculating the right size for the partition, > and outputing the size and type fo the cold partition symbol. After > applying this patch and looking at the same test, I get: > > $ readelf -sW cold_partition_label.x02 | grep foo > 36: 0000000000400450 29 FUNC LOCAL DEFAULT 12 foo.cold.0 > 58: 0000000000400490 43 FUNC GLOBAL DEFAULT 12 foo > $ > > This patch has been tested by bootstrapping the compiler, running the > dejagnu testsuite with no regressions, and checked as shown above that > it fixes the original problem. Is this patch OK to commit to ToT? > > -- Caroline Tice > cmtice@google.com > > 2014-12-05 Caroline Tice > > * final.c (final_scan_insn): Change 'cold_function_name' to > 'cold_partition_name' and make it a global variable; also output > assembly to give it a 'FUNC' type, if appropriate. > * varasm.c (cold_partition_name): Declare and initialize global > variable. > (assemble_start_function): Re-set value for cold_partition_name. > (assemble_end_function): Output assembly to calculate size of cold > partition, and associate size with name, if appropriate. > * varash.h (cold_partition_name): Add extern declaration for global > variable. OK for the trunk. I'm ever-so-slightly worried about the PA and PTX ports are they're probably the most sensitive to types. But we'll deal with them if they complain. Adding a testcase would be helpful. I believe some of the LTO tests use readelf, so there should be some infrastructure you can factor out and reuse. jeff