From patchwork Thu Feb 19 10:50:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 441564 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3DCFF14012A for ; Thu, 19 Feb 2015 21:50:17 +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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=WtTVP6qxoXfA2za67 PpoeYM/WQU6K9Wy069NZ+Ri/xs337dVkNRmfwblrFMZPr7zV2WQN9nW9SWLkRZN3 WufysFPSovdOClOC80WgaeBQ0k0vZ+dAYdqUDaWQ2Dslg3MPmDyt2JrnDIeB1R+J UPGDClfr8Eqsu/w/m7tgvv3WYg= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=XTlvejz+2p/TOkE0iSk05sg ZIhw=; b=aGMORxIxShpgUJNio8p7rr30c70H2wUuZAZOH9nwpfPdfVK26OFD8Da phijQ9dhEZvB/Us3aC1CZKgm2qBhU5pfIBow7m3sKR2kyI15W8wp/GHvZ0WFi5H/ qLQO86hwjYCQe4NvGKokmvK37u7uGcTB8jvl/SdIF2DCnmKWDRtU= Received: (qmail 13781 invoked by alias); 19 Feb 2015 10:50:10 -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 13769 invoked by uid 89); 19 Feb 2015 10:50:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Feb 2015 10:50:09 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-04.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1YOOgH-0001rE-KT from Tom_deVries@mentor.com ; Thu, 19 Feb 2015 02:50:05 -0800 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-04.mgc.mentorg.com (137.202.0.110) with Microsoft SMTP Server id 14.3.224.2; Thu, 19 Feb 2015 10:50:03 +0000 Message-ID: <54E5BFD9.9010305@mentor.com> Date: Thu, 19 Feb 2015 11:50:01 +0100 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jakub Jelinek , Richard Biener CC: GCC Patches , Michael Matz Subject: [PATCH][1/5] Disable lang_hooks.gimplify_expr in free_lang_data References: <54E5BB06.2080102@mentor.com> In-Reply-To: <54E5BB06.2080102@mentor.com> On 19-02-15 11:29, Tom de Vries wrote: > Hi, > > I'm posting this patch series for stage1: > - 0001-Disable-lang_hooks.gimplify_expr-in-free_lang_data.patch > - 0002-Add-gimple_find_sub_bbs.patch > - 0003-Factor-optimize_va_list_gpr_fpr_size-out-of-pass_std.patch > - 0004-Handle-internal_fn-in-operand_equal_p.patch > - 0005-Postpone-expanding-va_arg-until-pass_stdarg.patch > > The patch series - based on Michael's initial patch - postpones expanding va_arg > until pass_stdarg, which makes pass_stdarg more robust. > > Bootstrapped and reg-tested on x86_64 using all languages, with unix/ and > unix/-m32 testing. > > I'll post the patches in reply to this email. > This patch disables lang_hooks.gimplify_expr in free_lang_data. I ran into a situation ( mentioned here: https://gcc.gnu.org/ml/gcc/2015-02/msg00074.html ) where gimplify_expr was called during pass_stdarg, which called cp_gimplify_expr, which called is_really_empty_class, which tried to access some language data (TYPE_BINFO) that was already freed, which caused a segmentation fault. This patch fixes that. OK for stage1? Thanks, - Tom 2015-02-17 Tom de Vries * tree.c (free_lang_data): Disable lang_hooks.gimplify_expr. --- gcc/tree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/tree.c b/gcc/tree.c index 29f70f8..94b7c56 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5815,6 +5815,8 @@ free_lang_data (void) still be used indirectly via the get_alias_set langhook. */ lang_hooks.dwarf_name = lhd_dwarf_name; lang_hooks.decl_printable_name = gimple_decl_printable_name; + lang_hooks.gimplify_expr = lhd_gimplify_expr; + /* We do not want the default decl_assembler_name implementation, rather if we have fixed everything we want a wrapper around it asserting that all non-local symbols already got their assembler -- 1.9.1