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

            Bug ID: 72839
           Summary: MOVE_RATIO is too small for Lakemont
           Product: gcc
           Version: 6.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: ubizjak at gmail dot com
  Target Milestone: ---
              Host: i386

[hjl@gnu-6 stringops-1]$ cat x.i
extern char *strcpy (char *, const char *);

void
foo (char *s)
{
  strcpy (s,
          "12345678123456781234567812345678123456781234567812345678"
          "1234567");
}
[hjl@gnu-6 stringops-1]$ gcc -O2 -mtune=lakemont -m32 -S x.i
[hjl@gnu-6 stringops-1]$ cat x.s
        .file   "x.i"
        .section        .rodata.str1.4,"aMS",@progbits,1
        .align 4
.LC0:
        .string
"123456781234567812345678123456781234567812345678123456781234567"
        .text
        .p2align 4,,15
        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        pushl   %edi
        .cfi_def_cfa_offset 8
        .cfi_offset 7, -8
        pushl   %esi
        .cfi_def_cfa_offset 12
        .cfi_offset 6, -12
        movl    12(%esp), %edi
        movl    $.LC0, %esi
        movl    $64, %eax
        testl   $1, %edi
        jne     .L21
        testl   $2, %edi
        jne     .L22
.L3:
        movl    %eax, %ecx
        xorl    %edx, %edx
        shrl    $2, %ecx
        testb   $2, %al
        rep movsl
        je      .L4
        movw    (%esi), %dx
        movw    %dx, (%edi)
        movl    $2, %edx
.L4:
        testb   $1, %al
        je      .L1
        movb    (%esi,%edx), %al
        movb    %al, (%edi,%edx)
.L1:
        popl    %esi
        .cfi_remember_state
        .cfi_restore 6
        .cfi_def_cfa_offset 8
        popl    %edi
        .cfi_restore 7
        .cfi_def_cfa_offset 4
        ret
        .p2align 4,,7
        .p2align 3
.L21:
        .cfi_restore_state
        movb    .LC0, %al
        incl    %edi
        movb    %al, -1(%edi)
        movl    $.LC0+1, %esi
        movl    $63, %eax
        testl   $2, %edi
        je      .L3
        .p2align 4,,7
        .p2align 3
.L22:
        movw    (%esi), %dx
        addl    $2, %edi
        movw    %dx, -2(%edi)
        addl    $2, %esi
        subl    $2, %eax
        jmp     .L3
        .cfi_endproc
.LFE0:
        .size   foo, .-foo

The code is bigger and slower.

Reply via email to