Fix PR 25886. Convert OMP_CLAUSE_* into sub-codes.

Diego Novillo dnovillo@redhat.com
Wed Jan 25 18:05:00 GMT 2006


This patch replaces all the OMP_CLAUSE_* tree codes with a single
OMP_CLAUSE tree with sub-codes.  This avoids the code space overflow in
languages with more than 256 tree codes.

Although this could be used as template for a generic sub-code solution,
it's not clear to me whether the benefit would be worth the effort and
we are already entering stage 2.  Sub-coding other trees is likely to be
pretty invasive.

The idea is pretty straightforward.  OMP_CLAUSE_* codes are now a
separate enum that lives in tree_omp_clause.  Clauses can also have
sub-codes of their own (for reduction, schedule and default), which
prevents us from stealing a random field from some other tree structure
(we were using TREE_COMPLEXITY before and should provide a bit stronger
typing.

Other than that, the changes were mechanical search and replace,
compounded by the annoyance that most of the typing mistakes are exposed
at runtime via ICEs or dereferences into invalid memory.

There are two changes not directly related to the actual fix:

1- The range predicate in TREE_RANGE_CHECK was using && instead of ||.
2- TREE_BLOCK was not using EXPR_CHECK to make sure it was dealing with
an expr node.

Bootstrapped and tested on x86, x86-64 and ppc64.

OK for mainline?  I'll apply the C++ and Fortran changes to the gomp
branch after this is approved.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20060125-subcodes-for-omp-clauses.diff
Type: text/x-patch
Size: 48144 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060125/e978387c/attachment.bin>


More information about the Gcc-patches mailing list