public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/23295] New: fold does not simplify -a - (5) to (-5) - a
@ 2005-08-09  3:12 pinskia at gcc dot gnu dot org
  2005-08-09  3:12 ` [Bug middle-end/23295] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-09  3:12 UTC (permalink / raw)
  To: gcc-bugs

Take the following function:
int f(int a, int c)
{
  return -a - (5);
}

Fold should have converted that to:
int f(int a, int c)
{
  return (-5) - a;
}

So that we only have one constant (-5) and one decl (a) and one expression (MINUS_EXPR) instead
of one constant (5), one decl (a) and two expressions (MINUS_EXPR and NEG_EXPR).

-- 
           Summary: fold does not simplify -a - (5) to (-5) - a
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: enhancement
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2006-10-23  7:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-23295-6528@http.gcc.gnu.org/bugzilla/>
2005-11-30 16:51 ` [Bug middle-end/23295] fold does not simplify -a - (5) to (-5) - a pinskia at gcc dot gnu dot org
2006-04-12 18:10 ` rguenth at gcc dot gnu dot org
2006-04-13  1:01 ` pinskia at gcc dot gnu dot org
2006-10-22 14:45 ` rguenth at gcc dot gnu dot org
2006-10-23  7:20 ` rguenth at gcc dot gnu dot org
2006-10-23  7:20 ` rguenth at gcc dot gnu dot org
2005-08-09  3:12 [Bug middle-end/23295] New: " pinskia at gcc dot gnu dot org
2005-08-09  3:12 ` [Bug middle-end/23295] " pinskia at gcc dot gnu dot org
2005-08-09  3:31 ` pinskia at gcc dot gnu dot org
2005-08-09  3:31 ` pinskia at gcc dot gnu dot org
2005-08-09  4:26 ` phython at gcc dot gnu dot org
2005-08-09  4:44 ` 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).