Hi.

The sanity check calls toplev.finalize () in order to simulate JIT mode
in normal compilation mode.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

        PR jit/98615
        * main.c (main): Call toplev::finalize in CHECKING_P mode.
        * ipa-modref.c (ipa_modref_c_finalize): summaries are NULL
        when incremental LTO linking happens.
---
 gcc/ipa-modref.c | 3 ++-
 gcc/main.c       | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index ef5e62beb0e..e7f79caf34d 100644
--- a/gcc/ipa-modref.c
+++ b/gcc/ipa-modref.c
@@ -3867,7 +3867,8 @@ ipa_modref_c_finalize ()
   if (optimization_summaries)
     ggc_delete (optimization_summaries);
   optimization_summaries = NULL;
-  gcc_checking_assert (!summaries);
+  gcc_checking_assert (!summaries
+                      || flag_incremental_link == INCREMENTAL_LINK_LTO);
   if (summaries_lto)
     ggc_delete (summaries_lto);
   summaries_lto = NULL;
diff --git a/gcc/main.c b/gcc/main.c
index ab0244b1851..093e63954f8 100644
--- a/gcc/main.c
+++ b/gcc/main.c
@@ -36,5 +36,10 @@ main (int argc, char **argv)
   toplev toplev (NULL, /* external_timer */
                 true /* init_signals */);
 
-  return toplev.main (argc, argv);
+  int r = toplev.main (argc, argv);
+#if CHECKING_P
+  toplev.finalize ();
+#endif
+
+  return r;
 }
-- 
2.31.1

Reply via email to