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/100499] [9/10/11/12 Regression] Different results with -fpeel-loops -ftree-loop-vectorize options
Date: Fri, 04 Feb 2022 13:39:06 +0000	[thread overview]
Message-ID: <bug-100499-4-7ZIPLKS96a@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100499-4@http.gcc.gnu.org/bugzilla/>

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

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

https://gcc.gnu.org/g:0898049ad9bf6c46e510b18aaafca4946802749f

commit r12-7052-g0898049ad9bf6c46e510b18aaafca4946802749f
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jan 26 09:35:57 2022 +0100

    tree-optimization/100499 - niter analysis and multiple_of_p

    niter analysis uses multiple_of_p which currently assumes
    operations like MULT_EXPR do not wrap.  We've got to rely on this
    for optimizing size expressions like those in DECL_SIZE and those
    generally use unsigned arithmetic with no indication that they
    are not expected to wrap.  To preserve that the following adds
    a parameter to multiple_of_p, defaulted to true, indicating that
    the TOP expression is not expected to wrap for outer computations
    in TYPE.  This mostly follows a patch proposed by Bin last year
    with the conversion behavior added.

    Applying to all users the new effect is that upon type conversions
    in the TOP expression the behavior will switch to honor
    TYPE_OVERFLOW_UNDEFINED for the converted sub-expressions.

    The patch also changes the occurance in niter analysis that we
    know is problematic and we have testcases for to pass false
    to multiple_of_p.  The patch also contains a change to the
    PR72817 fix from Bin to avoid regressing gcc.dg/tree-ssa/loop-42.c.

    The intent for stage1 is to introduce a size_multiple_of_p and
    internalize the added parameter so all multiple_of_p users will
    honor TYPE_OVERFLOW_UNDEFINED and users dealing with size expressions
    need to be switched to size_multiple_of_p.

    2022-01-26  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/100499
            * fold-const.h (multiple_of_p): Add nowrap parameter, defaulted
            to true.
            * fold-const.cc (multiple_of_p): Likewise.  Honor it for
            MULT_EXPR, PLUS_EXPR and MINUS_EXPR and pass it along,
            switching to false for conversions.
            * tree-ssa-loop-niter.cc (number_of_iterations_ne): Do not
            claim the outermost expression does not wrap when calling
            multiple_of_p.  Refactor the check done to check the
            original IV, avoiding a bias that might wrap.

            * gcc.dg/torture/pr100499-1.c: New testcase.
            * gcc.dg/torture/pr100499-2.c: Likewise.
            * gcc.dg/torture/pr100499-3.c: Likewise.

    Co-authored-by: Bin Cheng  <bin.cheng@linux.alibaba.com>

  parent reply	other threads:[~2022-02-04 13:39 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 10:20 [Bug tree-optimization/100499] New: " dongjianqiang2 at huawei dot com
2021-05-10 11:13 ` [Bug tree-optimization/100499] " rguenth at gcc dot gnu.org
2021-05-11  9:06 ` marxin at gcc dot gnu.org
2021-05-11  9:07 ` marxin at gcc dot gnu.org
2021-05-11  9:09 ` marxin at gcc dot gnu.org
2021-05-11  9:12 ` dongjianqiang2 at huawei dot com
2021-05-11  9:42 ` rguenth at gcc dot gnu.org
2021-05-11 10:40 ` amker at gcc dot gnu.org
2021-05-11 11:33 ` marxin at gcc dot gnu.org
2021-05-17  2:17 ` amker at gcc dot gnu.org
2021-05-18  9:49 ` rguenth at gcc dot gnu.org
2021-05-18  9:57 ` rguenth at gcc dot gnu.org
2021-05-18 10:25 ` rguenth at gcc dot gnu.org
2021-05-18 11:33 ` amker at gcc dot gnu.org
2021-05-18 11:36 ` amker at gcc dot gnu.org
2021-05-18 11:54 ` rguenther at suse dot de
2021-05-18 15:46 ` amacleod at redhat dot com
2021-05-19  6:31 ` rguenth at gcc dot gnu.org
2021-05-19  7:10 ` amker at gcc dot gnu.org
2021-05-19  7:15 ` amker at gcc dot gnu.org
2021-05-19  8:24 ` aldyh at redhat dot com
2021-05-19 18:11 ` amacleod at redhat dot com
2021-05-22 15:37 ` law at gcc dot gnu.org
2021-05-26  8:14 ` aldyh at gcc dot gnu.org
2021-05-26  8:21 ` aldyh at gcc dot gnu.org
2021-05-26  8:34 ` rguenther at suse dot de
2021-05-26  8:40 ` aldyh at redhat dot com
2021-05-26  8:59 ` rguenther at suse dot de
2021-05-26 13:17 ` amacleod at redhat dot com
2021-05-26 13:23 ` rguenther at suse dot de
2021-05-26 13:30 ` aldyh at redhat dot com
2021-07-22  8:09 ` [Bug tree-optimization/100499] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
2021-07-22  8:09 ` rguenth at gcc dot gnu.org
2021-07-22  8:11 ` rguenth at gcc dot gnu.org
2021-07-28  9:05 ` rguenth at gcc dot gnu.org
2021-07-29  7:56 ` ebotcazou at gcc dot gnu.org
2022-01-24 13:16 ` rguenth at gcc dot gnu.org
2022-01-24 13:16 ` rguenth at gcc dot gnu.org
2022-01-24 13:17 ` rguenth at gcc dot gnu.org
2022-01-31  8:08 ` cvs-commit at gcc dot gnu.org
2022-01-31  8:38 ` cvs-commit at gcc dot gnu.org
2022-02-04 13:39 ` cvs-commit at gcc dot gnu.org [this message]
2022-02-04 13:40 ` [Bug tree-optimization/100499] [9/10/11 " rguenth at gcc dot gnu.org
2022-02-15 12:23 ` rguenth at gcc dot gnu.org
2022-05-27  9:45 ` [Bug tree-optimization/100499] [10/11 " rguenth at gcc dot gnu.org
2022-06-28 10:44 ` jakub at gcc dot gnu.org
2023-07-07 10:39 ` [Bug tree-optimization/100499] [11 " 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-100499-4-7ZIPLKS96a@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).