OSDN Git Service

* trans-stmt.c (gfc_trans_do): Add a few missing folds.
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 20 Aug 2009 18:47:51 +0000 (18:47 +0000)
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 20 Aug 2009 18:47:51 +0000 (18:47 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150969 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/trans-stmt.c

index 3a8dd03..6fde5a4 100644 (file)
@@ -1,3 +1,7 @@
+2009-08-20  Tobias Schl├╝ter  <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
index 66aecb1..1ae841f 100644 (file)
@@ -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);