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

            Bug ID: 70208
           Summary: [6 Regression] Operand size mismatch for `vpextrb' w/
                    -O3 -mavx -masm=intel
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: assemble-failure, ssemmx
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: x86_64-*-*-*

When compiling the following reduced snippet w/ -O3 (or -Ofast) -mavx (and
above) -masm=intel, gcc-6.0.0-alpha20160306 produces assembly that is diagnosed
by gas as incorrect:

char oi;

void
pl(void)
{
  int mx;

  if (!oi)
    for (mx = 0; mx < 30; ++mx)
      oi ^= 1;
}

% x86_64-unknown-linux-gnu-gcc-6.0.0-alpha20160306 -c -O3 -march=ivybridge
-masm=intel ca1lwdmy.c 
/tmp/ccFaEKel.s: Assembler messages:
/tmp/ccFaEKel.s:21: Error: operand size mismatch for `vpextrb'

And the offending instruction is obviously wrong: there should be

  vpextrb       BYTE PTR oi[rip], xmm0, 0

instead of generated

  vpextrb       DWORD PTR oi[rip], xmm0, 0

Given that instruction pextrb was introduced in SSE 4.1 (?), specifying -msse4,
-msse4.1, or -msse4.2 also works.

Reply via email to