public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Dominique d'Humières" <dominiq@lps.ens.fr>
To: fortran@gcc.gnu.org
Subject: [RFC] Hack for PRs 43996,45081, 58027, 59910, and 60993
Date: Sat, 14 Nov 2015 21:21:00 -0000	[thread overview]
Message-ID: <65FD2119-0F31-4B31-96F8-0DC84E5E698A@lps.ens.fr> (raw)

Compiling PRs 43996,45081, 58027, 59910, and 60993 gives the ICE

internal compiler error: in gfc_conv_array_initializer, at fortran/trans-array.c:5703

Compiling these PRs with  '-fno-range-check -fmax-array-constructor=1000000' succeeds except PR45081 (note that the output for pr 60993 does not seem to be the one expected by the reporter).

I have played with the following patch which gives the error

Fatal Error: A problem with BOZ and/or PARAMETER occurred at (1), try to compile with -fnorange-check and/or to increase the allowed 65535 upper limit for the '-fmax-array-constructor’ option

Is there a (simple) way to distinguish between the cases compiling with -fnorange-check and those requiring an increase of the default value for -fmax-array-constructor?

Indeed I know that the problem should be fixed upstream, but would it be acceptable to apply this kind of patch meanwhile?

Cheers,

Dominique

--- ../_clean/gcc/fortran/trans-array.c	2015-11-11 15:23:35.000000000 +0100
+++ gcc/fortran/trans-array.c	2015-11-14 22:02:20.000000000 +0100
@@ -5699,7 +5699,21 @@ gfc_conv_array_initializer (tree type, g
     case EXPR_NULL:
       return gfc_build_null_descriptor (type);
 
+    case EXPR_FUNCTION:
+      /* Problems occur when we get something like
+         integer :: a(lots) = (/(i, i=1, lots)/)  */
+      gfc_fatal_error ("A problem with BOZ and/or PARAMETER occurred "
+		       "at %L, try to compile with -fnorange-check and/or "
+		       "to increase the allowed %d upper limit for the "
+		       "%<-fmax-array-constructor%> option",
+		       &expr->where, flag_max_array_constructor);
+      return NULL_TREE;
+      /* int errors;
+      gfc_get_errors (NULL, &errors);
+      gfc_fatal_error ("Something wrong: errors count is %d", errors); */
+
     default:
+      printf ("expr->expr_type is %d\n", expr->expr_type);
       gcc_unreachable ();
     }
 

             reply	other threads:[~2015-11-14 21:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-14 21:21 Dominique d'Humières [this message]
2015-11-14 22:04 ` Steve Kargl
2015-11-16  0:32 ` Steve Kargl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65FD2119-0F31-4B31-96F8-0DC84E5E698A@lps.ens.fr \
    --to=dominiq@lps.ens.fr \
    --cc=fortran@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).