summaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-10 20:07:50 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-10 20:07:50 +0000
commit0091de3c2b5a7dcca2e3774c5ec1f3d92e988ebb (patch)
tree8f5d713bed3e3e3ffdce3d1ec3c8c4e6792024be /gcc/ipa-prop.c
parentf5cfa40206ef61cecab14e624f380e4cbbf7c0de (diff)
downloadgcc-0091de3c2b5a7dcca2e3774c5ec1f3d92e988ebb.tar.gz
2010-12-10 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 167697 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@167699 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 7c7df56e6f4..af5b2617dbc 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -460,11 +460,15 @@ compute_complex_ancestor_jump_func (struct ipa_node_params *info,
tree tmp, parm, expr;
int index, i;
- if (gimple_phi_num_args (phi) != 2
- || !integer_zerop (PHI_ARG_DEF (phi, 1)))
+ if (gimple_phi_num_args (phi) != 2)
return;
- tmp = PHI_ARG_DEF (phi, 0);
+ if (integer_zerop (PHI_ARG_DEF (phi, 1)))
+ tmp = PHI_ARG_DEF (phi, 0);
+ else if (integer_zerop (PHI_ARG_DEF (phi, 0)))
+ tmp = PHI_ARG_DEF (phi, 1);
+ else
+ return;
if (TREE_CODE (tmp) != SSA_NAME
|| SSA_NAME_IS_DEFAULT_DEF (tmp)
|| !POINTER_TYPE_P (TREE_TYPE (tmp))
@@ -2210,13 +2214,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 +2231,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 +2245,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);