From patchwork Sun Dec 8 12:29:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 1205632 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515445-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=netcologne.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qEZDQHN8"; dkim=pass (2048-bit key; unprotected) header.d=netcologne.de header.i=@netcologne.de header.b="HpifoES/"; dkim-atps=neutral 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 47W5HH3nkBz9sP3 for ; Sun, 8 Dec 2019 23:29:29 +1100 (AEDT) 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=IzQOoUvlmYfflSWHrTfmUdLx6GdiEayxtgsBXG3d+h59d4FR1G PZQskEa+xO3/66Lc4+KSXxvRzD5Yezr/O2JXL7QKeKMluDNWPTIH2usWj+wBWObJ GmuFMdE2JhZR0IGSo8hrDTzZ10TxcRgKECWvBztBViRqCNeYgqKKuXczs= 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=skZTTlIuCJDMbpml3qRPjvmY7U4=; b=qEZDQHN8LTNceQJipNX/ X+L9upuhIma+61OGH7E1dQPPNUSnDkn1xDL1xNEf+7KUO2kZZUrm+isV93qyprlJ VPLsB9sZGLBzdfKr5/o2vT1yENZsmjmXAo9SSlaxXa8JZiK8Fhl43eEK2mevXUf0 YZUeRS4p18qBsYzfo5+Bo2Y= Received: (qmail 45869 invoked by alias); 8 Dec 2019 12:29: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 45853 invoked by uid 89); 8 Dec 2019 12:29:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= 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 ESMTP; Sun, 08 Dec 2019 12:29:14 +0000 Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 316D412FF9; Sun, 8 Dec 2019 13:29:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1575808152; bh=e0ItgbzUmVHt6G4+OlttmDZclbxy6SP4TYLU9375/lk=; h=To:From:Subject:Message-ID:Date:From; b=HpifoES/YTBlVPPbxnJr1EcrfhhGVCoqtEdjbIErhlxbLUlQVnLiQvOMK6fczsZZi OwnDZ0A5koI111P4Y1xL1HifxOrxcpPV0yFhW1kWSpQLOLV0GCIBPbO5udRrqQzHWo DA5uGqB7+8xSBthr7AqB6trTEIKd5ZVz3dCobbuZ7XQsWvyo3FBqdChoubBcF3eaea GShf3olGD6TynoF5najumPTKWPxeH2tQGPO21AsOcYYXTbe8SXfJTpSFDLUviUejRR ohq8r7McoV3EMY9ubJo3bvOwMHAS2rYeEoiPQMZ6oUBlZpnwZGdCaLyugxS2j9a48h tXGyE/9mwatGA== Received: from localhost (localhost [127.0.0.1]) by cc-smtpin2.netcologne.de (Postfix) with ESMTP id 234E611D8C; Sun, 8 Dec 2019 13:29:12 +0100 (CET) Received: from [2001:4dd7:c4e0:0:7285:c2ff:fe6c:992d] (helo=cc-smtpin2.netcologne.de) by localhost with ESMTP (eXpurgate 4.11.6) (envelope-from ) id 5decec98-3658-7f0000012729-7f000001e4b0-1 for ; Sun, 08 Dec 2019 13:29:12 +0100 Received: from [IPv6:2001:4dd7:c4e0:0:7285:c2ff:fe6c:992d] (2001-4dd7-c4e0-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2001:4dd7:c4e0:0:7285:c2ff:fe6c:992d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA; Sun, 8 Dec 2019 13:29:10 +0100 (CET) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran] Fix PR 92755 Message-ID: <115a92f4-7cad-79e6-7823-111fb6aab925@netcologne.de> Date: Sun, 8 Dec 2019 13:29:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 Hello world, In the fix for PR 91783, I had not considered the case that the _data ref could also be somewhere inside. The solution was obvious and simple: Move the check into the loop over the refs. Committed as r279086 after regression-testing. Regards Thomas 2019-12-08 Thomas Koenig PR fortran/92755 * dependency.c (gfc_dep_resolver): Move skipping of _data ref into the loop. 2019-12-08 Thomas Koenig PR fortran/92755 * gfortran.dg/dependency_57.f90: New test. Index: dependency.c =================================================================== --- dependency.c (Revision 279064) +++ dependency.c (Arbeitskopie) @@ -2098,18 +2098,6 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gf gfc_dependency this_dep; bool same_component = false; - /* The refs might come in mixed, one with a _data component and one - without. Look at their next reference in order to avoid an - ICE. */ - - if (lref && lref->type == REF_COMPONENT && lref->u.c.component - && strcmp (lref->u.c.component->name, "_data") == 0) - lref = lref->next; - - if (rref && rref->type == REF_COMPONENT && rref->u.c.component - && strcmp (rref->u.c.component->name, "_data") == 0) - rref = rref->next; - this_dep = GFC_DEP_ERROR; fin_dep = GFC_DEP_ERROR; /* Dependencies due to pointers should already have been identified. @@ -2117,6 +2105,18 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gf while (lref && rref) { + /* The refs might come in mixed, one with a _data component and one + without. Look at their next reference in order to avoid an + ICE. */ + + if (lref && lref->type == REF_COMPONENT && lref->u.c.component + && strcmp (lref->u.c.component->name, "_data") == 0) + lref = lref->next; + + if (rref && rref->type == REF_COMPONENT && rref->u.c.component + && strcmp (rref->u.c.component->name, "_data") == 0) + rref = rref->next; + /* We're resolving from the same base symbol, so both refs should be the same type. We traverse the reference chain until we find ranges that are not equal. */