This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix SEGV in dump_variable
- From: Diego Novillo <dnovillo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 13 Sep 2005 11:56:57 -0400
- Subject: Fix SEGV in dump_variable
When dumping variables before the first SSA pass, we may have
empty annotations.
* tree-dfa.c (dump_variable): Guard against NULL annotations.
Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dfa.c,v
retrieving revision 2.63
diff -d -u -p -r2.63 tree-dfa.c
--- tree-dfa.c 28 Jul 2005 16:29:52 -0000 2.63
+++ tree-dfa.c 13 Sep 2005 15:53:39 -0000
@@ -314,13 +314,13 @@ dump_variable (FILE *file, tree var)
fprintf (file, ", ");
print_generic_expr (file, TREE_TYPE (var), dump_flags);
- if (ann->type_mem_tag)
+ if (ann && ann->type_mem_tag)
{
fprintf (file, ", type memory tag: ");
print_generic_expr (file, ann->type_mem_tag, dump_flags);
}
- if (ann->is_alias_tag)
+ if (ann && ann->is_alias_tag)
fprintf (file, ", is an alias tag");
if (TREE_ADDRESSABLE (var))
@@ -341,7 +341,7 @@ dump_variable (FILE *file, tree var)
print_generic_expr (file, default_def (var), dump_flags);
}
- if (ann->may_aliases)
+ if (may_aliases (var))
{
fprintf (file, ", may aliases: ");
dump_may_aliases_for (file, var);