From: Ian Lance Taylor Date: Wed, 14 Sep 2011 18:48:08 +0000 (+0000) Subject: Fix defer/recover at high optimization levels. X-Git-Tag: releases/gcc-4.7.0~3768 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d7b770603105640aca8c40b9bcdf7416eceed37;p=thirdparty%2Fgcc.git Fix defer/recover at high optimization levels. From-SVN: r178859 --- diff --git a/gcc/go/gofrontend/gogo-tree.cc b/gcc/go/gofrontend/gogo-tree.cc index ed211e97677b..fbddc0492f62 100644 --- a/gcc/go/gofrontend/gogo-tree.cc +++ b/gcc/go/gofrontend/gogo-tree.cc @@ -1159,8 +1159,11 @@ Function::get_or_make_decl(Gogo* gogo, Named_object* no, tree id) // If a function calls the predeclared recover function, we // can't inline it, because recover behaves differently in a - // function passed directly to defer. - if (this->calls_recover_ && !this->is_recover_thunk_) + // function passed directly to defer. If this is a recover + // thunk that we built to test whether a function can be + // recovered, we can't inline it, because that will mess up + // our return address comparison. + if (this->calls_recover_ || this->is_recover_thunk_) DECL_UNINLINABLE(decl) = 1; // If this is a thunk created to call a function which calls