This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Discard P - (P + CST) optimization in pointer_diff (PR c/61240)
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Mon, 4 Aug 2014 13:13:49 +0200 (CEST)
- Subject: Re: [C PATCH] Discard P - (P + CST) optimization in pointer_diff (PR c/61240)
- Authentication-results: sourceware.org; auth=none
- References: <20140804101856 dot GB24292 at redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1408041224210 dot 20733 at zhemvz dot fhfr dot qr> <20140804111016 dot GM7393 at tucnak dot redhat dot com>
On Mon, 4 Aug 2014, Jakub Jelinek wrote:
> On Mon, Aug 04, 2014 at 12:26:01PM +0200, Richard Biener wrote:
> > I think that tree-ssa-forwprop.c already simplifies this in
> > associate_plusminus with (T)(P + A) - (T)P -> (T)A. Well,
> > maybe not - but then the code should be massages to handle it.
> >
> > Can you double-check and do that?
> >
> > Otherwise I agree with removing this (and other) "premature"
> > optimizations scattered throughout the frontends (and convert.c).
>
> IMHO a precondition of such changes is exactly verifying the middle-end
> can perform those optimizations later on and if not, teaching the middle-end
> to optimize that.
Yep. Which is why I said "double-check and do that", "do that" in
extend what tree-ssa-forwrpop.c does.
Richard.