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 rs6000 build.
2025-11-28 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/rs6000.cc (complex_multiply_builtin_code):
Avoid arithmetics between enumerators from different enum types.
(complex_divide_builtin_code): Likewise.
complex_multiply_builtin_code (machine_mode mode)
{
gcc_assert (IN_RANGE (mode, MIN_MODE_COMPLEX_FLOAT, MAX_MODE_COMPLEX_FLOAT));
- int func = BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
+ int func = BUILT_IN_COMPLEX_MUL_MIN + (mode - MIN_MODE_COMPLEX_FLOAT);
return (built_in_function) func;
}
complex_divide_builtin_code (machine_mode mode)
{
gcc_assert (IN_RANGE (mode, MIN_MODE_COMPLEX_FLOAT, MAX_MODE_COMPLEX_FLOAT));
- int func = BUILT_IN_COMPLEX_DIV_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
+ int func = BUILT_IN_COMPLEX_DIV_MIN + (mode - MIN_MODE_COMPLEX_FLOAT);
return (built_in_function) func;
}