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 use_thunk for c++/26957


We set DECL_VALUE_EXPR on the PARM_DECLs on callee-copy targets so that references within the body of the function refer to the copy rather than the passed pointer. use_thunk was making copies of the PARM_DECLs for thunks without touching the DECL_VALUE_EXPR, so when we compile the thunk it tries to refer to the copy from the main function, which doesn't have RTL because we aren't in the main function. Fixed by clearing DECL_HAS_VALUE_EXPR_P on the copied parms so that they'll get their own version.

I don't have access to hppa hardware at the moment, so I would appreciate testing there to verify that it works properly apart from avoiding the crash. However, it doesn't cause any regressions on x86_64-pc-linux-gnu, so I'm going to go ahead and check it in.

2006-09-07  Jason Merrill  <jason@redhat.com>

	PR c++/26957
	* method.c (use_thunk): Clear DECL_HAS_VALUE_EXPR_P on copied
	parms.

Index: method.c
===================================================================
*** method.c	(revision 116754)
--- method.c	(working copy)
*************** use_thunk (tree thunk_fndecl, bool emit_
*** 419,424 ****
--- 419,425 ----
        TREE_CHAIN (x) = t;
        DECL_CONTEXT (x) = thunk_fndecl;
        SET_DECL_RTL (x, NULL_RTX);
+       DECL_HAS_VALUE_EXPR_P (x) = 0;
        t = x;
      }
    a = nreverse (t);

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