From patchwork Thu Jun 4 09:46:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 480580 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 194701401B5 for ; Thu, 4 Jun 2015 19:46:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=StcX0Pnw; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=rhiGuMQynrzSErLmrAkR5sJUJBvrjT2fkFWgzYjSf1SwKz /MwbTZIViaA1d/f5OszcXyvdYzZKl0CSFXQeVjLs/ZHzwelhHwpNbgdKJ30UkTKY uEnCZNyn8syJbWuPH4J+cxW+KXCbYlzGWNc00wbVaKBag+2ykjXADJQMn00KI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=aXte3FK2w2L4/SJjTHATH7RsWck=; b=StcX0PnwTogNvc76+71C uV83oY7DlTK1Sd4IMiBBpn2nP0MK80eAJX9nK6/H7b3jGnze7Yl7EzqB1JEXNMap +nnPvwElVD3c+S15kZVInjPOWmoNLcixisV4VpuVBg4FcYFG399sQ9zX+4vN62g+ 1+MK+Y9eMsZFvlf+g9KohtA= Received: (qmail 3362 invoked by alias); 4 Jun 2015 09:46:32 -0000 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 Received: (qmail 3345 invoked by uid 89); 4 Jun 2015 09:46:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout1.netcologne.de Received: from cc-smtpout1.netcologne.de (HELO cc-smtpout1.netcologne.de) (89.1.8.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 04 Jun 2015 09:46:30 +0000 Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 83D3C12424; Thu, 4 Jun 2015 11:46:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin2.netcologne.de (Postfix) with ESMTP id 7E46B11DE7; Thu, 4 Jun 2015 11:46:26 +0200 (CEST) Received: from [78.35.178.88] (helo=cc-smtpin2.netcologne.de) by localhost with ESMTP (eXpurgate 4.0.7) (envelope-from ) id 55701e72-0b66-7f0000012729-7f0000018e57-1 for ; Thu, 04 Jun 2015 11:46:26 +0200 Received: from [192.168.178.20] (xdsl-78-35-178-88.netcologne.de [78.35.178.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA; Thu, 4 Jun 2015 11:46:25 +0200 (CEST) Message-ID: <55701E70.5090403@netcologne.de> Date: Thu, 04 Jun 2015 11:46:24 +0200 From: Thomas Koenig User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "fortran@gcc.gnu.org" , gcc-patches Subject: [patch, fortran] Fix PR 66385, array constructors in FORALL Hello world, front-end optimization and FORALL do not appear to mix well. This patch fixes an ICE resulting from an attempt by front-end optimization to use a BLOCK inside a FORALL statement. I will commit this as obvious in a day or so unless somebody objects. I will also backport (time to install the gcc 5 branch...) There would be an alternative, in principle, to put the BLOCK around the FORALL, but frankly, I don't think it is worth spending the effort and complicating the code. Regards Thomas 2015-06-11 Thomas Koenig PR fortran/66385 * frontend-passes.c (combine_array_constructor): Return early if inside a FORALL loop. 2015-06-11 Thomas Koenig PR fortran/66385 * gfortran.dg/forall_17.f90: New test. Index: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 223876) +++ frontend-passes.c (Arbeitskopie) @@ -1243,6 +1243,10 @@ combine_array_constructor (gfc_expr *e) if (in_assoc_list) return false; + /* With FORALL, the BLOCKS created by create_var will cause an ICE. */ + if (forall_level > 0) + return false; + op1 = e->value.op.op1; op2 = e->value.op.op2;