[Bug fortran/86322] [9 Regression] ICE in reference_record with data statement

2019-01-08 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86322

--- Comment #4 from Steve Kargl  ---
On Tue, Jan 08, 2019 at 08:15:46PM +, janus at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86322
> 
> janus at gcc dot gnu.org changed:
> 
>What|Removed |Added
> 
>  CC||janus at gcc dot gnu.org
> 
> --- Comment #3 from janus at gcc dot gnu.org ---
> I have not verified, but I'm pretty sure the regression is due to r260808:
> 
> 2018-05-27  Steven G. Kargl  
> 
>  * decl.c (match_data_constant):  Fortran 2018 allows pointer
>  initialization in a data statement.
> 

Naw, it is is not due to my patch.  Rather my patch has
exposed or uncovered a bug in gfortran.  gfortran needs
to check

F2018:C877 (R839) A data-i-do-object or a variable that appears as a
   data-stmt-object shall not be an object designator in which a pointer
   appears other than as the entire rightmost part-ref .

In decl.c (gfc_match_data), gfortran needs a check for C877.
I haven't gotten around to fixing this yet, and I likely won't
for the foreseeable future.

[Bug fortran/86322] [9 Regression] ICE in reference_record with data statement

2019-01-08 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86322

janus at gcc dot gnu.org changed:

   What|Removed |Added

 CC||janus at gcc dot gnu.org

--- Comment #3 from janus at gcc dot gnu.org ---
I have not verified, but I'm pretty sure the regression is due to r260808:

2018-05-27  Steven G. Kargl  

 * decl.c (match_data_constant):  Fortran 2018 allows pointer
 initialization in a data statement.

[Bug fortran/86322] [9 Regression] ICE in reference_record with data statement

2018-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86322

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |9.0

[Bug fortran/86322] [9 Regression] ICE in reference_record with data statement

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

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to Jürgen Reuter from comment #0)
> The following example from c.l.f. July 12, 2016 gives an ICE in the actual
> gfortran trunk, 9.0.0. This is the ICE from gfortran:
> $ gfortran f08_4.f90 
> f951: internal compiler error: in record_reference, at cgraphbuild.c:64
> libbacktrace could not find executable to open
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See  for instructions.
> 
> 
> The code should be rejected apparently, as it violates F2008 C568.
> Ifort rejects it with the following message:
> error #8121: A data-stmt-object shall not be a subobject of a pointer.   [I]
>   data c%i /b%i/
> 
> program p
> type a
> integer i
> end type a
> type(a), target, save :: b
> type(a), pointer :: c
> data b%i /42/
> data c%i /b%i/
> print *, c%i
> end


Yes, the code should be rejected.  The location in data.c where one
needs to do the check is easy enough to find.  The correctly written
code isprogram p
type a
integer i
end type a
type(a), target, save :: b
type(a), pointer :: c
data c /b/
b%i = 42
print *, c%i
end

[Bug fortran/86322] [9 Regression] ICE in reference_record with data statement

2018-06-26 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86322

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
  Known to work||8.1.0
   Keywords||ice-on-invalid-code
   Last reconfirmed||2018-06-26
 Ever confirmed|0   |1
Summary|ICE in reference_record |[9 Regression] ICE in
   |with data statement |reference_record with data
   ||statement
  Known to fail||9.0

--- Comment #1 from Dominique d'Humieres  ---
Up to revision r260071 (2018-05-09) I get the error

pr86322.f90:8:11:

 data c%i /b%i/
   1
Error: Symbol 'b' must be a PARAMETER in DATA statement at (1)

I get the ICE with r261279 (2018-06-07). I also get the error with the 8 branch
revision 261740.