	* config/mep/mep.c (mep_validate_based_tiny): Only deal with VAR_DECL.
	(mep_validate_near_far): Only allow VAR_DECL and FUNCTION_DECL.
	(mep_validate_disinterrupt): Only allow FUNCTION_DECL.
	(mep_attribute_table): Set decl_required field for some handlers.
	* config/stormy16/stormy16.c (xstormy16_attribute_table): Set
	decl_required field for below100 handler.
	(xstormy16_handle_below100_attribute): Only handle VAR_DECL.


Index: config/mep/mep.c
===================================================================
*** config/mep/mep.c	(revision 217822)
--- config/mep/mep.c	(working copy)
*************** static tree
*** 3813,3826 ****
  mep_validate_based_tiny (tree *node, tree name, tree args,
  			 int flags ATTRIBUTE_UNUSED, bool *no_add)
  {
!   if (TREE_CODE (*node) != VAR_DECL
!       && TREE_CODE (*node) != POINTER_TYPE
!       && TREE_CODE (*node) != TYPE_DECL)
      {
        warning (0, "%qE attribute only applies to variables", name);
        *no_add = true;
      }
!   else if (args == NULL_TREE && TREE_CODE (*node) == VAR_DECL)
      {
        if (! (TREE_PUBLIC (*node) || TREE_STATIC (*node)))
  	{
--- 3813,3824 ----
  mep_validate_based_tiny (tree *node, tree name, tree args,
  			 int flags ATTRIBUTE_UNUSED, bool *no_add)
  {
!   if (TREE_CODE (*node) != VAR_DECL)
      {
        warning (0, "%qE attribute only applies to variables", name);
        *no_add = true;
      }
!   else if (args == NULL_TREE)
      {
        if (! (TREE_PUBLIC (*node) || TREE_STATIC (*node)))
  	{
*************** mep_validate_near_far (tree *node, tree
*** 3874,3883 ****
  		       int flags ATTRIBUTE_UNUSED, bool *no_add)
  {
    if (TREE_CODE (*node) != VAR_DECL
!       && TREE_CODE (*node) != FUNCTION_DECL
!       && TREE_CODE (*node) != METHOD_TYPE
!       && TREE_CODE (*node) != POINTER_TYPE
!       && TREE_CODE (*node) != TYPE_DECL)
      {
        warning (0, "%qE attribute only applies to variables and functions",
  	       name);
--- 3872,3878 ----
  		       int flags ATTRIBUTE_UNUSED, bool *no_add)
  {
    if (TREE_CODE (*node) != VAR_DECL
!       && TREE_CODE (*node) != FUNCTION_DECL)
      {
        warning (0, "%qE attribute only applies to variables and functions",
  	       name);
*************** static tree
*** 3910,3917 ****
  mep_validate_disinterrupt (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
  			   int flags ATTRIBUTE_UNUSED, bool *no_add)
  {
!   if (TREE_CODE (*node) != FUNCTION_DECL
!       && TREE_CODE (*node) != METHOD_TYPE)
      {
        warning (0, "%qE attribute only applies to functions", name);
        *no_add = true;
--- 3905,3911 ----
  mep_validate_disinterrupt (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
  			   int flags ATTRIBUTE_UNUSED, bool *no_add)
  {
!   if (TREE_CODE (*node) != FUNCTION_DECL)
      {
        warning (0, "%qE attribute only applies to functions", name);
        *no_add = true;
*************** static const struct attribute_spec mep_a
*** 4032,4046 ****
  {
    /* name         min max decl   type   func   handler
       affects_type_identity */
!   { "based",        0, 0, false, false, false, mep_validate_based_tiny, false },
!   { "tiny",         0, 0, false, false, false, mep_validate_based_tiny, false },
!   { "near",         0, 0, false, false, false, mep_validate_near_far, false },
!   { "far",          0, 0, false, false, false, mep_validate_near_far, false },
!   { "disinterrupt", 0, 0, false, false, false, mep_validate_disinterrupt,
      false },
!   { "interrupt",    0, 0, false, false, false, mep_validate_interrupt, false },
!   { "io",           0, 1, false, false, false, mep_validate_io_cb, false },
!   { "cb",           0, 1, false, false, false, mep_validate_io_cb, false },
    { "vliw",         0, 0, false, true,  false, mep_validate_vliw, false },
    { NULL,           0, 0, false, false, false, NULL, false }
  };
--- 4026,4040 ----
  {
    /* name         min max decl   type   func   handler
       affects_type_identity */
!   { "based",        0, 0, true, false, false, mep_validate_based_tiny, false },
!   { "tiny",         0, 0, true, false, false, mep_validate_based_tiny, false },
!   { "near",         0, 0, true, false, false, mep_validate_near_far, false },
!   { "far",          0, 0, true, false, false, mep_validate_near_far, false },
!   { "disinterrupt", 0, 0, true, false, false, mep_validate_disinterrupt,
      false },
!   { "interrupt",    0, 0, true, false, false, mep_validate_interrupt, false },
!   { "io",           0, 1, true, false, false, mep_validate_io_cb, false },
!   { "cb",           0, 1, true, false, false, mep_validate_io_cb, false },
    { "vliw",         0, 0, false, true,  false, mep_validate_vliw, false },
    { NULL,           0, 0, false, false, false, NULL, false }
  };
Index: config/stormy16/stormy16.c
===================================================================
*** config/stormy16/stormy16.c	(revision 217822)
--- config/stormy16/stormy16.c	(working copy)
*************** static const struct attribute_spec xstor
*** 2216,2224 ****
       affects_type_identity.  */
    { "interrupt", 0, 0, false, true,  true,
      xstormy16_handle_interrupt_attribute , false },
!   { "BELOW100",  0, 0, false, false, false,
      xstormy16_handle_below100_attribute, false },
!   { "below100",  0, 0, false, false, false,
      xstormy16_handle_below100_attribute, false },
    { NULL,        0, 0, false, false, false, NULL, false }
  };
--- 2216,2224 ----
       affects_type_identity.  */
    { "interrupt", 0, 0, false, true,  true,
      xstormy16_handle_interrupt_attribute , false },
!   { "BELOW100",  0, 0, true, false, false,
      xstormy16_handle_below100_attribute, false },
!   { "below100",  0, 0, true, false, false,
      xstormy16_handle_below100_attribute, false },
    { NULL,        0, 0, false, false, false, NULL, false }
  };
*************** xstormy16_handle_below100_attribute (tre
*** 2252,2266 ****
  				     int flags ATTRIBUTE_UNUSED,
  				     bool *no_add_attrs)
  {
!   if (TREE_CODE (*node) != VAR_DECL
!       && TREE_CODE (*node) != POINTER_TYPE
!       && TREE_CODE (*node) != TYPE_DECL)
      {
        warning (OPT_Wattributes,
  	       "%<__BELOW100__%> attribute only applies to variables");
        *no_add_attrs = true;
      }
!   else if (args == NULL_TREE && TREE_CODE (*node) == VAR_DECL)
      {
        if (! (TREE_PUBLIC (*node) || TREE_STATIC (*node)))
  	{
--- 2252,2264 ----
  				     int flags ATTRIBUTE_UNUSED,
  				     bool *no_add_attrs)
  {
!   if (TREE_CODE (*node) != VAR_DECL)
      {
        warning (OPT_Wattributes,
  	       "%<__BELOW100__%> attribute only applies to variables");
        *no_add_attrs = true;
      }
!   else if (args == NULL_TREE)
      {
        if (! (TREE_PUBLIC (*node) || TREE_STATIC (*node)))
  	{
