From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1652) id EDB823858D20; Fri, 3 Feb 2023 15:41:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EDB823858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675438878; bh=0n50l81jEW2NaFMZetukqELtgwXgRMYP4ibINs0zzJc=; h=From:To:Subject:Date:From; b=JpkKw6W3bDdm+4QfhHbuupui5hoMtRTo3R7P02h6HEjzVcS6cspbECdsjrhAAoOh6 GPOz9dN8LxJT5D4L0J6qUEEiS/G8UuH5uodj9hFSwnmOugBRaX2YB6l0ZDN1D/Delx lIb/4EQXDG9qYsMfhul291is2ES2atXyU9QQ5t5M= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Christophe Lyon To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5685] arm: Fix warning in libgcc/config/arm/pr-support.c X-Act-Checkin: gcc X-Git-Author: Christophe Lyon X-Git-Refname: refs/heads/master X-Git-Oldrev: 59e0376f607805ef9b67fd7b0a4a3084ab3571a5 X-Git-Newrev: 3dba5b2cf2d624921d976670b927bf5330da075c Message-Id: <20230203154118.EDB823858D20@sourceware.org> Date: Fri, 3 Feb 2023 15:41:18 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3dba5b2cf2d624921d976670b927bf5330da075c commit r13-5685-g3dba5b2cf2d624921d976670b927bf5330da075c Author: Christophe Lyon Date: Mon Jan 30 17:39:22 2023 +0100 arm: Fix warning in libgcc/config/arm/pr-support.c 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. Diff: --- 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; }