diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2006-07-22 17:55:35 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2006-07-22 17:55:35 +0000 |
commit | 5ec1334b94435a794e486bd94ea20b4b171d8cb2 (patch) | |
tree | 214163f4503231f8dfaa69d0dde6f577e5931451 | |
parent | f8145d0e611ad331124a0bef6b052cc0c6bbd485 (diff) | |
download | gcc-5ec1334b94435a794e486bd94ea20b4b171d8cb2.zip gcc-5ec1334b94435a794e486bd94ea20b4b171d8cb2.tar.gz gcc-5ec1334b94435a794e486bd94ea20b4b171d8cb2.tar.bz2 |
re PR fortran/28439 ([4.1 only] Multiple evaluations of arithmetic if condition)
2006-07-22 Steven Bosscher <steven@gcc.gnu.org>
PR fortran/28439
* trans-stmt.c (gfc_trans_arithmetic_if): Evaluate the condition once.
From-SVN: r115677
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/trans-stmt.c | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3f9f928..ad63dd1 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2006-07-22 Steven Bosscher <steven@gcc.gnu.org> + + PR fortran/28439 + * trans-stmt.c (gfc_trans_arithmetic_if): Evaluate the condition once. + 2006-07-16 Jakub Jelinek <jakub@redhat.com> PR fortran/28390 diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index a123166..97cb747 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -663,6 +663,7 @@ gfc_trans_arithmetic_if (gfc_code * code) /* Pre-evaluate COND. */ gfc_conv_expr_val (&se, code->expr); + se.expr = gfc_evaluate_now (se.expr, &se.pre); /* Build something to compare with. */ zero = gfc_build_const (TREE_TYPE (se.expr), integer_zero_node); |