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]

[tree-ssa] Death to WFL nodes


[ Resent as it appears my outgoing mail to gcc.gnu.org was being
  dropped. ]

Wrapping nodes with EXPR_WITH_FILE_LOCATION nodes to carry file/line
information is rather expensive, ugly and simply doesn't work well.

Conceptually all we need is a mechanism to pass file/line information
provided by the front-end through the simplifiers, optimizers, etc
so that they can be turned into line number notes during the
tree->rtl conversion process.

I don't recall the exact numbers, but roughly 15% of all the nodes
created during a bootstrap of the tree-ssa branch were WFL nodes
(at 32 bytes each).  All those nodes disappear with this patch.

Additionally, 20% of the generated nodes were DECL nodes of some
sort -- each of those has a location_t field (8 bytes) which goes
away.

In the new scheme we have a pointer in tree_common which points to
the file/location information.  We have a single entry cache which
allows us to share that information across multiple nodes.  The
single entry cache has a hit rate of roughly 60%.

The Java front-end still has EXPR_WITH_FILE_LOCATION nodes, but they
are strictly contained in the Java front-end.  When we have a java->gimple
converter, it will need to transform EXPR_WITH_FILE_LOCATION nodes into
annotations of existing nodes (should be simple).  This will probably
save memory too as 30% of all the nodes generated by the Java front-end
are EXPR_WITH_FILE_LOCATION nodes!

The C++ Front-end used to use EXPR_WITH_FILE_LOCATION to implement
push/pop of template instantiation levels.  This is now done with
a TINST_DECL node.

The new scheme ultimately saves space (do the algebra if you're really
that interested), eliminates those pesky STRIP_WFL statements that
we seem to have spread everywhere, and simplifies the simplififer.

Even better the new scheme actually conveys correct line information
(the old code got it wrong).  So it actually *improves* testresults
when compared to the tree-ssa branch without this patch.


Anyway, I'll wait 48hrs to give Diego, Andrew, etc a chance to 
comment before I commit the changes.

	* c-aux-info.c: Replace DECL_SOURCE_FILE and DECL_SOURCE_LINE with
	TREE_FILENAME and TREE_LINENO respectively when retrieving file
	and line information.  Use TREE_LOCUS to copy existing information
	from one node to another.  Use annotate_with_file_line to add or
	replace location information on a node.  Remove support for
	EXPR_WITH_FILE_LOCATION nodes.  Remove STRIP_WFL statements.
	* c-common.c, c-parse.in, c-pretty-print.c, dbxout.c: Likewise.
	* diagnostic.c, dwarf2out.c, dwarfout.c: Likewise.
	* except.c, integrate.c, stmt.c, tree-alias-common.c: Likewise.
	* tree-cfg.c, tree-dfa.c, tree-dump.c, tree-flow-inline.h: Likewise.
	* tree-mudflap.c, tree-pretty-print.c, tree-simple.c: Likewise.
	* tree-ssa-ccp.c, tree-ssa-dce.c, tree-ssa-pre.c: Likewise.
	* varasm.c, xcoffout.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/mips/mips.c: Likewise.
	* c-decl.c: Likewise.
	(duplicate_decls): Also copy TREE_LOCUS from olddecl to newdecl.
	(finish_function): Save and restore the current filename and
	linenumber around genericizing of the function tree.
	* c-simplify.c (c_simplify_stmt): Use annotate_all_with_file_line
	instead of wrap_all_with_wfl.  Remove STRIP_WFL statements.
	* expr.c (expand_expr): Emit line number notes for expressions
	with attached file/line information.  Remove EXPR_WITH_FILE_LOCATION
	support.
	* gimplify.c: Kill STRIP_WFL statements.  Remove EXPR_WITH_FILE_LOCATION
	support.
	(simplify_expr_wfl): Kill.
	(annotate_stmt_with_file_line): Renamed from wrap_with_wfl.
	(annotate_all_with_file_line): Renamed from wrap_all_with_wfl.
	(simplify_expr): Save and restore the current file/line around
	simplification of the given expression.  Add annotation to more
	nodes created during simplification.
	(simplify_self_mod_expr): Add file/line location to nodes we create.
	(get_initialized_tmp_var): Similarly.
	* old-tree-inline.c (expand_call_inline): Use annotate_with_file_line
	to add file/line information to nodes instead of wrapping them
	with EXPR_WITH_FILE_LOCATION nodes.
	* print-tree.c: Use TREE_FILENAME and TREE_LINENO instead of
	DECL_SOURCE_FILE and DECL_SOURCE_LINE respectively.  Remove
	support for EXPR_WITH_FILE_LOCATION nodes.
	(print_node): Dump any file/line information that is attached to
	the given node.
	* tree-inline.c (walk_tree): Set lineno appropriately.
	* tree-simple.h (annotate_all_with_file_line): Renamed from
	wrap_all_with_wfl.  Remove STRIP_WFL statements.
	* tree.c (build_expr_wfl): Kill.
	(make_node): Use annotate_with_file_line.
	(annotate_with_file_line): New function.
	* tree.def: Remove EXPR_WITH_FILE_LOCATION.
	* tree.h (tree_common): Add locus field.  Remove references to
	EXPR_WITH_FILE_LOCATION.
	(tree_decl): Remove locus field.
	(STRIP_WFL, EXPR_WFL_*): Kill.
	(DECL_SOURCE_LOCATION, DECL_SOURCE_FILE, DECL_SOURCE_LINE): Kill.
	(TREE_LOCUS, TREE_FILENAME, TREE_LINENO): new.
	(annotate_with_file_line): Renamed from build_expr_wfl.

cp:

	* class.c: Use TREE_FILENAME and TREE_LINENO to extract
	file/line information from tree nodes.  Remove EXPR_WITH_FILE_LOCATION
	nodes.  Use annotate_with_file_line to attach file/line information
	to tree nodes.  Use TREE_LOCUS to copy file/line information
	from one node to another.
	* decl2.c, error.c, init.c, lex.c, method.c: Likewise.
	* optimize.c: Likewise.
	* cp-tree.def (TINST_LEVEL): New tree node.
	* cp-tree.h (TINST_DECL): Update now that we no longer use
	EXPR_WITH_FILE_LOCATION to represent the TINST_DECL information.
	(TINST_FILE, TINST_LINE): Kill.
	* decl.c: Use TREE_FILENAME and TREE_LINENO to extract
	file/line information from tree nodes.  Use annotate_witH_file_line
	to add file/line information to tree nodes.  Use TREE_LOCUS
	to copy file/line information from one node to another.
	(duplicate_decls): Make sure to copy TREE_LOCUS information
	from the old decl to the new decl.
	(finish_function): Save and restore file/line information
	around genericizing the function tree.
	* pt.c (lookup_template_class): Use TREE_LOCUS to copy file/line
	information from one node to another.
	(push_tinst_level): Generate a TINST_LEVEL node rather than 
	using EXPR_WITH_FILE_LOCATION nodes.  Use annotate_with_file_line
	to annotate the new node with file/line information.
	(pop_tinst_level): Use  TREE_LINENO and TREE_FILENAME to extract
	file/line information from nodes.
	(tsubst_friend_function, instantiate_class_template): Likewise.
	(tsubst_decl, instantiate_decl, tsubst_enum): Likewise.
	* semantics.c: Use annotate_with_file_line to annotate tree
	nodes with file/line information.  Use TREE_FILENAME and TREE_LINENO
	to extract file/line information from tree nodes.
	(expand_body): Restore file/line information slightly earlier.
	tree.c (cp_walk_subtrees): Set lineno appropriately.
	(cp_copy_res_decl_for_inlining): Use TREE_LOCUS to copy file/line
	information from one node to another.

Fortran:

	* com.c (duplicate_decls): Use TREE_FILENAME and TREE_LINENO
	to extract file/line information from nodes.  Use TREE_LOCUS
	to copy file/line information from one node to another.
	Make sure to copy TREE_LOCUS from the old decl to the new decl.
	(pushdecl): Similarly.
	* ste.c: Likewise.

Java:

	* class.c: Use TREE_FILENAME and TREE_LINENO to extract file/line
	information from tree nodes.  Use annotate_with_file_line to
	annotate tree nodes with file/line information.
	* decl.c, jcf-parse.c, jcf-write.c, parse.h: Likewise.
	* parse.y: Likewise.
	* expr.c (java_expand_expr): Handle EXPR_WITH_FILE_LOCATION nodes.
	(build_expr_wfl): New function.
	* java-tree.def (EXPR_WITH_FILE_LOCATION): New node.
	* java-tree.h (EXPR_WFL_*): New macros.
	(build_expr_wfl): Declare.


	
Objc:
	* objc-act.c: Use TREE_FILENAME and TREE_LINENO to 
	extract file/line information from tree nodes.

Treelang:

	* treetree.c (tree_code_create_function_prototype): Use
	annotate_with_file_line to annotate tree nodes with file/line
	information.  Use TREE_FILENAME and TREE_LINENO to extract file/line
	information from tree nodes.

Ada:
	* trans.c (tree_transform): Use annotate_with_file_line to add
	file/line information to nodes.
	(build_unit_elab): Use TREE_FILENAME and TREE_LINENO to 
	retrieve file/line information from a node.
	* utils.c (create_label_decl): Use annotate_with_file_line to
	add file/line information to nodes.
	

