Created attachment 15263 [details] vcpu_fbench-vcpu_fbench.i ``` $ gcc-13 -c vcpu_fbench-vcpu_fbench.i -O3 -march=znver2 -Wa,-O2 /tmp/ccmQb140.s: Assembler messages: /tmp/ccmQb140.s:523: Internal error in build_vex_prefix at /var/tmp/portage/sys-devel/binutils-9999/work/binutils/gas/config/tc-i386.c:3764. Please report this bug. ``` ``` $ ld --version GNU ld (Gentoo 9999 p1) 2.41.50.20231218 Copyright (C) 2023 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. ```
Created attachment 15264 [details] vcpu_fbench-vcpu_fbench.s ``` $ as ./vcpu_fbench-vcpu_fbench.s -O2 ./vcpu_fbench-vcpu_fbench.s: Assembler messages: ./vcpu_fbench-vcpu_fbench.s:1217: Internal error in build_vex_prefix at /var/tmp/portage/sys-devel/binutils-9999/work/binutils/gas/config/tc-i386.c:3764. Please report this bug. ```
Breakpoint 1, build_vex_prefix (t=t@entry=0x5555555f11cc <i386_optab+112684>) at /usr/src/debug/sys-devel/binutils-9999/binutils/gas/config/tc-i386.c:3764 3764 gas_assert (i.tm.opcode_space == SPACE_0F); (gdb) bt #0 build_vex_prefix (t=t@entry=0x5555555f11cc <i386_optab+112684>) at /usr/src/debug/sys-devel/binutils-9999/binutils/gas/config/tc-i386.c:3764 #1 0x00005555555acc8e in md_assemble (line=<optimized out>) at /usr/src/debug/sys-devel/binutils-9999/binutils/gas/config/tc-i386.c:5595 #2 0x000055555558164e in assemble_one (line=0x55555562d21d "vfnmadd231sd %xmm9,%xmm2,%xmm0") at /usr/src/debug/sys-devel/binutils-9999/binutils/gas/read.c:750 #3 read_a_source_file (name=<optimized out>) at /usr/src/debug/sys-devel/binutils-9999/binutils/gas/read.c:1220 #4 0x000055555555a21f in perform_an_assembly_pass (argv=0x55555561c498, argc=<optimized out>) at /usr/src/debug/sys-devel/binutils-9999/binutils/gas/as.c:1236 #5 main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/sys-devel/binutils-9999/binutils/gas/as.c:1415 (gdb)
da0784f961d8a14890b2a3fa3b5db5820e17deb6 is the first bad commit commit da0784f961d8a14890b2a3fa3b5db5820e17deb6 Author: Jan Beulich <jbeulich@suse.com> Date: Wed Sep 27 14:16:09 2023 +0200 x86: fold FMA VEX and EVEX templates Following the folding of some generic AVX/AVX2 templates with their AVX512F counterpart ones, do this for FMA ones as well, requiring one further adjustment to cpu_flags_match(). gas/config/tc-i386.c | 4 + opcodes/i386-opc.tbl | 41 +- opcodes/i386-tbl.h | 1662 +++++++++++++++----------------------------------- 3 files changed, 520 insertions(+), 1187 deletions(-) bisect found first bad commit
I can see what I overlooked (the C attribute aliases StaticRounding); working on a fix.
https://sourceware.org/pipermail/binutils/2024-January/131582.html
The master branch has been updated by Jan Beulich <jbeulich@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7440781b67631ebdf1b0587724f5d77c3748b034 commit 7440781b67631ebdf1b0587724f5d77c3748b034 Author: Jan Beulich <jbeulich@suse.com> Date: Tue Jan 9 13:49:48 2024 +0100 x86: FMA insns aren't eligible to VEX2 encoding PR gas/31178 In da0784f961d8 ("x86: fold FMA VEX and EVEX templates") I overlooked that C aliases StaticRounding, and hence build_vex_prefix() now needs to be aware of that aliasing. Disambiguation is easy, as StaticRounding is only ever used together with SAE (hence why the overlaying works in the first place).
And thus fixed.