https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91614

--- Comment #2 from Bernd Edlinger <edlinger at gcc dot gnu.org> ---
In some configs the function saves r4/r5 with strd/ldrd,
I think the dg-final statments should ignore register spills,
they are easy to detect since they always use the sp register.
This changed a bit, since the string constant is 4-byte aligned
and the expansion uses the new unaligned_load&storedi for those.

Since the test case was failing already before, I think
the best would be to adapt the test patterns to the reality.
And update those whenever necessary.

like following:

Index: unaligned-memcpy-2.c
===================================================================
--- unaligned-memcpy-2.c        (revision 275063)
+++ unaligned-memcpy-2.c        (working copy)
@@ -15,9 +15,11 @@
    loads/stores for the remainder.  */

 /* { dg-final { scan-assembler-times "ldmia" 0 } } */
-/* { dg-final { scan-assembler-times "ldrd" 0 } } */
+/* { dg-final { scan-assembler-times "ldrd\(?!\[^\\n\]*sp\)" 0 } } */
+/* { dg-final { scan-assembler-times "ldm\(?!ia\)" 0 } } */
 /* { dg-final { scan-assembler-times "stmia" 1 { target { ! {
arm_prefer_ldrd_strd } } } } } */
-/* { dg-final { scan-assembler-times "strd" 1 { target { arm_prefer_ldrd_strd
} } } } */
+/* { dg-final { scan-assembler-times "strd\(?!\[^\\n\]*sp\)" 1 { target {
arm_prefer_ldrd_strd } } } } */
+/* { dg-final { scan-assembler-times "stm\(?!ia\)" 0 } } */
 /* { dg-final { scan-assembler-times "ldrh" 1 } } */
 /* { dg-final { scan-assembler-times "strh" 1 } } */
 /* { dg-final { scan-assembler-times "ldrb" 1 } } */
Index: unaligned-memcpy-3.c
===================================================================
--- unaligned-memcpy-3.c        (revision 275063)
+++ unaligned-memcpy-3.c        (working copy)
@@ -15,10 +15,12 @@
    loads/stores for the remainder.  */

 /* { dg-final { scan-assembler-times "ldmia" 1 { target { ! {
arm_prefer_ldrd_strd } } } } } */
-/* { dg-final { scan-assembler-times "ldrd" 1 { target { arm_prefer_ldrd_strd
} } } } */
-/* { dg-final { scan-assembler-times "strd" 0 } } */
-/* { dg-final { scan-assembler-times "stm" 0 } } */
-/* { dg-final { scan-assembler-times "ldrh" 1 { target { ! {
arm_prefer_ldrd_strd } } } } } */
+/* { dg-final { scan-assembler-times "ldrd\(?!\[^\\n\]*sp\)" 1 { target {
arm_prefer_ldrd_strd } } } } */
+/* { dg-final { scan-assembler-times "ldm\(?!ia\)" 0 } } */
+/* { dg-final { scan-assembler-times "stmia" 0 } } */
+/* { dg-final { scan-assembler-times "strd\(?!\[^\\n\]*sp\)" 0 } } */
+/* { dg-final { scan-assembler-times "stm\(?!ia\)" 0 } } */
+/* { dg-final { scan-assembler-times "ldrh" 1 } } */
 /* { dg-final { scan-assembler-times "strh" 1 } } */
-/* { dg-final { scan-assembler-times "ldrb" 1 { target { ! {
arm_prefer_ldrd_strd } } } } } */
+/* { dg-final { scan-assembler-times "ldrb" 1 } } */
 /* { dg-final { scan-assembler-times "strb" 1 } } */


which does pass in this test:
make check-gcc-c RUNTESTFLAGS="arm.exp=unaligned-memcpy-*
--target_board=unix\{-mcpu=cortex-a57,-mcpu=cortex-a15,-mcpu=cortex-a9,-mcpu=cortex-a8,-mcpu=cortex-a7\}\{-mfpu=crypto-neon-fp-armv8,-mfpu=neon-vfpv4,-mfpu=crypto-neon-fp-armv8\}\{-fno-omit-frame-pointer,\}"

Reply via email to