public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <rguenther@suse.de>
To: "Kaveh R. GHAZI" <ghazi@caip.rutgers.edu>
Cc: Nathan Froyd <froydnj@codesourcery.com>,
	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
Date: Thu, 24 Jan 2008 01:54:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.0801232223100.23003@zhemvz.fhfr.qr> (raw)
In-Reply-To: <Pine.GSO.4.58.0801231534180.7737@caipclassic.rutgers.edu>

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.

  reply	other threads:[~2008-01-23 21:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-26 21:40 Nathan Froyd
2008-01-24  1:09 ` Kaveh R. GHAZI
2008-01-24  1:54   ` Richard Guenther [this message]
2008-01-24 11:30     ` Kaveh R. GHAZI
2008-01-24 13:24       ` Richard Guenther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0801232223100.23003@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=froydnj@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ghazi@caip.rutgers.edu \
    --cc=janis187@us.ibm.com \
    --cc=zadeck@naturalbridge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).