This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
(C++) patch to walk_tree
- To: gcc-patches at gcc dot gnu dot org
- Subject: (C++) patch to walk_tree
- From: Jason Merrill <jason at cygnus dot com>
- Date: Mon, 1 May 2000 22:23:37 -0700
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.