https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119473

            Bug ID: 119473
           Summary: [15 Regression] __builtin_ia32_vaesdec_v32qi() emits
                    wrong base register with -mvaes -O2 -mapxf -m64
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lin1.hu at intel dot com
  Target Milestone: ---

Created attachment 60887
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60887&action=edit
testcase

$gcc test.c -m64 -O2 -mapxf -mvaes -S -o test.s
$cat test.s
        .file   "test.c"
        .text
        .p2align 4
        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        vmovdqa (%rcx), %ymm0
        vaesdec (%r26), %ymm0, %ymm0
        vmovdqa %ymm0, (%rdx)
        vmovdqa (%rcx), %ymm0
        vaesdeclast     (%r26), %ymm0, %ymm0
        vmovdqa %ymm0, (%rdx)
        vmovdqa (%rcx), %ymm0
        vaesenc (%r26), %ymm0, %ymm0
        vmovdqa %ymm0, (%rdx)
        vmovdqa (%rcx), %ymm0
        vaesenclast     (%r26), %ymm0, %ymm0
        vmovdqa %ymm0, (%rdx)
        vzeroupper
        ret
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .ident  "GCC: (GNU) 15.0.1 20250324 (experimental)"
        .section        .note.GNU-stack,"",@progbits

Due to without -mavx512vl, according to pattern vaesdec_<mode>'s constraint
"xjm,vm", (%r26) is invalid.

Reply via email to