Set incoming stack boundary to 128 for 64-bit targets
authorJulia Koval <julia.koval@intel.com>
Mon, 6 Mar 2017 16:08:59 +0000 (17:08 +0100)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 6 Mar 2017 16:08:59 +0000 (08:08 -0800)
For 64-bit targets, the incoming stack of interrupt handler is aligned
to 16 bytes.  Update ix86_minimum_incoming_stack_boundary to set the
incoming stack boundary of interrupt handler to 128 for 64-bit targets.

gcc/

2017-03-06  Julia Koval  <julia.koval@intel.com>

PR target/79793
* config/i386/i386.c (ix86_minimum_incoming_stack_boundary): Set
incoming stack boundary to 128 for 64-bit targets.

gcc/testsuite/

2017-03-06  Julia Koval  <julia.koval@intel.com>

PR target/79793
 * gcc.target/i386/interrupt-12.c: Update scan-assembler-times
 directives.
 * gcc.target/i386/interrupt-13.c: Ditto.
 * gcc.target/i386/interrupt-14.c: Ditto.
 * gcc.target/i386/interrupt-15.c: Ditto.

From-SVN: r245926

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/interrupt-12.c
gcc/testsuite/gcc.target/i386/interrupt-13.c
gcc/testsuite/gcc.target/i386/interrupt-14.c
gcc/testsuite/gcc.target/i386/interrupt-15.c

index d9fc372641d6d406ae47a921b7b1a79c0c57c0a8..05001aa26e820218ac398a0fbeed55541570e4e8 100644 (file)
@@ -1,3 +1,9 @@
+2017-03-06  Julia Koval  <julia.koval@intel.com>
+
+       PR target/79793
+       * config/i386/i386.c (ix86_minimum_incoming_stack_boundary): Set
+       incoming stack boundary to 128 for 64-bit targets.
+
 2017-03-06  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/79894
