sim: cgen: mark cgen_rtx_error noreturn
authorMike Frysinger <vapier@gentoo.org>
Sun, 24 Dec 2023 10:06:57 +0000 (05:06 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 24 Dec 2023 10:09:28 +0000 (05:09 -0500)
Since this function never returns, mark it as such to fix some unused
variable warnings in error code paths.

For example, cris triggers:
sim/cris/semcrisv10f-switch.c:3558:11: error:
variable 'tmp_newval' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]

Even though it has an "else" path that calls this error function.

sim/common/cgen-ops.h

index 8c880fe..552ff59 100644 (file)
@@ -705,6 +705,6 @@ SUBOFDI (DI a, DI b, BI c)
 
 #endif
 
-extern void cgen_rtx_error (SIM_CPU *, const char *);
+extern void cgen_rtx_error (SIM_CPU *, const char *) ATTRIBUTE_NORETURN;
 
 #endif /* CGEN_SEM_OPS_H */