From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10756 invoked by alias); 5 Dec 2001 01:03:37 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10539 invoked from network); 5 Dec 2001 01:02:18 -0000 Received: from unknown (HELO mail.wrs.com) (147.11.1.11) by sources.redhat.com with SMTP; 5 Dec 2001 01:02:18 -0000 Received: from kankakee.wrs.com (kankakee [147.11.37.13]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id RAA18725; Tue, 4 Dec 2001 17:01:28 -0800 (PST) From: mike stump Received: (from mrs@localhost) by kankakee.wrs.com (8.9.3+Sun/8.9.0) id RAA06411; Tue, 4 Dec 2001 17:02:14 -0800 (PST) Date: Tue, 04 Dec 2001 17:03:00 -0000 Message-Id: <200112050102.RAA06411@kankakee.wrs.com> To: drow@mvista.com, neil@daikokuya.demon.co.uk Subject: Re: [c/4053] Re: problems debugging gcc Cc: danishsamad@yahoo.com, gcc-gnats@gcc.gnu.org, gcc@gcc.gnu.org X-SW-Source: 2001-12/txt/msg00196.txt.bz2 > Date: Tue, 4 Dec 2001 16:08:45 -0500 > From: Daniel Jacobowitz > To: Neil Booth > For the curious, this is the exact same problem as c/4053. > > This happens to me very frequently; I have no idea what causes it. I > > have a sneaking suspicion that this GCC bug is what the original post > > was about, though I'm not sure. > Well, it isn't in the debug format code; the file information in the > RTL is wrong. And there's nothing obviously incorrect about the code > in cb_file_change... > Aha, I think I see it. cb_file_change updates input_filename as it > reads. Compile the testcase from the PR with a breakpoint on > cb_file_change and a breakpoint on emit_line_note. If I had to guess, > I'd say that the problem was input_filename describing the state of the > lexer where it used to describe the state of the parser. In > c_expand_body is the line: > init_function_start (fndecl, input_filename, DECL_SOURCE_LINE (fndecl)); > DECL_SOURCE_LINE is fine. input_filename isn't. Ok, since you did all the hard work, test out the below, and let us know if it works. Could someone else run a dejagnu run on it, then we can submit it for inclusion. 2001-12-04 Mike Stump * c-decl.c (c_expand_body): Use the name of the file associated with the fndecl, not the current input filename. *** c-decl.c.~1~ Tue Dec 4 16:52:33 2001 --- c-decl.c Tue Dec 4 16:54:14 2001 *************** c_expand_body (fndecl, nested_p, can_def *** 6889,6895 **** /* Initialize the RTL code for the function. */ current_function_decl = fndecl; ! init_function_start (fndecl, input_filename, DECL_SOURCE_LINE (fndecl)); /* This function is being processed in whole-function mode. */ cfun->x_whole_function_mode_p = 1; --- 6889,6897 ---- /* Initialize the RTL code for the function. */ current_function_decl = fndecl; ! init_function_start (fndecl, ! DECL_SOURCE_FILE (fndecl), ! DECL_SOURCE_LINE (fndecl)); /* This function is being processed in whole-function mode. */ cfun->x_whole_function_mode_p = 1; --------------