[PATCH] Improve alloca alignment
Rainer Orth
ro@CeBiTec.Uni-Bielefeld.DE
Wed Sep 6 08:06:00 GMT 2017
Jeff Law <law@redhat.com> writes:
> 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.
This patch brought back PR libgomp/78468, which had caused its
predecessor to be backed out of gcc-7.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
More information about the Gcc-patches
mailing list