public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8992] Verify destination[source] of a load[store] instruction is a register.
@ 2021-09-14 20:03 Pat Haugen
  0 siblings, 0 replies; only message in thread
From: Pat Haugen @ 2021-09-14 20:03 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4bcb3213f7431a64a4a10919f6661541ee4be88b

commit r11-8992-g4bcb3213f7431a64a4a10919f6661541ee4be88b
Author: Pat Haugen <pthaugen@linux.ibm.com>
Date:   Tue Sep 14 15:02:09 2021 -0500

    Verify destination[source] of a load[store] instruction is a register.
    
            Backported from master:
            2021-08-09  Pat Haugen  <pthaugen@linux.ibm.com>
    
    gcc/ChangeLog:
    
            * config/rs6000/rs6000.c (is_load_insn1): Verify destination is a
            register.
            (is_store_insn1): Verify source is a register.

Diff:
---
 gcc/config/rs6000/rs6000.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 843ce97b993..528a6f552bf 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -18731,7 +18731,12 @@ is_load_insn1 (rtx pat, rtx *load_mem)
     return false;
 
   if (GET_CODE (pat) == SET)
-    return find_mem_ref (SET_SRC (pat), load_mem);
+    {
+      if (REG_P (SET_DEST (pat)))
+	return find_mem_ref (SET_SRC (pat), load_mem);
+      else
+	return false;
+    }
 
   if (GET_CODE (pat) == PARALLEL)
     {
@@ -18768,7 +18773,12 @@ is_store_insn1 (rtx pat, rtx *str_mem)
     return false;
 
   if (GET_CODE (pat) == SET)
-    return find_mem_ref (SET_DEST (pat), str_mem);
+    {
+      if (REG_P (SET_SRC (pat)) || SUBREG_P (SET_SRC (pat)))
+	return find_mem_ref (SET_DEST (pat), str_mem);
+      else
+	return false;
+    }
 
   if (GET_CODE (pat) == PARALLEL)
     {


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

only message in thread, other threads:[~2021-09-14 20:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 20:03 [gcc r11-8992] Verify destination[source] of a load[store] instruction is a register Pat Haugen

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