[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2017-12-30 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-30
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Confirmed from 4.8 up to trunk (8.0).

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-01-05 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

Thomas Koenig  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 CC||tkoenig at gcc dot gnu.org

--- Comment #2 from Thomas Koenig  ---
The code is valid; F2003 7.6.1 "Specification expression" says

R729 specification-expr is scalar-int-expr

C710  (R729) The scalar-int-expr shall be a restricted expression.

A restricted expression is an expression in which each operation is intrinsic
and each primary is

[...]

(8) A reference to any other standard intrinsic function where each argument is
a restricted expression,

One possible workaround:

program main
  integer :: n
  n = command_argument_count()
  block
integer :: A(n)
A = 1
write (*,*) A
  end block
end

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-01-05 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

--- Comment #3 from Thomas Koenig  ---
Also, this does not ICE:

integer :: A(command_argument_count()) 
a = 1
write (*,*) A
end

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-01-05 Thread weeks at iastate dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

--- Comment #4 from Nathan T. Weeks  ---
Fortran 2008 appears to have tightened restrictions on explicit-shape arrays in
the main program and made this particular case illegal (per section 5.3.8.2
"Explicit-shape array"):

C531 (R516) An explicit-shape-spec whose bounds are not constant expressions
shall appear only in a subprogram, derived type definition, BLOCK construct, or
interface body.

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-01-26 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||kargl at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |kargl at gcc dot gnu.org

--- Comment #5 from kargl at gcc dot gnu.org ---
Patched to mailing list.

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-02-24 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

--- Comment #6 from Dominique d'Humieres  ---
> Patched to mailing list.

Patch at https://gcc.gnu.org/ml/fortran/2018-01/msg00192.html which seems to
have never been applied. What is the problem?

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-02-24 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

--- Comment #7 from Steve Kargl  ---
On Sun, Feb 25, 2018 at 12:13:09AM +, dominiq at lps dot ens.fr wrote:
> > Patched to mailing list.
> 
> Patch at https://gcc.gnu.org/ml/fortran/2018-01/msg00192.html which seems to
> have never been applied. What is the problem?
> 

Haven't gotten around to committing it.  Need to separate out
out diffs.

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-02-25 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

--- Comment #8 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Sun Feb 25 16:50:50 2018
New Revision: 257971

URL: https://gcc.gnu.org/viewcvs?rev=257971&root=gcc&view=rev
Log:
2018-02-25  Steven G. Kargl  

PR fortran/83633
* decl.c (variable_decl): Check that an explicit-shape-array with
nonconstant bounds is allowed.

2018-02-25  Steven G. Kargl  

PR fortran/83633
* gfortran.dg/explicit_shape_1.f90: New test.
* gfortran.dg/automatic_module_variable.f90: Update regex.
* gfortran.dg/bad_automatic_objects_1.f90: Ditto.
* gfortran.dg/constant_shape.f90: Ditto.
* gfortran.dg/dec_structure_23.f90: Ditto.
* gfortran.dg/pr78240.f90: Ditto.

Added:
trunk/gcc/testsuite/gfortran.dg/explicit_shape_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/automatic_module_variable.f90
trunk/gcc/testsuite/gfortran.dg/bad_automatic_objects_1.f90
trunk/gcc/testsuite/gfortran.dg/constant_shape.f90
trunk/gcc/testsuite/gfortran.dg/dec_structure_23.f90
trunk/gcc/testsuite/gfortran.dg/pr78240.f90

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-02-25 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

--- Comment #9 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Sun Feb 25 17:08:51 2018
New Revision: 257972

URL: https://gcc.gnu.org/viewcvs?rev=257972&root=gcc&view=rev
Log:
2018-02-25  Steven G. Kargl  

PR fortran/83633
* decl.c (variable_decl): Check that an explicit-shape-array with
nonconstant bounds is allowed.

2018-02-25  Steven G. Kargl  

PR fortran/83633
* gfortran.dg/explicit_shape_1.f90: New test.
* gfortran.dg/automatic_module_variable.f90: Update regex.
* gfortran.dg/bad_automatic_objects_1.f90: Ditto.
* gfortran.dg/constant_shape.f90: Ditto.

Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/explicit_shape_1.f90
Modified:
branches/gcc-7-branch/gcc/fortran/decl.c
   
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/automatic_module_variable.f90
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/bad_automatic_objects_1.f90
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/constant_shape.f90

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-02-25 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||gerhard.steinmetz.fortran@t
   ||-online.de

--- Comment #10 from kargl at gcc dot gnu.org ---
*** Bug 69420 has been marked as a duplicate of this bug. ***

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-02-25 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

--- Comment #11 from Dominique d'Humieres  ---
> *** Bug 69420 has been marked as a duplicate of this bug. ***

Yes, but what about pr69419?

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-02-25 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

--- Comment #12 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Sun Feb 25 17:32:36 2018
New Revision: 257974

URL: https://gcc.gnu.org/viewcvs?rev=257974&root=gcc&view=rev
Log:
2018-02-25  Steven G. Kargl  

PR fortran/83633
* decl.c (variable_decl): Check that an explicit-shape-array with
nonconstant bounds is allowed.

2018-02-25  Steven G. Kargl  

PR fortran/83633
* gfortran.dg/explicit_shape_1.f90: New test.
* gfortran.dg/automatic_module_variable.f90: Update regex.
* gfortran.dg/bad_automatic_objects_1.f90: Ditto.

Added:
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/explicit_shape_1.f90
Modified:
branches/gcc-6-branch/gcc/fortran/ChangeLog
branches/gcc-6-branch/gcc/fortran/decl.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog
   
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/automatic_module_variable.f90
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/bad_automatic_objects_1.f90

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-02-25 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

--- Comment #13 from kargl at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #11)
> > *** Bug 69420 has been marked as a duplicate of this bug. ***
> 
> Yes, but what about pr69419?

What about it?  It is unrelated.

[Bug fortran/83633] gfortran internal compiler error for explicit-shape array with non-constant bounds

2018-02-25 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.5

--- Comment #14 from kargl at gcc dot gnu.org ---
Fixed of 6-branch, 7-branch, and trunk.
Thanks for bug reports.