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]

C++ PATCH to cp_genericize_r for c++/21123


The original testcase for 21123 was continuing to fail because the genericizer was helpfully dereferencing invisible reference parms, which isn't what we want in a thunk. Fixed thus.

Tested on x86_64-pc-linux-gnu with asm thunk support disabled. Applied to trunk, 4.0 and 4.1 branches. Test in g++.dg/inherit/thunk5.C.
2005-11-30  Jason Merrill  <jason@redhat.com>

	PR c++/21123
	* cp-gimplify.c (cp_genericize_r): Don't dereference invisible reference 
	parms in a thunk.

Index: cp-gimplify.c
===================================================================
*** cp-gimplify.c	(revision 107732)
--- cp-gimplify.c	(working copy)
*************** cp_genericize_r (tree *stmt_p, int *walk
*** 596,602 ****
    tree stmt = *stmt_p;
    struct pointer_set_t *p_set = (struct pointer_set_t*) data;
  
!   if (is_invisiref_parm (stmt))
      {
        *stmt_p = convert_from_reference (stmt);
        *walk_subtrees = 0;
--- 596,605 ----
    tree stmt = *stmt_p;
    struct pointer_set_t *p_set = (struct pointer_set_t*) data;
  
!   if (is_invisiref_parm (stmt)
!       /* Don't dereference parms in a thunk, pass the references through. */
!       && !(DECL_THUNK_P (current_function_decl)
!            && TREE_CODE (stmt) == PARM_DECL))
      {
        *stmt_p = convert_from_reference (stmt);
        *walk_subtrees = 0;

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