Hi! On 2006-01-25T12:41:14-0500, Diego Novillo wrote: > This patch replaces all the OMP_CLAUSE_* tree codes with a single > OMP_CLAUSE tree with sub-codes. So, originally all OMP clauses were represented by their own tree codes, which all had to be enumerated/handled individually. But, with all these having been unified into 'OMP_CLAUSE'... > --- tree.c (revision 110178) > +++ tree.c (working copy) ..., and given this: > +/* Number of operands for each OpenMP clause. */ > +unsigned char omp_clause_num_ops[] = > +{ > + 0, /* OMP_CLAUSE_ERROR */ > + 1, /* OMP_CLAUSE_PRIVATE */ > + 1, /* OMP_CLAUSE_SHARED */ > + 1, /* OMP_CLAUSE_FIRSTPRIVATE */ > + 1, /* OMP_CLAUSE_LASTPRIVATE */ > + 4, /* OMP_CLAUSE_REDUCTION */ > + 1, /* OMP_CLAUSE_COPYIN */ > + 1, /* OMP_CLAUSE_COPYPRIVATE */ > + 1, /* OMP_CLAUSE_IF */ > + 1, /* OMP_CLAUSE_NUM_THREADS */ > + 1, /* OMP_CLAUSE_SCHEDULE */ > + 0, /* OMP_CLAUSE_NOWAIT */ > + 0, /* OMP_CLAUSE_ORDERED */ > + 0 /* OMP_CLAUSE_DEFAULT */ > +}; ..., we may simplify this: > @@ -7303,30 +7433,38 @@ walk_tree (tree *tp, walk_tree_fn func, > } > break; > > - case OMP_CLAUSE_PRIVATE: > -[...] > - case OMP_CLAUSE_SCHEDULE: > - WALK_SUBTREE (TREE_OPERAND (*tp, 0)); > - /* FALLTHRU */ > + case OMP_CLAUSE: > + switch (OMP_CLAUSE_CODE (*tp)) > + { > + case OMP_CLAUSE_PRIVATE: > +[...] > + case OMP_CLAUSE_SCHEDULE: > + WALK_SUBTREE (OMP_CLAUSE_OPERAND (*tp, 0)); > + /* FALLTHRU */ > > - case OMP_CLAUSE_NOWAIT: > - case OMP_CLAUSE_ORDERED: > - case OMP_CLAUSE_DEFAULT: > - WALK_SUBTREE_TAIL (OMP_CLAUSE_CHAIN (*tp)); > + case OMP_CLAUSE_NOWAIT: > + case OMP_CLAUSE_ORDERED: > + case OMP_CLAUSE_DEFAULT: > + WALK_SUBTREE_TAIL (OMP_CLAUSE_CHAIN (*tp)); > > - case OMP_CLAUSE_REDUCTION: > - { > - int i; > - for (i = 0; i < 4; i++) > - WALK_SUBTREE (TREE_OPERAND (*tp, i)); > - WALK_SUBTREE_TAIL (OMP_CLAUSE_CHAIN (*tp)); > - } > + case OMP_CLAUSE_REDUCTION: > + { > + int i; > + for (i = 0; i < 4; i++) > + WALK_SUBTREE (OMP_CLAUSE_OPERAND (*tp, i)); > + WALK_SUBTREE_TAIL (OMP_CLAUSE_CHAIN (*tp)); > + } > + > + default: > + gcc_unreachable (); > + } > + break; ... considerably? OK to push to master branch the attached "Simplify 'gcc/tree.c:walk_tree_1' handling of 'OMP_CLAUSE'"? Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955