public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: "Raoul Gough" <RaoulGough@yahoo.co.uk>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/6771: no code emitted for locally unused class with dllexport attribute
Date: Fri, 24 May 2002 05:46:00 -0000	[thread overview]
Message-ID: <20020524124608.9425.qmail@sources.redhat.com> (raw)

The following reply was made to PR c++/6771; it has been noted by GNATS.

From: "Raoul Gough" <RaoulGough@yahoo.co.uk>
To: <gcc-gnats@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>
Cc:  
Subject: Re: c++/6771: no code emitted for locally unused class with dllexport attribute
Date: Fri, 24 May 2002 13:45:30 +0100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=6771
 
 I have some more information regarding this dllexport problem (and
 a quick and dirty fix for my system). I hope this is the right way to
 submit additional information...
 
 I've determined that the problematic member function (foofunction) is
 having comdat_flag set (I believe erroneously) in decl2.c via the
 import_export_decl function (called from finish_file in the first
 deferred_fns loop). According the the comments in tree.h, comdat_flag
 should be set for entities "guaranteed to be generated by any
 translation unit that needs them, and therefore need not be put out
 anywhere where they are not needed", which is clearly not the case
 here (member function of a class with attribute dllexport). So I just
 hacked the comdat_linkage function as follows, and the problem went
 away :-)
 
 /cygdrive/d/gcc/CVS/gcc/gcc/cp $ diff decl2.c~ decl2.c
 2183c2183
 <   if (DECL_LANG_SPECIFIC (decl))
 ---
 >   if (DECL_LANG_SPECIFIC (decl) && !i386_pe_dllexport_p (decl))
 
 (diff with decl2.c CVS:1.520.2.5)
 
 This generates an "implicit declaration" warning, and is only suitable
 for systems that use config/i386/winnt.c. I'm sure this is not the
 right way to fix it, because comdat_linkage should probably never get
 called on a dllexport'd member function - maybe a better fix would be
 to clear DECL_DECLARED_INLINE_P at some stage?
 
 I'm willing to spend some more time on this (and possibly any other
 open bugs within my abilities), but would need a bit of advice on
 producing a legitimate fix.
 
 Regards,
 Raoul Gough.
 
 
 PS: I've upgraded via CVS to gcc_latest_snapshot (gcc_ss_20020521) and
 the problem is unchanged. Also, setting the -fno-default-inline flag
 fixes the problem for the export case, but crashes the compiler for
 the import case:
 
 /cygdrive/f/Users/Raoul/cxx $ /usr/local/bin/g++ -c
 dllexport.cc -fno-default-inline -save-temps
 dllexport.cc: In member function `void bar::barfunction()':
 dllexport.cc:26: Internal compiler error in rest_of_compilation, at
 toplev.c:
    3478
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
 
 This would otherwise be a temporary work-around for the original problem.
 
 
 
 _________________________________________________________
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com
 


             reply	other threads:[~2002-05-24 12:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-24  5:46 Raoul Gough [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-05-01 16:56 Giovanni Bajo
2002-11-25 14:36 Raoul Gough
2002-05-22 10:16 RaoulGough

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=20020524124608.9425.qmail@sources.redhat.com \
    --to=raoulgough@yahoo.co.uk \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@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).