From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18000 invoked by alias); 25 Jul 2007 17:30:06 -0000 Received: (qmail 17919 invoked by uid 22791); 25 Jul 2007 17:30:04 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 25 Jul 2007 17:30:01 +0000 Received: (qmail 27970 invoked from network); 25 Jul 2007 17:29:59 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Jul 2007 17:29:59 -0000 Date: Wed, 25 Jul 2007 18:02:00 -0000 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Subject: [PATCH,testsuite] fix gcc.dg/tree-ssa/wholeprogram-1.c for -fPIC Message-ID: <20070725172953.GA13536@sparrowhawk.codesourcery.com> Mail-Followup-To: gcc-patches@gcc.gnu.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg01836.txt.bz2 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 704 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 gcc/testsuite/ * gcc.dg/tree-ssa/wholeprogram-1.c (large_function): Declare as static to ensure it gets inlined even when -fPIC. --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="wholeprogram.patch" Content-length: 359 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; --M9NhX3UHpAaciwkO--