summaryrefslogtreecommitdiff
path: root/gcc/value-prof.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-13 20:41:07 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-13 20:41:07 +0000
commite913b5cd5b6a9bd3a2ad58c65f9e3cd2bb55a28c (patch)
treef52a097017e3dcf89fad6525984e4591489f961e /gcc/value-prof.c
parent9a5942c1d4d9116ab74b0741cfe3894a89fd17fb (diff)
downloadgcc-e913b5cd5b6a9bd3a2ad58c65f9e3cd2bb55a28c.tar.gz
Add wide-int branch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@201707 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r--gcc/value-prof.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 8aa9fcda905..d36d0eeefe5 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -805,9 +805,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)
@@ -1715,9 +1723,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 ",