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]

[lno] fix division by zero


	* tree-vectorizer.c (vect_analyze_operations): Test vectorization_factor
	before computing modulo.

Index: tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-vectorizer.c,v
retrieving revision 1.1.2.4
diff -d -u -p -r1.1.2.4 tree-vectorizer.c
--- tree-vectorizer.c	3 Jan 2004 00:48:43 -0000	1.1.2.4
+++ tree-vectorizer.c	3 Jan 2004 01:14:26 -0000
@@ -1433,8 +1433,9 @@ vect_analyze_operations (loop_vec_info l
   DBG_VECT2 (fprintf (stderr, "vectorization_factor = %d, niters = %d\n",
    		      vectorization_factor,LOOP_VINFO_NITERS (loop_vinfo)));
 
-  if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo) ||
-      LOOP_VINFO_NITERS (loop_vinfo) % vectorization_factor != 0)
+  if (vectorization_factor == 0
+      || !LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo) 
+      || LOOP_VINFO_NITERS (loop_vinfo) % vectorization_factor != 0)
     {
       DBG_VECT (fprintf (stderr,
       		"loop bound unknown or doesn't divide by %d\n", 


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