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: [PATCH TESTSUITE]: fix g++.dg/ipa/iinline-1.C with -fpic/-fPIC


On Thu, Nov 6, 2008 at 6:28 AM, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> This patch fixes g++.dg/ipa/iinline-1.C when run with -fpic/-fPIC.
>
> The function String::funcOne must be inlined for the test to succeed.
> By adding -fpie to the compilation, we ensure the function binds
> locally and gets inlined.
>
> This is the same way g++.dg/other/first-global.C and
> g++.dg/parse/attr-externally-visible-1.C solve this problem.  I like
> the -fpie solution in general because it doesn't alter the test
> parameters in the default (nonpic) case.
>
> I also noticed that the test uses "dg-do compile" which implies "-S",
> but the dg-options had "-c" in it.  The test just scans the ipa dump,
> so I took out the "-c".
>
> Note, we're only compiling so (lack of) -fpie support in the toolchain
> is not a factor.
>
> Tested via "make check" on x86_64-unknown-linux-gnu with extra
> -fpic/-fPIC passes.  The test succeeds with the patch.
>
> Okay for mainline?

Ok.

Thanks,
RIchard.

>                Thanks,
>                --Kaveh
>
>
> 2008-11-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
>
>        * g++.dg/ipa/iinline-1.C: Remove -c flag, add -fpie for PIC
>        targets.
>
> diff -rup orig/egcc-SVN20081105/gcc/testsuite/g++.dg/ipa/iinline-1.C egcc-SVN20081105/gcc/testsuite/g++.dg/ipa/iinline-1.C
> --- orig/egcc-SVN20081105/gcc/testsuite/g++.dg/ipa/iinline-1.C  2008-08-23 02:01:47.000000000 +0200
> +++ egcc-SVN20081105/gcc/testsuite/g++.dg/ipa/iinline-1.C       2008-11-05 20:37:28.000000000 +0100
> @@ -1,7 +1,8 @@
>  /* Verify that simple indirect calls are inlined even without early
>    inlining..  */
>  /* { dg-do compile } */
> -/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining"  } */
> +/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining"  } */
> +/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fpie" { target { ! nonpic } } } */
>
>  extern void non_existent (const char *, int);
>
>


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