View | Details | Return to bug 54146 | Differences between
and this patch

Collapse All | Expand All

(-)tree-ssa-loop-manip.c (-1 / +1 lines)
Lines 130-136 create_iv (tree base, tree step, tree va Link Here
130
  add_phi_arg (stmt, va, loop_latch_edge (loop), UNKNOWN_LOCATION);
130
  add_phi_arg (stmt, va, loop_latch_edge (loop), UNKNOWN_LOCATION);
131
}
131
}
132
132
133
/* Return the outermost superloop LOOP of USE_LOOP that is a superloop of
133
/* Return the innermost superloop LOOP of USE_LOOP that is a superloop of
134
   both DEF_LOOP and USE_LOOP.  */
134
   both DEF_LOOP and USE_LOOP.  */
135
135
136
static inline struct loop *
136
static inline struct loop *
(-)tree-ssa-loop-im.c (-23 / +14 lines)
Lines 183-188 static struct Link Here
183
  struct pointer_map_t *ttae_cache;
183
  struct pointer_map_t *ttae_cache;
184
} memory_accesses;
184
} memory_accesses;
185
185
186
/* Obstack for the bitmaps in the above data structures.  */
187
static bitmap_obstack lim_bitmap_obstack;
188
186
static bool ref_indep_loop_p (struct loop *, mem_ref_p);
189
static bool ref_indep_loop_p (struct loop *, mem_ref_p);
187
190
188
/* Minimum cost of an expensive expression.  */
191
/* Minimum cost of an expensive expression.  */
Lines 1491-1502 memref_free (struct mem_ref *mem) Link Here
1491
  unsigned i;
1494
  unsigned i;
1492
  mem_ref_locs_p accs;
1495
  mem_ref_locs_p accs;
1493
1496
1494
  BITMAP_FREE (mem->stored);
1495
  BITMAP_FREE (mem->indep_loop);
1496
  BITMAP_FREE (mem->dep_loop);
1497
  BITMAP_FREE (mem->indep_ref);
1498
  BITMAP_FREE (mem->dep_ref);
1499
1500
  FOR_EACH_VEC_ELT (mem_ref_locs_p, mem->accesses_in_loop, i, accs)
1497
  FOR_EACH_VEC_ELT (mem_ref_locs_p, mem->accesses_in_loop, i, accs)
1501
    free_mem_ref_locs (accs);
1498
    free_mem_ref_locs (accs);
1502
  VEC_free (mem_ref_locs_p, heap, mem->accesses_in_loop);
1499
  VEC_free (mem_ref_locs_p, heap, mem->accesses_in_loop);
