From: Andrew Pinski Date: Thu, 14 Jul 2011 20:23:36 +0000 (-0700) Subject: re PR tree-optimization/49309 (ICE with -fmudflap: verify_stmts failed: type mismatch... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9bed2f0d159d8aecfabfc0f2a42bd278531a05dc;p=gcc.git re PR tree-optimization/49309 (ICE with -fmudflap: verify_stmts failed: type mismatch in pointer plus expression) 2011-07-14 Andrew Pinski PR tree-opt/49309 * tree-mudflap.c (mf_xform_derefs_1 ): Use fold_build2_loc instead of build2. Use the correct type for the new tree. 2011-07-14 Andrew Pinski PR tree-opt/49309 * g++.dg/torture/pr49309.C: New testcase. From-SVN: r176281 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4a1a23d3f4..8a1bb94b5f2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-07-14 Andrew Pinski + + PR tree-opt/49309 + * tree-mudflap.c (mf_xform_derefs_1 ): + Use fold_build2_loc instead of build2. + Use the correct type for the new tree. + 2011-07-14 Bernd Schmidt PR rtl-optimization/11320 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6201af5dd6c..3dfa8126c88 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-07-14 Andrew Pinski + + PR tree-opt/49309 + * g++.dg/torture/pr49309.C: New testcase. + 2011-07-14 Bernd Schmidt * gcc.dg/pr48770.c: Add dg-require-effective-target fpic. diff --git a/gcc/testsuite/g++.dg/torture/pr49309.C b/gcc/testsuite/g++.dg/torture/pr49309.C new file mode 100644 index 00000000000..620076380b4 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr49309.C @@ -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()); } + diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c index bcd77e27bd9..7b5ed4b70a9 100644 --- a/gcc/tree-mudflap.c +++ b/gcc/tree-mudflap.c @@ -869,7 +869,7 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp, 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;