From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117149 invoked by alias); 11 Oct 2016 08:05:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 117125 invoked by uid 89); 11 Oct 2016 08:05:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=sk:build_o, 2016-10-11, 20161011, upcoming X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Oct 2016 08:05:48 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id C6CFB81338; Tue, 11 Oct 2016 10:05:45 +0200 (CEST) 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 WYunUYcXrlSq; Tue, 11 Oct 2016 10:05:45 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 2E90D812DB; Tue, 11 Oct 2016 10:05:45 +0200 (CEST) From: Eric Botcazou To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: [patch] Fix GC issue triggered by arithmetic overflow checking Date: Tue, 11 Oct 2016 08:05:00 -0000 Message-ID: <15117688.tMJrzIrphz@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-42-desktop; KDE/4.14.9; x86_64; ; ) In-Reply-To: References: <1863165.r8qPLI7fxq@polaris> <2004625.PcKOVMIpSq@polaris> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart2803622.eyLQmPeVhz" Content-Transfer-Encoding: 7Bit X-SW-Source: 2016-10/txt/msg00682.txt.bz2 This is a multi-part message in MIME format. --nextPart2803622.eyLQmPeVhz Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Content-length: 700 > I think only the calls in build_common_tree_nodes -- those are the ones > built early and that survive GC. The patch is ok if it passes testing > with that. Here's what I have installed, after bootstrap/regtesting on x86-64/Linux and SPARC/Solaris (with the upcoming overflow checking support). I'll try and dig deeper into the var-tracking instability. 2016-10-11 Eric Botcazou * tree.h (build_complex_type): Add second parameter with default. * tree.c (build_complex_type): Add NAMED second parameter and adjust recursive call. Create a TYPE_DECL only if NAMED is true. (build_common_tree_nodes): Pass true in calls to build_complex_type. -- Eric Botcazou --nextPart2803622.eyLQmPeVhz Content-Disposition: attachment; filename="p.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="p.diff" Content-length: 2694 Index: tree.c =================================================================== --- tree.c (revision 240962) +++ tree.c (working copy) @@ -8752,10 +8752,15 @@ build_offset_type (tree basetype, tree t return t; } -/* Create a complex type whose components are COMPONENT_TYPE. */ +/* Create a complex type whose components are COMPONENT_TYPE. + + If NAMED is true, the type is given a TYPE_NAME. We do not always + do so because this creates a DECL node and thus make the DECL_UIDs + dependent on the type canonicalization hashtable, which is GC-ed, + so the DECL_UIDs would not be stable wrt garbage collection. */ tree -build_complex_type (tree component_type) +build_complex_type (tree component_type, bool named) { tree t; inchash::hash hstate; @@ -8782,11 +8787,11 @@ build_complex_type (tree component_type) SET_TYPE_STRUCTURAL_EQUALITY (t); else if (TYPE_CANONICAL (component_type) != component_type) TYPE_CANONICAL (t) - = build_complex_type (TYPE_CANONICAL (component_type)); + = build_complex_type (TYPE_CANONICAL (component_type), named); } /* We need to create a name, since complex is a fundamental type. */ - if (! TYPE_NAME (t)) + if (!TYPE_NAME (t) && named) { const char *name; if (component_type == char_type_node) @@ -10372,10 +10377,11 @@ build_common_tree_nodes (bool signed_cha SET_TYPE_MODE (dfloat128_type_node, TDmode); dfloat128_ptr_type_node = build_pointer_type (dfloat128_type_node); - complex_integer_type_node = build_complex_type (integer_type_node); - complex_float_type_node = build_complex_type (float_type_node); - complex_double_type_node = build_complex_type (double_type_node); - complex_long_double_type_node = build_complex_type (long_double_type_node); + complex_integer_type_node = build_complex_type (integer_type_node, true); + complex_float_type_node = build_complex_type (float_type_node, true); + complex_double_type_node = build_complex_type (double_type_node, true); + complex_long_double_type_node = build_complex_type (long_double_type_node, + true); for (i = 0; i < NUM_FLOATN_NX_TYPES; i++) { Index: tree.h =================================================================== --- tree.h (revision 240962) +++ tree.h (working copy) @@ -4042,7 +4042,7 @@ extern tree build_varargs_function_type_ extern tree build_method_type_directly (tree, tree, tree); extern tree build_method_type (tree, tree); extern tree build_offset_type (tree, tree); -extern tree build_complex_type (tree); +extern tree build_complex_type (tree, bool named = false); extern tree array_type_nelts (const_tree); extern tree value_member (tree, tree); --nextPart2803622.eyLQmPeVhz--