From: Jozef Lawrynowicz Date: Thu, 24 May 2018 20:49:11 +0000 (+0000) Subject: msp430.c (TARGET_WARN_FUNC_RETURN): Define. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d0d518e79281f0ba51940a66c30f2c2307c2216;p=gcc.git msp430.c (TARGET_WARN_FUNC_RETURN): Define. * config/msp430/msp430.c (TARGET_WARN_FUNC_RETURN): Define. (msp430_warn_func_return): New. From-SVN: r260690 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b2ce6864e1d..c793380384a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-05-23 Jozef Lawrynowicz + + * config/msp430/msp430.c (TARGET_WARN_FUNC_RETURN): Define. + (msp430_warn_func_return): New. + 2018-05-24 Roger Sayle * fold-const.c (tree_nonzero_bits): New function. diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c index a8fed123f7a..adde5979c77 100644 --- a/gcc/config/msp430/msp430.c +++ b/gcc/config/msp430/msp430.c @@ -1855,6 +1855,17 @@ msp430_allocate_stack_slots_for_args (void) return ! is_naked_func (); } +#undef TARGET_WARN_FUNC_RETURN +#define TARGET_WARN_FUNC_RETURN msp430_warn_func_return + +static bool +msp430_warn_func_return (tree decl) +{ + /* Naked functions are implemented entirely in assembly, including the + return sequence, so suppress warnings about this. */ + return !is_naked_func (decl); +} + /* Verify MSP430 specific attributes. */ #define TREE_NAME_EQ(NAME, STR) (strcmp (IDENTIFIER_POINTER (NAME), (STR)) == 0)