public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH,testsuite] fix gcc.dg/tree-ssa/wholeprogram-1.c for -fPIC
@ 2007-07-25 18:02 Nathan Froyd
  2007-07-25 18:22 ` Kaveh R. GHAZI
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Froyd @ 2007-07-25 18:02 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 704 bytes --]

The attached patch resolves a problem with
gcc.dg/tree-ssa/wholeprogram-1.c and testing with -fPIC.  With -fPIC,
the inliner believes that large_function is not eligible for inlining
because global symbols can be overridden from other modules, which
causes the testcase to fail.  The simplest solution is to mark
large_function as static, thereby ensuring that large_function is a
local symbol rather than a global one.

Tested on powerpc-wrs-vxworks with and without -fPIC.  No regressions.
OK to commit?

-Nathan

2007-07-25  Nathan Froyd  <froydnj@codesourcery.com>

	gcc/testsuite/
	* gcc.dg/tree-ssa/wholeprogram-1.c (large_function): Declare as
	static to ensure it gets inlined even when -fPIC.



[-- Attachment #2: wholeprogram.patch --]
[-- Type: text/plain, Size: 359 bytes --]

Index: gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-1.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-1.c	(revision 177249)
+++ gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-1.c	(working copy)
@@ -2,7 +2,7 @@
 int b[100];
 void abort (void);
 
-void
+static void
 large_function ()
 {
   int i;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-02  1:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-25 18:02 [PATCH,testsuite] fix gcc.dg/tree-ssa/wholeprogram-1.c for -fPIC Nathan Froyd
2007-07-25 18:22 ` Kaveh R. GHAZI
2007-07-25 20:33   ` Nathan Froyd
2007-07-26 21:13     ` Kaveh R. GHAZI
2007-08-02  1:22     ` Mark Mitchell

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).