From: Georg-Johann Lay Date: Mon, 12 Aug 2024 12:39:24 +0000 (+0200) Subject: AVR: target/85624 - Fix non-matching alignment in clrmem* insns. X-Git-Tag: basepoints/gcc-16~6665 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68da681e614c2750f648dac2cd0b2595999ca5d9;p=thirdparty%2Fgcc.git AVR: target/85624 - Fix non-matching alignment in clrmem* insns. The clrmem* patterns don't use the provided alignment information, hence the setmemhi expander can just pass down 0 as alignment to the clrmem* insns. PR target/85624 gcc/ * config/avr/avr.md (setmemhi): Set alignment to 0. gcc/testsuite/ * gcc.target/avr/torture/pr85624.c: New test. --- diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md index 84dfe4c40ec..359343e563d 100644 --- a/gcc/config/avr/avr.md +++ b/gcc/config/avr/avr.md @@ -1355,6 +1355,8 @@ gen_int_mode (INTVAL (operands[1]), mode)); rtx addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0)); operands[0] = gen_rtx_MEM (BLKmode, addr0); + // Alignment is unused; just set it to 0. + operands[3] = const0_rtx; }) 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]; +}