public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Iain Buclaw via Gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] d: Committed fix multiple definition error when using mixins and interfaces.
Date: Tue, 17 Mar 2020 21:50:13 +0100	[thread overview]
Message-ID: <ydda74eso3e.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <20200316220809.31868-1-ibuclaw@gdcproject.org> (Iain Buclaw via Gcc-patches's message of "Mon, 16 Mar 2020 23:08:09 +0100")

Hi Iain,

> When generating thunks in the D front-end, they need not necesarily be
> in the same compilation unit as the module where the target function is
> declared.  When this happens, don't make the thunk public.  Later on
> expand_thunk will be called with force_gimple_thunk=true, so the thunk
> can never be made weak due to differing implementations between modules.
>
> Bootstrapped and tested on x86_64-linux-gnu, and committed to trunk.
>
> Regards
> Iain.
> ---
> gcc/d/ChangeLog:
>
> 	PR d/92216
> 	* decl.cc (make_thunk): Don't set TREE_PUBLIC on thunks if the target
> 	function is external to the current compilation.
>
> gcc/testsuite/ChangeLog:
>
> 	PR d/92216
> 	* gdc.dg/imports/pr92216.d: New.
> 	* gdc.dg/pr92216.d: New test.

this new testcase FAILs on 32-bit Solaris/SPARC and x86 (and, I suppose,
on every non-64-bit target):

+FAIL: gdc.dg/pr92216.d   -O0   scan-assembler _DT16_D7imports7pr922161B8__mixin24getSMFZPv[: \\t\\n]
+FAIL: gdc.dg/pr92216.d   -O0 -frelease   scan-assembler _DT16_D7imports7pr922161B8__mixin24getSMFZPv[: \\t\\n]
+FAIL: gdc.dg/pr92216.d   -O0 -frelease -g   scan-assembler _DT16_D7imports7pr922161B8__mixin24getSMFZPv[: \\t\\n]
+FAIL: gdc.dg/pr92216.d   -O0 -g   scan-assembler _DT16_D7imports7pr922161B8__mixin24getSMFZPv[: \\t\\n]

Same at -O[1-3s].  While the 64-bit version contains the expected

_DT16_D7imports7pr922161B8__mixin24getSMFZPv

the 32-bit one has

_DT8_D7imports7pr922161B8__mixin24getSMFZPv

I can't tell for certain if it's enough to allow for those two variants
or if more is needed.  Btw., I noticed that binutils 2.34 c++filt -s
dlang cannot demangle those symbols.  Is this expected?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

      reply	other threads:[~2020-03-17 20:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 22:08 Iain Buclaw
2020-03-17 20:50 ` Rainer Orth [this message]

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=ydda74eso3e.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=gcc-patches@gcc.gnu.org \
    /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).