From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23727 invoked by alias); 23 Jan 2008 21:24:10 -0000 Received: (qmail 23712 invoked by uid 22791); 23 Jan 2008 21:24:09 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 23 Jan 2008 21:23:40 +0000 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 4F7B126602; Wed, 23 Jan 2008 22:23:38 +0100 (CET) Date: Thu, 24 Jan 2008 01:54:00 -0000 From: Richard Guenther To: "Kaveh R. GHAZI" Cc: Nathan Froyd , gcc-patches@gcc.gnu.org, janis187@us.ibm.com, zadeck@naturalbridge.com Subject: Re: [PATCH,testsuite] fix gcc.dg/tree-ssa/20030714-1.c with -fPIC In-Reply-To: Message-ID: References: <20070726211317.GA32033@sparrowhawk.codesourcery.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: 2008-01/txt/msg01120.txt.bz2 On Wed, 23 Jan 2008, Kaveh R. GHAZI wrote: > The testcase gcc.dg/tree-ssa/20030714-1.c is failing on the branches with > -fpic/-fPIC and this failure is a regression (apparently intentional) from > previous 4.x gcc. More analysis below. > > The test seems to rely on the code being automatically marked pure/const > by gcc during compilation. Mainline is okay because the failing scans in > the test were removed as part of the fix for PR33826 by Kenny. In that > PR, it was decided that recursive function must not be considered for > automatic pure/const marking. So now the testcase on mainline passes > regardless of pic or nonpic, because the checks have been truncated to fit > into this new requirement. > > On the branches, the testcase still does the original checks and gcc still > allows recursive functions to become pure/const. And it passes in the > regular default case. However a change was made by Richard G. to ensure > this optimization happens only if the functions bind locally. With > -fpic/-fPIC the function doesn't bind locally and the error pops up. > > Nathan proposed a fix to the testcase here in July: > http://gcc.gnu.org/ml/gcc-patches/2007-07/msg01948.html > but I don't see that it ever got reviewed or installed. > > I believe Nathan's solution is correct in that he makes the function > static so it binds locally. By doing so, (and using a global wrapper to > get the dump) it works for -fpic/-fPIC. > > Another option would be to backport Kenny's patch for PR33826 which as a > side-effect would cure this failure by removing the scans. This might be > the correct thing to do given the analysis in the PR, however it is also > more intrusive. I haven't bootstrapped Kenny's patch on the branches to > make sure it doesn't break anything, but I will if people think it's a > better option. > > Thoughts on the best way to go? Backporting Kennys patch is the right thing to do - I don't know why the PR was closed as fixed. Thanks, Richard.