This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/37516] ~(-2 - a) is not being optimized into a + 1
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Feb 2012 08:42:01 +0000
- Subject: [Bug rtl-optimization/37516] ~(-2 - a) is not being optimized into a + 1
- Auto-submitted: auto-generated
- References: <bug-37516-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37516
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2012-02-23
AssignedTo|unassigned at gcc dot |pinskia at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-23 08:42:01 UTC ---
I have an idea on how to fix this.
basically:
~(C - X)
is the same as:
~ - (X - C)
which then can be simplified to
X - (C+1)
This should be done on both the tree level (on the pinskia/treecombine branch
in tree-ssa-fold.c) and the rtl level in simplify-rtx.c.