* [Patch, Fortran] GCC 4.7 backport: PR54370 - ICE with non-default-kind logicals
@ 2013-06-06 16:46 Tobias Burnus
0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2013-06-06 16:46 UTC (permalink / raw)
To: gcc patches, gfortran
[-- Attachment #1: Type: text/plain, Size: 56 bytes --]
Committed as Rev. 199746 to the GCC 4.7 branch.
Tobias
[-- Attachment #2: committed.diff --]
[-- Type: text/x-patch, Size: 2461 bytes --]
Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog (Revision 199745)
+++ gcc/fortran/ChangeLog (Arbeitskopie)
@@ -1,3 +1,12 @@
+2013-06-06 Tobias Burnus <burnus@net-b.de>
+
+ Backport from mainline
+ 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.
+
2013-06-01 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
Index: gcc/fortran/trans-stmt.c
===================================================================
--- gcc/fortran/trans-stmt.c (Revision 199745)
+++ gcc/fortran/trans-stmt.c (Arbeitskopie)
@@ -1743,7 +1743,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);
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog (Revision 199745)
+++ gcc/testsuite/ChangeLog (Arbeitskopie)
@@ -1,3 +1,11 @@
+2013-06-06 Tobias Burnus <burnus@net-b.de>
+
+ Backport from mainline
+ 2012-08-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/54370
+ * gfortran.dg/do_5.f90: New.
+
2013-06-01 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
Index: gcc/testsuite/gfortran.dg/do_5.f90
===================================================================
--- gcc/testsuite/gfortran.dg/do_5.f90 (Revision 0)
+++ gcc/testsuite/gfortran.dg/do_5.f90 (Arbeitskopie)
@@ -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) ! { dg-warning "may not be a C interoperable kind but it is bind" }
+ L2 = .FALSE._8
+ END FUNCTION
+
+ SUBROUTINE S()
+ DO WHILE (L())
+ ENDDO
+ DO WHILE (L2())
+ ENDDO
+ END
+
+ END
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-06-06 16:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-06 16:46 [Patch, Fortran] GCC 4.7 backport: PR54370 - ICE with non-default-kind logicals Tobias Burnus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).