This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: armv4l bootstrap problem in libstdc++-v3


Hi Jason,

: I think that the bug is that we are setting TREE_PARMLIST on actual
: parameter lists; it is only useful to distinguish between semi-parsed
: parameter declarations and semi-parsed expressions.  Once we have fully
: parsed the parm list, it serves no purpose.
: 
: Other opinions?

This seems correct.  I developed a patch yesterday that fixes the
problem, although I am not sure if it is the right solution:

Cheers
	Nick

2000-12-20  Nick Clifton  <nickc@redhat.com>

	* tree.c (build_function_type): Detect the presence of
	TREE_PARMLIST in C++ parameter lists and adjust the hash code
	accordingly.

Index: tree.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tree.c,v
retrieving revision 1.177
diff -p -r1.177 tree.c
*** tree.c	2000/11/27 07:09:19	1.177
--- tree.c	2000/12/20 20:25:22
*************** build_function_type (value_type, arg_typ
*** 3879,3886 ****
  
    /* If we already have such a type, use the old one and free this one.  */
    hashcode = TYPE_HASH (value_type) + type_hash_list (arg_types);
-   t = type_hash_canon (hashcode, t);
  
    if (!COMPLETE_TYPE_P (t))
      layout_type (t);
    return t;
--- 3879,3895 ----
  
    /* If we already have such a type, use the old one and free this one.  */
    hashcode = TYPE_HASH (value_type) + type_hash_list (arg_types);
  
+   if (arg_types && TREE_CHAIN (arg_types))
+     {
+       /* In C++ the TREE_UNSIGNED field is used to distinguish a parameter
+ 	 list from a list of expressions.  We must make sure that this bit
+ 	 is preserved in whichever type we select.  */
+       hashcode += TREE_UNSIGNED (TREE_CHAIN (arg_types)) ? 1 : 0;
+     }
+   
+   t = type_hash_canon (hashcode, t);
+   
    if (!COMPLETE_TYPE_P (t))
      layout_type (t);
    return t;



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