public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] sim: ppc: mark halt & restart funcs as noreturn
@ 2023-12-21  6:21 Michael Frysinger
  0 siblings, 0 replies; only message in thread
From: Michael Frysinger @ 2023-12-21  6:21 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5eba9ae8d52a2375e1f2394a4930fdb92844586b

commit 5eba9ae8d52a2375e1f2394a4930fdb92844586b
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Thu Dec 21 00:09:23 2023 -0500

    sim: ppc: mark halt & restart funcs as noreturn
    
    This helps the compiler with optimization and fixes fallthru warnings.

Diff:
---
 sim/ppc/cpu.h  | 6 +++---
 sim/ppc/psim.c | 2 +-
 sim/ppc/psim.h | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sim/ppc/cpu.h b/sim/ppc/cpu.h
index c7a08711271..dfd2244766c 100644
--- a/sim/ppc/cpu.h
+++ b/sim/ppc/cpu.h
@@ -100,21 +100,21 @@ INLINE_CPU\
 INLINE_CPU\
 (void) cpu_restart
 (cpu *processor,
- unsigned_word nia);
+ unsigned_word nia) ATTRIBUTE_NORETURN;
 
 INLINE_CPU\
 (void) cpu_halt
 (cpu *processor,
  unsigned_word nia,
  stop_reason reason,
- int signal);
+ int signal) ATTRIBUTE_NORETURN;
 
 EXTERN_CPU\
 (void) cpu_error
 (cpu *processor,
  unsigned_word cia,
  const char *fmt,
- ...) ATTRIBUTE_PRINTF_3;
+ ...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_3;
 
 
 /* The processors local concept of time */
diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c
index 2a823616fae..a08d38914ea 100644
--- a/sim/ppc/psim.c
+++ b/sim/ppc/psim.c
@@ -578,7 +578,7 @@ psim_restart(psim *system,
 }
 
 
-static void
+static ATTRIBUTE_NORETURN void
 cntrl_c_simulation(void *data)
 {
   psim *system = data;
diff --git a/sim/ppc/psim.h b/sim/ppc/psim.h
index 2070cbf7b90..6ed91cd9836 100644
--- a/sim/ppc/psim.h
+++ b/sim/ppc/psim.h
@@ -93,7 +93,7 @@ extern void psim_run
 
 extern void psim_restart
 (psim *system,
- int cpu_nr);
+ int cpu_nr) ATTRIBUTE_NORETURN;
 
 extern void psim_set_halt_and_restart
 (psim *system,
@@ -110,7 +110,7 @@ extern void psim_halt
 (psim *system,
  int cpu_nr,
  stop_reason reason,
- int signal);
+ int signal) ATTRIBUTE_NORETURN;
 
 extern int psim_last_cpu
 (psim *system);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-21  6:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-21  6:21 [binutils-gdb] sim: ppc: mark halt & restart funcs as noreturn Michael Frysinger

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).