diff mbox series

[2/2] gcc: xtensa: adjust STRICT_ALIGNMENT per hardware capabilities

Message ID 20230228135136.3727643-2-jcmvbkbc@gmail.com
State New
Headers show
Series [1/2] gcc: xtensa: add data alignment properties to dynconfig | expand

Commit Message

Max Filippov Feb. 28, 2023, 1:51 p.m. UTC
gcc/
	* config/xtensa/xtensa.h (STRICT_ALIGNMENT): Make it 0 when the
	hardware supports both unaligned loads and stores.
---
 gcc/config/xtensa/xtensa.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index 058602e44ee2..49ec9147b543 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -143,7 +143,8 @@  along with GCC; see the file COPYING3.  If not see
 
 /* Set this nonzero if move instructions will actually fail to work
    when given unaligned data.  */
-#define STRICT_ALIGNMENT 1
+#define STRICT_ALIGNMENT (!XCHAL_UNALIGNED_LOAD_HW			\
+			  || !XCHAL_UNALIGNED_STORE_HW)
 
 /* Promote integer modes smaller than a word to SImode.  Set UNSIGNEDP
    for QImode, because there is no 8-bit load from memory with sign