public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gscfq@t-online.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/101085] New: ICE in gfc_conv_intrinsic_to_class, at fortran/trans-expr.c:1039
Date: Tue, 15 Jun 2021 17:09:36 +0000	[thread overview]
Message-ID: <bug-101085-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101085
           Summary: ICE in gfc_conv_intrinsic_to_class, at
                    fortran/trans-expr.c:1039
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

This invalid code z1 (rank mismatch scalar versus array) affects
versions down to r7.  Case z2 is a correct variant of z1, similar
invalid case z3 is detected (integer instead of character) :


$ cat z1.f90
program p
   type t
      integer :: n
   end type
   class(t), allocatable :: c(:)
   character(3) :: a = 'abc'
   c = [t(1)]
   if ( f(c, a) /= 1 ) stop 1
contains
   integer function f(x, y)
      class(t) :: x(:)
      class(*) :: y(size(x))
      f = size(y)
   end
end


$ gfortran-12-20210613 -c z1.f90
z1.f90:8:8:

    8 |    if ( f(c, a) /= 1 ) stop 1
      |        1
internal compiler error: in fold_convert_loc, at fold-const.c:2553
0x9b26a3 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc/fold-const.c:2553
0x7d4c5b gfc_conv_intrinsic_to_class(gfc_se*, gfc_expr*, gfc_typespec)
        ../../gcc/fortran/trans-expr.c:1039
0x7d5e65 gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec<tree_node*, va_gc, vl_embed>*)
        ../../gcc/fortran/trans-expr.c:5878
0x7cdaca gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:9017
0x7cde9d gfc_conv_expr_op
        ../../gcc/fortran/trans-expr.c:3883
0x7cde9d gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:9013
0x7d0993 gfc_conv_expr_val(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:9070
0x80dcf9 gfc_trans_if_1
        ../../gcc/fortran/trans-stmt.c:1469
0x8158aa gfc_trans_if(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:1507
0x79f9c7 trans_code
        ../../gcc/fortran/trans.c:2006
0x7c6054 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6893
0x74c876 translate_all_program_units
        ../../gcc/fortran/parse.c:6461
0x74c876 gfc_parse_file()
        ../../gcc/fortran/parse.c:6730
0x798bbf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

             reply	other threads:[~2021-06-15 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 17:09 gscfq@t-online.de [this message]
2021-06-15 17:10 ` [Bug fortran/101085] " gscfq@t-online.de

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-101085-4@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).