public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] MSP430: Don't warn if naked function does not return
@ 2018-05-23 22:48 Jozef Lawrynowicz
  2018-05-24 20:59 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Jozef Lawrynowicz @ 2018-05-23 22:48 UTC (permalink / raw)
  To: gcc-patches; +Cc: Nick Clifton, DJ Delorie

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

Implement TARGET_WARN_FUNC_RETURN for msp430-elf, to eliminate warnings when
functions with the "naked" attribute do not return.
The GCC testsuite completes with no regressions for msp430-elf, and this fixes
pr53633.

If the patch is acceptable, I would appreciate it if someone could commit it
for me, as I don't have write access.


[-- Attachment #2: 0001-MSP430-Dont-warn-if-naked-func-does-not-return.patch --]
[-- Type: text/x-patch, Size: 1155 bytes --]

From 6b7a22144d70bcccfeebc9fcefd724e8f05a6e09 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Wed, 23 May 2018 21:33:45 +0100
Subject: [PATCH] MSP430: Dont warn if naked function does not return

2018-05-23  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/config/msp430/msp430.c (msp430_warn_func_return): New.

---
 gcc/config/msp430/msp430.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
index a8fed12..adde597 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)
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] MSP430: Don't warn if naked function does not return
  2018-05-23 22:48 [PATCH] MSP430: Don't warn if naked function does not return Jozef Lawrynowicz
@ 2018-05-24 20:59 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2018-05-24 20:59 UTC (permalink / raw)
  To: Jozef Lawrynowicz, gcc-patches; +Cc: Nick Clifton, DJ Delorie

On 05/23/2018 04:44 PM, Jozef Lawrynowicz wrote:
> 2018-05-23  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
> 
> 	gcc/config/msp430/msp430.c (msp430_warn_func_return): New.
> 
Thanks.  Installed on the trunk.

Jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-24 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 22:48 [PATCH] MSP430: Don't warn if naked function does not return Jozef Lawrynowicz
2018-05-24 20:59 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).