This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gcj -fprofile-arcs segfaults
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 27 Mar 2006 16:41:00 -0300
- Subject: Re: gcj -fprofile-arcs segfaults
- References: <orwtffeuoj.fsf@free.oliva.athome.lsd.ic.unicamp.br>
Ping?
:ADDPATCH gcov:
unsigned_type_node is not defined by the Java front end, so coverage.c
shouldn't reference it directly. This patch fixes it, hopefully
without breaking anything. I'm not sufficiently familiar with gcov to
tell whether the potential type change introduced by this change could
break anything.
Regression-tested by running check-gcc check-g++ with
RUNTESTFLAGS=gcov.exp on amd64-linux-gnu, both -m64 and -m32.
Ok to install?
for gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* coverage.c: Use get_gcov_unsigned_t() instead of
unsigned_type_node all over.
Index: gcc/coverage.c
===================================================================
--- gcc/coverage.c.orig 2006-02-03 03:45:15.000000000 -0200
+++ gcc/coverage.c 2006-02-28 03:04:30.000000000 -0300
@@ -608,7 +608,7 @@ build_fn_info_type (unsigned int counter
array_type = build_int_cst (NULL_TREE, counters - 1);
array_type = build_index_type (array_type);
- array_type = build_array_type (unsigned_type_node, array_type);
+ array_type = build_array_type (get_gcov_unsigned_t (), array_type);
/* counters */
field = build_decl (FIELD_DECL, NULL_TREE, array_type);
@@ -646,7 +646,7 @@ build_fn_info_value (const struct functi
for (ix = 0; ix != GCOV_COUNTERS; ix++)
if (prg_ctr_mask & (1 << ix))
{
- tree counters = build_int_cstu (unsigned_type_node,
+ tree counters = build_int_cstu (get_gcov_unsigned_t (),
function->n_ctrs[ix]);
array_value = tree_cons (NULL_TREE, counters, array_value);
@@ -686,7 +686,7 @@ build_ctr_info_type (void)
/* merge */
gcov_merge_fn_type =
build_function_type_list (void_type_node,
- gcov_ptr_type, unsigned_type_node,
+ gcov_ptr_type, get_gcov_unsigned_t (),
NULL_TREE);
field = build_decl (FIELD_DECL, NULL_TREE,
build_pointer_type (gcov_merge_fn_type));
@@ -720,7 +720,7 @@ build_ctr_info_value (unsigned int count
{
tree array_type;
- array_type = build_int_cstu (unsigned_type_node,
+ array_type = build_int_cstu (get_gcov_unsigned_t (),
prg_n_ctrs[counter] - 1);
array_type = build_index_type (array_type);
array_type = build_array_type (TREE_TYPE (TREE_TYPE (fields)),
@@ -849,11 +849,11 @@ build_gcov_info (void)
fn_info_value = null_pointer_node;
/* number of functions */
- field = build_decl (FIELD_DECL, NULL_TREE, unsigned_type_node);
+ field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
TREE_CHAIN (field) = fields;
fields = field;
value = tree_cons (field,
- build_int_cstu (unsigned_type_node, n_fns),
+ build_int_cstu (get_gcov_unsigned_t (), n_fns),
value);
/* fn_info table */
@@ -863,11 +863,11 @@ build_gcov_info (void)
value = tree_cons (field, fn_info_value, value);
/* counter_mask */
- field = build_decl (FIELD_DECL, NULL_TREE, unsigned_type_node);
+ field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
TREE_CHAIN (field) = fields;
fields = field;
value = tree_cons (field,
- build_int_cstu (unsigned_type_node, prg_ctr_mask),
+ build_int_cstu (get_gcov_unsigned_t (), prg_ctr_mask),
value);
/* counters */
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
Secretary for FSF Latin America http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}