Fortran: dump-parse-tree.c fixes for OpenMP

gcc/fortran/ChangeLog:

	* dump-parse-tree.c (show_omp_clauses): Handle ancestor modifier,
	avoid ICE for GFC_OMP_ATOMIC_SWAP.
	* gfortran.h (gfc_omp_clauses): Change 'anecestor' into a bitfield.
This commit is contained in:
Tobias Burnus 2021-10-13 11:53:30 +02:00
parent c1b6c360fc
commit 77c7abe358
2 changed files with 4 additions and 3 deletions

View File

@ -1750,6 +1750,8 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses)
if (omp_clauses->device)
{
fputs (" DEVICE(", dumpfile);
if (omp_clauses->ancestor)
fputs ("ANCESTOR:", dumpfile);
show_expr (omp_clauses->device);
fputc (')', dumpfile);
}
@ -1894,7 +1896,7 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses)
if (omp_clauses->atomic_op != GFC_OMP_ATOMIC_UNSET)
{
const char *atomic_op;
switch (omp_clauses->atomic_op)
switch (omp_clauses->atomic_op & GFC_OMP_ATOMIC_MASK)
{
case GFC_OMP_ATOMIC_READ: atomic_op = "READ"; break;
case GFC_OMP_ATOMIC_WRITE: atomic_op = "WRITE"; break;

View File

@ -1482,12 +1482,11 @@ typedef struct gfc_omp_clauses
struct gfc_expr *dist_chunk_size;
struct gfc_expr *message;
const char *critical_name;
bool ancestor;
enum gfc_omp_default_sharing default_sharing;
enum gfc_omp_atomic_op atomic_op;
enum gfc_omp_defaultmap defaultmap[OMP_DEFAULTMAP_CAT_NUM];
int collapse, orderedc;
unsigned nowait:1, ordered:1, untied:1, mergeable:1;
unsigned nowait:1, ordered:1, untied:1, mergeable:1, ancestor:1;
unsigned inbranch:1, notinbranch:1, nogroup:1;
unsigned sched_simd:1, sched_monotonic:1, sched_nonmonotonic:1;
unsigned simd:1, threads:1, depend_source:1, destroy:1, order_concurrent:1;