This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch that caused regression PR c/8602


On Wed, Jan 15, 2003 at 09:10:03AM -0800, Janis Johnson wrote:
> The bug is that a warning uses the incorrect line number for an
> inline function.  The PR has a small test case.

To a greater or lesser extent this is a problem with all warnings
that are generated by the optimizers, for all functions that get
deferred for later compilation.

This, I think, isn't so important as to lose sleep over it.  All
I'm willing to do about this is the following.  It's not exactly
the same as with gcc 2.95, as the generated locus is at the top of
the function, rather than the bottom.  It does, at least, get
your IDE to the right section of the right file.

This could be done better with the tree optimizers on tree-ssa
branch, as we won't have thrown away most of the line number
information yet.

Regression test still underway, to see if any of the dg tests 
wind up with their line numbers changed.


r~


	* integrate.c (output_inline_function): Reset input_filename
	and lineno from the decl before rest_of_compilation.

Index: integrate.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/integrate.c,v
retrieving revision 1.211
diff -c -p -d -r1.211 integrate.c
*** integrate.c	24 Jan 2003 22:45:56 -0000	1.211
--- integrate.c	25 Jan 2003 00:31:11 -0000
*************** output_inline_function (fndecl)
*** 3023,3028 ****
--- 3023,3033 ----
        debug_hooks = &do_nothing_debug_hooks;
      }
  
+   /* Make sure warnings emitted by the optimizers (e.g. control reaches
+      end of non-void function) is not wildly incorrect.  */
+   input_filename = DECL_SOURCE_FILE (fndecl);
+   lineno = DECL_SOURCE_LINE (fndecl);
+ 
    /* Compile this function all the way down to assembly code.  As a
       side effect this destroys the saved RTL representation, but
       that's okay, because we don't need to inline this anymore.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]