public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "stefansf at linux dot ibm.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/100263] [11/12 Regression] RTL optimizers miscompile loop
Date: Wed, 28 Apr 2021 11:52:06 +0000	[thread overview]
Message-ID: <bug-100263-4-roMZdZFzQD@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100263-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
Shouldn't we rather check for REG_CAN_CHANGE_MODE_P? A check for
TARGET_HARD_REGNO_MODE_OK for a FP register and QImode is successful.

Using the following also fixes the test for me:

diff --git a/gcc/postreload.c b/gcc/postreload.c
index dc67643384d..3dccbe63cf4 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -1733,7 +1733,7 @@ move2add_valid_value_p (int regno, scalar_int_mode mode)
         regno of the lowpart might be different.  */
       poly_int64 s_off = subreg_lowpart_offset (mode, old_mode);
       s_off = subreg_regno_offset (regno, old_mode, s_off, mode);
-      if (maybe_ne (s_off, 0))
+      if (maybe_ne (s_off, 0) || !REG_CAN_CHANGE_MODE_P (regno, old_mode,
mode))
        /* We could in principle adjust regno, check reg_mode[regno] to be
           BLKmode, and return s_off to the caller (vs. -1 for failure),
           but we currently have no callers that could make use of this

  parent reply	other threads:[~2021-04-28 11:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 10:49 [Bug tree-optimization/100263] New: Wrong removal of statement in copyprop3 stefansf at linux dot ibm.com
2021-04-26 14:12 ` [Bug tree-optimization/100263] [11/12 Regression] " jakub at gcc dot gnu.org
2021-04-26 15:37 ` jakub at gcc dot gnu.org
2021-04-26 16:50 ` jakub at gcc dot gnu.org
2021-04-27  5:56 ` [Bug rtl-optimization/100263] [11/12 Regression] RTL optimizers miscompile loop stefansf at linux dot ibm.com
2021-04-27 10:27 ` stefansf at linux dot ibm.com
2021-04-28  8:43 ` stefansf at linux dot ibm.com
2021-04-28 10:03 ` jakub at gcc dot gnu.org
2021-04-28 10:41 ` ebotcazou at gcc dot gnu.org
2021-04-28 11:52 ` stefansf at linux dot ibm.com [this message]
2021-04-28 12:01 ` ebotcazou at gcc dot gnu.org
2021-04-28 14:20 ` stefansf at linux dot ibm.com
2021-05-05 15:01 ` cvs-commit at gcc dot gnu.org
2021-05-05 15:07 ` cvs-commit at gcc dot gnu.org
2021-05-05 15:10 ` cvs-commit at gcc dot gnu.org
2021-05-05 15:11 ` cvs-commit at gcc dot gnu.org
2021-05-05 15:13 ` cvs-commit at gcc dot gnu.org
2021-05-06 12:51 ` stefansf at linux dot ibm.com

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-100263-4-roMZdZFzQD@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).