public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50410] New: ICE in record_reference
@ 2011-09-15  8:43 zeccav at gmail dot com
  2011-09-15 11:16 ` [Bug fortran/50410] [4.6/4.7 Regression] " dominiq at lps dot ens.fr
                   ` (37 more replies)
  0 siblings, 38 replies; 39+ messages in thread
From: zeccav at gmail dot com @ 2011-09-15  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50410
           Summary: ICE in record_reference
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zeccav@gmail.com


Created attachment 25286
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25286
just compile it

ICE in record_reference


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
@ 2011-09-15 11:16 ` dominiq at lps dot ens.fr
  2011-09-18 22:01 ` zeccav at gmail dot com
                   ` (36 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-09-15 11:16 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-09-15
            Summary|ICE in record_reference     |[4.6/4.7 Regression] ICE in
                   |                            |record_reference
     Ever Confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-09-15 11:08:55 UTC ---
Confirmed on 4.6.1 and trunk:

pr50410.f90:7:0: internal compiler error: in record_reference, at
cgraphbuild.c:67

no ICE on 4.4.6 and 4.5.3 (no error). g95 gives the following error:

In file pr50410.f90:6

      data  u%g /1/
            1
Error: Can't dereference POINTER in DATA statement at (1)


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
  2011-09-15 11:16 ` [Bug fortran/50410] [4.6/4.7 Regression] " dominiq at lps dot ens.fr
