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]

Re: More Dwarf2 issues


>>>>> "Jim" == Jim Wilson <wilson@cygnus.com> writes:

    Jim> Sorry about the delay, I was in meetings for a week and a
    Jim> half.

No problem.

    Jim> In the presense of inlining, we need to check
    Jim> DECL_ABSTRACT_ORIGIN as you've done.  Your patch looks
    Jim> reasonable to me, but you might be better off with something
    Jim> like TYPE_NAME (type) != x && (DECL_ABSTRACT_ORIGIN (x) ==
    Jim> NULL_TREE || decl_ultimate_origin (decl) != TYPE_NAME (type))
    Jim> This work even if TYPE_NAME (type) is NULL, and it works even
    Jim> if you have multiple levels of inlining.
    Jim> decl_ultimate_origin can be found in dwarf2out.c.

Thanks for pointing this out.  I was able to generate a test-case
based on your description that caused a crash, even with my original
patch.  What about the attached patch, instead of using
decl_ultimate_origin?  It seems more efficient, and makes
DECL_ABSTRACT_ORIGIN have (to me) clearer semantics;
DECL_ABSTRACT_ORIGIN is now always the truly original DECL of which
the present DECL is an instantiation, for lack of a better word.

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com

Mon Aug 17 13:10:00 1998  Mark Mitchell  <mark@markmitchell.com>

	* integrate.c (integrate_decl_tree): Make the DECL_ABSTRACT_ORIGIN
	the most distant ancestor, not the immediate parent.

Index: integrate.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/integrate.c,v
retrieving revision 1.34
diff -c -p -r1.34 integrate.c
*** integrate.c	1998/06/25 15:14:38	1.34
--- integrate.c	1998/08/17 20:07:59
*************** integrate_decl_tree (let, level, map)
*** 2247,2253 ****
        /* These args would always appear unused, if not for this.  */
        TREE_USED (d) = 1;
        /* Prevent warning for shadowing with these.  */
!       DECL_ABSTRACT_ORIGIN (d) = t;
  
        if (DECL_LANG_SPECIFIC (d))
  	copy_lang_decl (d);
--- 2247,2256 ----
        /* These args would always appear unused, if not for this.  */
        TREE_USED (d) = 1;
        /* Prevent warning for shadowing with these.  */
!       if (DECL_ABSTRACT_ORIGIN (t))
! 	DECL_ABSTRACT_ORIGIN (d) = DECL_ABSTRACT_ORIGIN (t);
!       else
! 	DECL_ABSTRACT_ORIGIN (d) = t;
  
        if (DECL_LANG_SPECIFIC (d))
  	copy_lang_decl (d);


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