------- Comment #4 from steven at gcc dot gnu dot org 2006-07-19 23:08 ------- Andrew, you're wrong. :-P
My gfortran skills are not what they used to be, but I believe this is the fix: Index: trans-stmt.c =================================================================== --- trans-stmt.c (revision 115467) +++ trans-stmt.c (working copy) @@ -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); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28439