From patchwork Mon Nov 7 19:37:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 81174 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1183909qge; Mon, 7 Nov 2016 11:38:27 -0800 (PST) X-Received: by 10.98.153.204 with SMTP id t73mr16302893pfk.144.1478547506655; Mon, 07 Nov 2016 11:38:26 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id vz10si27320509pab.271.2016.11.07.11.38.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 11:38:26 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-440664-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-440664-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-440664-patch=linaro.org@gcc.gnu.org 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=R2RTYW9UJ1LouRf0PfUSI/Q5eJ9T2YI5C1X55dwjfEoKyMhQhG 04qnbooSNLX5IOofyTHiYp/j07LxYmbO0lCpVJ8jMHwGpNF6AVrSpazBGZhiiV3k FBrXldk2bO5A1wEjFnANFilNreHLh4/mvj8eT9PLitzb2PjotiVle549g= 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=8GTdhQToZuU0x/f1WvrnpFlCDgE=; b=hXt+bi0xvSzyifEleifw hEZR/94Kd8T7e+TR0HAGbFkcI55pRrGx5tS80FY7qnCTkqKeGqMnjQGatduafd/c 116Rmw/HfLkAGUbxtJMkDvLbXBLMJaBa2OUV3ZsoFXyica5J/+YsvKuewKlrcy4A thGbmAvFWD6LmV16TdUVoJI= Received: (qmail 65571 invoked by alias); 7 Nov 2016 19:38: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 65542 invoked by uid 89); 7 Nov 2016 19:38:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=gfc_typespec, sk:gfc_fre, BT_DERIVED, bt_derived 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 ESMTP; Mon, 07 Nov 2016 19:37:53 +0000 Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout2.netcologne.de (Postfix) with ESMTP id A9D241298C; Mon, 7 Nov 2016 20:37:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id 9894711E38; Mon, 7 Nov 2016 20:37:48 +0100 (CET) Received: from [78.35.130.68] (helo=cc-smtpin1.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 5820d80c-0c14-7f0000012729-7f000001ed0e-1 for ; Mon, 07 Nov 2016 20:37:48 +0100 Received: from [192.168.178.20] (xdsl-78-35-130-68.netcologne.de [78.35.130.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA; Mon, 7 Nov 2016 20:37:47 +0100 (CET) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, committed, fortran] Final bug-fixing part of PR 78226 Message-ID: Date: Mon, 7 Nov 2016 20:37:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 OK, this is it (I hope). Finding the different parts where location information was missing is now complete (I hope), at least the testsuite passes with the addition of the warnings. I had a bit more time than expected today, so I split this up the way I did. I will submit a patch soon to always run the check for locus information when checking is enabled. Regards Thomas 2016-11-07 Thomas Koenig PR fortran/78226 * expr.c (gfc_generate_initializer): Add where to EXPR_NULL statement. * iresolve.c (gfc_resolve_extends_type_of): Add where to both arguments of the function. * resolve.c (resolve_select_type): Add where to the second argument of the new statement. Index: expr.c =================================================================== --- expr.c (Revision 241887) +++ expr.c (Arbeitskopie) @@ -4367,6 +4367,7 @@ gfc_generate_initializer (gfc_typespec *ts, bool g { ctor->expr = gfc_get_expr (); ctor->expr->expr_type = EXPR_NULL; + ctor->expr->where = init->where; ctor->expr->ts = comp->ts; } Index: iresolve.c =================================================================== --- iresolve.c (Revision 241887) +++ iresolve.c (Arbeitskopie) @@ -1044,9 +1044,12 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr gfc_add_vptr_component (a); else if (a->ts.type == BT_DERIVED) { + locus where; + vtab = gfc_find_derived_vtab (a->ts.u.derived); /* Clear the old expr. */ gfc_free_ref_list (a->ref); + where = a->where; memset (a, '\0', sizeof (gfc_expr)); /* Construct a new one. */ a->expr_type = EXPR_VARIABLE; @@ -1053,6 +1056,7 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr st = gfc_find_symtree (vtab->ns->sym_root, vtab->name); a->symtree = st; a->ts = vtab->ts; + a->where = where; } /* Replace the second argument with the corresponding vtab. */ @@ -1060,8 +1064,11 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr gfc_add_vptr_component (mo); else if (mo->ts.type == BT_DERIVED) { + locus where; + vtab = gfc_find_derived_vtab (mo->ts.u.derived); /* Clear the old expr. */ + where = mo->where; gfc_free_ref_list (mo->ref); memset (mo, '\0', sizeof (gfc_expr)); /* Construct a new one. */ @@ -1069,6 +1076,7 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr st = gfc_find_symtree (vtab->ns->sym_root, vtab->name); mo->symtree = st; mo->ts = vtab->ts; + mo->where = where; } f->ts.type = BT_LOGICAL; Index: resolve.c =================================================================== --- resolve.c (Revision 241909) +++ resolve.c (Arbeitskopie) @@ -8863,6 +8863,7 @@ resolve_select_type (gfc_code *code, gfc_namespace st = gfc_find_symtree (vtab->ns->sym_root, vtab->name); new_st->expr1->value.function.actual->next = gfc_get_actual_arglist (); new_st->expr1->value.function.actual->next->expr = gfc_get_variable_expr (st); + new_st->expr1->value.function.actual->next->expr->where = code->loc; new_st->next = body->next; } if (default_case->next)