From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98750 invoked by alias); 1 Oct 2015 07:12:33 -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 98739 invoked by uid 89); 1 Oct 2015 07:12:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,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; Thu, 01 Oct 2015 07:12:31 +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 t916q4Mk004041; Thu, 1 Oct 2015 09:12:26 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by m0046037.ppops.net with ESMTP id 1x8yf9860x-1 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 01 Oct 2015 09:12:26 +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 9198134; Thu, 1 Oct 2015 07:12:06 +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 DBD5D27AF; Thu, 1 Oct 2015 07:12:24 +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; Thu, 1 Oct 2015 09:12:24 +0200 Subject: Re: [PATCH ARM]: PR67745: Fix function alignment after __attribute__ 2/2 To: Jeff Law References: <560A90F2.5010708@st.com> <560C31CD.7060009@redhat.com> CC: "gcc-patches@gcc.gnu.org" , "kyrylo.tkachov@arm.com" , "richard.earnshaw@arm.com" From: Christian Bruel X-Enigmail-Draft-Status: N1110 X-No-Archive: yes Message-ID: <560CDCD7.9080108@st.com> Date: Thu, 01 Oct 2015 07:12:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <560C31CD.7060009@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-10-01_04:2015-09-30,2015-10-01,1970-01-01 signatures=0 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00009.txt.bz2 On 09/30/2015 09:02 PM, Jeff Law wrote: > On 09/29/2015 07:24 AM, Christian Bruel wrote: >> 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 >> >> >> align2.patch >> >> >> 2015-09-29 Christian Bruel >> >> PR target/67745 >> * gcc/varasm.c (assemble_start_function): Use current's function align. > Does this override alignment information that might be attached to the > DECL? Yes. Well, in the backend, for architectural (ABI) defined alignment, FUNCTION_BOUNDARY is used instead of DECL_ALIGN. And DECL_ALIGN is set with FUNCTION_BOUNDARY (make_node_stat) so they are accidentally equivalent if FUNCTION_BOUNDARY does not get changed due to switchable target. Does that, in effect, override any alignment information that > the developer may have put on the decl? If so, then it seems like a bad > idea, even with -Os. No it doesn't affect user alignments, that are carried thru align_functions_log, that prevails over the DECL_ALIGN. I played with various configurations of -falign-functions=x, __attribute__((aligned(x))), optimization levels for arm and x86 and was happy with them. > > Am I missing something here? Your comment makes me think about the direction I've taken to replace DECL_ALIGN by FUNCTION_BOUNDARY, and the problem might not be user align vs DECL_ALIGN: I stepped upon Jan's patch for a fortran regression. 2015-03-05 Jan Hubicka PR ipa/65334 * cgraph.h (symtab_node): Add definition_alignment, My patch was tested only for languages=c/c++. I'm going to give it a try with Fortran. If this is not satisfactory I'll have to think about updating DECL_ALIGN after the function's attribute are processed and keep using it in assemble_start_function. Come back later thanks,