This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 2/6] use auto_sbitmap in various places
On 07/25/2016 07:55 PM, Trevor Saunders wrote:
It also would likely to be extendable to other uses as well. There's a
ton of parallels between this and doing things like double-free,
use-after-free, leaked resource detection.
On Mon, Jul 25, 2016 at 11:18:07AM -0600, Jeff Law wrote:
On 07/24/2016 05:44 AM, email@example.com wrote:
From: Trevor Saunders <firstname.lastname@example.org>
2016-07-24 Trevor Saunders <email@example.com>
* bt-load.c (compute_out): Use auto_sbitmap class.
* cfganal.c (mark_dfs_back_edges): Likewise.
* cfgexpand.c (pass_expand::execute): Likewise.
* cfgloop.c (verify_loop_structure): Likewise.
* cfgloopmanip.c (fix_bb_placements): Likewise.
* cfgrtl.c (break_superblocks): Likewise.
* ddg.c (check_sccs): Likewise.
* df-core.c (df_worklist_dataflow): Likewise.
* dse.c (dse_step3): Likewise.
* except.c (eh_region_outermost): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (prune_expressions): Likewise.
* gimple-ssa-backprop.c (backprop::~backprop): Likewise.
* graph.c (draw_cfg_nodes_no_loops): Likewise.
* ira-lives.c (remove_some_program_points_and_update_live_ranges): Likewise.
* lcm.c (compute_earliest): Likewise.
* loop-unroll.c (unroll_loop_constant_iterations): Likewise.
* lower-subreg.c (decompose_multiword_subregs): Likewise.
* lra-lives.c: Likewise.
* lra.c (lra): Likewise.
* modulo-sched.c (schedule_reg_moves): Likewise.
* recog.c (split_all_insns): Likewise.
* regcprop.c (pass_cprop_hardreg::execute): Likewise.
* reload1.c (reload): Likewise.
* sched-rgn.c (haifa_find_rgns): Likewise.
* sel-sched.c (init_seqno): Likewise.
* store-motion.c (remove_reachable_equiv_notes): Likewise.
* tree-into-ssa.c (update_ssa): Likewise.
* tree-ssa-live.c (live_worklist): Likewise.
* tree-ssa-loop-im.c (fill_always_executed_in): Likewise.
* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely):
* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop):
* tree-ssa-pre.c (compute_antic): Likewise.
* tree-ssa-reassoc.c (undistribute_ops_list): Likewise.
* tree-stdarg.c (reachable_at_most_once): Likewise.
* tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Likewise.
* var-tracking.c (vt_find_locations): Likewise.
While looking at this, I noticed some more. Check the local sbitmaps in
yeah, there was a couple places like that which I left for the time
being mostly because they swapped bitmaps and I wanted to add a way of
doing that first.
I wonder if building a plugin to help find this kind of thing would help.
Essentially what we want is TYPE which we're considering converting to an
auto_TYPE. We want to see the declaration, possibly an allocation and an
explicit release. All paths have to pass through an explicit release. The
object must not escape. We can have a whitelist of routines where the
object can be passed in as a parameter.
Given that kind of infrastructure we ought to be able to look at a type and
say, yes, this seems to make sense to turn into an auto and here's all the
places that need twiddling for that change.
That infrastructure could also do things like say "X escaped via call Y" or
a path doesn't release which can further guide the process, or show leaks.
yeah, that would definitely be nice, and I've considered doing it
before, but been afraid it would be a bit of work. I suppose though if
it took work it would be because I learned some things so maybe its
worth doing for bitmap and all the uses of malloc / free.
Ah. Missed that. I wasn't really looking at those other cases as close
as the ones you changed.
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index a5f3f71..6247a4c 100644
@@ -2451,7 +2451,7 @@ compute_antic (void)
has_abnormal_preds seems ripe for a similar change in this function.
unfortunately its a file static, so that needs work first.