+2018-12-06 Richard Biener <rguenther@suse.de>
+
+ * bitmap.c (bitmap_head::crashme): Define.
+ * bitmap.h (bitmap_head): Add constexpr default constructor
+ poisoning the obstack member.
+ (bitmap_head::crashme): Declare.
+ (bitmap_release): New function clearing a bitmap and poisoning
+ the obstack member.
+ * gengtype.c (main): Make it recognize CONSTEXPR.
+ * lra-constraints.c (lra_inheritance): Use bitmap_release
+ instead of bitmap_clear.
+ * ira.c (ira): Work around class-memaccess warning.
+ * regrename.c (create_new_chain): Likewise.
+
2018-12-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/85726
/* Memory allocation statistics purpose instance. */
mem_alloc_description<bitmap_usage> bitmap_mem_desc;
+/* Static zero-initialized bitmap obstack used for default initialization
+ of bitmap_head. */
+bitmap_obstack bitmap_head::crashme;
+
static bitmap_element *bitmap_tree_listify_from (bitmap, bitmap_element *);
/* Register new bitmap. */
already pointed to by the chain started by first, so GTY((skip)) it. */
struct GTY(()) bitmap_head {
+ static bitmap_obstack crashme;
+ /* Poison obstack to not make it not a valid initialized GC bitmap. */
+ CONSTEXPR bitmap_head()
+ : indx(0), tree_form(false), first(NULL), current(NULL),
+ obstack (&crashme)
+ {}
/* Index of last element looked at. */
unsigned int indx;
/* False if the bitmap is in list form; true if the bitmap is in tree form.
bitmap_register (head PASS_MEM_STAT);
}
+/* Release a bitmap (but not its head). This is suitable for pairing with
+ bitmap_initialize. */
+
+static inline void
+bitmap_release (bitmap head)
+{
+ bitmap_clear (head);
+ /* Poison the obstack pointer so the obstack can be safely released.
+ Do not zero it as the bitmap then becomes initialized GC. */
+ head->obstack = &bitmap_head::crashme;
+}
+
/* Allocate and free bitmaps from obstack, malloc and gc'd memory. */
extern bitmap bitmap_alloc (bitmap_obstack *obstack CXX_MEM_STAT_INFO);
#define BITMAP_ALLOC bitmap_alloc
POS_HERE (do_scalar_typedef ("void", &pos));
POS_HERE (do_scalar_typedef ("machine_mode", &pos));
POS_HERE (do_scalar_typedef ("fixed_size_mode", &pos));
+ POS_HERE (do_scalar_typedef ("CONSTEXPR", &pos));
POS_HERE (do_typedef ("PTR",
create_pointer (resolve_typedef ("void", &pos)),
&pos));
= ((struct ira_spilled_reg_stack_slot *)
ira_allocate (max_regno
* sizeof (struct ira_spilled_reg_stack_slot)));
- memset (ira_spilled_reg_stack_slots, 0,
+ memset ((void *)ira_spilled_reg_stack_slots, 0,
max_regno * sizeof (struct ira_spilled_reg_stack_slot));
}
}
inherit_in_ebb. */
update_ebb_live_info (BB_HEAD (start_bb), BB_END (bb));
}
- bitmap_clear (&ebb_global_regs);
- bitmap_clear (&temp_bitmap);
- bitmap_clear (&live_regs);
- bitmap_clear (&invalid_invariant_regs);
- bitmap_clear (&check_only_regs);
+ bitmap_release (&ebb_global_regs);
+ bitmap_release (&temp_bitmap);
+ bitmap_release (&live_regs);
+ bitmap_release (&invalid_invariant_regs);
+ bitmap_release (&check_only_regs);
free (usage_insns);
timevar_pop (TV_LRA_INHERITANCE);
struct du_chain *this_du;
int nregs;
- memset (head, 0, sizeof *head);
+ memset ((void *)head, 0, sizeof *head);
head->next_chain = open_chains;
head->regno = this_regno;
head->nregs = this_nregs;