summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-05-12 13:35:57 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-05-12 13:35:57 +0000
commit740497030f80310c744cad6a0cbbf1658283a68a (patch)
tree23b616783b597adf61621a36af6440a298a5fa1b /gnu
parent1fbf0caac9de130b35216d9cb751b4119b2e15e5 (diff)
port -ftrampolines/-Wtrampolines support from gcc3.
comments and okay kettenis@
Diffstat (limited to 'gnu')
-rw-r--r--gnu/gcc/gcc/c.opt8
-rw-r--r--gnu/gcc/gcc/tree-nested.c9
2 files changed, 17 insertions, 0 deletions
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)