diff options
author | Martin Jambor <mjambor@suse.cz> | 2010-12-09 16:16:22 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2010-12-09 16:16:22 +0100 |
commit | 82d4982997c2e296135eb0c2f8f6c11b445c9484 (patch) | |
tree | b9b56ea61d799eb9047c570a47d2d6d142e02c00 /gcc/ipa-prop.c | |
parent | 544ae3f5fd694689b2eeb480b14acc316e49fa27 (diff) | |
download | gcc-82d4982997c2e296135eb0c2f8f6c11b445c9484.zip gcc-82d4982997c2e296135eb0c2f8f6c11b445c9484.tar.gz gcc-82d4982997c2e296135eb0c2f8f6c11b445c9484.tar.bz2 |
ipa-prop.h (struct ipa_parm_adjustment): New field alias_ptr_type.
2010-12-09 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (struct ipa_parm_adjustment): New field alias_ptr_type.
* ipa-prop.c (ipa_modify_call_arguments): Use it.
* tree-sra.c (splice_param_accesses): Test that all accesses have the
same alias reference type.
(turn_representatives_into_adjustments): Set alias_ptr_type of the
adjustment.
From-SVN: r167641
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 7c7df56..0e5a4b1 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -2210,13 +2210,10 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, base = gimple_call_arg (stmt, adj->base_index); loc = EXPR_LOCATION (base); - if (TREE_CODE (base) == ADDR_EXPR - && DECL_P (TREE_OPERAND (base, 0))) - off = build_int_cst (TREE_TYPE (base), + if (TREE_CODE (base) != ADDR_EXPR + && POINTER_TYPE_P (TREE_TYPE (base))) + off = build_int_cst (adj->alias_ptr_type, adj->offset / BITS_PER_UNIT); - else if (TREE_CODE (base) != ADDR_EXPR - && POINTER_TYPE_P (TREE_TYPE (base))) - off = build_int_cst (TREE_TYPE (base), adj->offset / BITS_PER_UNIT); else { HOST_WIDE_INT base_offset; @@ -2230,12 +2227,12 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, if (!base) { base = build_fold_addr_expr (prev_base); - off = build_int_cst (reference_alias_ptr_type (prev_base), + off = build_int_cst (adj->alias_ptr_type, adj->offset / BITS_PER_UNIT); } else if (TREE_CODE (base) == MEM_REF) { - off = build_int_cst (TREE_TYPE (TREE_OPERAND (base, 1)), + off = build_int_cst (adj->alias_ptr_type, base_offset + adj->offset / BITS_PER_UNIT); off = int_const_binop (PLUS_EXPR, TREE_OPERAND (base, 1), @@ -2244,7 +2241,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, } else { - off = build_int_cst (reference_alias_ptr_type (prev_base), + off = build_int_cst (adj->alias_ptr_type, base_offset + adj->offset / BITS_PER_UNIT); base = build_fold_addr_expr (base); |