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 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.

OK.

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
in fold-const.c).

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  <ebotcazou@adacore.com>

	* convert.c (convert_to_integer): Do not introduce useless conversions
	between integral types.
OK.
Jeff


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