This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/57623] New: BEXTR intrinsic has memory operands switched around (fails to compile code)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57623

            Bug ID: 57623
           Summary: BEXTR intrinsic has memory operands switched around
                    (fails to compile code)
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sgunderson at bigfoot dot com

Hi,

Given I'm on gcc 4.8.1 (Debian 4.8.1-2). Given the following test program:

sesse@gruessi:~$ cat bextr-test.c 
#include <stdint.h>

uint64_t func(uint64_t x, uint64_t *y)
{
    return __builtin_ia32_bextr_u64(x, *y);
}

trying to compile it fails:

sesse@gruessi:~$ gcc-4.8 -O2 -mbmi -c bextr-test.c --save-temps
bextr-test.s: Assembler messages:
bextr-test.s:9: Error: operand size mismatch for `bextr'

seemingly because GCC's idea of r/m is broken for this instruction:


sesse@gruessi:~$ cat bextr-test.s
    .file    "bextr-test.c"
    .text
    .p2align 4,,15
    .globl    func
    .type    func, @function
func:
.LFB0:
    .cfi_startproc
    bextr    (%rsi), %rdi, %rax
    ret
    .cfi_endproc
.LFE0:
    .size    func, .-func
    .ident    "GCC: (Debian 4.8.1-2) 4.8.1"
    .section    .note.GNU-stack,"",@progbits

As far as I understand, the second operand can be r/m64, but the first can only
be r64.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]