On Thu, May 20, 2021 at 4:30 PM Richard Biener
<richard.guent...@gmail.com> wrote:
>
> On Thu, May 20, 2021 at 10:15 AM Hongtao Liu <crazy...@gmail.com> wrote:
> >
> > On Thu, May 20, 2021 at 4:06 PM Richard Biener
> > <richard.guent...@gmail.com> wrote:
> > >
> > > On Thu, May 20, 2021 at 8:54 AM Hongtao Liu <crazy...@gmail.com> wrote:
> > > >
> > > > Hi:
> > > >   In folding target-specific builtin, when lhs is NULL, create a
> > > > temporary variable for it.
> > > >   Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
> > >
> > > I would suggest to drop the stmt or leave it unfolded instead.
> > Will -O0 be able to optimize the builtin away?
> >  Since i've deleted the corresponding expander, there would be an
> > error if the builtin goes directly to pass_expand.
>
> In that case replace it with a NOP, that should be safe then.
>
update patch.
> Richard.
>
> > > Note dropping would mean replacing it with a GIMPLE_NOP
> > > (gimple_build_nop ()).  But creating a new unused LHS certainly
> > > works as well.
> > >
> > > Jakub, any preference?
> > >
> > > Richard.
> > >
> > > > gcc/ChangeLog:
> > > >         PR target/100660
> > > >         * config/i386/i386.c (ix86_gimple_fold_builtin): Create a tmp
> > > >         variable for lhs when it doesn't exist.
> > > >
> > > > gcc/testsuite/ChangeLog:
> > > >         PR target/100660
> > > >         * gcc.target/i386/pr100660.c: New test.
> > > >
> > > >
> > > >
> > > > --
> > > > BR,
> > > > Hongtao
> >
> >
> >
> > --
> > BR,
> > Hongtao



-- 
BR,
Hongtao

Attachment: 0001-Fix-ICE-when-lhs-is-NULL.patch_v2
Description: Binary data

Reply via email to