This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/50346] Function call foils VRP/jump-threading of redundant predicate on struct member
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Oct 2011 10:10:15 +0000
- Subject: [Bug tree-optimization/50346] Function call foils VRP/jump-threading of redundant predicate on struct member
- Auto-submitted: auto-generated
- References: <bug-50346-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50346
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c++ |tree-optimization
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-12 10:10:15 UTC ---
Well, it's a tree optimization issue. It's simple - the local aggregate f
escapes the function via the member function call to baz:
<bb 5>:
foo::baz (&f);
and as our points-to analysis is not flow-sensitive for memory/calls this
causes f to be clobbered by the call to bar:
<bb 2>:
f.b = 0;
# USE = nonlocal null { f }
# CLB = nonlocal null { f }
retval.0_2 = bar ();
as neither the bodies of baz nor bar are visible there is nothing we can do
here (short of re-doing points-to analysis flow-sensitive for memory).
f.b is partially redundant, so you see later jump-threading at work optimizing
the path following the f.b = true assignment.