/[gentoo]/src/patchsets/gcc/4.5.1/gentoo/09_all_gcc-4.5-Wtrampolines.patch
Gentoo

Contents of /src/patchsets/gcc/4.5.1/gentoo/09_all_gcc-4.5-Wtrampolines.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Aug 7 22:10:15 2010 UTC (4 years, 4 months ago) by dirtyepic
Branch: MAIN
CVS Tags: HEAD
Add -Wtrampolines patch (bug #328451).

1 2010-07-15 Magnus Granberg <zorry@gentoo.org>
2 Kevin F. Quinn <kevquinn@gentoo.org>
3
4 * builtins.c (expand_builtin_init_trampoline): If
5 -Wtrampolines make a warning.
6 * common.opt: Add -Wtrampolines.
7 * doc/invoke.texi: Add -Wtrampolines.
8
9 2010-07-31 Magnus Granberg <zorry@gentoo.org>
10
11 #328451 set -Wtrampolines as default
12
13 http://gcc.gnu.org/viewcvs?view=revision&revision=162205
14
15 --- a/gcc/builtins.c
16 +++ b/gcc/builtins.c
17 @@ -5155,6 +5155,10 @@ expand_builtin_init_trampoline (tree exp)
18 targetm.calls.trampoline_init (m_tramp, t_func, r_chain);
19
20 trampolines_created = 1;
21 +
22 + warning_at (DECL_SOURCE_LOCATION (t_func), OPT_Wtrampolines,
23 + "trampoline generated for nested function %qD", t_func);
24 +
25 return const0_rtx;
26 }
27
28 --- a/gcc/common.opt
29 +++ b/gcc/common.opt
30 @@ -192,6 +192,10 @@ Wsystem-headers
31 Common Var(warn_system_headers) Warning
32 Do not suppress warnings from system headers
33
34 +Wtrampolines
35 +Common Var(warn_trampolines) Init(1) Warning
36 +Warn whenever a trampoline is generated
37 +
38 Wtype-limits
39 Common Var(warn_type_limits) Init(-1) Warning
40 Warn if a comparison is always true or always false due to the limited range of the data type
41 --- a/gcc/doc/invoke.texi
42 +++ b/gcc/doc/invoke.texi
43 @@ -3611,6 +3611,21 @@ code. However, note that using @option{-Wall} in conjunction with this
44 option will @emph{not} warn about unknown pragmas in system
45 headers---for that, @option{-Wunknown-pragmas} must also be used.
46
47 +@item -Wtrampolines
48 +@opindex Wtrampolines
49 +@opindex Wno-trampolines
50 + Warn about trampolines generated for pointers to nested functions.
51 +
52 + NOTE: In Gentoo, @option{-Wtrampolines} is set by default.
53 + To disable, specify @option{-Wno-trampolines}
54 +
55 + A trampoline is a small piece of data or code that is created at run
56 + time on the stack when the address of a nested function is taken, and
57 + is used to call the nested function indirectly. For some targets, it
58 + is made up of data only and thus requires no special treatment. But,
59 + for most targets, it is made up of code and thus requires the stack
60 + to be made executable in order for the program to work properly.
61 +
62 @item -Wfloat-equal
63 @opindex Wfloat-equal
64 @opindex Wno-float-equal

  ViewVC Help
Powered by ViewVC 1.1.20