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/99726] [10/11 Regression] ICE in create_intersect_range_checks_index, at tree-data-ref.c:1855 since r10-4762-gf9d6338bd15ce1fae36bf25d3a0545e9678ddc58
Date: Wed, 31 Mar 2021 18:34:21 +0000	[thread overview]
Message-ID: <bug-99726-4-ll7g1q3Inr@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99726-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Sandiford <rsandifo@gcc.gnu.org>:

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

commit r11-7935-gb5c7accfb56a7347008f629be4c7344dd849b1b1
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Wed Mar 31 19:34:01 2021 +0100

    data-ref: Tighten index-based alias checks [PR99726]

    create_intersect_range_checks_index tries to create a runtime
    alias check based on index comparisons.  It looks through the
    access functions for the two DRs to find a SCEV for the loop
    that is being versioned and converts a DR_STEP-based check
    into an index-based check.

    However, there isn't any reliable sign information in the types,
    so the code expects the value of the IV step (when interpreted as
    signed) to be negative iff the DR_STEP (when interpreted as signed)
    is negative.

    r10-4762 added another assert related to this assumption and the
    assert fired for the testcase in the PR.  The sign of the IV step
    didn't match the sign of the DR_STEP.

    I think this is actually showing what was previously a wrong-code bug.
    The signs didn't match because the DRs contained *two* access function
    SCEVs for the loop being versioned.  It doesn't look like the code
    is set up to deal with this, since it checks each access function
    independently and treats it as the sole source of DR_STEP.

    The patch therefore moves the main condition out of the loop.
    This also has the advantage of not building a tree for one access
    function only to throw it away if we find an inner function that
    makes the comparison invalid.

    gcc/
            PR tree-optimization/99726
            * tree-data-ref.c (create_intersect_range_checks_index): Bail
            out if there is more than one access function SCEV for the loop
            being versioned.

    gcc/testsuite/
            PR tree-optimization/99726
            * gcc.target/i386/pr99726.c: New test.

  parent reply	other threads:[~2021-03-31 18:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 10:59 [Bug tree-optimization/99726] New: " marxin at gcc dot gnu.org
2021-03-23 10:59 ` [Bug tree-optimization/99726] " marxin at gcc dot gnu.org
2021-03-24  8:31 ` rguenth at gcc dot gnu.org
2021-03-29 16:12 ` jakub at gcc dot gnu.org
2021-03-29 16:31 ` jakub at gcc dot gnu.org
2021-03-30 12:08 ` rsandifo at gcc dot gnu.org
2021-03-31 18:34 ` cvs-commit at gcc dot gnu.org [this message]
2021-03-31 20:36 ` [Bug tree-optimization/99726] [10 " rsandifo at gcc dot gnu.org
2021-04-02  8:09 ` cvs-commit at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-04-23  9:10 ` cvs-commit at gcc dot gnu.org
2021-04-23  9:11 ` rsandifo 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-99726-4-ll7g1q3Inr@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).