public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] Disallow SUBREG of MEM
@ 2022-05-06  2:31 Alexandre Oliva
  0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2022-05-06  2:31 UTC (permalink / raw)
  To: gcc-cvs

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

commit 4c180902db3bc44b13b251e454c850f485b0fa5a
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu May 5 23:25:39 2022 -0300

    Disallow SUBREG of MEM
    
    Introduce TARGET_ALLOW_SUBREG_OF_MEM, defaulting to 0.
    
    Reject SUBREG of MEM regardless of alignment, unless the macro is
    defined to nonzero.
    
    
    for  gcc/ChangeLog
    
            PR target/100106
            * emit-rtl.cc (validate_subreg) [!TARGET_ALLOW_SUBREG_OF_MEM]:
            Reject SUBREG of MEM.

Diff:
---
 gcc/emit-rtl.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc
index 9c03e27894f..f055179b3b8 100644
--- a/gcc/emit-rtl.cc
+++ b/gcc/emit-rtl.cc
@@ -983,8 +983,12 @@ validate_subreg (machine_mode omode, machine_mode imode,
       return subreg_offset_representable_p (regno, imode, offset, omode);
     }
   /* Do not allow SUBREG with stricter alignment than the inner MEM.  */
-  else if (reg && MEM_P (reg) && STRICT_ALIGNMENT
-	   && MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (omode))
+  else if (reg && MEM_P (reg)
+#if TARGET_ALLOW_SUBREG_OF_MEM /* ??? Reject them all eventually.  */
+	   && STRICT_ALIGNMENT
+	   && MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (omode)
+#endif
+	   )
     return false;
 
   /* The outer size must be ordered wrt the register size, otherwise


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

only message in thread, other threads:[~2022-05-06  2:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06  2:31 [gcc(refs/users/aoliva/heads/testme)] Disallow SUBREG of MEM Alexandre Oliva

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