[PATCH] remove incorrect assert

Gaius Mulley gaius.mulley@southwales.ac.uk
Mon Jun 5 11:15:00 GMT 2017


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).

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).

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);
 }
-
-



More information about the Gcc-patches mailing list