public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: PING: PATCH: PR middle-end/37843:[4.4 Regression] unaligned stack  in maindue to tail call optimizatiP
@ 2008-11-05 16:52 Uros Bizjak
  2008-11-05 18:18 ` H.J. Lu
  0 siblings, 1 reply; 17+ messages in thread
From: Uros Bizjak @ 2008-11-05 16:52 UTC (permalink / raw)
  To: GCC Patches; +Cc: H.J. Lu

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.

Thanks,
Uros.


^ permalink raw reply	[flat|nested] 17+ messages in thread
* PING: PATCH: PR middle-end/37843:[4.4 Regression] unaligned stack in maindue to tail call optimizatiP
@ 2008-11-01  0:25 H.J. Lu
  2008-11-04 17:54 ` H.J. Lu
  0 siblings, 1 reply; 17+ messages in thread
From: H.J. Lu @ 2008-11-01  0:25 UTC (permalink / raw)
  To: GCC Patches

On Fri, Oct 24, 2008 at 3:38 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Oct 17, 2008 at 10:06 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> H.J. Lu wrote:
>>
>>>
>>> The problem is sibcall optimization will use the incoming stack
>>> boundary as the outgoing stack boundary. It is OK as long as
>>> the incoming stack boundary >= the outgoing stack boundary.
>>> ix86_function_ok_for_sibcall needs to know the precise incoming
>>> stack boundary, which is set in expand_stack_alignment, to
>>> check if the incoming stack boundary >= the outgoing stack
>>> boundary.
>>>
>>> This patch moves updating stack boundary before
>>> TARGET_FUNCTION_OK_FOR_SIBCALL is called. It
>>> changes cfgexpand.c and i386.c. OK for trunk?
>>>
>>> Thanks.
>>>
>>>  2008-10-15  H.J. Lu  <hongjiu.lu@intel.com>
>>>            Joey Ye  <joey.ye@intel.com>
>>>
>>>        PR target/37843
>>>        * cfgexpand.c (expand_stack_alignment): Move updating stack
>>>        boundary to ...
>>>        (gimple_expand_cfg): 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-10-15  H.J. Lu  <hongjiu.lu@intel.com>
>>>
>>>        PR target/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.
>>
>> x86 part is OK, but generic part needs middle-end review.
>>
>> Thanks,
>> Uros.
>>
>
> Could middle-end reviewers take a  look at cfgexpand.c change?
>

Ping:

http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00724.html


-- 
H.J.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2008-11-30 14:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-05 16:52 PING: PATCH: PR middle-end/37843:[4.4 Regression] unaligned stack in maindue to tail call optimizatiP Uros Bizjak
2008-11-05 18:18 ` H.J. Lu
2008-11-11 12:19   ` H.J. Lu
2008-11-19 18:27     ` H.J. Lu
2008-11-26 15:57   ` H.J. Lu
2008-11-26 19:08     ` Jack Howarth
2008-11-26 19:42       ` H.J. Lu
2008-11-26 20:07         ` Andrew Pinski
2008-11-26 20:35           ` Jack Howarth
2008-11-28 16:03           ` Kaveh R. GHAZI
2008-11-28 17:58             ` H.J. Lu
2008-11-29 17:59               ` H.J. Lu
2008-11-30  5:18                 ` PING: PATCH: PR middle-end/37843:[4.4 Regression] unalignedstack " Kaveh R. Ghazi
2008-11-30  8:52                   ` H.J. Lu
2008-11-30 15:47                     ` Kaveh R. Ghazi
  -- strict thread matches above, loose matches on Subject: below --
2008-11-01  0:25 PING: PATCH: PR middle-end/37843:[4.4 Regression] unaligned stack " H.J. Lu
2008-11-04 17:54 ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).