[PATCH] Fix gcc.dg/ipa/inline-8.c for -fPIC

Richard Biener richard.guenther@gmail.com
Tue Aug 31 06:15:10 GMT 2021


On Tue, Aug 31, 2021 at 7:41 AM apinski--- via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> From: Andrew Pinski <apinski@marvell.com>
>
> The problem here is with -fPIC, both cmp and move
> don't bind locally so they are not even tried to be
> inlined.  This fixes the issue by marking both
> functions as static and now the testcase passes
> for both -fPIC and -fno-PIC cases.
>
> OK? Tested on x86_64-linux-gnu.

OK

> gcc/testsuite/ChangeLog:
>
>         * gcc.dg/ipa/inline-8.c: Mark cmp and move as
>         static so they both bind local and available for
>         inlinine.
> ---
>  gcc/testsuite/gcc.dg/ipa/inline-8.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.dg/ipa/inline-8.c b/gcc/testsuite/gcc.dg/ipa/inline-8.c
> index 388283ca213..c51eec20fc8 100644
> --- a/gcc/testsuite/gcc.dg/ipa/inline-8.c
> +++ b/gcc/testsuite/gcc.dg/ipa/inline-8.c
> @@ -6,13 +6,13 @@
>  #include <math.h>
>  extern int isnanf (float);
>  /* Can't be inlined because isnanf will be optimized out.  */
> -int
> +static int
>  cmp (float a)
>  {
>    return isnanf (a);
>  }
>  /* Can be inlined.  */
> -int
> +static int
>  move (int a)
>  {
>    return a;
> --
> 2.17.1
>


More information about the Gcc-patches mailing list