This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Do not generate useless integral conversions
- From: Jeff Law <law at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>, Richard Biener <richard dot guenther at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 02 Oct 2014 12:33:02 -0600
- Subject: Re: [patch] Do not generate useless integral conversions
- Authentication-results: sourceware.org; auth=none
- References: <1546601 dot hgDYK4VNce at polaris> <2979660 dot ydMd8y2aAn at polaris> <CAFiYyc0NRiZ+mdj4r=fDJwd0=OSXyNMyEvA7=Us+Mdpm+uj4aw at mail dot gmail dot com> <1836306 dot n3bX0zRZaz at polaris>
On 10/02/14 04:40, Eric Botcazou wrote:
[This is an old discussion about useless integral conversions introduced
behind the back of the front-end by the routines in convert.c]
I don't like re-introducing that inconsistency.
Maybe instead make convert.c do if (!TYPE_UNSIGNED) unsigned_type_for ()
instead? I notice that all callers of [un]signed_type_for are in
"premature" optimizations convert.c performs (that better should be done
Yes, that works for me too, patch attached, it makes sure convert_to_integer
only fiddles with the type when strictly necessary. Tested on x86-64/Linux.
2014-10-02 Eric Botcazou <firstname.lastname@example.org>
* convert.c (convert_to_integer): Do not introduce useless conversions
between integral types.