This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PING: PATCH: PR middle-end/37843:[4.4 Regression] unaligned stack in maindue to tail call optimizatiP


On Wed, Nov 05, 2008 at 10:06:57AM -0800, H.J. Lu wrote:
> On Wed, Nov 5, 2008 at 8:49 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> > Hello!
> >
> >> Here is the updated version. When we update stack boundary before
> >> expanding a function, we don't need to check parm_stack_boundary
> >> in expand_stack_alignment.  Tested on Linux/ia32, Linux/Intel64 and
> >> Linux/ia64.  OK for trunk?
> >>
> >> Thanks.
> >>
> >>
> >> --
> >> H.J.
> >> ----
> >> gcc/
> >>
> >> 2008-11-04  H.J. Lu  <hongjiu.lu@intel.com>
> >>            Joey Ye  <joey.ye@intel.com>
> >>
> >>        PR middle-end/37843
> >>        * cfgexpand.c (expand_stack_alignment): Don't update stack
> >>        boundary nor check incoming stack boundary here.
> >>        (gimple_expand_cfg): Update stack boundary and check incoming
> >>        stack boundary here.
> >>
> >>        * config/i386/i386.c (ix86_function_ok_for_sibcall): Return
> >>        false if we need to align the outgoing stack.
> >>        (ix86_update_stack_boundary): Check parm_stack_boundary.
> >>
> >> gcc/testsuite/
> >>
> >> 2008-11-04  H.J. Lu  <hongjiu.lu@intel.com>
> >>
> >>        PR middle-end/37843
> >>        * gcc.target/i386/align-main-3.c: New.
> >>        * gcc.target/i386/pr37843-1.c: Likewise.
> >>        * gcc.target/i386/pr37843-2.c: Likewise.
> >>        * gcc.target/i386/pr37843-3.c: Likewise.
> >>
> >
> >> --- gcc/testsuite/gcc.target/i386/align-main-3.c.sibcall        2008-11-04
> >> 08:33:41.000000000 -0800
> >> +++ gcc/testsuite/gcc.target/i386/align-main-3.c        2008-11-04
> >> 08:33:41.000000000 -0800
> >> @@ -0,0 +1,14 @@
> >> +/* Test for stack alignment with sibcall optimization.  */
> >> +/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ilp32
> >> } } } */
> >>
> >
> >
> > It is enough to check for "target { *-*-linux*  && ilp32 }", since we
> > execute gcc.target/i386 for i?86 and x86_64 targets only.
> >
> >> --- gcc/testsuite/gcc.target/i386/pr37843-3.c.sibcall   2008-11-04
> >> 08:33:41.000000000 -0800
> >> +++ gcc/testsuite/gcc.target/i386/pr37843-3.c   2008-11-04
> >> 08:33:41.000000000 -0800
> >> @@ -0,0 +1,13 @@
> >> +/* Test for stack alignment with sibcall optimization.  */
> >> +/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ilp32
> >> } } } */
> >>
> >
> > Same here.
> >
> 
> Here is the updated patch. Tested on Linux/ia32, Linux/Intel64 and
> Linux/ia64.  OK for trunk?
> 

Darwin doesn't support sibcall. I am checking it to mark them Linux
only.


H.J.
---
Index: gcc.target/i386/pr37843-2.c
===================================================================
--- gcc.target/i386/pr37843-2.c	(revision 142193)
+++ gcc.target/i386/pr37843-2.c	(working copy)
@@ -1,4 +1,5 @@
 /* Test for stack alignment with sibcall optimization.  */
+/* { dg-do compile { target *-*-linux* } } */
 /* { dg-options "-O2 -mpreferred-stack-boundary=6 -mincoming-stack-boundary=6" } */
 /* { dg-final { scan-assembler-not "and\[lq\]?\[\\t \]*\\$-64,\[\\t \]*%\[re\]?sp" } } */
 /* { dg-final { scan-assembler-not "call\[\\t \]*foo" } } */
Index: gcc.target/i386/pr37843-1.c
===================================================================
--- gcc.target/i386/pr37843-1.c	(revision 142193)
+++ gcc.target/i386/pr37843-1.c	(working copy)
@@ -1,4 +1,5 @@
 /* Test for stack alignment with sibcall optimization.  */
+/* { dg-do compile { target *-*-linux* } } */
 /* { dg-options "-O2 -mpreferred-stack-boundary=6 -mincoming-stack-boundary=5" } */
 /* { dg-final { scan-assembler "and\[lq\]?\[\\t \]*\\$-64,\[\\t \]*%\[re\]?sp" } } */
 /* { dg-final { scan-assembler "call\[\\t \]*foo" } } */
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 142193)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2008-11-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* gcc.target/i386/pr37843-1.c: Make it Linux only.
+	* gcc.target/i386/pr37843-2.c: Likewise.
+
 2008-11-25  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR middle-end/37843


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]