From 810ce19512c1e55095ac33c5ebd54bb74e47049a Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 6 Jul 2017 10:56:57 -0700
Subject: [PATCH] x86: Update gcc.dg/stack-layout-dynamic-1.c
On x86, since stack realignment is done with
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
andl $-65536, %esp
it is preferred to have .cfi_def_cfa_register, instead of
.cfi_startproc
pushl %edi
.cfi_def_cfa_offset 8
.cfi_offset 7, -8
leal 8(%esp), %edi
.cfi_def_cfa 7, 0
andl $-65536, %esp
pushl -4(%edi)
pushl %ebp
.cfi_escape 0x10,0x5,0x2,0x75,0
movl %esp, %ebp
PR target/81313
* gcc.dg/stack-layout-dynamic-1.c (dg-options): Add -mregparm=3
for ia32.
Don't expect cfi_escape and expect cfi_def_cfa_register on x86.
---
gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
@@ -2,6 +2,7 @@
in one pass together with normal local variables. */
/* { dg-do compile } */
/* { dg-options "-O0 -fomit-frame-pointer" } */
+/* { dg-options "-O0 -fomit-frame-pointer -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
/* { dg-require-effective-target ptr32plus } */
extern void bar (void *, void *, void *);
@@ -12,4 +13,6 @@ void foo (void)
__attribute__ ((aligned(32768))) char runtime_aligned_2[1024];
bar (&i, &runtime_aligned_1, &runtime_aligned_2);
}
-/* { dg-final { scan-assembler-not "cfi_def_cfa_register" } } */
+/* { dg-final { scan-assembler-not "cfi_escape" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-assembler-not "cfi_def_cfa_register" { target { ! { { i?86-*-* } || { x86_64-*-* } } } } } } */
+/* { dg-final { scan-assembler "cfi_def_cfa_register" { target i?86-*-* x86_64-*-* } } } */
--
2.9.4