[Bug c++/60228] ICE using lambda in #pragma omp declare reduction

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 20 17:31:00 GMT 2019


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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Dec 20 17:30:38 2019
New Revision: 279662

URL: https://gcc.gnu.org/viewcvs?rev=279662&root=gcc&view=rev
Log:
        Backported from mainline
        2019-11-29  Jakub Jelinek  <jakub@redhat.com>

        PR c++/60228
        * parser.c (cp_parser_omp_declare_reduction_exprs): If
        processing_template_decl, wrap the combiner or initializer
        into EXPR_STMT.
        * decl.c (start_preparsed_function): Don't start a lambda scope
        for DECL_OMP_DECLARE_REDUCTION_P functions.
        (finish_function): Don't finish a lambda scope for
        DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function
        them nor cp_genericize them.
        * mangle.c (decl_mangling_context): Look through
        DECL_OMP_DECLARE_REDUCTION_P functions.
        * semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P
        functions, use tentative linkage, don't keep their bodies with
        -fkeep-inline-functions and return false at the end.

        * g++.dg/gomp/openmp-simd-2.C: Don't expect bodies for
        DECL_OMP_DECLARE_REDUCTION_P functions.

        * testsuite/libgomp.c++/udr-20.C: New test.
        * testsuite/libgomp.c++/udr-21.C: New test.

Added:
    branches/gcc-9-branch/libgomp/testsuite/libgomp.c++/udr-20.C
    branches/gcc-9-branch/libgomp/testsuite/libgomp.c++/udr-21.C
Modified:
    branches/gcc-9-branch/gcc/cp/ChangeLog
    branches/gcc-9-branch/gcc/cp/decl.c
    branches/gcc-9-branch/gcc/cp/mangle.c
    branches/gcc-9-branch/gcc/cp/parser.c
    branches/gcc-9-branch/gcc/cp/semantics.c
    branches/gcc-9-branch/gcc/testsuite/ChangeLog
    branches/gcc-9-branch/gcc/testsuite/g++.dg/gomp/openmp-simd-2.C
    branches/gcc-9-branch/libgomp/ChangeLog


More information about the Gcc-bugs mailing list