Commit 9bed2f0d by Andrew Pinski Committed by Andrew Pinski

re PR tree-optimization/49309 (ICE with -fmudflap: verify_stmts failed: type…

re PR tree-optimization/49309 (ICE with -fmudflap: verify_stmts failed: type mismatch in pointer plus expression)

2011-07-14  Andrew Pinski  <pinskia@gmail.com>

	PR tree-opt/49309
	* tree-mudflap.c (mf_xform_derefs_1 <case MEM_REF>):
	Use fold_build2_loc instead of build2.
	Use the correct type for the new tree.

2011-07-14  Andrew Pinski  <pinskia@gmail.com>

	PR tree-opt/49309
	* g++.dg/torture/pr49309.C: New testcase.

From-SVN: r176281
parent 1f88caaa
2011-07-14 Andrew Pinski <pinskia@gmail.com>
PR tree-opt/49309
* tree-mudflap.c (mf_xform_derefs_1 <case MEM_REF>):
Use fold_build2_loc instead of build2.
Use the correct type for the new tree.
2011-07-14 Bernd Schmidt <bernds@codesourcery.com> 2011-07-14 Bernd Schmidt <bernds@codesourcery.com>
PR rtl-optimization/11320 PR rtl-optimization/11320
......
2011-07-14 Andrew Pinski <pinskia@gmail.com>
PR tree-opt/49309
* g++.dg/torture/pr49309.C: New testcase.
2011-07-14 Bernd Schmidt <bernds@codesourcery.com> 2011-07-14 Bernd Schmidt <bernds@codesourcery.com>
* gcc.dg/pr48770.c: Add dg-require-effective-target fpic. * gcc.dg/pr48770.c: Add dg-require-effective-target fpic.
......
/* { dg-do compile } */
/* { dg-options "-fmudflap" } */
struct A
{
int i;
A();
A(const A&);
};
inline void foo(A a) { a = A(); }
void bar() { foo(A()); }
...@@ -869,7 +869,7 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp, ...@@ -869,7 +869,7 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp,
break; break;
case MEM_REF: case MEM_REF:
addr = build2 (POINTER_PLUS_EXPR, TREE_TYPE (TREE_OPERAND (t, 1)), addr = fold_build2_loc (location, POINTER_PLUS_EXPR, TREE_TYPE (TREE_OPERAND (t, 0)),
TREE_OPERAND (t, 0), TREE_OPERAND (t, 0),
fold_convert (sizetype, TREE_OPERAND (t, 1))); fold_convert (sizetype, TREE_OPERAND (t, 1)));
base = addr; base = addr;
......
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