diff options
author | Richard Biener <rguenther@suse.de> | 2017-10-02 07:32:52 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-10-02 07:32:52 +0000 |
commit | 0389d86c4e252df643f9c3539e5a114add56ec7f (patch) | |
tree | 83af0087c3c1be8a0a44f85b0ac7b545e5279af2 /gcc/graphite-isl-ast-to-gimple.c | |
parent | 623c6df543b5cb025815e6a79ded86f889f4a4b1 (diff) | |
download | gcc-0389d86c4e252df643f9c3539e5a114add56ec7f.zip gcc-0389d86c4e252df643f9c3539e5a114add56ec7f.tar.gz gcc-0389d86c4e252df643f9c3539e5a114add56ec7f.tar.bz2 |
re PR tree-optimization/82355 (ICE in outermost_loop_in_sese, at sese.c:301)
2017-10-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/82355
* graphite-isl-ast-to-gimple.c (build_iv_mapping): Also build
a mapping for the enclosing loop but avoid generating one for
the loop tree root.
(copy_bb_and_scalar_dependences): Remove premature codegen
error on PHIs in blocks duplicated into multiple places.
* graphite-scop-detection.c
(scop_detection::stmt_has_simple_data_refs_p): For a loop not
in the region use it as loop and nest to analyze the DR in.
(try_generate_gimple_bb): Likewise.
* graphite-sese-to-poly.c (extract_affine_chrec): Adjust.
(add_loop_constraints): For blocks in a loop not in the region
create a dimension with a single iteration.
* sese.h (gbb_loop_at_index): Remove assert.
* gcc.dg/graphite/fuse-1.c: Adjust.
* gcc.dg/graphite/fuse-2.c: Likewise.
* gcc.dg/graphite/pr82355.c: New testcase.
From-SVN: r253336
Diffstat (limited to 'gcc/graphite-isl-ast-to-gimple.c')
-rw-r--r-- | gcc/graphite-isl-ast-to-gimple.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index 820e14e..fb91ba1 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -774,8 +774,10 @@ build_iv_mapping (vec<tree> iv_map, gimple_poly_bb_p gbb, if (codegen_error_p ()) t = integer_zero_node; - loop_p old_loop = gbb_loop_at_index (gbb, region, i - 1); - iv_map[old_loop->num] = t; + loop_p old_loop = gbb_loop_at_index (gbb, region, i - 2); + /* Record sth only for real loops. */ + if (loop_in_sese_p (old_loop, region)) + iv_map[old_loop->num] = t; } } @@ -2587,18 +2589,6 @@ edge translate_isl_ast_to_gimple:: copy_bb_and_scalar_dependences (basic_block bb, edge next_e, vec<tree> iv_map) { int num_phis = number_of_phi_nodes (bb); - - if (region->copied_bb_map->get (bb)) - { - /* FIXME: we should be able to handle phi nodes with args coming from - outside the region. */ - if (num_phis) - { - set_codegen_error (); - return NULL; - } - } - basic_block new_bb = NULL; if (bb_contains_loop_close_phi_nodes (bb)) { |