This is the mail archive of the
mailing list for the GCC project.
[PATCH] remove incorrect assert
- From: Gaius Mulley <gaius dot mulley at southwales dot ac dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 05 Jun 2017 12:14:54 +0100
- Subject: [PATCH] remove incorrect assert
- Authentication-results: sourceware.org; auth=none
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.
--- 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);
@@ -2631,5 +2630,3 @@
return new pass_lim (ctxt);