... instead of just the first clause.
gcc/
* tree-pretty-print.h (dump_omp_clauses): Add 'bool = true'
default argument.
* tree-pretty-print.c (dump_omp_clauses): Update.
(dump_generic_node) <OMP_CLAUSE>: Use it.
gcc/testsuite/
* gcc.dg/gomp/simd-clones-2.c: Enhance.
(cherry picked from commit
2973090c4c62105cbb61bfc6f83be903e3c46c71)
+2021-06-15 Tobias Burnus <tobias@codesourcery.com>
+
+ Backported from master:
+ 2021-06-11 Thomas Schwinge <thomas@codesourcery.com>
+
+ * tree-pretty-print.h (dump_omp_clauses): Add 'bool = true'
+ default argument.
+ * tree-pretty-print.c (dump_omp_clauses): Update.
+ (dump_generic_node) <OMP_CLAUSE>: Use it.
+
2021-06-08 Tobias Burnus <tobias@codesourcery.com>
Backported from master:
+2021-06-15 Tobias Burnus <tobias@codesourcery.com>
+
+ Backported from master:
+ 2021-06-11 Thomas Schwinge <thomas@codesourcery.com>
+
+ * gcc.dg/gomp/simd-clones-2.c: Enhance.
+
2021-06-09 Tobias Burnus <tobias@codesourcery.com>
Backported from master:
return a + b;
}
/* { dg-warning "GCC does not currently support mixed size types for 'simd' functions" "" { target aarch64*-*-* } .-4 } */
+/* { dg-final { scan-tree-dump {(?n)^__attribute__\(\(omp declare simd \(notinbranch aligned\(2:32\)\), omp declare simd \(inbranch uniform\(2\) linear\(1:66\)\)\)\)$} "optimized" } } */
#pragma omp declare simd uniform(a) aligned(a:32) linear(k:1) notinbranch
float setArray(float *a, float x, int k)
a[k] = a[k] + x;
return a[k];
}
+/* { dg-final { scan-tree-dump {(?n)^__attribute__\(\(omp declare simd \(notinbranch uniform\(0\) aligned\(0:32\) linear\(2:1\)\)\)\)$} "optimized" } } */
/* { dg-final { scan-tree-dump "_ZGVbN4ua32vl_setArray" "optimized" { target i?86-*-* x86_64-*-* } } } */
/* { dg-final { scan-tree-dump "_ZGVbN4vvva32_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
}
-/* Dump OpenMP clause CLAUSE. PP, CLAUSE, SPC and FLAGS are as in
- dump_generic_node. */
+/* Dump OMP clause CLAUSE, without following OMP_CLAUSE_CHAIN.
+
+ PP, CLAUSE, SPC and FLAGS are as in dump_generic_node. */
static void
dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
}
-/* Dump the list of OpenMP clauses. PP, SPC and FLAGS are as in
- dump_generic_node. */
+/* Dump chain of OMP clauses.
+
+ PP, SPC and FLAGS are as in dump_generic_node. */
void
-dump_omp_clauses (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
+dump_omp_clauses (pretty_printer *pp, tree clause, int spc, dump_flags_t flags,
+ bool leading_space)
{
- if (clause == NULL)
- return;
-
- pp_space (pp);
- while (1)
+ while (clause)
{
+ if (leading_space)
+ pp_space (pp);
dump_omp_clause (pp, clause, spc, flags);
+ leading_space = true;
+
clause = OMP_CLAUSE_CHAIN (clause);
- if (clause == NULL)
- return;
- pp_space (pp);
}
}
goto dump_omp_body;
case OMP_CLAUSE:
- dump_omp_clause (pp, node, spc, flags);
+ /* If we come here, we're dumping something that's not an OMP construct,
+ for example, OMP clauses attached to a function's '__attribute__'.
+ Dump the whole OMP clause chain. */
+ dump_omp_clauses (pp, node, spc, flags, false);
is_expr = false;
break;
extern void print_generic_stmt_indented (FILE *, tree, dump_flags_t, int);
extern void print_generic_expr (FILE *, tree, dump_flags_t = TDF_NONE);
extern char *print_generic_expr_to_str (tree);
-extern void dump_omp_clauses (pretty_printer *, tree, int, dump_flags_t);
+extern void dump_omp_clauses (pretty_printer *, tree, int, dump_flags_t,
+ bool = true);
extern void dump_omp_atomic_memory_order (pretty_printer *,
enum omp_memory_order);
extern void dump_omp_loop_non_rect_expr (pretty_printer *, tree, int,