From patchwork Fri Oct 14 02:04:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry DeLisle X-Patchwork-Id: 682091 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 3sw9s530F5z9s9N for ; Fri, 14 Oct 2016 13:04:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=cKMmEgwT; 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:cc :from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=LKnGivquMS8fzJ9s 4RDT9S8PItx9/25cFswCwhZ07D5/IuG+MK+oRhUx1MHha9Q3Q2epye3H6s12umfs /jj+tX1NG1hjloqRurJOaehSRu2R2zUt489I/RGDswIi6GjgXA8iYEgkoWHGRxrf /KNFk1w4+t8VB+tK0gb47A7m8zY= 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:cc :from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; s=default; bh=iIF5RCPOxZA0mXYek0KZcR PAiBY=; b=cKMmEgwTO3yafCBx4Z8JzJQDyw8C+77j0WghYDITUE3FS9FpsxWXfQ M/aR4QZcsJKlscf5Yk+/HaHmt8bnye+kgCC4uIvMzrUwg/s7RZE3GqSPmD9aGqGO i0D8cvasfoCFO9CFJzKcW88nFJI1rZAMGZSyY7hhC6/HoirktrFlc= Received: (qmail 124443 invoked by alias); 14 Oct 2016 02:04:19 -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 124357 invoked by uid 89); 14 Oct 2016 02:04:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:933, continued X-Spam-User: qpsmtpd, 2 recipients X-HELO: mtaout001-public.msg.strl.va.charter.net Received: from mtaout001-public.msg.strl.va.charter.net (HELO mtaout001-public.msg.strl.va.charter.net) (68.114.190.26) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Oct 2016 02:04:08 +0000 Received: from impout001 ([68.114.189.16]) by mtaout001.msg.strl.va.charter.net (InterMail vM.9.00.023.01 201-2473-194) with ESMTP id <20161014020406.WLKY7355.mtaout001.msg.strl.va.charter.net@impout001>; Thu, 13 Oct 2016 21:04:06 -0500 Received: from amda8.localdomain ([96.41.215.23]) by impout001 with charter.net id vE441t00C0Wrkg001E45uE; Thu, 13 Oct 2016 21:04:06 -0500 X-Authority-Analysis: v=2.1 cv=EKqI0jpC c=1 sm=1 tr=0 a=salB9WdMPIDduBH7JsZfrA==:117 a=salB9WdMPIDduBH7JsZfrA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=mDV3o1hIAAAA:8 a=kOkwgWyDB0WCbtBxhNQA:9 a=QEXdDO2ut3YA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Auth-id: anZkZWxpc2xlQGNoYXJ0ZXIubmV0 To: "fortran@gcc.gnu.org" Cc: GCC Patches From: Jerry DeLisle Subject: [patch, fortran] PR77972 ICE on broken character continuation with -Wall etc. Message-ID: <1a598dbd-e1c1-9596-016c-9ba5a1791d89@charter.net> Date: Thu, 13 Oct 2016 19:04:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 This patch is straight forward. We were sending bogus locus info to the diagnostics machinery and catch an assert in error,c. The patch avoids doing this. Regression tested on x86-64-linux. OK for trunk? Regards, Jerry 2016-10-13 Jerry DeLisle * scanner.c (gfc_next_char_literal): If nextc is null do not decrement the pointer and call the diagnostics. diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index be9c5091..5e355359 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -1414,10 +1414,9 @@ restart: if (c != '&') { - if (in_string) + if (in_string && gfc_current_locus.nextc) { - if (gfc_current_locus.nextc) - gfc_current_locus.nextc--; + gfc_current_locus.nextc--; if (warn_ampersand && in_string == INSTRING_WARN) gfc_warning (OPT_Wampersand, "Missing %<&%> in continued character "