diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2012-07-25 14:08:06 -0400 |
---|---|---|
committer | Sandra Loosemore <sandra@gcc.gnu.org> | 2012-07-25 14:08:06 -0400 |
commit | d45eae79db3e8c41ac1f307b267179498a636e0b (patch) | |
tree | f42803034e2d99c0fb7f313962516557837e0a57 /gcc/doc | |
parent | 62732c3044c767f4efcff0cd398c9e65ba437bda (diff) | |
download | gcc-d45eae79db3e8c41ac1f307b267179498a636e0b.zip gcc-d45eae79db3e8c41ac1f307b267179498a636e0b.tar.gz gcc-d45eae79db3e8c41ac1f307b267179498a636e0b.tar.bz2 |
re PR target/53633 (__attribute__((naked)) should disable -Wreturn-type)
2012-07-25 Sandra Loosemore <sandra@codesourcery.com>
Paul Brook <paul@codesourcery.com>
PR target/53633
gcc/
* target.def (warn_func_return): New hook.
* doc/tm.texi.in (TARGET_WARN_FUNC_RETURN): New hook.
* doc/tm.texi: Regenerate.
* doc/sourcebuild.texi (Effective-Target Keywords): Document
naked_functions.
* ipa-pure-const.c (warn_function_noreturn): Check
targetm.warn_func_return.
* tree-cfg.c (execute_warn_function_return): Likewise.
* config/spu/spu.c (spu_warn_func_return): New.
(TARGET_WARN_FUNC_RETURN): Define.
* config/rx/rx.c (rx_warn_func_return): New.
(TARGET_WARN_FUNC_RETURN): Define.
* config/avr/avr.c (avr_warn_func_return): New.
(TARGET_WARN_FUNC_RETURN): Define.
* config/arm/arm.c (arm_warn_func_return): New.
(TARGET_WARN_FUNC_RETURN): Define.
* config/mcore/mcore.c (mcore_warn_func_return): New.
(TARGET_WARN_FUNC_RETURN): Define.
(saved_warn_return_type, saved_warn_return_type_count): Remove.
(mcore_reorg, mcore_handle_naked_attribute): Remove warn_return hack.
gcc/cp/
* decl.c (finish_function): Check targetm.warn_func_return.
gcc/testsuite/
* lib/target-suports.exp (check_effective_target_naked_functions):
New.
* c-c++-common/pr53633.c: New test.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r189860
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/sourcebuild.texi | 3 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 4 | ||||
-rw-r--r-- | gcc/doc/tm.texi.in | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 44c2842..43afa00 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1787,6 +1787,9 @@ Target keeps null pointer checks, either due to the use of @item lto Compiler has been configured to support link-time optimization (LTO). +@item naked_functions +Target supports the @code{naked} function attribute. + @item named_sections Target supports named sections. diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index d1a27f8..b419a71 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -4977,6 +4977,10 @@ FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM. This hook should add additional registers that are computed by the prologue to the hard regset for shrink-wrapping optimization purposes. @end deftypefn +@deftypefn {Target Hook} bool TARGET_WARN_FUNC_RETURN (tree) +True if a function's return statements should be checked for matching the function's return type. This includes checking for falling off the end of a non-void function. Return false if no such check should be made. +@end deftypefn + @node Stack Smashing Protection @subsection Stack smashing protection @cindex stack smashing protection diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 85d9d1d..3f2ef1e 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -4918,6 +4918,8 @@ FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM. @hook TARGET_SET_UP_BY_PROLOGUE +@hook TARGET_WARN_FUNC_RETURN + @node Stack Smashing Protection @subsection Stack smashing protection @cindex stack smashing protection |