From dc3cf66b06e1357d69e5ad9293449369064f254e Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 21 Oct 2015 10:43:44 +0200 Subject: [PATCH] re PR target/68018 (ICE: in ix86_compute_frame_layout, at config/i386/i386.c:11308 with -mstackrealign) PR target/68018 * config/i386/i386.c (ix86_compute_frame_layout): Realign the stack for 64-bit MS_ABI targets also when default incoming stack boundary is overriden. testsuite/ChangeLog: PR target/68018 * gcc.target/i386/pr68018.c: New test. From-SVN: r229120 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 9 ++++++--- gcc/testsuite/ChangeLog | 13 +++++++++---- gcc/testsuite/gcc.target/i386/pr68018.c | 10 ++++++++++ 4 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr68018.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e30cdb3d93..949fb3aa6f8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-10-21 Uros Bizjak + + PR target/68018 + * config/i386/i386.c (ix86_compute_frame_layout): Realign the stack + for 64-bit MS_ABI targets also when default incoming stack boundary + is overriden. + 2015-10-21 Richard Biener * tree-ssa-sccvn.c (cond_stmts_equal_p): Compare two GIMPLE diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c800145fa3c..6fd4a564f1c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -11271,11 +11271,14 @@ ix86_compute_frame_layout (struct ix86_frame *frame) frame->nregs = ix86_nsaved_regs (); frame->nsseregs = ix86_nsaved_sseregs (); - /* 64-bit MS ABI seem to require stack alignment to be always 16 except for - function prologues and leaf. */ + /* 64-bit MS ABI seem to require stack alignment to be always 16, + except for function prologues, leaf functions and when the defult + incoming stack boundary is overriden at command line or via + force_align_arg_pointer attribute. */ if ((TARGET_64BIT_MS_ABI && crtl->preferred_stack_boundary < 128) && (!crtl->is_leaf || cfun->calls_alloca != 0 - || ix86_current_function_calls_tls_descriptor)) + || ix86_current_function_calls_tls_descriptor + || ix86_incoming_stack_boundary < 128)) { crtl->preferred_stack_boundary = 128; crtl->stack_alignment_needed = 128; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9c09d652279..7b3afbb1f03 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-10-21 Uros Bizjak + + PR target/68018 + * gcc.target/i386/pr68018.c: New test. + 2015-10-21 Richard Biener PR middle-end/68031 @@ -202,7 +207,7 @@ * gcc.dg/tree-ssa/ssa-dom-thread-2e.c: Likewise. * gcc.dg/tree-ssa/ssa-dom-thread-2f.c: Likewise. - PR testsuite/67959 + PR testsuite/67959 * gcc.dg/tree-ssa/ssa-thread-13.c: Avoid bitfield assumptions. 2015-10-14 Marek Polacek @@ -385,9 +390,9 @@ 2015-10-09 Martin Jambor - tree-optimization/67794 - * gcc.dg/ipa/ipa-sra-10.c: Nw test. - * gcc.dg/torture/pr67794.c: Likewise. + PR tree-optimization/67794 + * gcc.dg/ipa/ipa-sra-10.c: New test. + * gcc.dg/torture/pr67794.c: Likewise. 2015-10-09 Alexandre Oliva diff --git a/gcc/testsuite/gcc.target/i386/pr68018.c b/gcc/testsuite/gcc.target/i386/pr68018.c new file mode 100644 index 00000000000..a0fa21e0b00 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr68018.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */ +/* { dg-options "-O -mabi=ms -mstackrealign" } */ + +typedef float V __attribute__ ((vector_size (16))); + +int fn1 (V * x) +{ + V a = *x; + return a[0]; +} -- 2.30.2