From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37320 invoked by alias); 6 Oct 2015 13:35:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 37173 invoked by uid 48); 6 Oct 2015 13:35:30 -0000 From: "ramana at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/67868] New: [4.9/5/6 regression] ICE on targets with section anchors. Date: Tue, 06 Oct 2015 13:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ramana at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg00423.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67868 Bug ID: 67868 Summary: [4.9/5/6 regression] ICE on targets with section anchors. Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: ramana at gcc dot gnu.org Target Milestone: --- Given this testcase on targets with section anchors. I see the following ICE on arm, aarch64 and powerpc targets. $> cat /tmp/test.c char _vtable_map_vars_start [] __attribute__ ((__visibility__ ("protected"), used, aligned(4096), section(".vtable_map_vars"))) = { }; $> ./xgcc -B`pwd` -S -O2 /tmp/test.c /tmp/test.c:5:3: internal compiler error: Segmentation fault = { }; ^ 0xa95d6f crash_signal ../../gcc-fsf/gcc/toplev.c:353 0xd6faec tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gcc-fsf/gcc/tree.h:2863 0xd6faec default_elf_asm_named_section(char const*, unsigned int, tree_node*) ../../gcc-fsf/gcc/varasm.c:6303 0xd7191f switch_to_section(section*) ../../gcc-fsf/gcc/varasm.c:7144 0xd75603 output_object_block ../../gcc-fsf/gcc/varasm.c:7335 0xd75603 output_object_blocks() ../../gcc-fsf/gcc/varasm.c:7440 Please submit a full bug report, with preprocessed source if appropriate. The reason for the failure appears to be a failure to handle VAR_DECLS in default_elf_asm_named_section. Given that switch_to_section essentially passes a VAR_DECL or a FUNCTION_DECL into targetm.elf_asm_named_section while targetm.elf_asm_named_section only handles IDENTIFIER_NAMES in it, there is a clear mismatch in terms of what is passed and what is expected. I've got a patch that I'm currently testing.