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: 692041 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 3tCN5d43slz9t1B for ; Tue, 8 Nov 2016 06:38:13 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="XxzvEZkW"; 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=nKNpXVf3bbqgGno0CSZRbwVM5qy4/B8LsHkLfKVt5/935xE80D PS9FGB5fLYwZ+vXVKliyHUF55BK0Uyf2NCA/dX0hkszGmwzZ2be/u7J72E/ea6kE Qkt5zdZZF9w0TqYmsP99O3dp7mJ9rMbLqkMCFYJKf5LK6nnFXD/1Dx0ck= 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=XxzvEZkWxvQ9DwfKjqGx KJgxgUfmjRHWvHaqcw4YZ+ufOh3S3M+Ndse7kz7dfAHT9vbYXT9FxXOEq9G/Y47N bbh/YYLDePC09kDEirRS5CGheOOgCb6W+Q/mlCtShlaQtMX4JNKov8v7b5cDZaz/ FSoSSUyJSPlicZ4l7eQYK8E= 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)