On Thu, Jun 18, 2026 at 5:11 AM Joseph Myers <[email protected]> wrote: > > On Tue, 16 Jun 2026, Andrew Pinski wrote: > > > From: Carter Rennick <[email protected]> > > > > The definition of MAX_FIXED_MODE_SIZE did not account for MIPS supporting > > TImode, which causes an internal compiler error when building libstdc++. > > Upon further > > investigation, this definition appears to be a historical mistake. > > > > This patch removes the MAX_FIXED_MODE_SIZE override, which fixes the error. > > > > PR target/120144 > > > > gcc/ChangeLog: > > > > * config/mips/mips.h (MAX_FIXED_MODE_SIZE): Remove. > > This introduces an ICE building libstdc++ for mips64-linux-gnu > (preprocessed source attached, not reduced). > > Note 1: there is a similar ICE also on GCC mainline, but only for certain > little-endian configurations, whereas with GCC 15 branch I see this for a > wider range of MIPS configurations used by build-many-glibcs.py, both BE > and LE. I'm not sure exactly when the ICE appeared on GCC mainline (the > build of glibc in my bot using GCC mainline was broken for a while because > of -Wconstant-logical-operand issues in glibc), but it wasn't introduced > by the commit being backported; it appeared some time later, so maybe > there is an interaction of multiple commits involved. > > Note 2: I haven't tested for this issue with GCC 16 branch. > > > ICE with -O0: > > during RTL pass: expand > In file included from > /notnfs/josmyers/glibc-manual/build/compilers/mips64-linux-gnu/gcc/mips64-glibc-linux-gnu/libstdc++-v3/include/charconv:48, > from > /notnfs/josmyers/glibc-manual/src/gcc/libstdc++-v3/src/c++17/floating_to_chars.cc:25: > /notnfs/josmyers/glibc-manual/build/compilers/mips64-linux-gnu/gcc/mips64-glibc-linux-gnu/libstdc++-v3/include/bit: > In function 'constexpr int std::__countl_zero(_Tp) [with _Tp = __int128 > unsigned]': > /notnfs/josmyers/glibc-manual/build/compilers/mips64-linux-gnu/gcc/mips64-glibc-linux-gnu/libstdc++-v3/include/bit:209:37: > internal compiler error: in expand_fn_using_insn, at internal-fn.cc:268 > 209 | return __builtin_clzg(__x, _Nd); > | ^ > 0x1a092bf internal_error(char const*, ...) > > /notnfs/josmyers/glibc-manual/src/gcc/gcc/diagnostic-global-context.cc:517 > 0x44a7d5 fancy_abort(char const*, int, char const*) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/diagnostic.cc:1749 > 0x41a15d expand_fn_using_insn > /notnfs/josmyers/glibc-manual/src/gcc/gcc/internal-fn.cc:268 > 0x797887 expand_call_stmt > /notnfs/josmyers/glibc-manual/src/gcc/gcc/cfgexpand.cc:3050 > 0x797887 expand_gimple_stmt_1 > /notnfs/josmyers/glibc-manual/src/gcc/gcc/cfgexpand.cc:4225 > 0x797887 expand_gimple_stmt > /notnfs/josmyers/glibc-manual/src/gcc/gcc/cfgexpand.cc:4372 > 0x79dc07 expand_gimple_basic_block > /notnfs/josmyers/glibc-manual/src/gcc/gcc/cfgexpand.cc:6488 > 0x7a0287 execute > /notnfs/josmyers/glibc-manual/src/gcc/gcc/cfgexpand.cc:7237 > Please submit a full bug report, with preprocessed source (by using > -freport-bug). > Please include the complete backtrace with any bug report. > See <https://gcc.gnu.org/bugs/> for instructions. > > > ICE with -O2: > > during RTL pass: expand > /notnfs/josmyers/glibc-manual/src/gcc/libstdc++-v3/src/c++17/floating_to_chars.cc: > In function 'std::to_chars_result std::__floating_to_chars_hex(char*, char*, > T, optional<int>) [with T = long double]': > /notnfs/josmyers/glibc-manual/src/gcc/libstdc++-v3/src/c++17/floating_to_chars.cc:895:60: > internal compiler error: in expand_fn_using_insn, at internal-fn.cc:268 > 895 | const int shortest_full_precision = full_hex_precision - > trailing_zeros; > | > ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ > 0x1a092bf internal_error(char const*, ...) > > /notnfs/josmyers/glibc-manual/src/gcc/gcc/diagnostic-global-context.cc:517 > 0x44a7d5 fancy_abort(char const*, int, char const*) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/diagnostic.cc:1749 > 0x41a15d expand_fn_using_insn > /notnfs/josmyers/glibc-manual/src/gcc/gcc/internal-fn.cc:268 > 0x8b283c expand_expr_real_1(tree_node*, rtx_def*, machine_mode, > expand_modifier, rtx_def**, bool) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.cc:11470 > 0x8c5849 expand_expr_real(tree_node*, rtx_def*, machine_mode, > expand_modifier, rtx_def**, bool) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.cc:9613 > 0x8c5849 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.h:323 > 0x8c5849 expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode, > expand_modifier) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.cc:10716 > 0x8c8722 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode, > expand_modifier, rtx_def**, bool) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.cc:11278 > 0x8b3cb2 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, > expand_modifier, rtx_def**, bool) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.cc:11460 > 0x8b4964 expand_expr_real(tree_node*, rtx_def*, machine_mode, > expand_modifier, rtx_def**, bool) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.cc:9613 > 0x8b4964 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.h:323 > 0x8b4964 expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**, > rtx_def**, expand_modifier) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.cc:9192 > 0x8c4cbf expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode, > expand_modifier) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.cc:11202 > 0x8c8722 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode, > expand_modifier, rtx_def**, bool) > /notnfs/josmyers/glibc-manual/src/gcc/gcc/expr.cc:11278 > 0x7978ec expand_gimple_stmt_1 > /notnfs/josmyers/glibc-manual/src/gcc/gcc/cfgexpand.cc:4308 > 0x7978ec expand_gimple_stmt > /notnfs/josmyers/glibc-manual/src/gcc/gcc/cfgexpand.cc:4372 > 0x79dc07 expand_gimple_basic_block > /notnfs/josmyers/glibc-manual/src/gcc/gcc/cfgexpand.cc:6488 > 0x7a0287 execute > /notnfs/josmyers/glibc-manual/src/gcc/gcc/cfgexpand.cc:7237 > Please submit a full bug report, with preprocessed source (by using > -freport-bug). > Please include the complete backtrace with any bug report. > See <https://gcc.gnu.org/bugs/> for instructions.
I think I know what/why I messed up. There was a patch that was added to the GCC 16 release to fix the default definition of MAX_FIXED_MODE_SIZE and this change depends on that. That is why GCC 16 was fine with the backport but GCC 15 is not. Note the trunk failure seems different but related issue with MAX_FIXED_MODE_SIZE. I will look into both of this issues later today. > > -- > Joseph S. Myers > [email protected]
