From patchwork Sat Feb 9 18:10:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1039265 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-495627-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="v5GY3J2S"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43xg8C1D5qz9sN1 for ; Sun, 10 Feb 2019 05:10:27 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=mLmxKQNiebO3F3xENj0qgsw8b6s41mzrEy30c7f5PgIYlQ2DUjuY0 oIspCYDupvRWxB+zWOl/QPFRyvf6MRL2zjF+bwuNhezhce/K/UDePOciRtoyUXCy WVSC1ohGNb5TOFCNCKZ2Rq/maUtWsiCcQC4mdEUyP8dQMxzqXiQEpU= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=thrx3gMBv0/jx4NYNxek5F6IVc4=; b=v5GY3J2SeNjaCqA8da6U 8ZUsmS5K/dQPC6QrUy9+StzB00BSmJNFs1Ta3rd1wHXf7xE6kWQG2Zh9Yole01Ly MSPVwxQkRegRrVNeH+cYuMjGZWnRygaRP9URpd47IVTK/ePx3w8wAjANlhTIlfHp N3hQnpBc8ambsHSKYrljdM4= Received: (qmail 80440 invoked by alias); 9 Feb 2019 18:10:20 -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 80429 invoked by uid 89); 9 Feb 2019 18:10:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.5 required=5.0 tests=BAYES_05, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=sk:type_ma, sk:TYPE_MA, 5152, 7, 51528 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 09 Feb 2019 18:10:19 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 19C76280E7E; Sat, 9 Feb 2019 19:10:17 +0100 (CET) Date: Sat, 9 Feb 2019 19:10:17 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix odr ICE on Ada LTO Message-ID: <20190209181017.wj4fyul5oqwtoplx@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, this patch fixes ICE in free_lang_data compiling lto8.adb. The fix is bit symptomatic becuase type_with_linkage_p should return false for Ada types. Perhaps adding explicit flag to DECL_NAME would make sense but it can wait for next stage1. The fix works because at this stage of free_lang_data all mangled names must be computed and thus it is cheper to test presence of DECL_ASSEMBLER_NAME anyway. Bootstrapped/regtested x86_64-linux, comitted. PR lto/87957 * tree.c (fld_simplified_type_name): Use DECL_ASSEMBLER_NAME_SET_P instead of type_with_linkage. Index: tree.c =================================================================== --- tree.c (revision 268722) +++ tree.c (working copy) @@ -5152,7 +5152,8 @@ fld_simplified_type_name (tree type) /* Drop TYPE_DECLs in TYPE_NAME in favor of the identifier in the TYPE_DECL if the type doesn't have linkage. this must match fld_ */ - if (type != TYPE_MAIN_VARIANT (type) || ! type_with_linkage_p (type)) + if (type != TYPE_MAIN_VARIANT (type) + || !DECL_ASSEMBLER_NAME_SET_P (TYPE_NAME (type))) return DECL_NAME (TYPE_NAME (type)); return TYPE_NAME (type); }