The following code compile in gcc: class Foo { public: Foo() { } ~Foo() { } }; int main(int argc, char * argv) { Foo foo; return 0; } g++ testgcc.cpp -gcoff /cygdrive/f/TEMP/ccdnNbaT.s: Assembler messages: /cygdrive/f/TEMP/ccdnNbaT.s:1755: Fatal error: C_EFCN symbol out of scope Release: 3.2 20020927 (prerelease) released with cygwin Environment: PIII 550 Windows 2000
Hello, gcc 3.2 is rather old now. Would it be possible for you to check whether this problem is still present in gcc 3.3? Thanks, Dara
See Dara's question.
Hello. Just a reminder that this bug is in waiting. Have you had a chance to test gcc 3.3 yet for this problem? Thanks.
Confirmed with gcc 3.3 branch and mainline (20030711). No further feedback necessary.
Have the same bug here in gcc 3.3.x. /* forward declaration */ int Test(); void* Fnc = Test; int Test() { } Problem may be caused by forward declaration of function test.
Created attachment 5333 [details] This plain c source causes the same error message as c++ source. Only if variable Fnc is declared before function decleration the error is caused, otherwise not.
The problem is, that gcc produces 2 .def .endef blocks for the same function. (Is this allowed? At least ld don't want this!) Function i386_pe_file_end() in /gcc/config/i386/winnt.c shouldn't call i386_pe_declare_function_type() if -gcoff (SDB_DEBUG) is set. Commenting it out would solve this problem for the moment.
GCC 3.3.1 (cygming special) is ok.
The problem still exists with latest gcc 3.3.2 compiled as a cross compiler for i386-mingw32 from i686-pc-linux target.
This bug appears to still exists in mainline. When I compile the test case without optimization, I get both these lines .def _Test; .val _Test; .scl 2; .type 044; .endef .def _Test; .scl 3; .type 32; .endef The second line is incorrect. When it happens to be emitted first, it doesn't matter. When it is emitted second, it does matter. The note closing this PR says "GCC 3.3.1 (cygming special) is ok." Does the "cygming special" refer to a patched compiler?
Patch here: http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02460.html
Subject: Bug 9963 CVSROOT: /cvs/gcc Module name: gcc Changes by: ian@gcc.gnu.org 2005-04-05 04:08:57 Modified files: gcc : ChangeLog gcc/config/i386: cygming.h i386-protos.h winnt.c Log message: PR debug/9963 * config/i386/cygming.h (ASM_OUTPUT_EXTERNAL): Pass DECL to i386_pe_record_external_function. (i386_pe_record_external_function): Update declaration. * config/i386/winnt.c (struct extern_list): Add decl field. (i386_pe_record_external_function): Add decl parameter. (i386_pe_file_end): Check TREE_ASM_WRITTEN on decl, not identifier. * config/i386/i386-protos.h (i386_pe_record_external_function): Update declaration. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8135&r2=2.8136 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/cygming.h.diff?cvsroot=gcc&r1=1.25&r2=1.26 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386-protos.h.diff?cvsroot=gcc&r1=1.133&r2=1.134 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/winnt.c.diff?cvsroot=gcc&r1=1.77&r2=1.78
Fixed on mainline.