public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@acm.org>
To: Andreas Schwab <schwab@suse.de>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [C++ PATCH] namespace bindings
Date: Mon, 08 May 2017 17:03:00 -0000	[thread overview]
Message-ID: <c8bdff54-0963-4043-0bc3-318fdb04ced1@acm.org> (raw)
In-Reply-To: <mvm4lwvbco3.fsf@suse.de>

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

On 05/08/2017 11:17 AM, Andreas Schwab wrote:

> g++.dg/cpp0x/defaulted34.C has the same problem.

I'd managed to flub my xcompiler build.  The code path for 
fn-descriptor-using targets is different, and I'd missed that the 
shadowed outer 'fn' was expected to have been initialized  in that case.

Committed the attached fix.

nathan

-- 
Nathan Sidwell

[-- Attachment #2: vtb.diff --]
[-- Type: text/x-patch, Size: 1376 bytes --]

2017-05-08  Nathan Sidwell  <nathan@acm.org>

	* class.c (build_vtbl_initializer): Don't shadow outer variable
	with static var.

Index: cp/class.c
===================================================================
--- cp/class.c	(revision 247746)
+++ cp/class.c	(working copy)
@@ -9769,18 +9769,19 @@ build_vtbl_initializer (tree binfo,
 	  /* Likewise for deleted virtuals.  */
 	  else if (DECL_DELETED_FN (fn_original))
 	    {
-	      static tree fn;
+	      static tree dvirt_fn;
 
-	      if (!fn)
+	      if (!dvirt_fn)
 		{
 		  tree name = get_identifier ("__cxa_deleted_virtual");
-		  fn = IDENTIFIER_GLOBAL_VALUE (name);
-		  if (!fn)
-		    fn = push_library_fn
+		  dvirt_fn = IDENTIFIER_GLOBAL_VALUE (name);
+		  if (!dvirt_fn)
+		    dvirt_fn = push_library_fn
 		      (name,
 		       build_function_type_list (void_type_node, NULL_TREE),
 		       NULL_TREE, ECF_NORETURN);
 		}
+	      fn = dvirt_fn;
 	      if (!TARGET_VTABLE_USES_DESCRIPTORS)
 		init = fold_convert (vfunc_ptr_type_node,
 				     build_fold_addr_expr (fn));
@@ -9789,7 +9790,8 @@ build_vtbl_initializer (tree binfo,
 	    {
 	      if (!integer_zerop (delta) || vcall_index)
 		{
-		  fn = make_thunk (fn, /*this_adjusting=*/1, delta, vcall_index);
+		  fn = make_thunk (fn, /*this_adjusting=*/1,
+				   delta, vcall_index);
 		  if (!DECL_NAME (fn))
 		    finish_thunk (fn);
 		}

  reply	other threads:[~2017-05-08 17:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 20:25 Nathan Sidwell
2017-05-08 12:41 ` Andreas Schwab
2017-05-08 13:14   ` Nathan Sidwell
2017-05-08 14:33   ` Nathan Sidwell
2017-05-08 15:25     ` Andreas Schwab
2017-05-08 17:03       ` Nathan Sidwell [this message]
2017-05-08 13:06 ` Jason Merrill via gcc-patches
2017-05-08 13:34   ` Nathan Sidwell
2017-05-08 15:54   ` Nathan Sidwell
2017-05-23 19:47 Nathan Sidwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8bdff54-0963-4043-0bc3-318fdb04ced1@acm.org \
    --to=nathan@acm.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).