From patchwork Fri Nov 10 16:02:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoni Boucher X-Patchwork-Id: 163798 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp1211307vqs; Fri, 10 Nov 2023 08:02:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5jebUnWMvhy5wAm9+CgAHsugUjfMesktFQh1H0MpzVXF+JkW5US1Jv0DVvE6qMnoHLaNW X-Received: by 2002:ad4:4a70:0:b0:66d:81bb:5234 with SMTP id cn16-20020ad44a70000000b0066d81bb5234mr3736888qvb.11.1699632175290; Fri, 10 Nov 2023 08:02:55 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1699632175; cv=pass; d=google.com; s=arc-20160816; b=w6t966RAKfsh/PwxUm0uIwJb+aiKQvKlLo7sPWGfOON7AKKRMnrSlYf11ukl52DcJ3 HTvF4z5uwQD3BYhwPXwbMicBXnrgb051qj3ISyumkL6tVMCm6LInNM60ntcZ6oUdzHDM kW+Ty0cONsCQv+tk2+CDWaz+4dv5ToXUt70Nfwgv/Wzz6tWV2nTceHY2JE5lYdV1N6aB uqC4q7M2YIO2qiM13XmcTbfPYLkm5DL7CmwL38asemRpLyctVteWX654Po+D72x0d3Fm 1+3+L7GHIJNTCUY1HyzGip14hM14eLr5G0UYwZBW2XDvHLs6HoO2wru2YSQYR2fpMpH/ IIdQ== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id:mime-version :user-agent:autocrypt:date:cc:to:from:subject:message-id :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=PkEtH9u5CfWOagdhx13/8T86J1SLCoj9mdXWjK/qL4U=; fh=JISpz+bBSU4NvpZkyVsds76plEm8twWz26DY1VOoDBc=; b=Sd52xWxe4Ph+Ns3w2qSqwU/k2z1JLuT+ha2Q4rXoFIUjYxui7lXr1xl3HtEbn5RW3V ZWf/5VIaX86sdy7cXzVPOF9vJoN0arT0RAqZGjaByUuEPRG2yxQHJVhmB8Tx9PF70AHb aMf+svY7X5h7g+JRE3umqk9DiBhi21Q21MqzEjlki/m+FqsOaVQUPtg0IzwB2KdlKVRi 92xMK9+Sii0G2MGRj7KFLCACNyOV8pQnh8zxy1QH1Gh8HfKOxmpmzFoPWOU8JTu1L/GS SY9H/znemzCZ/nw8ndvGEYKt7kPEToZKdiSOoajP/MRFMejSvDrAsARr3gDNNzX8iCfv 4s+Q== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@zoho.com header.s=zm2022 header.b=VNbSS2CF; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zoho.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id pm19-20020ad446d3000000b0065b2e14c1c3si4837471qvb.463.2023.11.10.08.02.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 08:02:55 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@zoho.com header.s=zm2022 header.b=VNbSS2CF; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zoho.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BDDA3857352 for ; Fri, 10 Nov 2023 16:02:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from sender3-pp-o98.zoho.com (sender3-pp-o98.zoho.com [136.143.184.98]) by sourceware.org (Postfix) with ESMTPS id B2A6A3858D38; Fri, 10 Nov 2023 16:02:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B2A6A3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=zoho.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zoho.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B2A6A3858D38 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=136.143.184.98 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1699632147; cv=pass; b=IQF72wLyDG0DhizGkON3bhgvlD+FzCBqdEY9gRbVahkvg8DteZBL4e76/leW1ZlPW0zVgdoCbYXJmFj7YanmoBrwnIvz/gd0stoHvAJlUXcV79qR6j48C3S9uaW2+ONGB8siJVu3HHRStIHTFCbsZqW4ScV/HKAjaNCsT6W+lsc= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1699632147; c=relaxed/simple; bh=EO2Uf1cM+P/OB7j9KUONSoQ4pHIG1G3TgR5JGl6Luo8=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=CT01rRG8Dke/DhElA33QtOSpizXCIHRLjtGtno3rg1nxJUpTUWxaA1fiHW0CFymEbtBvws/jkJhVgHsBClDcRglVsxgAhJnjb1q7LK8vIOtBIvSZ9B0Xzzna852fIe23OnVTDggZmF5M2UuIRT9BOvRGzLop9gyJ2b+jcoUAW4Q= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; t=1699632140; cv=none; d=zohomail.com; s=zohoarc; b=Xv3BBd28I+C9vKzG9Srst8rBx9CZ53580eEAw2dhNvpV2lwwm5rIdNgF2uQ1mQyblk7tVjxDZ6/yupd9DBzjbOOFvgTboIZ1woxvdO/N+X4Cbb/y+/p2Q9DjizHwzFE//F6+JXAKalocCT5XvObDXMQ3Uu4dYEV7I4uzZsiCTY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699632140; h=Content-Type:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=PkEtH9u5CfWOagdhx13/8T86J1SLCoj9mdXWjK/qL4U=; b=UjVjjxbQzjGQ0zViT8PA97dxJV+pMm8GVjZjpNK07lKmpk9BVjFGhOyfSqpA6Qw2SqeS4K6Fi2WnCN7XzmRjannmzrj+baVLbp3/tXWediRxgbKtRkJicm21yV4Nd0KHb0OOKAcggt9o3FP8M5TxYtOPIy5dkB2KwaOwaeyhD3A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=bouanto@zoho.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1699632140; s=zm2022; d=zoho.com; i=bouanto@zoho.com; h=Message-ID:Subject:Subject:From:From:To:To:Cc:Cc:Date:Date:Content-Type:MIME-Version:Feedback-ID:Message-Id:Reply-To; bh=PkEtH9u5CfWOagdhx13/8T86J1SLCoj9mdXWjK/qL4U=; b=VNbSS2CF5nkvOpp0AHRJbgFyzTF/Z40ESFJDQsxRacAFjv+i1w4//kaIxEqPFALp 2Y1SL46gs3z8xfTuNifkLp9RmxO4Id9pZl3Aj4Pbyt2RApq6V8Ytr8XI9PC/+i28E6l KpDUlAUuLumBqOEid9IUbzn08LBcxLkkQeFsyPuo= Received: from [192.168.1.172] (38.87.11.6 [38.87.11.6]) by mx.zohomail.com with SMTPS id 1699632139081286.91489605340666; Fri, 10 Nov 2023 08:02:19 -0800 (PST) Message-ID: Subject: [PATCH] libgccjit: Fix GGC segfault when using -flto From: Antoni Boucher To: jit@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: David Malcolm Date: Fri, 10 Nov 2023 11:02:17 -0500 Autocrypt: addr=bouanto@zoho.com; prefer-encrypt=mutual; keydata=mQENBFOSMLQBCADO5aw6Ys8thMQUNzrwAnfJX2wbgWiz0pQ01DjYj22eeIpChkoZn6LWdt4dieq30u2rFi/yQzJ02foHwI2+aL9rU6xz/x4TwqyRJQGMOqklNc3R+pdXmH4WDQkQDWmLxvc07vu+zb8Tx5A6pMDh4J2ncCEhLEUcH39Yq/yg4eBnFwUX6N7kakvHrnScGNqhnSFCacoJeMJUAR+1G7VBSBd++jmnHLnx3mj7QkRZVECJUw2zqiv1yReCC6GU4SvqLjdqm5ZGeoWOqD/NHjBRoEeOVjzp6M/qOjjWRbkJVqmvgfcD8UytSSqqboR35YFT4L+rZt2ri3T12MJb3i5syCAXABEBAAG0IUFudG9uaSBCb3VjaGVyIDxib3VhbnRvQHpvaG8uY29tPokBVgQTAQgAQAIbIwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAFiEEOELC4Uw1Jeb66YE6RVeGAwR4zcEFAlz4QM4FCRLMEZoACgkQRVeGAwR4zcFBQQf/afttJrA/puADQZhrDfkgr0MFvq6iB+GCy1b8BkXimk1TOXTPt87YLehSeijNu3JkYhl5eRc87BNfU9J87KfI/KIy6hZxqlDXk16FhW9bw/7wYEA0hpb3MUn7xLElXDT0ZHaD+KTe8Oun7qfzgx5RlL6r/WODf3CkSpO085R/rfeBqDEx9mVlhDWgq6Az3CZoD+3CqiCKVqmDuHTWz4kwrd9AM5eVcLvvLKnZIdoIp+G5Ao6BvaGlZyfenN1iOSjLy2NXNt4MnUt0lUYEP5KSIIRhHQ8xkUbj7eWUmaahkxhNb3fH3sAPwGnRZrPpb4rgYzNmSk63wWMh9M2xk+rLb7kBDQRTkjC0AQgAumZzsAV/UFWI+dpzebQfma36kKYZZFuseant5sq/HWP553XQ/U6ttJiKyN5MpCqtxvCAoRplf42YhlHuFqgf73WJxoJ6Y+sdyqoBSwlR+ gzAneAmsa8gmmY0wawH0Z2leazjKuS7mJjVEQZg0ZGsiCVRGeRnDqFGzDEzDc9ngWKSoTq0fKzlGy1X85OrtmUrvEbhSo6HP+FoeunHkIqrxu3w3vDoFEXxVQlKI6V3I4nCz5n6DB8WR3L7nsiiTnOiGirPw1ngvWFLW86kkA4FJpayc8Xl3va3SLY+2y4yuROboX2DVI4AC/Qeug/mDiBicPxkP6YfUartQRMe6obkEQARAQABiQE8BBgBCAAmAhsMFiEEOELC4Uw1Jeb66YE6RVeGAwR4zcEFAlz4QRsFCRLMEecACgkQRVeGAwR4zcE56ggAgTgrJInBKC+7552Dpccuo6Clh3wZfjlNLv9/6r5lKEbaNzaTrfhPiAP4WgnluIUmj8amOFLFJpj+BAVNOXpZ4D2R3o9ch8z7fot+fW4Yw+PKIxH4I2xEys8ndoEB3aiQwHjKcGIhkIU7uyMJFQr2aWjdTY0gmXw0YZueHOSLgo7uX4XKxB8fEO/yto/Tff2YBAAq+AtNwt+Gh5YS9rZw7rwUTWMi84yVOlc+zRE79E9NJkvdTwX7IJYo64VzIRNfgHsn7QNdVzuM1XIFHl+Glk6cIlI8s6BO7nEoCn3hTF104fQTAO3fEs+XXZOKXo2lk8faowEoPq5r58StrV0nyg== User-Agent: Evolution 3.50.1 MIME-Version: 1.0 X-Zoho-Virus-Status: 1 Feedback-ID: rr080112280e78616c7daeb907812c91dd0000d40868e1c97d516804eb4ccc306ba1fb0f4079ba10f198f897c0:zu080112265db1c6057b56b14528bd6cbe0000ffcd57bd2915f8ccd03e048c78d2feda42f2142c0c06bf35:rf0801123249b89e0a7c7ef26fc8376e890000a64031560f2a45b8b4add9a0fccca39b1a90ce1d5cb0e179879dd2b36cecea1f68d3fca5:ZohoMail X-ZohoMailClient: External X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782193507852169680 X-GMAIL-MSGID: 1782193507852169680 Hi. This patch fixes the segfault when using -flto with libgccjit (bug 111396). You mentioned in bugzilla that this didn't fix the reproducer for you, but it does for me. At first, the test case would not pass, but running "make install" made it pass. Not sure if this is normal. Could you please check if this fixes the issue on your side as well? Since this patch changes files outside of gcc/jit, what tests should I run to make sure it didn't break anything? Thanks for the review. From f26d0f37e8d83bce1f5aa53c393961a8bd518d16 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Fri, 10 Nov 2023 09:52:32 -0500 Subject: [PATCH] libgccjit: Fix GGC segfault when using -flto gcc/ChangeLog: PR jit/111396 * ipa-fnsummary.cc (ipa_fnsummary_cc_finalize): Call ipa_free_size_summary. * ipa-icf.cc (ipa_icf_cc_finalize): New function. * ipa-profile.cc (ipa_profile_cc_finalize): New function. * ipa-prop.cc (ipa_prop_cc_finalize): New function. * ipa-prop.h (ipa_prop_cc_finalize): New function. * ipa-sra.cc (ipa_sra_cc_finalize): New function. * ipa-utils.h (ipa_profile_cc_finalize, ipa_icf_cc_finalize, ipa_sra_cc_finalize): New functions. * toplev.cc (toplev::finalize): Call ipa_icf_cc_finalize, ipa_prop_cc_finalize, ipa_profile_cc_finalize and ipa_sra_cc_finalize Include ipa-utils.h. gcc/testsuite/ChangeLog: PR jit/111396 * jit.dg/all-non-failing-tests.h: Add new test-ggc-bugfix. * jit.dg/test-ggc-bugfix.c: New test. --- gcc/ipa-fnsummary.cc | 1 + gcc/ipa-icf.cc | 9 ++++++ gcc/ipa-profile.cc | 10 ++++++ gcc/ipa-prop.cc | 18 +++++++++++ gcc/ipa-prop.h | 2 ++ gcc/ipa-sra.cc | 12 +++++++ gcc/ipa-utils.h | 7 ++++ gcc/testsuite/jit.dg/all-non-failing-tests.h | 12 ++++++- gcc/testsuite/jit.dg/test-ggc-bugfix.c | 34 ++++++++++++++++++++ gcc/toplev.cc | 5 +++ 10 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/jit.dg/test-ggc-bugfix.c diff --git a/gcc/ipa-fnsummary.cc b/gcc/ipa-fnsummary.cc index a2495ffe63e..34e011c4b50 100644 --- a/gcc/ipa-fnsummary.cc +++ b/gcc/ipa-fnsummary.cc @@ -5090,4 +5090,5 @@ void ipa_fnsummary_cc_finalize (void) { ipa_free_fn_summary (); + ipa_free_size_summary (); } diff --git a/gcc/ipa-icf.cc b/gcc/ipa-icf.cc index bbdfd445397..ba6c6899ce6 100644 --- a/gcc/ipa-icf.cc +++ b/gcc/ipa-icf.cc @@ -3657,3 +3657,12 @@ make_pass_ipa_icf (gcc::context *ctxt) { return new ipa_icf::pass_ipa_icf (ctxt); } + +/* Reset all state within ipa-icf.cc so that we can rerun the compiler + within the same process. For use by toplev::finalize. */ + +void +ipa_icf_cc_finalize (void) +{ + ipa_icf::optimizer = NULL; +} diff --git a/gcc/ipa-profile.cc b/gcc/ipa-profile.cc index 78a40a118bc..8083b8195a8 100644 --- a/gcc/ipa-profile.cc +++ b/gcc/ipa-profile.cc @@ -1065,3 +1065,13 @@ make_pass_ipa_profile (gcc::context *ctxt) { return new pass_ipa_profile (ctxt); } + +/* Reset all state within ipa-profile.cc so that we can rerun the compiler + within the same process. For use by toplev::finalize. */ + +void +ipa_profile_cc_finalize (void) +{ + delete call_sums; + call_sums = NULL; +} diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc index 827bdb691ba..32cfb7754be 100644 --- a/gcc/ipa-prop.cc +++ b/gcc/ipa-prop.cc @@ -5904,5 +5904,23 @@ ipcp_transform_function (struct cgraph_node *node) return modified_mem_access ? TODO_update_ssa_only_virtuals : 0; } +/* Reset all state within ipa-prop.cc so that we can rerun the compiler + within the same process. For use by toplev::finalize. */ + +void +ipa_prop_cc_finalize (void) +{ + if (function_insertion_hook_holder) + symtab->remove_cgraph_insertion_hook (function_insertion_hook_holder); + function_insertion_hook_holder = NULL; + + if (ipa_edge_args_sum) + ggc_delete (ipa_edge_args_sum); + ipa_edge_args_sum = NULL; + + if (ipa_node_params_sum) + ggc_delete (ipa_node_params_sum); + ipa_node_params_sum = NULL; +} #include "gt-ipa-prop.h" diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h index fcd0e5c638f..4409c4afee9 100644 --- a/gcc/ipa-prop.h +++ b/gcc/ipa-prop.h @@ -1255,6 +1255,8 @@ tree ipcp_get_aggregate_const (struct function *func, tree parm, bool by_ref, bool unadjusted_ptr_and_unit_offset (tree op, tree *ret, poly_int64 *offset_ret); +void ipa_prop_cc_finalize (void); + /* From tree-sra.cc: */ tree build_ref_for_offset (location_t, tree, poly_int64, bool, tree, gimple_stmt_iterator *, bool); diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc index 6ffad335db4..2ac6fee14c4 100644 --- a/gcc/ipa-sra.cc +++ b/gcc/ipa-sra.cc @@ -4707,5 +4707,17 @@ make_pass_ipa_sra (gcc::context *ctxt) return new pass_ipa_sra (ctxt); } +/* Reset all state within ipa-sra.cc so that we can rerun the compiler + within the same process. For use by toplev::finalize. */ + +void +ipa_sra_cc_finalize (void) +{ + if (func_sums) + ggc_delete (func_sums); + func_sums = NULL; + delete call_sums; + call_sums = NULL; +} #include "gt-ipa-sra.h" diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h index 0eefcf40d44..5f1e6601ff8 100644 --- a/gcc/ipa-utils.h +++ b/gcc/ipa-utils.h @@ -57,6 +57,13 @@ bool ipa_make_function_pure (cgraph_node *, bool, bool); /* In ipa-profile.cc */ bool ipa_propagate_frequency (struct cgraph_node *node); +void ipa_profile_cc_finalize (void); + +/* In ipa-icf.cc */ +void ipa_icf_cc_finalize (void); + +/* In ipa-sra.cc */ +void ipa_sra_cc_finalize (void); /* In ipa-devirt.cc */ diff --git a/gcc/testsuite/jit.dg/all-non-failing-tests.h b/gcc/testsuite/jit.dg/all-non-failing-tests.h index e762563f9bd..aee0a35d104 100644 --- a/gcc/testsuite/jit.dg/all-non-failing-tests.h +++ b/gcc/testsuite/jit.dg/all-non-failing-tests.h @@ -377,6 +377,13 @@ #undef create_code #undef verify_code +/* test-ggc-bugfix.c */ +#define create_code create_code_ggc_bugfix +#define verify_code verify_code_ggc_bugfix +#include "test-ggc-bugfix.c" +#undef create_code +#undef verify_code + /* Now expose the individual testcases as instances of this struct. */ struct testcase @@ -529,7 +536,10 @@ const struct testcase testcases[] = { verify_code_version}, {"volatile", create_code_volatile, - verify_code_volatile} + verify_code_volatile}, + {"ggc_bugfix", + create_code_ggc_bugfix, + verify_code_ggc_bugfix}, }; const int num_testcases = (sizeof (testcases) / sizeof (testcases[0])); diff --git a/gcc/testsuite/jit.dg/test-ggc-bugfix.c b/gcc/testsuite/jit.dg/test-ggc-bugfix.c new file mode 100644 index 00000000000..59eb374af8b --- /dev/null +++ b/gcc/testsuite/jit.dg/test-ggc-bugfix.c @@ -0,0 +1,34 @@ +/* { dg-do compile { target x86_64-*-* } } */ + +#include +#include + +#include "libgccjit.h" + +#include "harness.h" + +void +create_code (gcc_jit_context *ctxt, void *user_data) +{ + gcc_jit_context_add_command_line_option (ctxt, "-flto"); + gcc_jit_context_add_driver_option (ctxt, "-nostdlib"); + + gcc_jit_type *type_int = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT); + gcc_jit_param *params_for_func_main[0] = { + }; + gcc_jit_function *func_main = + gcc_jit_context_new_function (ctxt, NULL, GCC_JIT_FUNCTION_EXPORTED, + type_int, "main", 0, params_for_func_main, + 0); + gcc_jit_block *block_start = + gcc_jit_function_new_block (func_main, "start"); + gcc_jit_rvalue *rvalue__int_42 = + gcc_jit_context_new_rvalue_from_int (ctxt, type_int, 42); + gcc_jit_block_end_with_return (block_start, NULL, rvalue__int_42); +} + +void +verify_code (gcc_jit_context *ctxt, gcc_jit_result *result) +{ + CHECK_NON_NULL (result); +} diff --git a/gcc/toplev.cc b/gcc/toplev.cc index d8e8978dd55..2a8743f7bb4 100644 --- a/gcc/toplev.cc +++ b/gcc/toplev.cc @@ -75,6 +75,7 @@ along with GCC; see the file COPYING3. If not see #include "symbol-summary.h" #include "tree-vrp.h" #include "ipa-prop.h" +#include "ipa-utils.h" #include "gcse.h" #include "omp-offload.h" #include "edit-context.h" @@ -2337,7 +2338,11 @@ toplev::finalize (void) ipa_fnsummary_cc_finalize (); ipa_modref_cc_finalize (); ipa_edge_modifications_finalize (); + ipa_icf_cc_finalize (); + ipa_prop_cc_finalize (); + ipa_profile_cc_finalize (); + ipa_sra_cc_finalize (); cgraph_cc_finalize (); cgraphunit_cc_finalize (); symtab_thunks_cc_finalize (); -- 2.42.0