From patchwork Fri Nov 25 15:19:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 127711 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 167561007D5 for ; Sat, 26 Nov 2011 02:20:21 +1100 (EST) Received: (qmail 21109 invoked by alias); 25 Nov 2011 15:20:15 -0000 Received: (qmail 21025 invoked by uid 22791); 25 Nov 2011 15:20:14 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_TM X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Nov 2011 15:19:59 +0000 Received: from [192.168.178.22] (port-92-204-12-48.dynamic.qsc.de [92.204.12.48]) by mx01.qsc.de (Postfix) with ESMTP id A4E443CFCB; Fri, 25 Nov 2011 16:19:57 +0100 (CET) Message-ID: <4ECFB21C.3080600@net-b.de> Date: Fri, 25 Nov 2011 16:19:56 +0100 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran, committed] PR51302 - fix ICE with volatile loop variable Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Fixed the ICE: internal compiler error: in gfc_add_modify_loc, at fortran/trans.c:161 Build, regtested and committed (Rev. 181724 ) on x86-64-linux. Tobias Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (revision 181723) +++ gcc/fortran/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2011-11-25 Tobias Burnus + + PR fortran/51302 + * trans-stmt.c (gfc_trans_simple_do): Add a fold_convert. + 2011-11-24 Tobias Burnus PR fortran/51218 Index: gcc/fortran/trans-stmt.c =================================================================== --- gcc/fortran/trans-stmt.c (revision 181723) +++ gcc/fortran/trans-stmt.c (working copy) @@ -1259,7 +1259,8 @@ gfc_trans_simple_do (gfc_code * code, stmtblock_t loc = code->ext.iterator->start->where.lb->location; /* Initialize the DO variable: dovar = from. */ - gfc_add_modify_loc (loc, pblock, dovar, from); + gfc_add_modify_loc (loc, pblock, dovar, + fold_convert (TREE_TYPE(dovar), from)); /* Save value for do-tinkering checking. */ if (gfc_option.rtcheck & GFC_RTCHECK_DO) Index: gcc/testsuite/gfortran.dg/volatile13.f90 =================================================================== --- gcc/testsuite/gfortran.dg/volatile13.f90 (revision 0) +++ gcc/testsuite/gfortran.dg/volatile13.f90 (working copy) @@ -0,0 +1,11 @@ +! { dg-do compile } +! +! PR fortran/51302 +! +! Volatile DO variable - was ICEing before +! +integer, volatile :: i +integer :: n = 1 +do i = 1, n +end do +end Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (revision 181723) +++ gcc/testsuite/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2011-11-25 Tobias Burnus + + PR fortran/51302 + * gfortran.dg/volatile13.f90: New. + 2011-11-24 Andrew MacLeod PR c/51256