summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-14 18:48:08 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-14 18:48:08 +0000
commitb8c734e50ed0c5debf511e8e527f9ecbaa931238 (patch)
tree0dc70e83086aee3a21cc80901864a27873f5f719
parente9122e757f1054db4c76ef802eb52b7f5d9b20a4 (diff)
downloadgcc-b8c734e50ed0c5debf511e8e527f9ecbaa931238.tar.gz
Fix defer/recover at high optimization levels.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178859 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/go/gofrontend/gogo-tree.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/gogo-tree.cc b/gcc/go/gofrontend/gogo-tree.cc
index ed211e97677..fbddc0492f6 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