public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/53640] New: Missed cmove with stores
@ 2012-06-11 23:08 pinskia at gcc dot gnu.org
  2012-06-11 23:09 ` [Bug tree-optimization/53640] " pinskia at gcc dot gnu.org
  2012-06-12  9:29 ` rguenth at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-06-11 23:08 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53640
           Summary: Missed cmove with stores
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pinskia@gcc.gnu.org


Take:
int f(int a, int *b)
{
  if (a >= 2)
    *b = 1;
  else
    *b = 0;

  return *b;
}

int f1(int a, int *b)
{
  int t;
  if (a >= 2)
    t = 1;
  else
    t = 0;
  *b = t;

  return *b;
}

---- CUT ----
Both of these are the same.  f1 will produce better code.


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

end of thread, other threads:[~2012-06-12  9:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-11 23:08 [Bug tree-optimization/53640] New: Missed cmove with stores pinskia at gcc dot gnu.org
2012-06-11 23:09 ` [Bug tree-optimization/53640] " pinskia at gcc dot gnu.org
2012-06-12  9:29 ` rguenth at gcc dot gnu.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).