This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PHI optimization issue with boolean types
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 25 Oct 2016 12:31:02 +0200
- Subject: Re: [patch] Fix PHI optimization issue with boolean types
- Authentication-results: sourceware.org; auth=none
- References: <10860828.opkyFOrRK6@polaris> <2247596.6dkBKZEMlH@polaris> <CAFiYyc15CHyEtxYA4u9L75B2M2TrcL-LsX29OoELXnCx2bUQoA@mail.gmail.com> <3454180.bDkjEEGv1q@polaris>
On Tue, Oct 25, 2016 at 12:22 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> I'm not sure what you mean with "all other callers of fits_to_tree_p
>> are affected" - that was desired.
>
> Affected by the from == to eq_p change:
>
> + if (TREE_CODE (type) == BOOLEAN_TYPE)
> + return x == 0 || x == 1;
>
> vs
>
> + if (TREE_CODE (type) == BOOLEAN_TYPE)
> + return eq_p (x, 0) || eq_p (x, 1);
>
> Is eq_p free for them too? If no, then you distribute the overhead over all
> the callers instead of just int_fits_type_p (for which the call is unlikely).
Yes, eq_p is equivalent to == (apart from the overloading issue you ran into).
Richard.
> --
> Eric Botcazou