NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/60223: m68k--netbsdelf-c++ (NetBSD nb3 20260326) 12.5.0 ICE (sig-11) with certain FP asm statements



>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.




Home | Main Index | Thread Index | Old Index