public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Denis Chertykov <chertykov@gmail.com>
To: "Sivanupandi, Pitchumani" <Pitchumani.Sivanupandi@atmel.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Georg-Johann Lay <avr@gjlay.de>
Subject: Re: [patch, avr] Restore base register if not marked dead/unused
Date: Mon, 25 May 2015 17:53:00 -0000	[thread overview]
Message-ID: <CADOs=zYJp73tHoMcR8UKR1knobX2LbGowX049p2BzZGSjaf1Sw@mail.gmail.com> (raw)
In-Reply-To: <CAC140656783604CABA6AE60C2A6D5A4A265C7A6@penmbx01>

2015-05-19 16:04 GMT+03:00 Sivanupandi, Pitchumani
<Pitchumani.Sivanupandi@atmel.com>:
> Test gcc.c-torture/execute/memcpy-bi.c (-O2) failed for attiny40 device.
> Cause seems to be in "load from memory" as it is not restoring base
> register after load instructions generated.
>
> Function avr_out_load_psi_reg_no_disp_tiny in avr.c:
> It returns just after emitting instructions to load from memory to
> registers. It is important to restore the base register if it is
> not marked dead/unused after that insn.
>
> Code to restore base register is present already. Below patch let
> the function do the restore before return.
>
> If OK, could someone commit? I do not have commit access.
>
> diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
> index 4e83de8..b653858 100644
> --- a/gcc/config/avr/avr.c
> +++ b/gcc/config/avr/avr.c
> @@ -4365,9 +4365,9 @@ avr_out_load_psi_reg_no_disp_tiny (rtx insn, rtx *op, int *plen)
>      }
>    else
>      {
> -      return avr_asm_len ("ld %A0,%1+"  CR_TAB
> -                          "ld %B0,%1+"  CR_TAB
> -                          "ld %C0,%1", op, plen, -3);
> +      avr_asm_len ("ld %A0,%1+"  CR_TAB
> +                   "ld %B0,%1+"  CR_TAB
> +                   "ld %C0,%1", op, plen, -3);
>
>        if (reg_dest != reg_base - 2 &&
>            !reg_unused_after (insn, base))
>
> Regards,
> Pitchumani
>
> gcc/ChangeLog
> 2015-05-19  Pitchumani Sivanupandi  <pitchumani.s@atmel.com>
>
>     * config/avr/avr.c (avr_out_load_psi_reg_no_disp_tiny): Restore base
>         register if not marked dead/unused, before return.
>

Committed.

      reply	other threads:[~2015-05-25 16:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19 13:32 Sivanupandi, Pitchumani
2015-05-25 17:53 ` Denis Chertykov [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='CADOs=zYJp73tHoMcR8UKR1knobX2LbGowX049p2BzZGSjaf1Sw@mail.gmail.com' \
    --to=chertykov@gmail.com \
    --cc=Pitchumani.Sivanupandi@atmel.com \
    --cc=avr@gjlay.de \
    --cc=gcc-patches@gcc.gnu.org \
    /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).