public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47839] ICE in dwarf2out.c:add_AT_specification Date: Mon, 21 Feb 2011 17:14:00 -0000 [thread overview] Message-ID: <bug-47839-4-YUJKEqm0aS@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-47839-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47839 Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2011.02.21 17:04:46 Ever Confirmed|0 |1 --- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-02-21 17:04:46 UTC --- We merge the decls during symtab merging. The prevailing one looks for example like (gdb) call debug_tree (prevailing->decl) <var_decl 0x7ffff5b3b0a0 zstart type <integer_type 0x7ffff7ee3498 int public SI size <integer_cst 0x7ffff7ed36e0 constant 32> unit size <integer_cst 0x7ffff7ed33e8 constant 4> align 32 symtab 0 alias set -1 canonical type 0x7ffff7ee3498 precision 32 min <integer_cst 0x7ffff7ed3668 -2147483648> max <integer_cst 0x7ffff7ed3690 2147483647> pointer_to_this <pointer_type 0x7ffff7ef03f0>> used public static SI file mod.f90 line 2 col 0 size <integer_cst 0x7ffff7ed36e0 32> unit size <integer_cst 0x7ffff7ed33e8 4> align 32 context <namespace_decl 0x7ffff5b31678 globalvar_mod>> while the non-prevailing one is <var_decl 0x7ffff5b3b640 zstart type <integer_type 0x7ffff7ee3498 int public SI size <integer_cst 0x7ffff7ed36e0 constant 32> unit size <integer_cst 0x7ffff7ed33e8 constant 4> align 32 symtab 0 alias set -1 canonical type 0x7ffff7ee3498 precision 32 min <integer_cst 0x7ffff7ed3668 -2147483648> max <integer_cst 0x7ffff7ed3690 2147483647> pointer_to_this <pointer_type 0x7ffff7ef03f0>> used public ignored external SI file t.f90 line 4 col 0 size <integer_cst 0x7ffff7ed36e0 32> unit size <integer_cst 0x7ffff7ed33e8 4> align 32> note that it is public and external and has a NULL DECL_CONTEXT. The C frontend for a local extern declaration has <var_decl 0x7ffff5b481e0 i type <integer_type 0x7ffff7ee6498 int public SI size <integer_cst 0x7ffff7ed36e0 constant 32> unit size <integer_cst 0x7ffff7ed33e8 constant 4> align 32 symtab 0 alias set -1 canonical type 0x7ffff7ee6498 precision 32 min <integer_cst 0x7ffff7ed3668 -2147483648> max <integer_cst 0x7ffff7ed3690 2147483647> pointer_to_this <pointer_type 0x7ffff7ef7540>> used public external common SI defer-output file t.c line 8 col 15 size <integer_cst 0x7ffff7ed36e0 32> unit size <integer_cst 0x7ffff7ed33e8 4> align 32 context <function_decl 0x7ffff5b49000 foo>> thus puts it into function context. This decl is solely used for the BLOCK tree, in the function a public external global var is used (which is then merged with the static one from the other TU). void foo (void) { extern int i; i = 0; } --- int i; Simplified Fortran testcase: MODULE globalvar_mod integer :: xstop CONTAINS END MODULE globalvar_mod --- MODULE PEC_mod CONTAINS SUBROUTINE PECapply(Ex) USE globalvar_mod, ONLY : xstop real(kind=8), dimension(1:xstop), intent(inout) :: Ex END SUBROUTINE PECapply END MODULE PEC_mod it's important that PECapply is inside a module. The decl is built by gfc_get_symbol_decl and put into the function via gfc_add_decl_to_function - which is I think in general bogus for imported decls. Its context is later cleared in pushdecl, but the variable isn't removed from BLOCK_VARS. I think we want to avoid gfc_add_decl_to_function in the first place.
next prev parent reply other threads:[~2011-02-21 17:05 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-02-21 16:55 [Bug fortran/47839] New: " rguenth at gcc dot gnu.org 2011-02-21 16:56 ` [Bug fortran/47839] " rguenth at gcc dot gnu.org 2011-02-21 17:14 ` rguenth at gcc dot gnu.org [this message] 2011-02-22 11:56 ` rguenth at gcc dot gnu.org 2011-02-22 12:42 ` rguenth at gcc dot gnu.org 2011-02-24 10:35 ` rguenth at gcc dot gnu.org 2011-02-24 10:39 ` rguenth at gcc dot gnu.org
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=bug-47839-4-YUJKEqm0aS@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).