Commit 76d8a30a by Ian Lance Taylor Committed by Ian Lance Taylor

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
parent 7675ad4f
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> 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Implement opaque-enum-specifiesr for C++0x Implement opaque-enum-specifiesr for C++0x
...@@ -2186,7 +2186,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, ...@@ -2186,7 +2186,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
if (TREE_CODE (base) == ADDR_EXPR if (TREE_CODE (base) == ADDR_EXPR
&& DECL_P (TREE_OPERAND (base, 0))) && 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); adj->offset / BITS_PER_UNIT);
else if (TREE_CODE (base) != ADDR_EXPR else if (TREE_CODE (base) != ADDR_EXPR
&& POINTER_TYPE_P (TREE_TYPE (base))) && POINTER_TYPE_P (TREE_TYPE (base)))
...@@ -2209,7 +2209,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, ...@@ -2209,7 +2209,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
} }
else if (TREE_CODE (base) == MEM_REF) 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 base_offset
+ adj->offset / BITS_PER_UNIT); + adj->offset / BITS_PER_UNIT);
off = int_const_binop (PLUS_EXPR, TREE_OPERAND (base, 1), off = int_const_binop (PLUS_EXPR, TREE_OPERAND (base, 1),
...@@ -2218,7 +2218,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, ...@@ -2218,7 +2218,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
} }
else else
{ {
off = build_int_cst (reference_alias_ptr_type (base), off = build_int_cst (reference_alias_ptr_type (prev_base),
base_offset base_offset
+ adj->offset / BITS_PER_UNIT); + adj->offset / BITS_PER_UNIT);
base = build_fold_addr_expr (base); base = build_fold_addr_expr (base);
......
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> 2010-10-26 Tobias Burnus <burnus@net-b.de>
PR fortran/45451 PR fortran/45451
......
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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment