From: rsandifo Date: Sun, 10 Nov 2013 10:11:17 +0000 (+0000) Subject: Make more use of references. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=968d48a0a9eec4301d03dbedcbcd5ec60dce8440;p=thirdparty%2Fgcc.git Make more use of references. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@204627 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 45a24e31c75e..39276a6121ce 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -9900,7 +9900,7 @@ exact_inverse (tree type, tree cst) /* Mask out the tz least significant bits of X of type TYPE where tz is the number of trailing zeroes in Y. */ static wide_int -mask_with_tz (tree type, wide_int x, wide_int y) +mask_with_tz (tree type, const wide_int &x, const wide_int &y) { int tz = wi::ctz (y); if (tz > 0) diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index 2c177eeaec8a..6e887aaad664 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -179,7 +179,7 @@ make_ssa_name_fn (struct function *fn, tree var, gimple stmt) /* Store range information MIN, and MAX to tree ssa_name NAME. */ void -set_range_info (tree name, widest_int min, widest_int max) +set_range_info (tree name, const widest_int &min, const widest_int &max) { gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name))); range_info_def *ri = SSA_NAME_RANGE_INFO (name); @@ -201,16 +201,15 @@ set_range_info (tree name, widest_int min, widest_int max) if (wi::cmp (min, max, TYPE_SIGN (TREE_TYPE (name))) != 1) { int prec = TYPE_PRECISION (TREE_TYPE (name)); - widest_int xorv; - min = wi::zext (min, prec); - max = wi::zext (max, prec); - xorv = min ^ max; + widest_int ext_min = wi::zext (min, prec); + widest_int ext_max = wi::zext (max, prec); + widest_int xorv = ext_min ^ ext_max; if (xorv != 0) xorv = wi::mask (MAX_BITSIZE_MODE_ANY_INT - wi::clz (xorv), false); - ri->nonzero_bits = ri->nonzero_bits & (min | xorv); + ri->nonzero_bits = ri->nonzero_bits & (ext_min | xorv); } } @@ -254,7 +253,7 @@ get_range_info (const_tree name, widest_int *min, widest_int *max) /* Change non-zero bits bitmask of NAME. */ void -set_nonzero_bits (tree name, widest_int mask) +set_nonzero_bits (tree name, const widest_int &mask) { gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name))); if (SSA_NAME_RANGE_INFO (name) == NULL) diff --git a/gcc/tree-ssanames.h b/gcc/tree-ssanames.h index cafcd7c482af..2ac7744dfc9e 100644 --- a/gcc/tree-ssanames.h +++ b/gcc/tree-ssanames.h @@ -70,11 +70,11 @@ struct GTY (()) range_info_def { enum value_range_type { VR_UNDEFINED, VR_RANGE, VR_ANTI_RANGE, VR_VARYING }; /* Sets the value range to SSA. */ -extern void set_range_info (tree, widest_int, widest_int); +extern void set_range_info (tree, const widest_int &, const widest_int &); /* Gets the value range from SSA. */ extern enum value_range_type get_range_info (const_tree, widest_int *, widest_int *); -extern void set_nonzero_bits (tree, widest_int); +extern void set_nonzero_bits (tree, const widest_int &); extern widest_int get_nonzero_bits (const_tree); extern void init_ssanames (struct function *, int); extern void fini_ssanames (void);