]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: Fix warning in libgcc/config/arm/pr-support.c
authorChristophe Lyon <christophe.lyon@arm.com>
Mon, 30 Jan 2023 16:39:22 +0000 (17:39 +0100)
committerChristophe Lyon <christophe.lyon@arm.com>
Fri, 3 Feb 2023 15:40:42 +0000 (16:40 +0100)
I have noticed some warnings when building GCC for arm-eabi:
pr-support.c:110:7: warning: variable ‘set_pac_sp’ set but not used [-Wunused-but-set-variable]
pr-support.c:109:7: warning: variable ‘set_pac’ set but not used [-Wunused-but-set-variable]

This small patch avoids them by defining these two variables undef
TARGET_HAVE_PACBTI, like the code which actually uses them.

libgcc/
* config/arm/pr-support.c (__gnu_unwind_execute): Use
TARGET_HAVE_PACBTI to define set_pac and set_pac_sp.

libgcc/config/arm/pr-support.c

index 9c9d4eed85f33722374ead68a10db15dbcab854b..6c36ab477565fecc5f96b828068a128417d23162 100644 (file)
@@ -106,8 +106,10 @@ __gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws)
 {
   _uw op;
   int set_pc;
+#if defined(TARGET_HAVE_PACBTI)
   int set_pac = 0;
   int set_pac_sp = 0;
+#endif
   _uw reg;
   _uw sp;
 
@@ -258,7 +260,9 @@ __gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws)
              if (_Unwind_VRS_Pop (context, _UVRSC_PAC, 0, _UVRSD_UINT32)
                  != _UVRSR_OK)
                return _URC_FAILURE;
+#if defined(TARGET_HAVE_PACBTI)
              set_pac = 1;
+#endif
              continue;
            }
 
@@ -266,7 +270,9 @@ __gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws)
          if (op == 0xb5)
            {
              _Unwind_VRS_Get (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, &sp);
+#if defined(TARGET_HAVE_PACBTI)
              set_pac_sp = 1;
+#endif
              continue;
            }