Commit 93fc8073 by Richard Guenther Committed by Richard Biener

trans-expr.c (gfc_conv_substring): Use fold_build2 and build_int_cst.

2005-12-13  Richard Guenther  <rguenther@suse.de>

	* trans-expr.c (gfc_conv_substring): Use fold_build2 and
	build_int_cst.

From-SVN: r108476
parent 65260edb
2005-12-13 Richard Guenther <rguenther@suse.de>
* trans-expr.c (gfc_conv_substring): Use fold_build2 and
build_int_cst.
2005-12-13 Richard Sandiford <richard@codesourcery.com>
* Make-lang.in (fortran/trans-resolve.o): Depend on
......
......@@ -246,12 +246,11 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind)
gfc_conv_expr_type (&end, ref->u.ss.end, gfc_charlen_type_node);
gfc_add_block_to_block (&se->pre, &end.pre);
}
tmp =
build2 (MINUS_EXPR, gfc_charlen_type_node,
fold_convert (gfc_charlen_type_node, integer_one_node),
start.expr);
tmp = build2 (PLUS_EXPR, gfc_charlen_type_node, end.expr, tmp);
se->string_length = fold (tmp);
tmp = fold_build2 (MINUS_EXPR, gfc_charlen_type_node,
build_int_cst (gfc_charlen_type_node, 1),
start.expr);
tmp = fold_build2 (PLUS_EXPR, gfc_charlen_type_node, end.expr, tmp);
se->string_length = tmp;
}
......
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