ipa_fnsummary_cc_finalize (void)
{
ipa_free_fn_summary ();
+ ipa_free_size_summary ();
}
{
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;
+}
{
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;
+}
return true;
}
+/* 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"
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);
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"
/* 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 */
#undef create_code
#undef verify_code
+/* test-ggc-bugfix.c: We don't use this once, since the use of
+ gcc_jit_context_add_command_line_option and
+ gcc_jit_context_add_driver_option affects the whole context. */
+
/* Now expose the individual testcases as instances of this struct. */
struct testcase
--- /dev/null
+/* { dg-do compile { target x86_64-*-* } } */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#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);
+}
#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"
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 ();