PR fortran/54370
* trans-stmt.c (gfc_trans_do_while): Don't change the logical
kind for negation of the condition.
2012-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/54370
* gfortran.dg/do_5.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190709
138bc75d-0d04-0410-961f-
82ee72b054a4
2012-08-27 Tobias Burnus <burnus@net-b.de>
+ PR fortran/54370
+ * trans-stmt.c (gfc_trans_do_while): Don't change the logical
+ kind for negation of the condition.
+
+2012-08-27 Tobias Burnus <burnus@net-b.de>
+
* options.c (set_Wall): Don't set for -Wcompare-reals.
* invoke.texi (-Wall, -Wcompare-reals): -Wall no longer
implies -Wcompare-reals.
gfc_conv_expr_val (&cond, code->expr1);
gfc_add_block_to_block (&block, &cond.pre);
cond.expr = fold_build1_loc (code->expr1->where.lb->location,
- TRUTH_NOT_EXPR, boolean_type_node, cond.expr);
+ TRUTH_NOT_EXPR, TREE_TYPE (cond.expr), cond.expr);
/* Build "IF (! cond) GOTO exit_label". */
tmp = build1_v (GOTO_EXPR, exit_label);
2012-08-27 Tobias Burnus <burnus@net-b.de>
+ PR fortran/54370
+ * gfortran.dg/do_5.f90: New.
+
+2012-08-27 Tobias Burnus <burnus@net-b.de>
+
* gfortran.dg/bessel_5.f90: Remove -Wno-compare-reals
from dg-options as -Wall no longer implies it.
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/54370
+!
+! The following program was ICEing at tree-check time
+! "L()" was regarded as default-kind logical.
+!
+! Contributed by Kirill Chilikin
+!
+ MODULE M
+ CONTAINS
+
+ LOGICAL(C_BOOL) FUNCTION L() BIND(C)
+ USE, INTRINSIC :: ISO_C_BINDING
+ L = .FALSE.
+ END FUNCTION
+
+ LOGICAL(8) FUNCTION L2() BIND(C)
+ L2 = .FALSE._8
+ END FUNCTION
+
+ SUBROUTINE S()
+ DO WHILE (L())
+ ENDDO
+ DO WHILE (L2())
+ ENDDO
+ END
+
+ END