[PATCH TESTSUITE]: fix gcc.dg/tree-ssa/inline-2.c with -fpic/-fPIC

Richard Guenther richard.guenther@gmail.com
Thu Nov 6 10:03:00 GMT 2008


On Thu, Nov 6, 2008 at 6:27 AM, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> This patch fixes gcc.dg/tree-ssa/inline-2.c when run with -fpic/-fPIC.
>
> The function foo() must be inlined for the test to succeed, and it is
> marked with attribute "always_inline".  However my understanding from
> the docs is that this attribute is a noop unless you add the "inline"
> keyword as well.

Hm, yeah.  Maybe we should warn about this.

> Patch 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>
>
>        * gcc.dg/tree-ssa/inline-2.c (foo): Add 'inline' keyword.
>
> diff -rup orig/egcc-SVN20081105/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c egcc-SVN20081105/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c
> --- orig/egcc-SVN20081105/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c      2008-08-10 02:01:51.000000000 +0200
> +++ egcc-SVN20081105/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c   2008-11-05 21:24:02.000000000 +0100
> @@ -5,7 +5,7 @@
>    and the call to link_error optimized away.  */
>
>  extern void link_error (void);
> -int __attribute__((always_inline)) foo(void) { return 0; }
> +inline int __attribute__((always_inline)) foo(void) { return 0; }
>
>  int main()
>  {
>



More information about the Gcc-patches mailing list