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

            Bug ID: 59642
           Summary: Performance regression (4.7/4.8) with
                    -ftree-loop-distribute-patterns
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olle at liljenzin dot se

t.c:
void foo(int *v) {
  int *p;

  for(p = v; p < v + 2; ++p) *p = 0;

  for(p = v; p < v + 2; ++p)
    if(*p) *p = 1;
}

4.8.0/4.8.2 (fedora 19, x86_64):
% gcc -O3 -S t.c
        movq    $0, (%rdi)
        movl    4(%rdi), %eax
        testl   %eax, %eax
        je      .L1
        movl    $1, 4(%rdi)
.L1:
        rep ret

4.7.3:
        movl    $0, (%rdi)
        movl    $0, 4(%rdi)
        ret

With -fno-tree-loop-distribute-patterns 4.7 and 4.8 generate same code.

Reply via email to