index 1b982077cae4879457185caec1a0dcc37c809d2c..e705a3eb92363680841a2d153856147253a7e6c3 100644 (file)
@@ -13054,10 +13054,10 @@ ix86_minimum_incoming_stack_boundary (bool sibcall)
 {
   unsigned int incoming_stack_boundary;
 
-  /* Stack of interrupt handler is always aligned to MIN_STACK_BOUNDARY.
-   */
+  /* Stack of interrupt handler is aligned to 128 bits in 64bit
+     mode.  */
   if (cfun->machine->func_type != TYPE_NORMAL)
-    incoming_stack_boundary = MIN_STACK_BOUNDARY;
+    incoming_stack_boundary = TARGET_64BIT ? 128 : MIN_STACK_BOUNDARY;
   /* Prefer the one specified at command line. */
   else if (ix86_user_incoming_stack_boundary)
     incoming_stack_boundary = ix86_user_incoming_stack_boundary;
index 23adcd1884f7f5b913d6a2c29dbe2ba18d9addc8..798d89b2571cfbb468048fa4336ff1f0fa103781 100644 (file)
@@ -1,3 +1,12 @@
+2017-03-06  Julia Koval  <julia.koval@intel.com>
+
+       PR target/79793
+        * gcc.target/i386/interrupt-12.c: Update scan-assembler-times
+        directives.
+        * gcc.target/i386/interrupt-13.c: Ditto.
+        * gcc.target/i386/interrupt-14.c: Ditto.
+        * gcc.target/i386/interrupt-15.c: Ditto.
+
 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/79822
index 23780050d7676c86178dea30f9843efd1b6795d0..078bbcf779862f109da00e41c463c585a8e513b3 100644 (file)
@@ -17,12 +17,12 @@ fn1 (void *frame, uword_t error)
 /* { dg-final { scan-assembler-not "(push|pop)l\[\\t \]*%edi" { target ia32 } } } */
 /* { dg-final { scan-assembler-not "(push|pop)q\[\\t \]*%rax" { target { { ! ia32 } &&  nonpic } } } } */
 /* { dg-final { scan-assembler-not "(push|pop)q\[\\t \]*%r\[0-9\]+" { target { ! ia32 } } } } */
-/* { dg-final { scan-assembler-times "push(?:l|q)\[\\t \]*%(?:r|e)bp" 1 } } */
-/* { dg-final { scan-assembler-times "leave" 1 { target nonpic } } } */
+/* { dg-final { scan-assembler-times "pushl\[\\t \]*%ebp" 1 { target ia32 } } } */
+/* { dg-final { scan-assembler-times "leave" 1 { target { ia32 && nonpic } } } } */
 /* { dg-final { scan-assembler-times "pushl\[\\t \]*%eax" 1 { target ia32 } } } */
 /* { dg-final { scan-assembler-times "movl\[\\t \]*-4\\(%ebp\\),\[\\t \]*%eax" 1 { target ia32 } } } */
 /* { dg-final { scan-assembler-times "pushq\[\\t \]*%rdi" 1 { target { ! ia32 } } } } */
-/* { dg-final { scan-assembler-times "movq\[\\t \]*-8\\(%(?:r|e)bp\\),\[\\t \]*%rdi" 1 { target { { ! ia32 } && nonpic } } } } */
+/* { dg-final { scan-assembler-times "popq\[\\t \]*%rdi" 1 { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler "(addl|leal).*4.*%esp" { target ia32 } } } */
 /* { dg-final { scan-assembler "(add|lea)(?:l|q)\[\\t \]*\\\$?8.*,\[\\t \]*%\[re\]?sp" { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler-times "iret" 1 { target ia32 } } } */
index 378145ec672a1e25903a617bd22a43c084993237..77ee3a510701adc0bc4fd71dc8ecd5257a83c112 100644 (file)
@@ -17,12 +17,12 @@ fn1 (void *frame, uword_t error)
 /* { dg-final { scan-assembler-not "(push|pop)l\[\\t \]*%edi" { target ia32 } } } */
 /* { dg-final { scan-assembler-not "(push|pop)q\[\\t \]*%rax" { target { { ! ia32 } && nonpic } } } } */
 /* { dg-final { scan-assembler-not "(push|pop)q\[\\t \]*%r\[0-9\]+" { target { ! ia32 } } } } */
-/* { dg-final { scan-assembler-times "push(?:l|q)\[\\t \]*%(?:r|e)bp" 1 } } */
-/* { dg-final { scan-assembler-times "leave" 1 { target nonpic } } } */
+/* { dg-final { scan-assembler-times "pushl\[\\t \]*%ebp" 1 { target ia32 } } } */
+/* { dg-final { scan-assembler-times "leave" 1 { target { ia32 && nonpic } } } } */
 /* { dg-final { scan-assembler-times "pushl\[\\t \]*%eax" 1 { target ia32 } } } */
 /* { dg-final { scan-assembler-times "movl\[\\t \]*-4\\(%ebp\\),\[\\t \]*%eax" 1 { target ia32 } } } */
 /* { dg-final { scan-assembler-times "pushq\[\\t \]*%rdi" 1 { target { ! ia32 } } } } */
-/* { dg-final { scan-assembler-times "movq\[\\t \]*-8\\(%(?:r|e)bp\\),\[\\t \]*%rdi" 1 { target { { ! ia32 } && nonpic } } } } */
+/* { dg-final { scan-assembler-times "popq\[\\t \]*%rdi" 1 { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler "(addl|leal).*4.*%esp" { target ia32 } } } */
 /* { dg-final { scan-assembler "(add|lea)(?:l|q)\[\\t \]*\\\$?8.*,\[\\t \]*%\[re\]?sp" { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler-times "iret" 1 { target ia32 } } } */
index f574f4fafac4d6946b15dc17bf12370b1b420d72..92b3cb014df317925ec06a685083062aaab18bca 100644 (file)
@@ -23,10 +23,10 @@ fn2 (void *frame)
 /* { dg-final { scan-assembler-not "(push|pop)(l|q)\[\\t \]*%(r|e)si" } } */
 /* { dg-final { scan-assembler-not "(push|pop)q\[\\t \]*%r\[8-9\]+" { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler-not "(push|pop)q\[\\t \]*%r1\[0-5\]+" { target { ! ia32 } } } } */
-/* { dg-final { scan-assembler-times "push(?:l|q)\[\\t \]*%(?:r|e)bp" 2 } } */
+/* { dg-final { scan-assembler-times "pushl\[\\t \]*%ebp" 2 { target ia32 } } } */
 /* { dg-final { scan-assembler-times "leave" 2 { target ia32 } } } */
 /* { dg-final { scan-assembler-times "pushq\[\\t \]*%rdi" 2 { target { ! ia32 } } } } */
-/* { dg-final { scan-assembler-times "movq\[\\t \]*-8\\(%(?:r|e)bp\\),\[\\t \]*%rdi" 2 { target { { ! ia32 } && nonpic } } } } */
+/* { dg-final { scan-assembler-times "popq\[\\t \]*%rdi" 2 { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler-times "iret" 2 { target ia32 } } } */
 /* { dg-final { scan-assembler-times "iretq" 2 { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler-times "\tcld" 2 } } */
index 701ab2f4d33fc41ff7bb7f646727cb9603c7e2cf..2a0d260cfe6ae9c10997b7bb65f1daa184a6c011 100644 (file)
@@ -24,12 +24,12 @@ fn2 (void *frame, uword_t error)
 /* { dg-final { scan-assembler-not "(push|pop)l\[\\t \]*%edi" { target ia32 } } } */
 /* { dg-final { scan-assembler-not "(push|pop)q\[\\t \]*%rax" { target { { ! ia32 } && nonpic } } } } */
 /* { dg-final { scan-assembler-not "(push|pop)q\[\\t \]*%r\[0-9\]+" { target { ! ia32 } } } } */
-/* { dg-final { scan-assembler-times "push(?:l|q)\[\\t \]*%(?:r|e)bp" 2 } } */
-/* { dg-final { scan-assembler-times "leave" 2 { target nonpic } } } */
+/* { dg-final { scan-assembler-times "pushl\[\\t \]*%ebp" 2 { target ia32 } } } */
+/* { dg-final { scan-assembler-times "leave" 2 { target { ia32 && nonpic } } } } */
 /* { dg-final { scan-assembler-times "pushl\[\\t \]*%eax" 2 { target ia32 } } } */
 /* { dg-final { scan-assembler-times "movl\[\\t \]*-4\\(%ebp\\),\[\\t \]*%eax" 2 { target ia32 } } } */
 /* { dg-final { scan-assembler-times "pushq\[\\t \]*%rdi" 2 { target { ! ia32 } } } } */
-/* { dg-final { scan-assembler-times "movq\[\\t \]*-8\\(%(?:r|e)bp\\),\[\\t \]*%rdi" 2 { target { { ! ia32 } && nonpic } } } } */
+/* { dg-final { scan-assembler-times "popq\[\\t \]*%rdi" 2 { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler "(addl|leal).*4.*%esp" { target ia32 } } } */
 /* { dg-final { scan-assembler "(add|lea)(?:l|q)\[\\t \]*\\\$?8.*,\[\\t \]*%\[re\]?sp" { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler-times "iret" 2 { target ia32 } } } */