diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-21 16:15:08 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-21 16:15:08 +0000 |
commit | 3e4be816670d003898f20e8b25c0b6ab8ae7a472 (patch) | |
tree | 1ade2292fbb0e32211932a86c3ef59a327851403 /gcc/tree-ssa-ccp.c | |
parent | 8ef22a65ce978312f311c8065b838fa2a2bcbfad (diff) | |
download | gcc-3e4be816670d003898f20e8b25c0b6ab8ae7a472.tar.gz |
2008-08-21 Richard Guenther <rguenther@suse.de>
* tree-ssa-ccp.c (ccp_fold): Fold VIEW_CONVERT_EXPRs of constants.
* gcc.dg/vect/vect-fold-1.c: Scan ccp1 dump instead of dom1.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139398 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index cd50ad45941..57aa473481c 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -961,7 +961,17 @@ ccp_fold (gimple stmt) } if (kind == tcc_reference) - return fold_const_aggregate_ref (rhs); + { + if (TREE_CODE (rhs) == VIEW_CONVERT_EXPR + && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME) + { + prop_value_t *val = get_value (TREE_OPERAND (rhs, 0)); + if (val->lattice_val == CONSTANT) + return fold_unary (VIEW_CONVERT_EXPR, + TREE_TYPE (rhs), val->value); + } + return fold_const_aggregate_ref (rhs); + } else if (kind == tcc_declaration) return get_symbol_constant_value (rhs); return rhs; |