This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2, middle end]: Fix PR58372, internal compiler error: ix86_compute_frame_layout
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "H. J. Lu" <hjl dot tools at gmail dot com>, "Guo, Xuepeng" <xuepeng dot guo at intel dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Sun, 4 Nov 2018 20:25:32 +0100
- Subject: Re: [PATCH v2, middle end]: Fix PR58372, internal compiler error: ix86_compute_frame_layout
- References: <CAFULd4YHjPCyt7=OE5xkCTx0bbqt3QSdzcsM11y0Q+M4-zJzyA@mail.gmail.com> <CAFULd4ZO68sirbWgaw9Y8RRK6R6GqqmpyRe8JHCGpCu-Zrr_nQ@mail.gmail.com> <1e7c0bee-0aea-d8f1-2387-5db0d786edf8@redhat.com>
On Sun, Nov 4, 2018 at 6:59 PM Jeff Law <law@redhat.com> wrote:
>
> On 11/1/18 10:18 AM, Uros Bizjak wrote:
> > Hello!
> >
> > v2 of the patch hits the real problem: in pass_expand::execute
> > finish_eh_generation is called after expand_stack_alignment is called.
> > Construction of SjLj landing pads calls emit_library_call, which can
> > change crtl->preferred_stack_boundary value after all dependant
> > variables are already calculated by expand_stack_alignment.
> >
> > The solution is to move the call to finish_eh_generation in front of
> > the call to expand_stack_alignment.
> >
> > 2018-11-01 Uros Bizjak <ubizjak@gmail.com>
> >
> > PR middle-end/58372
> > * cfgexpand.c (pass_expand::execute): Move the call to
> > finish_eh_generation in front of the call to expand_stack_alignment.
> >
> > testsuite/ChangeLog:
> >
> > 2018-11-01 Uros Bizjak <ubizjak@gmail.com>
> >
> > PR middle-end/58372
> > * g++.target/i386/pr58372.C: New test.
> >
> > Patch was bootstrapped and regression tested on x86_64-linux-gnu
> > {,-m32}, all default languages plus go. Additionally, the testcase
> > from PR (and a couple of similar ones) were compiled for
> > i686-w64-mingw32 target with various combinations of
> > -mpreferred-stack-boundary= -mincoming-stack-boundary= -mforce-drap
> > and -m{no-}accumulate-outgoing-args.
> >
> > OK for mainline and release branches?
> >
> > Uros.
> >
> OK, but please add a comment indicating why the new sequencing is needed
> in the code.
Thanks, committed with the following comment:
/* Call expand_stack_alignment after finishing all
updates to crtl->preferred_stack_boundary. */
expand_stack_alignment ();
I'll backport the patch to release branches after a week without
problems in the mainline.
Uros.