public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, Pointer Bounds Checker 13/x] Early versioning
@ 2014-05-29 11:05 Ilya Enkovich
  2014-05-30 16:59 ` Jeff Law
  0 siblings, 1 reply; 14+ messages in thread
From: Ilya Enkovich @ 2014-05-29 11:05 UTC (permalink / raw)
  To: gcc-patches

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.enkovich@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);
 
   if (gimple_in_ssa_p (cfun))
@@ -5350,8 +5351,9 @@ tree_function_versioning (tree old_decl, tree new_decl,
   DECL_ARGUMENTS (new_decl) = DECL_ARGUMENTS (old_decl);
   initialize_cfun (new_decl, old_decl,
 		   old_entry_block->count);
-  DECL_STRUCT_FUNCTION (new_decl)->gimple_df->ipa_pta
-    = id.src_cfun->gimple_df->ipa_pta;
+  if (DECL_STRUCT_FUNCTION (new_decl)->gimple_df)
+    DECL_STRUCT_FUNCTION (new_decl)->gimple_df->ipa_pta
+      = id.src_cfun->gimple_df->ipa_pta;
 
   /* Copy the function's static chain.  */
   p = DECL_STRUCT_FUNCTION (old_decl)->static_chain_decl;

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-06-05 13:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-29 11:05 [PATCH, Pointer Bounds Checker 13/x] Early versioning Ilya Enkovich
2014-05-30 16:59 ` Jeff Law
2014-06-02 10:48   ` Ilya Enkovich
2014-06-02 11:56     ` Richard Biener
2014-06-02 12:02       ` Ilya Enkovich
2014-06-02 17:27     ` Jeff Law
2014-06-03  5:55       ` Ilya Enkovich
2014-06-03  9:29         ` Richard Biener
2014-06-04  6:46           ` Jeff Law
2014-06-04  8:04             ` Ilya Enkovich
2014-06-04 10:00             ` Richard Biener
2014-06-05 11:18               ` Ilya Enkovich
2014-06-05 11:58                 ` Richard Biener
2014-06-05 13:00                   ` Ilya Enkovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).