diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-29 02:50:47 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-29 02:50:47 +0000 |
commit | 93b4f514639d51295df376f9a0b54562b365e952 (patch) | |
tree | 6ec2f8d5a10435c23e27413403888abc84af50b0 /gcc/tree-ssa-ccp.c | |
parent | f582bb6c92c50798e4f1e4a5a3ccc592d4215898 (diff) | |
download | gcc-93b4f514639d51295df376f9a0b54562b365e952.tar.gz |
PR 15089
* tree-ssa-copy.c (may_propagate_copy_into_asm): New.
* tree-flow.h (may_propagate_copy_into_asm): Declare.
* tree-ssa-ccp.c (replace_uses_in): Use it.
* tree-ssa-dom.c (cprop_operand): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88269 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 144a8bfaeb0..d3ad9563a6b 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -454,16 +454,21 @@ replace_uses_in (tree stmt, bool *replaced_addresses_p) FOR_EACH_SSA_USE_OPERAND (use, stmt, iter, SSA_OP_USE) { - value *val = get_value (USE_FROM_PTR (use)); + tree tuse = USE_FROM_PTR (use); + value *val = get_value (tuse); - if (val->lattice_val == CONSTANT) - { - SET_USE (use, val->const_val); - replaced = true; - if (POINTER_TYPE_P (TREE_TYPE (USE_FROM_PTR (use))) - && replaced_addresses_p) - *replaced_addresses_p = true; - } + if (val->lattice_val != CONSTANT) + continue; + + if (TREE_CODE (stmt) == ASM_EXPR + && !may_propagate_copy_into_asm (tuse)) + continue; + + SET_USE (use, val->const_val); + + replaced = true; + if (POINTER_TYPE_P (TREE_TYPE (tuse)) && replaced_addresses_p) + *replaced_addresses_p = true; } return replaced; |