public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "uweigand at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/64010] [msp430-elf] struct function dereference clobbers parameter passed to function
Date: Tue, 02 Dec 2014 17:45:00 -0000	[thread overview]
Message-ID: <bug-64010-4-EhAceuaeF1@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64010-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64010

Ulrich Weigand <uweigand at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uweigand at gcc dot gnu.org

--- Comment #4 from Ulrich Weigand <uweigand at gcc dot gnu.org> ---
Yes, this seems a generic reload bug.  The comment ahead of the lines you're
adding say:

If [...] the operand contains a register that dies in this insn *and is used
nowhere else* [...]

which is supposed to be implemented by this check:

            && ! refers_to_regno_for_reload_p (regno,
                                               end_hard_regno (rel_mode,
                                                               regno),
                                               PATTERN (this_insn), inloc)

But this doesn't look into registers used as function arguments.

I'm not sure why this hasn't occured elsewhere ... however, in your particular
case, it is triggered by a call insn pattern using memory-indirect addressing,
which is probably not available on many targets.

Your patch is a little too conservative, however: it rejects any register that
could potentially be used as function argument, even if it isn't actually used
in this particular call.

Can you check whether this alternative patch (using find_reg_fusage) also fixes
the problem for you?


  parent reply	other threads:[~2014-12-02 17:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21  3:08 [Bug rtl-optimization/64010] New: " amykyta3 at gmail dot com
2014-12-02 16:34 ` [Bug rtl-optimization/64010] " nickc at redhat dot com
2014-12-02 17:45 ` uweigand at gcc dot gnu.org [this message]
2014-12-02 17:46 ` uweigand at gcc dot gnu.org
2014-12-03  0:20 ` pab at pabigot dot com
2014-12-03  0:31 ` pab at pabigot dot com
2014-12-03  3:25 ` amykyta3 at gmail dot com
2014-12-03 12:50 ` nickc at redhat dot com
2014-12-03 21:59 ` uweigand at gcc dot gnu.org
2014-12-03 22:07 ` uweigand at gcc dot gnu.org
2014-12-17 15:08 ` uweigand at gcc dot gnu.org
2014-12-17 15:09 ` uweigand at gcc dot gnu.org
2014-12-17 15:09 ` uweigand at gcc dot gnu.org

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=bug-64010-4-EhAceuaeF1@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).