From d8f59dc292da2b88dba8a1d19d11342b03128d4e Mon Sep 17 00:00:00 2001 From: nathan Date: Sat, 26 May 2001 19:20:06 +0000 Subject: cp: PR g++/2823 * semantics.c (expand_body): Don't optimize thunks. testsuite: * g++.old-deja/g++.other/optimize2.C: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42650 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/semantics.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/cp/semantics.c') diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index fe62bc5420e..7425f98f67c 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2397,8 +2397,13 @@ expand_body (fn) timevar_push (TV_INTEGRATION); - /* Optimize the body of the function before expanding it. */ - optimize_function (fn); + /* Optimize the body of the function before expanding it. We do not + optimize thunks, as (1) the backend tries to optimize the call to + the thunkee, (b) the tree based inliner breaks that optimization, + (c) virtual functions are rarely inlineable, and (d) + ASM_OUTPUT_MI_THUNK is there to DTRT anyway. */ + if (!DECL_THUNK_P (fn)) + optimize_function (fn); timevar_pop (TV_INTEGRATION); timevar_push (TV_EXPAND); -- cgit v1.2.1