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]
Other format: [Raw text]

[patch, installed] do not crash with -fdump-tree-all-all if cfun->cfg is null


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}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]