2017-08-03 Jakub Jelinek <jakub@redhat.com>
+ PR driver/81650
+ * calls.c (alloc_max_size): Use HOST_WIDE_INT_UC (10??)
+ instead of 10??LU, perform unit multiplication in wide_int,
+ don't change alloc_object_size_limit if the limit is larger
+ than SSIZE_MAX.
+
PR tree-optimization/81655
PR tree-optimization/81588
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Handle also
else if (!strcasecmp (end, "KiB") || strcmp (end, "KB"))
unit = 1024;
else if (!strcmp (end, "MB"))
- unit = 1000LU * 1000;
+ unit = HOST_WIDE_INT_UC (1000) * 1000;
else if (!strcasecmp (end, "MiB"))
- unit = 1024LU * 1024;
+ unit = HOST_WIDE_INT_UC (1024) * 1024;
else if (!strcasecmp (end, "GB"))
- unit = 1000LU * 1000 * 1000;
+ unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000;
else if (!strcasecmp (end, "GiB"))
- unit = 1024LU * 1024 * 1024;
+ unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024;
else if (!strcasecmp (end, "TB"))
- unit = 1000LU * 1000 * 1000 * 1000;
+ unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000;
else if (!strcasecmp (end, "TiB"))
- unit = 1024LU * 1024 * 1024 * 1024;
+ unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024;
else if (!strcasecmp (end, "PB"))
- unit = 1000LU * 1000 * 1000 * 1000 * 1000;
+ unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000 * 1000;
else if (!strcasecmp (end, "PiB"))
- unit = 1024LU * 1024 * 1024 * 1024 * 1024;
+ unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024 * 1024;
else if (!strcasecmp (end, "EB"))
- unit = 1000LU * 1000 * 1000 * 1000 * 1000 * 1000;
+ unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000 * 1000
+ * 1000;
else if (!strcasecmp (end, "EiB"))
- unit = 1024LU * 1024 * 1024 * 1024 * 1024 * 1024;
+ unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024 * 1024
+ * 1024;
else
unit = 0;
}
if (unit)
- alloc_object_size_limit
- = build_int_cst (ssizetype, limit * unit);
+ {
+ wide_int w = wi::uhwi (limit, HOST_BITS_PER_WIDE_INT + 64);
+ w *= unit;
+ if (wi::ltu_p (w, alloc_object_size_limit))
+ alloc_object_size_limit = wide_int_to_tree (ssizetype, w);
+ }
}
}
}