On 05/29/14 05:05, Ilya Enkovich wrote:
Hi,

This patch allows to perform function versioning when some structures are not 
available yet.  It is required to make clones for Pointer Bounds Checker right 
after SSA build.

Bootstrapped and tested on linux-x86_64.

Thanks,
Ilya
--
gcc/

2014-05-29  Ilya Enkovich  <ilya.enkov...@intel.com>

        * tree-inline.c (copy_cfg_body): Check loop tree
        existence before accessing it.
        (tree_function_versioning): Check DF info existence
        before accessing it.

diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 4293241..23fef90 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2544,7 +2544,8 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int 
frequency_scale,

    /* If the loop tree in the source function needed fixup, mark the
       destination loop tree for fixup, too.  */
-  if (loops_for_fn (src_cfun)->state & LOOPS_NEED_FIXUP)
+  if (loops_for_fn (src_cfun)
+      && loops_for_fn (src_cfun)->state & LOOPS_NEED_FIXUP)
      loops_state_set (LOOPS_NEED_FIXUP);
Hmm, so if I understand things correctly, src_fun has no loop structures attached, thus there's nothing to copy. Presumably at some later point we build loop structures for the copy from scratch?

Similarly for the PTA info, we just build it from scratch in the copy at some point?

Assuming the answers to both are yes, then this patch is OK for the trunk when the rest of the patches are approved. It's not great, bit it's OK.

jeff

Reply via email to