Clean up MPX-related stuff.
authorMartin Liska <mliska@suse.cz>
Wed, 13 Feb 2019 13:49:34 +0000 (14:49 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 13 Feb 2019 13:49:34 +0000 (13:49 +0000)
2019-02-13  Martin Liska  <mliska@suse.cz>

* builtins.h (expand_builtin_with_bounds): Remove declaration.
* calls.c (struct arg_data): Remove special_slot, pointer_arg
and pointer_offset fields.
(initialize_argument_information): Remove usage of dead
fields.
* cgraph.h (struct cgraph_thunk_info): Remove
add_pointer_bounds_args.
* cgraphunit.c (cgraph_node::expand_thunk): Remove usage of dead
fields.
(cgraph_node::assemble_thunks_and_aliases): Remove usage of dead
fields.
* config/i386/i386.c (ix86_function_arg_advance): Remove
unrelated comment.
(struct builtin_isa): Remove leaf_p and nothrow_p fields.
(def_builtin):  Remove usage of dead
fields.
(ix86_add_new_builtins): Likewise.
* ipa-fnsummary.c (compute_fn_summary): Likewise.
* ipa-icf.c (sem_function::equals_wpa): Likewise.
(sem_function::init): Likewise.
(sem_variable::merge): Likewise.
* ipa-visibility.c (function_and_variable_visibility): Likewise.
* ipa.c (symbol_table::remove_unreachable_nodes): Likewise.
* lto-cgraph.c (lto_output_node): Likewise.
(lto_output_varpool_node): Likewise.
(input_node): Likewise.
(input_varpool_node): Likewise.
* lto-streamer-out.c (lto_output): Likewise.
* tree-inline.c (expand_call_inline): Remove usage of
assign_stmts.
* tree-inline.h (struct copy_body_data): Likewise.
* varpool.c (varpool_node::dump): Likewise.

From-SVN: r268844

15 files changed:
gcc/ChangeLog
gcc/builtins.h
gcc/calls.c
gcc/cgraph.h
gcc/cgraphunit.c
gcc/config/i386/i386.c
gcc/ipa-fnsummary.c
gcc/ipa-icf.c
gcc/ipa-visibility.c
gcc/ipa.c
gcc/lto-cgraph.c
gcc/lto-streamer-out.c
gcc/tree-inline.c
gcc/tree-inline.h
gcc/varpool.c

index dc4d5475ec5930ec8190396764c1f3017b03d308..a6ef20cb71690556e95e898d5e451fbc855ab0ac 100644 (file)
@@ -1,3 +1,38 @@
+2019-02-13  Martin Liska  <mliska@suse.cz>
+
+       * builtins.h (expand_builtin_with_bounds): Remove declaration.
+       * calls.c (struct arg_data): Remove special_slot, pointer_arg
+       and pointer_offset fields.
+       (initialize_argument_information): Remove usage of dead
+       fields.
+       * cgraph.h (struct cgraph_thunk_info): Remove
+       add_pointer_bounds_args.
+       * cgraphunit.c (cgraph_node::expand_thunk): Remove usage of dead
+       fields.
+       (cgraph_node::assemble_thunks_and_aliases): Remove usage of dead
+       fields.
+       * config/i386/i386.c (ix86_function_arg_advance): Remove
+       unrelated comment.
+       (struct builtin_isa): Remove leaf_p and nothrow_p fields.
+       (def_builtin):  Remove usage of dead
+       fields.
+       (ix86_add_new_builtins): Likewise.
+       * ipa-fnsummary.c (compute_fn_summary): Likewise.
+       * ipa-icf.c (sem_function::equals_wpa): Likewise.
+       (sem_function::init): Likewise.
+       (sem_variable::merge): Likewise.
+       * ipa-visibility.c (function_and_variable_visibility): Likewise.
+       * ipa.c (symbol_table::remove_unreachable_nodes): Likewise.
+       * lto-cgraph.c (lto_output_node): Likewise.
+       (lto_output_varpool_node): Likewise.
+       (input_node): Likewise.
+       (input_varpool_node): Likewise.
+       * lto-streamer-out.c (lto_output): Likewise.
+       * tree-inline.c (expand_call_inline): Remove usage of
+       assign_stmts.
+       * tree-inline.h (struct copy_body_data): Likewise.
+       * varpool.c (varpool_node::dump): Likewise.
+
 2019-02-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/89303
index 3ec4ba09b662967c546775dd71f14e7e282a4821..599c96e72e166abee803dce2464dd0e60452258c 100644 (file)
@@ -119,7 +119,6 @@ extern void expand_builtin_trap (void);
 extern void expand_ifn_atomic_bit_test_and (gcall *);
 extern void expand_ifn_atomic_compare_exchange (gcall *);
 extern rtx expand_builtin (tree, rtx, rtx, machine_mode, int);
-extern rtx expand_builtin_with_bounds (tree, rtx, rtx, machine_mode, int);
 extern enum built_in_function builtin_mathfn_code (const_tree);
 extern tree fold_builtin_expect (location_t, tree, tree, tree, tree);
 extern bool avoid_folding_inline_builtin (tree);
index e11977e98df64b144d19ebd4f9669d8254070ab7..63c1bc52077c8829b7ff4caafa4a5c6fa2de473d 100644 (file)
@@ -82,15 +82,6 @@ struct arg_data
   /* If REG is a PARALLEL, this is a copy of VALUE pulled into the correct
      form for emit_group_move.  */
   rtx parallel_value;
-  /* If value is passed in neither reg nor stack, this field holds a number
-     of a special slot to be used.  */
-  rtx special_slot;
-  /* For pointer bounds hold an index of parm bounds are bound to.  -1 if
-     there is no such pointer.  */
-  int pointer_arg;
-  /* If pointer_arg refers a structure, then pointer_offset holds an offset
-     of a pointer in this structure.  */
-  int pointer_offset;
   /* If REG was promoted from the actual mode of the argument expression,
      indicates whether the promotion is sign- or zero-extended.  */
   int unsignedp;
@@ -2129,10 +2120,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
                                                argpos < n_named_args);
 
       if (args[i].reg && CONST_INT_P (args[i].reg))
