diff options
author | Ian Lance Taylor <iant@google.com> | 2010-10-26 13:39:37 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2010-10-26 13:39:37 +0000 |
commit | 76d8a30aaf0a266709be00a9e01148e60d803f1e (patch) | |
tree | f581fc6f99fb9a7212b2d307382a4b4a5cf54d48 /gcc/ipa-prop.c | |
parent | 7675ad4f6a9a8c6a1b1e75f9b31a669a874e19fe (diff) | |
download | gcc-76d8a30aaf0a266709be00a9e01148e60d803f1e.zip gcc-76d8a30aaf0a266709be00a9e01148e60d803f1e.tar.gz gcc-76d8a30aaf0a266709be00a9e01148e60d803f1e.tar.bz2 |
re PR middle-end/45687 (possible wrong code bug)
gcc/:
PR middle-end/45687
* ipa-prop.c (ipa_modify_call_arguments): Correct type of MEM_REF
offset.
gcc/testsuite:
* gcc.c-torture/execute/20101025-1.c: New test.
From-SVN: r165964
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 9ffbb3f..b3d9f91 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -2186,7 +2186,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, if (TREE_CODE (base) == ADDR_EXPR && DECL_P (TREE_OPERAND (base, 0))) - off = build_int_cst (reference_alias_ptr_type (base), + off = build_int_cst (TREE_TYPE (base), adj->offset / BITS_PER_UNIT); else if (TREE_CODE (base) != ADDR_EXPR && POINTER_TYPE_P (TREE_TYPE (base))) @@ -2209,7 +2209,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, } else if (TREE_CODE (base) == MEM_REF) { - off = build_int_cst (TREE_TYPE (TREE_OPERAND (base,1)), + off = build_int_cst (TREE_TYPE (TREE_OPERAND (base, 1)), base_offset + adj->offset / BITS_PER_UNIT); off = int_const_binop (PLUS_EXPR, TREE_OPERAND (base, 1), @@ -2218,7 +2218,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, } else { - off = build_int_cst (reference_alias_ptr_type (base), + off = build_int_cst (reference_alias_ptr_type (prev_base), base_offset + adj->offset / BITS_PER_UNIT); base = build_fold_addr_expr (base); |