re PR target/68018 (ICE: in ix86_compute_frame_layout, at config/i386/i386.c:11308...
authorUros Bizjak <uros@gcc.gnu.org>
Wed, 21 Oct 2015 08:43:44 +0000 (10:43 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 21 Oct 2015 08:43:44 +0000 (10:43 +0200)
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
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr68018.c [new file with mode: 0644]

index 6e30cdb3d933b6c10e3bbd266112ad82620ed785..949fb3aa6f824538782f069448e6d96681874fa8 100644 (file)
@@ -1,3 +1,10 @@
+2015-10-21  Uros Bizjak  <ubizjak@gmail.com>
+
+       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  <rguenther@suse.de>
 
        * tree-ssa-sccvn.c (cond_stmts_equal_p): Compare two GIMPLE
index c800145fa3c8fefd42b9dad88ad32ff8bf56373a..6fd4a564f1c8a71c9887b0ef5991ddc82228607e 100644 (file)
@@ -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;
index 9c09d652279ed3de44ba94b61f37f9571631e98f..7b3afbb1f03e4415a8935a84862a185474210c63 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-21  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/68018
+       * gcc.target/i386/pr68018.c: New test.
+
 2015-10-21  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/68031
        * 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  <polacek@redhat.com>
 
 2015-10-09  Martin Jambor  <mjambor@suse.cz>
 
-       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 <aoliva@redhat.com>
 
diff --git a/gcc/testsuite/gcc.target/i386/pr68018.c b/gcc/testsuite/gcc.target/i386/pr68018.c
new file mode 100644 (file)
index 0000000..a0fa21e
--- /dev/null
@@ -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];
+}