This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Remove bogus optimization from may_alias_p
On Tue, 21 Oct 2008, Richard Guenther wrote:
> On Tue, 21 Oct 2008, Daniel Berlin wrote:
>
> > On Tue, Oct 21, 2008 at 11:07 AM, Richard Guenther
> > <richard.guenther@gmail.com> wrote:
> > > On Tue, Oct 21, 2008 at 4:47 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> > >>> Bootstrapped and tested on x86_64-unknown-linux-gnu for the trunk
> > >>> and the gcc-4_3-branch. Committed to trunk and the branch.
> > >>>
> > >>> Richard.
> > >>>
> > >>> 2008-10-19 Richard Guenther <rguenther@suse.de>
> > >>>
> > >>> * tree-ssa-alias.c (may_alias_p): Remove bogus shortcut.
> > >>
> > >> On the 4.3 branch this causes lots of warnings during bootstrap of the form:
> > >>
> > > The stuff comes from the tree-ssa-alias-warnings.c code which is - err
> > > - bogus. On
> > > the trunk most of it is disabled because we prune all interesting
> > > stuff away from it,
> > > on the branch TBAA pruning of points-to sets was disabled, so the
> > > (bogus) warning
> > > code became "more effective" there. Retaining even more valid
> > > points-to information
> > > makes it appearantly go even more mad ... :/
> > >
> > > Unfortunately the author of said infrastructure left GCC development
> > > as I was told in
> > > the past. I will try to have a quick look (or end up reverting the
> > > patch on the branch).
> >
> > If the author is gone and nobody can update the code to be sane, we
> > should just remove it
>
> I have a nearly finished replacement for the trunk which deletes the code.
> It only depends on some PTA fixes ... ;) But for the branch this is
> probably not the way to go.
>
> Btw, I can reproduce it now. The interesting thing is that once I
> append -save-temps it doesn't reproduce anymore... :(
Try the following, we shouldn't trust points-to sets for producing
warnings if we merged in aliases of SMTs (we don't do that on
the trunk anymore). At least it gets me further with --enable-werror
than before.
Richard.
Index: tree-ssa-alias-warnings.c
===================================================================
--- tree-ssa-alias-warnings.c (revision 141264)
+++ tree-ssa-alias-warnings.c (working copy)
@@ -896,7 +896,7 @@ skip_this_pointer (tree ptr ATTRIBUTE_UN
return true;
/* This would probably cause too many false positives. */
- if (pi->value_escapes_p || pi->pt_anything)
+ if (pi->value_escapes_p || pi->pt_anything || pi->pt_global_mem)
return true;
return false;