This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/23295] New: fold does not simplify -a - (5) to (-5) - a
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Aug 2005 03:12:23 -0000
- Subject: [Bug middle-end/23295] New: fold does not simplify -a - (5) to (-5) - a
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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