public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107508] New: Invalid bounds due to bogus reallocation on assignment with KIND=4 characters Date: Wed, 02 Nov 2022 13:13:43 +0000 [thread overview] Message-ID: <bug-107508-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107508 Bug ID: 107508 Summary: Invalid bounds due to bogus reallocation on assignment with KIND=4 characters Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org Target Milestone: --- In the following code, the bounds change during the assignment but I believe the RHS and the LHS have the same shape and length parameters. As it works with kind=4, I assume that there is a missing '*4' in the size calculation. ! ------------------ implicit none character(len=:,kind=4), allocatable :: a4str(:), a4str2 allocate(character(len=7,kind=4) :: a4str(-2:3)) if (lbound(a4str,1) /= -2) error stop if (ubound(a4str,1) /= 3) error stop a4str = [4_"sf456aq", 4_"3dtzu24", 4_"_4fh7sm", 4_"=ff85s7", 4_"j=8af4d", 4_".,A%Fsz"] print *, lbound(a4str), ubound(a4str) ! expected (-2:3) - actually: (1:6) if (lbound(a4str,1) /= -2) error stop if (ubound(a4str,1) /= 3) error stop end
next reply other threads:[~2022-11-02 13:13 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-02 13:13 burnus at gcc dot gnu.org [this message] 2022-11-07 10:33 ` [Bug fortran/107508] " cvs-commit at gcc dot gnu.org 2023-01-12 21:23 ` 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-107508-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: linkBe 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).