https://gcc.gnu.org/g:507b4e147588c0fafe952b7226dd764ebeebb103

commit r14-10595-g507b4e147588c0fafe952b7226dd764ebeebb103
Author: Georg-Johann Lay <a...@gjlay.de>
Date:   Fri Aug 16 18:13:34 2024 +0200

    AVR: target/85624 - Use HImode for clrmemqi alignment.
    
    gcc/
            PR target/85624
            * config/avr/avr.md (*clrmemqi*): Use HImode for alignment operand.
    
    gcc/testsuite/
            * gcc.target/avr/torture/pr85624.c: New test.

Diff:
---
 gcc/config/avr/avr.md                          | 4 ++--
 gcc/testsuite/gcc.target/avr/torture/pr85624.c | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index dabf4c0fc5a..55de11079c3 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -1374,7 +1374,7 @@
   [(set (mem:BLK (match_operand:HI 0 "register_operand" "e"))
         (const_int 0))
    (use (match_operand:QI 1 "register_operand" "r"))
-   (use (match_operand:QI 2 "const_int_operand" "n"))
+   (use (match_operand:HI 2 "const_int_operand" "n"))
    (clobber (match_scratch:HI 3 "=0"))
    (clobber (match_scratch:QI 4 "=&1"))]
   ""
@@ -1392,7 +1392,7 @@
   [(set (mem:BLK (match_operand:HI 0 "register_operand" "e"))
         (const_int 0))
    (use (match_operand:QI 1 "register_operand" "r"))
-   (use (match_operand:QI 2 "const_int_operand" "n"))
+   (use (match_operand:HI 2 "const_int_operand" "n"))
    (clobber (match_scratch:HI 3 "=0"))
    (clobber (match_scratch:QI 4 "=&1"))
    (clobber (reg:CC REG_CC))]
diff --git a/gcc/testsuite/gcc.target/avr/torture/pr85624.c 
b/gcc/testsuite/gcc.target/avr/torture/pr85624.c
new file mode 100644
index 00000000000..b183d4558df
--- /dev/null
+++ b/gcc/testsuite/gcc.target/avr/torture/pr85624.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+int foo (void)
+{
+  volatile int arr[3] __attribute__((aligned(128))) = { 0 };
+  return arr[2];
+}

Reply via email to