------- Comment #23 from dfranke at gcc dot gnu dot org  2010-05-01 11:15 
-------
Undoing the changes of comments #7, #12 and #16, I now (with splay-tree
constructors get):

$ time gfortran-svn -Wall pr40472.f90

real    0m2.130s
user    0m1.924s
sys     0m0.148s

Instead of those 11 minutes shown in comment #6.

To be fair, 4.5 requires even less time, but it builds the array on runtime,
not compile time.

$ time gfortran-4.5 -Wall pr40472.f90

real    0m0.734s
user    0m0.028s
sys     0m0.132s


Dominique, could you apply this patch and check whether you still get an ICE?

Index: simplify.c
===================================================================
--- simplify.c  (revision 158958)
+++ simplify.c  (working copy)
@@ -4926,7 +4926,6 @@ gfc_simplify_spread (gfc_expr *source, g
 {
   gfc_expr *result = 0L;
   int i, j, dim, ncopies;
-  mpz_t size;

   if ((!gfc_is_constant_expr (source)
        && !is_constant_array_expr (source))
@@ -4942,19 +4941,6 @@ gfc_simplify_spread (gfc_expr *source, g
   gfc_extract_int (ncopies_expr, &ncopies);
   ncopies = MAX (ncopies, 0);

-  /* Do not allow the array size to exceed the limit for an array
-     constructor.  */
-  if (source->expr_type == EXPR_ARRAY)
-    {
-      if (gfc_array_size (source, &size) == FAILURE)
-       gfc_internal_error ("Failure getting length of a constant array.");
-    }
-  else
-    mpz_init_set_ui (size, 1);
-
-  if (mpz_get_si (size)*ncopies > gfc_option.flag_max_array_constructor)
-    return NULL;
-
   if (source->expr_type == EXPR_CONSTANT)
     {
       gcc_assert (dim == 0);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40472

Reply via email to