diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-18 14:52:19 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-18 14:52:19 +0000 |
commit | 6a0712d4ee92fb8ddf409de894393962bb54cbbf (patch) | |
tree | 586ec6bfb385ba75fc95f0a7d521c0b51c136124 /gcc/fold-const.c | |
parent | fcb97e84adcb5693684d9cfa7b2a97af32ba7a45 (diff) | |
download | linaro-gcc-6a0712d4ee92fb8ddf409de894393962bb54cbbf.tar.gz linaro-gcc-6a0712d4ee92fb8ddf409de894393962bb54cbbf.tar.bz2 linaro-gcc-6a0712d4ee92fb8ddf409de894393962bb54cbbf.zip |
gcc/ada/
* gcc-interface/decl.c, gcc-interface/utils.c, gcc-interface/utils2.c:
Replace tree_low_cst (..., 1) with tree_to_uhwi throughout.
gcc/c-family/
* c-common.c, c-cppbuiltin.c: Replace tree_low_cst (..., 1) with
tree_to_uhwi throughout.
gcc/c/
* c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with
tree_to_uhwi throughout.
gcc/cp/
* call.c, class.c, decl.c, error.c: Replace tree_low_cst (..., 1) with
tree_to_uhwi throughout.
gcc/objc/
* objc-encoding.c: Replace tree_low_cst (..., 1) with tree_to_uhwi
throughout.
gcc/
* alias.c, asan.c, builtins.c, cfgexpand.c, cgraph.c,
config/aarch64/aarch64.c, config/alpha/predicates.md,
config/arm/arm.c, config/darwin.c, config/epiphany/epiphany.c,
config/i386/i386.c, config/iq2000/iq2000.c, config/m32c/m32c-pragma.c,
config/mep/mep-pragma.c, config/mips/mips.c,
config/picochip/picochip.c, config/rs6000/rs6000.c, cppbuiltin.c,
dbxout.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, fold-const.c,
function.c, gimple-fold.c, godump.c, ipa-cp.c, ipa-prop.c, omp-low.c,
predict.c, sdbout.c, stor-layout.c, trans-mem.c, tree-object-size.c,
tree-sra.c, tree-ssa-ccp.c, tree-ssa-forwprop.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-niter.c,
tree-ssa-loop-prefetch.c, tree-ssa-strlen.c, tree-stdarg.c,
tree-switch-conversion.c, tree-vect-generic.c, tree-vect-loop.c,
tree-vect-patterns.c, tree-vrp.c, tree.c, tsan.c, ubsan.c, varasm.c:
Replace tree_low_cst (..., 1) with tree_to_uhwi throughout.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204961 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 46c66d36948..f4997ba8330 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -1433,10 +1433,10 @@ const_binop (enum tree_code code, tree arg1, tree arg2) if (!tree_fits_uhwi_p (arg2)) return NULL_TREE; - unsigned HOST_WIDE_INT shiftc = tree_low_cst (arg2, 1); - unsigned HOST_WIDE_INT outerc = tree_low_cst (TYPE_SIZE (type), 1); + unsigned HOST_WIDE_INT shiftc = tree_to_uhwi (arg2); + unsigned HOST_WIDE_INT outerc = tree_to_uhwi (TYPE_SIZE (type)); unsigned HOST_WIDE_INT innerc - = tree_low_cst (TYPE_SIZE (TREE_TYPE (type)), 1); + = tree_to_uhwi (TYPE_SIZE (TREE_TYPE (type))); if (shiftc >= outerc || (shiftc % innerc) != 0) return NULL_TREE; int offset = shiftc / innerc; @@ -8102,7 +8102,7 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0) { unsigned HOST_WIDE_INT cst; - cst = tree_low_cst (and1, 1); + cst = tree_to_uhwi (and1); cst &= HOST_WIDE_INT_M1U << (TYPE_PRECISION (TREE_TYPE (and1)) - 1); change = (cst == 0); @@ -11866,7 +11866,7 @@ fold_binary_loc (location_t loc, If B is constant and (B & M) == 0, fold into A & M. */ if (tree_fits_uhwi_p (arg1)) { - unsigned HOST_WIDE_INT cst1 = tree_low_cst (arg1, 1); + unsigned HOST_WIDE_INT cst1 = tree_to_uhwi (arg1); if (~cst1 && (cst1 & (cst1 + 1)) == 0 && INTEGRAL_TYPE_P (TREE_TYPE (arg0)) && (TREE_CODE (arg0) == PLUS_EXPR @@ -11891,7 +11891,7 @@ fold_binary_loc (location_t loc, } if (!tree_fits_uhwi_p (TYPE_MAX_VALUE (TREE_TYPE (arg0))) - || (tree_low_cst (TYPE_MAX_VALUE (TREE_TYPE (arg0)), 1) + || (tree_to_uhwi (TYPE_MAX_VALUE (TREE_TYPE (arg0))) & cst1) != cst1) which = -1; @@ -12036,11 +12036,11 @@ fold_binary_loc (location_t loc, && TYPE_PRECISION (TREE_TYPE (arg0)) <= HOST_BITS_PER_WIDE_INT && TREE_CODE (arg1) == INTEGER_CST && tree_fits_uhwi_p (TREE_OPERAND (arg0, 1)) - && tree_low_cst (TREE_OPERAND (arg0, 1), 1) > 0 - && (tree_low_cst (TREE_OPERAND (arg0, 1), 1) + && tree_to_uhwi (TREE_OPERAND (arg0, 1)) > 0 + && (tree_to_uhwi (TREE_OPERAND (arg0, 1)) < TYPE_PRECISION (TREE_TYPE (arg0)))) { - unsigned int shiftc = tree_low_cst (TREE_OPERAND (arg0, 1), 1); + unsigned int shiftc = tree_to_uhwi (TREE_OPERAND (arg0, 1)); unsigned HOST_WIDE_INT mask = TREE_INT_CST_LOW (arg1); unsigned HOST_WIDE_INT newmask, zerobits = 0; tree shift_type = TREE_TYPE (arg0); @@ -14503,9 +14503,9 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type, && TREE_TYPE (type) == TREE_TYPE (TREE_TYPE (arg0))))) { tree eltype = TREE_TYPE (TREE_TYPE (arg0)); - unsigned HOST_WIDE_INT width = tree_low_cst (TYPE_SIZE (eltype), 1); - unsigned HOST_WIDE_INT n = tree_low_cst (arg1, 1); - unsigned HOST_WIDE_INT idx = tree_low_cst (op2, 1); + unsigned HOST_WIDE_INT width = tree_to_uhwi (TYPE_SIZE (eltype)); + unsigned HOST_WIDE_INT n = tree_to_uhwi (arg1); + unsigned HOST_WIDE_INT idx = tree_to_uhwi (op2); if (n != 0 && (idx % width) == 0 @@ -14576,7 +14576,7 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type, /* A bit-field-ref that referenced the full argument can be stripped. */ if (INTEGRAL_TYPE_P (TREE_TYPE (arg0)) - && TYPE_PRECISION (TREE_TYPE (arg0)) == tree_low_cst (arg1, 1) + && TYPE_PRECISION (TREE_TYPE (arg0)) == tree_to_uhwi (arg1) && integer_zerop (op2)) return fold_convert_loc (loc, type, arg0); @@ -14587,14 +14587,14 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type, && tree_fits_uhwi_p (TYPE_SIZE_UNIT (TREE_TYPE (arg0))) /* This limitation should not be necessary, we just need to round this up to mode size. */ - && tree_low_cst (op1, 1) % BITS_PER_UNIT == 0 + && tree_to_uhwi (op1) % BITS_PER_UNIT == 0 /* Need bit-shifting of the buffer to relax the following. */ - && tree_low_cst (op2, 1) % BITS_PER_UNIT == 0) + && tree_to_uhwi (op2) % BITS_PER_UNIT == 0) { - unsigned HOST_WIDE_INT bitpos = tree_low_cst (op2, 1); - unsigned HOST_WIDE_INT bitsize = tree_low_cst (op1, 1); + unsigned HOST_WIDE_INT bitpos = tree_to_uhwi (op2); + unsigned HOST_WIDE_INT bitsize = tree_to_uhwi (op1); unsigned HOST_WIDE_INT clen; - clen = tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (arg0)), 1); + clen = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (arg0))); /* ??? We cannot tell native_encode_expr to start at some random byte only. So limit us to a reasonable amount of work. */ |