From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16508 invoked by alias); 6 Jun 2013 16:46:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 16493 invoked by uid 89); 6 Jun 2013 16:46:13 -0000 X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 06 Jun 2013 16:45:42 +0000 Received: from archimedes.net-b.de (port-92-195-31-211.dynamic.qsc.de [92.195.31.211]) by mx02.qsc.de (Postfix) with ESMTP id D5C0424C54; Thu, 6 Jun 2013 18:45:39 +0200 (CEST) Message-ID: <51B0BCB2.8000502@net-b.de> Date: Thu, 06 Jun 2013 16:46:00 -0000 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran] GCC 4.7 backport: PR54370 - ICE with non-default-kind logicals Content-Type: multipart/mixed; boundary="------------010406020907080307090500" X-Virus-Found: No X-SW-Source: 2013-06/txt/msg00345.txt.bz2 This is a multi-part message in MIME format. --------------010406020907080307090500 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-length: 56 Committed as Rev. 199746 to the GCC 4.7 branch. Tobias --------------010406020907080307090500 Content-Type: text/x-patch; name="committed.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="committed.diff" Content-length: 2461 Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 199745) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,12 @@ +2013-06-06 Tobias Burnus + + Backport from mainline + 2012-08-27 Tobias Burnus + + 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 Tobias Burnus 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 + + Backport from mainline + 2012-08-27 Tobias Burnus + + PR fortran/54370 + * gfortran.dg/do_5.f90: New. + 2013-06-01 Janus Weil Tobias Burnus 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 --------------010406020907080307090500--