This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 03 Aug 2014 14:24:46 +0000
- Subject: [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments
- Auto-submitted: auto-generated
- References: <bug-61999-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61999
--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The ICE is due to the line
gcc_assert (gfc_compare_types (&vector_a->ts, &vector_b->ts));
i.e., gfc_simplify_dot_product works only if the two vectors have the same
type. Replacing the assert with
--- ../_clean/gcc/fortran/simplify.c 2014-07-26 13:13:21.000000000 +0200
+++ gcc/fortran/simplify.c 2014-08-03 15:43:35.000000000 +0200
@@ -1883,7 +1883,8 @@ gfc_expr*
gfc_simplify_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
{
if (!is_constant_array_expr (vector_a)
- || !is_constant_array_expr (vector_b))
+ || !is_constant_array_expr (vector_b)
+ || !gfc_compare_types (&vector_a->ts, &vector_b->ts))
return NULL;
gcc_assert (vector_a->rank == 1);
fixes the problem. Indeed this prevents the dot product to be computed at
compile time. A better solution will be to do the type conversion, but I don't
know how to do it.