r235721 - in /trunk/gcc: ChangeLog c-family/Cha...

rsandifo@gcc.gnu.org rsandifo@gcc.gnu.org
Mon May 2 09:40:00 GMT 2016


Author: rsandifo
Date: Mon May  2 09:40:09 2016
New Revision: 235721

URL: https://gcc.gnu.org/viewcvs?rev=235721&root=gcc&view=rev
Log:
Add a wi::to_wide helper function

As Richard says, we ought to have a convenient way of converting
an INTEGER_CST to a wide_int of a particular precision without
having to extract the sign of the INTEGER_CST's type each time.
This patch adds a wi::to_wide helper for that, alongside the
existing wi::to_offset and wi::to_widest.

Tested on x86_64-linux-gnu and aarch64-linux-gnu.

gcc/
	* tree.h (wi::to_wide): New function.
	* expr.c (expand_expr_real_1): Use wi::to_wide.
	* fold-const.c (int_const_binop_1): Likewise.
	(extract_muldiv_1): Likewise.

gcc/c-family/
	* c-common.c (shorten_compare): Use wi::to_wide.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/expr.c
    trunk/gcc/fold-const.c
    trunk/gcc/tree.h



More information about the Gcc-cvs mailing list