commit 3d2cda1e758a54111af04e80ea3dbaa27b3387e7 Author: Sandra Loosemore Date: Wed Mar 25 21:29:17 2020 -0700 Bug fix for processing OpenACC data clauses in C++. The C++ front end wraps the values in OpenACC data clause array range specifications in NON_LVALUE_EXPR tree nodes. The existing code was failing to strip these before checking for constant values. 2020-03-25 Sandra Loosemore gcc/cp/ * semantics.c (handle_omp_array_sections_1): Call STRIP_NOPS on length and low_bound to unwrap NON_LVALUE_EXPRs. (handle_omp_array_sections): Likewise. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 34ccb9f..8945939 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2020-03-25 Sandra Loosemore + + * semantics.c (handle_omp_array_sections_1): Call STRIP_NOPS + on length and low_bound to unwrap NON_LVALUE_EXPRs. + (handle_omp_array_sections): Likewise. + 2020-03-25 Patrick Palka PR c++/94265 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 2721a55..2efc077 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -4861,6 +4861,10 @@ handle_omp_array_sections_1 (tree c, tree t, vec &types, length = mark_rvalue_use (length); /* We need to reduce to real constant-values for checks below. */ if (length) + STRIP_NOPS (length); + if (low_bound) + STRIP_NOPS (low_bound); + if (length) length = fold_simple (length); if (low_bound) low_bound = fold_simple (low_bound); @@ -5160,6 +5164,11 @@ handle_omp_array_sections (tree c, enum c_omp_region_type ort) tree low_bound = TREE_PURPOSE (t); tree length = TREE_VALUE (t); + if (length) + STRIP_NOPS (length); + if (low_bound) + STRIP_NOPS (low_bound); + i--; if (low_bound && TREE_CODE (low_bound) == INTEGER_CST