This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] i386: More use reference of struct ix86_frame to avoid copy


On Tue, Jan 16, 2018 at 8:09 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Jan 16, 2018 at 7:03 AM, Martin Liška <mliska@suse.cz> wrote:
>> On 01/16/2018 01:35 PM, H.J. Lu wrote:
>>> On Tue, Jan 16, 2018 at 3:40 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> This patch has been used with my Spectre backport for GCC 7 for many
>>>> weeks and has been checked into GCC 7 branch.  Should I revert it on
>>>> GCC 7 branch or check it into trunk?
>>>
>>> Ada build failed with this on trunk:
>>>
>>> raised STORAGE_ERROR : stack overflow or erroneous memory access
>>> make[5]: *** [/export/gnu/import/git/sources/gcc/gcc/ada/Make-generated.in:45:
>>> ada/sinfo.h] Error 1
>>
>> Hello.
>>
>> I know that you've already reverted the change, but it's possible to replace
>> struct ix86_frame &frame = cfun->machine->frame;
>>
>> with:
>> struct ix86_frame *frame = &cfun->machine->frame;
>>
>> And replace usages with point access operator (->). That would also avoid copying.
>
> Won't it be equivalent to reference?
>
>> One another question. After you switched to references, isn't the behavior of function
>> ix86_expand_epilogue as it also contains write to frame struct like:
>>
>>  14799    /* Special care must be taken for the normal return case of a function
>>  14800       using eh_return: the eax and edx registers are marked as saved, but
>>  14801       not restored along this path.  Adjust the save location to match.  */
>>  14802    if (crtl->calls_eh_return && style != 2)
>>  14803      frame.reg_save_offset -= 2 * UNITS_PER_WORD;
>
> That could be the issue.  I will double check it.
>

Revert the ix86_expand_epilogue change fixes the ada build.  I opened:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83905


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]