This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix PHI optimization issue with boolean types


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]