[avr] Fix PR117681 build warning for libgcc/unwind-sjlj.c

Message ID 6f064021-6d15-4fc6-874f-f6d6a97a1859@gjlay.de
State New
Headers
Series [avr] Fix PR117681 build warning for libgcc/unwind-sjlj.c |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply

Commit Message

Georg-Johann Lay Nov. 29, 2024, 5:37 p.m. UTC
  This patch fixes a build warning for libgcc/unwind-sjlj.c
which used word_mode for _Unwind_Word but should use Pmode.

Ok for trunk?

Johann

--

AVR: target/117681 - Set UNWIND_WORD_MODE to Pmode.

This patch fixes a build warning for libgcc/unwind-sjlj.c
which used word_mode for _Unwind_Word but should use Pmode.

	PR target/117681
gcc/
	* config/avr/avr.cc (TARGET_UNWIND_WORD_MODE): Define to...
	(avr_unwind_word_mode): ...this new static function.
  

Patch

commit 9e48a5e1dc054959d1dfc2f757d5dcfbdb18e1c3
Author: Georg-Johann Lay <avr@gjlay.de>
Date:   Fri Nov 29 18:26:17 2024 +0100

    AVR: target/117681 - Set UNWIND_WORD_MODE to Pmode.
    
    This patch fixes a build warning for libgcc/unwind-sjlj.c
    which used word_mode for _Unwind_Word but should use Pmode.
    
            PR target/117681
    gcc/
            * config/avr/avr.cc (TARGET_UNWIND_WORD_MODE): Define to...
            (avr_unwind_word_mode): ...this new static function.

diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index fc9f1770420..c5c39d30c47 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -15661,6 +15661,15 @@  avr_float_lib_compare_returns_bool (machine_mode mode, rtx_code)
 }
 
 
+/* Implement `TARGET_UNWIND_WORD_MODE'.  */
+
+static scalar_int_mode
+avr_unwind_word_mode ()
+{
+  return Pmode;
+}
+
+
 /* Implement `TARGET_LRA_P'.  */
 
 static bool
@@ -15867,6 +15876,9 @@  avr_use_lra_p ()
 #undef  TARGET_CANONICALIZE_COMPARISON
 #define TARGET_CANONICALIZE_COMPARISON avr_canonicalize_comparison
 
+#undef  TARGET_UNWIND_WORD_MODE
+#define TARGET_UNWIND_WORD_MODE avr_unwind_word_mode
+
 /* According to the opening comment in PR86772, the following applies:
   "If the port does not (and never will in the future) need to mitigate
    against unsafe speculation."  */