public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/31799]  New: Failed to optimize out test instruction
@ 2007-05-03 14:21 hjl at lucon dot org
  2007-05-03 16:08 ` [Bug rtl-optimization/31799] " ubizjak at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hjl at lucon dot org @ 2007-05-03 14:21 UTC (permalink / raw)
  To: gcc-bugs

For

void
foo (int x, int *y, int *z)
{
  *z = ++x;
  if (x != 0)
  *y = 1;
}

gcc 4.3 generates

foo:
.LFB2:
        addl    $1, %edi
        testl   %edi, %edi
        movl    %edi, (%rdx)
        je      .L3
        movl    $1, (%rsi)
.L3:
        rep ; ret

But "testl   %edi, %edi" isn't needed since "addl    $1, %edi" sets proper
FLAGS_REG.


-- 
           Summary: Failed to optimize out test instruction
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl at lucon dot org
GCC target triplet: x86_64-unknown-linux-gnu


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


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

end of thread, other threads:[~2007-05-05 17:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-03 14:21 [Bug rtl-optimization/31799] New: Failed to optimize out test instruction hjl at lucon dot org
2007-05-03 16:08 ` [Bug rtl-optimization/31799] " ubizjak at gmail dot com
2007-05-03 16:22 ` ubizjak at gmail dot com
2007-05-05  1:31 ` hjl at lucon dot org
2007-05-05 17:49 ` ubizjak at gmail 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).