===================================================================
@@ -1,3 +1,10 @@
+2011-07-13 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-13 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* config/spu/spu.c (spu_init_libfuncs): Install __clrsbdi2.
===================================================================
@@ -1,3 +1,8 @@
+2011-07-13 Andrew Pinski <pinskia@gmail.com>
+
+ PR tree-opt/49309
+ * g++.dg/torture/pr49309.C: New testcase.
+
2011-07-13 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/49296
===================================================================
@@ -0,0 +1,14 @@
+/* { 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
break;
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),
fold_convert (sizetype, TREE_OPERAND (t, 1)));
base = addr;