This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] remove incorrect assert


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]