Commit 1d636855 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/54370 (error: non-trivial conversion in unary operation)

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>

        PR fortran/54370
        * gfortran.dg/do_5.f90: New.

From-SVN: r190709
parent 6c513d43
2012-08-27 Tobias Burnus <burnus@net-b.de> 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. * options.c (set_Wall): Don't set for -Wcompare-reals.
* invoke.texi (-Wall, -Wcompare-reals): -Wall no longer * invoke.texi (-Wall, -Wcompare-reals): -Wall no longer
implies -Wcompare-reals. implies -Wcompare-reals.
......
...@@ -1785,7 +1785,7 @@ gfc_trans_do_while (gfc_code * code) ...@@ -1785,7 +1785,7 @@ gfc_trans_do_while (gfc_code * code)
gfc_conv_expr_val (&cond, code->expr1); gfc_conv_expr_val (&cond, code->expr1);
gfc_add_block_to_block (&block, &cond.pre); gfc_add_block_to_block (&block, &cond.pre);
cond.expr = fold_build1_loc (code->expr1->where.lb->location, 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". */ /* Build "IF (! cond) GOTO exit_label". */
tmp = build1_v (GOTO_EXPR, exit_label); tmp = build1_v (GOTO_EXPR, exit_label);
......
2012-08-27 Tobias Burnus <burnus@net-b.de> 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 * gfortran.dg/bessel_5.f90: Remove -Wno-compare-reals
from dg-options as -Wall no longer implies it. from dg-options as -Wall no longer implies it.
......
! { 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment