From patchwork Wed Jun 10 15:24:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 482741 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 8681D140285 for ; Thu, 11 Jun 2015 01:25:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=JibBmxCj; dkim-atps=neutral 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:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=Z08pNFH862idzR+L0SsbZo48x2NRSXmKrprZP1g8jwoeFKGZFVeE8 8IbATQES2h1dmhZXcXvXot9XG3XMWPLkolb6UQ09RhMVkl43nAKJjsItHezIi+2N 5kn4tEeymng4EgJTfskmf4N++dVBRQ7p3ZiQo/ixHfiQuI1MejlCa0= 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:cc:subject:date:message-id:in-reply-to:references; s= default; bh=UJz3K5Agl2RADyzwdJ7AVpTOGDE=; b=JibBmxCjZykzyf5DMwMk +ZOTehg+xpfIbybqvPWA0vDzWOqk7j0pVtXFiymAFVXqFyUm92V/CE5pzCVmm4jR A9bTCQG62baYMxsF6HQyInoA+LpN4Hpq2s46/mxd/TyEQyL/TdJQC3wegr6ee9aE Igmklee+H3fIxcZX2sRaM/c= Received: (qmail 114068 invoked by alias); 10 Jun 2015 15:25:49 -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 114058 invoked by uid 89); 10 Jun 2015 15:25:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 10 Jun 2015 15:25:47 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2heE-0000Q3-7l for gcc-patches@gcc.gnu.org; Wed, 10 Jun 2015 11:10:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2heE-0000Ng-1T for gcc-patches@gcc.gnu.org; Wed, 10 Jun 2015 11:10:34 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id E668D36B385 for ; Wed, 10 Jun 2015 15:10:33 +0000 (UTC) Received: from c64.redhat.com (vpn-230-17.phx2.redhat.com [10.3.230.17]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5AFAMM3007589; Wed, 10 Jun 2015 11:10:33 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 17/17] toplev.c: move location_adhoc_data_fini call Date: Wed, 10 Jun 2015 11:24:58 -0400 Message-Id: <1433949898-22033-18-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1433949898-22033-1-git-send-email-dmalcolm@redhat.com> References: <1433949898-22033-1-git-send-email-dmalcolm@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-IsSubscribed: yes test-functions.c: representation_test.building_cfg and others need the call to location_adhoc_data_fini to happen later, otherwise we get a segfault inside gimple_set_block here due to the adhoc-location data being finalized: #0 0x0000000000687800 in ?? () #1 0x00007ffff7504c22 in htab_find_slot (htab=0x6627a0, element=0x7fffffffde90, insert=INSERT) at ../../src/libiberty/hashtab.c:704 #2 0x00007ffff74c0de5 in get_combined_adhoc_loc (set=0x7ffff7ffa000, locus=, data=) at ../../src/libcpp/line-map.c:128 #3 0x00007ffff73cb047 in COMBINE_LOCATION_DATA (block=, loc=, set=) at ../../src/gcc/../libcpp/include/line-map.h:794 #4 gimple_set_block (g=, block=) at ../../src/gcc/gimple.h:1636 #5 lower_stmt (data=0x7fffffffdfa0, gsi=0x7fffffffdf00) at ../../src/gcc/gimple-low.c:260 #6 lower_sequence (seq=seq@entry=0x7fffefa310b8, data=data@entry=0x7fffffffdfa0) at ../../src/gcc/gimple-low.c:227 #7 0x00007ffff73caeef in lower_gimple_bind (gsi=gsi@entry=0x7fffffffdfc0, data=data@entry=0x7fffffffdfa0) at ../../src/gcc/gimple-low.c:441 #8 0x00007ffff73cc675 in lower_function_body () at ../../src/gcc/gimple-low.c:131 #9 (anonymous namespace)::pass_lower_cf::execute (this=) at ../../src/gcc/gimple-low.c:205 #10 0x0000000000414030 in (anonymous namespace)::representation_test::build_cfg (this=0x66c520, fndecl=0x7fffefa43ee0) at ../../src/gcc/unittests/test-functions.c:293 #11 0x000000000041787d in (anonymous namespace)::representation_test_building_cfg_Test::TestBody (this=0x66c520) at ../../src/gcc/unittests/test-functions.c:501 #12 0x00007ffff7dcf323 in void testing::internal::HandleExceptionsInMethodIfSupported(testing::Test*, void (testing::Test::*)(), char const*) () from /lib64/libgtest.so.0 #13 0x00007ffff7dc4b67 in testing::Test::Run() () from /lib64/libgtest.so.0 #14 0x00007ffff7dc4c0e in testing::TestInfo::Run() () from /lib64/libgtest.so.0 #15 0x00007ffff7dc4d15 in testing::TestCase::Run() () from /lib64/libgtest.so.0 #16 0x00007ffff7dc83a8 in testing::internal::UnitTestImpl::RunAllTests() () from /lib64/libgtest.so.0 #17 0x00007ffff7dc8647 in testing::UnitTest::Run() () from /lib64/libgtest.so.0 #18 0x00000000004369cb in main (argc=1, argv=0x7fffffffe478) at ../../src/gcc/unittests/unittests-main.c:107 gcc/ChangeLog: * toplev.c (toplev::main): Move call of location_adhoc_data_fini from here... (toplev::finalize): ...to here. --- gcc/toplev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/toplev.c b/gcc/toplev.c index 3b57b48..ca2c18c 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2194,7 +2194,6 @@ toplev::main (int argc, char **argv) diagnostic_finish (global_dc); finalize_plugins (); - location_adhoc_data_fini (line_table); if (seen_error () || werrorcount) return (FATAL_EXIT_CODE); @@ -2230,4 +2229,6 @@ toplev::finalize (void) g = NULL; obstack_free (&opts_obstack, NULL); + + location_adhoc_data_fini (line_table); }