public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/114019] New: allocation with source of deferred character length entity
Date: Tue, 20 Feb 2024 20:36:57 +0000	[thread overview]
Message-ID: <bug-114019-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 114019
           Summary: allocation with source of deferred character length
                    entity
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kargl at gcc dot gnu.org
  Target Milestone: ---

Found this issues with the Fujitsu testsuite.  The code 
is reduced to the minimum required.  If I had to guess,
gfc_charlen for source= is not set correctly.

!
! https://github.com/fujitsu/compiler-test-suite
! Reduced from Fortran/0069/0069_0037.f90
!
  implicit none
  character(:), pointer :: chr_pointer00
  character(5), pointer :: chr_pointer01
  character(1) :: w_character01 = "4"
  allocate(chr_pointer00, source="123"//w_character01//"56")
  allocate(chr_pointer01, source="123"//w_character01//"5")
  print *,'pass'
end

% gfcx -c 0069/0069_0037.f90
0069/0069_0037.f90:9:60:

    9 |   allocate(chr_pointer00, source="123"//w_character01//"56")
      |                                                            ^
Error: size of variable 'source.2' is too large
0069/0069_0037.f90:10:59:

   10 |   allocate(chr_pointer01, source="123"//w_character01//"5")
      |                                                           ^
Error: size of variable 'source.5' is too large
during RTL pass: expand
0069/0069_0037.f90:9:60:

    9 |   allocate(chr_pointer00, source="123"//w_character01//"56")
      |                                                            ^
internal compiler error: in lhd_incomplete_type_error, at langhooks.cc:208
0x77ff6f lhd_incomplete_type_error(unsigned int, tree_node const*, tree_node
const
        ../../gccx/gcc/langhooks.cc:208
0x13c00aa size_in_bytes_loc(unsigned int, tree_node const*)
        ../../gccx/gcc/tree.cc:3601
0x13c00aa size_in_bytes_loc(unsigned int, tree_node const*)
        ../../gccx/gcc/tree.cc:3589

             reply	other threads:[~2024-02-20 20:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 20:36 kargl at gcc dot gnu.org [this message]
2024-06-07 19:24 ` [Bug fortran/114019] " anlauf at gcc dot gnu.org

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