https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85088
--- Comment #6 from janus at gcc dot gnu.org --- (In reply to janus from comment #5) > (In reply to Dominique d'Humieres from comment #4) > > It seems that there is some inconsistencies > > Right, in particular regarding INTENT_INOUT vs DECL_INOUT etc. Therefore the > patch in comment #2 is much too naive (and produces a huge amount of > regressions). These regressions can actually be fixed by making sure that the DECL_* values correspond to INTENT_*: Index: gcc/fortran/decl.c =================================================================== --- gcc/fortran/decl.c (revision 258893) +++ gcc/fortran/decl.c (working copy) @@ -4674,9 +4674,10 @@ match_attr_spec (void) { /* Modifiers that can exist in a type statement. */ enum - { GFC_DECL_BEGIN = 0, - DECL_ALLOCATABLE = GFC_DECL_BEGIN, DECL_DIMENSION, DECL_EXTERNAL, - DECL_IN, DECL_OUT, DECL_INOUT, DECL_INTRINSIC, DECL_OPTIONAL, + { GFC_DECL_BEGIN = 0, DECL_ALLOCATABLE = GFC_DECL_BEGIN, + DECL_IN = INTENT_IN, DECL_OUT = INTENT_OUT, DECL_INOUT = INTENT_INOUT, + DECL_DIMENSION, DECL_EXTERNAL, + DECL_INTRINSIC, DECL_OPTIONAL, DECL_PARAMETER, DECL_POINTER, DECL_PROTECTED, DECL_PRIVATE, DECL_STATIC, DECL_AUTOMATIC, DECL_PUBLIC, DECL_SAVE, DECL_TARGET, DECL_VALUE, DECL_VOLATILE,