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]

(C++) patch to walk_tree


Fixes line numbers on error messages for g++.pt/crash6.C when compiled
with optimization.

2000-05-01  Jason Merrill  <jason@casey.cygnus.com>

	* tree.c (walk_tree): Set lineno.

Index: tree.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/tree.c,v
retrieving revision 1.194
diff -c -p -r1.194 tree.c
*** tree.c	2000/05/01 23:51:37	1.194
--- tree.c	2000/05/02 05:22:16
*************** walk_tree (tp, func, data)
*** 1245,1250 ****
--- 1245,1255 ----
      {
        int i, len;
  
+       /* 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);
+ 
        /* 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]