On Mon, Jun 5, 2017 at 1:14 PM, Gaius Mulley <gaius.mul...@southwales.ac.uk> wrote: > > Hi, > > here is a tiny patch which removes an assert which I believe is wrong. > I think it is an anomaly as the only callee (determine_max_movement at > gcc/tree-ssa-loop-im.c:749) tests the asserted result against NULL. (If > the assert really were correct then the else statement is redundant > (dead code) at line gcc/tree-ssa-loop-im.c:758).
That check checs for the first exit, !simple_mem_ref_in_stmt. The assert is about having populated the hash properly when gathering all simple_mem_refs. > I think the else is correct and the assert wrong as the gnu modula-2 > front end can provoke the assert to fail (thus needing the else statement). Then sth is wrong with either hashing, simple_mem_ref_in_stmt or the IL generated by modula-2. Richard. > I've run the C regression tests and there are no changes in the results > if the patch is applied. > > regards, > Gaius > > > --- gcc-versionno-orig/gcc/tree-ssa-loop-im.c 2017-06-01 17:06:50.228216946 > +0100 > +++ gcc-versionno/gcc/tree-ssa-loop-im.c 2017-06-01 21:34:55.623992245 > +0100 > @@ -602,7 +602,6 @@ > hash = iterative_hash_expr (*mem, 0); > ref = memory_accesses.refs->find_with_hash (*mem, hash); > > - gcc_assert (ref != NULL); > return ref; > } > > @@ -2631,5 +2630,3 @@ > { > return new pass_lim (ctxt); > } > - > - >