public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53653] New: [IR Tracking] Disallow abstract/unlimited-polymorphic types in array constructors
@ 2012-06-13  7:04 burnus at gcc dot gnu.org
  2014-07-20  8:25 ` [Bug fortran/53653] " dominiq at lps dot ens.fr
  2021-06-08 17:18 ` gscfq@t-online.de
  0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-06-13  7:04 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53653
           Summary: [IR Tracking] Disallow abstract/unlimited-polymorphic
                    types in array constructors
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


See thread started at http://j3-fortran.org/pipermail/j3/2012-June/005332.html
- and note that there is no IR yet.

Suggested change:
  C4106 (R472) An <ac-value> shall not be unlimited polymorphic or of an
  abstract type.


The following program gives currently an ICE:

test.f90:28:0: internal compiler error: in gfc_conv_array_constructor_expr, at
fortran/trans-expr.c:4932
 allocate(y(1), source=[x])
 ^


module m
  abstract interface
    integer function afoo()
    end function
  end interface

  type, abstract :: abstract_base
    integer i
  contains
    procedure(afoo), nopass, deferred :: foo
  end type

  type, extends(abstract_base) :: child
    integer j
  contains
    procedure, nopass :: foo => foo_child
  end type
contains
  integer function foo_child()
    foo_child = 1
  end function
end module

use m
implicit none
class(abstract_base), allocatable :: x, y(:)
allocate(x, source=child(1,2))
allocate(y(1), source=[x])
select type(y)
  type is (child)
    print *, y
  class is (abstract_base)
    print *, y(1)%i
end select
print *, y(1)%foo()
end


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

* [Bug fortran/53653] [IR Tracking] Disallow abstract/unlimited-polymorphic types in array constructors
  2012-06-13  7:04 [Bug fortran/53653] New: [IR Tracking] Disallow abstract/unlimited-polymorphic types in array constructors burnus at gcc dot gnu.org
@ 2014-07-20  8:25 ` dominiq at lps dot ens.fr
  2021-06-08 17:18 ` gscfq@t-online.de
  1 sibling, 0 replies; 3+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-07-20  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-07-20
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Compiling the code in comment 0 still gives an ICE with gfortran 4.10.0
r212833:

pr53653.f90: In function 'MAIN__':
pr53653.f90:28:0: internal compiler error: in gfc_conv_array_constructor_expr,
at fortran/trans-expr.c:5668
 allocate(y(1), source=[x])
 ^

The location of the ICE is the same as for pr51864.


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

* [Bug fortran/53653] [IR Tracking] Disallow abstract/unlimited-polymorphic types in array constructors
  2012-06-13  7:04 [Bug fortran/53653] New: [IR Tracking] Disallow abstract/unlimited-polymorphic types in array constructors burnus at gcc dot gnu.org
  2014-07-20  8:25 ` [Bug fortran/53653] " dominiq at lps dot ens.fr
@ 2021-06-08 17:18 ` gscfq@t-online.de
  1 sibling, 0 replies; 3+ messages in thread
From: gscfq@t-online.de @ 2021-06-08 17:18 UTC (permalink / raw)
  To: gcc-bugs

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

G. Steinmetz <gscfq@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gscfq@t-online.de

--- Comment #3 from G. Steinmetz <gscfq@t-online.de> ---

Very similar :

$ cat zz1.f90
program p
   type t
   end type
   class(t), allocatable :: a, b(:)
   allocate (b, source=[a])
end


$ gfortran-12-20210606 -c zz1.f90
zz1.f90:5:27:

    5 |    allocate (b, source=[a])
      |                           1
internal compiler error: in gfc_get_element_type, at fortran/trans-types.c:1249
0x81cbea gfc_get_element_type(tree_node*)
        ../../gcc/fortran/trans-types.c:1249
0x7a1f4c gfc_trans_create_temp_array(stmtblock_t*, stmtblock_t*, gfc_ss*,
tree_node*, tree_node*, bool, bool, bool, locus*)
        ../../gcc/fortran/trans-array.c:1329
0x7ac382 gfc_conv_loop_setup(gfc_loopinfo*, locus*)
        ../../gcc/fortran/trans-array.c:5319
0x7ac615 gfc_conv_expr_descriptor(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-array.c:7555
0x815fff gfc_trans_allocate(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:6289
0x79e617 trans_code
        ../../gcc/fortran/trans.c:2090
0x7c4bc4 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6893
0x74b3f6 translate_all_program_units
        ../../gcc/fortran/parse.c:6461
0x74b3f6 gfc_parse_file()
        ../../gcc/fortran/parse.c:6730
0x79772f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

end of thread, other threads:[~2021-06-08 17:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-13  7:04 [Bug fortran/53653] New: [IR Tracking] Disallow abstract/unlimited-polymorphic types in array constructors burnus at gcc dot gnu.org
2014-07-20  8:25 ` [Bug fortran/53653] " dominiq at lps dot ens.fr
2021-06-08 17:18 ` gscfq@t-online.de

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