From: Christophe Lyon <christophe.lyon@arm.com>
To: <gcc-patches@gcc.gnu.org>
Cc: Christophe Lyon <christophe.lyon@arm.com>
Subject: [PATCH] arm: Fix warning in libgcc/config/arm/pr-support.c
Date: Wed, 1 Feb 2023 10:46:49 +0100 [thread overview]
Message-ID: <20230201094650.65755-1-christophe.lyon@arm.com> (raw)
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 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libgcc/config/arm/pr-support.c b/libgcc/config/arm/pr-support.c
index 9c9d4eed85f..6c36ab47756 100644
--- a/libgcc/config/arm/pr-support.c
+++ b/libgcc/config/arm/pr-support.c
@@ -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;
}
--
2.34.1
next reply other threads:[~2023-02-01 9:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 9:46 Christophe Lyon [this message]
2023-02-01 9:46 ` [PATCH] arm: [MVE] Add missing length=8 attribute Christophe Lyon
2023-02-03 15:35 ` Richard Earnshaw
2023-02-03 15:34 ` [PATCH] arm: Fix warning in libgcc/config/arm/pr-support.c Richard Earnshaw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230201094650.65755-1-christophe.lyon@arm.com \
--to=christophe.lyon@arm.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).