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
This commit is contained in:
Steven Bosscher 2006-07-22 17:55:35 +00:00 committed by Steven G. Kargl
parent f8145d0e61
commit 5ec1334b94
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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);