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 c++/99033] [9/10 Regression] ICE in tree_to_poly_int64, at tree.c:3091
Date: Fri, 19 Mar 2021 23:29:07 +0000	[thread overview]
Message-ID: <bug-99033-4-ERMclXO8Jk@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99033-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:ea535f59b19f65e5b313c990ee6c194a7b055bd7

commit r10-9468-gea535f59b19f65e5b313c990ee6c194a7b055bd7
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 11 17:24:17 2021 +0100

    c++: Fix zero initialization of flexible array members [PR99033]

    array_type_nelts returns error_mark_node for type of flexible array members
    and build_zero_init_1 was placing an error_mark_node into the CONSTRUCTOR,
    on which e.g. varasm ICEs.  I think there is nothing erroneous on zero
    initialization of flexible array members though, such arrays should simply
    get no elements, like they do if such classes are constructed (everything
    except when some larger initializer comes from an explicit initializer).

    So, this patch handles [] arrays in zero initialization like [0] arrays
    and fixes handling of the [0] arrays - the
    tree_int_cst_equal (max_index, integer_minus_one_node) check
    didn't do what it thought it would do, max_index is typically unsigned
    integer (sizetype) and so it is never equal to a -1.

    What the patch doesn't do and maybe would be desirable is if it returns
    error_mark_node for other reasons let the recursive callers not stick that
    into CONSTRUCTOR but return error_mark_node instead.  But I don't have a
    testcase where that would be needed right now.

    2021-02-11  Jakub Jelinek  <jakub@redhat.com>

            PR c++/99033
            * init.c (build_zero_init_1): Handle zero initialiation of
            flexible array members like initialization of [0] arrays.
            Use integer_minus_onep instead of comparison to
integer_minus_one_node
            and integer_zerop instead of comparison against size_zero_node.
            Formatting fixes.

            * g++.dg/ext/flexary38.C: New test.

    (cherry picked from commit 2dcdd15d0bafb9b45a8d7ff580217bd6ac1f0975)

  parent reply	other threads:[~2021-03-19 23:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 17:39 [Bug c++/99033] New: [11 " gscfq@t-online.de
2021-02-09 17:39 ` [Bug c++/99033] " gscfq@t-online.de
2021-02-09 17:57 ` [Bug c++/99033] [9/10/11 " mpolacek at gcc dot gnu.org
2021-02-10  7:21 ` rguenth at gcc dot gnu.org
2021-02-10 14:24 ` jakub at gcc dot gnu.org
2021-02-11 16:25 ` cvs-commit at gcc dot gnu.org
2021-02-11 16:26 ` [Bug c++/99033] [9/10 " jakub at gcc dot gnu.org
2021-03-19 23:29 ` cvs-commit at gcc dot gnu.org [this message]
2021-03-20  8:07 ` [Bug c++/99033] [9 " jakub at gcc dot gnu.org
2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:50 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:11 ` 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-99033-4-ERMclXO8Jk@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).