[Bug c++/93931] ICE using lambda capture in openMP parallel for reduction
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Apr 7 19:03:40 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93931
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:484206967f958fc47827a71654fe52a98adc95cb
commit r9-8465-g484206967f958fc47827a71654fe52a98adc95cb
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Mar 19 12:22:47 2020 +0100
c++: Fix up handling of captured vars in lambdas in OpenMP clauses
[PR93931]
Without the parser.c change we were ICEing on the testcase, because while
the
uses of the captured vars inside of the constructs were replaced with
capture
proxy decls, we didn't do that for decls in OpenMP clauses.
With that fixed, we don't ICE anymore, but the testcase is miscompiled and
FAILs
at runtime. This is because the capture proxy decls have DECL_VALUE_EXPR
and
during gimplification we were gimplifying those to their DECL_VALUE_EXPRs.
That is fine for shared vars, but for privatized ones we must not do that.
So that is what the cp-gimplify.c changes do. Had to add a DECL_CONTEXT
check
before calling is_capture_proxy because some VAR_DECLs don't have
DECL_CONTEXT
set (yet) and is_capture_proxy relies on that being non-NULL always.
2020-03-19 Jakub Jelinek <jakub@redhat.com>
PR c++/93931
* parser.c (cp_parser_omp_var_list_no_open): Call
process_outer_var_ref
on outer_automatic_var_p decls.
* cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also
for
capture proxy decls.
* testsuite/libgomp.c++/pr93931.C: New test.
More information about the Gcc-bugs
mailing list