public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/44669]  New: ccp or similar passes aren't run after cunroll
@ 2010-06-25 16:25 jakub at gcc dot gnu dot org
  2010-06-25 16:26 ` [Bug tree-optimization/44669] " jakub at gcc dot gnu dot org
  2010-06-25 20:56 ` rguenth at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-06-25 16:25 UTC (permalink / raw)
  To: gcc-bugs

! { dg-options "-O2 -funroll-loops" }
function foo (b)
  character (len=1) :: b(4)
  logical :: foo
  foo = any (b .ne. (/"1","2","3","4"/))
end

results in horrible code:
        movzbl  .LC0(%rip), %edx
        movl    $1, %eax
        cmpb    %dl, (%rdi)
        jne     .L2
        movzbl  .LC1(%rip), %ecx
        cmpb    %cl, 1(%rdi)
        jne     .L2
        movzbl  .LC2(%rip), %esi
        cmpb    %sil, 2(%rdi)
        jne     .L2
        movzbl  .LC3(%rip), %r8d
        cmpb    %r8b, 3(%rdi)
        setne   %al
        movzbl  %al, %eax
.L2:
        rep
        ret
because nothing optimizes the constant array reads after cunroll.
If I schedule another pass_ccp right after pass_complete_unroll, much better
code is generated:

        cmpb    $49, (%rdi)
        movl    $1, %eax
        jne     .L2
        cmpb    $50, 1(%rdi)
        jne     .L2
        cmpb    $51, 2(%rdi)
        jne     .L2
        xorl    %eax, %eax
        cmpb    $52, 3(%rdi)
        setne   %al
.L2:
        rep
        ret


-- 
           Summary: ccp or similar passes aren't run after cunroll
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-01 12:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-44669-4@http.gcc.gnu.org/bugzilla/>
2015-04-01 12:00 ` [Bug tree-optimization/44669] ccp or similar passes aren't run after cunroll rguenth at gcc dot gnu.org
2010-06-25 16:25 [Bug tree-optimization/44669] New: " jakub at gcc dot gnu dot org
2010-06-25 16:26 ` [Bug tree-optimization/44669] " jakub at gcc dot gnu dot org
2010-06-25 20:56 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).