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] Do not generate useless integral conversions


On Tue, Jun 24, 2014 at 12:54 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> https://gcc.gnu.org/ml/gcc-patches/2012-03/msg00491.html changed the old
> signed_type_for/unsigned_type_for functions and made them always return an
> integer type, whereas they would previously leave integral types unchanged.
> I don't see any justification for the latter and this has the annoying effect
> of generating useless integral conversions in convert.c, for example between
> boolean types and integer types of the same precision.
>
> The attached patch restores the old behavior for them.  Bootstrapped/regtested
> on x86_64-suse-linux, OK for the mainline?

I think that was on purpose to avoid arithmetics in enum types.  As those
conversions are useless and thus stripped later is it really important
to retain enum and boolean kind here?

Richard.

> 2014-06-24  Eric Botcazou  <ebotcazou@adacore.com>
>
>         * tree.c (signed_or_unsigned_type_for): Treat integral types equally.
>
>
> --
> Eric Botcazou


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