From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E8F823858425; Tue, 20 Dec 2022 12:34:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8F823858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671539685; bh=YQoy9DMNnWHPSeIIG8urDQnIpVgY9My6RPbfN5sMiM4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=V2rAN38CCBNPKc+ZL8M4CINJUGY20DUQ9vr8eN4EYhusnm89Yu2s+wZ6WaBrI/h/A +5HD/txtOoaUosV1KbILbc6A+06uq6oKI0/LnbbYtboM4kikSjYsIca9xDPQdTOQkQ Bvqb4+HY0eu4RMus/to+L0sl667BzbPwPHXGdR2Y= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/108183] wrong code generated in the modula2 scaffold mechanism Date: Tue, 20 Dec 2022 12:34:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: modula2 X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: assemble-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: gaius at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108183 --- Comment #6 from Iain Sandoe --- OK so it seems that the reason for the marking of these object to be static= is because that's what was requested, so the reason lies within the M2 symbol table and handling of imports ...=20 * frame #0: 0x000000010002e34e cc1gm2`::m2decl_BuildEndFunctionDeclaration(location_begin=3D0, location_en= d=3D0, name=3D"_M2_termios_ctor", returntype=3D0x0000000000000000, isexternal=3D0, isnested=3D0, ispublic=3D1) at m2decl.cc:219 frame #1: 0x00000001000757ad cc1gm2`::DeclareProcedureToGccSeparateProgram(Sym=3D6114) at M2GCCDeclare.c= :7504 frame #2: 0x0000000100075829 cc1gm2`::DeclareProcedureToGcc(sym=3D6114)= at M2GCCDeclare.c:7527 frame #3: 0x000000010007cf4f cc1gm2`::M2GCCDeclare_DeclareProcedure(sym=3D6114) at M2GCCDeclare.c:11648 frame #4: 0x0000000100057b36 cc1gm2`::Lists_ForeachItemInListDo(l=3D0x0000000106d00550, P=3DSymbolKey_PerformOperation @ 0x00007ffeefbff110) at Lists.c:393 frame #5: 0x00000001000d96c9 cc1gm2`::SymbolTable_ForeachProcedureDo(Sym=3D155, P=3DSymbolKey_PerformOpe= ration @ 0x00007ffeefbff150) at SymbolTable.c:14153 frame #6: 0x000000010007cf91 cc1gm2`::M2GCCDeclare_DeclareProcedure(sym=3D155) at M2GCCDeclare.c:11653 frame #7: 0x00000001000cd22a cc1gm2`::SearchAndDo(t=3D0x0000000106d0059= 0, P=3DSymbolKey_PerformOperation @ 0x00007ffeefbff1a0) at SymbolKey.c:242 frame #8: 0x00000001000cd21b cc1gm2`::SearchAndDo(t=3D0x0000000106c1bc0= 0, P=3DSymbolKey_PerformOperation @ 0x00007ffeefbff1c0) at SymbolKey.c:241 frame #9: 0x00000001000cd21b cc1gm2`::SearchAndDo(t=3D0x0000000106c1b4f= 0, P=3DSymbolKey_PerformOperation @ 0x00007ffeefbff1e0) at SymbolKey.c:241 frame #10: 0x00000001000cd21b cc1gm2`::SearchAndDo(t=3D0x0000000106c0c9= d0, P=3DSymbolKey_PerformOperation @ 0x00007ffeefbff200) at SymbolKey.c:241 frame #11: 0x00000001000cd21b cc1gm2`::SearchAndDo(t=3D0x0000000105f008= f0, P=3DSymbolKey_PerformOperation @ 0x00007ffeefbff220) at SymbolKey.c:241 frame #12: 0x00000001000cd717 cc1gm2`::SymbolKey_ForeachNodeDo(t=3D0x0000000105f00460, P=3DSymbolKey_PerformOperation @ 0x00007ffeefbff240) at SymbolKey.c:505 frame #13: 0x00000001000d9720 cc1gm2`::SymbolTable_ForeachModuleDo(P=3DSymbolKey_PerformOperation @ 0x00007ffeefbff268) at SymbolTable.c:14174 frame #14: 0x0000000100075c43 cc1gm2`::StartDeclareModuleScopeSeparate(scope=3D155) at M2GCCDeclare.c:7723 frame #15: 0x0000000100075e64 cc1gm2`::StartDeclareModuleScope(scope=3D= 155) at M2GCCDeclare.c:7799 frame #16: 0x000000010007ca52 cc1gm2`::M2GCCDeclare_StartDeclareScope(scope=3D155) at M2GCCDeclare.c:11442 frame #17: 0x000000010006b96d cc1gm2`::DoModuleDeclare() at M2Code.c:256 frame #18: 0x000000010006bed9 cc1gm2`::M2Code_Code() at M2Code.c:470 frame #19: 0x000000010006c760 cc1gm2`::Compile(s=3D0x0000000106c1ed80) = at M2Comp.c:211 frame #20: 0x000000010006d4db cc1gm2`::M2Comp_compile(filename=3D0x00007ffeefbffa6a) at M2Comp.c:760 frame #21: 0x00000001000454b7 cc1gm2`init_PerCompilationInit(filename=3D"/source/test/hello.mod") at init.cc:195 frame #22: 0x0000000100002115 cc1gm2`::gm2_parse_input_files(filenames=3D0x0000000106819cc0, filename_cou= nt=3D1) at gm2-lang.cc:451 frame #23: 0x0000000100002146 cc1gm2`::gm2_langhook_parse_file() at gm2-lang.cc:458 frame #24: 0x0000000101cc353a cc1gm2`::compile_file() at toplev.cc:444 frame #25: 0x0000000101cc6f7f cc1gm2`::do_compile(no_backend=3Dfalse) at toplev.cc:2125 frame #26: 0x0000000101cc74bd cc1gm2`toplev::main(this=3D0x00007ffeefbf= f4da, argc=3D37, argv=3D0x00007ffeefbff518) at toplev.cc:2277 frame #27: 0x000000010251ecd2 cc1gm2`main(argc=3D37, argv=3D0x00007ffee= fbff518) at main.cc:39=