This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, installed] do not crash with -fdump-tree-all-all if cfun->cfg is null
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 18 Apr 2005 14:00:09 -0300
- Subject: [patch, installed] do not crash with -fdump-tree-all-all if cfun->cfg is null
- Organization: Red Hat Global Engineering Services Compiler Team
basic_block_info is now a macro that dereferences cfun->cfg, so make
sure we don't evaluate basic_block_info if cfun->cfg is NULL.
Bootstrapped and regtested on amd64-linux-gnu. I'm checking this in
as obvious.
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* tree-cfg.c (dump_function_to_file): Do not crash if cfun or
cfun->cfg are NULL.
Index: gcc/tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.173
diff -u -p -r2.173 tree-cfg.c
--- gcc/tree-cfg.c 17 Apr 2005 06:41:47 -0000 2.173
+++ gcc/tree-cfg.c 18 Apr 2005 16:55:15 -0000
@@ -5183,7 +5183,7 @@ dump_function_to_file (tree fn, FILE *fi
}
}
- if (basic_block_info)
+ if (cfun && cfun->cfg && basic_block_info)
{
/* Make a CFG based dump. */
check_bb_profile (ENTRY_BLOCK_PTR, file);
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}