public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: "Takayuki 'January June' Suwa" <jjsuwa_sys3175@yahoo.co.jp>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] xtensa: Prevent emitting integer additions of constant zero
Date: Wed, 17 Aug 2022 11:43:16 -0700	[thread overview]
Message-ID: <CAMo8Bf+PFBLoTHC=SEd1cc-8+YU_eNevrh7B2X1W_rYt4xmcYw@mail.gmail.com> (raw)
In-Reply-To: <dd3f314d-6a90-cfb4-3329-686d5e6ff009@yahoo.co.jp>

On Wed, Aug 17, 2022 at 2:52 AM Takayuki 'January June' Suwa
<jjsuwa_sys3175@yahoo.co.jp> wrote:
> As a matter of fact, "in a few cases" is just only one:
>
> [xtensa_expand_epilogue() in /gcc/config/xtensa/xtensa.cc]
> >      if (cfun->machine->current_frame_size > 0)
> >       {
> >         if (frame_pointer_needed || /* always reachable with addi */
> >             cfun->machine->current_frame_size > 1024 ||
> >             cfun->machine->current_frame_size <= 127)
> >           {
> >             if (cfun->machine->current_frame_size <= 127)
> >               offset = cfun->machine->current_frame_size;
> >             else
> >               offset = cfun->machine->callee_save_size;
> >
> >             emit_insn (gen_addsi3 (stack_pointer_rtx,
> >                                    stack_pointer_rtx,
> >                                    GEN_INT (offset)));        // offset can be zero!
> >           }

Oh, nice catch! I'll post a patch that adds a check for non-zero offset here.

-- 
Thanks.
-- Max

      reply	other threads:[~2022-08-17 18:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 12:40 Takayuki 'January June' Suwa
2022-08-16 19:58 ` Max Filippov
2022-08-17  9:51   ` Takayuki 'January June' Suwa
2022-08-17 18:43     ` Max Filippov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMo8Bf+PFBLoTHC=SEd1cc-8+YU_eNevrh7B2X1W_rYt4xmcYw@mail.gmail.com' \
    --to=jcmvbkbc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jjsuwa_sys3175@yahoo.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).