public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/55887] New: [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization
@ 2013-01-06 14:53 burnus at gcc dot gnu.org
  2013-01-24 19:16 ` [Bug fortran/55887] " tilo@tilo-schwarz.de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-01-06 14:53 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55887
           Summary: [OOP][F2008] ICE with CLASS and data-target pointer
                    association in (default) initialization
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
            Blocks: 45290, 51076


Follow up to PR 55763 comment 14/15.

For CLASS(t) and CLASS(*), gfortran ICEs for pointer default initializers/
initializers which point to a data target instead of NULL.

Example:

    type t
    end type t
    type(t), target :: x
    class(*), pointer :: ptr2 => x
    if (same_type_as (ptr2, x) .neqv. .TRUE.) call abort()
  end


That's a Fortran 2008 feature. (Cf. also PR51076, PR45290 and PR50410 comment
9.)


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

* [Bug fortran/55887] [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization
  2013-01-06 14:53 [Bug fortran/55887] New: [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization burnus at gcc dot gnu.org
@ 2013-01-24 19:16 ` tilo@tilo-schwarz.de
  2013-01-26 21:10 ` janus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tilo@tilo-schwarz.de @ 2013-01-24 19:16 UTC (permalink / raw)
  To: gcc-bugs


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

Tilo Schwarz <tilo@tilo-schwarz.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tilo@tilo-schwarz.de

--- Comment #1 from Tilo Schwarz <tilo@tilo-schwarz.de> 2013-01-24 19:16:25 UTC ---
I don't know how much help this actually is, but on my machine this commit

commit a90fe8299d2e635e53ab006c934154289d06ffa1
Author: pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Dec 20 00:15:00 2012 +0000

    2012-12-19  Paul Thomas  <pault@gcc.gnu.org>

    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194622
138bc75d-0d04-0410-961f-82ee72b054a4


gives an ICE, but one commit earlier


commit 873f242d97571e98acad8ea1912f81682bd7a448
Author: burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Dec 19 23:05:49 2012 +0000

    2012-12-19  Tobias Burnus  <burnus@net-b.de>

    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194621
138bc75d-0d04-0410-961f-82ee72b054a4


does not.


Regards,
Tilo


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

* [Bug fortran/55887] [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization
  2013-01-06 14:53 [Bug fortran/55887] New: [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization burnus at gcc dot gnu.org
  2013-01-24 19:16 ` [Bug fortran/55887] " tilo@tilo-schwarz.de
@ 2013-01-26 21:10 ` janus at gcc dot gnu.org
  2013-01-26 21:21 ` janus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2013-01-26 21:10 UTC (permalink / raw)
  To: gcc-bugs


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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-01-26
                 CC|                            |janus at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #2 from janus at gcc dot gnu.org 2013-01-26 21:10:15 UTC ---
The type(t) version ...

  type t
  end type t
  type(t), target :: x
  type(t), pointer :: ptr2 => x
  if (.not. same_type_as (ptr2, x)) call abort()
end

... is rejected by 4.7 with (note the wrong locus):

  type t
        1
Error: Pointer initialization target at (1) must have the SAVE attribute


but trunk gives yet another ICE:

internal compiler error: in symtab_get_node, at symtab.c:277


I think the error message of 4.7 is not triggered on trunk, because 'x' gets
the SAVE_IMPLICIT attribute. The ICE goes away when giving 'x' the SAVE
attribute explicitly.


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

* [Bug fortran/55887] [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization
  2013-01-06 14:53 [Bug fortran/55887] New: [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization burnus at gcc dot gnu.org
  2013-01-24 19:16 ` [Bug fortran/55887] " tilo@tilo-schwarz.de
  2013-01-26 21:10 ` janus at gcc dot gnu.org
@ 2013-01-26 21:21 ` janus at gcc dot gnu.org
  2013-07-31 13:09 ` [Bug fortran/55887] [OOP][F08] " janus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2013-01-26 21:21 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from janus at gcc dot gnu.org 2013-01-26 21:21:38 UTC ---
This patch fixes the ICE in comment 0:


Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c    (revision 195486)
+++ gcc/fortran/trans-decl.c    (working copy)
@@ -1484,6 +1484,12 @@ gfc_get_symbol_decl (gfc_symbol * sym)
       && (gfc_option.coarray != GFC_FCOARRAY_LIB
       || !sym->attr.codimension || sym->attr.allocatable))
     {
+      bool pointer;
+      if (sym->ts.type == BT_CLASS)
+    pointer = CLASS_DATA (sym)->attr.class_pointer
+          || CLASS_DATA (sym)->attr.allocatable;
+      else
+    pointer = sym->attr.pointer || sym->attr.allocatable;
       /* Add static initializer. For procedures, it is only needed if
      SAVE is specified otherwise they need to be reinitialized
      every time the procedure is entered. The TREE_STATIC is
@@ -1493,8 +1499,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
                           sym->attr.dimension
                           || (sym->attr.codimension
                               && sym->attr.allocatable),
-                          sym->attr.pointer
-                          || sym->attr.allocatable,
+                          pointer,
                           sym->attr.proc_pointer);
     }


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

* [Bug fortran/55887] [OOP][F08] ICE with CLASS and data-target pointer association in (default) initialization
  2013-01-06 14:53 [Bug fortran/55887] New: [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-01-26 21:21 ` janus at gcc dot gnu.org
@ 2013-07-31 13:09 ` janus at gcc dot gnu.org
  2013-07-31 13:10 ` janus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2013-07-31 13:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from janus at gcc dot gnu.org ---
PR 57036 is very much related to this one ...


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

* [Bug fortran/55887] [OOP][F08] ICE with CLASS and data-target pointer association in (default) initialization
  2013-01-06 14:53 [Bug fortran/55887] New: [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-07-31 13:09 ` [Bug fortran/55887] [OOP][F08] " janus at gcc dot gnu.org
@ 2013-07-31 13:10 ` janus at gcc dot gnu.org
  2013-08-09  8:34 ` janus at gcc dot gnu.org
  2014-03-15 11:12 ` dominiq at lps dot ens.fr
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2013-07-31 13:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from janus at gcc dot gnu.org ---
(In reply to janus from comment #4)
> PR 57036 is very much related to this one ...

Sorry, that should have been: PR 57306


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

* [Bug fortran/55887] [OOP][F08] ICE with CLASS and data-target pointer association in (default) initialization
  2013-01-06 14:53 [Bug fortran/55887] New: [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization burnus at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2013-07-31 13:10 ` janus at gcc dot gnu.org
@ 2013-08-09  8:34 ` janus at gcc dot gnu.org
  2014-03-15 11:12 ` dominiq at lps dot ens.fr
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2013-08-09  8:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from janus at gcc dot gnu.org ---
After fixing PR 57306, the original ICE here is gone and both test cases work
if one explicitly gives the target the SAVE attribute (otherwise there is
another ICE).

In fact the target should implicitly get the SAVE attribute, which is what PR
55207 is about. Once that is fixed, also the remaining ICE here should be gone.


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

* [Bug fortran/55887] [OOP][F08] ICE with CLASS and data-target pointer association in (default) initialization
  2013-01-06 14:53 [Bug fortran/55887] New: [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization burnus at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2013-08-09  8:34 ` janus at gcc dot gnu.org
@ 2014-03-15 11:12 ` dominiq at lps dot ens.fr
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-03-15 11:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> In fact the target should implicitly get the SAVE attribute, which is 
> what PR 55207 is about. Once that is fixed, also the remaining ICE here 
> should be gone.

It is. Closing as duplicate.

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


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

end of thread, other threads:[~2014-03-15 11:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-06 14:53 [Bug fortran/55887] New: [OOP][F2008] ICE with CLASS and data-target pointer association in (default) initialization burnus at gcc dot gnu.org
2013-01-24 19:16 ` [Bug fortran/55887] " tilo@tilo-schwarz.de
2013-01-26 21:10 ` janus at gcc dot gnu.org
2013-01-26 21:21 ` janus at gcc dot gnu.org
2013-07-31 13:09 ` [Bug fortran/55887] [OOP][F08] " janus at gcc dot gnu.org
2013-07-31 13:10 ` janus at gcc dot gnu.org
2013-08-09  8:34 ` janus at gcc dot gnu.org
2014-03-15 11:12 ` dominiq at lps dot ens.fr

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