diff options
author | Richard Guenther <rguenther@suse.de> | 2008-03-18 16:10:24 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-03-18 16:10:24 +0000 |
commit | b80280f2c568097c1da9aacd9b540f74ad91cf22 (patch) | |
tree | 1e20a972378312ce4158563ae53589c5b3dda789 /gcc/tree-ssa-sccvn.c | |
parent | 2e28e797125a94c7587b599eba438015fa02e5fe (diff) | |
download | gcc-b80280f2c568097c1da9aacd9b540f74ad91cf22.zip gcc-b80280f2c568097c1da9aacd9b540f74ad91cf22.tar.gz gcc-b80280f2c568097c1da9aacd9b540f74ad91cf22.tar.bz2 |
tree-ssa-sccvn.c (visit_reference_op_load): If the lookup found an expression with constants, note that in the VN for the lhs.
2008-03-18 Richard Guenther <rguenther@suse.de>
* tree-ssa-sccvn.c (visit_reference_op_load): If the lookup
found an expression with constants, note that in the VN for the lhs.
* tree-ssa-pre.c (eliminate): Visit COND_EXPR statements and
fold them to constants if possible. Run cleanup_cfg if done so.
(execute_pre): Return todo.
(do_pre): Likewise.
(execute_fre): Likewise.
* tree-ssa-forwprop.c (can_propagate_from): Allow propagation
of constants.
(get_prop_source_stmt): Look through pointer conversions.
* gcc.dg/tree-ssa/forwprop-4.c: New testcase.
* gcc.dg/tree-ssa/ssa-fre-16.c: Likewise.
From-SVN: r133315
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 b10d3e3..b613b2b 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1251,6 +1251,12 @@ visit_reference_op_load (tree lhs, tree op, tree stmt) if (result) { changed = set_ssa_val_to (lhs, result); + if (TREE_CODE (result) == SSA_NAME + && VN_INFO (result)->has_constants) + { + VN_INFO (lhs)->expr = VN_INFO (result)->expr; + VN_INFO (lhs)->has_constants = true; + } } else { |