From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81955 invoked by alias); 24 Mar 2016 21:25:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 81945 invoked by uid 89); 24 Mar 2016 21:25:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=UD:pr69650.c, pr69650.c, pr69650c, directivesc X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 24 Mar 2016 21:25:23 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id BC6C3804E6; Thu, 24 Mar 2016 21:25:21 +0000 (UTC) Received: from slagheap.utah.redhat.com (ovpn-113-52.phx2.redhat.com [10.3.113.52]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2OLPLgJ032088; Thu, 24 Mar 2016 17:25:21 -0400 Subject: Re: Fix 69650, bogus line numbers from libcpp To: Bernd Schmidt , Richard Biener References: <56E12FFF.6050800@t-online.de> <56E132FC.2030404@redhat.com> <1457734166.5425.43.camel@redhat.com> <56E6BAB1.6030804@redhat.com> <1458591323.9902.81.camel@redhat.com> <56F07CA0.5040607@redhat.com> <56F296D5.8050204@redhat.com> <56F405DB.1060600@redhat.com> Cc: David Malcolm , GCC Patches From: Jeff Law Message-ID: <56F45B40.4080405@redhat.com> Date: Thu, 24 Mar 2016 21:42:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56F405DB.1060600@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg01406.txt.bz2 On 03/24/2016 09:20 AM, Bernd Schmidt wrote: > > > On 03/23/2016 03:21 PM, Richard Biener wrote: >> On Wed, Mar 23, 2016 at 2:15 PM, Bernd Schmidt >> wrote: >>> On 03/23/2016 01:41 PM, Richard Biener wrote: >>>> >>>> Btw, the issue in the PR is also fixed with a simple >>>> >>>> Index: libcpp/line-map.c >>>> =================================================================== >>>> --- libcpp/line-map.c (revision 234415) >>>> +++ libcpp/line-map.c (working copy) >>>> @@ -543,7 +543,7 @@ linemap_add (struct line_maps *set, enum >>>> to_file); >>>> >>>> /* A TO_FILE of NULL is special - we use the natural >>>> values. */ >>>> - if (error || to_file == NULL) >>>> + if (to_file == NULL) >>>> { >>>> to_file = ORDINARY_MAP_FILE_NAME (from); >>>> to_line = SOURCE_LINE (from, from[1].start_location); >>> >>> >>> I looked at that, but that made it hard to add the testcase as the line >>> numbers no longer match the dg-error directives. By moving this code >>> we can >>> ignore the erroneous #line directive, and for this one testcase at >>> least, >>> that makes the line numbers (and caret diagnostics etc.) come out right. >> >> After some more digging and looking at your patch I'd approve that if >> it would >> emit a warning rather than an error - so can you please adjust it? > > Like this? No one has yet approved any better wording for the message, > so given that you said "it's not a regression" I've left it, but I would > now prefer "linemarker ignored due to incorrect nesting". > > > Bernd > > cpp-leave.diff > > > PR lto/69650 > * directives.c (do_linemarker): Test for file left but not entered > here. > * line-map.c (linemap_add): Not here. > > PR lto/69650 > * gcc.dg/pr69650.c: New test. OK. Also OK if you want to fixup the message. jeff