From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0EB163858D28; Tue, 20 Feb 2024 20:36:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0EB163858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708461418; bh=OBHAVHbvOD6NMladksopFd8cVwL19j9jgRe5FtlhrH4=; h=From:To:Subject:Date:From; b=h/OXXRv+gKr/hBSrZQky74BH3dcwpbyd6nJ8m258l70woRwJcK0FJYhZq2aA2sMYY PaYqPpmV9yN0ntST2LZYchGQ6AWdfAn7bnQ/YGW7yAJ+5P66yt0K150Dz2zmOnwKd5 jQI32bkxjKB4x00RusrlXQjlgaZ8n9MvPw+UqfZA= From: "kargl at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114019 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=20 is reduced to the minimum required. If I had to guess, gfc_charlen for source=3D 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 =3D "4" allocate(chr_pointer00, source=3D"123"//w_character01//"56") allocate(chr_pointer01, source=3D"123"//w_character01//"5") print *,'pass' end % gfcx -c 0069/0069_0037.f90 0069/0069_0037.f90:9:60: 9 | allocate(chr_pointer00, source=3D"123"//w_character01//"56") | ^ Error: size of variable 'source.2' is too large 0069/0069_0037.f90:10:59: 10 | allocate(chr_pointer01, source=3D"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=3D"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=