Commit 3110415b by Tobias Schlüter

* trans-stmt.c (gfc_trans_do): Add a few missing folds.

From-SVN: r150969
parent 6d383c5e
2009-08-20 Tobias Schlter <tobi@gcc.gnu.org>
* trans-stmt.c (gfc_trans_do): Add a few missing folds.
2009-08-20 Michael Matz <matz@suse.de>
PR fortran/41126
......
......@@ -1017,8 +1017,8 @@ gfc_trans_do (gfc_code * code)
tmp = fold_convert (utype, tmp);
tmp = fold_build2 (TRUNC_DIV_EXPR, utype, tmp,
fold_convert (utype, step));
tmp = build2 (MODIFY_EXPR, void_type_node, countm1, tmp);
pos = build2 (COMPOUND_EXPR, void_type_node, pos, tmp);
tmp = fold_build2 (MODIFY_EXPR, void_type_node, countm1, tmp);
pos = fold_build2 (COMPOUND_EXPR, void_type_node, pos, tmp);
tmp = fold_build2 (GT_EXPR, boolean_type_node, to, from);
neg = fold_build3 (COND_EXPR, void_type_node, tmp,
......@@ -1029,8 +1029,8 @@ gfc_trans_do (gfc_code * code)
tmp = fold_build2 (TRUNC_DIV_EXPR, utype, tmp,
fold_convert (utype, fold_build1 (NEGATE_EXPR,
type, step)));
tmp = build2 (MODIFY_EXPR, void_type_node, countm1, tmp);
neg = build2 (COMPOUND_EXPR, void_type_node, neg, tmp);
tmp = fold_build2 (MODIFY_EXPR, void_type_node, countm1, tmp);
neg = fold_build2 (COMPOUND_EXPR, void_type_node, neg, tmp);
tmp = fold_build3 (COND_EXPR, void_type_node, pos_step, pos, neg);
gfc_add_expr_to_block (&block, 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