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]

C++ tree-checking failure


I had a tree check failure when compiling gperf on PPC.

It seems that insisting on a FUNCTION_TYPE here is too strict: it
might be a method.  OK to apply?

Andrew.

2000-09-12  Andrew Haley  <aph@redhat.com>

        * tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): New macro.
        (TYPE_RETURNS_STACK_DEPRESSED): Use FUNCTION_OR_METHOD_TYPE_CHECK
        rather than FUNCTION_TYPE_CHECK.

Index: tree.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tree.h,v
retrieving revision 1.195
diff -p -2 -c -r1.195 tree.h
*** tree.h      2000/08/30 22:50:52     1.195
--- tree.h      2000/09/12 17:51:45
*************** struct tree_common
*** 302,305 ****
--- 302,311 ----
        tree_class_check_failed(__t, 'e', __FILE__, __LINE__, __FUNCTION__); \
      __t; })
+ #define FUNCTION_OR_METHOD_TYPE_CHECK(t) __extension__                        \
+ ({  const tree __t = t;                                                       \
+     if (TREE_CODE(__t) != FUNCTION_TYPE                                       \
+       && TREE_CODE(__t) != METHOD_TYPE)                               	\
+       tree_check_failed (__t, FUNCTION_TYPE, __FILE__, __LINE__, __FUNCTION__); \
+     __t; })
  
  extern void tree_check_failed PARAMS ((const tree, enum tree_code,
*************** struct tree_block
*** 965,969 ****
     pointer depressed.  */
  #define TYPE_RETURNS_STACK_DEPRESSED(NODE) \
!   (FUNCTION_TYPE_CHECK (NODE)->type.no_force_blk_flag)
  
  /* Nonzero in a type considered volatile as a whole.  */
--- 971,975 ----
     pointer depressed.  */
  #define TYPE_RETURNS_STACK_DEPRESSED(NODE) \
!   (FUNCTION_OR_METHOD_TYPE_CHECK (NODE)->type.no_force_blk_flag)
  
  /* Nonzero in a type considered volatile as a whole.  */

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