NetBSD Problem Report #60223
From www@netbsd.org Fri May 1 20:31:22 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.netbsd.org", Issuer "R12" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 5DCBA1A9239
for <gnats-bugs@gnats.NetBSD.org>; Fri, 1 May 2026 20:31:22 +0000 (UTC)
Message-Id: <20260501203120.E98C91A923C@mollari.NetBSD.org>
Date: Fri, 1 May 2026 20:31:20 +0000 (UTC)
From: thorpej@me.com
Reply-To: thorpej@me.com
To: gnats-bugs@NetBSD.org
Subject: m68k--netbsdelf-c++ (NetBSD nb3 20260326) 12.5.0 ICE (sig-11) with certain FP asm statements
X-Send-Pr-Version: www-1.0
X-From4GNATS: "thorpej@me.com via gnats" <gnats-admin@NetBSD.org>
>Number: 60223
>Category: toolchain
>Synopsis: m68k--netbsdelf-c++ (NetBSD nb3 20260326) 12.5.0 ICE (sig-11) with certain FP asm statements
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: toolchain-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 01 20:35:00 +0000 2026
>Originator: Jason Thorpe
>Release: NetBSD 11.99.5 as of 20260501
>Organization:
Society for Aspiring Unix Grey-beards
>Environment:
Cross-building from macOS host:
Darwin Jasons-MacBook-Air.local 24.4.0 Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:46 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T8112 arm64
Apple clang version 17.0.0 (clang-1700.0.13.3)
Target: arm64-apple-darwin24.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
>Description:
The following test program crashes the C++ compiler but not the C compiler:
<snip>
void
oink(void)
{
do { double d = 1.0; __asm__ __volatile__ ("fdiv" "%.s %#0r0,%0" "; fnop" : "=f" (d) : "0" (d)); } while ( 0);
}
</snip>
thorpej$ /opt/nbsd/current/bin/m68k--netbsdelf-c++ -O0 -c --save-temps test.i
test.i:4:3: internal compiler error: Segmentation fault: 11
4 | do { double d = 1.0; __asm__ __volatile__ ("fdiv" "%.s %#0r0,%0" "; fnop" : "=f" (d) : "0" (d)); } while ( 0);
| ^~
libbacktrace could not find executable to open
Works fine with C and -O0 and -O2:
thorpej$ /opt/nbsd/current/bin/m68k--netbsdelf-gcc -O0 -c --save-temps test.i
thorpej$ /opt/nbsd/current/bin/m68k--netbsdelf-gcc -O2 -c --save-temps test.i
Generated -O2 asm from C compiler:
oink:
.LFB0:
.cfi_startproc
fmovecr #0x32,%fp0
#APP
| 4 "test.i" 1
fdiv.s #0r0,%fp0; fnop
| 0 "" 2
#NO_APP
rts
.cfi_endproc
>How-To-Repeat:
See above.
>Fix:
Not provided.
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.