https://gcc.gnu.org/g:1121d2cc8e4b06523773a4d8f49f38d9c75aaa53

commit r16-5700-g1121d2cc8e4b06523773a4d8f49f38d9c75aaa53
Author: Jakub Jelinek <[email protected]>
Date:   Fri Nov 28 22:04:25 2025 +0100

    mips: MIPS backend, meet C++20
    
    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  <[email protected]>
    
            * config/mips/mips.cc (mips_unspec_address_offset): Avoid
            arithmetics between enumerators from different enum types.

Diff:
---
 gcc/config/mips/mips.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc
index 42dfc3b35119..abdf0da7a84c 100644
--- a/gcc/config/mips/mips.cc
+++ b/gcc/config/mips/mips.cc
@@ -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);

Reply via email to