summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr83330.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-07-06 08:58:46 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-01-11 13:10:33 -0800
commitfcf30d0b02c3b029e05d301a70116cc66249fa4f (patch)
tree419f1b8257da37fdff6122431d5e6442525e6d66 /gcc/testsuite/gcc.target/i386/pr83330.c
parentcc6420a8b984efa47496a8995d8b30945f58cb49 (diff)
downloadgcc-hjl/pr83330/gcc-7-branch.tar.gz
i386: Align stack frame if argument is passed on stackhjl/pr83330/gcc-7-branch
When a function call is removed, it may become a leaf function. But if argument may be passed on stack, we need to align the stack frame when there is no tail call. Tested on Linux/i686 and Linux/x86-64. gcc/ Backport from mainline PR target/83330 * config/i386/i386.c (ix86_function_arg_advance): Set outgoing_args_on_stack to true if there are outgoing arguments on stack. (ix86_function_arg): Likewise. (ix86_compute_frame_layout): Align stack frame if argument is passed on stack. * config/i386/i386.h (machine_function): Add outgoing_args_on_stack. gcc/testsuite/ Backport from mainline PR target/83330 * gcc.target/i386/pr83330.c: New test.
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr83330.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/pr83330.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr83330.c b/gcc/testsuite/gcc.target/i386/pr83330.c
new file mode 100644
index 00000000000..9040168377a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr83330.c
@@ -0,0 +1,29 @@
+/* { dg-do run { target int128 } } */
+/* { dg-options "-O2 -fno-tree-dce -mno-push-args" } */
+
+typedef unsigned long long u64;
+typedef unsigned __int128 u128;
+
+u64 v;
+u64 g;
+
+u64 __attribute__ ((noinline, noclone))
+bar (u128 d, u64 e, u64 f, u64 g, u128 h)
+{
+ (void)d, (void)e, (void)f, (void)g, (void)h;
+ return 0;
+}
+
+static u64
+foo (void)
+{
+ (void)(v - bar (0, 0, 0, 0, 0));
+ return g;
+}
+
+int
+main (void)
+{
+ (void)foo ();
+ return 0;
+}