diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ipa-prop.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20101025-1.c | 30 |
4 files changed, 44 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 949fb10..1e329e2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-10-26 Ian Lance Taylor <iant@google.com> + + PR middle-end/45687 + * ipa-prop.c (ipa_modify_call_arguments): Correct type of MEM_REF + offset. + 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> Implement opaque-enum-specifiesr for C++0x 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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5eb2f5c..a29194f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-10-26 Ian Lance Taylor <iant@google.com> + + PR middle-end/45687 + * gcc.c-torture/execute/20101025-1.c: New test. + 2010-10-26 Tobias Burnus <burnus@net-b.de> PR fortran/45451 diff --git a/gcc/testsuite/gcc.c-torture/execute/20101025-1.c b/gcc/testsuite/gcc.c-torture/execute/20101025-1.c new file mode 100644 index 0000000..95361a9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20101025-1.c @@ -0,0 +1,30 @@ +static int g_7; +static int *volatile g_6 = &g_7; +int g_3; + +static int f1 (int *p_58) +{ + return *p_58; +} + +void f2 (int i) __attribute__ ((noinline)); +void f2 (int i) +{ + g_3 = i; +} + +int f3 (void) __attribute__ ((noinline)); +int f3 (void) +{ + *g_6 = 1; + f2 (f1 (&g_7)); + return 0; +} + +int main () +{ + f3 (); + if (g_3 != 1) + abort (); + exit (0); +} |