From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1653 invoked by alias); 15 Jun 2013 14:29:38 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1630 invoked by uid 48); 15 Jun 2013 14:29:35 -0000 From: "sgunderson at bigfoot dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/57623] New: BEXTR intrinsic has memory operands switched around (fails to compile code) Date: Sat, 15 Jun 2013 14:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sgunderson at bigfoot dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg00794.txt.bz2 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 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.