[gcc r16-6769] defaults: Use argument in default EH_RETURN_DATA_REGNO definition [PR123115]
Jakub Jelinek
jakub@gcc.gnu.org
Wed Jan 14 14:57:23 GMT 2026
https://gcc.gnu.org/g:3a05f190ffd40098e44e6fc08d58313c6d7782a1
commit r16-6769-g3a05f190ffd40098e44e6fc08d58313c6d7782a1
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Jan 14 15:56:29 2026 +0100
defaults: Use argument in default EH_RETURN_DATA_REGNO definition [PR123115]
All targets use the EH_RETURN_DATA_REGNO macro argument except for
NVPTX which uses the default.
The problem is that we get then -Wunused-but-set-variable warning
when building df-scan.cc for NVPTX target with GCC 16 (post r16-2258
PR44677) on:
unsigned int i;
/* Mark the registers that will contain data for the handler. */
for (i = 0; ; ++i)
{
unsigned regno = EH_RETURN_DATA_REGNO (i);
if (regno == INVALID_REGNUM)
break;
If it were multiple targets suffering from this, I'd think about
adding something to use i in loops like this, but as it is
just the default definition, the following patch fixes it by
using the argument.
2026-01-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/123115
* defaults.h (EH_RETURN_DATA_REGNO): Add void (N) to the macro
definition inside of a comma expression before INVALID_REGNUM.
Diff:
---
gcc/defaults.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 8aed0545751e..6364216d9681 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -390,7 +390,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* Provide defaults for stuff that may not be defined when using
sjlj exceptions. */
#ifndef EH_RETURN_DATA_REGNO
-#define EH_RETURN_DATA_REGNO(N) INVALID_REGNUM
+#define EH_RETURN_DATA_REGNO(N) (void (N), INVALID_REGNUM)
#endif
/* Offset between the eh handler address and entry in eh tables. */
More information about the Gcc-cvs
mailing list