Lines 1514-1524 mem_ref_alloc (tree mem, unsigned hash, Link Here
1514
  ref->mem = mem;
1511
  ref->mem = mem;
1515
  ref->id = id;
1512
  ref->id = id;
1516
  ref->hash = hash;
1513
  ref->hash = hash;
1517
  ref->stored = BITMAP_ALLOC (NULL);
1514
  ref->stored = BITMAP_ALLOC (&lim_bitmap_obstack);
1518
  ref->indep_loop = BITMAP_ALLOC (NULL);
1515
  ref->indep_loop = BITMAP_ALLOC (&lim_bitmap_obstack);
1519
  ref->dep_loop = BITMAP_ALLOC (NULL);
1516
  ref->dep_loop = BITMAP_ALLOC (&lim_bitmap_obstack);
1520
  ref->indep_ref = BITMAP_ALLOC (NULL);
1517
  ref->indep_ref = BITMAP_ALLOC (&lim_bitmap_obstack);
1521
  ref->dep_ref = BITMAP_ALLOC (NULL);
1518
  ref->dep_ref = BITMAP_ALLOC (&lim_bitmap_obstack);
1522
  ref->accesses_in_loop = NULL;
1519
  ref->accesses_in_loop = NULL;
1523
1520
1524
  return ref;
1521
  return ref;
Lines 1738-1748 analyze_memory_references (void) Link Here
1738
1735
1739
  for (i = 0; i < number_of_loops (); i++)
1736
  for (i = 0; i < number_of_loops (); i++)
1740
    {
1737
    {
1741
      empty = BITMAP_ALLOC (NULL);
1738
      empty = BITMAP_ALLOC (&lim_bitmap_obstack);
1742
      VEC_quick_push (bitmap, memory_accesses.refs_in_loop, empty);
1739
      VEC_quick_push (bitmap, memory_accesses.refs_in_loop, empty);
1743
      empty = BITMAP_ALLOC (NULL);
1740
      empty = BITMAP_ALLOC (&lim_bitmap_obstack);
1744
      VEC_quick_push (bitmap, memory_accesses.all_refs_in_loop, empty);
1741
      VEC_quick_push (bitmap, memory_accesses.all_refs_in_loop, empty);
1745
      empty = BITMAP_ALLOC (NULL);
1742
      empty = BITMAP_ALLOC (&lim_bitmap_obstack);
1746
      VEC_quick_push (bitmap, memory_accesses.all_refs_stored_in_loop, empty);
1743
      VEC_quick_push (bitmap, memory_accesses.all_refs_stored_in_loop, empty);
1747
    }
1744
    }
1748
1745
Lines 2581-2586 tree_ssa_lim_initialize (void) Link Here
2581
  struct loop *loop;
2578
  struct loop *loop;
2582
  basic_block bb;
2579
  basic_block bb;
2583
2580
2581
  bitmap_obstack_initialize (&lim_bitmap_obstack);
2582
2584
  sbitmap_zero (contains_call);
2583
  sbitmap_zero (contains_call);
2585
  FOR_EACH_BB (bb)
2584
  FOR_EACH_BB (bb)
2586
    {
2585
    {
Lines 2614-2620 tree_ssa_lim_finalize (void) Link Here
2614
{
2613
{
2615
  basic_block bb;
2614
  basic_block bb;
2616
  unsigned i;
2615
  unsigned i;
2617
  bitmap b;
2618
  mem_ref_p ref;
2616
  mem_ref_p ref;
2619
2617
2620
  free_aux_for_edges ();
2618
  free_aux_for_edges ();
Lines 2622-2627 tree_ssa_lim_finalize (void) Link Here
2622
  FOR_EACH_BB (bb)
2620
  FOR_EACH_BB (bb)
2623
    SET_ALWAYS_EXECUTED_IN (bb, NULL);
2621
    SET_ALWAYS_EXECUTED_IN (bb, NULL);
2624
2622
2623
  bitmap_obstack_release (&lim_bitmap_obstack);
2625
  pointer_map_destroy (lim_aux_data_map);
2624
  pointer_map_destroy (lim_aux_data_map);
2626
2625
2627
  htab_delete (memory_accesses.refs);
2626
  htab_delete (memory_accesses.refs);
Lines 2630-2645 tree_ssa_lim_finalize (void) Link Here
2630
    memref_free (ref);
2629
    memref_free (ref);
2631
  VEC_free (mem_ref_p, heap, memory_accesses.refs_list);
2630
  VEC_free (mem_ref_p, heap, memory_accesses.refs_list);
2632
2631
2633
  FOR_EACH_VEC_ELT (bitmap, memory_accesses.refs_in_loop, i, b)
2634
    BITMAP_FREE (b);
2635
  VEC_free (bitmap, heap, memory_accesses.refs_in_loop);
2632
  VEC_free (bitmap, heap, memory_accesses.refs_in_loop);
2636
2637
  FOR_EACH_VEC_ELT (bitmap, memory_accesses.all_refs_in_loop, i, b)
2638
    BITMAP_FREE (b);
2639
  VEC_free (bitmap, heap, memory_accesses.all_refs_in_loop);
2633
  VEC_free (bitmap, heap, memory_accesses.all_refs_in_loop);
2640
2641
  FOR_EACH_VEC_ELT (bitmap, memory_accesses.all_refs_stored_in_loop, i, b)
2642
    BITMAP_FREE (b);
2643
  VEC_free (bitmap, heap, memory_accesses.all_refs_stored_in_loop);
2634
  VEC_free (bitmap, heap, memory_accesses.all_refs_stored_in_loop);
2644
2635
2645
  if (memory_accesses.ttae_cache)
2636
  if (memory_accesses.ttae_cache)
(-)dse.c (-61 / +52 lines)
Lines 200-207 along with GCC; see the file COPYING3. Link Here
200
   that really have constant offsets this size.  */
200
   that really have constant offsets this size.  */
201
#define MAX_OFFSET (64 * 1024)
201
#define MAX_OFFSET (64 * 1024)
202
202
203
/* Obstack for the DSE dataflow bitmaps.  We don't want to put these
204
   on the default obstack because these bitmaps can grow quite large
205
   (~2GB for the small (!) test case of PR54146) and we'll hold on to
206
   all that memory until the end of the compiler run.
207
   As a bonus, delete_tree_live_info can destroy all the bitmaps by just
208
   releasing the whole obstack.  */
209
static bitmap_obstack dse_bitmap_obstack;
210
211
/* Obstack for other data.  As for above: Kinda nice to be able to
212
   throw it all away at the end in one big sweep.  */
213
static struct obstack dse_obstack;
203
214
215
/* Scratch bitmap for cselib's cselib_expand_value_rtx.  */
204
static bitmap scratch = NULL;
216
static bitmap scratch = NULL;
217
205
struct insn_info;
218
struct insn_info;
206
219
207
/* This structure holds information about a candidate store.  */
220
/* This structure holds information about a candidate store.  */
Lines 685-697 get_group_info (rtx base) Link Here
685
	    (group_info_t) pool_alloc (rtx_group_info_pool);
698
	    (group_info_t) pool_alloc (rtx_group_info_pool);
686
	  memset (gi, 0, sizeof (struct group_info));
699
	  memset (gi, 0, sizeof (struct group_info));
687
	  gi->id = rtx_group_next_id++;
700
	  gi->id = rtx_group_next_id++;
688
	  gi->store1_n = BITMAP_ALLOC (NULL);
701
	  gi->store1_n = BITMAP_ALLOC (&dse_bitmap_obstack);
689
	  gi->store1_p = BITMAP_ALLOC (NULL);
702
	  gi->store1_p = BITMAP_ALLOC (&dse_bitmap_obstack);
690
	  gi->store2_n = BITMAP_ALLOC (NULL);
703
	  gi->store2_n = BITMAP_ALLOC (&dse_bitmap_obstack);
691
	  gi->store2_p = BITMAP_ALLOC (NULL);
704
	  gi->store2_p = BITMAP_ALLOC (&dse_bitmap_obstack);
692
	  gi->escaped_p = BITMAP_ALLOC (NULL);
705
	  gi->escaped_p = BITMAP_ALLOC (&dse_bitmap_obstack);
693
	  gi->escaped_n = BITMAP_ALLOC (NULL);
706
	  gi->escaped_n = BITMAP_ALLOC (&dse_bitmap_obstack);
694
	  gi->group_kill = BITMAP_ALLOC (NULL);
707
	  gi->group_kill = BITMAP_ALLOC (&dse_bitmap_obstack);
695
	  gi->process_globally = false;
708
	  gi->process_globally = false;
696
	  gi->offset_map_size_n = 0;
709
	  gi->offset_map_size_n = 0;
697
	  gi->offset_map_size_p = 0;
710
	  gi->offset_map_size_p = 0;
Lines 709-721 get_group_info (rtx base) Link Here
709
      gi->id = rtx_group_next_id++;
722
      gi->id = rtx_group_next_id++;
710
      gi->base_mem = gen_rtx_MEM (BLKmode, base);
723
      gi->base_mem = gen_rtx_MEM (BLKmode, base);
711
      gi->canon_base_addr = canon_rtx (base);
724
      gi->canon_base_addr = canon_rtx (base);
712
      gi->store1_n = BITMAP_ALLOC (NULL);
725
      gi->store1_n = BITMAP_ALLOC (&dse_bitmap_obstack);
713
      gi->store1_p = BITMAP_ALLOC (NULL);
726
      gi->store1_p = BITMAP_ALLOC (&dse_bitmap_obstack);
714
      gi->store2_n = BITMAP_ALLOC (NULL);
727
      gi->store2_n = BITMAP_ALLOC (&dse_bitmap_obstack);
715
      gi->store2_p = BITMAP_ALLOC (NULL);
728
      gi->store2_p = BITMAP_ALLOC (&dse_bitmap_obstack);
716
      gi->escaped_p = BITMAP_ALLOC (NULL);
729
      gi->escaped_p = BITMAP_ALLOC (&dse_bitmap_obstack);
717
      gi->escaped_n = BITMAP_ALLOC (NULL);
730
      gi->escaped_n = BITMAP_ALLOC (&dse_bitmap_obstack);
718
      gi->group_kill = BITMAP_ALLOC (NULL);
731
      gi->group_kill = BITMAP_ALLOC (&dse_bitmap_obstack);
719
      gi->process_globally = false;
732
      gi->process_globally = false;
720
      gi->frame_related =
733
      gi->frame_related =
721
	(base == frame_pointer_rtx) || (base == hard_frame_pointer_rtx);
734
	(base == frame_pointer_rtx) || (base == hard_frame_pointer_rtx);
Lines 739-746 dse_step0 (void) Link Here
739
  globally_deleted = 0;
752
  globally_deleted = 0;
740
  spill_deleted = 0;
753
  spill_deleted = 0;
741
754
742
  scratch = BITMAP_ALLOC (NULL);
755
  bitmap_obstack_initialize (&dse_bitmap_obstack);
743
  kill_on_calls = BITMAP_ALLOC (NULL);
756
  gcc_obstack_init (&dse_obstack);
757
758
  scratch = BITMAP_ALLOC (&reg_obstack);
759
  kill_on_calls = BITMAP_ALLOC (&dse_bitmap_obstack);
744
760
745
  rtx_store_info_pool
761
  rtx_store_info_pool
746
    = create_alloc_pool ("rtx_store_info_pool",
762
    = create_alloc_pool ("rtx_store_info_pool",
Lines 764-770 dse_step0 (void) Link Here
764
  rtx_group_table = htab_create (11, invariant_group_base_hash,
780
  rtx_group_table = htab_create (11, invariant_group_base_hash,
765
				 invariant_group_base_eq, NULL);
781
				 invariant_group_base_eq, NULL);
766
782
767
  bb_table = XCNEWVEC (bb_info_t, last_basic_block);
783
  bb_table = XNEWVEC (bb_info_t, last_basic_block);
768
  rtx_group_next_id = 0;
784
  rtx_group_next_id = 0;
769
785
770
  stores_off_frame_dead_at_return = !cfun->stdarg;
786
  stores_off_frame_dead_at_return = !cfun->stdarg;
Lines 1694-1700 record_store (rtx body, bb_info_t bb_inf Link Here
1694
    {
1710
    {
1695
      store_info->is_large = true;
1711
      store_info->is_large = true;
1696
      store_info->positions_needed.large.count = 0;
1712
      store_info->positions_needed.large.count = 0;
1697
      store_info->positions_needed.large.bmap = BITMAP_ALLOC (NULL);
1713
      store_info->positions_needed.large.bmap = BITMAP_ALLOC (&dse_bitmap_obstack);
1698
    }
1714
    }
1699
  else
1715
  else
1700
    {
1716
    {
Lines 2020-2026 replace_read (store_info_t store_info, i Link Here
2020
	 live at this point.  For instance, this can happen if one of
2036
	 live at this point.  For instance, this can happen if one of
2021
	 the insns sets the CC and the CC happened to be live at that
2037
	 the insns sets the CC and the CC happened to be live at that
2022
	 point.  This does occasionally happen, see PR 37922.  */
2038
	 point.  This does occasionally happen, see PR 37922.  */
2023
      bitmap regs_set = BITMAP_ALLOC (NULL);
2039
      bitmap regs_set = BITMAP_ALLOC (&reg_obstack);
2024
2040
2025
      for (this_insn = insns; this_insn != NULL_RTX; this_insn = NEXT_INSN (this_insn))
2041
      for (this_insn = insns; this_insn != NULL_RTX; this_insn = NEXT_INSN (this_insn))
2026
	note_stores (PATTERN (this_insn), look_for_hardregs, regs_set);
2042
	note_stores (PATTERN (this_insn), look_for_hardregs, regs_set);
Lines 2718-2724 static void Link Here
2718
dse_step1 (void)
2734
dse_step1 (void)
2719
{
2735
{
2720
  basic_block bb;
2736
  basic_block bb;
2721
  bitmap regs_live = BITMAP_ALLOC (NULL);
2737
  bitmap regs_live = BITMAP_ALLOC (&reg_obstack);
2722
2738
2723
  cselib_init (0);
2739
  cselib_init (0);
2724
  all_blocks = BITMAP_ALLOC (NULL);
2740
  all_blocks = BITMAP_ALLOC (NULL);
Lines 2906-2914 dse_step2_init (void) Link Here
2906
	}
2922
	}
2907
2923
2908
      group->offset_map_size_n++;
2924
      group->offset_map_size_n++;
2909
      group->offset_map_n = XNEWVEC (int, group->offset_map_size_n);
2925
      group->offset_map_n = XOBNEWVEC (&dse_obstack, int,
2926
				       group->offset_map_size_n);
2910
      group->offset_map_size_p++;
2927
      group->offset_map_size_p++;
2911
      group->offset_map_p = XNEWVEC (int, group->offset_map_size_p);
2928
      group->offset_map_p = XOBNEWVEC (&dse_obstack, int,
2929
				       group->offset_map_size_p);
2912
      group->process_globally = false;
2930
      group->process_globally = false;
2913
      if (dump_file)
2931
      if (dump_file)
2914
	{
2932
	{
Lines 3261-3267 dse_step3_scan (bool for_spills, basic_b Link Here
3261
      if (bb_info->kill)
3279
      if (bb_info->kill)
3262
	bitmap_clear (bb_info->kill);
3280
	bitmap_clear (bb_info->kill);
3263
      else
3281
      else
3264
	bb_info->kill = BITMAP_ALLOC (NULL);
3282
	bb_info->kill = BITMAP_ALLOC (&dse_bitmap_obstack);
3265
    }
3283
    }
3266
  else
3284
  else
3267
    if (bb_info->kill)
3285
    if (bb_info->kill)
Lines 3354-3360 dse_step3 (bool for_spills) Link Here
3354
      if (bb_info->gen)
3372
      if (bb_info->gen)
3355
	bitmap_clear (bb_info->gen);
3373
	bitmap_clear (bb_info->gen);
3356
      else
3374
      else
3357
	bb_info->gen = BITMAP_ALLOC (NULL);
3375
	bb_info->gen = BITMAP_ALLOC (&dse_bitmap_obstack);
3358
3376
3359
      if (bb->index == ENTRY_BLOCK)
3377
      if (bb->index == ENTRY_BLOCK)
3360
	;
3378
	;
Lines 3386-3398 dse_step3 (bool for_spills) Link Here
3386
	      unsigned int j;
3404
	      unsigned int j;
3387
	      group_info_t group;
3405
	      group_info_t group;
3388
3406
3389
	      all_ones = BITMAP_ALLOC (NULL);
3407
	      all_ones = BITMAP_ALLOC (&dse_bitmap_obstack);
3390
	      FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, j, group)
3408
	      FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, j, group)
3391
		bitmap_ior_into (all_ones, group->group_kill);
3409
		bitmap_ior_into (all_ones, group->group_kill);
3392
	    }
3410
	    }
3393
	  if (!bb_info->out)
3411
	  if (!bb_info->out)
3394
	    {
3412
	    {
3395
	      bb_info->out = BITMAP_ALLOC (NULL);
3413
	      bb_info->out = BITMAP_ALLOC (&dse_bitmap_obstack);
3396
	      bitmap_copy (bb_info->out, all_ones);
3414
	      bitmap_copy (bb_info->out, all_ones);
3397
	    }
3415
	    }
3398
	}
3416
	}
Lines 3428-3434 dse_confluence_0 (basic_block bb) Link Here
3428
3446
3429
  if (!bb_info->out)
3447
  if (!bb_info->out)
3430
    {
3448
    {
3431
      bb_info->out = BITMAP_ALLOC (NULL);
3449
      bb_info->out = BITMAP_ALLOC (&dse_bitmap_obstack);
3432
      bitmap_copy (bb_info->out, bb_table[EXIT_BLOCK]->gen);
3450
      bitmap_copy (bb_info->out, bb_table[EXIT_BLOCK]->gen);
3433
    }
3451
    }
3434
}
3452
}
Lines 3449-3455 dse_confluence_n (edge e) Link Here
3449
	bitmap_and_into (src_info->out, dest_info->in);
3467
	bitmap_and_into (src_info->out, dest_info->in);
3450
      else
3468
      else
3451
	{
3469
	{
3452
	  src_info->out = BITMAP_ALLOC (NULL);
3470
	  src_info->out = BITMAP_ALLOC (&dse_bitmap_obstack);
3453
	  bitmap_copy (src_info->out, dest_info->in);
3471
	  bitmap_copy (src_info->out, dest_info->in);
3454
	}
3472
	}
3455
    }
3473
    }
Lines 3488-3494 dse_transfer_function (int bb_index) Link Here
3488
					 bb_info->out, bb_info->kill);
3506
					 bb_info->out, bb_info->kill);
