public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/103691] [12 Regression] ICE in get_array_ctor_element_at_index, at fold-const.c:13314 since r12-4694-gcb153222404e2e14 Date: Fri, 25 Mar 2022 10:23:06 +0000 [thread overview] Message-ID: <bug-103691-4-smyXZVVwen@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103691-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103691 --- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:45e955b0a936eafc9838cdc00dcc31b3799b321b commit r12-7811-g45e955b0a936eafc9838cdc00dcc31b3799b321b Author: Jakub Jelinek <jakub@redhat.com> Date: Fri Mar 25 11:22:15 2022 +0100 fortran: Fix up initializers of param(0) PARAMETERs [PR103691] On the gfortran.dg/pr103691.f90 testcase the Fortran ICE emits static real(kind=4) a[0] = {[0 ... -1]=2.0e+0}; That is an invalid RANGE_EXPR where the maximum is smaller than the minimum. The following patch fixes that. If TYPE_MAX_VALUE is smaller than TYPE_MIN_VALUE, the array is empty and so doesn't need any initializer, if the two are equal, we don't need to bother with a RANGE_EXPR and can just use that INTEGER_CST as the index and finally for the 2+ values in the range it uses a RANGE_EXPR as before. 2022-03-25 Jakub Jelinek <jakub@redhat.com> PR fortran/103691 * trans-array.cc (gfc_conv_array_initializer): If TYPE_MAX_VALUE is smaller than TYPE_MIN_VALUE (i.e. empty array), ignore the initializer; if TYPE_MIN_VALUE is equal to TYPE_MAX_VALUE, use just the TYPE_MIN_VALUE as index instead of RANGE_EXPR.
next prev parent reply other threads:[~2022-03-25 10:23 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-13 19:51 [Bug fortran/103691] New: [12 Regression] ICE in get_array_ctor_element_at_index, at fold-const.c:13314 gscfq@t-online.de 2021-12-14 10:05 ` [Bug fortran/103691] [12 Regression] ICE in get_array_ctor_element_at_index, at fold-const.c:13314 since r12-4694-gcb153222404e2e14 marxin at gcc dot gnu.org 2021-12-14 15:43 ` amacleod at redhat dot com 2022-01-04 11:07 ` rguenth at gcc dot gnu.org 2022-01-04 11:32 ` jakub at gcc dot gnu.org 2022-01-04 12:26 ` rguenth at gcc dot gnu.org 2022-01-04 12:28 ` jakub at gcc dot gnu.org 2022-01-05 9:46 ` cvs-commit at gcc dot gnu.org 2022-01-05 9:49 ` jakub at gcc dot gnu.org 2022-03-24 15:23 ` jakub at gcc dot gnu.org 2022-03-25 10:23 ` cvs-commit at gcc dot gnu.org [this message] 2022-03-25 10:23 ` jakub 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-103691-4-smyXZVVwen@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).