public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <burnus@net-b.de>
To: gcc patches <gcc-patches@gcc.gnu.org>, gfortran <fortran@gcc.gnu.org>
Subject: [Patch, Fortran] GCC 4.7 backport: PR54370 - ICE with non-default-kind logicals
Date: Thu, 06 Jun 2013 16:46:00 -0000	[thread overview]
Message-ID: <51B0BCB2.8000502@net-b.de> (raw)

[-- 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

                 reply	other threads:[~2013-06-06 16:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51B0BCB2.8000502@net-b.de \
    --to=burnus@net-b.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).