The following testcase compiled with "-fmudflap -O" triggers an ICE ========================================= struct A { int i; A(); A(const A&); }; inline void foo(A a) { a = A(); } void bar() { foo(A()); } ========================================= bug.cc: In function 'void bar()': bug.cc:11:6: error: type mismatch in pointer plus expression struct A & restrict struct A * long unsigned int D.1282_15 = &D.1260 + 0; bug.cc:11:6: internal compiler error: verify_gimple failed Please submit a full bug report, [etc.]
GCC 4.6.1 is being released.
Simple fix: Index: tree-mudflap.c =================================================================== --- tree-mudflap.c (revision 62112) +++ tree-mudflap.c (working copy) @@ -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, 1)), TREE_OPERAND (t, 0), fold_convert (sizetype, TREE_OPERAND (t, 1))); base = addr;
Hm, I'd say rather - 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)),
Author: pinskia Date: Thu Jul 14 20:23:36 2011 New Revision: 176281 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176281 Log: 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. Added: trunk/gcc/testsuite/g++.dg/torture/pr49309.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-mudflap.c
Fixed on the trunk will apply to the 4.6 branch soon.
Author: pinskia Date: Thu Jul 14 20:55:38 2011 New Revision: 176282 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176282 Log: 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. Added: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/torture/pr49309.C - copied unchanged from r176281, trunk/gcc/testsuite/g++.dg/torture/pr49309.C Modified: branches/gcc-4_6-branch/gcc/ChangeLog branches/gcc-4_6-branch/gcc/testsuite/ChangeLog branches/gcc-4_6-branch/gcc/tree-mudflap.c
Fixed.
Author: jakub Date: Fri Jul 15 19:48:46 2011 New Revision: 176327 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176327 Log: PR testsuite/49753 PR tree-optimization/49309 * testsuite/libmudflap.c++/pass68-frag.cxx: New test. * g++.dg/torture/pr49309.C: Remove. Added: trunk/libmudflap/testsuite/libmudflap.c++/pass68-frag.cxx Removed: trunk/gcc/testsuite/g++.dg/torture/pr49309.C Modified: trunk/gcc/testsuite/ChangeLog trunk/libmudflap/ChangeLog
Author: jakub Date: Fri Jul 15 19:53:58 2011 New Revision: 176328 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176328 Log: PR testsuite/49753 PR tree-optimization/49309 * testsuite/libmudflap.c++/pass68-frag.cxx: New test. * g++.dg/torture/pr49309.C: Remove. Added: branches/gcc-4_6-branch/libmudflap/testsuite/libmudflap.c++/pass68-frag.cxx Removed: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/torture/pr49309.C Modified: branches/gcc-4_6-branch/gcc/testsuite/ChangeLog branches/gcc-4_6-branch/libmudflap/ChangeLog
Author: ro Date: Mon Jul 25 15:25:32 2011 New Revision: 176752 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176752 Log: gcc/testsuite: PR testsuite/49753 * g++.dg/torture/pr49309.C: Add -fpreprocessed to dg-options. Revert: 2011-07-15 Jakub Jelinek <jakub@redhat.com> PR testsuite/49753 * g++.dg/torture/pr49309.C: Remove. libmudflap: Revert: 2011-07-15 Jakub Jelinek <jakub@redhat.com> PR testsuite/49753 PR tree-optimization/49309 * testsuite/libmudflap.c++/pass68-frag.cxx: New test. Added: trunk/gcc/testsuite/g++.dg/torture/pr49309.C - copied, changed from r176751, trunk/libmudflap/testsuite/libmudflap.c++/pass68-frag.cxx Removed: trunk/libmudflap/testsuite/libmudflap.c++/pass68-frag.cxx Modified: trunk/gcc/testsuite/ChangeLog trunk/libmudflap/ChangeLog
Author: ro Date: Mon Jul 25 15:28:27 2011 New Revision: 176753 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176753 Log: gcc/testsuite: PR testsuite/49753 * g++.dg/torture/pr49309.C: Add -fpreprocessed to dg-options. Revert: 2011-07-15 Jakub Jelinek <jakub@redhat.com> PR testsuite/49753 * g++.dg/torture/pr49309.C: Remove. libmudflap: Revert: 2011-07-15 Jakub Jelinek <jakub@redhat.com> PR testsuite/49753 PR tree-optimization/49309 * testsuite/libmudflap.c++/pass68-frag.cxx: New test. Added: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/torture/pr49309.C - copied, changed from r176752, branches/gcc-4_6-branch/libmudflap/testsuite/libmudflap.c++/pass68-frag.cxx Removed: branches/gcc-4_6-branch/libmudflap/testsuite/libmudflap.c++/pass68-frag.cxx Modified: branches/gcc-4_6-branch/gcc/testsuite/ChangeLog branches/gcc-4_6-branch/libmudflap/ChangeLog