diff options
author | Bin Cheng <bin.cheng@linux.alibaba.com> | 2019-04-08 11:52:18 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-04-08 11:52:18 +0000 |
commit | d6366157deac0b526ce7ecfd2821745eecce06c8 (patch) | |
tree | 3042ff24ef928ab4c8b2ad26e74939b33f07787b /gcc/tree-data-ref.c | |
parent | 145f764aae16c101baf41c815abe99353fcf797d (diff) | |
download | gcc-d6366157deac0b526ce7ecfd2821745eecce06c8.zip gcc-d6366157deac0b526ce7ecfd2821745eecce06c8.tar.gz gcc-d6366157deac0b526ce7ecfd2821745eecce06c8.tar.bz2 |
re PR middle-end/89725 (ICE in get_fnname_from_decl, at varasm.c:1723)
2019-04-01 Bin Cheng <bin.cheng@linux.alibaba.com>
PR tree-optimization/89725
* tree-chrec.c (chrec_contains_symbols): New parameter. Handle outer
loop's chrec as invariant symbol.
* tree-chrec.h (chrec_contains_symbols): New parameter.
* tree-data-ref.c (analyze_miv_subscript): Pass new argument.
(build_classic_dist_vector_1, add_other_self_distances): Bypass access
function of loops not in DDR's loop_nest.
* tree-data-ref.h (index_in_loop_nest): Add unreachable check.
* gcc.dg/tree-ssa/pr89725.c: New test.
From-SVN: r270203
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index e536b46..51da181 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -4060,9 +4060,9 @@ analyze_miv_subscript (tree chrec_a, } else if (evolution_function_is_affine_in_loop (chrec_a, loop_nest->num) - && !chrec_contains_symbols (chrec_a) + && !chrec_contains_symbols (chrec_a, loop_nest) && evolution_function_is_affine_in_loop (chrec_b, loop_nest->num) - && !chrec_contains_symbols (chrec_b)) + && !chrec_contains_symbols (chrec_b, loop_nest)) { /* testsuite/.../ssa-chrec-35.c {0, +, 1}_2 vs. {0, +, 1}_3 @@ -4272,6 +4272,7 @@ build_classic_dist_vector_1 (struct data_dependence_relation *ddr, { unsigned i; lambda_vector init_v = lambda_vector_new (DDR_NB_LOOPS (ddr)); + struct loop *loop = DDR_LOOP_NEST (ddr)[0]; for (i = 0; i < DDR_NUM_SUBSCRIPTS (ddr); i++) { @@ -4302,6 +4303,15 @@ build_classic_dist_vector_1 (struct data_dependence_relation *ddr, return false; } + /* When data references are collected in a loop while data + dependences are analyzed in loop nest nested in the loop, we + would have more number of access functions than number of + loops. Skip access functions of loops not in the loop nest. + + See PR89725 for more information. */ + if (flow_loop_nested_p (get_loop (cfun, var_a), loop)) + continue; + dist = int_cst_value (SUB_DISTANCE (subscript)); index = index_in_loop_nest (var_a, DDR_LOOP_NEST (ddr)); *index_carry = MIN (index, *index_carry); @@ -4413,6 +4423,7 @@ add_other_self_distances (struct data_dependence_relation *ddr) unsigned i; int index_carry = DDR_NB_LOOPS (ddr); subscript *sub; + struct loop *loop = DDR_LOOP_NEST (ddr)[0]; FOR_EACH_VEC_ELT (DDR_SUBSCRIPTS (ddr), i, sub) { @@ -4442,6 +4453,16 @@ add_other_self_distances (struct data_dependence_relation *ddr) return; } + /* When data references are collected in a loop while data + dependences are analyzed in loop nest nested in the loop, we + would have more number of access functions than number of + loops. Skip access functions of loops not in the loop nest. + + See PR89725 for more information. */ + if (flow_loop_nested_p (get_loop (cfun, CHREC_VARIABLE (access_fun)), + loop)) + continue; + index_carry = MIN (index_carry, index_in_loop_nest (CHREC_VARIABLE (access_fun), DDR_LOOP_NEST (ddr))); |