public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/19719] New: missed optimization on boolean operation with boolean arguments
@ 2005-01-31  6:11 yuri at tsoft dot com
  2005-01-31  6:47 ` [Bug tree-optimization/19719] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: yuri at tsoft dot com @ 2005-01-31  6:11 UTC (permalink / raw)
  To: gcc-bugs

Function:
bool f(bool b1, bool b2) { return (b1 && b2); }

compiled into assembly with 2 jumps and many redundand instructions (7 total),
see below.

Should be no jumps and much less instructins (3 total).

Yuri


----got from g++----
        pushl   %ebp
        movl    %esp, %ebp
>        xorl    %eax, %eax
>        cmpb    $0, 8(%ebp)
>        movb    12(%ebp), %dl
>        je      .L2
>        testb   %dl, %dl
>        je      .L2
>        movb    $1, %al
        .p2align 2,,3
.L2:
        leave
        ret

----should be----
       pushl   %ebp
        movl    %esp, %ebp
>        xorl    %eax, %eax
>        movb    8(%ebp), %al
>        andb    12(%ebp), %al
        .p2align 2,,3
.L2:
        leave
        ret

-- 
           Summary: missed optimization on boolean operation with boolean
                    arguments
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yuri at tsoft dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2009-04-22 21:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-19719-6649@http.gcc.gnu.org/bugzilla/>
2005-10-23  0:04 ` [Bug tree-optimization/19719] missed optimization on boolean operation with boolean arguments pinskia at gcc dot gnu dot org
2006-04-06 20:58 ` pinskia at gcc dot gnu dot org
2006-04-11 21:24 ` pinskia at gcc dot gnu dot org
2006-10-24 13:14 ` rguenth at gcc dot gnu dot org
2006-10-26 12:57 ` pinskia at gcc dot gnu dot org
2007-05-28 21:21 ` pinskia at gcc dot gnu dot org
2009-04-22 21:25 ` pinskia at gcc dot gnu dot org
2005-01-31  6:11 [Bug rtl-optimization/19719] New: " yuri at tsoft dot com
2005-01-31  6:47 ` [Bug tree-optimization/19719] " pinskia at gcc dot gnu dot org
2005-05-04  1:52 ` pinskia at gcc dot gnu dot org
2005-05-08 17:50 ` pinskia at gcc dot gnu dot org
2005-05-16 13:52 ` rguenth at gcc dot gnu dot org
2005-05-16 21:27 ` pinskia 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).