Index: gcc/c-aux-info.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-aux-info.c,v
retrieving revision 1.20.12.2
diff -c -3 -p -r1.20.12.2 c-aux-info.c
*** gcc/c-aux-info.c	3 Dec 2002 22:53:31 -0000	1.20.12.2
--- gcc/c-aux-info.c	11 Jan 2003 00:31:28 -0000
*************** gen_aux_info_record (fndecl, is_definiti
*** 584,591 ****
        /* Write the actual line of auxiliary info.  */
  
        fprintf (aux_info_file, "/* %s:%d:%c%c */ %s;",
! 	       DECL_SOURCE_FILE (fndecl),
! 	       DECL_SOURCE_LINE (fndecl),
  	       (is_implicit) ? 'I' : (is_prototyped) ? 'N' : 'O',
  	       (is_definition) ? 'F' : 'C',
  	       gen_decl (fndecl, is_definition, ansi));
--- 584,591 ----
        /* Write the actual line of auxiliary info.  */
  
        fprintf (aux_info_file, "/* %s:%d:%c%c */ %s;",
! 	       TREE_FILENAME (fndecl),
! 	       TREE_LINENO (fndecl),
  	       (is_implicit) ? 'I' : (is_prototyped) ? 'N' : 'O',
  	       (is_definition) ? 'F' : 'C',
  	       gen_decl (fndecl, is_definition, ansi));
Index: gcc/c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.344.2.20
diff -c -3 -p -r1.344.2.20 c-common.c
*** gcc/c-common.c	3 Jan 2003 01:57:17 -0000	1.344.2.20
--- gcc/c-common.c	11 Jan 2003 00:31:56 -0000
*************** shadow_warning (msgid, name, decl)
*** 5223,5230 ****
       tree name, decl;
  {
    warning ("declaration of `%s' shadows %s", IDENTIFIER_POINTER (name), 
msgid);
!   warning_with_file_and_line (DECL_SOURCE_FILE (decl),
! 			      DECL_SOURCE_LINE (decl),
  			      "shadowed declaration is here");
  }
  
--- 5223,5230 ----
       tree name, decl;
  {
    warning ("declaration of `%s' shadows %s", IDENTIFIER_POINTER (name), 
msgid);
!   warning_with_file_and_line (TREE_FILENAME (decl),
! 			      TREE_LINENO (decl),
  			      "shadowed declaration is here");
  }
  
Index: gcc/c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.334.2.32
diff -c -3 -p -r1.334.2.32 c-decl.c
*** gcc/c-decl.c	8 Jan 2003 03:01:05 -0000	1.334.2.32
--- gcc/c-decl.c	11 Jan 2003 00:32:23 -0000
*************** pop_label_level ()
*** 770,776 ****
      {
        if (C_DECLARED_LABEL_FLAG (TREE_VALUE (link)))
  	{
! 	  if (DECL_SOURCE_LINE (TREE_VALUE (link)) == 0)
  	    {
  	      error_with_decl (TREE_VALUE (link),
  			       "label `%s' used but not defined");
--- 770,776 ----
      {
        if (C_DECLARED_LABEL_FLAG (TREE_VALUE (link)))
  	{
! 	  if (TREE_LINENO (TREE_VALUE (link)) == 0)
  	    {
  	      error_with_decl (TREE_VALUE (link),
  			       "label `%s' used but not defined");
*************** duplicate_decls (newdecl, olddecl, diffe
*** 1055,1061 ****
  	}
      }
    else if (TREE_CODE (olddecl) == FUNCTION_DECL
! 	   && DECL_SOURCE_LINE (olddecl) == 0)
      {
        /* A function declaration for a predeclared function
  	 that isn't actually built in.  */
--- 1055,1061 ----
  	}
      }
    else if (TREE_CODE (olddecl) == FUNCTION_DECL
! 	   && TREE_LINENO (olddecl) == 0)
      {
        /* A function declaration for a predeclared function
  	 that isn't actually built in.  */
*************** duplicate_decls (newdecl, olddecl, diffe
*** 1296,1302 ****
      }
  
    /* Optionally warn about more than one declaration for the same name.  */
!   if (errmsg == 0 && warn_redundant_decls && DECL_SOURCE_LINE (olddecl) != 0
        /* Don't warn about a function declaration
  	 followed by a definition.  */
        && !(TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) != 
0
--- 1296,1302 ----
      }
  
    /* Optionally warn about more than one declaration for the same name.  */
!   if (errmsg == 0 && warn_redundant_decls && TREE_LINENO (olddecl) != 0
        /* Don't warn about a function declaration
  	 followed by a definition.  */
        && !(TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) != 
0
*************** duplicate_decls (newdecl, olddecl, diffe
*** 1392,1401 ****
  	 information so that meaningful diagnostics can be given.  */
        if (DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0
  	  && ! different_binding_level)
! 	{
! 	  DECL_SOURCE_LINE (newdecl) = DECL_SOURCE_LINE (olddecl);
! 	  DECL_SOURCE_FILE (newdecl) = DECL_SOURCE_FILE (olddecl);
! 	}
  
        /* Merge the unused-warning information.  */
        if (DECL_IN_SYSTEM_HEADER (olddecl))
--- 1392,1398 ----
  	 information so that meaningful diagnostics can be given.  */
        if (DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0
  	  && ! different_binding_level)
! 	TREE_LOCUS (newdecl) = TREE_LOCUS (olddecl);
  
        /* Merge the unused-warning information.  */
        if (DECL_IN_SYSTEM_HEADER (olddecl))
*************** duplicate_decls (newdecl, olddecl, diffe
*** 1571,1576 ****
--- 1568,1574 ----
  	    (char *) newdecl + sizeof (struct tree_common),
  	    sizeof (struct tree_decl) - sizeof (struct tree_common));
      DECL_UID (olddecl) = olddecl_uid;
+     TREE_LOCUS (olddecl) = TREE_LOCUS (newdecl);
    }
  
    /* NEWDECL contains the merged attribute lists.
*************** warn_if_shadowing (x, oldlocal)
*** 1614,1620 ****
    /* Maybe warn if shadowing something else.  */
    else if (warn_shadow
  	   /* No shadow warnings for internally generated vars.  */
! 	   && DECL_SOURCE_LINE (x) != 0
  	   /* No shadow warnings for vars made for inlining.  */
  	   && ! DECL_FROM_INLINE (x))
      {
--- 1612,1618 ----
    /* Maybe warn if shadowing something else.  */
    else if (warn_shadow
  	   /* No shadow warnings for internally generated vars.  */
! 	   && TREE_LINENO (x) != 0
  	   /* No shadow warnings for vars made for inlining.  */
  	   && ! DECL_FROM_INLINE (x))
      {
*************** pushdecl (x)
*** 1715,1722 ****
  	  pedwarn ("`%s' was declared implicitly `extern' and later `static'",
  		   IDENTIFIER_POINTER (name));
  	  pedwarn_with_file_and_line
! 	    (DECL_SOURCE_FILE (IDENTIFIER_IMPLICIT_DECL (name)),
! 	     DECL_SOURCE_LINE (IDENTIFIER_IMPLICIT_DECL (name)),
  	     "previous declaration of `%s'",
  	     IDENTIFIER_POINTER (name));
  	  TREE_THIS_VOLATILE (name) = 1;
--- 1713,1720 ----
  	  pedwarn ("`%s' was declared implicitly `extern' and later `static'",
  		   IDENTIFIER_POINTER (name));
  	  pedwarn_with_file_and_line
! 	    (TREE_FILENAME (IDENTIFIER_IMPLICIT_DECL (name)),
! 	     TREE_LINENO (IDENTIFIER_IMPLICIT_DECL (name)),
  	     "previous declaration of `%s'",
  	     IDENTIFIER_POINTER (name));
  	  TREE_THIS_VOLATILE (name) = 1;
*************** pushdecl (x)
*** 1779,1785 ****
  
        if (TREE_CODE (x) == TYPE_DECL)
  	{
! 	  if (DECL_SOURCE_LINE (x) == 0)
  	    {
  	      if (TYPE_NAME (TREE_TYPE (x)) == 0)
  		TYPE_NAME (TREE_TYPE (x)) = x;
--- 1777,1783 ----
  
        if (TREE_CODE (x) == TYPE_DECL)
  	{
! 	  if (TREE_LINENO (x) == 0)
  	    {
  	      if (TYPE_NAME (TREE_TYPE (x)) == 0)
  		TYPE_NAME (TREE_TYPE (x)) = x;
*************** lookup_label (id)
*** 2204,2211 ****
  
    /* Say where one reference is to the label,
       for the sake of the error if it is not defined.  */
!   DECL_SOURCE_LINE (decl) = lineno;
!   DECL_SOURCE_FILE (decl) = input_filename;
  
    IDENTIFIER_LABEL_VALUE (id) = decl;
  
--- 2202,2208 ----
  
    /* Say where one reference is to the label,
       for the sake of the error if it is not defined.  */
!   annotate_with_file_line (decl, input_filename, lineno);
  
    IDENTIFIER_LABEL_VALUE (id) = decl;
  
*************** define_label (filename, line, name)
*** 2288,2295 ****
        /* Mark label as having been defined.  */
        DECL_INITIAL (decl) = error_mark_node;
        /* Say where in the source.  */
!       DECL_SOURCE_FILE (decl) = filename;
!       DECL_SOURCE_LINE (decl) = line;
        return decl;
      }
  }
--- 2285,2291 ----
        /* Mark label as having been defined.  */
        DECL_INITIAL (decl) = error_mark_node;
        /* Say where in the source.  */
!       annotate_with_file_line (decl, filename, line);
        return decl;
      }
  }
*************** start_function (declspecs, declarator, a
*** 5749,5756 ****
        && TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0)
      {
        TREE_TYPE (decl1) = TREE_TYPE (old_decl);
!       current_function_prototype_file = DECL_SOURCE_FILE (old_decl);
!       current_function_prototype_line = DECL_SOURCE_LINE (old_decl);
      }
  
    /* If there is no explicit declaration, look for any out-of-scope implicit
--- 5745,5752 ----
        && TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0)
      {
        TREE_TYPE (decl1) = TREE_TYPE (old_decl);
!       current_function_prototype_file = TREE_FILENAME (old_decl);
!       current_function_prototype_line = TREE_LINENO (old_decl);
      }
  
    /* If there is no explicit declaration, look for any out-of-scope implicit
*************** store_parm_decls ()
*** 6099,6106 ****
  	      found = build_decl (PARM_DECL, TREE_VALUE (parm),
  				  integer_type_node);
  	      DECL_ARG_TYPE (found) = TREE_TYPE (found);
! 	      DECL_SOURCE_LINE (found) = DECL_SOURCE_LINE (fndecl);
! 	      DECL_SOURCE_FILE (found) = DECL_SOURCE_FILE (fndecl);
  	      if (flag_isoc99)
  		pedwarn_with_decl (found, "type of `%s' defaults to `int'");
  	      else if (extra_warnings)
--- 6095,6101 ----
  	      found = build_decl (PARM_DECL, TREE_VALUE (parm),
  				  integer_type_node);
  	      DECL_ARG_TYPE (found) = TREE_TYPE (found);
! 	      TREE_LOCUS (found) = TREE_LOCUS (fndecl);
  	      if (flag_isoc99)
  		pedwarn_with_decl (found, "type of `%s' defaults to `int'");
  	      else if (extra_warnings)
*************** finish_function (nested, can_defer_p)
*** 6347,6352 ****
--- 6342,6349 ----
       int can_defer_p;
  {
    tree fndecl = current_function_decl;
+   int saved_lineno;
+   const char *saved_filename;
  
  #if 0
    /* This caused &foo to be of type ptr-to-const-function which then
*************** finish_function (nested, can_defer_p)
*** 6403,6408 ****
--- 6400,6411 ----
        && DECL_INLINE (fndecl))
      warning ("no return statement in function returning non-void");
  
+   /* Genericizing can change the current line number and filename.
+      We need to save/restore so that we can emit the proper line
+      note for the end of the function later.  */
+   saved_lineno = lineno;
+   saved_filename = input_filename;
+ 
    /* Genericize before inlining.  */
    if (!flag_disable_simple)
      c_genericize (fndecl);
*************** finish_function (nested, can_defer_p)
*** 6414,6419 ****
--- 6417,6426 ----
    free_after_compilation (cfun);
    cfun = NULL;
  
+   /* Restore file and line information.  */
+   lineno = saved_lineno;
+   input_filename = saved_filename;
+ 
    if (! nested)
      {
        /* Generate RTL for the body of this function.  */
*************** c_expand_body (fndecl, nested_p, can_def
*** 6507,6515 ****
  
    /* Initialize the RTL code for the function.  */
    current_function_decl = fndecl;
!   input_filename = DECL_SOURCE_FILE (fndecl);
    make_decl_rtl (fndecl, NULL);
!   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;
--- 6514,6522 ----
  
    /* Initialize the RTL code for the function.  */
    current_function_decl = fndecl;
!   input_filename = TREE_FILENAME (fndecl);
    make_decl_rtl (fndecl, NULL);
!   init_function_start (fndecl, input_filename, TREE_LINENO (fndecl));
  
    /* This function is being processed in whole-function mode.  */
    cfun->x_whole_function_mode_p = 1;
Index: gcc/c-parse.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-parse.in,v
retrieving revision 1.144.2.7
diff -c -3 -p -r1.144.2.7 c-parse.in
*** gcc/c-parse.in	3 Dec 2002 22:53:34 -0000	1.144.2.7
--- gcc/c-parse.in	11 Jan 2003 00:32:27 -0000
*************** fndef:
*** 438,445 ****
  	  old_style_parm_decls
  		{ store_parm_decls (); }
  	  save_filename save_lineno compstmt_or_error
! 		{ DECL_SOURCE_FILE (current_function_decl) = $7;
! 		  DECL_SOURCE_LINE (current_function_decl) = $8;
  		  finish_function (0, 1);
  		  POP_DECLSPEC_STACK; }
  	| declspecs_ts setspecs declarator error
--- 438,444 ----
  	  old_style_parm_decls
  		{ store_parm_decls (); }
  	  save_filename save_lineno compstmt_or_error
! 		{ annotate_with_file_line (current_function_decl, $7, $8);
  		  finish_function (0, 1);
  		  POP_DECLSPEC_STACK; }
  	| declspecs_ts setspecs declarator error
*************** fndef:
*** 452,459 ****
  	  old_style_parm_decls
  		{ store_parm_decls (); }
  	  save_filename save_lineno compstmt_or_error
! 		{ DECL_SOURCE_FILE (current_function_decl) = $7;
! 		  DECL_SOURCE_LINE (current_function_decl) = $8;
  		  finish_function (0, 1);
  		  POP_DECLSPEC_STACK; }
  	| declspecs_nots setspecs notype_declarator error
--- 451,457 ----
  	  old_style_parm_decls
  		{ store_parm_decls (); }
  	  save_filename save_lineno compstmt_or_error
! 		{ annotate_with_file_line (current_function_decl, $7, $8);
  		  finish_function (0, 1);
  		  POP_DECLSPEC_STACK; }
  	| declspecs_nots setspecs notype_declarator error
*************** fndef:
*** 466,473 ****
  	  old_style_parm_decls
  		{ store_parm_decls (); }
  	  save_filename save_lineno compstmt_or_error
! 		{ DECL_SOURCE_FILE (current_function_decl) = $6;
! 		  DECL_SOURCE_LINE (current_function_decl) = $7;
  		  finish_function (0, 1);
  		  POP_DECLSPEC_STACK; }
  	| setspecs notype_declarator error
--- 464,470 ----
  	  old_style_parm_decls
  		{ store_parm_decls (); }
  	  save_filename save_lineno compstmt_or_error
! 		{ annotate_with_file_line (current_function_decl, $6, $7);
  		  finish_function (0, 1);
  		  POP_DECLSPEC_STACK; }
  	| setspecs notype_declarator error
*************** nested_function:
*** 1604,1611 ****
     which called YYERROR1 again, and so on.  */
  	  save_filename save_lineno compstmt
  		{ tree decl = current_function_decl;
! 		  DECL_SOURCE_FILE (decl) = $5;
! 		  DECL_SOURCE_LINE (decl) = $6;
  		  finish_function (1, 1);
  		  pop_function_context ();
  		  add_decl_stmt (decl); }
--- 1601,1607 ----
     which called YYERROR1 again, and so on.  */
  	  save_filename save_lineno compstmt
  		{ tree decl = current_function_decl;
! 		  annotate_with_file_line (decl, $5, $6);
  		  finish_function (1, 1);
  		  pop_function_context ();
  		  add_decl_stmt (decl); }
*************** notype_nested_function:
*** 1635,1642 ****
     which called YYERROR1 again, and so on.  */
  	  save_filename save_lineno compstmt
  		{ tree decl = current_function_decl;
! 		  DECL_SOURCE_FILE (decl) = $5;
! 		  DECL_SOURCE_LINE (decl) = $6;
  		  finish_function (1, 1);
  		  pop_function_context ();
  		  add_decl_stmt (decl); }
--- 1631,1637 ----
     which called YYERROR1 again, and so on.  */
  	  save_filename save_lineno compstmt
  		{ tree decl = current_function_decl;
! 		  annotate_with_file_line (decl, $5, $6);
  		  finish_function (1, 1);
  		  pop_function_context ();
  		  add_decl_stmt (decl); }
Index: gcc/c-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-pretty-print.c,v
retrieving revision 1.1.4.19
diff -c -3 -p -r1.1.4.19 c-pretty-print.c
*** gcc/c-pretty-print.c	3 Jan 2003 01:57:18 -0000	1.1.4.19
--- gcc/c-pretty-print.c	11 Jan 2003 00:32:35 -0000
*************** dump_c_node (buffer, node, spc, brief_du
*** 567,573 ****
        break;
  
      case TYPE_DECL:
!       if (strcmp (DECL_SOURCE_FILE (node), "<built-in>") == 0)
  	{
  	  /* Don't print the declaration of built-in types.  */
  	  break;
--- 567,573 ----
        break;
  
      case TYPE_DECL:
!       if (strcmp (TREE_FILENAME (node), "<built-in>") == 0)
  	{
  	  /* Don't print the declaration of built-in types.  */
  	  break;
*************** dump_c_node (buffer, node, spc, brief_du
*** 1172,1181 ****
        output_add_string (buffer, ">>>");
        break;
  
-     case EXPR_WITH_FILE_LOCATION:
-       dump_c_node (buffer, TREE_OPERAND (node, 0), spc, brief_dump);
-       break;
- 
      case EXC_PTR_EXPR:
        NIY;
        break;
--- 1172,1177 ----
*************** op_prio (op)
*** 1815,1823 ****
      case NON_LVALUE_EXPR:
        return op_prio (TREE_OPERAND (op, 0));
  
-     case EXPR_WITH_FILE_LOCATION:
-       return op_prio (EXPR_WFL_NODE (op));
- 
      default:
        /* If OP is any type of expression operator, abort because we
  	 should know what its relative precedence is.  Otherwise, return
--- 1811,1816 ----
*************** print_call_name (buffer, node)
*** 1981,1993 ****
      case INDIRECT_REF:
      case NOP_EXPR:
        dump_c_node (buffer, TREE_OPERAND (op0, 0), 0, 0);
-       break;
- 
-     case EXPR_WITH_FILE_LOCATION:
-       if (TREE_CODE (TREE_OPERAND (op0, 0)) == VAR_DECL)
-         PRINT_FUNCTION_NAME (TREE_OPERAND (op0, 0));
-       else
- 	dump_c_node (buffer, TREE_OPERAND (op0, 0), 0, 0);
        break;
      
      case COND_EXPR:
--- 1974,1979 ----
Index: gcc/c-simplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/c-simplify.c,v
retrieving revision 1.1.4.36
diff -c -3 -p -r1.1.4.36 c-simplify.c
*** gcc/c-simplify.c	3 Jan 2003 01:57:18 -0000	1.1.4.36
--- gcc/c-simplify.c	11 Jan 2003 00:32:37 -0000
*************** c_simplify_stmt (stmt_p)
*** 300,306 ****
        add_tree (stmt, &pre);
        add_tree (post, &pre);
        pre = rationalize_compound_expr (pre);
!       wrap_all_with_wfl (&pre, stmt_filename, stmt_lineno);
  
        add_tree (pre, &outer_pre);
      cont:
--- 300,306 ----
        add_tree (stmt, &pre);
        add_tree (post, &pre);
        pre = rationalize_compound_expr (pre);
!       annotate_all_with_file_line (&pre, stmt_filename, stmt_lineno);
  
        add_tree (pre, &outer_pre);
      cont:
*************** simplify_c_loop (cond, body, incr, cond_
*** 615,621 ****
        add_tree (exit, &stuff);
      }
  
!   wrap_all_with_wfl (&stuff, stmt_filename, stmt_lineno);
  
    LOOP_EXPR_BODY (loop) = rationalize_compound_expr (stuff);
  
--- 615,621 ----
        add_tree (exit, &stuff);
      }
  
!   annotate_all_with_file_line (&stuff, stmt_filename, stmt_lineno);
  
    LOOP_EXPR_BODY (loop) = rationalize_compound_expr (stuff);
  
*************** simplify_stmt_expr (expr_p)
*** 897,903 ****
        if (!STMT_EXPR_NO_SCOPE (*expr_p))
  	{
  	  bind = body;
- 	  STRIP_WFL (bind);
  	  substmt = BIND_EXPR_BODY (bind);
  	}
        else
--- 897,902 ----
Index: gcc/dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.123.2.7
diff -c -3 -p -r1.123.2.7 dbxout.c
*** gcc/dbxout.c	17 Dec 2002 20:46:36 -0000	1.123.2.7
--- gcc/dbxout.c	11 Jan 2003 00:32:46 -0000
*************** dbxout_prepare_symbol (decl)
*** 2494,2500 ****
       tree decl ATTRIBUTE_UNUSED;
  {
  #ifdef WINNING_GDB
!   const char *filename = DECL_SOURCE_FILE (decl);
  
    dbxout_source_file (asmfile, filename);
  #endif
--- 2494,2500 ----
       tree decl ATTRIBUTE_UNUSED;
  {
  #ifdef WINNING_GDB
!   const char *filename = TREE_FILENAME (decl);
  
    dbxout_source_file (asmfile, filename);
  #endif
*************** dbxout_finish_symbol (sym)
*** 2509,2515 ****
  #else
    int line = 0;
    if (use_gnu_debug_info_extensions && sym != 0)
!     line = DECL_SOURCE_LINE (sym);
  
    fprintf (asmfile, "\",%d,0,%d,", current_sym_code, line);
    if (current_sym_addr)
--- 2509,2515 ----
  #else
    int line = 0;
    if (use_gnu_debug_info_extensions && sym != 0)
!     line = TREE_LINENO (sym);
  
    fprintf (asmfile, "\",%d,0,%d,", current_sym_code, line);
    if (current_sym_addr)
Index: gcc/diagnostic.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/diagnostic.c,v
retrieving revision 1.91.2.12
diff -c -3 -p -r1.91.2.12 diagnostic.c
*** gcc/diagnostic.c	3 Dec 2002 22:53:50 -0000	1.91.2.12
--- gcc/diagnostic.c	11 Jan 2003 00:33:01 -0000
*************** pedwarn_with_decl VPARAMS ((tree decl, c
*** 984,990 ****
    VA_FIXEDARG (ap, const char *, msgid);
  
    diagnostic_set_info (&diagnostic, _(msgid), &ap,
!                        DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
                         pedantic_error_kind ());
  
    /* We don't want -pedantic-errors to cause the compilation to fail from
--- 984,990 ----
    VA_FIXEDARG (ap, const char *, msgid);
  
    diagnostic_set_info (&diagnostic, _(msgid), &ap,
!                        TREE_FILENAME (decl), TREE_LINENO (decl),
                         pedantic_error_kind ());
  
    /* We don't want -pedantic-errors to cause the compilation to fail from
*************** error_with_decl VPARAMS ((tree decl, con
*** 1126,1132 ****
    VA_FIXEDARG (ap, const char *, msgid);
  
    diagnostic_set_info (&diagnostic, msgid, &ap,
!                        DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
                         DK_ERROR);
    diagnostic_for_decl (&diagnostic, decl);
    VA_CLOSE (ap);
--- 1126,1132 ----
    VA_FIXEDARG (ap, const char *, msgid);
  
    diagnostic_set_info (&diagnostic, msgid, &ap,
!                        TREE_FILENAME (decl), TREE_LINENO (decl),
                         DK_ERROR);
    diagnostic_for_decl (&diagnostic, decl);
    VA_CLOSE (ap);
*************** warning_with_decl VPARAMS ((tree decl, c
*** 1229,1235 ****
    VA_FIXEDARG (ap, const char *, msgid);
  
    diagnostic_set_info (&diagnostic, msgid, &ap,
!                        DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
                         DK_WARNING);
    diagnostic_for_decl (&diagnostic, decl);
    VA_CLOSE (ap);
--- 1229,1235 ----
    VA_FIXEDARG (ap, const char *, msgid);
  
    diagnostic_set_info (&diagnostic, msgid, &ap,
!                        TREE_FILENAME (decl), TREE_LINENO (decl),
                         DK_WARNING);
    diagnostic_for_decl (&diagnostic, decl);
    VA_CLOSE (ap);
*************** warn_deprecated_use (node)
*** 1437,1443 ****
    if (DECL_P (node))
      warning ("`%s' is deprecated (declared at %s:%d)",
  	     IDENTIFIER_POINTER (DECL_NAME (node)),
! 	     DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
    else if (TYPE_P (node))
      {
        const char *what = NULL;
--- 1437,1443 ----
    if (DECL_P (node))
      warning ("`%s' is deprecated (declared at %s:%d)",
  	     IDENTIFIER_POINTER (DECL_NAME (node)),
! 	     TREE_FILENAME (node), TREE_LINENO (node));
    else if (TYPE_P (node))
      {
        const char *what = NULL;
*************** warn_deprecated_use (node)
*** 1453,1465 ****
  	{
  	  if (decl)
  	    warning ("`%s' is deprecated (declared at %s:%d)", what,
! 		     DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
  	  else
  	    warning ("`%s' is deprecated", what);
  	}
        else if (decl)
  	warning ("type is deprecated (declared at %s:%d)",
! 		 DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
        else
  	warning ("type is deprecated");
      }
--- 1453,1465 ----
  	{
  	  if (decl)
  	    warning ("`%s' is deprecated (declared at %s:%d)", what,
! 		     TREE_FILENAME (decl), TREE_LINENO (decl));
  	  else
  	    warning ("`%s' is deprecated", what);
  	}
        else if (decl)
  	warning ("type is deprecated (declared at %s:%d)",
! 		 TREE_FILENAME (decl), TREE_LINENO (decl));
        else
  	warning ("type is deprecated");
      }
Index: gcc/dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.379.2.12
diff -c -3 -p -r1.379.2.12 dwarf2out.c
*** gcc/dwarf2out.c	3 Dec 2002 22:53:51 -0000	1.379.2.12
--- gcc/dwarf2out.c	11 Jan 2003 00:33:40 -0000
*************** add_src_coords_attributes (die, decl)
*** 9910,9919 ****
       dw_die_ref die;
       tree decl;
  {
!   unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl));
  
    add_AT_unsigned (die, DW_AT_decl_file, file_index);
!   add_AT_unsigned (die, DW_AT_decl_line, DECL_SOURCE_LINE (decl));
  }
  
  /* Add an DW_AT_name attribute and source coordinate attribute for the
--- 9910,9919 ----
       dw_die_ref die;
       tree decl;
  {
!   unsigned file_index = lookup_filename (TREE_FILENAME (decl));
  
    add_AT_unsigned (die, DW_AT_decl_file, file_index);
!   add_AT_unsigned (die, DW_AT_decl_line, TREE_LINENO (decl));
  }
  
  /* Add an DW_AT_name attribute and source coordinate attribute for the
*************** gen_subprogram_die (decl, context_die)
*** 10637,10643 ****
      }
    else if (old_die)
      {
!       unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl));
  
        if (!get_AT_flag (old_die, DW_AT_declaration)
  	  /* We can have a normal definition following an inline one in the
--- 10637,10643 ----
      }
    else if (old_die)
      {
!       unsigned file_index = lookup_filename (TREE_FILENAME (decl));
  
        if (!get_AT_flag (old_die, DW_AT_declaration)
  	  /* We can have a normal definition following an inline one in the
*************** gen_subprogram_die (decl, context_die)
*** 10666,10672 ****
  	  && (DECL_ARTIFICIAL (decl)
  	      || (get_AT_unsigned (old_die, DW_AT_decl_file) == file_index
  		  && (get_AT_unsigned (old_die, DW_AT_decl_line)
! 		      == (unsigned) DECL_SOURCE_LINE (decl)))))
  	{
  	  subr_die = old_die;
  
--- 10666,10672 ----
  	  && (DECL_ARTIFICIAL (decl)
  	      || (get_AT_unsigned (old_die, DW_AT_decl_file) == file_index
  		  && (get_AT_unsigned (old_die, DW_AT_decl_line)
! 		      == (unsigned) TREE_LINENO (decl)))))
  	{
  	  subr_die = old_die;
  
*************** gen_subprogram_die (decl, context_die)
*** 10681,10689 ****
  	  if (get_AT_unsigned (old_die, DW_AT_decl_file) != file_index)
  	    add_AT_unsigned (subr_die, DW_AT_decl_file, file_index);
  	  if (get_AT_unsigned (old_die, DW_AT_decl_line)
! 	      != (unsigned) DECL_SOURCE_LINE (decl))
  	    add_AT_unsigned
! 	      (subr_die, DW_AT_decl_line, DECL_SOURCE_LINE (decl));
  	}
      }
    else
--- 10681,10689 ----
  	  if (get_AT_unsigned (old_die, DW_AT_decl_file) != file_index)
  	    add_AT_unsigned (subr_die, DW_AT_decl_file, file_index);
  	  if (get_AT_unsigned (old_die, DW_AT_decl_line)
! 	      != (unsigned) TREE_LINENO (decl))
  	    add_AT_unsigned
! 	      (subr_die, DW_AT_decl_line, TREE_LINENO (decl));
  	}
      }
    else
*************** gen_variable_die (decl, context_die)
*** 10902,10917 ****
        add_AT_die_ref (var_die, DW_AT_specification, old_die);
        if (DECL_NAME (decl))
  	{
! 	  unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl));
  
  	  if (get_AT_unsigned (old_die, DW_AT_decl_file) != file_index)
  	    add_AT_unsigned (var_die, DW_AT_decl_file, file_index);
  
  	  if (get_AT_unsigned (old_die, DW_AT_decl_line)
! 	      != (unsigned) DECL_SOURCE_LINE (decl))
  
  	    add_AT_unsigned (var_die, DW_AT_decl_line,
! 			     DECL_SOURCE_LINE (decl));
  	}
      }
    else
--- 10902,10917 ----
        add_AT_die_ref (var_die, DW_AT_specification, old_die);
        if (DECL_NAME (decl))
  	{
! 	  unsigned file_index = lookup_filename (TREE_FILENAME (decl));
  
  	  if (get_AT_unsigned (old_die, DW_AT_decl_file) != file_index)
  	    add_AT_unsigned (var_die, DW_AT_decl_file, file_index);
  
  	  if (get_AT_unsigned (old_die, DW_AT_decl_line)
! 	      != (unsigned) TREE_LINENO (decl))
  
  	    add_AT_unsigned (var_die, DW_AT_decl_line,
! 			     TREE_LINENO (decl));
  	}
      }
    else
*************** dwarf2out_decl (decl)
*** 12117,12123 ****
  
        /* Don't bother trying to generate any DIEs to represent any of the
           normal built-in types for the language we are compiling.  */
!       if (DECL_SOURCE_LINE (decl) == 0)
  	{
  	  /* OK, we need to generate one for `bool' so GDB knows what type
               comparisons have.  */
--- 12117,12123 ----
  
        /* Don't bother trying to generate any DIEs to represent any of the
           normal built-in types for the language we are compiling.  */
!       if (TREE_LINENO (decl) == 0)
  	{
  	  /* OK, we need to generate one for `bool' so GDB knows what type
               comparisons have.  */
*************** lookup_filename (file_name)
*** 12210,12216 ****
  {
    unsigned i;
  
!   /* ??? Why isn't DECL_SOURCE_FILE left null instead.  */
    if (strcmp (file_name, "<internal>") == 0
        || strcmp (file_name, "<built-in>") == 0)
      return 0;
--- 12210,12216 ----
  {
    unsigned i;
  
!   /* ??? Why isn't TREE_FILENAME left null instead.  */
    if (strcmp (file_name, "<internal>") == 0
        || strcmp (file_name, "<built-in>") == 0)
      return 0;
Index: gcc/dwarfout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarfout.c,v
retrieving revision 1.111.2.8
diff -c -3 -p -r1.111.2.8 dwarfout.c
*** gcc/dwarfout.c	17 Dec 2002 20:46:36 -0000	1.111.2.8
--- gcc/dwarfout.c	11 Jan 2003 00:34:13 -0000
*************** name_and_src_coords_attributes (decl)
*** 3492,3501 ****
  	   Fred Fish sez that m68k/svr4 assemblers botch those.  */
  
  	ASM_OUTPUT_POP_SECTION (asm_out_file);
! 	file_index = lookup_filename (DECL_SOURCE_FILE (decl));
  	ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION);
  
! 	src_coords_attribute (file_index, DECL_SOURCE_LINE (decl));
        }
  #endif /* defined(DWARF_DECL_COORDINATES) */
      }
--- 3492,3501 ----
  	   Fred Fish sez that m68k/svr4 assemblers botch those.  */
  
  	ASM_OUTPUT_POP_SECTION (asm_out_file);
! 	file_index = lookup_filename (TREE_FILENAME (decl));
  	ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION);
  
! 	src_coords_attribute (file_index, TREE_LINENO (decl));
        }
  #endif /* defined(DWARF_DECL_COORDINATES) */
      }
*************** dwarfout_file_scope_decl (decl, set_fina
*** 5748,5754 ****
        /* ??? This code is different than the equivalent code in dwarf2out.c.
  	 The dwarf2out.c code is probably more correct.  */
  
!       if (DECL_SOURCE_LINE (decl) == 0
  	  && (type_is_fundamental (TREE_TYPE (decl))
  	      || TREE_CODE (TREE_TYPE (decl)) == LANG_TYPE))
  	return;
--- 5748,5754 ----
        /* ??? This code is different than the equivalent code in dwarf2out.c.
  	 The dwarf2out.c code is probably more correct.  */
  
!       if (TREE_LINENO (decl) == 0
  	  && (type_is_fundamental (TREE_TYPE (decl))
  	      || TREE_CODE (TREE_TYPE (decl)) == LANG_TYPE))
  	return;
Index: gcc/except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.227.2.6
diff -c -3 -p -r1.227.2.6 except.c
*** gcc/except.c	3 Jan 2003 01:57:19 -0000	1.227.2.6
--- gcc/except.c	11 Jan 2003 00:34:21 -0000
*************** expand_eh_handler (handler)
*** 542,549 ****
       tree handler;
  {
    tree inner = handler;
!   while (TREE_CODE (inner) == COMPOUND_EXPR
! 	 || TREE_CODE (inner) == EXPR_WITH_FILE_LOCATION)
      inner = TREE_OPERAND (inner, 0);
  
    switch (TREE_CODE (inner))
--- 542,548 ----
       tree handler;
  {
    tree inner = handler;
!   while (TREE_CODE (inner) == COMPOUND_EXPR)
      inner = TREE_OPERAND (inner, 0);
  
    switch (TREE_CODE (inner))
Index: gcc/expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.467.2.21
diff -c -3 -p -r1.467.2.21 expr.c
*** gcc/expr.c	3 Jan 2003 01:57:20 -0000	1.467.2.21
--- gcc/expr.c	11 Jan 2003 00:34:40 -0000
*************** expand_expr (exp, target, tmode, modifie
*** 6424,6429 ****
--- 6424,6430 ----
    int unsignedp = TREE_UNSIGNED (type);
    enum machine_mode mode;
    enum tree_code code = TREE_CODE (exp);
+   char class = TREE_CODE_CLASS (code);
    optab this_optab;
    rtx subtarget, original_target;
    int ignore;
*************** expand_expr (exp, target, tmode, modifie
*** 6557,6562 ****
--- 6558,6605 ----
        && ! (code == CALL_EXPR && aggregate_value_p (exp)))
      target = subtarget;
  
+ 
+   /* If this is an expression of some kind and it has an associated line
+      number, then emit the line number before expanding the expression. 
+ 
+      We need to save and restore the file and line information so that
+      errors discovered during expansion are emitted with the right
+      information.  It would be better of the diagnostic routines 
+      used the file/line information embedded in the tree nodes rather
+      than globals.  */
+   if (cfun
+       && TREE_LOCUS (exp)
+       && (IS_EXPR_CODE_CLASS (class)
+           || class == 'r'
+ 	  || class == 's'))
+       {
+ 	const char *saved_input_filename = input_filename;
+ 	int saved_lineno = lineno;
+ 	location_t *saved_locus = TREE_LOCUS (exp);
+ 	rtx to_return;
+ 
+ 	/* Update the global file line information and emit the note.  */
+ 	input_filename = TREE_FILENAME (exp);
+ 	lineno = TREE_LINENO (exp);
+ 	emit_line_note (input_filename, lineno);
+ 
+ 	/* This is a gross hack.  Temporarily remove the locus information
+ 	   and re-call expand_expr.
+ 
+ 	   Long term this should be changed to have the exit paths from
+ 	   expand_expr restore the global file and line information so
+ 	   we can avoid this recursive call.  */
+ 	TREE_LOCUS (exp) = NULL;
+ 	to_return = expand_expr (exp, (ignore ? const0_rtx : target),
+ 				 tmode, modifier);
+ 
+ 	/* Restore the locus and global file line information.  */
+ 	TREE_LOCUS (exp) = saved_locus;
+ 	input_filename = saved_input_filename;
+ 	lineno = saved_lineno;
+ 	return to_return;
+       }
+ 
    switch (code)
      {
      case LABEL_DECL:
*************** expand_expr (exp, target, tmode, modifie
*** 6775,6798 ****
  	return replace_equiv_address (TREE_CST_RTL (exp),
  				      copy_rtx (XEXP (TREE_CST_RTL (exp), 0)));
        return TREE_CST_RTL (exp);
- 
-     case EXPR_WITH_FILE_LOCATION:
-       {
- 	rtx to_return;
- 	const char *saved_input_filename = input_filename;
- 	int saved_lineno = lineno;
- 	input_filename = EXPR_WFL_FILENAME (exp);
- 	lineno = EXPR_WFL_LINENO (exp);
- 	if (EXPR_WFL_EMIT_LINE_NOTE (exp))
- 	  emit_line_note (input_filename, lineno);
- 	/* Possibly avoid switching back and forth here.  */
- 	to_return = expand_expr (EXPR_WFL_NODE (exp),
- 				 (ignore ? const0_rtx : target),
- 				 tmode, modifier);
- 	input_filename = saved_input_filename;
- 	lineno = saved_lineno;
- 	return to_return;
-       }
  
      case SAVE_EXPR:
        context = decl_function_context (exp);
--- 6818,6823 ----
Index: gcc/gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gimplify.c,v
retrieving revision 1.1.2.18
diff -c -3 -p -r1.1.2.18 gimplify.c
*** gcc/gimplify.c	3 Jan 2003 01:57:22 -0000	1.1.2.18
--- gcc/gimplify.c	11 Jan 2003 00:34:49 -0000
*************** static void simplify_addr_expr       PAR
*** 51,58 ****
  static void simplify_self_mod_expr   PARAMS ((tree *, tree *, tree *));
  static void simplify_cond_expr       PARAMS ((tree *, tree *, tree));
  static void simplify_boolean_expr    PARAMS ((tree *, tree *));
- static void simplify_expr_wfl        PARAMS ((tree *, tree *, tree *,
-                                               int (*) (tree)));
  static void simplify_return_expr     PARAMS ((tree, tree *));
  static tree build_addr_expr	     PARAMS ((tree));
  static tree add_stmt_to_compound	PARAMS ((tree, tree));
--- 51,56 ----
*************** static void simplify_bind_expr		PARAMS (
*** 61,67 ****
  static inline void remove_suffix	PARAMS ((char *, int));
  static void push_gimplify_context	PARAMS ((void));
  static void pop_gimplify_context	PARAMS ((void));
! static void wrap_with_wfl		PARAMS ((tree *));
  static tree copy_if_shared_r		PARAMS ((tree *, int *, void *));
  static tree unmark_visited_r		PARAMS ((tree *, int *, void *));
  static tree mostly_copy_tree_r		PARAMS ((tree *, int *, void *));
--- 59,65 ----
  static inline void remove_suffix	PARAMS ((char *, int));
  static void push_gimplify_context	PARAMS ((void));
  static void pop_gimplify_context	PARAMS ((void));
! static void annotate_stmt_with_file_line	PARAMS ((tree *));
  static tree copy_if_shared_r		PARAMS ((tree *, int *, void *));
  static tree unmark_visited_r		PARAMS ((tree *, int *, void *));
  static tree mostly_copy_tree_r		PARAMS ((tree *, int *, void *));
*************** simplify_function_tree (fndecl)
*** 198,204 ****
  
    /* If there isn't an outer BIND_EXPR, add one.  */
    tmp = fnbody;
-   STRIP_WFL (tmp);
    if (TREE_CODE (tmp) != BIND_EXPR)
      fnbody = build (BIND_EXPR, void_type_node, NULL_TREE, fnbody, NULL_TREE);
  
--- 196,201 ----
*************** simplify_expr (expr_p, pre_p, post_p, si
*** 267,272 ****
--- 264,273 ----
    tree internal_post = NULL_TREE;
    tree save_expr;
    int is_statement = (pre_p == NULL);
+   char class;
+   location_t *locus;
+   const char *saved_input_filename;
+   int saved_lineno;
  
    if (*expr_p == NULL_TREE)
      return 1;
*************** simplify_expr (expr_p, pre_p, post_p, si
*** 280,285 ****
--- 281,302 ----
    /* Strip any uselessness.  */
    STRIP_TYPE_NOPS (*expr_p);
  
+   class = TREE_CODE_CLASS (TREE_CODE (*expr_p));
+   locus = TREE_LOCUS (*expr_p);
+ 
+   if (locus
+       && (IS_EXPR_CODE_CLASS (class)
+ 	  || class == 'r'
+           || class == 's'))
+     {
+       saved_input_filename = input_filename;
+       saved_lineno = lineno;
+ 
+       input_filename = TREE_FILENAME (*expr_p);
+       lineno = TREE_LINENO (*expr_p);
+ 
+     }
+ 
    /* Loop over the specific simplifiers until the toplevel node remains the
       same.  */
    do
*************** simplify_expr (expr_p, pre_p, post_p, si
*** 451,460 ****
  	  simplify_save_expr (expr_p, pre_p);
  	  break;
  
- 	case EXPR_WITH_FILE_LOCATION:
- 	  simplify_expr_wfl (expr_p, pre_p, post_p, simple_test_f);
- 	  break;
- 
  	case BIT_FIELD_REF:
  	  simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
  		         is_simple_min_lval, fb_either);
--- 468,473 ----
*************** simplify_expr (expr_p, pre_p, post_p, si
*** 551,559 ****
--- 564,583 ----
    if (is_statement)
      {
        add_tree (*expr_p, pre_p);
+       annotate_all_with_file_line (&internal_post, input_filename, lineno);
        add_tree (internal_post, pre_p);
        tmp = rationalize_compound_expr (internal_pre);
+       annotate_all_with_file_line (&tmp, input_filename, lineno);
        *expr_p = tmp;
+ 
+       if (locus
+ 	  && (IS_EXPR_CODE_CLASS (class)
+ 	      || class == 'r'
+               || class == 's'))
+ 	{
+ 	  input_filename = saved_input_filename;
+ 	  lineno = saved_lineno;
+ 	}
        return 1;
      }
  
*************** simplify_expr (expr_p, pre_p, post_p, si
*** 564,570 ****
       handling some post-effects internally; if that's the case, we need to
       copy into a temp before adding the post-effects to the tree.  */
    if (!internal_post && (*simple_test_f) (*expr_p))
!     return 1;
  
    /* Otherwise, we need to create a new temporary for the simplified
       expression.  */
--- 588,604 ----
       handling some post-effects internally; if that's the case, we need to
       copy into a temp before adding the post-effects to the tree.  */
    if (!internal_post && (*simple_test_f) (*expr_p))
!     {
!       if (locus
! 	  && (IS_EXPR_CODE_CLASS (class)
! 	      || class == 'r'
!               || class == 's'))
!         {
!           input_filename = saved_input_filename;
!           lineno = saved_lineno;
!         }
!       return 1;
!     }
  
    /* Otherwise, we need to create a new temporary for the simplified
       expression.  */
*************** simplify_expr (expr_p, pre_p, post_p, si
*** 608,614 ****
  #endif
  
    if (internal_post)
!     add_tree (internal_post, pre_p);
  
    return 1;
  }
--- 642,660 ----
  #endif
  
    if (internal_post)
!     {
!       annotate_all_with_file_line (&internal_post, input_filename, lineno);
!       add_tree (internal_post, pre_p);
!     }
! 
!   if (locus
!       && (IS_EXPR_CODE_CLASS (class)
! 	  || class == 'r'
!           || class == 's'))
!     {
!       input_filename = saved_input_filename;
!       lineno = saved_lineno;
!     }
  
    return 1;
  }
*************** simplify_self_mod_expr (expr_p, pre_p, p
*** 1000,1005 ****
--- 1046,1055 ----
  #endif
  
    t1 = build (MODIFY_EXPR, TREE_TYPE (lvalue), lvalue, t1);
+   if (TREE_LOCUS (*expr_p))
+     TREE_LOCUS (t1) = TREE_LOCUS (*expr_p);
+   else
+     annotate_with_file_line (t1, input_filename, lineno);
  
    /* Determine whether the new assignment should go before or after
       the simplified expression.  */
*************** simplify_compound_expr (expr_p, pre_p)
*** 1397,1467 ****
  }
  
  
- /*  Simplify an EXPR_WITH_FILE_LOCATION.  EXPR_P points to the expression
-     to simplify.
- 
-     After simplification, all the nodes in PRE_P and POST_P are wrapped 
inside
-     a EXPR_WITH_FILE_LOCATION node to preserve the original semantics.  The
-     simplified expression is also returned inside an EXPR_WITH_FILE_LOCATION
-     node.
- 
-     PRE_P points to the list where side effects that must happen before
- 	*EXPR_P should be stored.
- 
-     POST_P points to the list where side effects that must happen after
-     	*EXPR_P should be stored.
- 
-     SIMPLE_TEST_F points to a function that takes a tree T and
- 	returns nonzero if T is in the SIMPLE form requested by the
- 	caller.  */
- 
- static void
- simplify_expr_wfl (expr_p, pre_p, post_p, simple_test_f)
-      tree *expr_p;
-      tree *pre_p;
-      tree *post_p;
-      int (*simple_test_f) PARAMS ((tree));
- {
-   const char *file;
-   int line, col;
-   tree pre = NULL_TREE;
-   tree post = NULL_TREE;
-   
- #if defined ENABLE_CHECKING
-   if (TREE_CODE (*expr_p) != EXPR_WITH_FILE_LOCATION)
-     abort ();
- #endif
- 
-   file = input_filename;
-   input_filename = EXPR_WFL_FILENAME (*expr_p);
- 
-   line = lineno;
-   lineno = EXPR_WFL_LINENO (*expr_p);
- 
-   col = EXPR_WFL_COLNO (*expr_p);
- 
-   simplify_expr (&EXPR_WFL_NODE (*expr_p), &pre, &post, simple_test_f,
- 		 fb_rvalue);
- 
-   pre = rationalize_compound_expr (pre);
-   wrap_all_with_wfl (&pre, EXPR_WFL_FILENAME (*expr_p),
- 		     EXPR_WFL_LINENO (*expr_p));
-   post = rationalize_compound_expr (post);
-   wrap_all_with_wfl (&post, EXPR_WFL_FILENAME (*expr_p),
- 		     EXPR_WFL_LINENO (*expr_p));
-   
-   lineno = line;
-   input_filename = file;
- 
-   add_tree (pre, pre_p);
-   add_tree (post, post_p);
- 
-   if (EXPR_WFL_NODE (*expr_p) == NULL_TREE)
-     *expr_p = NULL_TREE;
-   else
-     TREE_SIDE_EFFECTS (*expr_p) = TREE_SIDE_EFFECTS (EXPR_WFL_NODE 
(*expr_p));
- }
- 
  /*  Simplify a SAVE_EXPR node.  EXPR_P points to the expression to
      simplify.  After simplification, EXPR_P will point to a new temporary
      that holds the original value of the SAVE_EXPR node.
--- 1447,1452 ----
*************** static const char *wfl_filename;
*** 1567,1595 ****
  static int wfl_lineno;
  
  static void
! wrap_with_wfl (stmt_p)
       tree *stmt_p;
  {
!   if (TREE_CODE (*stmt_p) == LABEL_EXPR)
!     /* Don't emit a line note for a label.  We particularly don't want to
!        emit one for the break label, since it doesn't actually correspond
!        to the beginning of the loop/switch.  */;
!   else if (TREE_CODE (*stmt_p) != EXPR_WITH_FILE_LOCATION)
!     {
!       *stmt_p = build_expr_wfl (*stmt_p, wfl_filename, wfl_lineno, 0);
!       EXPR_WFL_EMIT_LINE_NOTE (*stmt_p) = 1;
!     }
  }
  
  void
! wrap_all_with_wfl (stmt_p, file, line)
       tree *stmt_p;
       const char *file;
       int line;
  {
    wfl_filename = file;
    wfl_lineno = line;
!   foreach_stmt (stmt_p, wrap_with_wfl);
  }
  
  /* Add STMT to EXISTING if possible, otherwise create a new
--- 1552,1577 ----
  static int wfl_lineno;
  
  static void
! annotate_stmt_with_file_line (stmt_p)
       tree *stmt_p;
  {
!   /* Don't emit a line note for a label.  We particularly don't want to
!      emit one for the break label, since it doesn't actually correspond
!      to the beginning of the loop/switch.  */;
!   if (TREE_CODE (*stmt_p) != LABEL_EXPR
!       && ! TREE_LOCUS (*stmt_p))
!     annotate_with_file_line (*stmt_p, wfl_filename, wfl_lineno);
  }
  
  void
! annotate_all_with_file_line (stmt_p, file, line)
       tree *stmt_p;
       const char *file;
       int line;
  {
    wfl_filename = file;
    wfl_lineno = line;
!   foreach_stmt (stmt_p, annotate_stmt_with_file_line);
  }
  
  /* Add STMT to EXISTING if possible, otherwise create a new
*************** get_initialized_tmp_var (val, pre_p)
*** 1766,1771 ****
--- 1748,1757 ----
    simplify_expr (&val, pre_p, NULL, is_simple_rhs, fb_rvalue);
    t = create_tmp_var (TREE_TYPE (val), prefix);
    mod = build (MODIFY_EXPR, TREE_TYPE (t), t, val);
+   if (TREE_LOCUS (val))
+     TREE_LOCUS (mod) = TREE_LOCUS (val);
+   else
+     annotate_with_file_line (mod, input_filename, lineno);
    add_tree (mod, pre_p);
  
    return t;
*************** declare_tmp_vars (vars, scope)
*** 1795,1806 ****
      {
        tree temps;
  
-       STRIP_WFL (scope);
- 
        /* C99 mode puts the default 'return 0;' for main() outside the outer
  	 braces.  So drill down until we find an actual scope.  */
!       while (TREE_CODE (scope) == COMPOUND_EXPR
! 	     || TREE_CODE (scope) == EXPR_WITH_FILE_LOCATION)
  	scope = TREE_OPERAND (scope, 0);
  
        if (TREE_CODE (scope) != BIND_EXPR)
--- 1781,1789 ----
      {
        tree temps;
  
        /* C99 mode puts the default 'return 0;' for main() outside the outer
  	 braces.  So drill down until we find an actual scope.  */
!       while (TREE_CODE (scope) == COMPOUND_EXPR)
  	scope = TREE_OPERAND (scope, 0);
  
        if (TREE_CODE (scope) != BIND_EXPR)
Index: gcc/integrate.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/integrate.c,v
retrieving revision 1.197.2.12
diff -c -3 -p -r1.197.2.12 integrate.c
*** gcc/integrate.c	3 Jan 2003 01:57:23 -0000	1.197.2.12
--- gcc/integrate.c	11 Jan 2003 00:35:14 -0000
*************** expand_inline_function (fndecl, parms, t
*** 994,1001 ****
  	  && ! (GET_CODE (XEXP (loc, 0)) == REG
  		&& REGNO (XEXP (loc, 0)) > LAST_VIRTUAL_REGISTER))
  	{
! 	  rtx note = emit_note (DECL_SOURCE_FILE (formal),
! 				DECL_SOURCE_LINE (formal));
  	  if (note)
  	    RTX_INTEGRATED_P (note) = 1;
  
--- 994,1001 ----
  	  && ! (GET_CODE (XEXP (loc, 0)) == REG
  		&& REGNO (XEXP (loc, 0)) > LAST_VIRTUAL_REGISTER))
  	{
! 	  rtx note = emit_note (TREE_FILENAME (formal),
! 				TREE_LINENO (formal));
  	  if (note)
  	    RTX_INTEGRATED_P (note) = 1;
  
Index: gcc/old-tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/old-tree-inline.c,v
retrieving revision 1.1.4.6
diff -c -3 -p -r1.1.4.6 old-tree-inline.c
*** gcc/old-tree-inline.c	14 Dec 2002 17:11:21 -0000	1.1.4.6
--- gcc/old-tree-inline.c	11 Jan 2003 00:35:17 -0000
*************** expand_call_inline (tp, walk_subtrees, d
*** 1114,1120 ****
       line numbers corresponding to the function we are calling.  We
       wrap the whole inlined body in an EXPR_WITH_FILE_AND_LINE as well
       because individual statements don't record the filename.  */
!   push_srcloc (DECL_SOURCE_FILE (fn), DECL_SOURCE_LINE (fn));
  
  #ifndef INLINER_FOR_JAVA
    /* Build a statement-expression containing code to initialize the
--- 1114,1120 ----
       line numbers corresponding to the function we are calling.  We
       wrap the whole inlined body in an EXPR_WITH_FILE_AND_LINE as well
       because individual statements don't record the filename.  */
!   push_srcloc (TREE_FILENAME (fn), TREE_LINENO (fn));
  
  #ifndef INLINER_FOR_JAVA
    /* Build a statement-expression containing code to initialize the
*************** expand_call_inline (tp, walk_subtrees, d
*** 1309,1325 ****
       EXPR_WITH_FILE_LOCATION so that we'll get debugging line notes
       pointing to the right place.  */
  #ifndef INLINER_FOR_JAVA
!   chain = TREE_CHAIN (*tp);
!   *tp = build_expr_wfl (expr, DECL_SOURCE_FILE (fn), DECL_SOURCE_LINE (fn),
! 			/*col=*/0);
  #else /* INLINER_FOR_JAVA */
!   *tp = build_expr_wfl (expr, DECL_SOURCE_FILE (fn),
! 			DECL_SOURCE_LINE_FIRST(fn),
! 			/*col=*/0);
  #endif /* INLINER_FOR_JAVA */
-   EXPR_WFL_EMIT_LINE_NOTE (*tp) = 1;
  #ifndef INLINER_FOR_JAVA
-   TREE_CHAIN (*tp) = chain;
  #endif /* not INLINER_FOR_JAVA */
    pop_srcloc ();
  
--- 1309,1319 ----
       EXPR_WITH_FILE_LOCATION so that we'll get debugging line notes
       pointing to the right place.  */
  #ifndef INLINER_FOR_JAVA
!   annotate_with_file_line (expr, TREE_FILENAME (fn), TREE_LINENO (fn));
  #else /* INLINER_FOR_JAVA */
!   annotate_with_file_line (expr, TREE_FILENAME (fn), 
TREE_SOURCE_LINE_FIRST(fn));
  #endif /* INLINER_FOR_JAVA */
  #ifndef INLINER_FOR_JAVA
  #endif /* not INLINER_FOR_JAVA */
    pop_srcloc ();
  
Index: gcc/print-tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/print-tree.c,v
retrieving revision 1.59.2.7
diff -c -3 -p -r1.59.2.7 print-tree.c
*** gcc/print-tree.c	27 Dec 2002 01:51:17 -0000	1.59.2.7
--- gcc/print-tree.c	11 Jan 2003 00:35:18 -0000
*************** print_node (file, prefix, node, indent)
*** 385,391 ****
  
        fprintf (file, " %s", GET_MODE_NAME (mode));
        fprintf (file, " file %s line %d",
! 	       DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
  
        print_node (file, "size", DECL_SIZE (node), indent + 4);
        print_node (file, "unit size", DECL_SIZE_UNIT (node), indent + 4);
--- 385,391 ----
  
        fprintf (file, " %s", GET_MODE_NAME (mode));
        fprintf (file, " file %s line %d",
! 	       TREE_FILENAME (node), TREE_LINENO (node));
  
        print_node (file, "size", DECL_SIZE (node), indent + 4);
        print_node (file, "unit size", DECL_SIZE_UNIT (node), indent + 4);
*************** print_node (file, prefix, node, indent)
*** 638,651 ****
  	    }
  	}
  
-       if (TREE_CODE (node) == EXPR_WITH_FILE_LOCATION)
- 	{
- 	  indent_to (file, indent+4);
- 	  fprintf (file, "%s:%d:%d",
- 		   (EXPR_WFL_FILENAME_NODE (node ) ?
- 		    EXPR_WFL_FILENAME (node) : "(no file info)"),
- 		   EXPR_WFL_LINENO (node), EXPR_WFL_COLNO (node));
- 	}
        print_node (file, "chain", TREE_CHAIN (node), indent + 4);
        break;
  
--- 638,643 ----
*************** print_node (file, prefix, node, indent)
*** 766,771 ****
--- 758,771 ----
  	}
  
        break;
+     }
+ 
+   if (TREE_LOCUS (node) && TREE_FILENAME (node))
+     {
+       indent_to (file, indent+4);
+       fprintf (file, "%s:%d",
+ 	       TREE_FILENAME (node),
+ 	       TREE_LINENO (node));
      }
  
    fprintf (file, ">");
Index: gcc/stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.267.2.11
diff -c -3 -p -r1.267.2.11 stmt.c
*** gcc/stmt.c	27 Dec 2002 01:51:21 -0000	1.267.2.11
--- gcc/stmt.c	11 Jan 2003 00:35:47 -0000
*************** expand_decl_init (decl)
*** 4059,4065 ****
      }
    else if (DECL_INITIAL (decl) && TREE_CODE (DECL_INITIAL (decl)) != 
TREE_LIST)
      {
!       emit_line_note (DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
        expand_assignment (decl, DECL_INITIAL (decl), 0, 0);
        emit_queue ();
      }
--- 4059,4065 ----
      }
    else if (DECL_INITIAL (decl) && TREE_CODE (DECL_INITIAL (decl)) != 
TREE_LIST)
      {
!       emit_line_note (TREE_FILENAME (decl), TREE_LINENO (decl));
        expand_assignment (decl, DECL_INITIAL (decl), 0, 0);
        emit_queue ();
      }
Index: gcc/tree-alias-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-alias-common.c,v
retrieving revision 1.1.2.13
diff -c -3 -p -r1.1.2.13 tree-alias-common.c
*** gcc/tree-alias-common.c	29 Dec 2002 22:04:59 -0000	1.1.2.13
--- gcc/tree-alias-common.c	11 Jan 2003 00:36:28 -0000
*************** get_alias_var (expr)
*** 192,199 ****
    struct alias_annot_entry entry;
    struct alias_annot_entry *result;
    
-   STRIP_WFL (expr);
-   
    /* If it's a decl, get the alias var of the decl. We farm this off
       to get_alias_var_decl so it can abort if the alias var doesn't
       exist, and in case something else *knows* it has a decl, and
--- 192,197 ----
*************** find_func_aliases (tp, walk_subtrees, da
*** 405,411 ****
  {
    tree stp = *tp;
    
-   STRIP_WFL (stp);
    if (TREE_CODE (stp) == SCOPE_STMT)
      {
        *walk_subtrees = 0;
--- 403,408 ----
*************** find_func_aliases (tp, walk_subtrees, da
*** 430,437 ****
  	  op0 = TREE_OPERAND (stp, 0);
  	  op1 = TREE_OPERAND (stp, 1);
  	}
-       STRIP_WFL (op0);
-       STRIP_WFL (op1);
        /* lhsAV should always have an alias variable */
        lhsAV = get_alias_var (op0);
        /* rhsAV might not have one, c.f. c = 5 */
--- 427,432 ----
Index: gcc/tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.42
diff -c -3 -p -r1.1.4.42 tree-cfg.c
*** gcc/tree-cfg.c	8 Jan 2003 03:01:05 -0000	1.1.4.42
--- gcc/tree-cfg.c	11 Jan 2003 00:36:31 -0000
*************** static void cleanup_switch_expr_graph	PA
*** 98,112 ****
  static void disconnect_unreachable_case_labels PARAMS ((basic_block));
  
  
! /* Remove any COMPOUND_EXPR and WFL container from NODE.  */
  #define STRIP_CONTAINERS(NODE)					\
    do {								\
!     while (TREE_CODE (NODE) == COMPOUND_EXPR			\
! 	   || TREE_CODE (NODE) == EXPR_WITH_FILE_LOCATION)	\
!       if (TREE_CODE (NODE) == COMPOUND_EXPR)			\
! 	NODE = TREE_OPERAND (NODE, 0);				\
!       else if (TREE_CODE (NODE) == EXPR_WITH_FILE_LOCATION)	\
! 	NODE = EXPR_WFL_NODE (NODE);				\
    } while (0)
  
  
--- 98,108 ----
  static void disconnect_unreachable_case_labels PARAMS ((basic_block));
  
  
! /* Remove any COMPOUND_EXPR container from NODE.  */
  #define STRIP_CONTAINERS(NODE)					\
    do {								\
!     while (TREE_CODE (NODE) == COMPOUND_EXPR)			\
!       NODE = TREE_OPERAND (NODE, 0);				\
    } while (0)
  
  
*************** build_tree_cfg (fnbody)
*** 135,141 ****
    /* Find the basic blocks for the flowgraph.  First skip any
       non-executable statements at the start of the function.  Otherwise
       we'll end up with an empty basic block 0, which is useless.  */
-   STRIP_WFL (fnbody);
  
    if (fnbody == empty_stmt_node || TREE_CODE (fnbody) != BIND_EXPR)
      return;
--- 131,136 ----
*************** make_blocks (first_p, parent_block)
*** 224,230 ****
  	  continue;
  	}
  
-       STRIP_WFL (stmt);
        STRIP_NOPS (stmt);
  
        code = TREE_CODE (stmt);
--- 219,224 ----
*************** make_ctrl_stmt_edges (bb)
*** 521,527 ****
  		and enters an infinite loop.  */
        {
  	tree body = SWITCH_BODY (first);
- 	STRIP_WFL (body);
  	STRIP_NOPS (body);
  	if (TREE_CODE (body) == BIND_EXPR)
  	  {
--- 515,520 ----
*************** gsi_remove (i)
*** 986,992 ****
  {
    tree t = *(i.tp);
  
-   STRIP_WFL (t);
    STRIP_NOPS (t);
  
    if (!is_exec_stmt (t))
--- 979,984 ----
*************** remove_stmt (stmt_p)
*** 1019,1025 ****
    ref_list_iterator i;
    tree stmt = *stmt_p;
  
-   STRIP_WFL (stmt);
    STRIP_NOPS (stmt);
  
    /* Remove all the references made by this statement, only if the
--- 1011,1016 ----
*************** disconnect_unreachable_case_labels (bb)
*** 1240,1247 ****
        edge e, next;
        tree switch_body = SWITCH_BODY (first_stmt (bb));
  
-       STRIP_WFL (switch_body);
- 
        /* Remove all the edges that go to case labels that will never
  	 be taken.  */
        for (e = bb->succ; e; e = next)
--- 1231,1236 ----
*************** is_ctrl_stmt (t)
*** 1689,1695 ****
      abort ();
  #endif
  
-   STRIP_WFL (t);
    return (TREE_CODE (t) == COND_EXPR
  	  || TREE_CODE (t) == LOOP_EXPR
  	  || TREE_CODE (t) == SWITCH_EXPR);
--- 1678,1683 ----
*************** is_ctrl_altering_stmt (t)
*** 1710,1716 ****
      abort ();
  #endif
  
-   STRIP_WFL (t);
    if (TREE_CODE (t) == GOTO_EXPR || TREE_CODE (t) == RETURN_EXPR)
      return true;
  
--- 1698,1703 ----
*************** bool
*** 1750,1756 ****
  is_loop_stmt (t)
       tree t;
  {
-   STRIP_WFL (t);
    return (TREE_CODE (t) == LOOP_EXPR);
  }
  
--- 1737,1742 ----
*************** bool
*** 1761,1767 ****
  is_computed_goto (t)
       tree t;
  {
-   STRIP_WFL (t);
    return (TREE_CODE (t) == GOTO_EXPR
            && TREE_CODE (GOTO_DESTINATION (t)) != LABEL_DECL);
  }
--- 1747,1752 ----
*************** bool
*** 1773,1779 ****
  stmt_starts_bb_p (t)
       tree t;
  {
-   STRIP_WFL (t);
    return (TREE_CODE (t) == CASE_LABEL_EXPR
  	  || TREE_CODE (t) == LABEL_EXPR
  	  || TREE_CODE (t) == BIND_EXPR
--- 1758,1763 ----
*************** first_exec_stmt (entry_p)
*** 1859,1865 ****
        if (!stmt)
          continue;
  
-       STRIP_WFL (stmt);
        STRIP_NOPS (stmt);
  
        /* Note that we actually return the container for the executable
--- 1843,1848 ----
*************** switch_parent (bb)
*** 1912,1918 ****
  
  
  /** @brief Return the first statement in basic block BB, stripped of any
! 	   WFL or NOP containers.  */
  
  tree
  first_stmt (bb)
--- 1895,1901 ----
  
  
  /** @brief Return the first statement in basic block BB, stripped of any
! 	   NOP containers.  */
  
  tree
  first_stmt (bb)
*************** first_stmt (bb)
*** 1929,1942 ****
    if (gsi_end_bb (i))
      return NULL_TREE;
    t = gsi_stmt (i);
-   STRIP_WFL (t);
    STRIP_NOPS (t);
    return t;
  }
  
  
  /** @brief Return the last statement in basic block BB, stripped of
! 	   any WFL or NOP containers.
  
      empty_stmt_nodes are never returned. NULL is returned if there
      are no such statements.  */
--- 1912,1924 ----
    if (gsi_end_bb (i))
      return NULL_TREE;
    t = gsi_stmt (i);
    STRIP_NOPS (t);
    return t;
  }
  
  
  /** @brief Return the last statement in basic block BB, stripped of
! 	   any NOP containers.
  
      empty_stmt_nodes are never returned. NULL is returned if there
      are no such statements.  */
*************** last_stmt (bb)
*** 1963,1969 ****
      }
    if (t)
      {
-       STRIP_WFL (t);
        STRIP_NOPS (t);
      }
    return t;
--- 1945,1950 ----
*************** set_bb_for_stmt (t, bb)
*** 2035,2042 ****
        ann->bb = bb;
        if (TREE_CODE (t) == COMPOUND_EXPR)
  	t = TREE_OPERAND (t, 0);
-       else if (TREE_CODE (t) == EXPR_WITH_FILE_LOCATION)
- 	t = EXPR_WFL_NODE (t);
        else
  	t = NULL;
      }
--- 2016,2021 ----
Index: gcc/tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.62
diff -c -3 -p -r1.1.4.62 tree-dfa.c
*** gcc/tree-dfa.c	29 Dec 2002 22:04:59 -0000	1.1.4.62
--- gcc/tree-dfa.c	11 Jan 2003 00:36:35 -0000
*************** find_refs_in_stmt (stmt_p, bb)
*** 173,179 ****
    if (stmt == error_mark_node || stmt == empty_stmt_node)
      return;
  
-   STRIP_WFL (stmt);
    STRIP_NOPS (stmt);
    code = TREE_CODE (stmt);
    switch (code)
--- 173,178 ----
*************** find_refs_in_expr (expr_p, ref_type, ref
*** 275,281 ****
    if (parent_stmt && TREE_NOT_GIMPLE (parent_stmt))
      return;
  
-   STRIP_WFL (parent_stmt);
    STRIP_NOPS (parent_stmt);
  
    /* If we found a _DECL node, create a reference to it and return.  */
--- 274,279 ----
*************** find_refs_in_expr (expr_p, ref_type, ref
*** 460,466 ****
  
    /* Unary expressions.  */
    if (class == '1'
-       || code == EXPR_WITH_FILE_LOCATION
        || code == VA_ARG_EXPR
        || code == BIT_FIELD_REF)
      {
--- 458,463 ----
*************** try_replace_ref_with (stmt, ref, op)
*** 1076,1082 ****
    enum tree_code code;
    struct replace_data_d replace;
  
-   STRIP_WFL (stmt);
    STRIP_NOPS (stmt);
  
  #if defined ENABLE_CHECKING
--- 1073,1078 ----
*************** create_tree_ann (t)
*** 1453,1459 ****
  
    ann = (tree_ann) ggc_alloc (sizeof (*ann));
    memset ((void *) ann, 0, sizeof (*ann));
-   STRIP_WFL (t);
    STRIP_NOPS (t);
    t->common.ann = ann;
    return ann;
--- 1449,1454 ----
*************** collect_dfa_stats_r (tp, walk_subtrees, 
*** 2003,2009 ****
    tree t = *tp;
    struct dfa_stats_d *dfa_stats_p = (struct dfa_stats_d *)data;
  
!   /* Don't call tree_annotation here because it strips the WFL and NOPS
       wrappers from T.  */
    ann = t->common.ann;
    if (ann)
--- 1998,2004 ----
    tree t = *tp;
    struct dfa_stats_d *dfa_stats_p = (struct dfa_stats_d *)data;
  
!   /* Don't call tree_annotation here because it strips the NOPS
       wrappers from T.  */
    ann = t->common.ann;
    if (ann)
*************** tree_ref
*** 2618,2624 ****
  output_ref (t)
       tree t;
  {
-   STRIP_WFL (t);
    STRIP_NOPS (t);
    if (is_assignment_stmt (t))
      {
--- 2613,2618 ----
Index: gcc/tree-dump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dump.c,v
retrieving revision 1.6.2.20
diff -c -3 -p -r1.6.2.20 tree-dump.c
*** gcc/tree-dump.c	8 Jan 2003 03:01:06 -0000	1.6.2.20
--- gcc/tree-dump.c	11 Jan 2003 00:36:35 -0000
*************** dequeue_and_dump (di)
*** 328,345 ****
        queue_and_dump_type (di, t);
        dump_child ("scpe", DECL_CONTEXT (t));
        /* And a source position.  */
!       if (DECL_SOURCE_FILE (t))
  	{
! 	  const char *filename = strrchr (DECL_SOURCE_FILE (t), '/');
  	  if (!filename)
! 	    filename = DECL_SOURCE_FILE (t);
  	  else
  	    /* Skip the slash.  */
  	    ++filename;
  
  	  dump_maybe_newline (di);
  	  fprintf (di->stream, "srcp: %s:%-6d ", filename,
! 		   DECL_SOURCE_LINE (t));
  	  di->column += 6 + strlen (filename) + 8;
  	}
        /* And any declaration can be compiler-generated.  */
--- 328,345 ----
        queue_and_dump_type (di, t);
        dump_child ("scpe", DECL_CONTEXT (t));
        /* And a source position.  */
!       if (TREE_FILENAME (t))
  	{
! 	  const char *filename = strrchr (TREE_FILENAME (t), '/');
  	  if (!filename)
! 	    filename = TREE_FILENAME (t);
  	  else
  	    /* Skip the slash.  */
  	    ++filename;
  
  	  dump_maybe_newline (di);
  	  fprintf (di->stream, "srcp: %s:%-6d ", filename,
! 		   TREE_LINENO (t));
  	  di->column += 6 + strlen (filename) + 8;
  	}
        /* And any declaration can be compiler-generated.  */
*************** dequeue_and_dump (di)
*** 576,585 ****
  	 position of the fourth operand, and the second operand
  	 becomes NULL.  */
        dump_child ("init", TREE_OPERAND (t, 3));
-       break;
- 
-     case EXPR_WITH_FILE_LOCATION:
-       dump_child ("expr", EXPR_WFL_NODE (t));
        break;
  
      default:
--- 576,581 ----
Index: gcc/tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow-inline.h,v
retrieving revision 1.1.2.17
diff -c -3 -p -r1.1.2.17 tree-flow-inline.h
*** gcc/tree-flow-inline.h	6 Dec 2002 20:16:27 -0000	1.1.2.17
--- gcc/tree-flow-inline.h	11 Jan 2003 00:36:36 -0000
*************** static inline tree_ann
*** 165,171 ****
  tree_annotation (t)
       tree t;
  {
-   STRIP_WFL (t);
    STRIP_NOPS (t);
    return t->common.ann;
  }
--- 165,170 ----
*************** get_lineno (expr)
*** 246,255 ****
    if (TREE_CODE (expr) == COMPOUND_EXPR)
      expr = TREE_OPERAND (expr, 0);
  
!   if (TREE_CODE (expr) == EXPR_WITH_FILE_LOCATION)
!     return EXPR_WFL_LINENO (expr);
!   else
!     return -1;
  }
  
  static inline const char *
--- 245,251 ----
    if (TREE_CODE (expr) == COMPOUND_EXPR)
      expr = TREE_OPERAND (expr, 0);
  
!   return TREE_LINENO (expr);
  }
  
  static inline const char *
*************** get_filename (expr)
*** 262,269 ****
    if (TREE_CODE (expr) == COMPOUND_EXPR)
      expr = TREE_OPERAND (expr, 0);
  
!   if (TREE_CODE (expr) == EXPR_WITH_FILE_LOCATION)
!     return EXPR_WFL_FILENAME (expr);
    else
      return "???";
  }
--- 258,265 ----
    if (TREE_CODE (expr) == COMPOUND_EXPR)
      expr = TREE_OPERAND (expr, 0);
  
!   if (TREE_FILENAME (expr))
!     return TREE_FILENAME (expr);
    else
      return "???";
  }
*************** static inline bool
*** 709,715 ****
  is_assignment_stmt (t)
       tree t;
  {
-   STRIP_WFL (t);
    STRIP_NOPS (t);
    return (TREE_CODE (t) == MODIFY_EXPR || TREE_CODE (t) == INIT_EXPR);
  }
--- 705,710 ----
Index: gcc/tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.26.2.16
diff -c -3 -p -r1.26.2.16 tree-inline.c
*** gcc/tree-inline.c	3 Jan 2003 01:57:23 -0000	1.26.2.16
--- gcc/tree-inline.c	11 Jan 2003 00:36:44 -0000
*************** walk_tree (tp, func, data, htab_)
*** 1217,1222 ****
--- 1217,1227 ----
      {
        int i, len;
  
+       /* Set lineno here so we get the right instantiation context
+          if we call instantiate_decl from inlinable_function_p.  */
+       if (TREE_LOCUS (*tp))
+         lineno = TREE_LINENO (*tp);
+ 
        /* Walk over all the sub-trees of this operand.  */
        len = first_rtl_op (code);
        /* TARGET_EXPRs are peculiar: operands 1 and 3 can be the same.
Index: gcc/tree-mudflap.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-mudflap.c,v
retrieving revision 1.1.2.28
diff -c -3 -p -r1.1.2.28 tree-mudflap.c
*** gcc/tree-mudflap.c	24 Dec 2002 03:14:36 -0000	1.1.2.28
--- gcc/tree-mudflap.c	11 Jan 2003 00:36:45 -0000
*************** mf_varname_tree (decl)
*** 405,419 ****
      const char *sourcefile;
      unsigned sourceline;
  
!     sourcefile = DECL_SOURCE_FILE (decl);
      if (sourcefile == NULL && current_function_decl != NULL_TREE)
!       sourcefile = DECL_SOURCE_FILE (current_function_decl);
      if (sourcefile == NULL)
        sourcefile = "<unknown file>";
  
      output_add_string (buf, sourcefile);
  
!     sourceline = DECL_SOURCE_LINE (decl);
      if (sourceline != 0)
        {
  	output_add_string (buf, ":");
--- 405,419 ----
      const char *sourcefile;
      unsigned sourceline;
  
!     sourcefile = TREE_FILENAME (decl);
      if (sourcefile == NULL && current_function_decl != NULL_TREE)
!       sourcefile = TREE_FILENAME (current_function_decl);
      if (sourcefile == NULL)
        sourcefile = "<unknown file>";
  
      output_add_string (buf, sourcefile);
  
!     sourceline = TREE_LINENO (decl);
      if (sourceline != 0)
        {
  	output_add_string (buf, ":");
*************** mf_file_function_line_tree (file, line)
*** 472,478 ****
  
    /* Add FILENAME[:LINENUMBER]. */
    if (file == NULL && current_function_decl != NULL_TREE)
!     file = DECL_SOURCE_FILE (current_function_decl);
    if (file == NULL)
      file = "<unknown file>";
    output_add_string (buf, file);
--- 472,478 ----
  
    /* Add FILENAME[:LINENUMBER]. */
    if (file == NULL && current_function_decl != NULL_TREE)
!     file = TREE_FILENAME (current_function_decl);
    if (file == NULL)
      file = "<unknown file>";
    output_add_string (buf, file);
*************** mx_xfn_indirect_ref (t, continue_p, data
*** 815,824 ****
      last_lineno = (STMT_LINENO (*t) > 0 ? STMT_LINENO (*t) : last_lineno);
    if (TREE_CODE (*t) == FILE_STMT)
      last_filename = FILE_STMT_FILENAME (*t);
!   if (TREE_CODE (*t) == EXPR_WITH_FILE_LOCATION)
      {
!       last_filename = EXPR_WFL_FILENAME (*t);
!       last_lineno = (EXPR_WFL_LINENO (*t) > 0 ? EXPR_WFL_LINENO (*t) : 
last_lineno);
      }
  
    /* Avoid traversal into subtrees specifically listed as
--- 815,824 ----
      last_lineno = (STMT_LINENO (*t) > 0 ? STMT_LINENO (*t) : last_lineno);
    if (TREE_CODE (*t) == FILE_STMT)
      last_filename = FILE_STMT_FILENAME (*t);
!   if (TREE_FILENAME (*t))
      {
!       last_filename = TREE_FILENAME (*t);
!       last_lineno = (TREE_LINENO (*t) > 0 ? TREE_LINENO (*t) : last_lineno);
      }
  
    /* Avoid traversal into subtrees specifically listed as
Index: gcc/tree-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-pretty-print.c,v
retrieving revision 1.1.2.11
diff -c -3 -p -r1.1.2.11 tree-pretty-print.c
*** gcc/tree-pretty-print.c	3 Jan 2003 01:57:23 -0000	1.1.2.11
--- gcc/tree-pretty-print.c	11 Jan 2003 00:36:56 -0000
*************** dump_generic_node (buffer, node, spc, fl
*** 475,481 ****
        break;
  
      case TYPE_DECL:
!       if (strcmp (DECL_SOURCE_FILE (node), "<built-in>") == 0)
  	{
  	  /* Don't print the declaration of built-in types.  */
  	  break;
--- 475,481 ----
        break;
  
      case TYPE_DECL:
!       if (strcmp (TREE_FILENAME (node), "<built-in>") == 0)
  	{
  	  /* Don't print the declaration of built-in types.  */
  	  break;
*************** dump_generic_node (buffer, node, spc, fl
*** 1102,1111 ****
        output_add_string (buffer, ">>>");
        break;
  
-     case EXPR_WITH_FILE_LOCATION:
-       dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
-       break;
- 
      case EXC_PTR_EXPR:
        output_add_string (buffer, "<<<exception object>>>");
        break;
--- 1102,1107 ----
*************** op_prio (op)
*** 1514,1522 ****
      case NON_LVALUE_EXPR:
        return op_prio (TREE_OPERAND (op, 0));
  
-     case EXPR_WITH_FILE_LOCATION:
-       return op_prio (EXPR_WFL_NODE (op));
- 
      default:
        /* Return an arbitrarily high precedence to avoid surrounding single
  	 VAR_DECLs in ()s.  */
--- 1510,1515 ----
*************** print_call_name (buffer, node)
*** 1666,1678 ****
      case INDIRECT_REF:
      case NOP_EXPR:
        dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0);
-       break;
-     
-     case EXPR_WITH_FILE_LOCATION:
-       if (TREE_CODE (TREE_OPERAND (op0, 0)) == VAR_DECL)
-         PRINT_FUNCTION_NAME (TREE_OPERAND (op0, 0));
-       else
- 	dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0);
        break;
      
      case COND_EXPR:
--- 1659,1664 ----
Index: gcc/tree-simple.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-simple.c,v
retrieving revision 1.1.4.24
diff -c -3 -p -r1.1.4.24 tree-simple.c
*** gcc/tree-simple.c	3 Jan 2003 01:57:23 -0000	1.1.4.24
--- gcc/tree-simple.c	11 Jan 2003 00:36:57 -0000
*************** is_simple_modify_expr (t)
*** 323,331 ****
      return 1;
  
    /* Additions to the original grammar.  Allow NON_LVALUE_EXPR
!      and EXPR_WITH_FILE_LOCATION wrappers.  */
!   if (TREE_CODE (t) == EXPR_WITH_FILE_LOCATION
!       || TREE_CODE (t) == NON_LVALUE_EXPR)
      return is_simple_modify_expr (TREE_OPERAND (t, 0));
  
    return ((TREE_CODE (t) == MODIFY_EXPR
--- 323,330 ----
      return 1;
  
    /* Additions to the original grammar.  Allow NON_LVALUE_EXPR
!      wrappers.  */
!   if (TREE_CODE (t) == NON_LVALUE_EXPR)
      return is_simple_modify_expr (TREE_OPERAND (t, 0));
  
    return ((TREE_CODE (t) == MODIFY_EXPR
*************** is_simple_binary_expr (t)
*** 381,389 ****
      return 1;
  
    /* Additions to the original grammar.  Allow NON_LVALUE_EXPR
!      and EXPR_WITH_FILE_LOCATION wrappers.  */
!   if (TREE_CODE (t) == EXPR_WITH_FILE_LOCATION
!       || TREE_CODE (t) == NON_LVALUE_EXPR)
      return is_simple_binary_expr (TREE_OPERAND (t, 0));
  
    return ((TREE_CODE_CLASS (TREE_CODE (t)) == '2'
--- 380,387 ----
      return 1;
  
    /* Additions to the original grammar.  Allow NON_LVALUE_EXPR
!      wrappers.  */
!   if (TREE_CODE (t) == NON_LVALUE_EXPR)
      return is_simple_binary_expr (TREE_OPERAND (t, 0));
  
    return ((TREE_CODE_CLASS (TREE_CODE (t)) == '2'
*************** is_simple_condexpr (t)
*** 407,415 ****
      return 1;
  
    /* Additions to the original grammar.  Allow NON_LVALUE_EXPR
!      and EXPR_WITH_FILE_LOCATION wrappers.  */
!   if (TREE_CODE (t) == EXPR_WITH_FILE_LOCATION
!       || TREE_CODE (t) == NON_LVALUE_EXPR)
      return is_simple_condexpr (TREE_OPERAND (t, 0));
  
    return (is_simple_val (t)
--- 405,412 ----
      return 1;
  
    /* Additions to the original grammar.  Allow NON_LVALUE_EXPR
!      wrappers.  */
!   if (TREE_CODE (t) == NON_LVALUE_EXPR)
      return is_simple_condexpr (TREE_OPERAND (t, 0));
  
    return (is_simple_val (t)
*************** is_simple_unary_expr (t)
*** 441,450 ****
  
    STRIP_NOPS (t);
  
!   /* Additions to the original grammar.  Allow NON_LVALUE_EXPR and
!      EXPR_WITH_FILE_LOCATION wrappers.  */
!   if (TREE_CODE (t) == EXPR_WITH_FILE_LOCATION
!       || TREE_CODE (t) == NON_LVALUE_EXPR
        || TREE_CODE (t) == VTABLE_REF)
      return is_simple_unary_expr (TREE_OPERAND (t, 0));
  
--- 438,446 ----
  
    STRIP_NOPS (t);
  
!   /* Additions to the original grammar.  Allow NON_LVALUE_EXPR
!      wrappers.  */
!   if (TREE_CODE (t) == NON_LVALUE_EXPR
        || TREE_CODE (t) == VTABLE_REF)
      return is_simple_unary_expr (TREE_OPERAND (t, 0));
  
*************** is_simple_id (t)
*** 670,678 ****
      return 1;
  
    /* Additions to the original grammar.  Allow identifiers wrapped in
!      NON_LVALUE_EXPR and EXPR_WITH_FILE_LOCATION.  */
!   if (TREE_CODE (t) == NON_LVALUE_EXPR
!       || TREE_CODE (t) == EXPR_WITH_FILE_LOCATION)
      return is_simple_id (TREE_OPERAND (t, 0));
  
    /* Allow real and imaginary parts of a complex variable.  */
--- 666,673 ----
      return 1;
  
    /* Additions to the original grammar.  Allow identifiers wrapped in
!      NON_LVALUE_EXPR.  */
!   if (TREE_CODE (t) == NON_LVALUE_EXPR)
      return is_simple_id (TREE_OPERAND (t, 0));
  
    /* Allow real and imaginary parts of a complex variable.  */
*************** get_base_symbol (t)
*** 956,962 ****
      case INDIRECT_REF:
      case REALPART_EXPR:
      case IMAGPART_EXPR:
-     case EXPR_WITH_FILE_LOCATION:
        return get_base_symbol (TREE_OPERAND (t, 0));
  
      default:
--- 951,956 ----
Index: gcc/tree-simple.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-simple.h,v
retrieving revision 1.1.4.19
diff -c -3 -p -r1.1.4.19 tree-simple.h
*** gcc/tree-simple.h	3 Jan 2003 01:57:23 -0000	1.1.4.19
--- gcc/tree-simple.h	11 Jan 2003 00:36:57 -0000
*************** extern tree update_line_number         P
*** 36,42 ****
  
  extern tree rationalize_compound_expr  PARAMS ((tree));
  extern tree right_assocify_expr		PARAMS ((tree));
! extern void wrap_all_with_wfl PARAMS ((tree *, const char *, int));
  
  /* Validation of SIMPLE expressions.  */
  int is_simple_expr                     PARAMS ((tree));
--- 36,42 ----
  
  extern tree rationalize_compound_expr  PARAMS ((tree));
  extern tree right_assocify_expr		PARAMS ((tree));
! extern void annotate_all_with_file_line PARAMS ((tree *, const char *, int));
  
  /* Validation of SIMPLE expressions.  */
  int is_simple_expr                     PARAMS ((tree));
*************** gsi_step (i)
*** 133,139 ****
       gimple_stmt_iterator *i;
  {
    tree t = *(i->tp);
-   STRIP_WFL (t);
    STRIP_NOPS (t);
    if (TREE_CODE (t) == COMPOUND_EXPR)
      i->tp = &(TREE_OPERAND (t, 1));
--- 133,138 ----
*************** gsi_stmt_ptr (i)
*** 153,159 ****
  #endif
  
    t = *(i.tp);
-   STRIP_WFL (t);
    STRIP_NOPS (t);
  
    if (TREE_CODE (t) == COMPOUND_EXPR)
--- 152,157 ----
*************** gsi_stmt (i)
*** 167,173 ****
       gimple_stmt_iterator i;
  {
    tree t = *(gsi_stmt_ptr (i));
-   STRIP_WFL (t);
    STRIP_NOPS (t);
    if (t == empty_stmt_node || t == error_mark_node)
      t = NULL_TREE;
--- 165,170 ----
Index: gcc/tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-ccp.c,v
retrieving revision 1.1.2.39
diff -c -3 -p -r1.1.2.39 tree-ssa-ccp.c
*** gcc/tree-ssa-ccp.c	8 Jan 2003 03:01:06 -0000	1.1.2.39
--- gcc/tree-ssa-ccp.c	11 Jan 2003 00:36:58 -0000
*************** evaluate_stmt (stmt)
*** 609,615 ****
    val.const_value = NULL_TREE;
  
    /* Evaluate a copy of the original statement.  */
-   STRIP_WFL (stmt);
    STRIP_NOPS (stmt);
    copy = stmt;
    walk_tree (&copy, copy_tree_r, NULL, NULL);
--- 609,614 ----
*************** fold_stmt (stmt)
*** 946,952 ****
  {
    tree rhs, result;
  
-   STRIP_WFL (stmt);
    STRIP_NOPS (stmt);
    rhs = get_rhs (stmt);
    if (rhs)
--- 945,950 ----
Index: gcc/tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dce.c,v
retrieving revision 1.1.2.19
diff -c -3 -p -r1.1.2.19 tree-ssa-dce.c
*** gcc/tree-ssa-dce.c	8 Jan 2003 03:01:06 -0000	1.1.2.19
--- gcc/tree-ssa-dce.c	11 Jan 2003 00:37:00 -0000
*************** find_useful_stmts ()
*** 233,239 ****
  	  tree stmt;
  
  	  t = stmt = gsi_stmt (i);
- 	  STRIP_WFL (stmt);
  	  STRIP_NOPS (stmt);
  
  	  /* Asms and Returns are required. Labels are kept because 
--- 233,238 ----
*************** remove_dead_stmts ()
*** 405,411 ****
  		}
  	      stats.removed++;
  
- 	      STRIP_WFL (t);
  	      STRIP_NOPS (t);
  
  	      /* If we have determined that a conditional branch statement
--- 404,409 ----
Index: gcc/tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-pre.c,v
retrieving revision 1.1.4.43
diff -c -3 -p -r1.1.4.43 tree-ssa-pre.c
*** gcc/tree-ssa-pre.c	8 Jan 2003 03:01:06 -0000	1.1.4.43
--- gcc/tree-ssa-pre.c	11 Jan 2003 00:37:24 -0000
*************** is_strred_cand (expr)
*** 288,295 ****
    tree_ref def, use;
    ref_list_iterator i;
    
-   STRIP_WFL (expr);
- 
    /* Multiplications that def a variable they use can't be strength reduced.
       Removing the multiplications would require adding more multiplications.
       IE a = a * 5. */
--- 288,293 ----
*************** is_injuring_def (ei, inj)
*** 339,345 ****
  {
    if (!inj || !is_simple_modify_expr (inj))
      return false;
-   STRIP_WFL (inj);
    if (TREE_CODE (TREE_OPERAND (inj, 1)) != PLUS_EXPR
        && TREE_CODE (TREE_OPERAND (inj, 1)) != MINUS_EXPR)
      return false;
--- 337,342 ----
*************** is_on_lhs (var_p, expr_p)
*** 536,542 ****
       tree *expr_p;
  {
    tree expr = *expr_p;
-   STRIP_WFL (expr);
    STRIP_NOPS (expr);
    switch (TREE_CODE (expr))
      {
--- 533,538 ----
*************** defs_y_dom_x (ei, y, x)
*** 645,651 ****
        tree yexpr, refexpr;
        
        yexpr = ref_stmt (y);
-       STRIP_WFL (yexpr);
        yexpr = TREE_OPERAND (yexpr, 1);
  
        if (!get_operand (yexpr, i))
--- 641,646 ----
*************** defs_y_dom_x (ei, y, x)
*** 660,666 ****
  	  if (ref_type (ref) != V_USE)
  	    continue;
  	  refexpr = ref_stmt (ref);
- 	  STRIP_WFL (refexpr);
  	  if (!is_simple_modify_expr (refexpr))
              continue;
            if (!names_match_p (ref_var (ref), get_operand (yexpr, i)))
--- 655,660 ----
*************** defs_match_p (ei, t1, t2)
*** 691,698 ****
    tree origt2;
    ref_list_iterator i;
    
-   STRIP_WFL (t1);
-   STRIP_WFL (t2);
    origt2 = t2;
    t2 = TREE_OPERAND (t2, 1);
    
--- 685,690 ----
*************** defs_match_p (ei, t1, t2)
*** 706,712 ****
  	  || is_on_lhs (&TREE_OPERAND (use1expr, 0), use1->common.stmt_p))
          continue;
  
-       STRIP_WFL (use1expr);
        use1expr = TREE_OPERAND (use1expr, 1);
        use2 = maybe_find_rhs_use_for_var (find_def_for_stmt (origt2),
  					 ref_var (use1));
--- 698,703 ----
*************** static inline bool
*** 777,783 ****
  is_a_call (expr)
       tree expr;
  {
-   STRIP_WFL (expr);
    STRIP_NOPS (expr);
    if (TREE_CODE (expr) == CALL_EXPR)
      return true;
--- 768,773 ----
*************** expr_phi_insertion (dfs, ei)
*** 1831,1837 ****
        temp = compute_idfs (dfs, occur);
        sbitmap_a_or_b (dfphis, dfphis, temp);
        sbitmap_free (temp);
-       STRIP_WFL (occur);
        if (kill != NULL)
  	continue;
        occur = TREE_OPERAND (occur, 1);
--- 1821,1826 ----
*************** calculate_increment (ei, expr)
*** 2142,2148 ****
       tree expr;
  {
    tree incr;
-   STRIP_WFL (expr);
    
    /*XXX: Currently assume it's like a = a + 5, thus, this will give us the 
5.
     */
--- 2131,2136 ----
*************** update_ssa_for_new_use (temp, newuse, de
*** 2452,2458 ****
    ref_stmt (use_orig_ref)->common.ann = NULL;
  #endif
    useexpr = ref_stmt (use_orig_ref);
-   STRIP_WFL (useexpr);
    if (TREE_CODE (useexpr) == INIT_EXPR)
      newmodifyexpr = build (INIT_EXPR, TREE_TYPE (useexpr), 
  			   TREE_OPERAND (useexpr, 0), temp);
--- 2440,2445 ----
*************** code_motion (ei, temp)
*** 2615,2623 ****
  		  fprintf (dump_file, " before statement ");
  		  print_generic_expr (dump_file,TREE_OPERAND (use_stmt, 0), 0);
  		  fprintf (dump_file, " on line %d\n", 
! 			   EXPR_WFL_LINENO (use_expr));
  		}
- 	      STRIP_WFL (use_expr);
  	      copy = TREE_OPERAND (use_expr, 1);
  	      walk_tree (&copy, copy_tree_r, NULL, NULL);
  	      newexpr = build (INIT_EXPR, TREE_TYPE (temp), temp, copy);
--- 2602,2609 ----
  		  fprintf (dump_file, " before statement ");
  		  print_generic_expr (dump_file,TREE_OPERAND (use_stmt, 0), 0);
  		  fprintf (dump_file, " on line %d\n", 
! 			   TREE_LINENO (use_expr));
  		}
  	      copy = TREE_OPERAND (use_expr, 1);
  	      walk_tree (&copy, copy_tree_r, NULL, NULL);
  	      newexpr = build (INIT_EXPR, TREE_TYPE (temp), temp, copy);
*************** code_motion (ei, temp)
*** 2691,2697 ****
                    fprintf (dump_file, " in statement ");
                    print_generic_stmt (dump_file, use_stmt, 0);
                    fprintf (dump_file, " on line %d\n", 
! 			   EXPR_WFL_LINENO (use_stmt));
                  }
  	      /* Update the SSA representation for a new use of the temporary.
  		 Do exactly what we do for the new use generated by the save. 
--- 2677,2683 ----
                    fprintf (dump_file, " in statement ");
                    print_generic_stmt (dump_file, use_stmt, 0);
                    fprintf (dump_file, " on line %d\n", 
! 			   TREE_LINENO (use_stmt));
                  }
  	      /* Update the SSA representation for a new use of the temporary.
  		 Do exactly what we do for the new use generated by the save. 
*************** process_left_occs_and_kills (bexprs, slo
*** 3071,3077 ****
       tree expr;
  {
    size_t k;
-   STRIP_WFL (expr);
    
    if (!is_simple_modify_expr (expr))
      return;
--- 3057,3062 ----
*************** tree_perform_ssapre (fndecl)
*** 3241,3247 ****
  	  if (ref_stmt (ref) == NULL_TREE)
  	    continue;
  
- 	  STRIP_WFL (expr);
  	  if (ref_type (ref) == V_USE 
  		&& htab_find (seen, orig_expr) != NULL)
  	    continue;
--- 3226,3231 ----
Index: gcc/tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.263.2.18
diff -c -3 -p -r1.263.2.18 tree.c
*** gcc/tree.c	3 Jan 2003 01:57:23 -0000	1.263.2.18
--- gcc/tree.c	11 Jan 2003 00:37:30 -0000
*************** make_node (code)
*** 304,312 ****
  	DECL_ALIGN (t) = 1;
        DECL_USER_ALIGN (t) = 0;
        DECL_IN_SYSTEM_HEADER (t) = in_system_header;
!       DECL_SOURCE_LINE (t) = lineno;
!       DECL_SOURCE_FILE (t) =
! 	(input_filename) ? input_filename : "<built-in>";
        DECL_UID (t) = next_decl_uid++;
  
        /* We have not yet computed the alias set for this declaration.  */
--- 304,314 ----
  	DECL_ALIGN (t) = 1;
        DECL_USER_ALIGN (t) = 0;
        DECL_IN_SYSTEM_HEADER (t) = in_system_header;
!       annotate_with_file_line (t,
! 			       (input_filename
! 				? input_filename
! 				: "<built-in"),
! 			       lineno);
        DECL_UID (t) = next_decl_uid++;
  
        /* We have not yet computed the alias set for this declaration.  */
*************** build_block (vars, tags, subblocks, supe
*** 2388,2424 ****
    return block;
  }
  
! /* EXPR_WITH_FILE_LOCATION are used to keep track of the exact
!    location where an expression or an identifier were encountered. It
!    is necessary for languages where the frontend parser will handle
!    recursively more than one file (Java is one of them).  */
  
! tree
! build_expr_wfl (node, file, line, col)
       tree node;
       const char *file;
!      int line, col;
  {
!   static const char *last_file = 0;
!   static tree last_filenode = NULL_TREE;
!   tree wfl = make_node (EXPR_WITH_FILE_LOCATION);
! 
!   EXPR_WFL_NODE (wfl) = node;
!   EXPR_WFL_SET_LINECOL (wfl, line, col);
!   if (file != last_file)
!     {
!       last_file = file;
!       last_filenode = file ? get_identifier (file) : NULL_TREE;
!     }
! 
!   EXPR_WFL_FILENAME_NODE (wfl) = last_filenode;
!   if (node)
!     {
!       TREE_SIDE_EFFECTS (wfl) = TREE_SIDE_EFFECTS (node);
!       TREE_TYPE (wfl) = TREE_TYPE (node);
!     }
! 
!   return wfl;
  }
  
  /* Return a declaration like DDECL except that its DECL_ATTRIBUTES
--- 2390,2431 ----
    return block;
  }
  
! static GTY(()) tree last_annotated_node;
  
! /* Record the exact location where an expression or an identifier were
!    encountered.  */
! void
! annotate_with_file_line (node, file, line)
       tree node;
       const char *file;
!      int line;
  {
!   /* Roughly one percent of the calls to this function are to annotate
!      a node with the same information already attached to that node!
!      Just return instead of wasting memory.  */
!   if (TREE_LOCUS (node)
!       && (TREE_FILENAME (node) == file
! 	  || ! strcmp (TREE_FILENAME (node), file))
!       && TREE_LINENO (node) == line)
!     return;
! 
!   /* In heavily macroized code (such as GCC itself) this single
!      entry cache can reduce the number of allocations by more
!      than half.  */
!   if (last_annotated_node
!       && TREE_LOCUS (last_annotated_node)
!       && (TREE_FILENAME (last_annotated_node) == file
! 	  || ! strcmp (TREE_FILENAME (last_annotated_node), file))
!       && TREE_LINENO (last_annotated_node) == line)
!     {
!       TREE_LOCUS (node) = TREE_LOCUS (last_annotated_node); 
!       return;
!     }
! 
!   TREE_LOCUS (node) = ggc_alloc (sizeof (location_t));
!   TREE_LINENO (node) = line;
!   TREE_FILENAME (node) = file;
!   last_annotated_node = node;
  }
  
  /* Return a declaration like DDECL except that its DECL_ATTRIBUTES
Index: gcc/tree.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.def,v
retrieving revision 1.52.2.4
diff -c -3 -p -r1.52.2.4 tree.def
*** gcc/tree.def	3 Jan 2003 01:57:24 -0000	1.52.2.4
--- gcc/tree.def	11 Jan 2003 00:37:31 -0000
*************** DEFTREECODE (STRING_CST, "string_cst", '
*** 323,332 ****
      built-in functions.  Its value is an enum built_in_function
      that says which built-in function it is.
  
-    DECL_SOURCE_FILE holds a filename string and DECL_SOURCE_LINE
-    holds a line number.  In some cases these can be the location of
-    a reference, if no definition has been seen.
- 
     DECL_ABSTRACT is nonzero if the decl represents an abstract instance
     of a decl (i.e. one which is nested within an abstract instance of a
     inline function.  */
--- 323,328 ----
*************** DEFTREECODE (POSTINCREMENT_EXPR, "postin
*** 773,787 ****
  
  /* Used to implement `va_arg'.  */
  DEFTREECODE (VA_ARG_EXPR, "va_arg_expr", 'e', 1)
- 
- /* Annotates a tree node (usually an expression) with source location
-    information: a file name (EXPR_WFL_FILENAME);  a line number
-    (EXPR_WFL_LINENO); and column number (EXPR_WFL_COLNO).  It is
-    expanded as the contained node (EXPR_WFL_NODE);  a line note should
-    be emitted first if EXPR_WFL_EMIT_LINE_NOTE.  
-    The third operand is only used in the Java front-end, and will
-    eventually be removed.  */
- DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location", 'e', 3)
  
  /* Evaluate operand 1.  If and only if an exception is thrown during
     the evaluation of operand 1, evaluate operand 2.
--- 769,774 ----
Index: gcc/tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.342.2.37
diff -c -3 -p -r1.342.2.37 tree.h
*** gcc/tree.h	8 Jan 2003 03:01:06 -0000	1.342.2.37
--- gcc/tree.h	11 Jan 2003 00:37:38 -0000
*************** struct tree_common GTY(())
*** 128,133 ****
--- 128,134 ----
    tree chain;
    tree type;
    struct tree_ann_d *ann;
+   location_t *locus;
  
    ENUM_BITFIELD(tree_code) code : 8;
  
*************** struct tree_common GTY(())
*** 198,205 ****
             VAR_DECL or FUNCTION_DECL or IDENTIFIER_NODE
         TREE_VIA_PUBLIC in
             TREE_LIST or TREE_VEC
-        EXPR_WFL_EMIT_LINE_NOTE in
-            EXPR_WITH_FILE_LOCATION
         ASM_VOLATILE_P in
             ASM_EXPR
  
--- 199,204 ----
*************** extern void tree_vec_elt_check_failed PA
*** 424,437 ****
  	     == TREE_TYPE (TREE_OPERAND (EXP, 0))))		\
      (EXP) = TREE_OPERAND (EXP, 0)
  
- /* Given an expression as a tree, strip any EXPR_WFLs.  */
- 
- #define STRIP_WFL(NODE)					\
-   do {							\
-     while (TREE_CODE (NODE) == EXPR_WITH_FILE_LOCATION)	\
-       NODE = EXPR_WFL_NODE (NODE);			\
-   } while (0)
- 
  /* Nonzero if TYPE represents an integral type.  Note that we do not
     include COMPLEX types here.  */
  
--- 423,428 ----
*************** struct tree_vec GTY(())
*** 908,927 ****
  #define LOOP_EXPR_BODY(NODE) TREE_OPERAND (LOOP_EXPR_CHECK (NODE), 0)
  
  /* In an EXPR_WITH_FILE_LOCATION node.  */
! #define EXPR_WFL_EMIT_LINE_NOTE(NODE) \
!   (EXPR_WITH_FILE_LOCATION_CHECK (NODE)->common.public_flag)
! #define EXPR_WFL_NODE(NODE) \
!   TREE_OPERAND (EXPR_WITH_FILE_LOCATION_CHECK (NODE), 0)
! #define EXPR_WFL_FILENAME_NODE(NODE) \
!   TREE_OPERAND (EXPR_WITH_FILE_LOCATION_CHECK (NODE), 1)
! #define EXPR_WFL_FILENAME(NODE) \
!   IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE (NODE))
! /* ??? Java uses this in all expressions.  */
! #define EXPR_WFL_LINECOL(NODE) (EXPR_CHECK (NODE)->exp.complexity)
! #define EXPR_WFL_LINENO(NODE) (EXPR_WFL_LINECOL (NODE) >> 12)
! #define EXPR_WFL_COLNO(NODE) (EXPR_WFL_LINECOL (NODE) & 0xfff)
! #define EXPR_WFL_SET_LINECOL(NODE, LINE, COL) \
!   (EXPR_WFL_LINECOL(NODE) = ((LINE) << 12) | ((COL) & 0xfff))
  
  /* In a TARGET_EXPR node.  */
  #define TARGET_EXPR_SLOT(NODE) TREE_OPERAND (TARGET_EXPR_CHECK (NODE), 0)
--- 899,910 ----
  #define LOOP_EXPR_BODY(NODE) TREE_OPERAND (LOOP_EXPR_CHECK (NODE), 0)
  
  /* In an EXPR_WITH_FILE_LOCATION node.  */
! #define TREE_LOCUS(NODE) \
!   ((NODE)->common.locus)
! #define TREE_FILENAME(NODE) \
!   ((NODE)->common.locus->file)
! #define TREE_LINENO(NODE) \
!   ((NODE)->common.locus->line)
  
  /* In a TARGET_EXPR node.  */
  #define TARGET_EXPR_SLOT(NODE) TREE_OPERAND (TARGET_EXPR_CHECK (NODE), 0)
*************** struct tree_type GTY(())
*** 1550,1562 ****
  /* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
     if nonzero, indicates that the field occupies the type.  */
  #define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->decl.initial)
- /* These two fields describe where in the source code the declaration
-    was.  If the declaration appears in several places (as for a C
-    function that is declared first and then defined later), this
-    information should refer to the definition.  */
- #define DECL_SOURCE_LOCATION(NODE) (DECL_CHECK (NODE)->decl.locus)
- #define DECL_SOURCE_FILE(NODE) (DECL_SOURCE_LOCATION (NODE).file)
- #define DECL_SOURCE_LINE(NODE) (DECL_SOURCE_LOCATION (NODE).line)
  /* Holds the size of the datum, in bits, as a tree expression.
     Need not be constant.  */
  #define DECL_SIZE(NODE) (DECL_CHECK (NODE)->decl.size)
--- 1533,1538 ----
*************** struct function;
*** 1882,1888 ****
  struct tree_decl GTY(())
  {
    struct tree_common common;
-   location_t locus;
    unsigned int uid;
    tree size;
    ENUM_BITFIELD(machine_mode) mode : 8;
--- 1858,1863 ----
*************** extern tree build1			PARAMS ((enum tree_
*** 2333,2339 ****
  extern tree build_tree_list		PARAMS ((tree, tree));
  extern tree build_decl			PARAMS ((enum tree_code, tree, tree));
  extern tree build_block			PARAMS ((tree, tree, tree, tree, tree));
! extern tree build_expr_wfl              PARAMS ((tree, const char *, int, 
int));
  
  /* Construct various nodes representing data types.  */
  
--- 2308,2314 ----
  extern tree build_tree_list		PARAMS ((tree, tree));
  extern tree build_decl			PARAMS ((enum tree_code, tree, tree));
  extern tree build_block			PARAMS ((tree, tree, tree, tree, tree));
! extern void annotate_with_file_line	PARAMS ((tree, const char *, int));
  
  /* Construct various nodes representing data types.  */
  
Index: gcc/varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.295.2.19
diff -c -3 -p -r1.295.2.19 varasm.c
*** gcc/varasm.c	27 Dec 2002 01:51:23 -0000	1.295.2.19
--- gcc/varasm.c	11 Jan 2003 00:37:46 -0000
*************** assemble_variable (decl, top_level, at_e
*** 1452,1459 ****
  
    if (!dont_output_data && DECL_SIZE (decl) == 0)
      {
!       error_with_file_and_line (DECL_SOURCE_FILE (decl),
! 				DECL_SOURCE_LINE (decl),
  				"storage size of `%s' isn't known",
  				IDENTIFIER_POINTER (DECL_NAME (decl)));
        TREE_ASM_WRITTEN (decl) = 1;
--- 1452,1459 ----
  
    if (!dont_output_data && DECL_SIZE (decl) == 0)
      {
!       error_with_file_and_line (TREE_FILENAME (decl),
! 				TREE_LINENO (decl),
  				"storage size of `%s' isn't known",
  				IDENTIFIER_POINTER (DECL_NAME (decl)));
        TREE_ASM_WRITTEN (decl) = 1;
Index: gcc/xcoffout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/xcoffout.c,v
retrieving revision 1.30.2.2
diff -c -3 -p -r1.30.2.2 xcoffout.c
*** gcc/xcoffout.c	3 Dec 2002 22:54:39 -0000	1.30.2.2
--- gcc/xcoffout.c	11 Jan 2003 00:37:47 -0000
*************** xcoffout_declare_function (file, decl, n
*** 431,437 ****
    /* Any pending .bi or .ei must occur before the .function pseudo op.
       Otherwise debuggers will think that the function is in the previous
       file and/or at the wrong line number.  */
!   xcoffout_source_file (file, DECL_SOURCE_FILE (decl), 0);
    dbxout_symbol (decl, 0);
  
    /* .function NAME, TOP, MAPPING, TYPE, SIZE
--- 431,437 ----
    /* Any pending .bi or .ei must occur before the .function pseudo op.
       Otherwise debuggers will think that the function is in the previous
       file and/or at the wrong line number.  */
!   xcoffout_source_file (file, TREE_FILENAME (decl), 0);
    dbxout_symbol (decl, 0);
  
    /* .function NAME, TOP, MAPPING, TYPE, SIZE
Index: gcc/ada/trans.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/trans.c,v
retrieving revision 1.19.2.4
diff -c -3 -p -r1.19.2.4 trans.c
*** gcc/ada/trans.c	3 Dec 2002 22:54:44 -0000	1.19.2.4
--- gcc/ada/trans.c	11 Jan 2003 00:38:46 -0000
*************** tree_transform (gnat_node)
*** 2617,2624 ****
  	   the body so that the line number notes are written 
  	   correctly.  */
  	set_lineno (gnat_node, 0);
! 	DECL_SOURCE_FILE (gnu_subprog_decl) = input_filename;
! 	DECL_SOURCE_LINE (gnu_subprog_decl) = lineno;
  
  	begin_subprog_body (gnu_subprog_decl);
  	set_lineno (gnat_node, 1);
--- 2617,2623 ----
  	   the body so that the line number notes are written 
  	   correctly.  */
  	set_lineno (gnat_node, 0);
! 	annotate_with_file_line (gnu_subprog_decl, input_filename, lineno);
  
  	begin_subprog_body (gnu_subprog_decl);
  	set_lineno (gnat_node, 1);
*************** build_unit_elab (gnat_unit, body_p, gnu_
*** 5340,5347 ****
        {
  	tree lhs = TREE_PURPOSE (gnu_elab_list);
  
! 	input_filename = DECL_SOURCE_FILE (lhs);
! 	lineno = DECL_SOURCE_LINE (lhs);
  
  	/* If LHS has a padded type, convert it to the unpadded type
  	   so the assignment is done properly.  */
--- 5339,5346 ----
        {
  	tree lhs = TREE_PURPOSE (gnu_elab_list);
  
! 	input_filename = TREE_FILENAME (lhs);
! 	lineno = TREE_LINENO (lhs);
  
  	/* If LHS has a padded type, convert it to the unpadded type
  	   so the assignment is done properly.  */
Index: gcc/ada/utils.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/utils.c,v
retrieving revision 1.19.2.4
diff -c -3 -p -r1.19.2.4 utils.c
*** gcc/ada/utils.c	3 Dec 2002 22:54:44 -0000	1.19.2.4
--- gcc/ada/utils.c	11 Jan 2003 00:38:50 -0000
*************** create_label_decl (label_name)
*** 1663,1670 ****
  
    DECL_CONTEXT (label_decl)     = current_function_decl;
    DECL_MODE (label_decl)        = VOIDmode;
!   DECL_SOURCE_LINE (label_decl) = lineno;
!   DECL_SOURCE_FILE (label_decl) = input_filename;
  
    return label_decl;
  }
--- 1663,1669 ----
  
    DECL_CONTEXT (label_decl)     = current_function_decl;
    DECL_MODE (label_decl)        = VOIDmode;
!   annotate_with_file_line (label_decl, input_filename, lineno);
  
    return label_decl;
  }
Index: gcc/config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.263.2.13
diff -c -3 -p -r1.263.2.13 alpha.c
*** gcc/config/alpha/alpha.c	27 Dec 2002 01:51:29 -0000	1.263.2.13
--- gcc/config/alpha/alpha.c	11 Jan 2003 00:39:31 -0000
*************** alpha_start_function (file, fnname, decl
*** 7439,7450 ****
      {
  #ifdef ASM_OUTPUT_SOURCE_FILENAME
        ASM_OUTPUT_SOURCE_FILENAME (file,
! 				  DECL_SOURCE_FILE (current_function_decl));
  #endif
  #ifdef ASM_OUTPUT_SOURCE_LINE
        if (debug_info_level != DINFO_LEVEL_TERSE)
          ASM_OUTPUT_SOURCE_LINE (file,
! 				DECL_SOURCE_LINE (current_function_decl));
  #endif
      }
  
--- 7439,7450 ----
      {
  #ifdef ASM_OUTPUT_SOURCE_FILENAME
        ASM_OUTPUT_SOURCE_FILENAME (file,
! 				  TREE_FILENAME (current_function_decl));
  #endif
  #ifdef ASM_OUTPUT_SOURCE_LINE
        if (debug_info_level != DINFO_LEVEL_TERSE)
          ASM_OUTPUT_SOURCE_LINE (file,
! 				TREE_LINENO (current_function_decl));
  #endif
      }
  
Index: gcc/config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.211.2.18
diff -c -3 -p -r1.211.2.18 mips.c
*** gcc/config/mips/mips.c	27 Dec 2002 01:51:40 -0000	1.211.2.18
--- gcc/config/mips/mips.c	11 Jan 2003 00:40:37 -0000
*************** mips_output_function_prologue (file, siz
*** 7161,7171 ****
       need the source filename more than once in the file, beyond what is
       emitted by the debug information.  */
    if (!TARGET_GAS)
!     ASM_OUTPUT_SOURCE_FILENAME (file, DECL_SOURCE_FILE 
(current_function_decl));
  
  #ifdef SDB_DEBUGGING_INFO
    if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG)
!     ASM_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl));
  #endif
  
    /* In mips16 mode, we may need to generate a 32 bit to handle
--- 7161,7171 ----
       need the source filename more than once in the file, beyond what is
       emitted by the debug information.  */
    if (!TARGET_GAS)
!     ASM_OUTPUT_SOURCE_FILENAME (file, TREE_FILENAME (current_function_decl));
  
  #ifdef SDB_DEBUGGING_INFO
    if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG)
!     ASM_OUTPUT_SOURCE_LINE (file, TREE_LINENO (current_function_decl));
  #endif
  
    /* In mips16 mode, we may need to generate a 32 bit to handle
Index: gcc/cp/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/class.c,v
retrieving revision 1.452.2.15
diff -c -3 -p -r1.452.2.15 class.c
*** gcc/cp/class.c	3 Jan 2003 01:57:29 -0000	1.452.2.15
--- gcc/cp/class.c	11 Jan 2003 00:41:36 -0000
*************** finish_struct (t, attributes)
*** 5439,5446 ****
  
    /* Nadger the current location so that diagnostics point to the start of
       the struct, not the end.  */
!   input_filename = DECL_SOURCE_FILE (TYPE_NAME (t));
!   lineno = DECL_SOURCE_LINE (TYPE_NAME (t));
  
    if (processing_template_decl)
      {
--- 5439,5446 ----
  
    /* Nadger the current location so that diagnostics point to the start of
       the struct, not the end.  */
!   input_filename = TREE_FILENAME (TYPE_NAME (t));
!   lineno = TREE_LINENO (TYPE_NAME (t));
  
    if (processing_template_decl)
      {
Index: gcc/cp/cp-tree.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.def,v
retrieving revision 1.63.2.4
diff -c -3 -p -r1.63.2.4 cp-tree.def
*** gcc/cp/cp-tree.def	19 Dec 2002 18:31:28 -0000	1.63.2.4
--- gcc/cp/cp-tree.def	11 Jan 2003 00:41:36 -0000
*************** DEFTREECODE (USER_CONV, "user_conv", 'e'
*** 285,290 ****
--- 285,299 ----
  DEFTREECODE (AMBIG_CONV, "ambig_conv", 'e', 1)
  DEFTREECODE (RVALUE_CONV, "rvalue_conv", 'e', 1)
  
+ /* Template instantiation level node.
+ 
+    Operand 1 contains the original DECL node and can be accessed via 
TINST_DECL.
+ 
+    A stack of template instantiation nodes is kept through the TREE_CHAIN
+    fields of these nodes.  */
+ 
+ DEFTREECODE (TINST_LEVEL, "TINST_LEVEL", 'e', 1)
+ 
  /*
  Local variables:
  mode:c
Index: gcc/cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.719.2.22
diff -c -3 -p -r1.719.2.22 cp-tree.h
*** gcc/cp/cp-tree.h	27 Dec 2002 01:51:50 -0000	1.719.2.22
--- gcc/cp/cp-tree.h	11 Jan 2003 00:41:49 -0000
*************** typedef enum unification_kind_t {
*** 3164,3175 ****
    DEDUCE_ORDER
  } unification_kind_t;
  
! /* Macros for operating on a template instantiation level node, represented
!    by an EXPR_WITH_FILE_LOCATION.  */
  
! #define TINST_DECL(NODE) EXPR_WFL_NODE (NODE)
! #define TINST_LINE(NODE) EXPR_WFL_LINENO (NODE)
! #define TINST_FILE(NODE) EXPR_WFL_FILENAME (NODE)
  
  /* in class.c */
  
--- 3164,3172 ----
    DEDUCE_ORDER
  } unification_kind_t;
  
! /* Macros for operating on a template instantiation level node.  */
  
! #define TINST_DECL(NODE) TREE_OPERAND (NODE, 0)
  
  /* in class.c */
  
Index: gcc/cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.911.2.21
diff -c -3 -p -r1.911.2.21 decl.c
*** gcc/cp/decl.c	3 Jan 2003 01:57:33 -0000	1.911.2.21
--- gcc/cp/decl.c	11 Jan 2003 00:43:55 -0000
*************** print_binding_level (lvl)
*** 1971,1977 ****
  	    continue;
  	  if (no_print_builtins
  	      && (TREE_CODE (t) == TYPE_DECL)
! 	      && (!strcmp (DECL_SOURCE_FILE (t),"<built-in>")))
  	    continue;
  
  	  /* Function decls tend to have longer names.  */
--- 1971,1977 ----
  	    continue;
  	  if (no_print_builtins
  	      && (TREE_CODE (t) == TYPE_DECL)
! 	      && (!strcmp (TREE_FILENAME (t),"<built-in>")))
  	    continue;
  
  	  /* Function decls tend to have longer names.  */
*************** duplicate_decls (newdecl, olddecl)
*** 3447,3455 ****
        if (DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)) == NULL_TREE
  	  && DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl)) != NULL_TREE)
  	{
! 	  DECL_SOURCE_LOCATION (olddecl) 
! 	    = DECL_SOURCE_LOCATION (DECL_TEMPLATE_RESULT (olddecl))
! 	    = DECL_SOURCE_LOCATION (newdecl);
  	}
  
        return 1;
--- 3447,3454 ----
        if (DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)) == NULL_TREE
  	  && DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl)) != NULL_TREE)
  	{
! 	  TREE_LOCUS (olddecl) = TREE_LOCUS (newdecl);
! 	  TREE_LOCUS (DECL_TEMPLATE_RESULT (olddecl)) = TREE_LOCUS (newdecl);
  	}
  
        return 1;
*************** duplicate_decls (newdecl, olddecl)
*** 3487,3493 ****
  							 TYPE_RAISES_EXCEPTIONS (oldtype));
  
  	  if ((pedantic || ! DECL_IN_SYSTEM_HEADER (olddecl))
! 	      && DECL_SOURCE_LINE (olddecl) != 0
  	      && flag_exceptions
  	      && !comp_except_specs (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (newdecl)),
  	                             TYPE_RAISES_EXCEPTIONS (TREE_TYPE (olddecl)), 
1))
--- 3486,3492 ----
  							 TYPE_RAISES_EXCEPTIONS (oldtype));
  
  	  if ((pedantic || ! DECL_IN_SYSTEM_HEADER (olddecl))
! 	      && TREE_LINENO (olddecl) != 0
  	      && flag_exceptions
  	      && !comp_except_specs (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (newdecl)),
  	                             TYPE_RAISES_EXCEPTIONS (TREE_TYPE (olddecl)), 
1))
*************** duplicate_decls (newdecl, olddecl)
*** 3524,3530 ****
  	  && DECL_INITIAL (olddecl) != NULL_TREE)
  	{
  	  DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
! 	  DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl);
  	  if (CAN_HAVE_FULL_LANG_DECL_P (newdecl)
  	      && DECL_LANG_SPECIFIC (newdecl)
  	      && DECL_LANG_SPECIFIC (olddecl))
--- 3523,3529 ----
  	  && DECL_INITIAL (olddecl) != NULL_TREE)
  	{
  	  DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
! 	  TREE_LOCUS (newdecl) = TREE_LOCUS (olddecl);
  	  if (CAN_HAVE_FULL_LANG_DECL_P (newdecl)
  	      && DECL_LANG_SPECIFIC (newdecl)
  	      && DECL_LANG_SPECIFIC (olddecl))
*************** duplicate_decls (newdecl, olddecl)
*** 3716,3721 ****
--- 3715,3721 ----
        memcpy ((char *) olddecl + sizeof (struct tree_common),
  	      (char *) newdecl + sizeof (struct tree_common),
  	      function_size - sizeof (struct tree_common));
+       TREE_LOCUS (olddecl) = TREE_LOCUS (newdecl);
  
        if (DECL_TEMPLATE_INSTANTIATION (newdecl))
  	{
*************** duplicate_decls (newdecl, olddecl)
*** 3755,3760 ****
--- 3755,3761 ----
  	      (char *) newdecl + sizeof (struct tree_common),
  	      sizeof (struct tree_decl) - sizeof (struct tree_common)
  	      + TREE_CODE_LENGTH (TREE_CODE (newdecl)) * sizeof (char *));
+       TREE_LOCUS (olddecl) = TREE_LOCUS (newdecl);
      }
  
    DECL_UID (olddecl) = olddecl_uid;
*************** pushdecl (x)
*** 3987,3993 ****
        if (TREE_CODE (x) == TYPE_DECL)
  	{
  	  tree type = TREE_TYPE (x);
! 	  if (DECL_SOURCE_LINE (x) == 0)
              {
  	      if (TYPE_NAME (type) == 0)
  	        TYPE_NAME (type) = x;
--- 3988,3994 ----
        if (TREE_CODE (x) == TYPE_DECL)
  	{
  	  tree type = TREE_TYPE (x);
! 	  if (TREE_LINENO (x) == 0)
              {
  	      if (TYPE_NAME (type) == 0)
  	        TYPE_NAME (type) = x;
*************** make_label_decl (id, local_p)
*** 4772,4779 ****
  
    /* Say where one reference is to the label, for the sake of the
       error if it is not defined.  */
!   DECL_SOURCE_LINE (decl) = lineno;
!   DECL_SOURCE_FILE (decl) = input_filename;
  
    /* Record the fact that this identifier is bound to this label.  */
    SET_IDENTIFIER_LABEL_VALUE (id, decl);
--- 4773,4779 ----
  
    /* Say where one reference is to the label, for the sake of the
       error if it is not defined.  */
!   annotate_with_file_line (decl, input_filename, lineno);
  
    /* Record the fact that this identifier is bound to this label.  */
    SET_IDENTIFIER_LABEL_VALUE (id, decl);
*************** define_label (filename, line, name)
*** 5102,5109 ****
        /* Mark label as having been defined.  */
        DECL_INITIAL (decl) = error_mark_node;
        /* Say where in the source.  */
!       DECL_SOURCE_FILE (decl) = filename;
!       DECL_SOURCE_LINE (decl) = line;
        if (ent)
  	{
  	  ent->names_in_scope = current_binding_level->names;
--- 5102,5108 ----
        /* Mark label as having been defined.  */
        DECL_INITIAL (decl) = error_mark_node;
        /* Say where in the source.  */
!       annotate_with_file_line (decl, filename, line);
        if (ent)
  	{
  	  ent->names_in_scope = current_binding_level->names;
*************** finish_function (flags)
*** 14436,14441 ****
--- 14435,14442 ----
    tree fntype, ctype = NULL_TREE;
    int inclass_inline = (flags & 2) != 0;
    int nested;
+   int saved_lineno;
+   const char *saved_filename;
  
    /* When we get some parse errors, we can end up without a
       current_function_decl, so cope.  */
*************** finish_function (flags)
*** 14566,14572 ****
  	 inline function, as we might never be compiled separately.  */
        && (DECL_INLINE (fndecl) || processing_template_decl))
      warning ("no return statement in function returning non-void");
!     
    /* Genericize before inlining.  */
    if (!flag_disable_simple && !processing_template_decl)
      c_genericize (fndecl);
--- 14567,14579 ----
  	 inline function, as we might never be compiled separately.  */
        && (DECL_INLINE (fndecl) || processing_template_decl))
      warning ("no return statement in function returning non-void");
! 
!   /* Genericizing can change the current line number and filename.
!      We need to save/restore so that we can emit the proper line
!      note for the end of the function later.  */
!   saved_lineno = lineno;
!   saved_filename = input_filename;
! 
    /* Genericize before inlining.  */
    if (!flag_disable_simple && !processing_template_decl)
      c_genericize (fndecl);
*************** finish_function (flags)
*** 14577,14582 ****
--- 14584,14593 ----
       CFUN.  Do so explicitly.  */
    free_after_compilation (cfun);
    cfun = NULL;
+ 
+   /* Restore file and line information.  */
+   lineno = saved_lineno;
+   input_filename = saved_filename;
  
    /* If this is an in-class inline definition, we may have to pop the
       bindings for the template parameters that we added in
Index: gcc/cp/decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.540.2.20
diff -c -3 -p -r1.540.2.20 decl2.c
*** gcc/cp/decl2.c	3 Jan 2003 01:57:34 -0000	1.540.2.20
--- gcc/cp/decl2.c	11 Jan 2003 00:44:03 -0000
*************** warn_if_unknown_interface (decl)
*** 189,196 ****
  
        if (til)
  	{
! 	  lineno = TINST_LINE (til);
! 	  input_filename = TINST_FILE (til);
  	}
        warning ("template `%#D' instantiated in file without #pragma 
interface",
  		  decl);
--- 189,196 ----
  
        if (til)
  	{
! 	  lineno = TREE_LINENO (til);
! 	  input_filename = TREE_FILENAME (til);
  	}
        warning ("template `%#D' instantiated in file without #pragma 
interface",
  		  decl);
*************** start_static_initialization_or_destructi
*** 2367,2374 ****
       where DECL was declared so that error-messages make sense, and so
       that the debugger will show somewhat sensible file and line
       information.  */
!   input_filename = DECL_SOURCE_FILE (decl);
!   lineno = DECL_SOURCE_LINE (decl);
  
    /* Because of:
  
--- 2367,2374 ----
       where DECL was declared so that error-messages make sense, and so
       that the debugger will show somewhat sensible file and line
       information.  */
!   input_filename = TREE_FILENAME (decl);
!   lineno = TREE_LINENO (decl);
  
    /* Because of:
  
Index: gcc/cp/error.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/error.c,v
retrieving revision 1.180.2.8
diff -c -3 -p -r1.180.2.8 error.c
*** gcc/cp/error.c	17 Dec 2002 20:47:55 -0000	1.180.2.8
--- gcc/cp/error.c	11 Jan 2003 00:44:07 -0000
*************** dump_expr (t, flags)
*** 1827,1836 ****
        dump_expr (TREE_OPERAND (t, 0), flags);
        break;
  
-     case EXPR_WITH_FILE_LOCATION:
-       dump_expr (EXPR_WFL_NODE (t), flags);
-       break;
- 
      case CONSTRUCTOR:
        if (TREE_TYPE (t) && TYPE_PTRMEMFUNC_P (TREE_TYPE (t)))
  	{
--- 1827,1832 ----
*************** cp_file_of (t)
*** 2165,2177 ****
       tree t;
  {
    if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
!     return DECL_SOURCE_FILE (DECL_CONTEXT (t));
    else if (TYPE_P (t))
!     return DECL_SOURCE_FILE (TYPE_MAIN_DECL (t));
    else if (TREE_CODE (t) == OVERLOAD)
!     return DECL_SOURCE_FILE (OVL_FUNCTION (t));
    else
!     return DECL_SOURCE_FILE (t);
  }
  
  int
--- 2161,2173 ----
       tree t;
  {
    if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
!     return TREE_FILENAME (DECL_CONTEXT (t));
    else if (TYPE_P (t))
!     return TREE_FILENAME (TYPE_MAIN_DECL (t));
    else if (TREE_CODE (t) == OVERLOAD)
!     return TREE_FILENAME (OVL_FUNCTION (t));
    else
!     return TREE_FILENAME (t);
  }
  
  int
*************** cp_line_of (t)
*** 2180,2196 ****
  {
    int line = 0;
    if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
!     line = DECL_SOURCE_LINE (DECL_CONTEXT (t));
    if (TREE_CODE (t) == TYPE_DECL && DECL_ARTIFICIAL (t)
        && TYPE_MAIN_DECL (TREE_TYPE (t)))
      t = TREE_TYPE (t);
  
    if (TYPE_P (t))
!     line = DECL_SOURCE_LINE (TYPE_MAIN_DECL (t));
    else if (TREE_CODE (t) == OVERLOAD)
!     line = DECL_SOURCE_LINE (OVL_FUNCTION (t));
    else
!     line = DECL_SOURCE_LINE (t);
  
    if (line == 0)
      return lineno;
--- 2176,2192 ----
  {
    int line = 0;
    if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
!     line = TREE_LINENO (DECL_CONTEXT (t));
    if (TREE_CODE (t) == TYPE_DECL && DECL_ARTIFICIAL (t)
        && TYPE_MAIN_DECL (TREE_TYPE (t)))
      t = TREE_TYPE (t);
  
    if (TYPE_P (t))
!     line = TREE_LINENO (TYPE_MAIN_DECL (t));
    else if (TREE_CODE (t) == OVERLOAD)
!     line = TREE_LINENO (OVL_FUNCTION (t));
    else
!     line = TREE_LINENO (t);
  
    if (line == 0)
      return lineno;
*************** print_instantiation_full_context (contex
*** 2490,2497 ****
                               decl_as_string (TINST_DECL (p),
                                               TFF_DECL_SPECIFIERS | 
TFF_RETURN_TYPE));
  
! 	  line = TINST_LINE (p);
! 	  file = TINST_FILE (p);
  	  p = TREE_CHAIN (p);
  	}
      }
--- 2486,2493 ----
                               decl_as_string (TINST_DECL (p),
                                               TFF_DECL_SPECIFIERS | 
TFF_RETURN_TYPE));
  
! 	  line = TREE_LINENO (p);
! 	  file = TREE_FILENAME (p);
  	  p = TREE_CHAIN (p);
  	}
      }
*************** print_instantiation_partial_context (con
*** 2512,2519 ****
        output_verbatim
          (&context->buffer, "%s:%d:   instantiated from `%s'\n", file, line,
           decl_as_string (TINST_DECL (t), TFF_DECL_SPECIFIERS | 
TFF_RETURN_TYPE));
!       line = TINST_LINE (t);
!       file = TINST_FILE (t);
      }
    output_verbatim (&context->buffer, "%s:%d:   instantiated from here\n", 
file, line);
  }
--- 2508,2515 ----
        output_verbatim
          (&context->buffer, "%s:%d:   instantiated from `%s'\n", file, line,
           decl_as_string (TINST_DECL (t), TFF_DECL_SPECIFIERS | 
TFF_RETURN_TYPE));
!       line = TREE_LINENO (t);
!       file = TREE_FILENAME (t);
      }
    output_verbatim (&context->buffer, "%s:%d:   instantiated from here\n", 
file, line);
  }
Index: gcc/cp/init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/init.c,v
retrieving revision 1.281.2.11
diff -c -3 -p -r1.281.2.11 init.c
*** gcc/cp/init.c	3 Jan 2003 01:57:35 -0000	1.281.2.11
--- gcc/cp/init.c	11 Jan 2003 00:44:14 -0000
*************** create_temporary_var (type)
*** 2664,2671 ****
    decl = build_decl (VAR_DECL, NULL_TREE, type);
    TREE_USED (decl) = 1;
    DECL_ARTIFICIAL (decl) = 1;
!   DECL_SOURCE_FILE (decl) = input_filename;
!   DECL_SOURCE_LINE (decl) = lineno;
    DECL_IGNORED_P (decl) = 1;
    DECL_CONTEXT (decl) = current_function_decl;
  
--- 2664,2670 ----
    decl = build_decl (VAR_DECL, NULL_TREE, type);
    TREE_USED (decl) = 1;
    DECL_ARTIFICIAL (decl) = 1;
!   annotate_with_file_line (decl, input_filename, lineno);
    DECL_IGNORED_P (decl) = 1;
    DECL_CONTEXT (decl) = current_function_decl;
  
Index: gcc/cp/lex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/lex.c,v
retrieving revision 1.284.2.8
diff -c -3 -p -r1.284.2.8 lex.c
*** gcc/cp/lex.c	3 Dec 2002 22:55:38 -0000	1.284.2.8
--- gcc/cp/lex.c	11 Jan 2003 00:44:15 -0000
*************** extract_interface_info ()
*** 823,829 ****
        tree til = tinst_for_decl ();
  
        if (til)
! 	finfo = get_fileinfo (TINST_FILE (til));
      }
    if (!finfo)
      finfo = get_fileinfo (input_filename);
--- 823,829 ----
        tree til = tinst_for_decl ();
  
        if (til)
! 	finfo = get_fileinfo (TREE_FILENAME (til));
      }
    if (!finfo)
      finfo = get_fileinfo (input_filename);
Index: gcc/cp/method.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/method.c,v
retrieving revision 1.224.2.9
diff -c -3 -p -r1.224.2.9 method.c
*** gcc/cp/method.c	17 Dec 2002 20:47:56 -0000	1.224.2.9
--- gcc/cp/method.c	11 Jan 2003 00:44:17 -0000
*************** synthesize_method (tree fndecl)
*** 807,814 ****
       where the attempt to generate the function occurs, giving the
       user a hint as to why we are attempting to generate the
       function.  */
!   DECL_SOURCE_LINE (fndecl) = lineno;
!   DECL_SOURCE_FILE (fndecl) = input_filename;
  
    interface_unknown = 1;
    start_function (NULL_TREE, fndecl, NULL_TREE, SF_DEFAULT | SF_PRE_PARSED);
--- 807,813 ----
       where the attempt to generate the function occurs, giving the
       user a hint as to why we are attempting to generate the
       function.  */
!   annotate_with_file_line (fndecl, input_filename, lineno);
  
    interface_unknown = 1;
    start_function (NULL_TREE, fndecl, NULL_TREE, SF_DEFAULT | SF_PRE_PARSED);
Index: gcc/cp/optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/optimize.c,v
retrieving revision 1.81.10.11
diff -c -3 -p -r1.81.10.11 optimize.c
*** gcc/cp/optimize.c	3 Jan 2003 01:57:36 -0000	1.81.10.11
--- gcc/cp/optimize.c	11 Jan 2003 00:44:25 -0000
*************** update_cloned_parm (tree parm, tree clon
*** 139,145 ****
    
    /* The name may have changed from the declaration.  */
    DECL_NAME (cloned_parm) = DECL_NAME (parm);
!   DECL_SOURCE_LOCATION (cloned_parm) = DECL_SOURCE_LOCATION (parm);
  }
  
  /* FN is a function that has a complete body.  Clone the body as
--- 139,145 ----
    
    /* The name may have changed from the declaration.  */
    DECL_NAME (cloned_parm) = DECL_NAME (parm);
!   TREE_LOCUS (cloned_parm) = TREE_LOCUS (parm);
  }
  
  /* FN is a function that has a complete body.  Clone the body as
*************** maybe_clone_body (tree fn)
*** 172,178 ****
        splay_tree decl_map;
  
        /* Update CLONE's source position information to match FN's.  */
!       DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn);
        DECL_INLINE (clone) = DECL_INLINE (fn);
        DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn);
        DECL_COMDAT (clone) = DECL_COMDAT (fn);
--- 172,178 ----
        splay_tree decl_map;
  
        /* Update CLONE's source position information to match FN's.  */
!       TREE_LOCUS (clone) = TREE_LOCUS (fn);
        DECL_INLINE (clone) = DECL_INLINE (fn);
        DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn);
        DECL_COMDAT (clone) = DECL_COMDAT (fn);
Index: gcc/cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.591.2.20
diff -c -3 -p -r1.591.2.20 pt.c
*** gcc/cp/pt.c	27 Dec 2002 01:51:53 -0000	1.591.2.20
--- gcc/cp/pt.c	11 Jan 2003 00:44:53 -0000
*************** lookup_template_class (d1, arglist, in_d
*** 4229,4236 ****
  	  type_decl = create_implicit_typedef (DECL_NAME (template), t);
  	  DECL_CONTEXT (type_decl) = TYPE_CONTEXT (t);
  	  TYPE_STUB_DECL (t) = type_decl;
! 	  DECL_SOURCE_LOCATION (type_decl) 
! 	    = DECL_SOURCE_LOCATION (TYPE_STUB_DECL (template_type));
  	}
        else
  	type_decl = TYPE_NAME (t);
--- 4229,4236 ----
  	  type_decl = create_implicit_typedef (DECL_NAME (template), t);
  	  DECL_CONTEXT (type_decl) = TYPE_CONTEXT (t);
  	  TYPE_STUB_DECL (t) = type_decl;
! 	  TREE_LOCUS (type_decl)
! 	    = TREE_LOCUS (TYPE_STUB_DECL (template_type));
  	}
        else
  	type_decl = TYPE_NAME (t);
*************** push_tinst_level (d)
*** 4610,4616 ****
        return 0;
      }
  
!   new = build_expr_wfl (d, input_filename, lineno, 0);
    TREE_CHAIN (new) = current_tinst_level;
    current_tinst_level = new;
  
--- 4610,4618 ----
        return 0;
      }
  
!   new = make_node (TINST_LEVEL);
!   annotate_with_file_line (new, input_filename, lineno);
!   TINST_DECL (new) = d;
    TREE_CHAIN (new) = current_tinst_level;
    current_tinst_level = new;
  
*************** pop_tinst_level ()
*** 4634,4641 ****
  
    /* Restore the filename and line number stashed away when we started
       this instantiation.  */
!   lineno = TINST_LINE (old);
!   input_filename = TINST_FILE (old);
    extract_interface_info ();
    
    current_tinst_level = TREE_CHAIN (old);
--- 4636,4643 ----
  
    /* Restore the filename and line number stashed away when we started
       this instantiation.  */
!   lineno = TREE_LINENO (old);
!   input_filename = TREE_FILENAME (old);
    extract_interface_info ();
    
    current_tinst_level = TREE_CHAIN (old);
*************** tsubst_friend_function (decl, args)
*** 4689,4696 ****
    int line = lineno;
    const char *file = input_filename;
  
!   lineno = DECL_SOURCE_LINE (decl);
!   input_filename = DECL_SOURCE_FILE (decl);
  
    if (TREE_CODE (decl) == FUNCTION_DECL 
        && DECL_TEMPLATE_INSTANTIATION (decl)
--- 4691,4698 ----
    int line = lineno;
    const char *file = input_filename;
  
!   lineno = TREE_LINENO (decl);
!   input_filename = TREE_FILENAME (decl);
  
    if (TREE_CODE (decl) == FUNCTION_DECL 
        && DECL_TEMPLATE_INSTANTIATION (decl)
*************** instantiate_class_template (type)
*** 5329,5336 ****
  		  /* The the file and line for this declaration, to assist
  		     in error message reporting.  Since we called 
  		     push_tinst_level above, we don't need to restore these.  */
! 		  lineno = DECL_SOURCE_LINE (t);
! 		  input_filename = DECL_SOURCE_FILE (t);
  
  		  r = tsubst (t, args, tf_error | tf_warning, NULL_TREE);
  		  if (TREE_CODE (r) == VAR_DECL)
--- 5331,5338 ----
  		  /* The the file and line for this declaration, to assist
  		     in error message reporting.  Since we called 
  		     push_tinst_level above, we don't need to restore these.  */
! 		  lineno = TREE_LINENO (t);
! 		  input_filename = TREE_FILENAME (t);
  
  		  r = tsubst (t, args, tf_error | tf_warning, NULL_TREE);
  		  if (TREE_CODE (r) == VAR_DECL)
*************** instantiate_class_template (type)
*** 5436,5443 ****
       implicit functions at a predictable point, and the same point
       that would be used for non-template classes.  */
    typedecl = TYPE_MAIN_DECL (type);
!   lineno = DECL_SOURCE_LINE (typedecl);
!   input_filename = DECL_SOURCE_FILE (typedecl);
  
    unreverse_member_declarations (type);
    finish_struct_1 (type);
--- 5438,5445 ----
       implicit functions at a predictable point, and the same point
       that would be used for non-template classes.  */
    typedecl = TYPE_MAIN_DECL (type);
!   lineno = TREE_LINENO (typedecl);
!   input_filename = TREE_FILENAME (typedecl);
  
    unreverse_member_declarations (type);
    finish_struct_1 (type);
*************** tsubst_decl (t, args, type, complain)
*** 5758,5765 ****
    /* Set the filename and linenumber to improve error-reporting.  */
    saved_lineno = lineno;
    saved_filename = input_filename;
!   lineno = DECL_SOURCE_LINE (t);
!   input_filename = DECL_SOURCE_FILE (t);
  
    switch (TREE_CODE (t))
      {
--- 5760,5767 ----
    /* Set the filename and linenumber to improve error-reporting.  */
    saved_lineno = lineno;
    saved_filename = input_filename;
!   lineno = TREE_LINENO (t);
!   input_filename = TREE_FILENAME (t);
  
    switch (TREE_CODE (t))
      {
*************** instantiate_decl (d, defer_ok)
*** 10079,10086 ****
    else
      pattern_defined = ! DECL_IN_AGGR_P (code_pattern);
  
!   lineno = DECL_SOURCE_LINE (d);
!   input_filename = DECL_SOURCE_FILE (d);
  
    if (pattern_defined)
      {
--- 10081,10088 ----
    else
      pattern_defined = ! DECL_IN_AGGR_P (code_pattern);
  
!   lineno = TREE_LINENO (d);
!   input_filename = TREE_FILENAME (d);
  
    if (pattern_defined)
      {
*************** instantiate_decl (d, defer_ok)
*** 10202,10209 ****
  
    /* We already set the file and line above.  Reset them now in case
       they changed as a result of calling regenerate_decl_from_template.  */
!   lineno = DECL_SOURCE_LINE (d);
!   input_filename = DECL_SOURCE_FILE (d);
  
    if (TREE_CODE (d) == VAR_DECL)
      {
--- 10204,10211 ----
  
    /* We already set the file and line above.  Reset them now in case
       they changed as a result of calling regenerate_decl_from_template.  */
!   lineno = TREE_LINENO (d);
!   input_filename = TREE_FILENAME (d);
  
    if (TREE_CODE (d) == VAR_DECL)
      {
*************** tsubst_enum (tag, newtag, args)
*** 10437,10444 ****
      }
  
    finish_enum (newtag);
!   DECL_SOURCE_LOCATION (TYPE_NAME (newtag))
!     = DECL_SOURCE_LOCATION (TYPE_NAME (tag));
  }
  
  /* DECL is a FUNCTION_DECL that is a template specialization.  Return
--- 10439,10446 ----
      }
  
    finish_enum (newtag);
!   TREE_LOCUS (TYPE_NAME (newtag))
!     = TREE_LOCUS (TYPE_NAME (tag));
  }
  
  /* DECL is a FUNCTION_DECL that is a template specialization.  Return
Index: gcc/cp/semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.264.2.20
diff -c -3 -p -r1.264.2.20 semantics.c
*** gcc/cp/semantics.c	3 Jan 2003 01:57:36 -0000	1.264.2.20
--- gcc/cp/semantics.c	11 Jan 2003 00:45:07 -0000
*************** begin_class_definition (t)
*** 1767,1774 ****
      duplicate_tag_error (t);
  
    /* Update the location of the decl.  */
!   DECL_SOURCE_FILE (TYPE_NAME (t)) = input_filename;
!   DECL_SOURCE_LINE (TYPE_NAME (t)) = lineno;
    
    if (TYPE_BEING_DEFINED (t))
      {
--- 1767,1773 ----
      duplicate_tag_error (t);
  
    /* Update the location of the decl.  */
!   annotate_with_file_line (TYPE_NAME (t), input_filename, lineno);
    
    if (TYPE_BEING_DEFINED (t))
      {
*************** expand_body (fn)
*** 2329,2336 ****
    saved_lineno = lineno;
    saved_input_filename = input_filename;
    saved_function = current_function_decl;
!   lineno = DECL_SOURCE_LINE (fn);
!   input_filename = DECL_SOURCE_FILE (fn);
    current_function_decl = fn;
  
    timevar_push (TV_INTEGRATION);
--- 2328,2335 ----
    saved_lineno = lineno;
    saved_input_filename = input_filename;
    saved_function = current_function_decl;
!   lineno = TREE_LINENO (fn);
!   input_filename = TREE_FILENAME (fn);
    current_function_decl = fn;
  
    timevar_push (TV_INTEGRATION);
*************** expand_body (fn)
*** 2350,2355 ****
--- 2349,2358 ----
  
    expand_expr_stmt_value (DECL_SAVED_TREE (fn), 0, 0);
  
+   /* And restore the current source position.  */
+   lineno = saved_lineno;
+   input_filename = saved_input_filename;
+ 
    /* Statements should always be full-expressions at the outermost set
       of curly braces for a function.  */
    my_friendly_assert (stmts_are_full_exprs_p (), 19990831);
*************** expand_body (fn)
*** 2370,2379 ****
      /* We don't need the body; blow it away.  */
      DECL_SAVED_TREE (fn) = NULL_TREE;
  
-   /* And restore the current source position.  */
    current_function_decl = saved_function;
-   lineno = saved_lineno;
-   input_filename = saved_input_filename;
    extract_interface_info ();
  
    timevar_pop (TV_EXPAND);
--- 2373,2379 ----
*************** genrtl_start_function (fn)
*** 2417,2423 ****
    /* Tell everybody what function we're processing.  */
    current_function_decl = fn;
    /* Get the RTL machinery going for this function.  */
!   init_function_start (fn, DECL_SOURCE_FILE (fn), DECL_SOURCE_LINE (fn));
    /* Let everybody know that we're expanding this function, not doing
       semantic analysis.  */
    expanding_p = 1;
--- 2417,2423 ----
    /* Tell everybody what function we're processing.  */
    current_function_decl = fn;
    /* Get the RTL machinery going for this function.  */
!   init_function_start (fn, TREE_FILENAME (fn), TREE_LINENO (fn));
    /* Let everybody know that we're expanding this function, not doing
       semantic analysis.  */
    expanding_p = 1;
Index: gcc/cp/tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/tree.c,v
retrieving revision 1.286.2.19
diff -c -3 -p -r1.286.2.19 tree.c
*** gcc/cp/tree.c	3 Jan 2003 01:57:37 -0000	1.286.2.19
--- gcc/cp/tree.c	11 Jan 2003 00:45:16 -0000
*************** cp_walk_subtrees (tp, walk_subtrees_p, f
*** 2172,2177 ****
--- 2172,2182 ----
      }							\
    while (0)
  
+   /* Set lineno here so we get the right instantiation context
+      if we call instantiate_decl from inlinable_function_p.  */
+   if (statement_code_p (code) && !STMT_LINENO_FOR_FN_P (*tp))
+     lineno = STMT_LINENO (*tp);
+ 
    /* Not one of the easy cases.  We must explicitly go through the
       children.  */
    switch (code)
*************** cp_copy_res_decl_for_inlining (result, f
*** 2364,2370 ****
  	  if (TREE_CODE (var) == VAR_DECL)
  	    {
  	      DECL_NAME (var) = DECL_NAME (nrv);
! 	      DECL_SOURCE_LOCATION (var) = DECL_SOURCE_LOCATION (nrv);
  	      DECL_ABSTRACT_ORIGIN (var) = DECL_ORIGIN (nrv);
  	      /* Don't lose initialization info.  */
  	      DECL_INITIAL (var) = DECL_INITIAL (nrv);
--- 2369,2375 ----
  	  if (TREE_CODE (var) == VAR_DECL)
  	    {
  	      DECL_NAME (var) = DECL_NAME (nrv);
! 	      TREE_LOCUS (var) = TREE_LOCUS (nrv);
  	      DECL_ABSTRACT_ORIGIN (var) = DECL_ORIGIN (nrv);
  	      /* Don't lose initialization info.  */
  	      DECL_INITIAL (var) = DECL_INITIAL (nrv);
Index: gcc/f/com.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/com.c,v
retrieving revision 1.171.2.8
diff -c -3 -p -r1.171.2.8 com.c
*** gcc/f/com.c	6 Nov 2002 12:21:32 -0000	1.171.2.8
--- gcc/f/com.c	11 Jan 2003 00:45:53 -0000
*************** duplicate_decls (tree newdecl, tree oldd
*** 13166,13172 ****
  	return 0;
      }
    else if (TREE_CODE (olddecl) == FUNCTION_DECL
! 	   && DECL_SOURCE_LINE (olddecl) == 0)
      {
        /* A function declaration for a predeclared function
  	 that isn't actually built in.  */
--- 13166,13172 ----
  	return 0;
      }
    else if (TREE_CODE (olddecl) == FUNCTION_DECL
! 	   && TREE_LINENO (olddecl) == 0)
      {
        /* A function declaration for a predeclared function
  	 that isn't actually built in.  */
*************** duplicate_decls (tree newdecl, tree oldd
*** 13239,13246 ****
        if ((DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0)
  	  || (DECL_CONTEXT (newdecl) != 0 && DECL_CONTEXT (olddecl) == 0))
  	{
! 	  DECL_SOURCE_LINE (newdecl) = DECL_SOURCE_LINE (olddecl);
! 	  DECL_SOURCE_FILE (newdecl) = DECL_SOURCE_FILE (olddecl);
  
  	  if (DECL_CONTEXT (olddecl) == 0
  	      && TREE_CODE (newdecl) != FUNCTION_DECL)
--- 13239,13245 ----
        if ((DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0)
  	  || (DECL_CONTEXT (newdecl) != 0 && DECL_CONTEXT (olddecl) == 0))
  	{
! 	  TREE_LOCUS (newdecl) = TREE_LOCUS (olddecl);
  
  	  if (DECL_CONTEXT (olddecl) == 0
  	      && TREE_CODE (newdecl) != FUNCTION_DECL)
*************** duplicate_decls (tree newdecl, tree oldd
*** 13346,13351 ****
--- 13345,13351 ----
      memcpy ((char *) olddecl + sizeof (struct tree_common),
  	    (char *) newdecl + sizeof (struct tree_common),
  	    sizeof (struct tree_decl) - sizeof (struct tree_common));
+     TREE_LOCUS (olddecl) = TREE_LOCUS (newdecl);
      DECL_UID (olddecl) = olddecl_uid;
    }
  
*************** pushdecl (x)
*** 14488,14494 ****
  
        if (TREE_CODE (x) == TYPE_DECL)
  	{
! 	  if (DECL_SOURCE_LINE (x) == 0)
  	    {
  	      if (TYPE_NAME (TREE_TYPE (x)) == 0)
  		TYPE_NAME (TREE_TYPE (x)) = x;
--- 14488,14494 ----
  
        if (TREE_CODE (x) == TYPE_DECL)
  	{
! 	  if (TREE_LINENO (x) == 0)
  	    {
  	      if (TYPE_NAME (TREE_TYPE (x)) == 0)
  		TYPE_NAME (TREE_TYPE (x)) = x;
Index: gcc/f/ste.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/ste.c,v
retrieving revision 1.29
diff -c -3 -p -r1.29 ste.c
*** gcc/f/ste.c	4 Jun 2002 07:10:37 -0000	1.29
--- gcc/f/ste.c	11 Jan 2003 00:46:00 -0000
*************** ffeste_labeldef_branch (ffelab label)
*** 2395,2402 ****
    assert (DECL_INITIAL (glabel) == NULL_TREE);
  
    DECL_INITIAL (glabel) = error_mark_node;
!   DECL_SOURCE_FILE (glabel) = ffelab_definition_filename (label);
!   DECL_SOURCE_LINE (glabel) = ffelab_definition_filelinenum (label);
  
    emit_nop ();
  
--- 2395,2403 ----
    assert (DECL_INITIAL (glabel) == NULL_TREE);
  
    DECL_INITIAL (glabel) = error_mark_node;
!   annotate_with_file_line (glabel,
! 		  	   ffelab_definition_filename (label),
! 		  	   ffelab_definition_filelinenum (label));
  
    emit_nop ();
  
Index: gcc/java/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.133.2.7
diff -c -3 -p -r1.133.2.7 class.c
*** gcc/java/class.c	27 Dec 2002 01:52:04 -0000	1.133.2.7
--- gcc/java/class.c	11 Jan 2003 00:46:09 -0000
*************** layout_class (this_class)
*** 1907,1914 ****
  	  tree decl = TYPE_NAME (TREE_PURPOSE (current));
  	  sprintf (buffer, "\n  which inherits from `%s' (%s:%d)",
  		   IDENTIFIER_POINTER (DECL_NAME (decl)),
! 		   DECL_SOURCE_FILE (decl),
! 		   DECL_SOURCE_LINE (decl));
  	  obstack_grow (&temporary_obstack, buffer, strlen (buffer));
  	}
        obstack_1grow (&temporary_obstack, '\0');
--- 1907,1914 ----
  	  tree decl = TYPE_NAME (TREE_PURPOSE (current));
  	  sprintf (buffer, "\n  which inherits from `%s' (%s:%d)",
  		   IDENTIFIER_POINTER (DECL_NAME (decl)),
! 		   TREE_FILENAME (decl),
! 		   TREE_LINENO (decl));
  	  obstack_grow (&temporary_obstack, buffer, strlen (buffer));
  	}
        obstack_1grow (&temporary_obstack, '\0');
Index: gcc/java/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.128.2.7
diff -c -3 -p -r1.128.2.7 decl.c
*** gcc/java/decl.c	17 Dec 2002 20:48:13 -0000	1.128.2.7
--- gcc/java/decl.c	11 Jan 2003 00:46:12 -0000
*************** pushdecl (x)
*** 1055,1062 ****
  
        if (t != 0)
  	{
! 	  file = DECL_SOURCE_FILE (t);
! 	  line = DECL_SOURCE_LINE (t);
  	}
  
        /* If we're naming a hitherto-unnamed type, set its TYPE_NAME
--- 1055,1062 ----
  
        if (t != 0)
  	{
! 	  file = TREE_FILENAME (t);
! 	  line = TREE_LINENO (t);
  	}
  
        /* If we're naming a hitherto-unnamed type, set its TYPE_NAME
*************** pushdecl (x)
*** 1107,1113 ****
  	  /* Maybe warn if shadowing something else.  */
  	  else if (warn_shadow && !DECL_EXTERNAL (x)
  		   /* No shadow warnings for internally generated vars.  */
! 		   && DECL_SOURCE_LINE (x) != 0
  		   /* No shadow warnings for vars made for inlining.  */
  		   && ! DECL_FROM_INLINE (x))
  	    {
--- 1107,1113 ----
  	  /* Maybe warn if shadowing something else.  */
  	  else if (warn_shadow && !DECL_EXTERNAL (x)
  		   /* No shadow warnings for internally generated vars.  */
! 		   && TREE_LINENO (x) != 0
  		   /* No shadow warnings for vars made for inlining.  */
  		   && ! DECL_FROM_INLINE (x))
  	    {
Index: gcc/java/expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.147.2.6
diff -c -3 -p -r1.147.2.6 expr.c
*** gcc/java/expr.c	3 Dec 2002 22:55:52 -0000	1.147.2.6
--- gcc/java/expr.c	11 Jan 2003 00:46:17 -0000
*************** java_expand_expr (exp, target, tmode, mo
*** 2484,2489 ****
--- 2484,2506 ----
  
    switch (TREE_CODE (exp))
      {
+ 
+     case EXPR_WITH_FILE_LOCATION:
+       {
+ 	rtx to_return;
+ 	const char *saved_input_filename = input_filename;
+ 	int saved_lineno = lineno;
+ 	input_filename = EXPR_WFL_FILENAME (exp);
+ 	lineno = EXPR_WFL_LINENO (exp);
+         if (EXPR_WFL_EMIT_LINE_NOTE (exp))
+           emit_line_note (input_filename, lineno);
+ 	/* Possibly avoid switching back and forth here.  */
+ 	to_return = expand_expr (EXPR_WFL_NODE (exp), target, tmode, modifier);
+ 	input_filename = saved_input_filename;
+ 	lineno = saved_lineno;
+ 	return to_return;
+       }
+ 
      case NEW_ARRAY_INIT:
        {
  	rtx tmp;
*************** emit_init_test_initialization (entry, x)
*** 3481,3485 ****
--- 3498,3534 ----
    return true;
  }
  
+ /* EXPR_WITH_FILE_LOCATION are used to keep track of the exact
+    location where an expression or an identifier were encountered. It
+    is necessary for languages where the frontend parser will handle
+    recursively more than one file (Java is one of them).  */
+ 
+ tree
+ build_expr_wfl (node, file, line, col)
+      tree node;
+      const char *file;
+      int line, col;
+ {
+   static const char *last_file = 0;
+   static tree last_filenode = NULL_TREE;
+   tree wfl = make_node (EXPR_WITH_FILE_LOCATION);
+ 
+   EXPR_WFL_NODE (wfl) = node;
+   EXPR_WFL_SET_LINECOL (wfl, line, col);
+   if (file != last_file)
+     {
+       last_file = file;
+       last_filenode = file ? get_identifier (file) : NULL_TREE;
+     }
+ 
+   EXPR_WFL_FILENAME_NODE (wfl) = last_filenode;
+   if (node)
+     {
+       TREE_SIDE_EFFECTS (wfl) = TREE_SIDE_EFFECTS (node);
+       TREE_TYPE (wfl) = TREE_TYPE (node);
+     }
+ 
+   return wfl;
+ }
  #include "gt-java-expr.h"
  
Index: gcc/java/java-tree.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/java-tree.def,v
retrieving revision 1.17.16.1
diff -c -3 -p -r1.17.16.1 java-tree.def
*** gcc/java/java-tree.def	3 Jan 2003 01:57:38 -0000	1.17.16.1
--- gcc/java/java-tree.def	11 Jan 2003 00:46:17 -0000
*************** DEFTREECODE (CLASS_LITERAL, "class_liter
*** 91,96 ****
--- 91,103 ----
  /* The Java object within the exception object from the runtime.  */
  DEFTREECODE (JAVA_EXC_OBJ_EXPR, "java_exc_obj_expr", 'e', 0)
  
+ /* Annotates a tree node (usually an expression) with source location
+    information: a file name (EXPR_WFL_FILENAME);  a line number
+    (EXPR_WFL_LINENO); and column number (EXPR_WFL_COLNO).  It is
+    expanded as the contained node (EXPR_WFL_NODE);  a line note should
+    be emitted first if EXPR_WFL_EMIT_LINE_NOTE.  */
+ DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location", 'e', 3)
+ 
  /*
  Local variables:
  mode:c
Index: gcc/java/java-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/java-tree.h,v
retrieving revision 1.153.2.9
diff -c -3 -p -r1.153.2.9 java-tree.h
*** gcc/java/java-tree.h	27 Dec 2002 01:52:05 -0000	1.153.2.9
--- gcc/java/java-tree.h	11 Jan 2003 00:46:25 -0000
*************** enum
*** 1744,1746 ****
--- 1744,1764 ----
  };
  
  #undef DEBUG_JAVA_BINDING_LEVELS
+ 
+ /* In an EXPR_WITH_FILE_LOCATION node.  */
+ #define EXPR_WFL_EMIT_LINE_NOTE(NODE) \
+   (EXPR_WITH_FILE_LOCATION_CHECK (NODE)->common.public_flag)
+ #define EXPR_WFL_NODE(NODE) \
+   TREE_OPERAND (EXPR_WITH_FILE_LOCATION_CHECK (NODE), 0)
+ #define EXPR_WFL_FILENAME_NODE(NODE) \
+   TREE_OPERAND (EXPR_WITH_FILE_LOCATION_CHECK (NODE), 1)
+ #define EXPR_WFL_FILENAME(NODE) \
+   IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE (NODE))
+ /* ??? Java uses this in all expressions.  */
+ #define EXPR_WFL_LINECOL(NODE) (EXPR_CHECK (NODE)->exp.complexity)
+ #define EXPR_WFL_LINENO(NODE) (EXPR_WFL_LINECOL (NODE) >> 12)
+ #define EXPR_WFL_COLNO(NODE) (EXPR_WFL_LINECOL (NODE) & 0xfff)
+ #define EXPR_WFL_SET_LINECOL(NODE, LINE, COL) \
+   (EXPR_WFL_LINECOL(NODE) = ((LINE) << 12) | ((COL) & 0xfff))
+ 
+ extern tree build_expr_wfl              PARAMS ((tree, const char *, int, 
int));
Index: gcc/java/jcf-parse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-parse.c,v
retrieving revision 1.118.2.6
diff -c -3 -p -r1.118.2.6 jcf-parse.c
*** gcc/java/jcf-parse.c	27 Dec 2002 01:52:06 -0000	1.118.2.6
--- gcc/java/jcf-parse.c	11 Jan 2003 00:46:27 -0000
*************** set_source_filename (jcf, index)
*** 149,155 ****
  	return;
      }
    input_filename = sfname;
!   DECL_SOURCE_FILE (TYPE_NAME (current_class)) = sfname;
    if (current_class == main_class) main_input_filename = input_filename;
  }
  
--- 149,157 ----
  	return;
      }
    input_filename = sfname;
!   annotate_with_file_line (TYPE_NAME (current_class),
! 			   sfname,
! 			   TREE_LINENO (TYPE_NAME (current_class)));
    if (current_class == main_class) main_input_filename = input_filename;
  }
  
*************** give_name_to_class (jcf, i)
*** 430,436 ****
        tree class_name = unmangle_classname (JPOOL_UTF_DATA (jcf, j),
  					    JPOOL_UTF_LENGTH (jcf, j));
        this_class = lookup_class (class_name);
!       input_filename = DECL_SOURCE_FILE (TYPE_NAME (this_class));
        lineno = 0;
        if (main_input_filename == NULL && jcf == main_jcf)
  	main_input_filename = input_filename;
--- 432,438 ----
        tree class_name = unmangle_classname (JPOOL_UTF_DATA (jcf, j),
  					    JPOOL_UTF_LENGTH (jcf, j));
        this_class = lookup_class (class_name);
!       input_filename = TREE_FILENAME (TYPE_NAME (this_class));
        lineno = 0;
        if (main_input_filename == NULL && jcf == main_jcf)
  	main_input_filename = input_filename;
*************** parse_class_file ()
*** 722,728 ****
  
    java_layout_seen_class_methods ();
  
!   input_filename = DECL_SOURCE_FILE (TYPE_NAME (current_class));
    lineno = 0;
    (*debug_hooks->start_source_file) (lineno, input_filename);
    init_outgoing_cpool ();
--- 724,730 ----
  
    java_layout_seen_class_methods ();
  
!   input_filename = TREE_FILENAME (TYPE_NAME (current_class));
    lineno = 0;
    (*debug_hooks->start_source_file) (lineno, input_filename);
    init_outgoing_cpool ();
Index: gcc/java/jcf-write.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-write.c,v
retrieving revision 1.107.2.4
diff -c -3 -p -r1.107.2.4 jcf-write.c
*** gcc/java/jcf-write.c	27 Dec 2002 01:52:06 -0000	1.107.2.4
--- gcc/java/jcf-write.c	11 Jan 2003 00:46:35 -0000
*************** generate_classfile (clas, state)
*** 3172,3178 ****
      }
    ptr = methods_count_ptr;  UNSAFE_PUT2 (methods_count);
  
!   source_file = DECL_SOURCE_FILE (TYPE_NAME (clas));
    for (s = source_file; ; s++)
      {
        char ch = *s;
--- 3172,3178 ----
      }
    ptr = methods_count_ptr;  UNSAFE_PUT2 (methods_count);
  
!   source_file = TREE_FILENAME (TYPE_NAME (clas));
    for (s = source_file; ; s++)
      {
        char ch = *s;
*************** make_class_file_name (clas)
*** 3348,3354 ****
        /* Make sure we put the class file into the .java file's
  	 directory, and not into some subdirectory thereof.  */
        char *t;
!       dname = DECL_SOURCE_FILE (TYPE_NAME (clas));
        slash = strrchr (dname, DIR_SEPARATOR);
        if (! slash)
  	{
--- 3348,3354 ----
        /* Make sure we put the class file into the .java file's
  	 directory, and not into some subdirectory thereof.  */
        char *t;
!       dname = TREE_FILENAME (TYPE_NAME (clas));
        slash = strrchr (dname, DIR_SEPARATOR);
        if (! slash)
  	{
Index: gcc/java/parse.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.h,v
retrieving revision 1.84.2.1
diff -c -3 -p -r1.84.2.1 parse.h
*** gcc/java/parse.h	12 Aug 2002 01:33:46 -0000	1.84.2.1
--- gcc/java/parse.h	11 Jan 2003 00:46:36 -0000
*************** typedef struct _jdeplist {
*** 615,625 ****
  
  /* Merge an other line to the source line number of a decl. Used to
     remember function's end. */
! #define DECL_SOURCE_LINE_MERGE(DECL,NO) DECL_SOURCE_LINE(DECL) |= (NO << 16)
  
  /* Retrieve those two info separately. */
! #define DECL_SOURCE_LINE_FIRST(DECL)    (DECL_SOURCE_LINE(DECL) & 0x0000ffff)
! #define DECL_SOURCE_LINE_LAST(DECL)     (DECL_SOURCE_LINE(DECL) >> 16)
  
  /* Retrieve line/column from a WFL. */
  #define EXPR_WFL_GET_LINECOL(V,LINE,COL)	\
--- 615,628 ----
  
  /* Merge an other line to the source line number of a decl. Used to
     remember function's end. */
! #define TREE_SOURCE_LINE_MERGE(DECL,NO) \
!   annotate_with_file_line (DECL, \
! 			   TREE_FILENAME (DECL), \
! 			   TREE_LINENO (DECL) | (NO << 16));
  
  /* Retrieve those two info separately. */
! #define TREE_SOURCE_LINE_FIRST(DECL)    (TREE_LINENO (DECL) & 0x0000ffff)
! #define TREE_SOURCE_LINE_LAST(DECL)     (TREE_LINENO (DECL) >> 16)
  
  /* Retrieve line/column from a WFL. */
  #define EXPR_WFL_GET_LINECOL(V,LINE,COL)	\
Index: gcc/java/parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.387.2.13
diff -c -3 -p -r1.387.2.13 parse.y
*** gcc/java/parse.y	3 Jan 2003 01:57:39 -0000	1.387.2.13
--- gcc/java/parse.y	11 Jan 2003 00:47:34 -0000
*************** static void
*** 3178,3184 ****
  missing_return_error (method)
       tree method;
  {
!   EXPR_WFL_SET_LINECOL (wfl_operator, DECL_SOURCE_LINE_LAST (method), -2);
    parse_error_context (wfl_operator, "Missing return statement");
  }
  
--- 3178,3184 ----
  missing_return_error (method)
       tree method;
  {
!   EXPR_WFL_SET_LINECOL (wfl_operator, TREE_SOURCE_LINE_LAST (method), -2);
    parse_error_context (wfl_operator, "Missing return statement");
  }
  
*************** classitf_redefinition_error (context, id
*** 3254,3260 ****
  {
    parse_error_context (cl, "%s `%s' already defined in %s:%d",
  		       context, IDENTIFIER_POINTER (id),
! 		       DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
    /* Here we should point out where its redefined. It's a unicode. FIXME */
  }
  
--- 3254,3260 ----
  {
    parse_error_context (cl, "%s `%s' already defined in %s:%d",
  		       context, IDENTIFIER_POINTER (id),
! 		       TREE_FILENAME (decl), TREE_LINENO (decl));
    /* Here we should point out where its redefined. It's a unicode. FIXME */
  }
  
*************** maybe_create_class_interface_decl (decl,
*** 3771,3782 ****
      decl = push_class (make_class (), qualified_name);
  
    /* Take care of the file and line business */
-   DECL_SOURCE_FILE (decl) = EXPR_WFL_FILENAME (cl);
-   /* If we're emiting xrefs, store the line/col number information */
    if (flag_emit_xref)
!     DECL_SOURCE_LINE (decl) = EXPR_WFL_LINECOL (cl);
    else
!     DECL_SOURCE_LINE (decl) = EXPR_WFL_LINENO (cl);
    CLASS_FROM_SOURCE_P (TREE_TYPE (decl)) = 1;
    CLASS_PARSED_P (TREE_TYPE (decl)) = 1;
    CLASS_FROM_CURRENTLY_COMPILED_P (TREE_TYPE (decl)) =
--- 3771,3785 ----
      decl = push_class (make_class (), qualified_name);
  
    /* Take care of the file and line business */
    if (flag_emit_xref)
!     annotate_with_file_line (decl,
! 			     EXPR_WFL_FILENAME (cl),
! 			     EXPR_WFL_LINECOL (cl));
    else
!     annotate_with_file_line (decl,
! 			     EXPR_WFL_FILENAME (cl),
! 			     EXPR_WFL_LINENO (cl));
! 
    CLASS_FROM_SOURCE_P (TREE_TYPE (decl)) = 1;
    CLASS_PARSED_P (TREE_TYPE (decl)) = 1;
    CLASS_FROM_CURRENTLY_COMPILED_P (TREE_TYPE (decl)) =
*************** duplicate_declaration_error_p (new_field
*** 4272,4278 ****
  	(cl , "Duplicate variable declaration: `%s %s' was `%s %s' (%s:%d)",
  	 t1, IDENTIFIER_POINTER (new_field_name),
  	 t2, IDENTIFIER_POINTER (DECL_NAME (decl)),
! 	 DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
        free (t1);
        free (t2);
        return 1;
--- 4275,4281 ----
  	(cl , "Duplicate variable declaration: `%s %s' was `%s %s' (%s:%d)",
  	 t1, IDENTIFIER_POINTER (new_field_name),
  	 t2, IDENTIFIER_POINTER (DECL_NAME (decl)),
! 	 TREE_FILENAME (decl), TREE_LINENO (decl));
        free (t1);
        free (t2);
        return 1;
*************** method_header (flags, type, mdecl, throw
*** 4747,4753 ****
    /* If doing xref, store column and line number information instead
       of the line number only. */
    if (flag_emit_xref)
!     DECL_SOURCE_LINE (meth) = EXPR_WFL_LINECOL (id);
  
    return meth;
  }
--- 4750,4758 ----
    /* If doing xref, store column and line number information instead
       of the line number only. */
    if (flag_emit_xref)
!     annotate_with_file_line (meth,
! 			     EXPR_WFL_FILENAME (id),
! 			     EXPR_WFL_LINECOL (id));
  
    return meth;
  }
*************** finish_method_declaration (method_body)
*** 4817,4823 ****
    /* Merge last line of the function with first line, directly in the
       function decl. It will be used to emit correct debug info. */
    if (!flag_emit_xref)
!     DECL_SOURCE_LINE_MERGE (current_function_decl, ctxp->last_ccb_indent1);
  
    /* Since function's argument's list are shared, reset the
       ARG_FINAL_P parameter that might have been set on some of this
--- 4822,4828 ----
    /* Merge last line of the function with first line, directly in the
       function decl. It will be used to emit correct debug info. */
    if (!flag_emit_xref)
!     TREE_SOURCE_LINE_MERGE (current_function_decl, ctxp->last_ccb_indent1);
  
    /* Since function's argument's list are shared, reset the
       ARG_FINAL_P parameter that might have been set on some of this
*************** lookup_cl (decl)
*** 6702,6709 ****
        cl_v = build_expr_wfl (NULL_TREE, NULL, 0, 0);
      }
  
!   EXPR_WFL_FILENAME_NODE (cl_v) = get_identifier (DECL_SOURCE_FILE (decl));
!   EXPR_WFL_SET_LINECOL (cl_v, DECL_SOURCE_LINE_FIRST (decl), -1);
  
    line = java_get_line_col (EXPR_WFL_FILENAME (cl_v),
  			    EXPR_WFL_LINENO (cl_v), EXPR_WFL_COLNO (cl_v));
--- 6707,6714 ----
        cl_v = build_expr_wfl (NULL_TREE, NULL, 0, 0);
      }
  
!   EXPR_WFL_FILENAME_NODE (cl_v) = get_identifier (TREE_FILENAME (decl));
!   EXPR_WFL_SET_LINECOL (cl_v, TREE_SOURCE_LINE_FIRST (decl), -1);
  
    line = java_get_line_col (EXPR_WFL_FILENAME (cl_v),
  			    EXPR_WFL_LINENO (cl_v), EXPR_WFL_COLNO (cl_v));
*************** declare_local_variables (modifier, type,
*** 7297,7303 ****
        if ((other = lookup_name_in_blocks (name)))
  	{
  	  variable_redefinition_error (wfl, name, TREE_TYPE (other),
! 				       DECL_SOURCE_LINE (other));
  	  continue;
  	}
  
--- 7302,7308 ----
        if ((other = lookup_name_in_blocks (name)))
  	{
  	  variable_redefinition_error (wfl, name, TREE_TYPE (other),
! 				       TREE_LINENO (other));
  	  continue;
  	}
  
*************** declare_local_variables (modifier, type,
*** 7317,7323 ****
        /* If doing xreferencing, replace the line number with the WFL
           compound value */
        if (flag_emit_xref)
! 	DECL_SOURCE_LINE (decl) = EXPR_WFL_LINECOL (wfl);
  
        /* Don't try to use an INIT statement when an error was found */
        if (init && java_error_count)
--- 7322,7330 ----
        /* If doing xreferencing, replace the line number with the WFL
           compound value */
        if (flag_emit_xref)
! 	annotate_with_file_line (decl,
! 			         TREE_FILENAME (decl),
! 			         EXPR_WFL_LINECOL (wfl));
  
        /* Don't try to use an INIT statement when an error was found */
        if (init && java_error_count)
*************** static void
*** 7429,7436 ****
  start_artificial_method_body (mdecl)
       tree mdecl;
  {
!   DECL_SOURCE_LINE (mdecl) = 1;
!   DECL_SOURCE_LINE_MERGE (mdecl, 1);
    source_start_java_method (mdecl);
    enter_block ();
  }
--- 7436,7443 ----
  start_artificial_method_body (mdecl)
       tree mdecl;
  {
!   annotate_with_file_line (mdecl, TREE_FILENAME (mdecl), 1);
!   TREE_SOURCE_LINE_MERGE (mdecl, 1);
    source_start_java_method (mdecl);
    enter_block ();
  }
*************** source_end_java_method ()
*** 7505,7514 ****
    /* Generate rtl for function exit.  */
    if (! flag_emit_class_files && ! flag_emit_xref)
      {
!       lineno = DECL_SOURCE_LINE_LAST (fndecl);
        expand_function_end (input_filename, lineno, 0);
  
!       DECL_SOURCE_LINE (fndecl) = DECL_SOURCE_LINE_FIRST (fndecl);
  
        /* Run the optimizers and output assembler code for this function. */
        rest_of_compilation (fndecl);
--- 7512,7523 ----
    /* Generate rtl for function exit.  */
    if (! flag_emit_class_files && ! flag_emit_xref)
      {
!       lineno = TREE_SOURCE_LINE_LAST (fndecl);
        expand_function_end (input_filename, lineno, 0);
  
!       annotate_with_file_line (fndecl,
! 			       TREE_FILENAME (fndecl),
! 			       TREE_SOURCE_LINE_FIRST (fndecl));
  
        /* Run the optimizers and output assembler code for this function. */
        rest_of_compilation (fndecl);
*************** start_complete_expand_method (mdecl)
*** 8023,8029 ****
        TREE_CHAIN (tem) = next;
      }
    pushdecl_force_head (DECL_ARGUMENTS (mdecl));
!   lineno = DECL_SOURCE_LINE_FIRST (mdecl);
    build_result_decl (mdecl);
  }
  
--- 8032,8038 ----
        TREE_CHAIN (tem) = next;
      }
    pushdecl_force_head (DECL_ARGUMENTS (mdecl));
!   lineno = TREE_SOURCE_LINE_FIRST (mdecl);
    build_result_decl (mdecl);
  }
  
*************** static void
*** 10075,10081 ****
  check_deprecation (wfl, decl)
       tree wfl, decl;
  {
!   const char *file = DECL_SOURCE_FILE (decl);
    /* Complain if the field is deprecated and the file it was defined
       in isn't compiled at the same time the file which contains its
       use is */
--- 10084,10090 ----
  check_deprecation (wfl, decl)
       tree wfl, decl;
  {
!   const char *file = TREE_FILENAME (decl);
    /* Complain if the field is deprecated and the file it was defined
       in isn't compiled at the same time the file which contains its
       use is */
Index: gcc/objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.137.2.11
diff -c -3 -p -r1.137.2.11 objc-act.c
*** gcc/objc/objc-act.c	3 Dec 2002 22:55:57 -0000	1.137.2.11
--- gcc/objc/objc-act.c	11 Jan 2003 00:48:46 -0000
*************** build_selector_translation_table ()
*** 2048,2054 ****
              /* Adjust line number for warning message.  */
              int save_lineno = lineno;
              if (flag_next_runtime && TREE_PURPOSE (chain))
!               lineno = DECL_SOURCE_LINE (TREE_PURPOSE (chain));
              warning ("creating selector for non existant method %s",
                       IDENTIFIER_POINTER (TREE_VALUE (chain)));
              lineno = save_lineno;
--- 2048,2054 ----
              /* Adjust line number for warning message.  */
              int save_lineno = lineno;
              if (flag_next_runtime && TREE_PURPOSE (chain))
!               lineno = TREE_LINENO (TREE_PURPOSE (chain));
              warning ("creating selector for non existant method %s",
                       IDENTIFIER_POINTER (TREE_VALUE (chain)));
              lineno = save_lineno;
*************** error_with_ivar (message, decl, rawdecl)
*** 3540,3547 ****
  
    diagnostic_report_current_function (global_dc);
  
!   error_with_file_and_line (DECL_SOURCE_FILE (decl),
! 			    DECL_SOURCE_LINE (decl),
  			    "%s `%s'",
  			    message, gen_declaration (rawdecl, errbuf));
  
--- 3540,3547 ----
  
    diagnostic_report_current_function (global_dc);
  
!   error_with_file_and_line (TREE_FILENAME (decl),
! 			    TREE_LINENO (decl),
  			    "%s `%s'",
  			    message, gen_declaration (rawdecl, errbuf));
  
*************** warn_with_method (message, mtype, method
*** 7088,7095 ****
    diagnostic_report_current_function (global_dc);
  
    /* Add a readable method name to the warning.  */
!   warning_with_file_and_line (DECL_SOURCE_FILE (method),
! 			      DECL_SOURCE_LINE (method),
  			      "%s `%c%s'",
  			      message, mtype,
  			      gen_method_decl (method, errbuf));
--- 7088,7095 ----
    diagnostic_report_current_function (global_dc);
  
    /* Add a readable method name to the warning.  */
!   warning_with_file_and_line (TREE_FILENAME (method),
! 			      TREE_LINENO (method),
  			      "%s `%c%s'",
  			      message, mtype,
  			      gen_method_decl (method, errbuf));
Index: gcc/treelang/treetree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/treelang/treetree.c,v
retrieving revision 1.6.2.5
diff -c -3 -p -r1.6.2.5 treetree.c
*** gcc/treelang/treetree.c	3 Dec 2002 22:56:05 -0000	1.6.2.5
--- gcc/treelang/treetree.c	11 Jan 2003 00:51:20 -0000
*************** tree_code_create_function_prototype (uns
*** 249,261 ****
    fn_decl = build_decl (FUNCTION_DECL, id, fn_type);
  
    DECL_CONTEXT (fn_decl) = NULL_TREE; /* Nested functions not supported 
here.  */
!   DECL_SOURCE_FILE (fn_decl) = (const char *)filename;
!  /*  if (lineno > 1000000)
!     ; */ /* Probably the line # is rubbish because someone forgot to set
!     the line number - and unfortunately impossible line #s are used as
!     magic flags at various times. The longest known function for
!     example is about 550,000 lines (it was written in COBOL).  */
!   DECL_SOURCE_LINE (fn_decl) = lineno;
  
    TREE_USED (fn_decl) = 1;
  
--- 249,255 ----
    fn_decl = build_decl (FUNCTION_DECL, id, fn_type);
  
    DECL_CONTEXT (fn_decl) = NULL_TREE; /* Nested functions not supported 
here.  */
!   annotate_with_file_line (fn_decl, filename, lineno);
  
    TREE_USED (fn_decl) = 1;
  
*************** tree_code_create_function_initial (tree 
*** 329,343 ****
    current_function_decl = fn_decl;
    DECL_INITIAL (fn_decl) = error_mark_node;
  
!   DECL_SOURCE_FILE (fn_decl) = (const char *)filename;
!   DECL_SOURCE_LINE (fn_decl) = lineno;
  
    /* Prepare creation of rtl for a new function.  */
    
    resultdecl = DECL_RESULT (fn_decl) = build_decl (RESULT_DECL, NULL_TREE, 
TREE_TYPE (TREE_TYPE (fn_decl)));
    DECL_CONTEXT (DECL_RESULT (fn_decl)) = fn_decl;
!   DECL_SOURCE_FILE (resultdecl) = (const char *)filename;
!   DECL_SOURCE_LINE (resultdecl) = lineno;
    /* Work out the size. ??? is this needed.  */
    layout_decl (DECL_RESULT (fn_decl), 0);
  
--- 323,335 ----
    current_function_decl = fn_decl;
    DECL_INITIAL (fn_decl) = error_mark_node;
  
!   annotate_with_file_line_column (fn_decl, filename, lineno, 0);
  
    /* Prepare creation of rtl for a new function.  */
    
    resultdecl = DECL_RESULT (fn_decl) = build_decl (RESULT_DECL, NULL_TREE, 
TREE_TYPE (TREE_TYPE (fn_decl)));
    DECL_CONTEXT (DECL_RESULT (fn_decl)) = fn_decl;
!   annotate_with_file_line_column (resultdecl, filename, lineno, 0);
    /* Work out the size. ??? is this needed.  */
    layout_decl (DECL_RESULT (fn_decl), 0);
  
*************** tree_code_create_function_initial (tree 
*** 356,363 ****
        if (!fn_decl)
          abort ();
        DECL_CONTEXT (parm_decl) = fn_decl;
!       DECL_SOURCE_FILE (parm_decl) = (const char *)filename;
!       DECL_SOURCE_LINE (parm_decl) = lineno;
        parm_list = chainon (parm_decl, parm_list);
      }
  
--- 348,354 ----
        if (!fn_decl)
          abort ();
        DECL_CONTEXT (parm_decl) = fn_decl;
!       annotate_with_file_line_column (parm_decl, filename, lineno, 0);
        parm_list = chainon (parm_decl, parm_list);
      }
  
*************** tree_code_create_variable (unsigned int 
*** 528,535 ****
  
    DECL_CONTEXT (var_decl) = current_function_decl;
  
!   DECL_SOURCE_FILE (var_decl) = (const char *)filename;
!   DECL_SOURCE_LINE (var_decl) = lineno;
  
    /* Set the storage mode and whether only visible in the same file.  */
    switch (storage_class)
--- 519,525 ----
  
    DECL_CONTEXT (var_decl) = current_function_decl;
  
!   annotate_with_file_line_column (var_decl, filename, lineno, 0);
  
    /* Set the storage mode and whether only visible in the same file.  */
    switch (storage_class)






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