This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Fix DCE bug in VA_ARG_EXPR nodes [patch]
- From: Diego Novillo <dnovillo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 2 Dec 2002 07:35:59 -0500
- Subject: [tree-ssa] Fix DCE bug in VA_ARG_EXPR nodes [patch]
- Organization: Red Hat Canada
Fixes a DCE bug caused by the reference finder not looking into
VA_ARG_EXPR nodes.
Bootstrapped and tested on x86.
Diego.
* tree-dfa.c (find_refs_in_expr): Look for references in
VA_ARG_EXPR nodes.
Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.51
diff -d -u -p -r1.1.4.51 tree-dfa.c
--- tree-dfa.c 1 Dec 2002 17:12:01 -0000 1.1.4.51
+++ tree-dfa.c 2 Dec 2002 04:03:55 -0000
@@ -238,8 +238,7 @@ find_refs_in_expr (expr_p, ref_type, ref
|| class == 'b'
|| code == RESULT_DECL
|| code == FUNCTION_DECL
- || code == LABEL_DECL
- || code == VA_ARG_EXPR)
+ || code == LABEL_DECL)
return;
/* If this reference is associated with a non SIMPLE expression, then we
@@ -439,6 +438,7 @@ find_refs_in_expr (expr_p, ref_type, ref
/* Unary expressions. */
if (class == '1'
|| code == EXPR_WITH_FILE_LOCATION
+ || code == VA_ARG_EXPR
|| code == BIT_FIELD_REF)
{
find_refs_in_expr (&TREE_OPERAND (expr, 0), ref_type, ref_mod, bb,