public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64674] New: OOP Internal compiler error in associate with allocated class
@ 2015-01-19 17:03 antony at cosmologist dot info
  2015-01-19 22:09 ` [Bug fortran/64674] [OOP] ICE in ASSOCIATE " janus at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: antony at cosmologist dot info @ 2015-01-19 17:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64674
           Summary: OOP Internal compiler error in associate with
                    allocated class
           Product: gcc
           Version: fortran-dev
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antony at cosmologist dot info

On latest trunk

module X
  Type T
   integer :: map
  end Type T
contains

subroutine DoBug
   class(T), allocatable :: Cls(:,:)

   allocate(T::Cls(2, 2))
   associate(CL => Cls(1,2))
      CL%map = 2
   end associate

end subroutine
end module X

gives

testbug.f90:12:0:

       CL%map = 2
 1
internal compiler error: in gfc_conv_component_ref, at
fortran/trans-expr.c:1954
0x82e588e gfc_conv_component_ref
    ../../gcc-trunk/gcc/fortran/trans-expr.c:1954
0x82ed630 gfc_conv_variable
    ../../gcc-trunk/gcc/fortran/trans-expr.c:2211
0x82eaea0 gfc_conv_expr(gfc_se*, gfc_expr*)
    ../../gcc-trunk/gcc/fortran/trans-expr.c:6836
0x82f856d gfc_trans_assignment_1
    ../../gcc-trunk/gcc/fortran/trans-expr.c:8568
0x82f9a75 gfc_trans_assign(gfc_code*)
    ../../gcc-trunk/gcc/fortran/trans-expr.c:8765
0x82b836d trans_code
    ../../gcc-trunk/gcc/fortran/trans.c:1650
0x832b3f7 gfc_trans_block_construct(gfc_code*)
    ../../gcc-trunk/gcc/fortran/trans-stmt.c:1456
0x82b80c8 trans_code
    ../../gcc-trunk/gcc/fortran/trans.c:1755
0x82e1f55 gfc_generate_function_code(gfc_namespace*)
    ../../gcc-trunk/gcc/fortran/trans-decl.c:5843
0x82bc482 gfc_generate_module_code(gfc_namespace*)
    ../../gcc-trunk/gcc/fortran/trans.c:2021
0x82761ba translate_all_program_units
    ../../gcc-trunk/gcc/fortran/parse.c:5328
0x82761ba gfc_parse_file()
    ../../gcc-trunk/gcc/fortran/parse.c:5538
0x82b436b gfc_be_parse_file
    ../../gcc-trunk/gcc/fortran/f95-lang.c:228
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.

If you change class(T) to type(T) it compiles OK.


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

* [Bug fortran/64674] [OOP] ICE in ASSOCIATE with allocated class
  2015-01-19 17:03 [Bug fortran/64674] New: OOP Internal compiler error in associate with allocated class antony at cosmologist dot info
@ 2015-01-19 22:09 ` janus at gcc dot gnu.org
  2015-02-09 11:14 ` [Bug fortran/64674] [OOP] ICE in ASSOCIATE with class array dominiq at lps dot ens.fr
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-19 22:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from janus at gcc dot gnu.org ---
When commenting the line with 'CL%map', one gets a different ICE:

   associate(CL => Cls(1))
 1
internal compiler error: in gfc_conv_expr_descriptor, bei
fortran/trans-array.c:6499
0x692657 gfc_conv_expr_descriptor(gfc_se*, gfc_expr*)
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-array.c:6499
0x6de41c trans_associate_var
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-stmt.c:1313
0x6de41c gfc_trans_block_construct(gfc_code*)
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-stmt.c:1463
0x681d37 trans_code
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/trans.c:1755
0x6a2d63 gfc_generate_function_code(gfc_namespace*)
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-decl.c:5843
0x63e400 translate_all_program_units
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/parse.c:5341
0x63e400 gfc_parse_file()
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/parse.c:5538
0x67dda5 gfc_be_parse_file
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/f95-lang.c:228


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

* [Bug fortran/64674] [OOP] ICE in ASSOCIATE with class array
  2015-01-19 17:03 [Bug fortran/64674] New: OOP Internal compiler error in associate with allocated class antony at cosmologist dot info
  2015-01-19 22:09 ` [Bug fortran/64674] [OOP] ICE in ASSOCIATE " janus at gcc dot gnu.org
@ 2015-02-09 11:14 ` dominiq at lps dot ens.fr
  2015-05-04 15:08 ` vehre at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-02-09 11:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Likely a duplicate of pr56386.


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

