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

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

https://gcc.gnu.org/g:79c12969ec3e9185fdbb90d3b1699d64b1cd0901

commit r11-2138-g79c12969ec3e9185fdbb90d3b1699d64b1cd0901
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Jul 15 16:34:54 2020 +0200

    openmp: Fix up loop-21.c

    I've missed
    +FAIL: libgomp.c/loop-21.c execution test
    during testing of the recent patch.  The problem is that while
    for the number of iterations computation it doesn't matter if we compute
    min_inner_iterations as (m2 * first + n2 + (adjusted step) + m1 * first +
n1) / step
    or (m2 * last + n2 + (adjusted step) + m1 * last + n1) / step provided that
    in the second case we use as factor (m1 - m2) * ostep / step rather than
    (m2 - m1) * ostep / step, for the logical to actual iterator values
computation
    it does matter and in my hand written C implementations of all the cases
(outer
    vs. inner loop with increasing vs. decreasing iterator) I'm using the same
computation
    and it worked well for all the pseudo-random iterators testing it was
doing.

    It also means min_inner_iterations is misnamed, because it is not really
    minimum number of inner iterations, whether the first or last outer
iteration
    results in the smaller or larger value of this can be (sometimes) only
    determined at runtime.
    So this patch also renames it to first_inner_iterations.

    2020-07-15  Jakub Jelinek  <ja...@redhat.com>

            PR libgomp/96198
            * omp-general.h (struct omp_for_data): Rename min_inner_iterations
            member to first_inner_iterations, adjust comment.
            * omp-general.c (omp_extract_for_data): Adjust for the above
change.
            Always use n1first and n2first to compute it, rather than depending
            on single_nonrect_cond_code.  Similarly, always compute factor
            as (m2 - m1) * outer_step / inner_step rather than sometimes m1 -
m2
            depending on single_nonrect_cond_code.
            * omp-expand.c (expand_omp_for_init_vars): Rename
min_inner_iterations
            to first_inner_iterations and min_inner_iterationsd to
            first_inner_iterationsd.

Reply via email to