3489
	  else
3507
	  else
3490
	    {
3508
	    {
3491
	      bb_info->in = BITMAP_ALLOC (NULL);
3509
	      bb_info->in = BITMAP_ALLOC (&dse_bitmap_obstack);
3492
	      bitmap_ior_and_compl (bb_info->in, bb_info->gen,
3510
	      bitmap_ior_and_compl (bb_info->in, bb_info->gen,
3493
				    bb_info->out, bb_info->kill);
3511
				    bb_info->out, bb_info->kill);
3494
	      return true;
3512
	      return true;
Lines 3506-3512 dse_transfer_function (int bb_index) Link Here
3506
	return false;
3524
	return false;
3507
      else
3525
      else
3508
	{
3526
	{
3509
	  bb_info->in = BITMAP_ALLOC (NULL);
3527
	  bb_info->in = BITMAP_ALLOC (&dse_bitmap_obstack);
3510
	  bitmap_copy (bb_info->in, bb_info->gen);
3528
	  bitmap_copy (bb_info->in, bb_info->gen);
3511
	  return true;
3529
	  return true;
3512
	}
3530
	}
Lines 3786-3822 dse_step6 (void) Link Here
3786
----------------------------------------------------------------------------*/
3804
----------------------------------------------------------------------------*/
3787
3805
3788
static void
3806
static void
3789
dse_step7 (bool global_done)
3807
dse_step7 (void)
3790
{
3808
{
3791
  unsigned int i;
3809
  bitmap_obstack_release (&dse_bitmap_obstack);
3792
  group_info_t group;
3810
  obstack_free (&dse_obstack, NULL);
3793
  basic_block bb;
3794
3795
  FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
3796
    {
3797
      free (group->offset_map_n);
3798
      free (group->offset_map_p);
3799
      BITMAP_FREE (group->store1_n);
3800
      BITMAP_FREE (group->store1_p);
3801
      BITMAP_FREE (group->store2_n);
3802
      BITMAP_FREE (group->store2_p);
3803
      BITMAP_FREE (group->escaped_n);
3804
      BITMAP_FREE (group->escaped_p);
3805
      BITMAP_FREE (group->group_kill);
3806
    }
3807
3808
  if (global_done)
3809
    FOR_ALL_BB (bb)
3810
      {
3811
	bb_info_t bb_info = bb_table[bb->index];
3812
	BITMAP_FREE (bb_info->gen);
3813
	if (bb_info->kill)
3814
	  BITMAP_FREE (bb_info->kill);
3815
	if (bb_info->in)
3816
	  BITMAP_FREE (bb_info->in);
3817
	if (bb_info->out)
3818
	  BITMAP_FREE (bb_info->out);
3819
      }
3820
3811
3821
  if (clear_alias_sets)
3812
  if (clear_alias_sets)
3822
    {
3813
    {
Lines 3897-3903 rest_of_handle_dse (void) Link Here
3897
    }
3888
    }
3898
3889
3899
  dse_step6 ();
3890
  dse_step6 ();
3900
  dse_step7 (did_global);
3891
  dse_step7 ();
3901
3892
3902
  if (dump_file)
3893
  if (dump_file)
3903
    fprintf (dump_file, "dse: local deletions = %d, global deletions = %d, spill deletions = %d\n",
3894
    fprintf (dump_file, "dse: local deletions = %d, global deletions = %d, spill deletions = %d\n",
(-)cfgexpand.c (-20 / +30 lines)
Lines 185-190 static size_t stack_vars_alloc; Link Here
185
static size_t stack_vars_num;
185
static size_t stack_vars_num;
186
static struct pointer_map_t *decl_to_stack_part;
186
static struct pointer_map_t *decl_to_stack_part;
187
187
188
/* Conflict bitmaps go on this obstack.  This allows us to destroy
189
   all of them in one big sweep.  */
190
static bitmap_obstack stack_var_bitmap_obstack;
191
188
/* An array of indices such that stack_vars[stack_vars_sorted[i]].size
192
/* An array of indices such that stack_vars[stack_vars_sorted[i]].size
189
   is non-decreasing.  */
193
   is non-decreasing.  */
190
static size_t *stack_vars_sorted;
194
static size_t *stack_vars_sorted;
Lines 299-307 add_stack_var_conflict (size_t x, size_t Link Here
299
  struct stack_var *a = &stack_vars[x];
303
  struct stack_var *a = &stack_vars[x];
300
  struct stack_var *b = &stack_vars[y];
304
  struct stack_var *b = &stack_vars[y];
301
  if (!a->conflicts)
305
  if (!a->conflicts)
302
    a->conflicts = BITMAP_ALLOC (NULL);
306
    a->conflicts = BITMAP_ALLOC (&stack_var_bitmap_obstack);
303
  if (!b->conflicts)
307
  if (!b->conflicts)
304
    b->conflicts = BITMAP_ALLOC (NULL);
308
    b->conflicts = BITMAP_ALLOC (&stack_var_bitmap_obstack);
305
  bitmap_set_bit (a->conflicts, y);
309
  bitmap_set_bit (a->conflicts, y);
306
  bitmap_set_bit (b->conflicts, x);
310
  bitmap_set_bit (b->conflicts, x);
307
}
311
}
Lines 431-437 add_scope_conflicts_1 (basic_block bb, b Link Here
431
		{
435
		{
432
		  struct stack_var *a = &stack_vars[i];
436
		  struct stack_var *a = &stack_vars[i];
433
		  if (!a->conflicts)
437
		  if (!a->conflicts)
434
		    a->conflicts = BITMAP_ALLOC (NULL);
438
		    a->conflicts = BITMAP_ALLOC (&stack_var_bitmap_obstack);
435
		  bitmap_ior_into (a->conflicts, work);
439
		  bitmap_ior_into (a->conflicts, work);
436
		}
440
		}
437
	      visit = visit_conflict;
441
	      visit = visit_conflict;
Lines 464-470 add_scope_conflicts (void) Link Here
464
     We then do a mostly classical bitmap liveness algorithm.  */
468
     We then do a mostly classical bitmap liveness algorithm.  */
465
469
466
  FOR_ALL_BB (bb)
470
  FOR_ALL_BB (bb)
467
    bb->aux = BITMAP_ALLOC (NULL);
471
    bb->aux = BITMAP_ALLOC (&stack_var_bitmap_obstack);
468
472
469
  rpo = XNEWVEC (int, last_basic_block);
473
  rpo = XNEWVEC (int, last_basic_block);
470
  n_bbs = pre_and_rev_post_order_compute (NULL, rpo, false);
474
  n_bbs = pre_and_rev_post_order_compute (NULL, rpo, false);
Lines 647-653 update_alias_info_with_stack_vars (void) Link Here
647
    {
651
    {
648
      unsigned i;
652
      unsigned i;
649
      struct pointer_set_t *visited = pointer_set_create ();
653
      struct pointer_set_t *visited = pointer_set_create ();
650
      bitmap temp = BITMAP_ALLOC (NULL);
654
      bitmap temp = BITMAP_ALLOC (&stack_var_bitmap_obstack);
651
655
652
      for (i = 1; i < num_ssa_names; i++)
656
      for (i = 1; i < num_ssa_names; i++)
653
	{
657
	{
Lines 1378-1391 create_stack_guard (void) Link Here
1378
static void
1382
static void
1379
init_vars_expansion (void)
1383
init_vars_expansion (void)
1380
{
1384
{
1381
  tree t;
1385
  /* Conflict bitmaps, and a few related temporary bitmaps, go here.  */
1382
  unsigned ix;
1386
  bitmap_obstack_initialize (&stack_var_bitmap_obstack);
1383
  /* Set TREE_USED on all variables in the local_decls.  */
1384
  FOR_EACH_LOCAL_DECL (cfun, ix, t)
1385
    TREE_USED (t) = 1;
1386
1387
1387
  /* Clear TREE_USED on all variables associated with a block scope.  */
1388
  /* A map from decl to stack partition.  */
1388
  clear_tree_used (DECL_INITIAL (current_function_decl));
1389
  decl_to_stack_part = pointer_map_create ();
1389
1390
1390
  /* Initialize local stack smashing state.  */
1391
  /* Initialize local stack smashing state.  */
1391
  has_protected_decls = false;
1392
  has_protected_decls = false;
Lines 1396-1406 init_vars_expansion (void) Link Here
1396
static void
1397
static void
1397
fini_vars_expansion (void)
1398
fini_vars_expansion (void)
1398
{
1399
{
1399
  size_t i, n = stack_vars_num;
1400
  bitmap_obstack_release (&stack_var_bitmap_obstack);
1400
  for (i = 0; i < n; i++)
1401
  if (stack_vars)
1401
    BITMAP_FREE (stack_vars[i].conflicts);
1402
    XDELETEVEC (stack_vars);
1402
  XDELETEVEC (stack_vars);
1403
  if (stack_vars_sorted)
1403
  XDELETEVEC (stack_vars_sorted);
1404
    XDELETEVEC (stack_vars_sorted);
1404
  stack_vars = NULL;
1405
  stack_vars = NULL;
1405
  stack_vars_sorted = NULL;
1406
  stack_vars_sorted = NULL;
1406
  stack_vars_alloc = stack_vars_num = 0;
1407
  stack_vars_alloc = stack_vars_num = 0;
Lines 1428-1433 estimated_stack_frame_size (struct cgrap Link Here
1428
  current_function_decl = node->symbol.decl;
1429
  current_function_decl = node->symbol.decl;
1429
  push_cfun (fn);
1430
  push_cfun (fn);
1430
1431
1432
  init_vars_expansion ();
1433
1431
  FOR_EACH_LOCAL_DECL (fn, i, var)
1434
  FOR_EACH_LOCAL_DECL (fn, i, var)
1432
    if (auto_var_in_fn_p (var, fn->decl))
1435
    if (auto_var_in_fn_p (var, fn->decl))
1433
      size += expand_one_var (var, true, false);
1436
      size += expand_one_var (var, true, false);
Lines 1439-1446 estimated_stack_frame_size (struct cgrap Link Here
1439
      for (i = 0; i < stack_vars_num; ++i)
1442
      for (i = 0; i < stack_vars_num; ++i)
1440
	stack_vars_sorted[i] = i;
1443
	stack_vars_sorted[i] = i;
1441
      size += account_stack_vars ();
1444
      size += account_stack_vars ();
1442
      fini_vars_expansion ();
1443
    }
1445
    }
1446
1447
  fini_vars_expansion ();
1444
  pop_cfun ();
1448
  pop_cfun ();
1445
  current_function_decl = old_cur_fun_decl;
1449
  current_function_decl = old_cur_fun_decl;
1446
  return size;
1450
  return size;
Lines 1464-1469 expand_used_vars (void) Link Here
1464
    frame_phase = off ? align - off : 0;
1468
    frame_phase = off ? align - off : 0;
1465
  }
1469
  }
1466
1470
1471
  /* Set TREE_USED on all variables in the local_decls.  */
1472
  FOR_EACH_LOCAL_DECL (cfun, i, var)
1473
    TREE_USED (var) = 1;
1474
  /* Clear TREE_USED on all variables associated with a block scope.  */
1475
  clear_tree_used (DECL_INITIAL (current_function_decl));
1476
1467
  init_vars_expansion ();
1477
  init_vars_expansion ();
1468
1478
1469
  ssa_name_decls = pointer_map_create ();
1479
  ssa_name_decls = pointer_map_create ();
Lines 1613-1622 expand_used_vars (void) Link Here
1613
	}
1623
	}
1614
1624
1615
      expand_stack_vars (NULL);
1625
      expand_stack_vars (NULL);
1616
1617
      fini_vars_expansion ();
1618
    }
1626
    }
1619
1627
1628
  fini_vars_expansion ();
1629
1620
  /* If there were any artificial non-ignored vars without rtl
1630
  /* If there were any artificial non-ignored vars without rtl
1621
     found earlier, see if deferred stack allocation hasn't assigned
1631
     found earlier, see if deferred stack allocation hasn't assigned
1622
     rtl to them.  */
1632
     rtl to them.  */
(-)tree-ssa-live.h (-11 / +11 lines)
Lines 226-233 typedef struct tree_live_info_d Link Here
226
  /* Bitmap indicating which partitions are global.  */
226
  /* Bitmap indicating which partitions are global.  */
227
  bitmap global;
227
  bitmap global;
228
228
229
  /* Bitmap of live on entry blocks for partition elements.  */
229
  /* Bitmaps of live on entry blocks for partition elements.  */
230
  bitmap *livein;
230
  bitmap_head *livein;
231
232
  /* Bitmaps of what variables are live on exit for a basic blocks.  */
233
  bitmap_head *liveout;
231
234
232
  /* Number of basic blocks when live on exit calculated.  */
235
  /* Number of basic blocks when live on exit calculated.  */
233
  int num_blocks;
236
  int num_blocks;
Lines 237-245 typedef struct tree_live_info_d Link Here
237
240
238
  /* Top of workstack.  */
241
  /* Top of workstack.  */
239
  int *stack_top;
242
  int *stack_top;
240
241
  /* Bitmap of what variables are live on exit for a basic blocks.  */
242
  bitmap *liveout;
243
} *tree_live_info_p;
243
} *tree_live_info_p;
244
244
245
245
Lines 273-279 live_on_entry (tree_live_info_p live, ba Link Here
273
		       && bb != ENTRY_BLOCK_PTR
273
		       && bb != ENTRY_BLOCK_PTR
274
		       && bb != EXIT_BLOCK_PTR);
274
		       && bb != EXIT_BLOCK_PTR);
275
275
276
  return live->livein[bb->index];
276
  return &live->livein[bb->index];
277
}
277
}
278
278
279
279
Lines 287-293 live_on_exit (tree_live_info_p live, bas Link Here
287
		       && bb != ENTRY_BLOCK_PTR
287
		       && bb != ENTRY_BLOCK_PTR
288
		       && bb != EXIT_BLOCK_PTR);
288
		       && bb != EXIT_BLOCK_PTR);
289
289
290
  return live->liveout[bb->index];
290
  return &live->liveout[bb->index];
291
}
291
}
292
292
293
293
Lines 306-314 live_var_map (tree_live_info_p live) Link Here
306
static inline void
306
static inline void
307
live_merge_and_clear (tree_live_info_p live, int p1, int p2)
307
live_merge_and_clear (tree_live_info_p live, int p1, int p2)
308
{
308
{
309
  gcc_checking_assert (live->livein[p1] && live->livein[p2]);
309
  gcc_checking_assert (&live->livein[p1] && &live->livein[p2]);
310
  bitmap_ior_into (live->livein[p1], live->livein[p2]);
310
  bitmap_ior_into (&live->livein[p1], &live->livein[p2]);
311
  bitmap_zero (live->livein[p2]);
311
  bitmap_zero (&live->livein[p2]);
312
}
312
}
313
313
314
314
Lines 317-323 live_merge_and_clear (tree_live_info_p l Link Here
317
static inline void
317
static inline void
318
make_live_on_entry (tree_live_info_p live, basic_block bb , int p)
318
make_live_on_entry (tree_live_info_p live, basic_block bb , int p)
319
{
319
{
320
  bitmap_set_bit (live->livein[bb->index], p);
320
  bitmap_set_bit (&live->livein[bb->index], p);
321
  bitmap_set_bit (live->global, p);
321
  bitmap_set_bit (live->global, p);
322
}
322
}
323
323
(-)tree-ssa-live.c (-32 / +29 lines)
Lines 293-299 partition_view_fini (var_map map, bitmap Link Here
293
/* Create a partition view which includes all the used partitions in MAP.  If
293
/* Create a partition view which includes all the used partitions in MAP.  If
294
   WANT_BASES is true, create the base variable map as well.  */
294
   WANT_BASES is true, create the base variable map as well.  */
295
295
296
extern void
296
void
297
partition_view_normal (var_map map, bool want_bases)
297
partition_view_normal (var_map map, bool want_bases)
298
{
298
{
299
  bitmap used;
299
  bitmap used;
Lines 312-318 partition_view_normal (var_map map, bool Link Here
312
   the bitmap ONLY. If WANT_BASES is true, create the base variable map
312
   the bitmap ONLY. If WANT_BASES is true, create the base variable map
313
   as well.  */
313
   as well.  */
314
314
315
extern void
315
void
316
partition_view_bitmap (var_map map, bitmap only, bool want_bases)
316
partition_view_bitmap (var_map map, bitmap only, bool want_bases)
317
{
317
{
318
  bitmap used;
318
  bitmap used;
Lines 329-335 partition_view_bitmap (var_map map, bitm Link Here
329
    }
329
    }
330
  partition_view_fini (map, new_partitions);
330
  partition_view_fini (map, new_partitions);
331
331
332
  BITMAP_FREE (used);
333
  if (want_bases)
332
  if (want_bases)
334
    var_map_base_init (map);
333
    var_map_base_init (map);
335
  else
334
  else
Lines 849-854 remove_unused_locals (void) Link Here
849
  timevar_pop (TV_REMOVE_UNUSED);
848
  timevar_pop (TV_REMOVE_UNUSED);
850
}
849
}
851
850
851
/* Obstack for globale liveness info bitmaps.  We don't want to put these
852
   on the default obstack because these bitmaps can grow quite large and
853
   we'll hold on to all that memory until the end of the compiler run.
854
   As a bonus, delete_tree_live_info can destroy all the bitmaps by just
855
   releasing the whole obstack.  */
856
static bitmap_obstack liveness_bitmap_obstack;
852
857
853
/* Allocate and return a new live range information object base on MAP.  */
858
/* Allocate and return a new live range information object base on MAP.  */
854
859
Lines 856-879 static tree_live_info_p Link Here
856
new_tree_live_info (var_map map)
861
new_tree_live_info (var_map map)
857
{
862
{
858
  tree_live_info_p live;
863
  tree_live_info_p live;
859
  unsigned x;
864
  basic_block bb;
860
865
861
  live = (tree_live_info_p) xmalloc (sizeof (struct tree_live_info_d));
866
  live = XNEW (struct tree_live_info_d);
862
  live->map = map;
867
  live->map = map;
863
  live->num_blocks = last_basic_block;
868
  live->num_blocks = last_basic_block;
864
869
865
  live->livein = (bitmap *)xmalloc (last_basic_block * sizeof (bitmap));
870
  live->livein = XNEWVEC (bitmap_head, last_basic_block);
866
  for (x = 0; x < (unsigned)last_basic_block; x++)
871
  FOR_EACH_BB (bb)
867
    live->livein[x] = BITMAP_ALLOC (NULL);
872
    bitmap_initialize (&live->livein[bb->index], &liveness_bitmap_obstack);
868
873
869
  live->liveout = (bitmap *)xmalloc (last_basic_block * sizeof (bitmap));
874
  live->liveout = XNEWVEC (bitmap_head, last_basic_block);
870
  for (x = 0; x < (unsigned)last_basic_block; x++)
875
  FOR_EACH_BB (bb)
871
    live->liveout[x] = BITMAP_ALLOC (NULL);
876
    bitmap_initialize (&live->liveout[bb->index], &liveness_bitmap_obstack);
872
877
873
  live->work_stack = XNEWVEC (int, last_basic_block);
878
  live->work_stack = XNEWVEC (int, last_basic_block);
874
  live->stack_top = live->work_stack;
879
  live->stack_top = live->work_stack;
875
880
876
  live->global = BITMAP_ALLOC (NULL);
881
  live->global = BITMAP_ALLOC (&liveness_bitmap_obstack);
877
  return live;
882
  return live;
878
}
883
}
879
884
Lines 883-901 new_tree_live_info (var_map map) Link Here
883
void
888
void
884
delete_tree_live_info (tree_live_info_p live)
889
delete_tree_live_info (tree_live_info_p live)
885
{
890
{
886
  int x;
891
  bitmap_obstack_release (&liveness_bitmap_obstack);
887
888
  BITMAP_FREE (live->global);
889
  free (live->work_stack);
892
  free (live->work_stack);
890
891
  for (x = live->num_blocks - 1; x >= 0; x--)
892
    BITMAP_FREE (live->liveout[x]);
893
  free (live->liveout);
893
  free (live->liveout);
894
895
  for (x = live->num_blocks - 1; x >= 0; x--)
896
    BITMAP_FREE (live->livein[x]);
897
  free (live->livein);
894
  free (live->livein);
898
899
  free (live);
895
  free (live);
900
}
896
}
901
897
Lines 928-934 loe_visit_block (tree_live_info_p live, Link Here
928
	 predecessor block.  This should be the live on entry vars to pred.
924
	 predecessor block.  This should be the live on entry vars to pred.
929
	 Note that liveout is the DEFs in a block while live on entry is
925
	 Note that liveout is the DEFs in a block while live on entry is
930
	 being calculated.  */
926
	 being calculated.  */
931
      bitmap_and_compl (tmp, loe, live->liveout[pred_bb->index]);
927
      bitmap_and_compl (tmp, loe, &live->liveout[pred_bb->index]);
932
928
933
      /* Add these bits to live-on-entry for the pred. if there are any
929
      /* Add these bits to live-on-entry for the pred. if there are any
934
	 changes, and pred_bb has been visited already, add it to the
930
	 changes, and pred_bb has been visited already, add it to the
Lines 952-958 live_worklist (tree_live_info_p live) Link Here
952
  unsigned b;
948
  unsigned b;
953
  basic_block bb;
949
  basic_block bb;
954
  sbitmap visited = sbitmap_alloc (last_basic_block + 1);
950
  sbitmap visited = sbitmap_alloc (last_basic_block + 1);
955
  bitmap tmp = BITMAP_ALLOC (NULL);
951
  bitmap tmp = BITMAP_ALLOC (&liveness_bitmap_obstack);
956
952
957
  sbitmap_zero (visited);
953
  sbitmap_zero (visited);
958
954
Lines 997-1003 set_var_live_on_entry (tree ssa_name, tr Link Here
997
      def_bb = gimple_bb (stmt);
993
      def_bb = gimple_bb (stmt);
998
      /* Mark defs in liveout bitmap temporarily.  */
994
      /* Mark defs in liveout bitmap temporarily.  */
999
      if (def_bb)
995
      if (def_bb)
1000
	bitmap_set_bit (live->liveout[def_bb->index], p);
996
	bitmap_set_bit (&live->liveout[def_bb->index], p);
1001
    }
997
    }
1002
  else
998
  else
1003
    def_bb = ENTRY_BLOCK_PTR;
999
    def_bb = ENTRY_BLOCK_PTR;
Lines 1036-1042 set_var_live_on_entry (tree ssa_name, tr Link Here
1036
      if (add_block)
1032
      if (add_block)
1037
        {
1033
        {
1038
	  global = true;
1034
	  global = true;
1039
	  bitmap_set_bit (live->livein[add_block->index], p);
1035
	  bitmap_set_bit (&live->livein[add_block->index], p);
1040
	}
1036
	}
1041
    }
1037
    }
1042
1038
Lines 1058-1064 calculate_live_on_exit (tree_live_info_p Link Here
1058
1054
1059
  /* live on entry calculations used liveout vectors for defs, clear them.  */
1055
  /* live on entry calculations used liveout vectors for defs, clear them.  */
1060
  FOR_EACH_BB (bb)
1056
  FOR_EACH_BB (bb)
1061
    bitmap_clear (liveinfo->liveout[bb->index]);
1057
    bitmap_clear (&liveinfo->liveout[bb->index]);
1062
1058
1063
  /* Set all the live-on-exit bits for uses in PHIs.  */
1059
  /* Set all the live-on-exit bits for uses in PHIs.  */
1064
  FOR_EACH_BB (bb)
1060
  FOR_EACH_BB (bb)
Lines 1083-1096 calculate_live_on_exit (tree_live_info_p Link Here
1083
		continue;
1079
		continue;
1084
	      e = gimple_phi_arg_edge (phi, i);
1080
	      e = gimple_phi_arg_edge (phi, i);
1085
	      if (e->src != ENTRY_BLOCK_PTR)
1081
	      if (e->src != ENTRY_BLOCK_PTR)
1086
		bitmap_set_bit (liveinfo->liveout[e->src->index], p);
1082
		bitmap_set_bit (&liveinfo->liveout[e->src->index], p);
1087
	    }
1083
	    }
1088
	}
1084
	}
