From: Richard Guenther Date: Mon, 15 Feb 2010 11:27:54 +0000 (+0000) Subject: re PR tree-optimization/43068 (ICE: in estimate_operator_cost, at tree-inline.c:3141... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=313333a6d4a764968406c2d7e59ff92f7676aa6f;p=gcc.git re PR tree-optimization/43068 (ICE: in estimate_operator_cost, at tree-inline.c:3141 with -freorder-blocks -ftracer) 2010-02-15 Richard Guenther PR middle-end/43068 * cgraphunit.c (thunk_adjust): Skip adjusting by fixed_offset if that is zero. * g++.dg/torture/pr43068.C: New testcase. From-SVN: r156770 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2196c90e92d..b5148ebda1f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-02-15 Richard Guenther + + PR middle-end/43068 + * cgraphunit.c (thunk_adjust): Skip adjusting by fixed_offset + if that is zero. + 2010-02-15 Nick Clifton * config/mn10300/mn10300.h (FUNCTION_ARG_REGNO_P): Revert previous diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 9cd5f16f488..ec7f9d8fc33 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1230,7 +1230,8 @@ thunk_adjust (gimple_stmt_iterator * bsi, gimple stmt; tree ret; - if (this_adjusting) + if (this_adjusting + && fixed_offset != 0) { stmt = gimple_build_assign (ptr, fold_build2_loc (input_location, @@ -1315,7 +1316,8 @@ thunk_adjust (gimple_stmt_iterator * bsi, offsettmp); } - if (!this_adjusting) + if (!this_adjusting + && fixed_offset != 0) /* Adjust the pointer by the constant. */ { tree ptrtmp; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4ad1e674276..a06de9a9f4a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-02-15 Richard Guenther + + PR middle-end/43068 + * g++.dg/torture/pr43068.C: New testcase. + 2010-02-14 Volker Reichelt PR c++/43024 diff --git a/gcc/testsuite/g++.dg/torture/pr43068.C b/gcc/testsuite/g++.dg/torture/pr43068.C new file mode 100644 index 00000000000..524fd23ee52 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr43068.C @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-freorder-blocks -ftracer} */ + +struct A { + virtual A *f(); +}; +struct B : virtual A { + virtual B *f(); +}; +B *B::f() { return 0; }