From patchwork Tue Sep 29 13:24:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Bruel X-Patchwork-Id: 523820 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 670EF140180 for ; Tue, 29 Sep 2015 23:24: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=ychRfz1h; 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:from :cc:subject:message-id:date:mime-version:content-type; q=dns; s= default; b=MN9vRzNDQqAdFI6Hi0RhZVkU77FmUwZJL1jBXPGYDKymtm7eRXJmc huyw8YJsStBOqJCFqkC2nmTW670Dy8Ici7lm85wohwg4d9GqIjK2MYfVSGgQk+ND IzU9LhutHXtFdmry+Ob/4rS/qbVjYMp0y613spc9Hh/sYwm8WnRlHw= 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:from :cc:subject:message-id:date:mime-version:content-type; s= default; bh=6Eh/Gg6i2MPA9RbJbk7upe5l328=; b=ychRfz1hcSDLqY9PjVOa TeDB69nDCqrWxCJCkk6m0j8JR5ueXjpots9B+xDoz5+LlGmb400zDrK6L4El7oqb nvO5SFK40v3PcyV4Hpv+Lqn6jJL4W7p4t+e8WNwliD0lMevOPqzCsVMsoaMv3GmB oaE19vH9fT0I9/WTsZdImIc= Received: (qmail 117391 invoked by alias); 29 Sep 2015 13:24:13 -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 117368 invoked by uid 89); 29 Sep 2015 13:24:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=AWL, BAYES_40, KAM_LAZY_DOMAIN_SECURITY, MISSING_HEADERS, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 29 Sep 2015 13:24:10 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by m0046037.ppops.net (8.14.5/8.14.5) with SMTP id t8TDMRbn024024; Tue, 29 Sep 2015 15:24:06 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by m0046037.ppops.net with ESMTP id 1x7r72s1xy-1 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 29 Sep 2015 15:24:06 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 77D1048; Tue, 29 Sep 2015 13:23:47 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas4.st.com [10.75.90.69]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D05F7270D; Tue, 29 Sep 2015 13:24:03 +0000 (GMT) Received: from [164.129.122.197] (164.129.122.197) by webmail-eu.st.com (10.75.90.13) with Microsoft SMTP Server (TLS) id 8.3.342.0; Tue, 29 Sep 2015 15:24:03 +0200 From: Christian Bruel X-Enigmail-Draft-Status: N1110 CC: , , , Subject: [PATCH ARM]: PR67745: Fix function alignment after __attribute__ 2/2 X-No-Archive: yes Message-ID: <560A90F2.5010708@st.com> Date: Tue, 29 Sep 2015 15:24:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151, 1.0.33, 0.0.0000 definitions=2015-09-29_09:2015-09-29, 2015-09-29, 1970-01-01 signatures=0 X-IsSubscribed: yes This patch uses FUNCTION_BOUNDARY instead of DECL_ALIGN to check the max align when optimizing for size in assemble_start_function. This is necessary for ARM that can switch the max code alignment directives between modes. No regressions for ARM Testing on-going for x86 Christian 2015-09-29 Christian Bruel PR target/67745 * gcc/varasm.c (assemble_start_function): Use current's function align. Index: gcc/varasm.c =================================================================== --- gcc/varasm.c (revision 228229) +++ gcc/varasm.c (working copy) @@ -1729,7 +1729,7 @@ assemble_start_function (tree decl, cons if (CONSTANT_POOL_BEFORE_FUNCTION) output_constant_pool (fnname, decl); - align = symtab_node::get (decl)->definition_alignment (); + align = FUNCTION_BOUNDARY; /* Make sure the not and cold text (code) sections are properly aligned. This is necessary here in the case where the function @@ -1774,12 +1774,15 @@ assemble_start_function (tree decl, cons ASM_OUTPUT_ALIGN (asm_out_file, align); } + /* align_functions_log cannot exceed current function's ABI when + optimizing for size */ + if (optimize_function_for_size_p (cfun)) + align_functions_log = MIN (align_functions_log, align); + /* Handle a user-specified function alignment. Note that we still need to align to DECL_ALIGN, as above, because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all. */ - if (! DECL_USER_ALIGN (decl) - && align_functions_log > align - && optimize_function_for_speed_p (cfun)) + if (! DECL_USER_ALIGN (decl) && align_functions_log > align) { #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file,