diff options
author | Tobias Burnus <burnus@net-b.de> | 2012-08-27 14:03:41 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-08-27 14:03:41 +0200 |
commit | 1d6368551e85cac41df6df4234d865918b693319 (patch) | |
tree | 4fda2ff21c6c4925e57041ec9ffdb79d95b3afc4 /gcc | |
parent | 6c513d43fb33ccd370998b3efae513f4f3a203be (diff) | |
download | gcc-1d6368551e85cac41df6df4234d865918b693319.zip gcc-1d6368551e85cac41df6df4234d865918b693319.tar.gz gcc-1d6368551e85cac41df6df4234d865918b693319.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-stmt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/do_5.f90 | 29 |
4 files changed, 41 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4d50517..eff252c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 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. diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 9467601..8bc4916 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -1785,7 +1785,7 @@ gfc_trans_do_while (gfc_code * code) 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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1c7f779..fd5b350 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 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. diff --git a/gcc/testsuite/gfortran.dg/do_5.f90 b/gcc/testsuite/gfortran.dg/do_5.f90 new file mode 100644 index 0000000..08cd8e6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/do_5.f90 @@ -0,0 +1,29 @@ +! { 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 |