Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820
@ 2026-10-24 21:50 Yegor Yefremov
  2026-10-24 21:50 ` [Buildroot] [PATCH 2/2] package/openssh: fix build on MIPS before R6 at -O0 Yegor Yefremov
  2026-10-25 20:49 ` [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820 Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Yegor Yefremov @ 2026-10-24 21:50 UTC (permalink / raw)
  To: buildroot; +Cc: Giulio Benetti, Romain Naour, Thomas Petazzoni

-fzero-call-used-regs is broken on MIPS before R6, which still has the
hi/lo registers: gcc either rejects -fzero-call-used-regs=used for
functions using them:

  sorry, unimplemented: argument 'used' is not supported for '-fzero-call-used-regs' on this target

or, depending on the code, the ABI and the optimization level, ICEs:

  during RTL pass: zero_call_used_regs
  channels.c:437:1: internal compiler error: in int_mode_for_mode, at stor-layout.cc:408

This has been reported upstream, and is still present in gcc 15.3.0:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104820
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104817

MIPS R6 doesn't have hi/lo and is not affected.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 toolchain/Config.in | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 4e6a8d7927..5f4c5f5fb7 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -210,6 +210,16 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_104028
 	bool
 	default y if BR2_m68k
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104820
+# ICE: on MIPS: in int_mode_for_mode, at stor-layout.cc:408 during
+# RTL pass: zero_call_used_regs. MIPS before R6 also rejects
+# -fzero-call-used-regs=used in functions using the hi/lo registers.
+# This bug still exists in gcc = 15.3.0
+config BR2_TOOLCHAIN_HAS_GCC_BUG_104820
+	bool
+	default y if (BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el) \
+		&& !BR2_MIPS_CPU_MIPS32R6 && !BR2_MIPS_CPU_MIPS64R6
+
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107728
 # https://sourceware.org/bugzilla/show_bug.cgi?id=29621
 config BR2_TOOLCHAIN_HAS_GCC_BUG_107728
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-25 20:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-24 21:50 [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820 Yegor Yefremov
2026-10-24 21:50 ` [Buildroot] [PATCH 2/2] package/openssh: fix build on MIPS before R6 at -O0 Yegor Yefremov
2026-10-25 20:49 ` [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820 Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox