[Bug middle-end/102431] [12 Regression] ICE in lower_gimple_bind, at gimple-low.c:439 since r12-1206-g178191e1dfafd8db

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 23 09:33:48 GMT 2021


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

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

https://gcc.gnu.org/g:5e9b973bd60185f221222022f56db7df3d92250e

commit r12-5464-g5e9b973bd60185f221222022f56db7df3d92250e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Nov 23 10:30:02 2021 +0100

    openmp: Fix up handling of reduction clauses on the loop construct
[PR102431]

    We were using unshare_expr and walk_tree_without_duplicate replacement
    of the placeholder vars.  The OMP_CLAUSE_REDUCTION_{INIT,MERGE} can contain
    other trees that need to be duplicated though, e.g. BLOCKs referenced in
    BIND_EXPR(s), or local VAR_DECLs.  This patch uses the inliner code to copy
    all of that.  There is a slight complication that those local VAR_DECLs or
    placeholders don't have DECL_CONTEXT set, they will get that only when
    they are gimplified later on, so this patch sets DECL_CONTEXT for those
    temporarily and resets it afterwards.

    2021-11-23  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/102431
            * gimplify.c (replace_reduction_placeholders): Remove.
            (note_no_context_vars): New function.
            (gimplify_omp_loop): For OMP_PARALLEL's BIND_EXPR create a new
            BLOCK.  Use copy_tree_body_r with walk_tree instead of unshare_expr
            and replace_reduction_placeholders for duplication of
            OMP_CLAUSE_REDUCTION_{INIT,MERGE} expressions.  Ensure all
mentioned
            automatic vars have DECL_CONTEXT set to non-NULL before doing so
            and reset it afterwards for those vars and their corresponding
            vars.

            * c-c++-common/gomp/pr102431.c: New test.
            * g++.dg/gomp/pr102431.C: New test.
            * gfortran.dg/gomp/pr102431.f90: New test.


More information about the Gcc-bugs mailing list