]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
mips: MIPS backend, meet C++20
authorJakub Jelinek <jakub@redhat.com>
Fri, 28 Nov 2025 21:04:25 +0000 (22:04 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 28 Nov 2025 21:04:25 +0000 (22:04 +0100)
C++20, in particular https://wg21.link/P1120R0 paper voted into it,
deprecates various operations between enumerators from different enumeration
types etc., and as we've switched to -std=gnu++20 by default, this now
results in warnings or errors during stage2 and onwards.

The following patch should fix mips build.

2025-11-28  Jakub Jelinek  <jakub@redhat.com>

* config/mips/mips.cc (mips_unspec_address_offset): Avoid
arithmetics between enumerators from different enum types.

gcc/config/mips/mips.cc

index 42dfc3b351198335ef9f6fe4d8c10a1740638d4d..abdf0da7a84c309d391bee803ad41cea5833447d 100644 (file)
@@ -3315,7 +3315,7 @@ mips_unspec_address_offset (rtx base, rtx offset,
                            enum mips_symbol_type symbol_type)
 {
   base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base),
-                        UNSPEC_ADDRESS_FIRST + symbol_type);
+                        UNSPEC_ADDRESS_FIRST + (int) symbol_type);
   if (offset != const0_rtx)
     base = gen_rtx_PLUS (Pmode, base, offset);
   return gen_rtx_CONST (Pmode, base);