diff mbox

Fix construction of gcov_fn_info

Message ID 20150511025015.GA61882@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka May 11, 2015, 2:50 a.m. UTC
Hi,
as discussed while back, gcov_fn_info_type is built incorrectly. We produce
a variant that is COMPLETE_TYPE_P but has no fields.  THis triggers ICE with
verify_type patch I am about to send.

Bootstrapped/regtested x86_64-linux, comitted.

	Patch by Richard Biener
	* coverage.c (coverage_obj_init): Delay building of type variant
	until the type is finished.
diff mbox

Patch

Index: coverage.c
===================================================================
--- coverage.c	(revision 222984)
+++ coverage.c	(working copy)
@@ -1141,9 +1141,10 @@  coverage_obj_init (void)
   /* Build the info and fn_info types.  These are mutually recursive.  */
   gcov_info_type = lang_hooks.types.make_type (RECORD_TYPE);
   gcov_fn_info_type = lang_hooks.types.make_type (RECORD_TYPE);
+  build_fn_info_type (gcov_fn_info_type, n_counters, gcov_info_type);
+  gcov_info_type = lang_hooks.types.make_type (RECORD_TYPE);
   gcov_fn_info_ptr_type = build_pointer_type
     (build_qualified_type (gcov_fn_info_type, TYPE_QUAL_CONST));
-  build_fn_info_type (gcov_fn_info_type, n_counters, gcov_info_type);
   build_info_type (gcov_info_type, gcov_fn_info_ptr_type);
   
   /* Build the gcov info var, this is referred to in its own