This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve alloca alignment
- From: Jeff Law <law at redhat dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: nd <nd at arm dot com>
- Date: Thu, 24 Aug 2017 15:56:43 -0600
- Subject: Re: [PATCH] Improve alloca alignment
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C063281DF9
- References: <DB6PR0801MB2053EFC180A8360BC943BEB883B90@DB6PR0801MB2053.eurprd08.prod.outlook.com> <9c8a4d59-92c6-9134-a415-d187dd153127@redhat.com> <DB6PR0801MB2053C589860FEBE267E5429483B90@DB6PR0801MB2053.eurprd08.prod.outlook.com> <8dd9edf2-494b-66b4-09aa-5c4a984576c0@redhat.com> <DB6PR0801MB2053A36AF986D2F04C1FDE6B83840@DB6PR0801MB2053.eurprd08.prod.outlook.com>
On 08/22/2017 08:15 AM, Wilco Dijkstra wrote:
> Jeff Law wrote:
> On 07/26/2017 05:29 PM, Wilco Dijkstra wrote:
>
>>> But then the check size_align % MAX_SUPPORTED_STACK_ALIGNMENT != 0
>>> seems wrong too given that round_push uses a different alignment to align to.
>> I had started to dig into the history of this code, but just didn't have
>> the time to do so fully before needing to leave for the day. To some
>> degree I was hoping you knew the rationale behind the test against
>> MAX_SUPPORTED_STACK_ALIGNMENT and I wouldn't have to do a ton of digging :-)
>
> I looked further into this - it appears this works correctly since it is only bypassed if
> size_align is already maximally aligned. round_push aligns to the preferred alignment,
> which may be lower or equal to MAX_SUPPORTED_STACK_ALIGNMENT (which is
> at least STACK_BOUNDARY).
>
> Here is the updated version:
>
> ChangeLog:
> 2017-08-22 Wilco Dijkstra <wdijkstr@arm.com>
>
> * explow.c (get_dynamic_stack_size): Improve dynamic alignment.
OK. I wonder if this will make it easier to write stack-clash tests of
the dynamic space for boundary conditions :-) I was always annoyed that
I had to fiddle around with magic adjustments to the sizes of objects to
tickle boundary cases.
jeff