public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64355] New: ICE (segfault) in gfc_zero_size_array with -fcoarray=single
@ 2014-12-18 20:26 burnus at gcc dot gnu.org
  2014-12-18 20:49 ` [Bug fortran/64355] [4.9/5 Regression] " dominiq at lps dot ens.fr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-12-18 20:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64355
           Summary: ICE (segfault) in gfc_zero_size_array with
                    -fcoarray=single
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

The following program ICEs (segfaults) in
  0x607cbb gfc_zero_size_array
          ../../gcc/fortran/arith.c:1637
when compiled with gfortran -fcoarray=single



module m
type t
   integer, allocatable :: a(:)
end type t
end module m

program main
  use m
  type(t), save :: caf[*]

  interface
    subroutine sub1(x)
      import :: t
      type(t) :: x[*]
    end subroutine sub1
  end interface

  call sub1(caf)
end program main


subroutine sub1(x)
  use m
  type(t) :: x[*]
end subroutine sub1


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

* [Bug fortran/64355] [4.9/5 Regression] ICE (segfault) in gfc_zero_size_array with -fcoarray=single
  2014-12-18 20:26 [Bug fortran/64355] New: ICE (segfault) in gfc_zero_size_array with -fcoarray=single burnus at gcc dot gnu.org
@ 2014-12-18 20:49 ` dominiq at lps dot ens.fr
  2014-12-18 21:13 ` kargl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-12-18 20:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-12-18
      Known to work|                            |4.8.4
            Summary|ICE (segfault) in           |[4.9/5 Regression] ICE
                   |gfc_zero_size_array with    |(segfault) in
                   |-fcoarray=single            |gfc_zero_size_array with
                   |                            |-fcoarray=single
     Ever confirmed|0                           |1
      Known to fail|                            |4.9.3, 5.0

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed on 4.9.3 and trunk (5.0). 4.8.4 compiles the code without error.


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

* [Bug fortran/64355] [4.9/5 Regression] ICE (segfault) in gfc_zero_size_array with -fcoarray=single
  2014-12-18 20:26 [Bug fortran/64355] New: ICE (segfault) in gfc_zero_size_array with -fcoarray=single burnus at gcc dot gnu.org
  2014-12-18 20:49 ` [Bug fortran/64355] [4.9/5 Regression] " dominiq at lps dot ens.fr
@ 2014-12-18 21:13 ` kargl at gcc dot gnu.org
  2015-01-09 11:31 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu.org @ 2014-12-18 21:13 UTC (permalink / raw)
  To: gcc-bugs

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

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 ---
The problem arises in interface.c at 1210.

      if (s1->as->type == AS_EXPLICIT)
    for (i = 0; i < s1->as->rank + s1->as->corank; i++)
      {
        shape1 = gfc_subtract (gfc_copy_expr (s1->as->upper[i]),
                  gfc_copy_expr (s1->as->lower[i]));
        shape2 = gfc_subtract (gfc_copy_expr (s2->as->upper[i]),
                  gfc_copy_expr (s2->as->lower[i]));


(gdb) print *s1->as
$4 = {rank = 0, corank = 1, type = AS_EXPLICIT, cotype = AS_EXPLICIT, 
  lower = {0x20348b240, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, upper = {0x0, 0x0, 
    0x0, 0x0, 0x0, 0x0, 0x0}, cray_pointee = false, cp_was_assumed = false}
(gdb) print *s2->as
$5 = {rank = 0, corank = 1, type = AS_EXPLICIT, cotype = AS_EXPLICIT, 
  lower = {0x20348b540, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, upper = {0x0, 0x0, 
    0x0, 0x0, 0x0, 0x0, 0x0}, cray_pointee = false, cp_was_assumed = false}

Both s1->as->upper[0] and s2->as->upper[0] are NULL.  gfc_copy_expr()
returns NULL, so the code is gfc_subtract(NULL, 0x20348b240).  Well,
gfc_subtract isn't expecting a NULL.


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

* [Bug fortran/64355] [4.9/5 Regression] ICE (segfault) in gfc_zero_size_array with -fcoarray=single
  2014-12-18 20:26 [Bug fortran/64355] New: ICE (segfault) in gfc_zero_size_array with -fcoarray=single burnus at gcc dot gnu.org
  2014-12-18 20:49 ` [Bug fortran/64355] [4.9/5 Regression] " dominiq at lps dot ens.fr
  2014-12-18 21:13 ` kargl at gcc dot gnu.org
@ 2015-01-09 11:31 ` rguenth at gcc dot gnu.org
  2015-01-13  9:33 ` jakub at gcc dot gnu.org
  2015-01-27 17:54 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-09 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

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


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

* [Bug fortran/64355] [4.9/5 Regression] ICE (segfault) in gfc_zero_size_array with -fcoarray=single
  2014-12-18 20:26 [Bug fortran/64355] New: ICE (segfault) in gfc_zero_size_array with -fcoarray=single burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-01-09 11:31 ` rguenth at gcc dot gnu.org
@ 2015-01-13  9:33 ` jakub at gcc dot gnu.org
  2015-01-27 17:54 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-01-13  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |janus at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r197922.


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

* [Bug fortran/64355] [4.9/5 Regression] ICE (segfault) in gfc_zero_size_array with -fcoarray=single
  2014-12-18 20:26 [Bug fortran/64355] New: ICE (segfault) in gfc_zero_size_array with -fcoarray=single burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-01-13  9:33 ` jakub at gcc dot gnu.org
@ 2015-01-27 17:54 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2015-01-27 17:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Duplicate of PR 64771, which fixed it for GCC 5 (backporting pending).

*** This bug has been marked as a duplicate of bug 64771 ***


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

end of thread, other threads:[~2015-01-27 17:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-18 20:26 [Bug fortran/64355] New: ICE (segfault) in gfc_zero_size_array with -fcoarray=single burnus at gcc dot gnu.org
2014-12-18 20:49 ` [Bug fortran/64355] [4.9/5 Regression] " dominiq at lps dot ens.fr
2014-12-18 21:13 ` kargl at gcc dot gnu.org
2015-01-09 11:31 ` rguenth at gcc dot gnu.org
2015-01-13  9:33 ` jakub at gcc dot gnu.org
2015-01-27 17:54 ` burnus 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).