Commit c813f268 by Richard Biener Committed by Richard Biener

re PR fortran/77678 (ICE in fold_read_from_constant_string, at fold-const.c:13706)

2016-09-22  Richard Biener  <rguenther@suse.de>

	PR middle-end/77678
	* expr.c (expand_expr_real_1): Guard array access against negative
	offset.

From-SVN: r240351
parent b8ffdd97
2016-09-22 Richard Biener <rguenther@suse.de>
PR middle-end/77678
* expr.c (expand_expr_real_1): Guard array access against negative
offset.
2016-09-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gimple-ssa-sprintf.c (format_floating_max): Use GMP_RNDN instead
......
......@@ -10274,7 +10274,8 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
fold_convert_loc (loc, sizetype,
low_bound));
if (compare_tree_int (index1, TREE_STRING_LENGTH (init)) < 0)
if (tree_fits_uhwi_p (index1)
&& compare_tree_int (index1, TREE_STRING_LENGTH (init)) < 0)
{
tree type = TREE_TYPE (TREE_TYPE (init));
machine_mode mode = TYPE_MODE (type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment