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: "vries 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 05:41:34 +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 #1 from vries at gcc dot gnu.org 2012-01-18 05:41:34 UTC ---
This works for the 3 examples:
...
Index: tree-ssa-sccvn.c
===================================================================
--- tree-ssa-sccvn.c (revision 182098)
+++ tree-ssa-sccvn.c (working copy)
@@ -3360,8 +3360,7 @@ visit_use (tree use)
/* ??? We should handle stores from calls. */
else if (TREE_CODE (lhs) == SSA_NAME)
{
- if (!gimple_call_internal_p (stmt)
- && gimple_call_flags (stmt) & (ECF_PURE | ECF_CONST))
+ if (!gimple_call_internal_p (stmt))
changed = visit_reference_op_call (lhs, stmt);
else
changed = defs_to_varying (stmt);
...
I'll test this to see what breaks.