[Bug tree-optimization/27331] [4.2 Regression] segfault in fold_convert with -ftree-vectorize
rakdver at atrey dot karlin dot mff dot cuni dot cz
gcc-bugzilla@gcc.gnu.org
Fri Jun 16 08:23:00 GMT 2006
------- Comment #11 from rakdver at atrey dot karlin dot mff dot cuni dot cz 2006-06-16 08:15 -------
Subject: Re: [4.2 Regression] segfault in fold_convert with -ftree-vectorize
> You said that you had a fix in predcom, is that fix in your local
> tree, or have you sent a patch to gcc-patches?
The patch is in predcom branch. The relevant part (fixing also another
similar bug) is below.
*** tree-data-ref.c (revision 114118)
--- tree-data-ref.c (working copy)
*************** create_data_ref (tree memref, tree stmt,
*** 1954,1964 ****
--- 2009,2031 ----
/* Update access function. */
access_fn = DR_ACCESS_FN (dr, 0);
+ if (automatically_generated_chrec_p (access_fn))
+ {
+ free_data_ref (dr);
+ return NULL;
+ }
+
new_step = size_binop (TRUNC_DIV_EXPR,
fold_convert (ssizetype, step), type_size);
init_cond = chrec_convert (chrec_type (access_fn), init_cond, stmt);
new_step = chrec_convert (chrec_type (access_fn), new_step, stmt);
+ if (automatically_generated_chrec_p (init_cond)
+ || automatically_generated_chrec_p (new_step))
+ {
+ free_data_ref (dr);
+ return NULL;
+ }
access_fn = chrec_replace_initial_condition (access_fn, init_cond);
access_fn = reset_evolution_in_loop (loop->num, access_fn, new_step);
*************** free_dependence_relations (VEC (ddr_p, h
*** 4364,4369 ****
--- 4435,4453 ----
VEC_free (ddr_p, heap, dependence_relations);
}
+ /* Free the memory used by the data reference DR. */
+
+ static void
+ free_data_ref (data_reference_p dr)
+ {
+ if (DR_TYPE(dr) == ARRAY_REF_TYPE)
+ VEC_free (tree, heap, dr->object_info.access_fns);
+ else
+ VEC_free (tree, heap, dr->first_location.access_fns);
+
+ free (dr);
+ }
+
/* Free the memory used by the data references from DATAREFS. */
void
*************** free_data_refs (VEC (data_reference_p, h
*** 4373,4386 ****
struct data_reference *dr;
for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
! {
! if (DR_TYPE(dr) == ARRAY_REF_TYPE)
! VEC_free (tree, heap, (dr)->object_info.access_fns);
! else
! VEC_free (tree, heap, (dr)->first_location.access_fns);
!
! free (dr);
! }
VEC_free (data_reference_p, heap, datarefs);
}
--- 4457,4463 ----
struct data_reference *dr;
for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
! free_data_ref (dr);
VEC_free (data_reference_p, heap, datarefs);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27331
More information about the Gcc-bugs
mailing list