aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-01-24 17:28:47 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-01-24 17:28:47 +0100
commitf1542d9aee3d96366a680a470e2754912f0e8ce7 (patch)
tree174665a92f7c4715370c978fc58ff9d4a0673587 /gcc/omp-low.c
parent556d3a2433a6e2207c6f36fe292d89d81f46f924 (diff)
downloadgcc-f1542d9aee3d96366a680a470e2754912f0e8ce7.zip
gcc-f1542d9aee3d96366a680a470e2754912f0e8ce7.tar.gz
gcc-f1542d9aee3d96366a680a470e2754912f0e8ce7.tar.bz2
re PR middle-end/83977 (ICE in simd_clone_clauses_extract, at omp-simd-clone.c:184)
PR middle-end/83977 * tree.c (free_lang_data_in_decl): Don't clear DECL_ABSTRACT_ORIGIN here. * omp-low.c (create_omp_child_function): Remove "omp declare simd" attributes from DECL_ATTRIBUTES (decl) without affecting DECL_ATTRIBUTES (current_function_decl). * omp-simd-clone.c (expand_simd_clones): Ignore DECL_ARTIFICIAL functions with non-NULL DECL_ABSTRACT_ORIGIN. * c-c++-common/gomp/pr83977-1.c: New test. * c-c++-common/gomp/pr83977-2.c: New test. * c-c++-common/gomp/pr83977-3.c: New test. * gfortran.dg/gomp/pr83977.f90: New test. From-SVN: r257023
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 3fcda29..ebbf88e 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -1585,6 +1585,23 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
DECL_INITIAL (decl) = make_node (BLOCK);
BLOCK_SUPERCONTEXT (DECL_INITIAL (decl)) = decl;
DECL_ATTRIBUTES (decl) = DECL_ATTRIBUTES (current_function_decl);
+ /* Remove omp declare simd attribute from the new attributes. */
+ if (tree a = lookup_attribute ("omp declare simd", DECL_ATTRIBUTES (decl)))
+ {
+ while (tree a2 = lookup_attribute ("omp declare simd", TREE_CHAIN (a)))
+ a = a2;
+ a = TREE_CHAIN (a);
+ for (tree *p = &DECL_ATTRIBUTES (decl); *p != a;)
+ if (is_attribute_p ("omp declare simd", get_attribute_name (*p)))
+ *p = TREE_CHAIN (*p);
+ else
+ {
+ tree chain = TREE_CHAIN (*p);
+ *p = copy_node (*p);
+ p = &TREE_CHAIN (*p);
+ *p = chain;
+ }
+ }
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)
= DECL_FUNCTION_SPECIFIC_OPTIMIZATION (current_function_decl);
DECL_FUNCTION_SPECIFIC_TARGET (decl)