https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103926
Bug ID: 103926
Summary: "wQ" broken
Product: gcc
Version: 11.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: aik at ozlabs dot ru
CC: segher at gcc dot gnu.org
Target Milestone: ---
Host: power8
Target: powerpc64le-linux
Build: 3b0ba97fafe8 (2 week old releases/gcc-11)
Using `wQ` constraint ("memory acceptable by `lq`") makes gcc crash. Note that
without "-O2" gcc gently fails (not sure why).
The issue recreates on gcc-11 from git and Ubuntu 2104's gcc (10.3.0-1ubuntu1).
[fstn1-p1 ~]$
/home/aik/pbuild/crossgcc/gcc-powerpc64le-linux-11.2.1-2.37.50-nolibc/bin/powerpc64le-linux-gcc
gccbug.c -o gccbug.o -O2
gccbug.c: In function âfâ:
gccbug.c:6:1: error: unrecognizable insn:
6 | }
| ^
(insn 6 11 9 2 (parallel [
(set (reg:TI 10 10 [orig:118 v ] [118])
(asm_operands/v:TI ("lq %0, 0(%1)") ("=&r") 0 [
(mem/f/c:DI (reg:DI 9 9 [120]) [1 ptr+0 S8 A128])
]
[
(asm_input:DI ("wQ") gccbug.c:5)
]
[] gccbug.c:5))
(clobber (reg:SI 98 ca))
]) "gccbug.c":5:2 -1
(nil))
during RTL pass: postreload
gccbug.c:6:1: internal compiler error: in extract_constrain_insn, at
recog.c:2671
0x10190343 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/home/aik/p/gcc/gcc/gcc/rtl-error.c:108
0x10190397 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/home/aik/p/gcc/gcc/gcc/rtl-error.c:116
0x1082fe6b extract_constrain_insn(rtx_insn*)
/home/aik/p/gcc/gcc/gcc/recog.c:2671
0x107ea1bf reload_cse_simplify_operands
/home/aik/p/gcc/gcc/gcc/postreload.c:407
0x107ebd5f reload_cse_simplify
/home/aik/p/gcc/gcc/gcc/postreload.c:190
0x107ebd5f reload_cse_regs_1
/home/aik/p/gcc/gcc/gcc/postreload.c:238
0x107edf7b reload_cse_regs
/home/aik/p/gcc/gcc/gcc/postreload.c:66
0x107edf7b execute
/home/aik/p/gcc/gcc/gcc/postreload.c:2359
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[fstn1-p1 ~]$ cat gccbug.c
void f(void)
{
void *ptr;
__int128 v;
asm volatile("lq %0, 0(%1)" : "=&r" (v) : "wQ" (ptr));
}