-       {
-         args[i].special_slot = args[i].reg;
-         args[i].reg = NULL;
-       }
+       args[i].reg = NULL;
 
       /* If this is a sibling call and the machine has register windows, the
         register window has to be unwinded before calling the routine, so
index 75d4cec0ba8cdca2ff5804d3bde9f3764ca5ecd4..2f6daa75a2416bf53ce6e628ca1dae3d960de50e 100644 (file)
@@ -690,9 +690,6 @@ struct GTY(()) cgraph_thunk_info {
        the virtual one.  */
   bool virtual_offset_p;
 
-  /* ??? True for special kind of thunks, seems related to instrumentation.  */
-  bool add_pointer_bounds_args;
-
   /* Set to true when alias node (the cgraph_node to which this struct belong)
      is a thunk.  Access to any other fields is invalid if this is false.  */
   bool thunk_p;
@@ -1939,10 +1936,6 @@ public:
   /* Set when variable is scheduled to be assembled.  */
   unsigned output : 1;
 
-  /* Set when variable has statically initialized pointer
-     or is a static bounds variable and needs initalization.  */
-  unsigned need_bounds_init : 1;
-
   /* Set if the variable is dynamically initialized, except for
      function local statics.   */
   unsigned dynamically_initialized : 1;
index 162e0049b6bf35bd8dfdbaa457d07781fc0a338c..8bfbd0bb12f3bb13e3fbcfdcfc2a9b64f791b0fb 100644 (file)
@@ -1782,11 +1782,6 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
   tree thunk_fndecl = decl;
   tree a;
 
