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 tree-optimization/99824] [10 Regression] ICE in wide_int_to_tree_1, at tree.c:1572
Date: Tue, 30 Mar 2021 12:02:17 +0000	[thread overview]
Message-ID: <bug-99824-4-5bVaAn95dd@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99824-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

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

commit r10-9618-gee15832c53d52656e562c29110f2be1cfb66c450
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Mar 30 11:22:52 2021 +0200

    tree-optimization/99824 - avoid excessive integer type precision in VN

    VN sometimes builds new integer types to handle accesss where precision
    of the access type does not match the access size.  The way
    ao_ref_init_from_vn_reference is computing the access size ignores
    the access type in case the ref operands have an outermost
    COMPONENT_REF which, in case it is an array for example, can be
    way larger than the access size.  This can cause us to try
    building an integer type with precision larger than WIDE_INT_MAX_PRECISION
    eventually leading to memory corruption.

    The following adjusts ao_ref_init_from_vn_reference to only lower
    access sizes via the outermost COMPONENT_REF but otherwise honor
    the access size as specified by the access type.

    It also places an assert in integer type building that we remain
    in the limits of WIDE_INT_MAX_PRECISION.  I chose the shared code
    where we set TYPE_MIN/MAX_VALUE because that will immediately
    cross the wide_ints capacity otherwise.

    2021-03-30  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/99824
            * stor-layout.c (set_min_and_max_values_for_integral_type):
            Assert the precision is within the bounds of
            WIDE_INT_MAX_PRECISION.
            * tree-ssa-sccvn.c (ao_ref_init_from_vn_reference): Use
            the outermost component ref only to lower the access size
            and initialize that from the access type.

            * gcc.dg/torture/pr99824.c: New testcase.

  parent reply	other threads:[~2021-03-30 12:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30  7:07 [Bug tree-optimization/99824] New: " marxin at gcc dot gnu.org
2021-03-30  7:08 ` [Bug tree-optimization/99824] [10 Regression] " marxin at gcc dot gnu.org
2021-03-30  7:19 ` marxin at gcc dot gnu.org
2021-03-30  7:42 ` rguenth at gcc dot gnu.org
2021-03-30  7:42 ` rguenth at gcc dot gnu.org
2021-03-30  8:09 ` rguenth at gcc dot gnu.org
2021-03-30  8:24 ` marxin at gcc dot gnu.org
2021-03-30  8:30 ` marxin at gcc dot gnu.org
2021-03-30  9:14 ` rguenth at gcc dot gnu.org
2021-03-30  9:16 ` rguenth at gcc dot gnu.org
2021-03-30  9:22 ` rguenth at gcc dot gnu.org
2021-03-30  9:30 ` rguenth at gcc dot gnu.org
2021-03-30  9:32 ` marxin at gcc dot gnu.org
2021-03-30 10:03 ` rguenther at suse dot de
2021-03-30 10:08 ` marxin at gcc dot gnu.org
2021-03-30 10:13 ` marxin at gcc dot gnu.org
2021-03-30 12:01 ` cvs-commit at gcc dot gnu.org
2021-03-30 12:02 ` cvs-commit at gcc dot gnu.org [this message]
2021-03-30 12:02 ` rguenth 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-99824-4-5bVaAn95dd@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).