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

             Bug #: 51924
           Summary: [4.7 Regression] wrong code with -O -free
                    -fno-rename-registers -ftree-vectorize -funroll-loops
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: zso...@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 26397
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26397
reduced testcase

Output:
$ gcc -O -free -fno-rename-registers -ftree-vectorize -funroll-loops testcase.c
$ ./a.out
Aborted


In the output assembly when comparing output with -free and -fno-ree, this
often happens:
*************** bn_sub_words:
*** 152,159 ****
        mov     QWORD PTR [rdi+rcx], r10
        cmp     r9, r8
        setb    r10b
        cmp     r9, r8
!       cmovne  rax, r10
        add     rcx, 8
        cmp     rcx, r11
        jne     .L5
--- 156,164 ----
        mov     QWORD PTR [rdi+rcx], r10
        cmp     r9, r8
        setb    r10b
+       movzx   r10d, r10b
        cmp     r9, r8
!       cmovne  eax, r10d
        add     rcx, 8
        cmp     rcx, r11
        jne     .L5

With -fno-ree (bottom), the value is extended as r10b -> r10d -> eax (-> rax
before ret)
With -free (top), the value is extended r10d -> rax (where only r10b is valid -
it is missing the r10b->r10d step)

Tested revisions:
r183324 - fail
4.6 - doesn't know -free, but -free is included in -O2

Reply via email to