[Bug tree-optimization/104519] [12 Regression] wrong code at -Os on x86_64-linux-gnu and char as induction variable

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 15 10:41:57 GMT 2022


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

--- Comment #8 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:d8b6da8dd15240849e00d46f3aef40cb8eeb1dc5

commit r12-7239-gd8b6da8dd15240849e00d46f3aef40cb8eeb1dc5
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Feb 15 09:40:59 2022 +0100

    tree-optimization/104519 - adjust PR100499 niter fix

    The following adjusts the PR100499 niter fix to use the appropriate
    types when checking whether the difference between the final and base
    values of the IV are a multiple of the step.  It also gets rid of
    an always false condition in multiple_of_p which lead me to a
    wrong solution first.

    2022-02-15  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/104519
            * fold-const.cc (multiple_of_p): Remove never true condition.
            * tree-ssa-loop-niter.cc (number_of_iterations_ne): Use
            the appropriate types for determining whether the difference
            of final and base is a multiple of the step.

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


More information about the Gcc-bugs mailing list