public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/47521] New: Unnecessary usage of edx register
@ 2011-01-28 18:42 tony.poppleton at gmail dot com
  2011-01-28 18:44 ` [Bug rtl-optimization/47521] " tony.poppleton at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: tony.poppleton at gmail dot com @ 2011-01-28 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Unnecessary usage of edx register
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tony.poppleton@gmail.com


In testing PR46235 I noticed some minor inefficiency in the usage of an extra
register.

The C code is:

int foo(int a, int x, int y)
{
   if  (a & (16))
       return a;
   return 1;
}

Which produces the asm:
        movl    %edi, %eax
        movl    $1, %edx
        testb   $16, %al
        cmove   %edx, %eax
        ret

The above code could have been further optimized to remove the usage of edx:
        movl    $1, %eax
        test    $16, %edi
        cmove   %edi, %eax
        ret


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

end of thread, other threads:[~2013-09-17 18:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-28 18:42 [Bug rtl-optimization/47521] New: Unnecessary usage of edx register tony.poppleton at gmail dot com
2011-01-28 18:44 ` [Bug rtl-optimization/47521] " tony.poppleton at gmail dot com
2011-01-29 12:02 ` [Bug rtl-optimization/47521] [Regression 4.4/4.5/4.6] " tony.poppleton at gmail dot com
2011-01-31 14:49 ` [Bug rtl-optimization/47521] [4.4/4.5/4.6 Regression] " rguenth at gcc dot gnu.org
2011-02-02 19:27 ` [Bug rtl-optimization/47521] " law at redhat dot com
2011-02-03 13:54 ` law at redhat dot com
2011-02-03 14:16 ` tony.poppleton at gmail dot com
2011-02-03 14:32 ` law at redhat dot com
2011-04-16 10:56 ` jakub at gcc dot gnu.org
2011-04-28 16:27 ` rguenth at gcc dot gnu.org
2013-04-10  1:51 ` tony.poppleton at gmail dot com
2013-09-17 18:49 ` law at redhat dot com

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).