This is the mail archive of the gcc@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: How to get TYPE_LANG_SPECIFIC initialized


> >>>>> "Jan" == Jan Hubicka <jh@suse.cz> writes:
> 
> > the new final.c code to output profile-arcs sturcture fails on C++. THis is because
> > the tree we construct lacks TYPE_LANG_SPECIFIC nodes and C++ frontend fails when
> > it is called via memory aliasing hook.
> 
> I thought I sent this to you already.  Does this patch fix the problem?

You did. I received it minute ago, as our net has been partly down over weekend.

> 
> > How can I get the field initialized in generic way?  I see there is LANG_HOOKS_MAKE_TYPE,
> > but I don't see how it is used at all.
> 
> Doesn't look like it is, no.

I like your patch, just testing it, but I guess it will work.
I am attaching my other patch to the i386 structure passing problem, does it look sensible for you?
If so, I will install it to the tree.

Sun May 12 18:48:22 CEST 2002  Jan Hubicka  <jh@suse.cz>
	* i386.c (classify_argument): Handle subclases.

*** /aux/hubicka/egcs/gcc/config/i386/i386.c	Sat May 11 11:32:02 2002
--- i386.c	Sat May 11 11:29:55 2002
*************** classify_argument (mode, type, classes, 
*** 1682,1687 ****
--- 1676,1709 ----
        /* Classify each field of record and merge classes.  */
        if (TREE_CODE (type) == RECORD_TYPE)
  	{
+ 	  /* For classes first merge in the field of the subclasses.  */
+ 	  if (TYPE_BINFO (type) != NULL && TYPE_BINFO_BASETYPES (type) != NULL)
+ 	    {
+ 	      tree bases = TYPE_BINFO_BASETYPES (type);
+ 	      int n_bases = TREE_VEC_LENGTH (bases);
+ 	      int i;
+ 
+ 	      for (i = 0; i < n_bases; ++i)
+ 		{
+ 		   tree binfo = TREE_VEC_ELT (bases, i);
+ 		   int num;
+ 		   int offset = tree_low_cst (BINFO_OFFSET (binfo), 0) * 8;
+ 		   tree type = BINFO_TYPE (binfo);
+ 
+ 		   num = classify_argument (TYPE_MODE (type),
+ 					    type, subclasses,
+ 					    (offset + bit_offset) % 256);
+ 		   if (!num)
+ 		     return 0;
+ 		   for (i = 0; i < num; i++)
+ 		     {
+ 		       int pos = (offset + bit_offset) / 8 / 8;
+ 		       classes[i + pos] =
+ 			 merge_classes (subclasses[i], classes[i + pos]);
+ 		     }
+ 		}
+ 	    }
+ 	  /* And now merge the fields of structure.   */
  	  for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
  	    {
  	      if (TREE_CODE (field) == FIELD_DECL)


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