-  /* Instrumentation thunk is the same function with
-     a different signature.  Never need to expand it.  */
-  if (thunk.add_pointer_bounds_args)
-    return false;
-
   if (!force_gimple_thunk
       && this_adjusting
       && indirect_offset == 0
@@ -2123,8 +2118,7 @@ cgraph_node::assemble_thunks_and_aliases (void)
 
   for (e = callers; e;)
     if (e->caller->thunk.thunk_p
-       && !e->caller->global.inlined_to
-       && !e->caller->thunk.add_pointer_bounds_args)
+       && !e->caller->global.inlined_to)
       {
        cgraph_node *thunk = e->caller;
 
index 12bc7926f864d6803fee9c8c03ea6f74dc8e4c15..fd05873ba39fa94ace525a0d24da5170d26fc1e4 100644 (file)
@@ -8324,8 +8324,6 @@ ix86_function_arg_advance (cumulative_args_t cum_v, machine_mode mode,
   else
     nregs = function_arg_advance_32 (cum, mode, type, bytes, words);
 
-  /* For pointers passed in memory we expect bounds passed in Bounds
-     Table.  */
   if (!nregs)
     {
       /* Track if there are outgoing arguments on stack.  */
@@ -30421,8 +30419,6 @@ struct builtin_isa {
   enum ix86_builtin_func_type tcode; /* type to use in the declaration */
   unsigned char const_p:1;     /* true if the declaration is constant */
   unsigned char pure_p:1;      /* true if the declaration has pure attribute */
-  bool leaf_p;                 /* true if the declaration has leaf attribute */
-  bool nothrow_p;              /* true if the declaration has nothrow attribute */
   bool set_and_not_built_p;
 };
 
@@ -30493,8 +30489,6 @@ def_builtin (HOST_WIDE_INT mask, HOST_WIDE_INT mask2,
          ix86_builtins[(int) code] = NULL_TREE;
          ix86_builtins_isa[(int) code].tcode = tcode;
          ix86_builtins_isa[(int) code].name = name;
-         ix86_builtins_isa[(int) code].leaf_p = false;
-         ix86_builtins_isa[(int) code].nothrow_p = false;
          ix86_builtins_isa[(int) code].const_p = false;
          ix86_builtins_isa[(int) code].pure_p = false;
          ix86_builtins_isa[(int) code].set_and_not_built_p = true;
@@ -30574,13 +30568,6 @@ ix86_add_new_builtins (HOST_WIDE_INT isa, HOST_WIDE_INT isa2)
          ix86_builtins[i] = decl;
          if (ix86_builtins_isa[i].const_p)
            TREE_READONLY (decl) = 1;
-         if (ix86_builtins_isa[i].pure_p)
-           DECL_PURE_P (decl) = 1;
-         if (ix86_builtins_isa[i].leaf_p)
-           DECL_ATTRIBUTES (decl) = build_tree_list (get_identifier ("leaf"),
-                                                     NULL_TREE);
-         if (ix86_builtins_isa[i].nothrow_p)
-           TREE_NOTHROW (decl) = 1;
        }
     }
 
index 057b364b3794d6403c41cefb3f0c9f79c131743a..260315da228c2328c96583d2a2b901e5a829dbda 100644 (file)
@@ -2449,13 +2449,7 @@ compute_fn_summary (struct cgraph_node *node, bool early)
       info->account_size_time (2 * ipa_fn_summary::size_scale, 0, t, t);
       ipa_update_overall_fn_summary (node);
       info->self_size = info->size;
-      /* We cannot inline instrumentation clones.  */
-      if (node->thunk.add_pointer_bounds_args)
-       {
-          info->inlinable = false;
-          node->callees->inline_failed = CIF_CHKP;
-       }
-      else if (stdarg_p (TREE_TYPE (node->decl)))
+      if (stdarg_p (TREE_TYPE (node->decl)))
        {
          info->inlinable = false;
          node->callees->inline_failed = CIF_VARIADIC_THUNK;
@@ -2501,16 +2495,6 @@ compute_fn_summary (struct cgraph_node *node, bool early)
               node->local.can_change_signature = !e;
             }
         }
-       /* Functions called by instrumentation thunk can't change signature
-         because instrumentation thunk modification is not supported.  */
-       if (node->local.can_change_signature)
-        for (e = node->callers; e; e = e->next_caller)
-          if (e->caller->thunk.thunk_p
-              && e->caller->thunk.add_pointer_bounds_args)
-            {
-              node->local.can_change_signature = false;
-              break;
-            }
        analyze_function_body (node, early);
        pop_cfun ();
      }
index 849e9b4e9f5b84ff64f5f635c01f49092b9eaecd..e4c9dda0df1e6221f2c0406316f195789bd1493f 100644 (file)
@@ -548,9 +548,6 @@ sem_function::equals_wpa (sem_item *item,
         return return_false_with_msg ("thunk this_adjusting mismatch");
       if (cnode->thunk.virtual_offset_p != cnode2->thunk.virtual_offset_p)
         return return_false_with_msg ("thunk virtual_offset_p mismatch");
-      if (cnode->thunk.add_pointer_bounds_args
-         != cnode2->thunk.add_pointer_bounds_args)
-        return return_false_with_msg ("thunk add_pointer_bounds_args mismatch");
     }
 
   /* Compare special function DECL attributes.  */
@@ -1407,7 +1404,6 @@ sem_function::init (void)
       hstate.add_hwi (cnode->thunk.virtual_value);
       hstate.add_flag (cnode->thunk.this_adjusting);
       hstate.add_flag (cnode->thunk.virtual_offset_p);
-      hstate.add_flag (cnode->thunk.add_pointer_bounds_args);
       gcode_hash = hstate.end ();
     }
 }
@@ -2205,7 +2201,6 @@ sem_variable::merge (sem_item *alias_item)
       DECL_INITIAL (alias->decl) = NULL;
       ((symtab_node *)alias)->call_for_symbol_and_aliases (clear_decl_rtl,
                                                           NULL, true);
-      alias->need_bounds_init = false;
       alias->remove_all_references ();
       if (TREE_ADDRESSABLE (alias->decl))
         original->call_for_symbol_and_aliases (set_addressable, NULL, true);
index d9ef8f537359603f42214ae042733afcbe8e59dd..84585b52e46cd227917be730d0d613bae67c39af 100644 (file)
@@ -721,7 +721,6 @@ function_and_variable_visibility (bool whole_program)
        localize_node (whole_program, node);
 
       if (node->thunk.thunk_p
-         && !node->thunk.add_pointer_bounds_args
          && TREE_PUBLIC (node->decl))
        {
          struct cgraph_node *decl_node = node;
index 26268bc0c7c370d7d26789eff63ac6ebbd51d148..2496694124cc606a5bceb26c4705ddd5d31cc508 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -548,12 +548,6 @@ symbol_table::remove_unreachable_nodes (FILE *file)
              node->remove_callees ();
              node->remove_all_references ();
              changed = true;
-             if (node->thunk.thunk_p
-                 && node->thunk.add_pointer_bounds_args)
-               {
-                 node->thunk.thunk_p = false;
-                 node->thunk.add_pointer_bounds_args = false;
-               }
            }
        }
       else
index b941c76a8781443e6082b08ac8a73023a13101c0..4dfa2862be3733dee61547d418c97fc0a9ab671f 100644 (file)
@@ -556,8 +556,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
       streamer_write_uhwi_stream
         (ob->main_stream,
          1 + (node->thunk.this_adjusting != 0) * 2
-         + (node->thunk.virtual_offset_p != 0) * 4
-         + (node->thunk.add_pointer_bounds_args != 0) * 8);
+         + (node->thunk.virtual_offset_p != 0) * 4);
       streamer_write_uhwi_stream (ob->main_stream, node->thunk.fixed_offset);
       streamer_write_uhwi_stream (ob->main_stream, node->thunk.virtual_value);
       streamer_write_uhwi_stream (ob->main_stream, node->thunk.indirect_offset);
@@ -631,7 +630,6 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, varpool_node *node,
   bp_pack_value (&bp, node->tls_model, 3);
   bp_pack_value (&bp, node->used_by_single_function, 1);
   bp_pack_value (&bp, node->dynamically_initialized, 1);
-  bp_pack_value (&bp, node->need_bounds_init, 1);
   streamer_write_bitpack (&bp);
 
   group = node->get_comdat_group ();
@@ -1311,7 +1309,6 @@ input_node (struct lto_file_decl_data *file_data,
       node->thunk.indirect_offset = indirect_offset;
       node->thunk.this_adjusting = (type & 2);
       node->thunk.virtual_offset_p = (type & 4);
-      node->thunk.add_pointer_bounds_args = (type & 8);
     }
   if (node->alias && !node->analyzed && node->weakref)
     node->alias_target = get_alias_symbol (node->decl);
@@ -1382,7 +1379,6 @@ input_varpool_node (struct lto_file_decl_data *file_data,
   node->tls_model = (enum tls_model)bp_unpack_value (&bp, 3);
   node->used_by_single_function = (enum tls_model)bp_unpack_value (&bp, 1);
   node->dynamically_initialized = bp_unpack_value (&bp, 1);
-  node->need_bounds_init = bp_unpack_value (&bp, 1);
   group = read_identifier (ib);
   if (group)
     {
index b26c883b732562636f80a2737004feff5d539e91..a72016a48432f251d229f4d1de4a80e76e29e5df 100644 (file)
@@ -2412,8 +2412,7 @@ lto_output (void)
       if (cgraph_node *node = dyn_cast <cgraph_node *> (snode))
        {
          if (lto_symtab_encoder_encode_body_p (encoder, node)
-             && !node->alias
-             && (!node->thunk.thunk_p || !node->thunk.add_pointer_bounds_args))
+             && !node->alias)
            {
              if (flag_checking)
                {
index 5c0c4c5ab91da61e6b8b74045f6840e4dc4b5a2a..98cfbe31b8299390566f82514183ea9868f32f0e 100644 (file)
@@ -4554,7 +4554,6 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
 
   /* We will be inlining this callee.  */
   id->eh_lp_nr = lookup_stmt_eh_lp (stmt);
-  id->assign_stmts.create (0);
 
   /* Update the callers EH personality.  */
   if (DECL_FUNCTION_PERSONALITY (fn))
@@ -4916,7 +4915,6 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
       TREE_USED (gimple_assign_rhs1 (stmt)) = 1;
     }
 
-  id->assign_stmts.release ();
   id->add_clobbers_to_eh_landing_pads = 0;
 
   /* Output the inlining info for this abstract function, since it has been
index 11f596e3a740e2f3a13c1dbb091ad16b22435410..9c2915edc6c6d6a75ef3cf5a79f29fda75e3b164 100644 (file)
@@ -63,9 +63,6 @@ struct copy_body_data
   /* The VAR_DECL for the return value.  */
   tree retvar;
 
-  /* Assign statements that need bounds copy.  */
-  vec<gimple *> assign_stmts;
-
   /* The map from local declarations in the inlined function to
      equivalents in the function into which it is being inlined.  */
   hash_map<tree, tree> *decl_map;
index edffa551ee667b1e21f4172d3f949134a76c8ac5..8e5a93726565550b7a2c064861898e01d51ee685 100644 (file)
@@ -226,8 +226,6 @@ varpool_node::dump (FILE *f)
     fprintf (f, " output");
   if (used_by_single_function)
     fprintf (f, " used-by-single-function");
-  if (need_bounds_init)
-    fprintf (f, " need-bounds-init");
   if (TREE_READONLY (decl))
     fprintf (f, " read-only");
   if (ctor_useable_for_folding_p ())