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 Fri, Nov 28, 2008 at 08:30:35AM -0800, H.J. Lu wrote:
> On Fri, Nov 28, 2008 at 10:49:16AM -0500, Kaveh R. GHAZI wrote:
> > On Wed, 26 Nov 2008, Andrew Pinski wrote:
> > 
> > > On Wed, Nov 26, 2008 at 10:02 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >>>
> > > >>> Darwin doesn't support sibcall. I am checking it to mark them Linux
> > > >>> only.
> > > >>> H.J.
> > > >>
> > > > static bool
> > > > ix86_function_ok_for_sibcall (tree decl, tree exp)
> > > > {
> > > >  tree func;
> > > >  rtx a, b;
> > > >
> > > >  /* If we are generating position-independent code, we cannot sibcall
> > > >     optimize any indirect call, or a direct call to a global function,
> > > >     as the PLT requires %ebx be live.  */
> > > >  if (!TARGET_64BIT && flag_pic && (!decl || !targetm.binds_local_p (decl)))
> > > >    return false;
> > > >
> > > > Darwin returns false.
> > > >
> > >
> > > Because darwin is always pic though binds_local_p should return true ...
> > > -- Pinski
> > 
> > HJ,
> > 
> > You should change the target selector from "*-*-linux*" to "nonpic" since
> > you'll get a failure on linux with "-m32 -fpic", e.g:
> > 
> > http://gcc.gnu.org/ml/gcc-testresults/2008-11/msg02492.html
> 
> I am checking in this patch to make them for nonpic only.
> 
> > 
> > Note: pr37843-3.c is failing on the nonpic case as well.  Even in your own
> > testsuite results.  E.g:
> > 
> > http://gcc.gnu.org/ml/gcc-testresults/2008-11/msg02491.html
> > 
> 
> See:
> 
> http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01309.html
> 

Even after middle-end patch is applied, pr37843-3.c only works with
non-PIC.  I am applying this patch.


H.J.
---
Index: gcc.target/i386/pr37843-3.c
===================================================================
--- gcc.target/i386/pr37843-3.c	(revision 142277)
+++ gcc.target/i386/pr37843-3.c	(working copy)
@@ -1,5 +1,5 @@
 /* Test for stack alignment with sibcall optimization.  */
-/* { dg-do compile { target { *-*-linux* && ilp32 } } } */
+/* { dg-do compile { target { *-*-linux* && { ilp32 && nonpic } } } } */
 /* { dg-options "-O2 -std=gnu99 -mpreferred-stack-boundary=4 -mincoming-stack-boundary=2" } */
 /* { dg-final { scan-assembler-not "andl\[\\t \]*\\$-16,\[\\t \]*%\[re\]?sp" } } */
 /* { dg-final { scan-assembler-not "call\[\\t \]*foo" } } */
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 142277)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2008-11-29  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR middle-end/37843
+	* gcc.target/i386/pr37843-3.c: Make it nonpic targets only.
+
 2008-11-29  Janus Weil  <janus@gcc.gnu.org>
 	    Tobias Burnus <burnus@gcc.gnu.org>
 


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