[Bug middle-end/89725] ICE in get_fnname_from_decl, at varasm.c:1723
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 28 14:20:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89725
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amker at gcc dot gnu.org
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think the issue is that the DDR is bogus - loop interchange computes
data-refs
for a deeper nest (including some outer loops) than it ends up doing
dependence checking later on. But we have access functions analyzed with
respect to outer loops already.
I think it would be possible to handle this in data dependence computation,
simply treating evolutions in outer loops as invariants. Eventually the
access functions evolving in outer loops can also be pruned? We can't
really undo SCEV analysis on them.
I think that Jakubs fix is too conservative though.
Since we fail when we cannot compute the "invalid" subscript distance at the
moment the safest fix would probably to create the DDR with the loop-nest
we originally analyzed? Bin?
diff --git a/gcc/gimple-loop-interchange.cc b/gcc/gimple-loop-interchange.cc
index bb01a9b0d40..1f9b0c900d4 100644
--- a/gcc/gimple-loop-interchange.cc
+++ b/gcc/gimple-loop-interchange.cc
@@ -1995,6 +1995,7 @@ prepare_perfect_loop_nest (struct loop *loop, vec<loop_p>
*loop_nest,
/* Prepare the data reference vector for the loop nest, pruning outer
loops we cannot handle. */
+ struct loop *dr_loop = start_loop;
start_loop = prepare_data_references (start_loop, datarefs);
if (!start_loop
/* Check if there is no data reference. */
@@ -2022,7 +2023,7 @@ prepare_perfect_loop_nest (struct loop *loop, vec<loop_p>
*loop_nest,
if (loop != start_loop)
prune_datarefs_not_in_loop (start_loop, *datarefs);
- if (find_loop_nest (start_loop, loop_nest)
+ if (find_loop_nest (dr_loop, loop_nest)
&& tree_loop_interchange_compute_ddrs (*loop_nest, *datarefs, ddrs))
{
if (dump_file && (dump_flags & TDF_DETAILS))
With the following the ICE reproduces for me on x86_64-linux with
just -O2 -floop-interchange -fno-tree-dce
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index 11aa806a64d..54651e903ff 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -585,6 +585,7 @@ index_in_loop_nest (int var, vec<loop_p> loop_nest)
if (loopi->num == var)
break;
+ gcc_assert (var_index < loop_nest.length ());
return var_index;
}
More information about the Gcc-bugs
mailing list