public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, fortran, committed] Fix PR 84134
@ 2018-01-30 22:38 Thomas Koenig
  0 siblings, 0 replies; only message in thread
From: Thomas Koenig @ 2018-01-30 22:38 UTC (permalink / raw)
  To: fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

Hello world,

another obvious fix, this time for an ice-on-invalid regression,
committed after regression-testing.

Regards

	Thomas

2017-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/84134
         * array.c (gfc_ref_dimen_size): Whitespace fixes.  If stride is
         zero, return false.

2017-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/84134

[-- Attachment #2: p1.diff --]
[-- Type: text/x-patch, Size: 594 bytes --]

Index: array.c
===================================================================
--- array.c	(Revision 257131)
+++ array.c	(Arbeitskopie)
@@ -2245,9 +2245,12 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen,
       else
 	{
 	  stride_expr = gfc_copy_expr(ar->stride[dimen]); 
+
 	  if(!gfc_simplify_expr(stride_expr, 1))
 	    gfc_internal_error("Simplification error");
-	  if (stride_expr->expr_type != EXPR_CONSTANT)
+
+	  if (stride_expr->expr_type != EXPR_CONSTANT
+	      || mpz_cmp_ui (stride_expr->value.integer, 0) == 0)
 	    {
 	      mpz_clear (stride);
 	      return false;

[-- Attachment #3: data_implied_do_2.f90 --]
[-- Type: text/x-fortran, Size: 209 bytes --]

! { dg-do compile }
! PR fortran/84134 - this used to ICE.
! Test case by Gerhard Steinmetz

program p
   integer :: i, x(3)
   data (x(i+1:i+2:i),i=0,1) /1,2,3/ ! { dg-error "Nonconstant array section" }
end

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-30 22:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30 22:38 [patch, fortran, committed] Fix PR 84134 Thomas Koenig

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).