public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/52010] [OOP] Intrinsic assignment of a CLASS to a TYPE
Date: Sat, 28 Jan 2012 19:09:00 -0000	[thread overview]
Message-ID: <bug-52010-4-wD2Iu18wwK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-52010-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-28
     Ever Confirmed|0                           |1

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-01-28 17:40:51 UTC ---
The error is gone with the patch in comment #3. Note that playing with the
code, the following two avatars give an ICE after error:

[macbook] f90/bug% diff -up pr52010.f90 pr52010_db_1.f90
--- pr52010.f90    2012-01-26 17:36:45.000000000 +0100
+++ pr52010_db_1.f90    2012-01-26 17:40:47.000000000 +0100
@@ -16,7 +16,7 @@ subroutine subrt( x )

  class(t1), intent(in) :: x

- type(t1) :: local
+ class(t1) :: local

  local = x

[macbook] f90/bug% gfc pr52010_db_1.f90
pr52010_db_1.f90:19.19:

 class(t1) :: local
                   1
Error: CLASS variable 'local' at (1) must be dummy, allocatable or pointer
f951: internal compiler error: Segmentation fault

[macbook] f90/bug% diff -up pr52010.f90 pr52010_db_2.f90
--- pr52010.f90    2012-01-26 17:36:45.000000000 +0100
+++ pr52010_db_2.f90    2012-01-26 17:41:50.000000000 +0100
@@ -6,7 +6,7 @@ program test
    integer :: a
  end type

- type(t1) :: x
+ class(t1) :: x

 call subrt( x )

[macbook] f90/bug% gfc pr52010_db_2.f90
pr52010_db_2.f90:9.15:

 class(t1) :: x
               1
Error: CLASS variable 'x' at (1) must be dummy, allocatable or pointer
f951: internal compiler error: Segmentation fault

The backtrace for the first case is

#0  gfc_find_typebound_intrinsic_op (derived=0x0, t=0x7fff5fbfd304,
op=INTRINSIC_ASSIGN, noaccess=false, where=0x0)
    at ../../work/gcc/fortran/class.c:946
#1  0x0000000100037746 in matching_typebound_op (tb_base=0x7fff5fbfd368,
args=0x141e07910, op=INTRINSIC_ASSIGN, uop=0x0, gname=0x7fff5fbfd360)
    at ../../work/gcc/fortran/interface.c:3199
#2  0x00000001000381db in gfc_extend_assign (c=0x141e16a30, ns=0x0) at
../../work/gcc/fortran/interface.c:3478
#3  0x000000010008c76f in resolve_code (code=<value optimized out>, ns=<value
optimized out>) at ../../work/gcc/fortran/resolve.c:9068
#4  0x000000010008f014 in resolve_codes (ns=<value optimized out>) at
../../work/gcc/fortran/resolve.c:13945
#5  0x000000010008ef18 in resolve_codes (ns=<value optimized out>) at
../../work/gcc/fortran/resolve.c:13931
#6  0x000000010007ee38 in gfc_resolve (ns=<value optimized out>) at
../../work/gcc/fortran/resolve.c:13972
#7  0x000000010007477b in gfc_parse_file () at
../../work/gcc/fortran/parse.c:4387
#8  0x00000001000b3486 in gfc_be_parse_file () at
../../work/gcc/fortran/f95-lang.c:250
#9  0x00000001007b8051 in toplev_main (argc=2, argv=0x7fff5fbfd7a0) at
../../work/gcc/toplev.c:557
#10 0x00000001000016c4 in start ()

and for the second case it is

#0  gfc_compare_derived_types (derived1=0x141e13d70, derived2=0x0) at
../../work/gcc/fortran/interface.c:402
#1  0x00000001000a6327 in gfc_type_is_extension_of (t1=0x141e13d70, t2=0x0) at
../../work/gcc/fortran/symbol.c:4823
#2  0x00000001000333cb in gfc_compare_types (ts1=0x141e146c0, ts2=0x141e14328)
at ../../work/gcc/fortran/interface.c:495
#3  0x00000001000347aa in compare_parameter (formal=0x141e146a0,
actual=0x141e14320, ranks_must_agree=0, is_elemental=<value optimized out>, 
    where=0x141e13878) at ../../work/gcc/fortran/interface.c:1697
#4  0x0000000100035a34 in compare_actual_formal (ap=0x141e138e0,
formal=0x141e05f40, ranks_must_agree=0, is_elemental=0, where=0x141e13878)
    at ../../work/gcc/fortran/interface.c:2270
#5  0x0000000100037337 in gfc_procedure_use (sym=0x141e13fc0, ap=0x141e138e0,
where=<value optimized out>) at ../../work/gcc/fortran/interface.c:2961
#6  0x0000000100087d59 in resolve_call (c=<value optimized out>) at
../../work/gcc/fortran/resolve.c:3614
#7  0x000000010008c7ce in resolve_code (code=<value optimized out>, ns=<value
optimized out>) at ../../work/gcc/fortran/resolve.c:9480
#8  0x000000010008f014 in resolve_codes (ns=<value optimized out>) at
../../work/gcc/fortran/resolve.c:13945
#9  0x000000010007ee38 in gfc_resolve (ns=<value optimized out>) at
../../work/gcc/fortran/resolve.c:13972
#10 0x000000010007477b in gfc_parse_file () at
../../work/gcc/fortran/parse.c:4387
#11 0x00000001000b3486 in gfc_be_parse_file () at
../../work/gcc/fortran/f95-lang.c:250
#12 0x00000001007b8051 in toplev_main (argc=2, argv=0x7fff5fbfd7a0) at
../../work/gcc/toplev.c:557
#13 0x00000001000016c4 in start ()

Should I open new PR(s) for them?


  parent reply	other threads:[~2012-01-28 17:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26 15:55 [Bug fortran/52010] New: Intrinsic assignment involving CLASS/TYPE fmartinez at gmv dot com
2012-01-26 18:40 ` [Bug fortran/52010] " dominiq at lps dot ens.fr
2012-01-26 18:42 ` fmartinez at gmv dot com
2012-01-27 17:07 ` [Bug fortran/52010] [OOP] Intrinsic assignment of a CLASS to a TYPE burnus at gcc dot gnu.org
2012-01-28 19:09 ` dominiq at lps dot ens.fr [this message]
2012-01-28 23:38 ` fmartinez at gmv dot com
2012-01-28 23:40 ` fmartinez at gmv dot com
2014-12-29  3:46 ` pault at gcc dot gnu.org
2014-12-30  3:12 ` pault at gcc dot gnu.org
2015-10-18 20:54 ` dominiq at lps dot ens.fr
2015-10-19  4:40 ` paul.richard.thomas at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-52010-4-wD2Iu18wwK@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).