This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add checks for tree.value, tree.minval, and tree.maxval andothers


On Thu, 2004-03-18 at 16:14, Richard Kenner wrote:

> 	* tree.h (TREE_CHECK2, TREE_CHECK3, TREE_CHECK5): New macros.
> 	(tree_check2_failed, tree_check3_failed, tree_check5_failed): New decl.
> 	(FUNC_OR_METHOD_CHECK, SET_ARRAY_OR_VECTOR_CHECK): New macros.
> 	(REC_OR_UNION_CHECK, NUMERICAL_TYPE_CHECK): Likewise.
> 	(TYPE_VALUES, TYPE_DOMAIN, TYPE_FIELDS, TYPE_METHODS, TYPE_VFIELD):
> 	Protect with proper check.
>
The check for TYPE_DOMAIN seems wrong.  It is not allowing
INTEGER_TYPEs, which, according to doc/c-tree.texi, it should.  This
causes an ICE in tree-ssa inside c-typeck.c:comptypes() where we have

  if (TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2)
      && TYPE_DOMAIN (t2) != 0)
    t2 = TYPE_DOMAIN (t2);


OK for mainline after bootstrapping?  It bootstraps on tree-ssa.


Diego.

*** tree.h      2004/03/26 01:15:40     1.1
--- tree.h      2004/03/26 01:19:58
*************** extern void tree_operand_check_failed (i
*** 523,530 ****
  #define FUNC_OR_METHOD_CHECK(T)       TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TY
PE)
  #define PTR_OR_REF_CHECK(T)   TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE)

! #define SET_ARRAY_OR_VECTOR_CHECK(T) \
!   TREE_CHECK3 (T, ARRAY_TYPE, SET_TYPE, VECTOR_TYPE)

  #define REC_OR_UNION_CHECK(T) \
    TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
--- 523,530 ----
  #define FUNC_OR_METHOD_CHECK(T)       TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TY
PE)
  #define PTR_OR_REF_CHECK(T)   TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE)

! #define INTEGER_SET_ARRAY_OR_VECTOR_CHECK(T) \
!   TREE_CHECK4 (T, INTEGER_TYPE, ARRAY_TYPE, SET_TYPE, VECTOR_TYPE)

  #define REC_OR_UNION_CHECK(T) \
    TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
*************** struct tree_block GTY(())
*** 1422,1428 ****
  #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
  #define TYPE_ORIG_SIZE_TYPE(NODE) (INTEGER_TYPE_CHECK (NODE)->type.values)
  #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
! #define TYPE_DOMAIN(NODE) (SET_ARRAY_OR_VECTOR_CHECK (NODE)->type.values)
  #define TYPE_FIELDS(NODE) (REC_OR_UNION_CHECK (NODE)->type.values)
  #define TYPE_METHODS(NODE) (REC_OR_UNION_CHECK (NODE)->type.maxval)
  #define TYPE_VFIELD(NODE) (REC_OR_UNION_CHECK (NODE)->type.minval)
--- 1422,1428 ----
  #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
  #define TYPE_ORIG_SIZE_TYPE(NODE) (INTEGER_TYPE_CHECK (NODE)->type.values)
  #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
! #define TYPE_DOMAIN(NODE) (INTEGER_SET_ARRAY_OR_VECTOR_CHECK (NODE)->type.valu
es)
  #define TYPE_FIELDS(NODE) (REC_OR_UNION_CHECK (NODE)->type.values)
  #define TYPE_METHODS(NODE) (REC_OR_UNION_CHECK (NODE)->type.maxval)
  #define TYPE_VFIELD(NODE) (REC_OR_UNION_CHECK (NODE)->type.minval)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]