public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-8-branch)] PR rtl-optimization/100263: Ensure register can change mode
@ 2021-05-14 14:57 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-05-14 14:57 UTC (permalink / raw)
  To: gcc-cvs

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-14 14:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 14:57 [gcc(refs/vendors/redhat/heads/gcc-8-branch)] PR rtl-optimization/100263: Ensure register can change mode Jakub Jelinek

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).