From patchwork Sat Jul 9 20:16:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 646699 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 3rn2gh6zzXz9sCg for ; Sun, 10 Jul 2016 06:16:31 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ISWLvTTf; 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=v+c1VM4hcBGcKdmNUdIT2MGefnVUjIj5NgoDZ21wcub8U+TPOz X6cEuEEd2/Q3E/nHFU6MMoksg1ijlFVVfhR6yV1u62sP2EdLmFnap4PHXpvyeEW5 kbxrLoirYznxVjGVNyfbSw5YYCPFIvoCfwB+psO3EIfLJJYY//EaY/v0s= 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=EERuXZAQnw5x2ku8LN6kxb4ba3E=; b=ISWLvTTfNmd4Xl5emJSo NN0COF46124Jx9aSCLttDybAtPJrzE4XSxnCNKZBHGGmMp3xxOMt25aoEIZ2w8ai Pm6Hh+U4EhryPi1rbXEWbpCap7lIXk+Z6NlY4P2rDanwC63fv7KcNe/ko7CeE+h4 p5jSuiEhWZkxjozCcT/Cw5E= Received: (qmail 130910 invoked by alias); 9 Jul 2016 20:16: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 130873 invoked by uid 89); 9 Jul 2016 20:16:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=2016-07-09 X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout2.netcologne.de Received: from cc-smtpout2.netcologne.de (HELO cc-smtpout2.netcologne.de) (89.1.8.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 09 Jul 2016 20:16:06 +0000 Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout2.netcologne.de (Postfix) with ESMTP id 8D571125D7; Sat, 9 Jul 2016 22:16:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin3.netcologne.de (Postfix) with ESMTP id 89CB411DF8; Sat, 9 Jul 2016 22:16:02 +0200 (CEST) Received: from [78.35.149.101] (helo=cc-smtpin3.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.8) (envelope-from ) id 57815b82-0bb0-7f0000012729-7f000001e855-1 for ; Sat, 09 Jul 2016 22:16:02 +0200 Received: from [192.168.178.20] (xdsl-78-35-149-101.netcologne.de [78.35.149.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cc-smtpin3.netcologne.de (Postfix) with ESMTPSA; Sat, 9 Jul 2016 22:16:01 +0200 (CEST) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran] Fix PR 71783 Message-ID: <57815B80.4010008@netcologne.de> Date: Sat, 9 Jul 2016 22:16:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 Hello world, this patch fixes the regression by always allocating a charlen. Why we still allocate a temporary even for obviously non-overlapping cases like the test case remains to be investigated. I'll open a separate PR for this. Regression-tested. OK for all affected branches? Regards Thomas 2016-07-09 Thomas Koenig PR fortran/71783 * frontend-passes.c (create_var): Always allocate a charlen for character variables. 2016-07-09 Thomas Koenig PR fortran/71783 * gfortran.dg/dependency_46.f90: New test. Index: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 237949) +++ frontend-passes.c (Arbeitskopie) @@ -665,12 +665,10 @@ create_var (gfc_expr * e, const char *vname) { gfc_expr *length; + symbol->ts.u.cl = gfc_new_charlen (ns, NULL); length = constant_string_length (e); if (length) - { - symbol->ts.u.cl = gfc_new_charlen (ns, NULL); - symbol->ts.u.cl->length = length; - } + symbol->ts.u.cl->length = length; else symbol->attr.allocatable = 1; }