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: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Feb 2012 08:47:55 +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
--- Comment #3 from rguenther at suse dot de <rguenther at suse dot de> 2012-02-23 08:47:55 UTC ---
On Thu, 23 Feb 2012, pinskia at gcc dot gnu.org wrote:
> 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.
Maybe get away with these old-stylish names ('tree' and 'fold') and
make it match reality, gimple-ssa-combine.c ;)
Still have to have a look at your branch - do you have a brief
overview documentation, for example on the wiki? What I'd like
to do is have an interface that I can re-use for VN combining,
basically replace its simplify_*_expression functions.
Richard.