From patchwork Sun Dec 1 12:18:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 295682 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 860BD2C0095 for ; Sun, 1 Dec 2013 23:24:58 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=iiz9wwA5nmQv1HHK BRFcof4+82nyrE2KmUB7vIfHQsEFOAeN7xFjp2EMwotn2naGvEtn8/AjZXlwLll4 hEngCtUO60qZtS6IHWcHf8292pnaiDp04XNklMtXD8is5Out/+nIH93R1lIgzxOM 8WybLPmLkiybg2lqXHqSgw+gqpw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=Th81RglUsQgXKXNaFr093c iGgv8=; b=buqAyjKaNVlmPRNxboNvQZfv21Ipy5G28ftbmWzeOaOWDrWHVfMddk sEJBF+48dStzErhxQGdyvhWs/oVN7IrFjfoiuSXbGU23fPtWVxgYakl9uvCy5Nq8 VRRdIz5acySRg6I9d6hETNi3wPUodfgwjSZ1pNvL5RFLAVA+/UTtg= Received: (qmail 19195 invoked by alias); 1 Dec 2013 12:24:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 19169 invoked by uid 89); 1 Dec 2013 12:24:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL, BAYES_50, RDNS_NONE, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from Unknown (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 01 Dec 2013 12:23:25 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id A0B5A26C010B for ; Sun, 1 Dec 2013 13:23:16 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1XlHrR1GpeSn for ; Sun, 1 Dec 2013 13:23:16 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 8129426C001E for ; Sun, 1 Dec 2013 13:23:16 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix -g3 on Windows Date: Sun, 01 Dec 2013 13:18:36 +0100 Message-ID: <2225321.oc0fT1EooQ@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; ) MIME-Version: 1.0 Any compiler configured to target Windows with tree checking breaks on -g3: eric@polaris:~/gnat/bugs/MB28-035> ~/build/gcc/i686-pc-mingw32/gcc/cc1 -quiet -g3 t.c t.c:1:0: internal compiler error: tree check: expected tree that contains 'decl common' structure, have 'identifier_node' in i386_pe_asm_named_section, at config/i386/winnt.c:569 Without tree checking, e.g. on release branches, you get sometimes a segfault. The reason is that i386_pe_asm_named_section takes DECL_ATTRIBUTES of an IDENTIFIER_NODE. The latter is valid here, see default_elf_asm_named_section. This is a (somewhat old) regression, tested on i686-pc-mingw32, applied on all active branches as obvious. 2013-12-01 Eric Botcazou * config/i386/winnt.c (i386_pe_asm_named_section): Be prepared for an identifier node. Index: config/i386/winnt.c =================================================================== --- config/i386/winnt.c (revision 205562) +++ config/i386/winnt.c (working copy) @@ -565,8 +565,9 @@ i386_pe_asm_named_section (const char *n sets 'discard' characteristic, rather than telling linker to warn of size or content mismatch, so do the same. */ bool discard = (flags & SECTION_CODE) - || lookup_attribute ("selectany", - DECL_ATTRIBUTES (decl)); + || (TREE_CODE (decl) != IDENTIFIER_NODE + && lookup_attribute ("selectany", + DECL_ATTRIBUTES (decl))); fprintf (asm_out_file, "\t.linkonce %s\n", (discard ? "discard" : "same_size")); }