From: Julia Koval Date: Mon, 6 Mar 2017 16:08:59 +0000 (+0100) Subject: Set incoming stack boundary to 128 for 64-bit targets X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=52564551d3b21bc1cf08d87de8a0682764753c8a;p=gcc.git Set incoming stack boundary to 128 for 64-bit targets 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 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 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9fc372641d..05001aa26e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-06 Julia Koval + + 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 PR tree-optimization/79894 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 1b982077cae..e705a3eb923 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 23adcd1884f..798d89b2571 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2017-03-06 Julia Koval + + 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 PR c++/79822 diff --git a/gcc/testsuite/gcc.target/i386/interrupt-12.c b/gcc/testsuite/gcc.target/i386/interrupt-12.c index 23780050d76..078bbcf7798 100644 --- a/gcc/testsuite/gcc.target/i386/interrupt-12.c +++ b/gcc/testsuite/gcc.target/i386/interrupt-12.c @@ -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 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/interrupt-13.c b/gcc/testsuite/gcc.target/i386/interrupt-13.c index 378145ec672..77ee3a51070 100644 --- a/gcc/testsuite/gcc.target/i386/interrupt-13.c +++ b/gcc/testsuite/gcc.target/i386/interrupt-13.c @@ -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 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/interrupt-14.c b/gcc/testsuite/gcc.target/i386/interrupt-14.c index f574f4fafac..92b3cb014df 100644 --- a/gcc/testsuite/gcc.target/i386/interrupt-14.c +++ b/gcc/testsuite/gcc.target/i386/interrupt-14.c @@ -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 } } */ diff --git a/gcc/testsuite/gcc.target/i386/interrupt-15.c b/gcc/testsuite/gcc.target/i386/interrupt-15.c index 701ab2f4d33..2a0d260cfe6 100644 --- a/gcc/testsuite/gcc.target/i386/interrupt-15.c +++ b/gcc/testsuite/gcc.target/i386/interrupt-15.c @@ -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 } } } */