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

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

https://gcc.gnu.org/g:19295e8607da2f743368fe6f5708146616aafa91

commit r13-3476-g19295e8607da2f743368fe6f5708146616aafa91
Author: Richard Biener <rguent...@suse.de>
Date:   Mon Oct 24 09:51:32 2022 +0200

    tree-optimization/100756 - niter analysis and folding

    niter analysis, specifically the part trying to simplify the computed
    maybe_zero condition against the loop header copying condition, is
    confused by us now simplifying

      _15 = n_8(D) * 4;
      if (_15 > 0)

    to

      _15 = n_8(D) * 4;
      if (n_8(D) > 0)

    which is perfectly sound at the point we do this transform.  One
    solution might be to involve ranger in this simplification, another
    is to be more aggressive when expanding expressions - the condition
    we try to simplify is _15 > 0, so all we need is expanding that
    to n_8(D) * 4 > 0.

    The following does just that.

            PR tree-optimization/100756
            * tree-ssa-loop-niter.cc (expand_simple_operations): Also
            expand multiplications by invariants.

            * gcc.dg/vect/pr100756.c: New testcase.

Reply via email to