On Wed, Dec 22, 2021 at 9:10 AM Uros Bizjak <ubiz...@gmail.com> wrote:
>
> On Tue, Dec 21, 2021 at 1:27 PM Roger Sayle <ro...@nextmovesoftware.com> 
> wrote:
> >
> >
> > My apologies for the inconvenience.  The new support for -Oz using
> > push/pop for small integer constants on x86_64 is only a win/correct
> > for loading registers.  Fixed by adding !MEM_P tests in the appropriate
> > locations.
> >
> > This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> > and make -k check with no new failures.  Ok for mainline?
> >
> >
> > 2021-12-21  Roger Sayle  <ro...@nextmovesoftware.com>
> >
> > gcc/ChangeLog
> >         PR target/103773
> >         * config/i386/i386.md (*movdi_internal): Only use short
> >         push/pop sequence for register (non-memory) destinations.
> >         (*movsi_internal): Likewise.
> >
> > gcc/testsuite/ChangeLog
> >         PR target/103773
> >         * gcc.target/i386/pr103773.c: New test case.
>
> Ouch, as pointed out in the PR, this approach clobbers the red zone.
>
> Please revert the original patch.

*Maybe* we can use frame->red_zone_size here, but the frame is
recalculated several times during the compilation. I think it is just
too dangerous to use push/pop w.r.t. red zone clobbering.

Uros.

Reply via email to