NetBSD-Bugs archive

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

toolchain/60842: GCC/alpha 14 miscompiles libgcc btree_insert()



>Number:         60842
>Category:       toolchain
>Synopsis:       GCC/alpha 14 miscompiles libgcc btree_insert()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 03 06:00:00 +0000 2026
>Originator:     Rin Okuyama
>Release:        11.99.8
>Organization:
Internet Initiative Japan Inc.
>Environment:
NetBSD ds10.local 11.99.8 NetBSD 11.99.8 (GENERIC-$Revision: 1.421 $) #0: Tue Sep 29 22:05:52 JST 2026  rin@sakaizumii.local:/home/rin/src/sys/arch/alpha/compile/obj.alpha-alpha/GENERIC alpha
>Description:
With GCC14, tests/usr.bin/c++/*:*pic_profile crash on alpha.
For t_hello:hello_pic_profile:

```
# gdb hello
GNU gdb (GDB) 17.1
...snip...
Reading symbols from hello...
(gdb) r
Starting program: /usr/tests/usr.bin/c++/hello

Program received signal SIGSEGV, Segmentation fault.
0x000003fffde0ea40 in memmove () from ./libtest.so
(gdb) bt
#0  0x000003fffde0ea40 in memmove () from ./libtest.so
#1  0x000003fffdd4ddf0 in btree_insert.isra () from /usr/lib/libgcc_s.so.1
#2  0x000003fffdd4fea8 in __register_frame_info_bases () from /usr/lib/libgcc_s.so.1
#3  0x000003fffdd4ff20 in __register_frame_info () from /usr/lib/libgcc_s.so.1
#4  0x0000000120000ba0 in __do_global_ctors_aux ()
    at /home/rin/src/lib/csu/common/crtbegin.c:84
#5  0x0000000120000738 in _init ()
#6  0x0000000120000968 in ___start (cleanup=<optimized out>,
    ps_strings=0x1ffffffe0) at /home/rin/src/lib/csu/common/crt0-common.c:373
#7  0x00000001200007a8 in _start ()
Backtrace stopped: frame did not save the PC
(gdb)
```

I've found that this is because GCC14 miscompiles btree_insert() itself.
>How-To-Repeat:
Described above.
>Fix:
As a workaround, sprinkle -fno-tree-loop-distribute-patterns to
libgcc/unwind-dw2-btree.h:btree_insert().

Then, all pic_profile tests successfully pass.




Home | Main Index | Thread Index | Old Index