Bug#1080974: kf6-ktexttemplate: FTBFS on arm64 with gcc-14 and optimization level 2
On 2024-09-06 10:04, Emanuele Rocca wrote:
> The problem seems to be a GCC 14 regression, given that with GCC 13 and
> optimization level -O2 the build is fine.
The issue seems related to the new optimization pass to fuse loads and
stores to adjacent memory locations into load and store-pair introduced
in GCC 14. In both testloadertags_exec and testbuiltins_exec the
segfaults happen in a ldp instruction. See eg. in testloadertags_exec:
- gdb ./bin/testloadertags_exec
(gdb) disassemble
Dump of assembler code for function _ZN8QVariantC2ERKS_:
0x0000fffff7ac5040 <+0>: paciasp
0x0000fffff7ac5044 <+4>: stp x29, x30, [sp, #-32]!
0x0000fffff7ac5048 <+8>: mov x29, sp
=> 0x0000fffff7ac504c <+12>: ldp q31, q30, [x1]
0x0000fffff7ac5050 <+16>: str q30, [sp, #16]
I thus tried to build the package with -O2 -mno-late-ldp-fusion, and
indeed it builds fine:
https://people.debian.org/~ema/kf6-ktexttemplate-gcc-14-no-early-ldp-fusion.log
Specifically, I used the following command:
sbuild --chroot-setup-commands='printf "APPEND CXXFLAGS -mno-late-ldp-fusion\n" > /etc/dpkg/buildflags.conf
Using -O2 -mno-early-ldp-fusion the tests segfault, so the problem seems
to be due to the optimizations performed after register allocation.
Reply to: