The following fixes uninitialized uses in pass_manager::pass_manager
which causes bootstrap failure when a fix for PR2972 is applied.

Bootstrap and regtest in progress on x86_64-unknown-linux-gnu
(together with the 2972 fix).

Richard.

2017-04-21  Richard Biener  <rguent...@suse.de>

        PR bootstrap/79814
        * pass_manager.h (pass_manager::operator new): Remove.
        (pass_manager::operator delete): Likewise.
        * passes.c (pass_manager::operator new): Remove.
        (pass_manager::operator delete): Likewise.
        (pass_manager::pass_manager): Zero individual pass members.

Index: gcc/pass_manager.h
===================================================================
*** gcc/pass_manager.h  (revision 247049)
--- gcc/pass_manager.h  (working copy)
*************** class context;
*** 47,55 ****
  class pass_manager
  {
  public:
-   void *operator new (size_t sz);
-   void operator delete (void *ptr);
- 
    pass_manager (context *ctxt);
    ~pass_manager ();
  
--- 47,52 ----
Index: gcc/passes.c
===================================================================
*** gcc/passes.c        (revision 247049)
--- gcc/passes.c        (working copy)
*************** pass_manager::register_pass (struct regi
*** 1528,1546 ****
                                        -> all_passes
  */
  
- void *
- pass_manager::operator new (size_t sz)
- {
-   /* Ensure that all fields of the pass manager are zero-initialized.  */
-   return xcalloc (1, sz);
- }
- 
- void
- pass_manager::operator delete (void *ptr)
- {
-   free (ptr);
- }
- 
  pass_manager::pass_manager (context *ctxt)
  : all_passes (NULL), all_small_ipa_passes (NULL), all_lowering_passes (NULL),
    all_regular_ipa_passes (NULL),
--- 1528,1533 ----
*************** pass_manager::pass_manager (context *ctx
*** 1549,1554 ****
--- 1536,1556 ----
  {
    opt_pass **p;
  
+   /* Zero-initialize pass members.  */
+ #define INSERT_PASSES_AFTER(PASS)
+ #define PUSH_INSERT_PASSES_WITHIN(PASS)
+ #define POP_INSERT_PASSES()
+ #define NEXT_PASS(PASS, NUM) PASS ## _ ## NUM = NULL
+ #define NEXT_PASS_WITH_ARG(PASS, NUM, ARG) NEXT_PASS (PASS, NUM)
+ #define TERMINATE_PASS_LIST(PASS)
+ #include "pass-instances.def"
+ #undef INSERT_PASSES_AFTER
+ #undef PUSH_INSERT_PASSES_WITHIN
+ #undef POP_INSERT_PASSES
+ #undef NEXT_PASS
+ #undef NEXT_PASS_WITH_ARG
+ #undef TERMINATE_PASS_LIST
+ 
    /* Initialize the pass_lists array.  */
  #define DEF_PASS_LIST(LIST) pass_lists[PASS_LIST_NO_##LIST] = &LIST;
    GCC_PASS_LISTS

Reply via email to