* [Bug fortran/64674] [OOP] ICE in ASSOCIATE with class array
  2015-01-19 17:03 [Bug fortran/64674] New: OOP Internal compiler error in associate with allocated class antony at cosmologist dot info
  2015-01-19 22:09 ` [Bug fortran/64674] [OOP] ICE in ASSOCIATE " janus at gcc dot gnu.org
  2015-02-09 11:14 ` [Bug fortran/64674] [OOP] ICE in ASSOCIATE with class array dominiq at lps dot ens.fr
@ 2015-05-04 15:08 ` vehre at gcc dot gnu.org
  2015-05-04 15:10 ` vehre at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vehre at gcc dot gnu.org @ 2015-05-04 15:08 UTC (permalink / raw)
  To: gcc-bugs

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

vehre at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |vehre at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |vehre at gcc dot gnu.org


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

* [Bug fortran/64674] [OOP] ICE in ASSOCIATE with class array
  2015-01-19 17:03 [Bug fortran/64674] New: OOP Internal compiler error in associate with allocated class antony at cosmologist dot info
                   ` (2 preceding siblings ...)
  2015-05-04 15:08 ` vehre at gcc dot gnu.org
@ 2015-05-04 15:10 ` vehre at gcc dot gnu.org
  2015-06-23  9:07 ` vehre at gcc dot gnu.org
  2015-07-03  8:16 ` vehre at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vehre at gcc dot gnu.org @ 2015-05-04 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from vehre at gcc dot gnu.org ---
First patch available at:

https://gcc.gnu.org/ml/fortran/2015-05/msg00011.html


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

* [Bug fortran/64674] [OOP] ICE in ASSOCIATE with class array
  2015-01-19 17:03 [Bug fortran/64674] New: OOP Internal compiler error in associate with allocated class antony at cosmologist dot info
                   ` (3 preceding siblings ...)
  2015-05-04 15:10 ` vehre at gcc dot gnu.org
@ 2015-06-23  9:07 ` vehre at gcc dot gnu.org
  2015-07-03  8:16 ` vehre at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vehre at gcc dot gnu.org @ 2015-06-23  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from vehre at gcc dot gnu.org ---
Author: vehre
Date: Tue Jun 23 09:07:22 2015
New Revision: 224827

URL: https://gcc.gnu.org/viewcvs?rev=224827&root=gcc&view=rev
Log:
gcc/fortran/ChangeLog:

2015-06-23  Andre Vehreschild  <vehre@gmx.de>

        PR fortran/64674
        * parse.c (parse_associate): Figure the rank and as of a
        class array in an associate early.
        * primary.c (gfc_match_varspec): Prevent setting the
        dimension attribute on the sym for classes.
        * resolve.c (resolve_variable): Correct the component
        ref's type for associated variables.  Add a full array ref
        when class array's are associated.
        (resolve_assoc_var): Correct the type of the symbol,
        when in the associate the expression's rank becomes scalar.
        * trans-expr.c (gfc_conv_variable): Indirect ref needed for
        allocatable associated objects.

gcc/testsuite/ChangeLog:

2015-06-23  Andre Vehreschild  <vehre@gmx.de>

        PR fortran/64674
        * gfortran.dg/associate_18.f08: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/associate_18.f08
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/parse.c
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/64674] [OOP] ICE in ASSOCIATE with class array
  2015-01-19 17:03 [Bug fortran/64674] New: OOP Internal compiler error in associate with allocated class antony at cosmologist dot info
                   ` (4 preceding siblings ...)
  2015-06-23  9:07 ` vehre at gcc dot gnu.org
@ 2015-07-03  8:16 ` vehre at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vehre at gcc dot gnu.org @ 2015-07-03  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

vehre at gcc dot gnu.org changed:

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

--- Comment #6 from vehre at gcc dot gnu.org ---
No complaints so far, closing.


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

end of thread, other threads:[~2015-07-03  8:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-19 17:03 [Bug fortran/64674] New: OOP Internal compiler error in associate with allocated class antony at cosmologist dot info
2015-01-19 22:09 ` [Bug fortran/64674] [OOP] ICE in ASSOCIATE " janus at gcc dot gnu.org
2015-02-09 11:14 ` [Bug fortran/64674] [OOP] ICE in ASSOCIATE with class array dominiq at lps dot ens.fr
2015-05-04 15:08 ` vehre at gcc dot gnu.org
2015-05-04 15:10 ` vehre at gcc dot gnu.org
2015-06-23  9:07 ` vehre at gcc dot gnu.org
2015-07-03  8:16 ` vehre 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).