Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 407260 Details for
Bug 546752
[ICE/5] sys-devel/gcc: internal error when using both lto and graphite: isl_constraint.c: expecting integer value
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
gcc trunk backport of isl integer value overflow fix for gcc 5 graphite support
95_all_pr61929-graphite-isl.patch (text/plain), 13.27 KB, created by
Jana Saout
on 2015-07-20 14:13:26 UTC
(
hide
)
Description:
gcc trunk backport of isl integer value overflow fix for gcc 5 graphite support
Filename:
MIME Type:
Creator:
Jana Saout
Created:
2015-07-20 14:13:26 UTC
Size:
13.27 KB
patch
obsolete
>Only in gcc-5.2.0/gcc: ChangeLog.orig >diff -ur gcc-5.2.0.orig/gcc/graphite-dependences.c gcc-5.2.0/gcc/graphite-dependences.c >--- gcc-5.2.0.orig/gcc/graphite-dependences.c 2015-01-09 21:18:42.000000000 +0100 >+++ gcc-5.2.0/gcc/graphite-dependences.c 2015-07-17 23:28:42.095170874 +0200 >@@ -110,13 +110,13 @@ > return isl_map_intersect_domain (map, s); > } > >-/* Constrain pdr->accesses with pdr->extent and pbb->domain. */ >+/* Constrain pdr->accesses with pdr->subscript_sizes and pbb->domain. */ > > static isl_map * > add_pdr_constraints (poly_dr_p pdr, poly_bb_p pbb) > { > isl_map *x = isl_map_intersect_range (isl_map_copy (pdr->accesses), >- isl_set_copy (pdr->extent)); >+ isl_set_copy (pdr->subscript_sizes)); > x = constrain_domain (x, isl_set_copy (pbb->domain)); > return x; > } >Only in gcc-5.2.0/gcc: graphite-dependences.c.orig >diff -ur gcc-5.2.0.orig/gcc/graphite-interchange.c gcc-5.2.0/gcc/graphite-interchange.c >--- gcc-5.2.0.orig/gcc/graphite-interchange.c 2015-01-09 21:18:42.000000000 +0100 >+++ gcc-5.2.0/gcc/graphite-interchange.c 2015-07-17 23:28:42.098504204 +0200 >@@ -101,37 +101,40 @@ > static isl_constraint * > build_linearized_memory_access (isl_map *map, poly_dr_p pdr) > { >- isl_constraint *res; > isl_local_space *ls = isl_local_space_from_space (isl_map_get_space (map)); >- unsigned offset, nsubs; >- int i; >- isl_ctx *ctx; >+ isl_constraint *res = isl_equality_alloc (ls); >+ isl_val *size = isl_val_int_from_ui (isl_map_get_ctx (map), 1); > >- isl_val *size, *subsize, *size1; >- >- res = isl_equality_alloc (ls); >- ctx = isl_local_space_get_ctx (ls); >- size = isl_val_int_from_ui (ctx, 1); >- >- nsubs = isl_set_dim (pdr->extent, isl_dim_set); >+ unsigned nsubs = isl_set_dim (pdr->subscript_sizes, isl_dim_set); > /* -1 for the already included L dimension. */ >- offset = isl_map_dim (map, isl_dim_out) - 1 - nsubs; >+ unsigned offset = isl_map_dim (map, isl_dim_out) - 1 - nsubs; > res = isl_constraint_set_coefficient_si (res, isl_dim_out, offset + nsubs, -1); >- /* Go through all subscripts from last to first. First dimension >+ /* Go through all subscripts from last to first. The dimension "i=0" > is the alias set, ignore it. */ >- for (i = nsubs - 1; i >= 1; i--) >+ for (int i = nsubs - 1; i >= 1; i--) > { >- isl_space *dc; >- isl_aff *aff; >- >- size1 = isl_val_copy (size); >- res = isl_constraint_set_coefficient_val (res, isl_dim_out, offset + i, size); >- dc = isl_set_get_space (pdr->extent); >- aff = isl_aff_zero_on_domain (isl_local_space_from_space (dc)); >- aff = isl_aff_set_coefficient_si (aff, isl_dim_in, i, 1); >- subsize = isl_set_max_val (pdr->extent, aff); >- isl_aff_free (aff); >- size = isl_val_mul (size1, subsize); >+ isl_aff *extract_dim; >+ res = isl_constraint_set_coefficient_val (res, isl_dim_out, offset + i, >+ isl_val_copy (size)); >+ isl_space *dc = isl_set_get_space (pdr->subscript_sizes); >+ extract_dim = isl_aff_zero_on_domain (isl_local_space_from_space (dc)); >+ extract_dim = isl_aff_set_coefficient_si (extract_dim, isl_dim_in, i, 1); >+ isl_val *max = isl_set_max_val (pdr->subscript_sizes, extract_dim); >+ isl_aff_free (extract_dim); >+ >+ /* The result is NULL in case of an error, the optimal value in case there >+ is one, negative infinity or infinity if the problem is unbounded and >+ NaN if the problem is empty. */ >+ gcc_assert (max); >+ >+ /* When one of the dimensions cannot be computed, we cannot build the size >+ of the array for any outer dimensions. */ >+ if (!isl_val_is_int (max)) >+ { >+ isl_val_free (max); >+ break; >+ } >+ size = isl_val_mul (size, max); > } > > isl_val_free (size); >@@ -198,7 +201,7 @@ > > /* pdr->accesses: [P1..nb_param,I1..nb_domain]->[a,S1..nb_subscript] > ??? [P] not used for PDRs? >- pdr->extent: [a,S1..nb_subscript] >+ pdr->subscript_sizes: [a,S1..nb_subscript] > pbb->domain: [P1..nb_param,I1..nb_domain] > pbb->transformed: [P1..nb_param,I1..nb_domain]->[T1..Tnb_sctr] > [T] includes local vars (currently unused) >Only in gcc-5.2.0/gcc: graphite-interchange.c.orig >diff -ur gcc-5.2.0.orig/gcc/graphite-poly.c gcc-5.2.0/gcc/graphite-poly.c >--- gcc-5.2.0.orig/gcc/graphite-poly.c 2015-01-09 21:18:42.000000000 +0100 >+++ gcc-5.2.0/gcc/graphite-poly.c 2015-07-17 23:28:42.098504204 +0200 >@@ -294,7 +294,7 @@ > void > new_poly_dr (poly_bb_p pbb, int dr_base_object_set, > enum poly_dr_type type, void *cdr, graphite_dim_t nb_subscripts, >- isl_map *acc, isl_set *extent) >+ isl_map *acc, isl_set *subscript_sizes) > { > static int id = 0; > poly_dr_p pdr = XNEW (struct poly_dr); >@@ -304,7 +304,7 @@ > PDR_NB_REFS (pdr) = 1; > PDR_PBB (pdr) = pbb; > pdr->accesses = acc; >- pdr->extent = extent; >+ pdr->subscript_sizes = subscript_sizes; > PDR_TYPE (pdr) = type; > PDR_CDR (pdr) = cdr; > PDR_NB_SUBSCRIPTS (pdr) = nb_subscripts; >@@ -317,7 +317,7 @@ > free_poly_dr (poly_dr_p pdr) > { > isl_map_free (pdr->accesses); >- isl_set_free (pdr->extent); >+ isl_set_free (pdr->subscript_sizes); > XDELETE (pdr); > } > >Only in gcc-5.2.0/gcc: graphite-poly.c.orig >diff -ur gcc-5.2.0.orig/gcc/graphite-poly.h gcc-5.2.0/gcc/graphite-poly.h >--- gcc-5.2.0.orig/gcc/graphite-poly.h 2015-01-05 13:33:28.000000000 +0100 >+++ gcc-5.2.0/gcc/graphite-poly.h 2015-07-17 23:28:42.098504204 +0200 >@@ -175,7 +175,7 @@ > > In the example, the vector "R C O I L P" is "7 7 3 2 0 1". */ > isl_map *accesses; >- isl_set *extent; >+ isl_set *subscript_sizes; > > /* Data reference's base object set number, we must assure 2 pdrs are in the > same base object set before dependency checking. */ >Only in gcc-5.2.0/gcc: graphite-poly.h.orig >diff -ur gcc-5.2.0.orig/gcc/graphite-scop-detection.c gcc-5.2.0/gcc/graphite-scop-detection.c >--- gcc-5.2.0.orig/gcc/graphite-scop-detection.c 2015-01-09 21:18:42.000000000 +0100 >+++ gcc-5.2.0/gcc/graphite-scop-detection.c 2015-07-17 23:28:42.098504204 +0200 >@@ -314,7 +314,6 @@ > gimple stmt) > { > data_reference_p dr; >- unsigned i; > int j; > bool res = true; > vec<data_reference_p> drs = vNULL; >@@ -327,18 +326,29 @@ > stmt, &drs); > > FOR_EACH_VEC_ELT (drs, j, dr) >- for (i = 0; i < DR_NUM_DIMENSIONS (dr); i++) >- if (!graphite_can_represent_scev (DR_ACCESS_FN (dr, i))) >+ { >+ int nb_subscripts = DR_NUM_DIMENSIONS (dr); >+ tree ref = DR_REF (dr); >+ >+ for (int i = nb_subscripts - 1; i >= 0; i--) > { >- res = false; >- goto done; >+ if (!graphite_can_represent_scev (DR_ACCESS_FN (dr, i)) >+ || (TREE_CODE (ref) != ARRAY_REF >+ && TREE_CODE (ref) != MEM_REF >+ && TREE_CODE (ref) != COMPONENT_REF)) >+ { >+ free_data_refs (drs); >+ return false; >+ } >+ >+ ref = TREE_OPERAND (ref, 0); > } >+ } > > free_data_refs (drs); > drs.create (0); > } > >- done: > free_data_refs (drs); > return res; > } >Only in gcc-5.2.0/gcc: graphite-scop-detection.c.orig >diff -ur gcc-5.2.0.orig/gcc/graphite-scop-detection.h gcc-5.2.0/gcc/graphite-scop-detection.h >--- gcc-5.2.0.orig/gcc/graphite-scop-detection.h 2015-01-05 13:33:28.000000000 +0100 >+++ gcc-5.2.0/gcc/graphite-scop-detection.h 2015-07-17 23:28:42.098504204 +0200 >@@ -23,7 +23,7 @@ > #define GCC_GRAPHITE_SCOP_DETECTION_H > > extern void build_scops (vec<scop_p> *); >-extern void dot_all_scops (vec<scop_p> ); >+extern void dot_all_scops (vec<scop_p>); > extern void dot_scop (scop_p); > > #endif /* GCC_GRAPHITE_SCOP_DETECTION_H */ >diff -ur gcc-5.2.0.orig/gcc/graphite-sese-to-poly.c gcc-5.2.0/gcc/graphite-sese-to-poly.c >--- gcc-5.2.0.orig/gcc/graphite-sese-to-poly.c 2015-01-15 14:28:42.000000000 +0100 >+++ gcc-5.2.0/gcc/graphite-sese-to-poly.c 2015-07-17 23:28:42.098504204 +0200 >@@ -537,6 +537,7 @@ > (isl_local_space_from_space (isl_map_get_space (pbb->schedule))); > > val = isl_aff_get_coefficient_val (static_sched, isl_dim_in, i / 2); >+ gcc_assert (val && isl_val_is_int (val)); > > val = isl_val_neg (val); > c = isl_constraint_set_constant_val (c, val); >@@ -759,14 +760,12 @@ > > /* Compute pwaff mod 2^width. */ > >-extern isl_ctx *the_isl_ctx; >- > static isl_pw_aff * > wrap (isl_pw_aff *pwaff, unsigned width) > { > isl_val *mod; > >- mod = isl_val_int_from_ui(the_isl_ctx, width); >+ mod = isl_val_int_from_ui (isl_pw_aff_get_ctx (pwaff), width); > mod = isl_val_2exp (mod); > pwaff = isl_pw_aff_mod_val (pwaff, mod); > >@@ -1045,7 +1044,7 @@ > (isl_local_space_from_space (isl_space_copy (space))); > c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, -1); > tree_int_to_gmp (nb_iters, g); >- v = isl_val_int_from_gmp (the_isl_ctx, g); >+ v = isl_val_int_from_gmp (scop->ctx, g); > c = isl_constraint_set_constant_val (c, v); > inner = isl_set_add_constraint (inner, c); > } >@@ -1100,7 +1099,7 @@ > c = isl_inequality_alloc > (isl_local_space_from_space (isl_space_copy (space))); > c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, -1); >- v = isl_val_int_from_gmp (the_isl_ctx, g); >+ v = isl_val_int_from_gmp (scop->ctx, g); > mpz_clear (g); > c = isl_constraint_set_constant_val (c, v); > inner = isl_set_add_constraint (inner, c); >@@ -1364,7 +1363,7 @@ > c = isl_inequality_alloc (isl_local_space_from_space (space)); > mpz_init (g); > tree_int_to_gmp (lb, g); >- v = isl_val_int_from_gmp (the_isl_ctx, g); >+ v = isl_val_int_from_gmp (scop->ctx, g); > v = isl_val_neg (v); > mpz_clear (g); > c = isl_constraint_set_constant_val (c, v); >@@ -1384,7 +1383,7 @@ > > mpz_init (g); > tree_int_to_gmp (ub, g); >- v = isl_val_int_from_gmp (the_isl_ctx, g); >+ v = isl_val_int_from_gmp (scop->ctx, g); > mpz_clear (g); > c = isl_constraint_set_constant_val (c, v); > c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, -1); >@@ -1520,20 +1519,19 @@ > domain. */ > > static isl_set * >-pdr_add_data_dimensions (isl_set *extent, scop_p scop, data_reference_p dr) >+pdr_add_data_dimensions (isl_set *subscript_sizes, scop_p scop, >+ data_reference_p dr) > { > tree ref = DR_REF (dr); >- int i, nb_subscripts = DR_NUM_DIMENSIONS (dr); > >- for (i = nb_subscripts - 1; i >= 0; i--, ref = TREE_OPERAND (ref, 0)) >+ int nb_subscripts = DR_NUM_DIMENSIONS (dr); >+ for (int i = nb_subscripts - 1; i >= 0; i--, ref = TREE_OPERAND (ref, 0)) > { >- tree low, high; >- > if (TREE_CODE (ref) != ARRAY_REF) >- break; >+ return subscript_sizes; > >- low = array_ref_low_bound (ref); >- high = array_ref_up_bound (ref); >+ tree low = array_ref_low_bound (ref); >+ tree high = array_ref_up_bound (ref); > > /* XXX The PPL code dealt separately with > subscript - low >= 0 and high - subscript >= 0 in case one of >@@ -1551,10 +1549,10 @@ > isl_aff *aff; > isl_set *univ, *lbs, *ubs; > isl_pw_aff *index; >- isl_space *space; > isl_set *valid; >- isl_pw_aff *lb = extract_affine_int (low, isl_set_get_space (extent)); >- isl_pw_aff *ub = extract_affine_int (high, isl_set_get_space (extent)); >+ isl_space *space = isl_set_get_space (subscript_sizes); >+ isl_pw_aff *lb = extract_affine_int (low, isl_space_copy (space)); >+ isl_pw_aff *ub = extract_affine_int (high, isl_space_copy (space)); > > /* high >= 0 */ > valid = isl_pw_aff_nonneg_set (isl_pw_aff_copy (ub)); >@@ -1562,25 +1560,24 @@ > isl_set_dim (valid, isl_dim_set)); > scop->context = isl_set_intersect (scop->context, valid); > >- space = isl_set_get_space (extent); > aff = isl_aff_zero_on_domain (isl_local_space_from_space (space)); > aff = isl_aff_add_coefficient_si (aff, isl_dim_in, i + 1, 1); > univ = isl_set_universe (isl_space_domain (isl_aff_get_space (aff))); > index = isl_pw_aff_alloc (univ, aff); > >- id = isl_set_get_tuple_id (extent); >+ id = isl_set_get_tuple_id (subscript_sizes); > lb = isl_pw_aff_set_tuple_id (lb, isl_dim_in, isl_id_copy (id)); > ub = isl_pw_aff_set_tuple_id (ub, isl_dim_in, id); > > /* low <= sub_i <= high */ > lbs = isl_pw_aff_ge_set (isl_pw_aff_copy (index), lb); > ubs = isl_pw_aff_le_set (index, ub); >- extent = isl_set_intersect (extent, lbs); >- extent = isl_set_intersect (extent, ubs); >+ subscript_sizes = isl_set_intersect (subscript_sizes, lbs); >+ subscript_sizes = isl_set_intersect (subscript_sizes, ubs); > } > } > >- return extent; >+ return subscript_sizes; > } > > /* Build data accesses for DR in PBB. */ >@@ -1590,7 +1587,7 @@ > { > int dr_base_object_set; > isl_map *acc; >- isl_set *extent; >+ isl_set *subscript_sizes; > scop_p scop = PBB_SCOP (pbb); > > { >@@ -1617,9 +1614,10 @@ > alias_set_num = *(bap->alias_set); > > space = isl_space_set_tuple_id (space, isl_dim_set, id); >- extent = isl_set_nat_universe (space); >- extent = isl_set_fix_si (extent, isl_dim_set, 0, alias_set_num); >- extent = pdr_add_data_dimensions (extent, scop, dr); >+ subscript_sizes = isl_set_nat_universe (space); >+ subscript_sizes = isl_set_fix_si (subscript_sizes, isl_dim_set, 0, >+ alias_set_num); >+ subscript_sizes = pdr_add_data_dimensions (subscript_sizes, scop, dr); > } > > gcc_assert (dr->aux); >@@ -1627,7 +1625,7 @@ > > new_poly_dr (pbb, dr_base_object_set, > DR_IS_READ (dr) ? PDR_READ : PDR_WRITE, >- dr, DR_NUM_DIMENSIONS (dr), acc, extent); >+ dr, DR_NUM_DIMENSIONS (dr), acc, subscript_sizes); > } > > /* Write to FILE the alias graph of data references in DIMACS format. */ >Only in gcc-5.2.0/gcc: graphite-sese-to-poly.c.orig >Only in gcc-5.2.0/gcc/testsuite: ChangeLog.orig
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 546752
: 407260 |
407262
|
407326