This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PING: PATCH: PR middle-end/37843:[4.4 Regression] unaligned stack in maindue to tail call optimizatiP
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
Thanks.
H.J.
---
Index: gcc.target/i386/pr37843-2.c
===================================================================
--- gcc.target/i386/pr37843-2.c (revision 142258)
+++ gcc.target/i386/pr37843-2.c (working copy)
@@ -1,5 +1,5 @@
/* Test for stack alignment with sibcall optimization. */
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target nonpic } } */
/* { 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 142258)
+++ gcc.target/i386/pr37843-1.c (working copy)
@@ -1,5 +1,5 @@
/* Test for stack alignment with sibcall optimization. */
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target nonpic } } */
/* { 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 142258)
+++ ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2008-11-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/37843
+ * gcc.target/i386/pr37843-1.c: Make it nonpic targets only.
+ * gcc.target/i386/pr37843-2.c: Likewise.
+
2008-11-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37955