aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-03-28 10:43:08 +0200
committerJakub Jelinek <jakub@redhat.com>2023-04-18 09:15:20 +0200
commit429a5143d17bd83d4662cd6c7a2c30d065c8f65b (patch)
treed335c121939e35f0df6cdba0531bf2253e66845e /gcc/testsuite/gcc.target
parent2407495178fa20382944cdbb875e940ad109f9fb (diff)
downloadgcc-429a5143d17bd83d4662cd6c7a2c30d065c8f65b.zip
gcc-429a5143d17bd83d4662cd6c7a2c30d065c8f65b.tar.gz
gcc-429a5143d17bd83d4662cd6c7a2c30d065c8f65b.tar.bz2
i386: Require just 32-bit alignment for SLOT_FLOATxFDI_387 -m32 -mpreferred-stack-boundary=2 DImode temporaries [PR109276]
The following testcase ICEs since r11-2259 because assign_386_stack_local -> assign_stack_local -> ix86_local_alignment now uses 64-bit alignment for DImode temporaries rather than 32-bit as before. Most of the spots in the backend which ask for DImode temporaries are during expansion and those apparently are handled fine with -m32 -mpreferred-stack-boundary=2, we dynamically realign the stack in that case (most of the spots actually don't need that alignment but at least one does), then 2 spots are in STV which I assume also work correctly. But during splitting we can create a DImode slot which doesn't need to be 64-bit alignment (it is nicer for performance though), when we apparently aren't able to detect it for dynamic stack realignment purposes. The following patch just makes the slot 32-bit aligned in that rare case. 2023-03-28 Jakub Jelinek <jakub@redhat.com> PR target/109276 * config/i386/i386.cc (assign_386_stack_local): For DImode with SLOT_FLOATxFDI_387 and -m32 -mpreferred-stack-boundary=2 pass align 32 rather than 0 to assign_stack_local. * gcc.target/i386/pr109276.c: New test. (cherry picked from commit 4b5ef857f5faf09f274c0a95c67faaa80d198124)
Diffstat (limited to 'gcc/testsuite/gcc.target')
-rw-r--r--gcc/testsuite/gcc.target/i386/pr109276.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr109276.c b/gcc/testsuite/gcc.target/i386/pr109276.c
new file mode 100644
index 0000000..5d0827a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr109276.c
@@ -0,0 +1,13 @@
+/* PR target/109276 */
+/* { dg-do compile } */
+/* { dg-options "-march=x86-64" } */
+/* { dg-additional-options "-mpreferred-stack-boundary=2" { target ia32 } } */
+
+long long a;
+long double b;
+
+void
+foo (void)
+{
+ b += a;
+}