From: Andrew Pinski Date: Tue, 31 Aug 2021 05:36:47 +0000 (+0000) Subject: Fix gcc.dg/ipa/inline-8.c for -fPIC X-Git-Tag: basepoints/gcc-13~5069 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aba800615e1af875b75f7774de67778c1b3315ad;p=thirdparty%2Fgcc.git Fix gcc.dg/ipa/inline-8.c for -fPIC 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. gcc/testsuite/ChangeLog: * gcc.dg/ipa/inline-8.c: Mark cmp and move as static so they both bind local and available for inlinine. --- diff --git a/gcc/testsuite/gcc.dg/ipa/inline-8.c b/gcc/testsuite/gcc.dg/ipa/inline-8.c index 388283ca2132..c51eec20fc83 100644 --- a/gcc/testsuite/gcc.dg/ipa/inline-8.c +++ b/gcc/testsuite/gcc.dg/ipa/inline-8.c @@ -6,13 +6,13 @@ #include 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;