1089
1085
1090
      /* Add each successors live on entry to this bock live on exit.  */
1086
      /* Add each successors live on entry to this bock live on exit.  */
1091
      FOR_EACH_EDGE (e, ei, bb->succs)
1087
      FOR_EACH_EDGE (e, ei, bb->succs)
1092
        if (e->dest != EXIT_BLOCK_PTR)
1088
        if (e->dest != EXIT_BLOCK_PTR)
1093
	  bitmap_ior_into (liveinfo->liveout[bb->index],
1089
	  bitmap_ior_into (&liveinfo->liveout[bb->index],
1094
			   live_on_entry (liveinfo, e->dest));
1090
			   live_on_entry (liveinfo, e->dest));
1095
    }
1091
    }
1096
}
1092
}
Lines 1106-1111 calculate_live_ranges (var_map map) Link Here
1106
  unsigned i;
1102
  unsigned i;
1107
  tree_live_info_p live;
1103
  tree_live_info_p live;
1108
1104
1105
  bitmap_obstack_initialize (&liveness_bitmap_obstack);
1109
  live = new_tree_live_info (map);
1106
  live = new_tree_live_info (map);
1110
  for (i = 0; i < num_var_partitions (map); i++)
1107
  for (i = 0; i < num_var_partitions (map); i++)
