This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/51879] Missed tail merging with non-const/pure calls
- 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, 18 Jan 2012 10:45:01 +0000
- Subject: [Bug tree-optimization/51879] Missed tail merging with non-const/pure calls
- Auto-submitted: auto-generated
- References: <bug-51879-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51879
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-18 10:45:01 UTC ---
(In reply to comment #2)
> I'm afraid a lot would break. It really depends on what you use VN for and on
> what code.
> If you have:
> D.12345_1 = bar (7);
> D.12346_2 = bar (7);
> and bar isn't const/pure call, then if VN equivalences D.12345_1 and D.12346_2,
> it is wrong. Of course if you have:
> <bb7>:
> D.12345_1 = bar (7);
> goto bb9;
> <bb8>:
> D.12346_2 = bar (7);
> <bb9>:
> D.12347_3 = PHI <D.12345_1(7), D.12346_2(8)>
> (this case), you could VN them the same.
Yes, but not for
D.12345_1 = bar (7);
D.12346_2 = bar (7);
so you can't really value-number the calls the same. As we are working
on SSA SCCs and not on a CFG (and thus do not do predicated value-numbering)
that ability is useless.