aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-09-10 09:34:42 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2015-09-10 09:34:42 +0200
commit7da8534d1e1ec7b1470ea556b1444c5173799348 (patch)
tree7399d039a1259fda5d1612397faf0278b51dae51 /gcc/cp
parentcbdfbde871992d05f9fbd6118196f5eeadfc91e6 (diff)
downloadgcc-7da8534d1e1ec7b1470ea556b1444c5173799348.zip
gcc-7da8534d1e1ec7b1470ea556b1444c5173799348.tar.gz
gcc-7da8534d1e1ec7b1470ea556b1444c5173799348.tar.bz2
re PR c++/67522 (OpenMP ICE in type_dependent_expression_p)
PR c++/67522 * semantics.c (handle_omp_array_sections_1): Only run type_dependent_expression_p on VAR_DECL/PARM_DECLs. (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Likewise. Don't adjust OMP_CLAUSE_LINEAR_STEP if OMP_CLAUSE_DECL is not a VAR_DECL/PARM_DECL. * g++.dg/gomp/pr67522.C: New test. From-SVN: r227610
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/semantics.c11
2 files changed, 14 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4b32f5a..32646e0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,12 @@
2015-09-10 Jakub Jelinek <jakub@redhat.com>
+ PR c++/67522
+ * semantics.c (handle_omp_array_sections_1): Only run
+ type_dependent_expression_p on VAR_DECL/PARM_DECLs.
+ (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Likewise.
+ Don't adjust OMP_CLAUSE_LINEAR_STEP if OMP_CLAUSE_DECL
+ is not a VAR_DECL/PARM_DECL.
+
PR c++/67511
* semantics.c (handle_omp_for_class_iterator): Don't wrap
error_mark_node into a NOP_EXPR to void_type_node.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 5c3f1be..0897ff7 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4294,8 +4294,6 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
{
if (error_operand_p (t))
return error_mark_node;
- if (type_dependent_expression_p (t))
- return NULL_TREE;
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
if (processing_template_decl)
@@ -4318,6 +4316,8 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
return error_mark_node;
}
+ if (type_dependent_expression_p (t))
+ return NULL_TREE;
t = convert_from_reference (t);
return t;
}
@@ -5332,7 +5332,8 @@ finish_omp_clauses (tree clauses)
goto check_dup_generic;
case OMP_CLAUSE_LINEAR:
t = OMP_CLAUSE_DECL (c);
- if (!type_dependent_expression_p (t)
+ if ((VAR_P (t) || TREE_CODE (t) == PARM_DECL)
+ && !type_dependent_expression_p (t)
&& !INTEGRAL_TYPE_P (TREE_TYPE (t))
&& TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE)
{
@@ -5359,7 +5360,9 @@ finish_omp_clauses (tree clauses)
else
{
t = mark_rvalue_use (t);
- if (!processing_template_decl)
+ if (!processing_template_decl
+ && (VAR_P (OMP_CLAUSE_DECL (c))
+ || TREE_CODE (OMP_CLAUSE_DECL (c)) == PARM_DECL))
{
if (TREE_CODE (OMP_CLAUSE_DECL (c)) == PARM_DECL)
t = maybe_constant_value (t);