1111
    {
1108
    {
Lines 1185-1191 dump_live_info (FILE *f, tree_live_info_ Link Here
1185
      FOR_EACH_BB (bb)
1182
      FOR_EACH_BB (bb)
1186
	{
1183
	{
1187
	  fprintf (f, "\nLive on entry to BB%d : ", bb->index);
1184
	  fprintf (f, "\nLive on entry to BB%d : ", bb->index);
1188
	  EXECUTE_IF_SET_IN_BITMAP (live->livein[bb->index], 0, i, bi)
1185
	  EXECUTE_IF_SET_IN_BITMAP (&live->livein[bb->index], 0, i, bi)
1189
	    {
1186
	    {
1190
	      print_generic_expr (f, partition_to_var (map, i), TDF_SLIM);
1187
	      print_generic_expr (f, partition_to_var (map, i), TDF_SLIM);
1191
	      fprintf (f, "  ");
1188
	      fprintf (f, "  ");
Lines 1199-1205 dump_live_info (FILE *f, tree_live_info_ Link Here
1199
      FOR_EACH_BB (bb)
1196
      FOR_EACH_BB (bb)
1200
	{
1197
	{
1201
	  fprintf (f, "\nLive on exit from BB%d : ", bb->index);
1198
	  fprintf (f, "\nLive on exit from BB%d : ", bb->index);
1202
	  EXECUTE_IF_SET_IN_BITMAP (live->liveout[bb->index], 0, i, bi)
1199
	  EXECUTE_IF_SET_IN_BITMAP (&live->liveout[bb->index], 0, i, bi)
1203
	    {
1200
	    {
1204
	      print_generic_expr (f, partition_to_var (map, i), TDF_SLIM);
1201
	      print_generic_expr (f, partition_to_var (map, i), TDF_SLIM);
1205
	      fprintf (f, "  ");
1202
	      fprintf (f, "  ");
(-)tree-ssa-ter.c (-9 / +16 lines)
Lines 172-177 typedef struct temp_expr_table_d Link Here
172
/* Used to indicate a dependency on VDEFs.  */
172
/* Used to indicate a dependency on VDEFs.  */
173
#define VIRTUAL_PARTITION(table)	(table->virtual_partition)
173
#define VIRTUAL_PARTITION(table)	(table->virtual_partition)
174
174
175
/* A place for the many, many bitmaps we create.  */
176
static bitmap_obstack ter_bitmap_obstack;
177
175
#ifdef ENABLE_CHECKING
178
#ifdef ENABLE_CHECKING
176
extern void debug_ter (FILE *, temp_expr_table_p);
179
extern void debug_ter (FILE *, temp_expr_table_p);
177
#endif
180
#endif
Lines 192-201 new_temp_expr_table (var_map map) Link Here
192
  t->expr_decl_uids = XCNEWVEC (bitmap, num_ssa_names + 1);
195
  t->expr_decl_uids = XCNEWVEC (bitmap, num_ssa_names + 1);
193
  t->kill_list = XCNEWVEC (bitmap, num_var_partitions (map) + 1);
196
  t->kill_list = XCNEWVEC (bitmap, num_var_partitions (map) + 1);
194
197
195
  t->partition_in_use = BITMAP_ALLOC (NULL);
198
  t->partition_in_use = BITMAP_ALLOC (&ter_bitmap_obstack);
196
199
197
  t->virtual_partition = num_var_partitions (map);
200
  t->virtual_partition = num_var_partitions (map);
198
  t->new_replaceable_dependencies = BITMAP_ALLOC (NULL);
201
  t->new_replaceable_dependencies = BITMAP_ALLOC (&ter_bitmap_obstack);
199
202
200
  t->replaceable_expressions = NULL;
203
  t->replaceable_expressions = NULL;
201
  t->num_in_part = XCNEWVEC (int, num_var_partitions (map));
204
  t->num_in_part = XCNEWVEC (int, num_var_partitions (map));
Lines 269-275 static inline void Link Here
269
make_dependent_on_partition (temp_expr_table_p tab, int version, int p)
272
make_dependent_on_partition (temp_expr_table_p tab, int version, int p)
270
{
273
{
271
  if (!tab->partition_dependencies[version])
274
  if (!tab->partition_dependencies[version])
272
    tab->partition_dependencies[version] = BITMAP_ALLOC (NULL);
275
    tab->partition_dependencies[version] = BITMAP_ALLOC (&ter_bitmap_obstack);
273
276
274
  bitmap_set_bit (tab->partition_dependencies[version], p);
277
  bitmap_set_bit (tab->partition_dependencies[version], p);
275
}
278
}
Lines 282-288 add_to_partition_kill_list (temp_expr_ta Link Here
282
{
285
{
283
  if (!tab->kill_list[p])
286
  if (!tab->kill_list[p])
284
    {
287
    {
285
      tab->kill_list[p] = BITMAP_ALLOC (NULL);
288
      tab->kill_list[p] = BITMAP_ALLOC (&ter_bitmap_obstack);
286
      bitmap_set_bit (tab->partition_in_use, p);
289
      bitmap_set_bit (tab->partition_in_use, p);
287
    }
290
    }
288
  bitmap_set_bit (tab->kill_list[p], ver);
291
  bitmap_set_bit (tab->kill_list[p], ver);
Lines 330-336 add_dependence (temp_expr_table_p tab, i Link Here
330
	  /* Rather than set partition_dependencies and in_use lists bit by
333
	  /* Rather than set partition_dependencies and in_use lists bit by
331
	     bit, simply OR in the new_replaceable_dependencies bits.  */
334
	     bit, simply OR in the new_replaceable_dependencies bits.  */
332
	  if (!tab->partition_dependencies[version])
335
	  if (!tab->partition_dependencies[version])
333
	    tab->partition_dependencies[version] = BITMAP_ALLOC (NULL);
336
	    tab->partition_dependencies[version] =
337
	      BITMAP_ALLOC (&ter_bitmap_obstack);
334
	  bitmap_ior_into (tab->partition_dependencies[version],
338
	  bitmap_ior_into (tab->partition_dependencies[version],
335
			   tab->new_replaceable_dependencies);
339
			   tab->new_replaceable_dependencies);
336
	  bitmap_ior_into (tab->partition_in_use,
340
	  bitmap_ior_into (tab->partition_in_use,
Lines 498-504 process_replaceable (temp_expr_table_p t Link Here
498
502
499
  def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF);
503
  def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF);
500
  version = SSA_NAME_VERSION (def);
504
  version = SSA_NAME_VERSION (def);
501
  def_vars = BITMAP_ALLOC (NULL);
505
  def_vars = BITMAP_ALLOC (&ter_bitmap_obstack);
502
506
503
  basevar = SSA_NAME_VAR (def);
507
  basevar = SSA_NAME_VAR (def);
504
  if (basevar)
508
  if (basevar)
Lines 578-584 mark_replaceable (temp_expr_table_p tab, Link Here
578
582
579
  finished_with_expr (tab, version, !more_replacing);
583
  finished_with_expr (tab, version, !more_replacing);
580
584
581
  /* Set the replaceable expression.  */
585
  /* Set the replaceable expression.
586
     The bitmap for this "escapes" from this file so it's allocated
587
     on the default obstack.  */
582
  if (!tab->replaceable_expressions)
588
  if (!tab->replaceable_expressions)
583
    tab->replaceable_expressions = BITMAP_ALLOC (NULL);
589
    tab->replaceable_expressions = BITMAP_ALLOC (NULL);
584
  bitmap_set_bit (tab->replaceable_expressions, version);
590
  bitmap_set_bit (tab->replaceable_expressions, version);
Lines 706-726 find_replaceable_in_bb (temp_expr_table_ Link Here
706
   NULL is returned by the function, otherwise an expression vector indexed
712
   NULL is returned by the function, otherwise an expression vector indexed
707
   by SSA_NAME version numbers.  */
713
   by SSA_NAME version numbers.  */
708
714
709
extern bitmap
715
bitmap
710
find_replaceable_exprs (var_map map)
716
find_replaceable_exprs (var_map map)
711
{
717
{
712
  basic_block bb;
718
  basic_block bb;
713
  temp_expr_table_p table;
719
  temp_expr_table_p table;
714
  bitmap ret;
720
  bitmap ret;
715
721
722
  bitmap_obstack_initialize (&ter_bitmap_obstack);
716
  table = new_temp_expr_table (map);
723
  table = new_temp_expr_table (map);
717
  FOR_EACH_BB (bb)
724
  FOR_EACH_BB (bb)
718
    {
725
    {
719
      find_replaceable_in_bb (table, bb);
726
      find_replaceable_in_bb (table, bb);
720
      gcc_checking_assert (bitmap_empty_p (table->partition_in_use));
727
      gcc_checking_assert (bitmap_empty_p (table->partition_in_use));
721
    }
728
    }
722
723
  ret = free_temp_expr_table (table);
729
  ret = free_temp_expr_table (table);
730
  bitmap_obstack_release (&ter_bitmap_obstack);
724
  return ret;
731
  return ret;
725
}
732
}
726
733
(-)df-problems.c (-4 / +4 lines)
Lines 1228-1234 df_lr_add_problem (void) Link Here
1228
  df_add_problem (&problem_LR);
1228
  df_add_problem (&problem_LR);
1229
  /* These will be initialized when df_scan_blocks processes each
1229
  /* These will be initialized when df_scan_blocks processes each
1230
     block.  */
1230
     block.  */
1231
  df_lr->out_of_date_transfer_functions = BITMAP_ALLOC (NULL);
1231
  df_lr->out_of_date_transfer_functions = BITMAP_ALLOC (&df_bitmap_obstack);
1232
}
1232
}
1233
1233
1234
1234
Lines 1757-1763 df_live_add_problem (void) Link Here
1757
  df_add_problem (&problem_LIVE);
1757
  df_add_problem (&problem_LIVE);
1758
  /* These will be initialized when df_scan_blocks processes each
1758
  /* These will be initialized when df_scan_blocks processes each
1759
     block.  */
1759
     block.  */
1760
  df_live->out_of_date_transfer_functions = BITMAP_ALLOC (NULL);
1760
  df_live->out_of_date_transfer_functions = BITMAP_ALLOC (&df_bitmap_obstack);
1761
}
1761
}
1762
1762
1763
1763
Lines 2283-2289 df_chain_add_problem (unsigned int chain Link Here
2283
{
2283
{
2284
  df_add_problem (&problem_CHAIN);
2284
  df_add_problem (&problem_CHAIN);
2285
  df_chain->local_flags = chain_flags;
2285
  df_chain->local_flags = chain_flags;
2286
  df_chain->out_of_date_transfer_functions = BITMAP_ALLOC (NULL);
2286
  df_chain->out_of_date_transfer_functions = BITMAP_ALLOC (&df_bitmap_obstack);
2287
}
2287
}
2288
2288
2289
#undef df_chain_problem_p
2289
#undef df_chain_problem_p
Lines 2662-2668 df_word_lr_add_problem (void) Link Here
2662
  df_add_problem (&problem_WORD_LR);
2662
  df_add_problem (&problem_WORD_LR);
2663
  /* These will be initialized when df_scan_blocks processes each
2663
  /* These will be initialized when df_scan_blocks processes each
2664
     block.  */
2664
     block.  */
2665
  df_word_lr->out_of_date_transfer_functions = BITMAP_ALLOC (NULL);
2665
  df_word_lr->out_of_date_transfer_functions = BITMAP_ALLOC (&df_bitmap_obstack);
2666
}
2666
}
2667
2667
2668
2668

Return to bug 54146