From 0b778f9f4a9606cff7c9b9b8a923e17f291c527a Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Wed, 28 Aug 2019 10:20:44 +0000 Subject: [PATCH] re PR middle-end/89544 (Argument marshalling incorrectly assumes stack slots are naturally aligned.) 2019-08-28 Bernd Edlinger PR middle-end/89544 * gcc.target/arm/unaligned-argument-3.c: New test. From-SVN: r274987 --- gcc/testsuite/ChangeLog | 5 +++++ .../gcc.target/arm/unaligned-argument-3.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 gcc/testsuite/gcc.target/arm/unaligned-argument-3.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4c58780ff67..333fe3cdea2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-08-28 Bernd Edlinger + + PR middle-end/89544 + * gcc.target/arm/unaligned-argument-3.c: New test. + 2019-08-27 Marek Polacek PR c++/81676 - bogus -Wunused warnings in constexpr if. diff --git a/gcc/testsuite/gcc.target/arm/unaligned-argument-3.c b/gcc/testsuite/gcc.target/arm/unaligned-argument-3.c new file mode 100644 index 00000000000..2543038e93e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/unaligned-argument-3.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_arm_ok } */ +/* { dg-options "-marm -mno-unaligned-access -O3" } */ + +typedef int __attribute__((aligned(1))) s; + +void x(char*, s*); +void f(char a, s f) +{ + x(&a, &f); +} + +/* { dg-final { scan-assembler-times "str\t\[^\\n\]*\\\[sp\\\]" 1 } } */ +/* { dg-final { scan-assembler-times "str\t\[^\\n\]*\\\[sp, #3\\\]" 0 } } */ -- 2.30.2