diff options
author | Kenneth Zadeck <zadeck@naturalbridge.com> | 2014-05-06 16:25:05 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2014-05-06 16:25:05 +0000 |
commit | 807e902eea17f3132488c256c963823976b2348c (patch) | |
tree | e5e1af94eb1502ba893bd6ce4a11f68877ff62a9 /gcc/value-prof.c | |
parent | 6122336c832dc4dfedc49279549caddce86306ff (diff) | |
download | gcc-807e902eea17f3132488c256c963823976b2348c.tar.gz |
Merge in wide-int.
From-SVN: r210113
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r-- | gcc/value-prof.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/gcc/value-prof.c b/gcc/value-prof.c index 28900934744..0d033ef6284 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -834,9 +834,17 @@ gimple_divmod_fixed_value_transform (gimple_stmt_iterator *si) else prob = 0; - tree_val = build_int_cst_wide (get_gcov_type (), - (unsigned HOST_WIDE_INT) val, - val >> (HOST_BITS_PER_WIDE_INT - 1) >> 1); + if (sizeof (gcov_type) == sizeof (HOST_WIDE_INT)) + tree_val = build_int_cst (get_gcov_type (), val); + else + { + HOST_WIDE_INT a[2]; + a[0] = (unsigned HOST_WIDE_INT) val; + a[1] = val >> (HOST_BITS_PER_WIDE_INT - 1) >> 1; + + tree_val = wide_int_to_tree (get_gcov_type (), wide_int::from_array (a, 2, + TYPE_PRECISION (get_gcov_type ()), false)); + } result = gimple_divmod_fixed_value (stmt, tree_val, prob, count, all); if (dump_file) @@ -1745,9 +1753,18 @@ gimple_stringops_transform (gimple_stmt_iterator *gsi) default: gcc_unreachable (); } - tree_val = build_int_cst_wide (get_gcov_type (), - (unsigned HOST_WIDE_INT) val, - val >> (HOST_BITS_PER_WIDE_INT - 1) >> 1); + if (sizeof (gcov_type) == sizeof (HOST_WIDE_INT)) + tree_val = build_int_cst (get_gcov_type (), val); + else + { + HOST_WIDE_INT a[2]; + a[0] = (unsigned HOST_WIDE_INT) val; + a[1] = val >> (HOST_BITS_PER_WIDE_INT - 1) >> 1; + + tree_val = wide_int_to_tree (get_gcov_type (), wide_int::from_array (a, 2, + TYPE_PRECISION (get_gcov_type ()), false)); + } + if (dump_file) { fprintf (dump_file, "Single value %i stringop transformation on ", |