diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-12 19:00:39 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-12 19:00:39 +0000 |
commit | 380c5f612a168b4a271b392ac16e202b4088c52d (patch) | |
tree | ce8fe06a4a5b43d55c7335eddbcf12d9026c27d4 /gcc/tree-ssa-sccvn.c | |
parent | 754a9c6cc1b3c2e514a8bfc2472a511a280637b1 (diff) | |
download | gcc-380c5f612a168b4a271b392ac16e202b4088c52d.tar.gz |
2009-06-12 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/38865
* tree-ssa-sccvn.c (visit_reference_op_load): If vn_reference_lookup
is returns NULL and OP is a VCE, look through the VCE.
2009-06-12 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/38865
* gcc.dg/tree-ssa/fre-vce-1.c
:
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148437 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 03fea751feb..6d263ded177 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1976,6 +1976,12 @@ visit_reference_op_load (tree lhs, tree op, gimple stmt) bool changed = false; tree result = vn_reference_lookup (op, gimple_vuse (stmt), true, NULL); + /* If we have a VCE, try looking up its operand as it might be stored in + a different type. */ + if (!result && TREE_CODE (op) == VIEW_CONVERT_EXPR) + result = vn_reference_lookup (TREE_OPERAND (op, 0), gimple_vuse (stmt), + true, NULL); + /* We handle type-punning through unions by value-numbering based on offset and size of the access. Be prepared to handle a type-mismatch here via creating a VIEW_CONVERT_EXPR. */ |