public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] arm: Fix warning in libgcc/config/arm/pr-support.c
@ 2023-02-01  9:46 Christophe Lyon
  2023-02-01  9:46 ` [PATCH] arm: [MVE] Add missing length=8 attribute Christophe Lyon
  2023-02-03 15:34 ` [PATCH] arm: Fix warning in libgcc/config/arm/pr-support.c Richard Earnshaw
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe Lyon @ 2023-02-01  9:46 UTC (permalink / raw)
  To: gcc-patches; +Cc: Christophe Lyon

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm: [MVE] Add missing length=8 attribute
  2023-02-01  9:46 [PATCH] arm: Fix warning in libgcc/config/arm/pr-support.c Christophe Lyon
@ 2023-02-01  9:46 ` 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
  1 sibling, 1 reply; 4+ messages in thread
From: Christophe Lyon @ 2023-02-01  9:46 UTC (permalink / raw)
  To: gcc-patches; +Cc: Christophe Lyon

I have noticed that the "length" "8" attribute is missing in a few
patterns in mve.md.

	gcc/
	* config/arm/mve.md (mve_vabavq_p_<supf><mode>): Add length
	attribute.
	(mve_vqshluq_m_n_s<mode>): Likewise.
	(mve_vshlq_m_<supf><mode>): Likewise.
	(mve_vsriq_m_n_<supf><mode>): Likewise.
	(mve_vsubq_m_<supf><mode>): Likewise.
---
 gcc/config/arm/mve.md | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/gcc/config/arm/mve.md b/gcc/config/arm/mve.md
index 555ad1b66c8..8a05371e14a 100644
--- a/gcc/config/arm/mve.md
+++ b/gcc/config/arm/mve.md
@@ -4979,7 +4979,7 @@ (define_insn "mve_vabavq_p_<supf><mode>"
   "TARGET_HAVE_MVE"
   "vpst\;vabavt.<supf>%#<V_sz_elem>\t%0, %q2, %q3"
   [(set_attr "type" "mve_move")
-])
+   (set_attr "length" "8")])
 
 ;;
 ;; [vqshluq_m_n_s])
@@ -4995,7 +4995,8 @@ (define_insn "mve_vqshluq_m_n_s<mode>"
   ]
   "TARGET_HAVE_MVE"
   "vpst\n\tvqshlut.s%#<V_sz_elem>\t%q0, %q2, %3"
-  [(set_attr "type" "mve_move")])
+  [(set_attr "type" "mve_move")
+   (set_attr "length" "8")])
 
 ;;
 ;; [vshlq_m_s, vshlq_m_u])
@@ -5011,7 +5012,8 @@ (define_insn "mve_vshlq_m_<supf><mode>"
   ]
   "TARGET_HAVE_MVE"
   "vpst\;vshlt.<supf>%#<V_sz_elem>\t%q0, %q2, %q3"
-  [(set_attr "type" "mve_move")])
+  [(set_attr "type" "mve_move")
+   (set_attr "length" "8")])
 
 ;;
 ;; [vsriq_m_n_s, vsriq_m_n_u])
@@ -5027,7 +5029,8 @@ (define_insn "mve_vsriq_m_n_<supf><mode>"
   ]
   "TARGET_HAVE_MVE"
   "vpst\;vsrit.%#<V_sz_elem>\t%q0, %q2, %3"
-  [(set_attr "type" "mve_move")])
+  [(set_attr "type" "mve_move")
+   (set_attr "length" "8")])
 
 ;;
 ;; [vsubq_m_u, vsubq_m_s])
@@ -5043,7 +5046,8 @@ (define_insn "mve_vsubq_m_<supf><mode>"
   ]
   "TARGET_HAVE_MVE"
   "vpst\;vsubt.i%#<V_sz_elem>\t%q0, %q2, %q3"
-  [(set_attr "type" "mve_move")])
+  [(set_attr "type" "mve_move")
+   (set_attr "length" "8")])
 
 ;;
 ;; [vcvtq_m_n_to_f_u, vcvtq_m_n_to_f_s])
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: Fix warning in libgcc/config/arm/pr-support.c
  2023-02-01  9:46 [PATCH] arm: Fix warning in libgcc/config/arm/pr-support.c Christophe Lyon
  2023-02-01  9:46 ` [PATCH] arm: [MVE] Add missing length=8 attribute Christophe Lyon
@ 2023-02-03 15:34 ` Richard Earnshaw
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Earnshaw @ 2023-02-03 15:34 UTC (permalink / raw)
  To: Christophe Lyon, gcc-patches



On 01/02/2023 09:46, Christophe Lyon via Gcc-patches wrote:
> 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.

OK

R.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: [MVE] Add missing length=8 attribute
  2023-02-01  9:46 ` [PATCH] arm: [MVE] Add missing length=8 attribute Christophe Lyon
@ 2023-02-03 15:35   ` Richard Earnshaw
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Earnshaw @ 2023-02-03 15:35 UTC (permalink / raw)
  To: Christophe Lyon, gcc-patches



On 01/02/2023 09:46, Christophe Lyon via Gcc-patches wrote:
> I have noticed that the "length" "8" attribute is missing in a few
> patterns in mve.md.
> 
> 	gcc/
> 	* config/arm/mve.md (mve_vabavq_p_<supf><mode>): Add length
> 	attribute.
> 	(mve_vqshluq_m_n_s<mode>): Likewise.
> 	(mve_vshlq_m_<supf><mode>): Likewise.
> 	(mve_vsriq_m_n_<supf><mode>): Likewise.
> 	(mve_vsubq_m_<supf><mode>): Likewise.
> ---

OK

R.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-03 15:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01  9:46 [PATCH] arm: Fix warning in libgcc/config/arm/pr-support.c Christophe Lyon
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

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).