]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix gcc.dg/ipa/inline-8.c for -fPIC
authorAndrew Pinski <apinski@marvell.com>
Tue, 31 Aug 2021 05:36:47 +0000 (05:36 +0000)
committerAndrew Pinski <apinski@marvell.com>
Tue, 31 Aug 2021 06:28:27 +0000 (06:28 +0000)
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.

gcc/testsuite/gcc.dg/ipa/inline-8.c

index 388283ca2132af063321324f6ff77f6d8dcf63e4..c51eec20fc830116ed66c6ec2760946f7458e3c0 100644 (file)
@@ -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;