From patchwork Mon Apr 8 19:39:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 234873 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 668EB2C00A5 for ; Tue, 9 Apr 2013 05:39:31 +1000 (EST) 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=S2RBAlhNMbT5LlIhOQKFhdlhnmwnI8waSmM6cwR2Rrwcc1 kmC0Y1XF6tDkC4x8ZMmAHVlZShshAy5cyZCOkz8Qz9ac8R2PeC/NFAnnkQPggvL7 TjUDf/Xa5aSwa0srsNFQHO6wZIil2cBVGpdBQu7Wh/+JuK9q7kCbaROxyTOdA= 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=t2KfBm1PTGE9OH0wAzNzHDlAz20=; b=aaVDsj3lS/YQW8Wp2eSV +AQZbpF0gWEQmWJzbPTlPQ0jY9P0imPXd7OsbgdL6v8sEaFhv+0uXohfDeOyzSrH QEg6T3jqPcrXSk2SjKcuc0P5hYUK7alHHqie9dtdrGtuScr75/rH1Yc9Dk1hgUk/ 0e+8tRUfLkRh8pKcRI76bd8= Received: (qmail 29216 invoked by alias); 8 Apr 2013 19:39:17 -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 29197 invoked by uid 89); 8 Apr 2013 19:39:17 -0000 X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_NO, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from cc-smtpout1.netcologne.de (HELO cc-smtpout1.netcologne.de) (89.1.8.211) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 08 Apr 2013 19:39:11 +0000 Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 445D6124E6; Mon, 8 Apr 2013 21:39:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin2.netcologne.de (Postfix) with ESMTP id 3B10C11DBB; Mon, 8 Apr 2013 21:39:09 +0200 (CEST) Received: from [87.79.192.3] (helo=cc-smtpin2.netcologne.de) by localhost with ESMTP (eXpurgate 4.0.0) (envelope-from ) id 51631cdd-1149-7f0000012729-7f000001ba43-1 for ; Mon, 08 Apr 2013 21:39:09 +0200 Received: from [192.168.0.107] (xdsl-87-79-192-3.netcologne.de [87.79.192.3]) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA; Mon, 8 Apr 2013 21:39:07 +0200 (CEST) Message-ID: <51631CDB.9050008@netcologne.de> Date: Mon, 08 Apr 2013 21:39:07 +0200 From: Thomas Koenig User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: "fortran@gcc.gnu.org" , gcc-patches Subject: [patch, fortran] Committed fix for PR 56782 X-Virus-Found: No Hello world, I committed the attached patch as obvious to fix the regression with array constructors on trunk, after regression-testing. Will commit to 4.8 next. Thomas 2013-04-08 Thomas Koenig PR fortran/56782 * frontend-passes.c (callback_reduction): Dont't do any simplification if there is only a single element which has an iterator. 2013-04-08 Thomas Koenig PR fortran/56782 * gfortran.dg/array_constructor_44.f90: New test. Index: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 197233) +++ frontend-passes.c (Arbeitskopie) @@ -300,7 +300,12 @@ callback_reduction (gfc_expr **e, int *walk_subtre c = gfc_constructor_first (arg->value.constructor); - if (c == NULL) + /* Don't do any simplififcation if we have + - no element in the constructor or + - only have a single element in the array which contains an + iterator. */ + + if (c == NULL || (c->iterator != NULL && gfc_constructor_next (c) == NULL)) return 0; res = copy_walk_reduction_arg (c->expr, fn);