aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-06-17 15:35:42 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-06-17 15:35:42 +0200
commit9b6a8d0fd1ab985408a389809fdaafdc09d2d165 (patch)
treefa79a694cfe82656768dfc101f5b35d41f9fea27 /gcc
parent6ffccb58d64ee2383365ab4e0eb949b780dd3f14 (diff)
downloadgcc-9b6a8d0fd1ab985408a389809fdaafdc09d2d165.zip
gcc-9b6a8d0fd1ab985408a389809fdaafdc09d2d165.tar.gz
gcc-9b6a8d0fd1ab985408a389809fdaafdc09d2d165.tar.bz2
semantics.c (handle_omp_array_sections_1): Don't ICE when processing_template_decl when checking for bitfields and unions.
* semantics.c (handle_omp_array_sections_1): Don't ICE when processing_template_decl when checking for bitfields and unions. Look through REFERENCE_REF_P as base of COMPONENT_REF. (finish_omp_clauses): Look through REFERENCE_REF_P even for array sections with COMPONENT_REF bases. * testsuite/libgomp.c++/target-21.C: New test. From-SVN: r237554
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/semantics.c10
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5ad3354..8841e15 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2016-06-17 Jakub Jelinek <jakub@redhat.com>
+
+ * semantics.c (handle_omp_array_sections_1): Don't ICE when
+ processing_template_decl when checking for bitfields and unions.
+ Look through REFERENCE_REF_P as base of COMPONENT_REF.
+ (finish_omp_clauses): Look through REFERENCE_REF_P even for
+ array sections with COMPONENT_REF bases.
+
2016-06-16 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_var_list_no_open): Call
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 4cc5d23..fa4698e 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4487,7 +4487,8 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FROM)
&& !type_dependent_expression_p (t))
{
- if (DECL_BIT_FIELD (TREE_OPERAND (t, 1)))
+ if (TREE_CODE (TREE_OPERAND (t, 1)) == FIELD_DECL
+ && DECL_BIT_FIELD (TREE_OPERAND (t, 1)))
{
error_at (OMP_CLAUSE_LOCATION (c),
"bit-field %qE in %qs clause",
@@ -4496,7 +4497,8 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
}
while (TREE_CODE (t) == COMPONENT_REF)
{
- if (TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == UNION_TYPE)
+ if (TREE_TYPE (TREE_OPERAND (t, 0))
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == UNION_TYPE)
{
error_at (OMP_CLAUSE_LOCATION (c),
"%qE is a member of a union", t);
@@ -4504,6 +4506,8 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
}
t = TREE_OPERAND (t, 0);
}
+ if (REFERENCE_REF_P (t))
+ t = TREE_OPERAND (t, 0);
}
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
@@ -6623,6 +6627,8 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
{
while (TREE_CODE (t) == COMPONENT_REF)
t = TREE_OPERAND (t, 0);
+ if (REFERENCE_REF_P (t))
+ t = TREE_OPERAND (t, 0);
if (bitmap_bit_p (&map_field_head, DECL_UID (t)))
break;
if (bitmap_bit_p (&map_head, DECL_UID (t)))