aboutsummaryrefslogtreecommitdiff
blob: a68a43f03d7ff8038b2813bdd68d956317a93028 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
	This trivial patch causes gcc to emit a warning whenever
	it generates a trampoline.  These are otherwise hard to
	locate.  It is rigged to default ON - to have it default
	to OFF remove the text 'Init(1)' from the common.opt
	patch, leaving just 'Common Var(warn_trampolines)'.
	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006

--- gcc/gcc/common.opt
+++ gcc/gcc/common.opt
@@ -141,6 +141,10 @@
 Common Var(warn_system_headers)
 Do not suppress warnings from system headers
 
+Wtrampolines
+Common Var(warn_trampolines) Init(1)
+Warn whenever a trampoline is generated
+
 Wuninitialized
 Common Var(warn_uninitialized)
 Warn about uninitialized automatic variables
--- gcc/gcc/builtins.c
+++ gcc/gcc/builtins.c
@@ -5224,6 +5224,9 @@
 #endif
   trampolines_created = 1;
   INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
+
+  if (warn_trampolines)
+    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
 
   return const0_rtx;
 }