From 740497030f80310c744cad6a0cbbf1658283a68a Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Wed, 12 May 2010 13:35:57 +0000 Subject: port -ftrampolines/-Wtrampolines support from gcc3. comments and okay kettenis@ --- gnu/gcc/gcc/c.opt | 8 ++++++++ gnu/gcc/gcc/tree-nested.c | 9 +++++++++ 2 files changed, 17 insertions(+) (limited to 'gnu') diff --git a/gnu/gcc/gcc/c.opt b/gnu/gcc/gcc/c.opt index 2d38a89b336..d76cefb280d 100644 --- a/gnu/gcc/gcc/c.opt +++ b/gnu/gcc/gcc/c.opt @@ -407,6 +407,10 @@ Wtraditional C ObjC Var(warn_traditional) Warn about features not present in traditional C +Wtrampolines +Common Var(warn_trampolines) +Warn when trampolines are emitted + Wtrigraphs C ObjC C++ ObjC++ Warn if trigraphs are encountered that might affect the meaning of the program @@ -708,6 +712,10 @@ fthreadsafe-statics C++ ObjC++ -fno-threadsafe-statics Do not generate thread-safe code for initializing local statics +ftrampolines +Common Var(flag_trampolines) +Allows trampolines + funsigned-bitfields C ObjC C++ ObjC++ When \"signed\" or \"unsigned\" is not given make the bitfield unsigned diff --git a/gnu/gcc/gcc/tree-nested.c b/gnu/gcc/gcc/tree-nested.c index e62c47ae175..1cd9999a296 100644 --- a/gnu/gcc/gcc/tree-nested.c +++ b/gnu/gcc/gcc/tree-nested.c @@ -1622,6 +1622,15 @@ convert_tramp_reference (tree *tp, int *walk_subtrees, void *data) if (DECL_NO_STATIC_CHAIN (decl)) break; + if (!flag_trampolines) + { + error ("trampoline code generation is not allowed without -ftrampolines"); + return NULL_TREE; + } + if (warn_trampolines) + { + warning(0, "local function address taken needing trampoline generation"); + } /* Lookup the immediate parent of the callee, as that's where we need to insert the trampoline. */ for (i = info; i->context != target_context; i = i->outer) -- cgit v1.2.3