This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make PRE PHI insertion use an already available PHI
- From: "Daniel Berlin" <dberlin at dberlin dot org>
- To: "Richard Guenther" <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Aug 2008 14:06:59 -0400
- Subject: Re: [PATCH] Make PRE PHI insertion use an already available PHI
- References: <alpine.LNX.1.10.0808211608300.3427@zhemvz.fhfr.qr>
On Thu, Aug 21, 2008 at 10:14 AM, Richard Guenther <rguenther@suse.de> wrote:
>
> This makes us no longer rely on a second DOM pass for
> gcc.dg/builtins-20.c. The case in question is
>
> extern double cos(double);
> void test2(double x, double y)
> {
> if (cos(y<10 ? x : -y) != cos(y<10 ? x : y))
> link_error ();
> }
>
> which we don't fold directly but have to deal with during optimization.
> PRE figures out that all is equivalent but produces
>
> <bb 4>:
> # x_1 = PHI <x_5(D)(7), y_3(D)(3)>
> # D.1955_15 = PHI <D.1955_14(7), D.1955_7(3)>
> # prephitmp_22 = PHI <D.1955_14(7), D.1955_7(3)>
> D.1960_10 = prephitmp_22;
> if (D.1955_15 != D.1960_10)
Actually, this makes no sense to me.
If you have a phi node already for the value, it should have detected
it as a full redundancy, not a partial one.