From patchwork Fri Feb 19 18:50:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 585381 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 BC59C14031D for ; Sat, 20 Feb 2016 05:51:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=q4LMjScr; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=GZ7flRs4kbS7BGL4U+QQen41TmtfpcgBBGrCW+yr1eS4wEHV34 MIEz27x78lNtL61BQy3quUrMRQ8OUywlMJu2OFLiWD9l0vWWa0Lt7eBwyTzoaxDX BIown586VfU9/RT7NhpvocQBoPecRV8mFv7KvwkBSaAdr9jLl6c8ryCs0= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=+0snFmX3j/9OxPrB4or/fqX5RGU=; b=q4LMjScr5FtK2ZHITPUy MahqA0b65fZ/OZiGytlMKA25ZCgWvT8KfPY1aApaKszrfqd2pxu7FcECej1oxK8b mnLcRanOK2SU8gMTqu66BBMSoWMg6AMiwM6OX1wTBdrNg7aIGnDj0vyFgVpjYYDc XWA86bZkYP049Lvc52kuBHE= Received: (qmail 38168 invoked by alias); 19 Feb 2016 18:51:04 -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 38096 invoked by uid 89); 19 Feb 2016 18:51:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*Ad:U*tkoenig, THEN, Hx-languages-length:1679, UD:frontend-passes.c X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout3.netcologne.de Received: from cc-smtpout3.netcologne.de (HELO cc-smtpout3.netcologne.de) (89.1.8.213) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 19 Feb 2016 18:51:02 +0000 Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id 82030125A6; Fri, 19 Feb 2016 19:50:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin3.netcologne.de (Postfix) with ESMTP id 7CD3011DFF; Fri, 19 Feb 2016 19:50:58 +0100 (CET) Received: from [78.35.153.203] (helo=cc-smtpin3.netcologne.de) by localhost with ESMTP (eXpurgate 4.0.9) (envelope-from ) id 56c76412-0b56-7f0000012729-7f00000195cb-1 for ; Fri, 19 Feb 2016 19:50:58 +0100 Received: from [192.168.178.20] (xdsl-78-35-153-203.netcologne.de [78.35.153.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cc-smtpin3.netcologne.de (Postfix) with ESMTPSA; Fri, 19 Feb 2016 19:50:57 +0100 (CET) To: gcc-patches , "fortran@gcc.gnu.org" From: Thomas Koenig Subject: [patch, Fortran] Fix PR fortran/68147, temporaries for allocatable strings Message-ID: <56C76410.30405@netcologne.de> Date: Fri, 19 Feb 2016 19:50:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Hello world, in the fix for PR 47674, there was a piece of unnecessary code which meant that allocatable string assignments did not get their temporary within IF statements (and others). This patch is really simple and obvious. If we weren't in tstage 4, I would simply commit it. Because allocatable strings are a major convenience for users, I would still like to commit this to trunk and to the affected branches. So, OK for these branches? Regards Thomas 2016-02-18 Thomas Koenig PR fortran/68147 PR fortran/47674 * frontend-passes.c (realloc_string_callbac): Don't set walk_subtrees. 2016-02-18 Thomas Koenig PR fortran/68147 PR fortran/47674 * gfortran.dg/realloc_on_assign_26.f90: New test case. Index: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 233474) +++ frontend-passes.c (Arbeitskopie) @@ -153,7 +153,7 @@ gfc_run_passes (gfc_namespace *ns) */ static int -realloc_string_callback (gfc_code **c, int *walk_subtrees, +realloc_string_callback (gfc_code **c, int *walk_subtrees ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED) { gfc_expr *expr1, *expr2; @@ -160,7 +160,6 @@ static int gfc_code *co = *c; gfc_expr *n; - *walk_subtrees = 0; if (co->op != EXEC_ASSIGN) return 0;