This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Fix PR middle-end/18005.
- From: Sebastian Pop <sebastian dot pop at cri dot ensmp dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Oct 2004 11:55:05 +0200
- Subject: [patch] Fix PR middle-end/18005.
Hello,
The following patch fixes PR18005 by ensuring that the arguments of
EXACT_DIV_EXPR are INTEGER_CST.
Bootstrapped and tested on i686-pc-linux-gnu.
Sebastian
* tree-data-ref.c (estimate_niter_from_size_of_data): Ensure
that arguments of EXACT_DIV_EXPR are INTEGER_CST.
Index: tree-data-ref.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.c,v
retrieving revision 2.12
diff -d -u -p -r2.12 tree-data-ref.c
--- tree-data-ref.c 13 Oct 2004 11:58:10 -0000 2.12
+++ tree-data-ref.c 19 Oct 2004 09:52:09 -0000
@@ -513,11 +513,13 @@ estimate_niter_from_size_of_data (struct
array_size = TYPE_SIZE (TREE_TYPE (opnd0));
element_size = TYPE_SIZE (TREE_TYPE (TREE_TYPE (opnd0)));
if (array_size == NULL_TREE
- || element_size == NULL_TREE)
+ || element_size == NULL_TREE
+ || TREE_CODE (array_size) != INTEGER_CST
+ || TREE_CODE (element_size) != INTEGER_CST)
return;
data_size = fold (build2 (EXACT_DIV_EXPR, integer_type_node,
- array_size, element_size));
+ array_size, element_size));
if (init != NULL_TREE
&& step != NULL_TREE