diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-04-27 14:11:36 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-04-27 14:11:36 +0000 |
commit | a9da8e7bb77c7cb37abe007475a4bfb021c26c94 (patch) | |
tree | 7650376a487e4fe03c56b13665120366d5deae8d | |
parent | b76fbb43c872e87ec2d7094cf3b2883d95d49964 (diff) |
Provide -ftrampolines and -Wtrampoline to the gcc 2.95 codebase.
ok espie@
-rw-r--r-- | gnu/egcs/gcc/expr.c | 11 | ||||
-rw-r--r-- | gnu/egcs/gcc/toplev.c | 9 |
2 files changed, 19 insertions, 1 deletions
diff --git a/gnu/egcs/gcc/expr.c b/gnu/egcs/gcc/expr.c index db562c895d3..7f573d457ba 100644 --- a/gnu/egcs/gcc/expr.c +++ b/gnu/egcs/gcc/expr.c @@ -5562,6 +5562,8 @@ check_max_integer_computation_mode (exp) } } #endif +extern int flag_trampolines; +extern int warn_trampolines; /* expand_expr: generate code for computing expression EXP. @@ -8059,6 +8061,15 @@ expand_expr (exp, target, tmode, modifier) && ! DECL_NO_STATIC_CHAIN (TREE_OPERAND (exp, 0)) && ! TREE_STATIC (exp)) { + if (!flag_trampolines) + { + error_with_decl(exp, "trampoline code generation is not allowed without -ftrampolines"); + return const0_rtx; + } + if (warn_trampolines) + { + warning_with_decl(exp, "local function address taken, needing trampoline generation"); + } op0 = trampoline_address (TREE_OPERAND (exp, 0)); op0 = force_operand (op0, target); } diff --git a/gnu/egcs/gcc/toplev.c b/gnu/egcs/gcc/toplev.c index 3a4730f174d..7443a766999 100644 --- a/gnu/egcs/gcc/toplev.c +++ b/gnu/egcs/gcc/toplev.c @@ -785,6 +785,9 @@ int flag_propolice_protection = 0; int flag_stack_protection = 0; #endif +int flag_trampolines = 0; +int warn_trampolines = 0; + /* Table of supported debugging formats. */ static struct { @@ -997,6 +1000,8 @@ lang_independent_options f_options[] = "Enables stack protection" }, {"stack-protector-all", &flag_stack_protection, 1, "Enables stack protection of every function" }, + {"trampolines", &flag_trampolines, 1, + "Allows trampolines" } }; #define NUM_ELEM(a) (sizeof (a) / sizeof ((a)[0])) @@ -1279,7 +1284,9 @@ lang_independent_options W_options[] = {"inline", &warn_inline, 1, "Warn when an inlined function cannot be inlined"}, {"stack-protector", &warn_stack_protector, 1, - "Warn when disabling stack protector for some reason"} + "Warn when disabling stack protector for some reason"}, + {"trampolines", &warn_trampolines, 1, + "Warn when trampolines are emitted"} }; /* Output files for assembler code (real compiler output) |