@ 2011-09-18 22:01 ` zeccav at gmail dot com
  2011-09-18 22:02 ` dominiq at lps dot ens.fr
                   ` (35 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: zeccav at gmail dot com @ 2011-09-18 22:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Vittorio Zecca <zeccav at gmail dot com> 2011-09-18 17:38:10 UTC ---
The following produces a Segmentation fault in gfc_conv_structure (r178925)

      type t
       integer g
      end type
      type(t) :: u=t(1)
      data u%g /2/
      end


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
  2011-09-15 11:16 ` [Bug fortran/50410] [4.6/4.7 Regression] " dominiq at lps dot ens.fr
  2011-09-18 22:01 ` zeccav at gmail dot com
@ 2011-09-18 22:02 ` dominiq at lps dot ens.fr
  2011-09-19  0:46 ` kargl at gcc dot gnu.org
                   ` (34 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-09-18 22:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-09-18 18:20:57 UTC ---
The problem for the code in comment #2 seems different:
it gives a segmentation fault with 4.6.1 and trunk and an ICE with 4.4.6 and
4.5.3:

f951: internal compiler error: in formalize_structure_cons, at
fortran/data.c:(756|755)

g95 gives the following error

In file pr50410_1.f90:5

      data u%g /2/
           1
Error: Variable 'u' at (1) already has an initialization


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (2 preceding siblings ...)
  2011-09-18 22:02 ` dominiq at lps dot ens.fr
@ 2011-09-19  0:46 ` kargl at gcc dot gnu.org
  2011-09-21 19:17 ` janus at gcc dot gnu.org
                   ` (33 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-09-19  0:46 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #4 from kargl at gcc dot gnu.org 2011-09-18 23:31:53 UTC ---
(In reply to comment #2)
> The following produces a Segmentation fault in gfc_conv_structure (r178925)
> 
>       type t
>        integer g
>       end type
>       type(t) :: u=t(1)
>       data u%g /2/
>       end

The code is invalid and so gfortran can do anything that it
wishes, including segfault.

5.2.5 Data Statement

  ...
  A variable, or part of a variable, shall not be explicitly
  initialized more than once in a program.
  ...


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (3 preceding siblings ...)
  2011-09-19  0:46 ` kargl at gcc dot gnu.org
@ 2011-09-21 19:17 ` janus at gcc dot gnu.org
  2011-09-29 13:23 ` rguenth at gcc dot gnu.org
                   ` (32 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: janus at gcc dot gnu.org @ 2011-09-21 19:17 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
                 CC|                            |janus at gcc dot gnu.org

--- Comment #5 from janus at gcc dot gnu.org 2011-09-21 16:58:29 UTC ---
(In reply to comment #4)
> The code is invalid and so gfortran can do anything that it
> wishes, including segfault.

Well, no. An ICE on invalid code may not be as bad as an ICE on valid code, but
it's still a bug. gfortran should give a meaningful error message.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (4 preceding siblings ...)
  2011-09-21 19:17 ` janus at gcc dot gnu.org
@ 2011-09-29 13:23 ` rguenth at gcc dot gnu.org
  2011-10-10 13:59 ` rguenth at gcc dot gnu.org
                   ` (31 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-09-29 13:23 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.2


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (5 preceding siblings ...)
  2011-09-29 13:23 ` rguenth at gcc dot gnu.org
@ 2011-10-10 13:59 ` rguenth at gcc dot gnu.org
  2011-10-17 16:39 ` burnus at gcc dot gnu.org
                   ` (30 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-10 13:59 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (6 preceding siblings ...)
  2011-10-10 13:59 ` rguenth at gcc dot gnu.org
@ 2011-10-17 16:39 ` burnus at gcc dot gnu.org
  2011-10-17 17:37 ` kargl at gcc dot gnu.org
                   ` (29 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-10-17 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-17 16:38:28 UTC ---
To check:
- Pointer attribute in the part ref - or an allocate attribute.
- Whether there is already some initialization.
  If one uses a constructor, it affects the whole variable,
  but mixing different data statements is OK as long as different
  parts are initialized.
- If one directly access the variable: Pointer init is only OK for null()

Example for the last item:
      integer, pointer :: u
      data u /1/  ! Accepted, but probably shouldn't
      ! data u/null()/ ! Probably OK (and currently accepted).
      end

I think it could be sufficient to check decl.c's var_element though it might
fail if one initializes a DT piecewise; if so, one needs to add a check to
data.c or modify something else in decl.c


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (7 preceding siblings ...)
  2011-10-17 16:39 ` burnus at gcc dot gnu.org
@ 2011-10-17 17:37 ` kargl at gcc dot gnu.org
  2011-10-17 21:21 ` burnus at gcc dot gnu.org
                   ` (28 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-10-17 17:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from kargl at gcc dot gnu.org 2011-10-17 17:36:33 UTC ---
(In reply to comment #2)
> The following produces a Segmentation fault in gfc_conv_structure (r178925)
> 
>       type t
>        integer g
>       end type
>       type(t) :: u=t(1)
>       data u%g /2/
>       end

The following patch removes the seqfault.  If one adds
'print *, u%g' before end and compiles the resulting
program, then one gets 1.  This is acceptable, IMHO,
because the code is invalid.


Index: trans-expr.c
===================================================================
--- trans-expr.c        (revision 180099)
+++ trans-expr.c        (working copy)
@@ -4747,7 +4747,7 @@ gfc_conv_structure (gfc_se * se, gfc_exp
   cm = expr->ts.u.derived->components;

   for (c = gfc_constructor_first (expr->value.constructor);
-       c; c = gfc_constructor_next (c), cm = cm->next)
+       c && cm; c = gfc_constructor_next (c), cm = cm->next)
     {
       /* Skip absent members in default initializers and allocatable
         components.  Although the latter have a default initializer


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (8 preceding siblings ...)
  2011-10-17 17:37 ` kargl at gcc dot gnu.org
@ 2011-10-17 21:21 ` burnus at gcc dot gnu.org
  2011-10-18  7:23 ` burnus at gcc dot gnu.org
                   ` (27 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-10-17 21:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-17 21:20:25 UTC ---
Created attachment 25534
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25534
Draft patch

The attached patch should fix all issues; however, I think the error message
text can be improved. Additionally, one should re-check the standard and add
some more test cases.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (9 preceding siblings ...)
  2011-10-17 21:21 ` burnus at gcc dot gnu.org
@ 2011-10-18  7:23 ` burnus at gcc dot gnu.org
  2011-10-26 17:37 ` jakub at gcc dot gnu.org
                   ` (26 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-10-18  7:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-18 07:23:10 UTC ---
>From the standard:
"C568 (R536) 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."

"C567 (R536) A variable whose designator appears as a
 data-stmt-object or a data-i-do-object shall not be a dummy
 argument, accessed by use or host association, in a named
 common block unless the DATA statement is in a block data
 program unit, in blank common, a function name, a function
 result name, an automatic object, or an allocatable variable."

To be fixed beyond the patch of attachment 25534
* ICE below (1) for init of DT with default init
* ICE below (2) with structure constructor, which initializes a pointer
(plus: test cases, revised error message wording)
* (3) Pointer init in DATA: Also "initial-data-target" is allowed

For the pointer init, see also PR 45290.

! =============== (1) =======================
module m
type t
  integer :: a  = 7
end type t
type t2
  integer :: b
end type t2
end module m

use m
implicit type(t)(x), type(t2)(y)
! ICE in trans:
! Invalid as "nonpointer object has default initialization"
DATA x%a/8/

! OK:
!DATA y%b/5/
!type(t2) :: y = t2(7) ! { dg-error "initializer already appears in a DATA
statement" }
end
! ============= (2) =========================
module m
  type t
    integer :: a
    integer, pointer :: bar
  end type t
end module m

subroutine test()
  use m
  type(t) :: x ! = t(4, null()) ! OK
 DATA x/t(4, null())/ ! ICE in the middle end
end subroutine test
! ============= (3) =========================
type t
  integer, pointer :: ptr
end type t
integer, target, save :: tgt

! Version A:
!type(t) :: x = t(tgt)
! Rejected with "has not been declared or is a variable,
!         which does not reduce to a constant expression"

! Version 2
type(t) :: x
DATA x%ptr /tgt/ ! error "must be a PARAMETER in DATA statement"

tgt = 7
print *, ptr
end


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (10 preceding siblings ...)
  2011-10-18  7:23 ` burnus at gcc dot gnu.org
@ 2011-10-26 17:37 ` jakub at gcc dot gnu.org
  2012-01-02 12:32 ` burnus at gcc dot gnu.org
                   ` (25 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-10-26 17:37 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.2                       |4.6.3

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-10-26 17:13:37 UTC ---
GCC 4.6.2 is being released.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (11 preceding siblings ...)
  2011-10-26 17:37 ` jakub at gcc dot gnu.org
@ 2012-01-02 12:32 ` burnus at gcc dot gnu.org
  2012-03-01 15:01 ` jakub at gcc dot gnu.org
                   ` (24 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-01-02 12:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-02 12:30:42 UTC ---
See also RFC patch: http://gcc.gnu.org/ml/fortran/2011-10/msg00136.html
and reply: http://gcc.gnu.org/ml/fortran/2011-10/msg00138.html


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.6/4.7 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (12 preceding siblings ...)
  2012-01-02 12:32 ` burnus at gcc dot gnu.org
@ 2012-03-01 15:01 ` jakub at gcc dot gnu.org
  2013-04-12 15:17 ` [Bug fortran/50410] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
                   ` (23 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-01 15:01 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.3                       |4.6.4

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-01 14:38:32 UTC ---
GCC 4.6.3 is being released.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.7/4.8/4.9 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (13 preceding siblings ...)
  2012-03-01 15:01 ` jakub at gcc dot gnu.org
@ 2013-04-12 15:17 ` jakub at gcc dot gnu.org
  2014-06-12 13:48 ` [Bug fortran/50410] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org
                   ` (22 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-12 15:17 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.4                       |4.7.4

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-12 15:16:50 UTC ---
GCC 4.6.4 has been released and the branch has been closed.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.7/4.8/4.9/4.10 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (14 preceding siblings ...)
  2013-04-12 15:17 ` [Bug fortran/50410] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
@ 2014-06-12 13:48 ` rguenth at gcc dot gnu.org
  2014-12-19 13:34 ` [Bug fortran/50410] [4.8/4.9/5 " jakub at gcc dot gnu.org
                   ` (21 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-12 13:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.7.4                       |4.8.4

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
The 4.7 branch is being closed, moving target milestone to 4.8.4.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.8/4.9/5 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (15 preceding siblings ...)
  2014-06-12 13:48 ` [Bug fortran/50410] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org
@ 2014-12-19 13:34 ` jakub at gcc dot gnu.org
  2015-06-23  8:28 ` [Bug fortran/50410] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
                   ` (20 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-19 13:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.4                       |4.8.5

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.4 has been released.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.8/4.9/5/6 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (16 preceding siblings ...)
  2014-12-19 13:34 ` [Bug fortran/50410] [4.8/4.9/5 " jakub at gcc dot gnu.org
@ 2015-06-23  8:28 ` rguenth at gcc dot gnu.org
  2015-06-26 20:02 ` [Bug fortran/50410] [4.9/5/6 " jakub at gcc dot gnu.org
                   ` (19 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-23  8:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.5                       |4.9.3

--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.9/5/6 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (17 preceding siblings ...)
  2015-06-23  8:28 ` [Bug fortran/50410] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
@ 2015-06-26 20:02 ` jakub at gcc dot gnu.org
  2015-06-26 20:30 ` jakub at gcc dot gnu.org
                   ` (18 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.3 has been released.


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.9/5/6 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (18 preceding siblings ...)
  2015-06-26 20:02 ` [Bug fortran/50410] [4.9/5/6 " jakub at gcc dot gnu.org
@ 2015-06-26 20:30 ` jakub at gcc dot gnu.org
  2015-09-02 13:14 ` zeccav at gmail dot com
                   ` (17 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.3                       |4.9.4


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [4.9/5/6 Regression] ICE in record_reference
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (19 preceding siblings ...)
  2015-06-26 20:30 ` jakub at gcc dot gnu.org
@ 2015-09-02 13:14 ` zeccav at gmail dot com
  2020-05-11  4:57 ` [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement zeccav at gmail dot com
                   ` (16 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: zeccav at gmail dot com @ 2015-09-02 13:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #19 from Vittorio Zecca <zeccav at gmail dot com> ---
ICE still there in 5.2.0


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (20 preceding siblings ...)
  2015-09-02 13:14 ` zeccav at gmail dot com
@ 2020-05-11  4:57 ` zeccav at gmail dot com
  2020-05-11  4:58 ` zeccav at gmail dot com
                   ` (15 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: zeccav at gmail dot com @ 2020-05-11  4:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #37 from Vittorio Zecca <zeccav at gmail dot com> ---
Fixed in 10.1.1.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (21 preceding siblings ...)
  2020-05-11  4:57 ` [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement zeccav at gmail dot com
@ 2020-05-11  4:58 ` zeccav at gmail dot com
  2020-05-11  6:09 ` kargl at gcc dot gnu.org
                   ` (14 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: zeccav at gmail dot com @ 2020-05-11  4:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

Vittorio Zecca <zeccav at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #38 from Vittorio Zecca <zeccav at gmail dot com> ---
Fixed in 10.1.1.
Closing the issue.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (22 preceding siblings ...)
  2020-05-11  4:58 ` zeccav at gmail dot com
@ 2020-05-11  6:09 ` kargl at gcc dot gnu.org
  2020-06-20 19:29 ` anlauf at gcc dot gnu.org
                   ` (13 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-05-11  6:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |kargl at gcc dot gnu.org
         Resolution|FIXED                       |---
   Target Milestone|8.5                         |11.0

--- Comment #39 from kargl at gcc dot gnu.org ---
The bug is not fixed.  The code from comment #3

% cat a.f90
     type t
       integer g
      end type
      type(t) :: u=t(1)
      data u%g /2/
      end
troutmask:sgk[205] gfcx -c a.f90
a.f90:1:0:

    1 |      type t
      | 
internal compiler error: Segmentation fault
0xdf6e3a crash_signal
        ../../gccx/gcc/toplev.c:328
0x8acbae gfc_conv_structure(gfc_se*, gfc_expr*, int)
        ../../gccx/gcc/fortran/trans-expr.c:8528
0x8c1f37 gfc_conv_initializer(gfc_expr*, gfc_typespec*, tree_node*, bool, bool,
bool)
        ../../gccx/gcc/fortran/trans-expr.c:7679
0x8a0020 gfc_get_symbol_decl(gfc_symbol*)
        ../../gccx/gcc/fortran/trans-decl.c:1892
0x8a33e5 generate_local_decl
        ../../gccx/gcc/fortran/trans-decl.c:5894
0x85a0e2 do_traverse_symtree
        ../../gccx/gcc/fortran/symbol.c:4165
0x8a454c generate_local_vars
        ../../gccx/gcc/fortran/trans-decl.c:6100
0x8a454c gfc_generate_function_code(gfc_namespace*)
        ../../gccx/gcc/fortran/trans-decl.c:6758
0x81e516 translate_all_program_units
        ../../gccx/gcc/fortran/parse.c:6302
0x81e516 gfc_parse_file()
        ../../gccx/gcc/fortran/parse.c:6541
0x871858 gfc_be_parse_file
        ../../gccx/gcc/fortran/f95-lang.c:210

The code in the first example in comment #9 also causes an ICE.

Codes z1.f90, z2.f90, and z3.f90 in comment #23 cause ICEs.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (23 preceding siblings ...)
  2020-05-11  6:09 ` kargl at gcc dot gnu.org
@ 2020-06-20 19:29 ` anlauf at gcc dot gnu.org
  2020-06-21 15:31 ` dominiq at lps dot ens.fr
                   ` (12 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-20 19:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #40 from anlauf at gcc dot gnu.org ---
(In reply to kargl from comment #39)
> The bug is not fixed.  The code from comment #3
> 
> % cat a.f90
>      type t
>        integer g
>       end type
>       type(t) :: u=t(1)
>       data u%g /2/
>       end

The patch

diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index b7c568e90e6..02caf992dfd 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -8543,7 +8543,7 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int
init)
   cm = expr->ts.u.derived->components;

   for (c = gfc_constructor_first (expr->value.constructor);
-       c; c = gfc_constructor_next (c), cm = cm->next)
+       c && cm; c = gfc_constructor_next (c), cm = cm->next)
     {
       /* Skip absent members in default initializers and allocatable
         components.  Although the latter have a default initializer

fixes the ICE, but does not detect the double initialization.

> The code in the first example in comment #9 also causes an ICE.

This one then works and produces the expected error.

> Codes z1.f90, z2.f90, and z3.f90 in comment #23 cause ICEs.

Only z1 ICEs, z2 and z3 produce error messages.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (24 preceding siblings ...)
  2020-06-20 19:29 ` anlauf at gcc dot gnu.org
@ 2020-06-21 15:31 ` dominiq at lps dot ens.fr
  2020-06-21 17:20 ` anlauf at gcc dot gnu.org
                   ` (11 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-06-21 15:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #41 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
In my working tree I had the following patch

--- /opt/gcc/_clean-svn//gcc/fortran/trans-expr.c       2020-01-05
11:44:35.000000000 +0100
+++ /opt/gcc/work-cvs/gcc/fortran/trans-expr.c  2020-01-05 11:45:38.000000000
+0100
@@ -8366,7 +8366,7 @@ gfc_trans_structure_assign (tree dest, g
     gfc_init_se (&se, NULL);

   for (c = gfc_constructor_first (expr->value.constructor);
-       c; c = gfc_constructor_next (c), cm = cm->next)
+       c && cm; c = gfc_constructor_next (c), cm = cm->next)
     {
       /* Skip absent members in default initializers.  */
       if (!c->expr && !cm->attr.allocatable)
@@ -8447,6 +8447,7 @@ gfc_trans_structure_assign (tree dest, g
                                              expr->ts.u.derived, init);
       gfc_add_expr_to_block (&block, tmp);
     }
+  gcc_assert (!c);
   return gfc_finish_block (&block);
 }

@@ -8519,7 +8520,7 @@ gfc_conv_structure (gfc_se * se, gfc_exp
   cm = expr->ts.u.derived->components;

   for (c = gfc_constructor_first (expr->value.constructor);
-       c; c = gfc_constructor_next (c), cm = cm->next)
+       c && cm; c = gfc_constructor_next (c), cm = cm->next)
     {
       /* Skip absent members in default initializers and allocatable
         components.  Although the latter have a default initializer
@@ -8564,6 +8565,11 @@ gfc_conv_structure (gfc_se * se, gfc_exp
          CONSTRUCTOR_APPEND_ELT (v, cm->backend_decl, val);
        }
     }
+  /* gcc_assert (!c); */
+  if (c)
+    /* gfc_error ("Invalid DATA statement at %C.");
+    gfc_error ("Invalid DATA statement at %L.", &expr->where); */
+    gfc_error ("Invalid DATA statement at %L.", &gfc_current_locus);

   se->expr = build_constructor (type, v);
   if (init)

I have never seen the first assert triggering and I never found a way to emit a
better error message.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (25 preceding siblings ...)
  2020-06-21 15:31 ` dominiq at lps dot ens.fr
@ 2020-06-21 17:20 ` anlauf at gcc dot gnu.org
  2020-06-21 18:19 ` anlauf at gcc dot gnu.org
                   ` (10 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-21 17:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #42 from anlauf at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #41)
> In my working tree I had the following patch

This still ICEs on comment#23 z1.

Slightly rewriting that case, one gets a reasonable error message:

program p
  type ta
     integer :: a
  end type ta
  type t
     type(ta), pointer :: b
  end type t
  type(t) :: u = t(ta(1))
end

pr50410_23x.f90:8:19:

    8 |   type(t) :: u = t(ta(1))
      |                   1
Error: The element in the structure constructor at (1), for pointer component
'b' should be a POINTER or a TARGET


Digging further, one sees that the error is generated for z1 but not emitted.
The following patch does the magic (not regtested):

diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 8daa7bb8d06..0a995ec3ae7 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3087,6 +3087,9 @@ gfc_reduce_init_expr (gfc_expr *expr)
     t = gfc_check_init_expr (expr);
   gfc_init_expr_flag = false;

+  if (gfc_error_check())
+    return false;
+
   if (!t || !expr)
     return false;

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (26 preceding siblings ...)
  2020-06-21 17:20 ` anlauf at gcc dot gnu.org
@ 2020-06-21 18:19 ` anlauf at gcc dot gnu.org
  2021-04-27 11:37 ` [Bug fortran/50410] [8/9/10/11/12 " jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-21 18:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #43 from anlauf at gcc dot gnu.org ---
(In reply to anlauf from comment #42)
> The following patch does the magic (not regtested):
> 
> diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
> index 8daa7bb8d06..0a995ec3ae7 100644
> --- a/gcc/fortran/expr.c
> +++ b/gcc/fortran/expr.c
> @@ -3087,6 +3087,9 @@ gfc_reduce_init_expr (gfc_expr *expr)
>      t = gfc_check_init_expr (expr);
>    gfc_init_expr_flag = false;
>  
> +  if (gfc_error_check())
> +    return false;
> +
>    if (!t || !expr)
>      return false;

This produces lots of regressions.  So this is apparently not the right place.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [8/9/10/11/12 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (27 preceding siblings ...)
  2020-06-21 18:19 ` anlauf at gcc dot gnu.org
@ 2021-04-27 11:37 ` jakub at gcc dot gnu.org
  2021-07-28  7:04 ` [Bug fortran/50410] [9/10/11/12 " rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-27 11:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.0                        |11.2

--- Comment #44 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.1 has been released, retargeting bugs to GCC 11.2.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [9/10/11/12 Regression] ICE in record_reference,  pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (28 preceding siblings ...)
  2021-04-27 11:37 ` [Bug fortran/50410] [8/9/10/11/12 " jakub at gcc dot gnu.org
@ 2021-07-28  7:04 ` rguenth at gcc dot gnu.org
  2022-04-21  7:47 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-28  7:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.2                        |11.3

--- Comment #45 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11.2 is being released, retargeting bugs to GCC 11.3

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [9/10/11/12 Regression] ICE in record_reference,  pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (29 preceding siblings ...)
  2021-07-28  7:04 ` [Bug fortran/50410] [9/10/11/12 " rguenth at gcc dot gnu.org
@ 2022-04-21  7:47 ` rguenth at gcc dot gnu.org
  2023-05-29 10:01 ` [Bug fortran/50410] [10/11/12/13/14 " jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-21  7:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.3                        |11.4

--- Comment #46 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11.3 is being released, retargeting bugs to GCC 11.4.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [10/11/12/13/14 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (30 preceding siblings ...)
  2022-04-21  7:47 ` rguenth at gcc dot gnu.org
@ 2023-05-29 10:01 ` jakub at gcc dot gnu.org
  2023-07-31 20:49 ` [Bug fortran/50410] [11/12/13/14 " anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-29 10:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.4                        |11.5

--- Comment #47 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.4 is being released, retargeting bugs to GCC 11.5.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [11/12/13/14 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (31 preceding siblings ...)
  2023-05-29 10:01 ` [Bug fortran/50410] [10/11/12/13/14 " jakub at gcc dot gnu.org
@ 2023-07-31 20:49 ` anlauf at gcc dot gnu.org
  2024-03-29  9:32 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-07-31 20:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #48 from anlauf at gcc dot gnu.org ---
Created attachment 55666
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55666&action=edit
Inremental patch

This is a cut-down and revised version of the patch by Tobias that deals with
invalid allocatable and pointer components in data statements, and adjusted
to F2018, and fixing the issue mentioned by Steve.

I've removed the other part that tries to detect the double initialization.
I think this is the wrong place as is would not detect e.g. the following:

program p
  type t
     integer :: g
  end type t
  type(t) :: u
  data u /t(3)/
  data u%g /2/
end

A better-suited place is probably the loop in gfc_assign_data_value, but
find_con_by_component seems not to be able to handle the current situation.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [11/12/13/14 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (32 preceding siblings ...)
  2023-07-31 20:49 ` [Bug fortran/50410] [11/12/13/14 " anlauf at gcc dot gnu.org
@ 2024-03-29  9:32 ` cvs-commit at gcc dot gnu.org
  2024-03-29 17:02 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-29  9:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #49 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:6fb253a25dff13253d63553f02e0fe72c5e3ab4e

commit r14-9720-g6fb253a25dff13253d63553f02e0fe72c5e3ab4e
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Mar 28 22:34:40 2024 +0100

    Fortran: fix NULL pointer dereference on overlapping initialization
[PR50410]

    gcc/fortran/ChangeLog:

            PR fortran/50410
            * trans-expr.cc (gfc_conv_structure): Check for NULL pointer.

    gcc/testsuite/ChangeLog:

            PR fortran/50410
            * gfortran.dg/data_initialized_4.f90: New test.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [11/12/13/14 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (33 preceding siblings ...)
  2024-03-29  9:32 ` cvs-commit at gcc dot gnu.org
@ 2024-03-29 17:02 ` cvs-commit at gcc dot gnu.org
  2024-03-29 17:25 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  37 siblings, 0 replies; 39+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-29 17:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #50 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:250990298fb792635d9895e7642ccedbc2dd39d4

commit r13-8505-g250990298fb792635d9895e7642ccedbc2dd39d4
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Mar 28 22:34:40 2024 +0100

    Fortran: fix NULL pointer dereference on overlapping initialization
[PR50410]

    gcc/fortran/ChangeLog:

            PR fortran/50410
            * trans-expr.cc (gfc_conv_structure): Check for NULL pointer.

    gcc/testsuite/ChangeLog:

            PR fortran/50410
            * gfortran.dg/data_initialized_4.f90: New test.

    (cherry picked from commit 6fb253a25dff13253d63553f02e0fe72c5e3ab4e)

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [11/12/13/14 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (34 preceding siblings ...)
  2024-03-29 17:02 ` cvs-commit at gcc dot gnu.org
@ 2024-03-29 17:25 ` cvs-commit at gcc dot gnu.org
  2024-03-29 17:43 ` cvs-commit at gcc dot gnu.org
  2024-03-29 17:50 ` [Bug fortran/50410] " anlauf at gcc dot gnu.org
  37 siblings, 0 replies; 39+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-29 17:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #51 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:cb72fbd49e1f0c1cbdf8a9e97860063b19b1f95e

commit r12-10299-gcb72fbd49e1f0c1cbdf8a9e97860063b19b1f95e
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Mar 28 22:34:40 2024 +0100

    Fortran: fix NULL pointer dereference on overlapping initialization
[PR50410]

    gcc/fortran/ChangeLog:

            PR fortran/50410
            * trans-expr.cc (gfc_conv_structure): Check for NULL pointer.

    gcc/testsuite/ChangeLog:

            PR fortran/50410
            * gfortran.dg/data_initialized_4.f90: New test.

    (cherry picked from commit 6fb253a25dff13253d63553f02e0fe72c5e3ab4e)

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] [11/12/13/14 Regression] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (35 preceding siblings ...)
  2024-03-29 17:25 ` cvs-commit at gcc dot gnu.org
@ 2024-03-29 17:43 ` cvs-commit at gcc dot gnu.org
  2024-03-29 17:50 ` [Bug fortran/50410] " anlauf at gcc dot gnu.org
  37 siblings, 0 replies; 39+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-29 17:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

--- Comment #52 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:1611acc1f72cad30c7ecccb5c85246836c1d0299

commit r11-11299-g1611acc1f72cad30c7ecccb5c85246836c1d0299
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Mar 28 22:34:40 2024 +0100

    Fortran: fix NULL pointer dereference on overlapping initialization
[PR50410]

    gcc/fortran/ChangeLog:

            PR fortran/50410
            * trans-expr.c (gfc_conv_structure): Check for NULL pointer.

    gcc/testsuite/ChangeLog:

            PR fortran/50410
            * gfortran.dg/data_initialized_4.f90: New test.

    (cherry picked from commit 6fb253a25dff13253d63553f02e0fe72c5e3ab4e)

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [Bug fortran/50410] ICE in record_reference, pointer variable in data statement
  2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
                   ` (36 preceding siblings ...)
  2024-03-29 17:43 ` cvs-commit at gcc dot gnu.org
@ 2024-03-29 17:50 ` anlauf at gcc dot gnu.org
  37 siblings, 0 replies; 39+ messages in thread
From: anlauf at gcc dot gnu.org @ 2024-03-29 17:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50410

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12/13/14 Regression]    |ICE in record_reference,
                   |ICE in record_reference,    |pointer variable in data
                   |pointer variable in data    |statement
                   |statement                   |
           Keywords|                            |diagnostic

--- Comment #53 from anlauf at gcc dot gnu.org ---
Removing the regression marker after the ICEs on the testcases are all
resolved except:

- comment#24 testcase z5: this is a coarray issue and has nothing to do
  with DATA initialization --> should be moved to a separate PR

- missing diagnostics for overlapping initialization of DT components,
  and some sub-optimal error messages that could be improved

So let's treat this PR further as any regular one.

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2024-03-29 17:50 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-15  8:43 [Bug fortran/50410] New: ICE in record_reference zeccav at gmail dot com
2011-09-15 11:16 ` [Bug fortran/50410] [4.6/4.7 Regression] " dominiq at lps dot ens.fr
2011-09-18 22:01 ` zeccav at gmail dot com
2011-09-18 22:02 ` dominiq at lps dot ens.fr
2011-09-19  0:46 ` kargl at gcc dot gnu.org
2011-09-21 19:17 ` janus at gcc dot gnu.org
2011-09-29 13:23 ` rguenth at gcc dot gnu.org
2011-10-10 13:59 ` rguenth at gcc dot gnu.org
2011-10-17 16:39 ` burnus at gcc dot gnu.org
2011-10-17 17:37 ` kargl at gcc dot gnu.org
2011-10-17 21:21 ` burnus at gcc dot gnu.org
2011-10-18  7:23 ` burnus at gcc dot gnu.org
2011-10-26 17:37 ` jakub at gcc dot gnu.org
2012-01-02 12:32 ` burnus at gcc dot gnu.org
2012-03-01 15:01 ` jakub at gcc dot gnu.org
2013-04-12 15:17 ` [Bug fortran/50410] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
2014-06-12 13:48 ` [Bug fortran/50410] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-12-19 13:34 ` [Bug fortran/50410] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-06-23  8:28 ` [Bug fortran/50410] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
2015-06-26 20:02 ` [Bug fortran/50410] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:30 ` jakub at gcc dot gnu.org
2015-09-02 13:14 ` zeccav at gmail dot com
2020-05-11  4:57 ` [Bug fortran/50410] [8/9/10/11 Regression] ICE in record_reference, pointer variable in data statement zeccav at gmail dot com
2020-05-11  4:58 ` zeccav at gmail dot com
2020-05-11  6:09 ` kargl at gcc dot gnu.org
2020-06-20 19:29 ` anlauf at gcc dot gnu.org
2020-06-21 15:31 ` dominiq at lps dot ens.fr
2020-06-21 17:20 ` anlauf at gcc dot gnu.org
2020-06-21 18:19 ` anlauf at gcc dot gnu.org
2021-04-27 11:37 ` [Bug fortran/50410] [8/9/10/11/12 " jakub at gcc dot gnu.org
2021-07-28  7:04 ` [Bug fortran/50410] [9/10/11/12 " rguenth at gcc dot gnu.org
2022-04-21  7:47 ` rguenth at gcc dot gnu.org
2023-05-29 10:01 ` [Bug fortran/50410] [10/11/12/13/14 " jakub at gcc dot gnu.org
2023-07-31 20:49 ` [Bug fortran/50410] [11/12/13/14 " anlauf at gcc dot gnu.org
2024-03-29  9:32 ` cvs-commit at gcc dot gnu.org
2024-03-29 17:02 ` cvs-commit at gcc dot gnu.org
2024-03-29 17:25 ` cvs-commit at gcc dot gnu.org
2024-03-29 17:43 ` cvs-commit at gcc dot gnu.org
2024-03-29 17:50 ` [Bug fortran/50410] " anlauf at gcc dot gnu.org

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