]> git.ipfire.org Git - people/ms/gcc.git/commit
Fix bug in processing of array dimensions in data clauses.
authorSandra Loosemore <sandra@codesourcery.com>
Tue, 31 Mar 2020 21:29:09 +0000 (14:29 -0700)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 21 Jun 2022 13:11:23 +0000 (14:11 +0100)
commit49577050cb3e16a17e57c08c58bbe16f97bf94a5
treee15bddbbb714dcfb3cb96dc1ea6b6468f75a3a46
parent8ce5285eeb9b0a616a5ea0585fda279ec2fc71c4
Fix bug in processing of array dimensions in data clauses.

The g++ front end wraps the array length and low_bound values in
NON_LVALUE_EXPR, causing the subsequent tests for INTEGER_CST to fail.
The test case c-c++-common/goacc/kernels-loop-annotation-1.c was
tickling this bug and giving bogus errors in g++ because it was falling
through to dynamic array code instead of recognizing the constant bounds.

This patch was posted upstream here
https://gcc.gnu.org/pipermail/gcc-patches/2020-March/542694.html
but not yet committed.  It may be that some other fix for this problem
is implemented on mainline instead; check before merging this patch.

2020-03-31  Sandra Loosemore  <sandra@codesourcery.com>

gcc/cp/
* semantics.cc (handle_omp_array_sections_1): Call STRIP_NOPS
on length and low_bound;
(handle_omp_array_sections): Likewise.
gcc/cp/ChangeLog.omp
gcc/cp/semantics.cc