public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3244] Fix gcc.dg/ipa/inline-8.c for -fPIC
@ 2021-08-31  6:29 Andrew Pinski
  0 siblings, 0 replies; only message in thread
From: Andrew Pinski @ 2021-08-31  6:29 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:aba800615e1af875b75f7774de67778c1b3315ad

commit r12-3244-gaba800615e1af875b75f7774de67778c1b3315ad
Author: Andrew Pinski <apinski@marvell.com>
Date:   Tue Aug 31 05:36:47 2021 +0000

    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:
---
 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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-31  6:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31  6:29 [gcc r12-3244] Fix gcc.dg/ipa/inline-8.c for -fPIC Andrew Pinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).