aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-03-20 13:26:19 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-03-20 13:26:19 +0000
commit92a8d7a7332ca2d53a70d856052b148331da518a (patch)
tree4cf6946974a9a59ae3ef87513ac71079e3170b97 /gcc/tree-ssa-sccvn.c
parent54714c680a46d4290c10b7369c1c1b2afd1e8d97 (diff)
downloadgcc-92a8d7a7332ca2d53a70d856052b148331da518a.zip
gcc-92a8d7a7332ca2d53a70d856052b148331da518a.tar.gz
gcc-92a8d7a7332ca2d53a70d856052b148331da518a.tar.bz2
re PR tree-optimization/56661 (Incorrect code with -O1 -ftree-pre)
2013-03-20 Richard Biener <rguenther@suse.de> PR tree-optimization/56661 * tree-ssa-sccvn.c (visit_use): Only value-number calls if the result does not have to be distinct. * gcc.dg/torture/pr56661.c: New testcase. From-SVN: r196825
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 8360cc7..e7aefbf 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -3506,8 +3506,13 @@ visit_use (tree use)
We can value number 2 calls to the same function with the
same vuse and the same operands which are not subsequent
the same, because there is no code in the program that can
- compare the 2 values. */
- || gimple_vdef (stmt)))
+ compare the 2 values... */
+ || (gimple_vdef (stmt)
+ /* ... unless the call returns a pointer which does
+ not alias with anything else. In which case the
+ information that the values are distinct are encoded
+ in the IL. */
+ && !(gimple_call_return_flags (stmt) & ERF_NOALIAS))))
changed = visit_reference_op_call (lhs, stmt);
else
changed = defs_to_varying (stmt);