summaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-26 19:20:06 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-26 19:20:06 +0000
commitd8f59dc292da2b88dba8a1d19d11342b03128d4e (patch)
tree40db25021bf2b7c29f335616fb7afe894dbba83f /gcc/cp/semantics.c
parentf1ec9aeba3b9e072ed9162dd8f8886dee04219c5 (diff)
downloadgcc-d8f59dc292da2b88dba8a1d19d11342b03128d4e.tar.gz
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
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c9
1 files changed, 7 insertions, 2 deletions
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);