public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/redhat/heads/gcc-8-branch)] PR rtl-optimization/100263: Ensure register can change mode Date: Fri, 14 May 2021 14:57:18 +0000 (GMT) [thread overview] Message-ID: <20210514145718.509973943429@sourceware.org> (raw) https://gcc.gnu.org/g:ac6f0ee3638ebd1f7eee988af71bd5a5e835c647 commit ac6f0ee3638ebd1f7eee988af71bd5a5e835c647 Author: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com> Date: Wed May 5 17:12:35 2021 +0200 PR rtl-optimization/100263: Ensure register can change mode For move2add_valid_value_p we also have to ask the target whether a register can be accessed in a different mode than it was set before. gcc/ChangeLog: PR rtl-optimization/100263 * postreload.c (move2add_valid_value_p): Ensure register can change mode. (cherry picked from commit bb283170e7a1f39bf533651418daf10ad18eccfc) Diff: --- gcc/postreload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/postreload.c b/gcc/postreload.c index 184b158bb05..b97392337e7 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -1704,7 +1704,8 @@ move2add_valid_value_p (int regno, scalar_int_mode mode) { scalar_int_mode old_mode; if (!is_a <scalar_int_mode> (reg_mode[regno], &old_mode) - || !MODES_OK_FOR_MOVE2ADD (mode, old_mode)) + || !MODES_OK_FOR_MOVE2ADD (mode, old_mode) + || !REG_CAN_CHANGE_MODE_P (regno, old_mode, mode)) return false; /* The value loaded into regno in reg_mode[regno] is also valid in mode after truncation only if (REG:mode regno) is the lowpart of
reply other threads:[~2021-05-14 14:57 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210514145718.509973943429@sourceware.org \ --to=jakub@gcc.gnu.org \ --cc=gcc-cvs@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: linkBe 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).