public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, Pointer Bounds Checker 40/x] Support in IPA ICF
@ 2014-10-28 16:40 Ilya Enkovich
  2014-10-29 23:35 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Enkovich @ 2014-10-28 16:40 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jeff Law

Hi,

After recent merge with trunk I found that new IPA pass ICF requires few modifications for instrumented code:
 - instrumentation thunk existence means we cannot merge function into another one and should generate thunk instead
 - thunk generation should set with_bounds flag for instrumented funnctions
 - when DECL_INITIAL is cleaned for symbol, need_bounds_init should also be reset


Merge also required some minor changes in other patches due to changes includes, etc.  Nothing important to repost.

With these changes I get clean bootstrap and make check on linux-x86_64.  Also have clean runs of instrumented (run in NOP mode) and not isntrumented SPEC2000 and SPEC2006.

I also tried to bootstrap it for Darwin but unfortunately trunk fails to bootstrap there even with patches from PR63534 applied.  Error is the same for mpx branch.

Thanks,
Ilya
--
2014-10-28  Ilya Enkovich  <ilya.enkovich@intel.com>

	* cgraphunit.c (cgraph_node::expand_thunk): Set with_bounds flag
	for created call statement.
	* ipa-icf.c (sem_function::merge): Do not merge when instrumentation
	thunk still exists.
	(sem_variable::merge): Reset need_bounds_init flag.


diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index f203f6d..c29e9aa 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1585,6 +1585,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
       call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
       callees->call_stmt = call;
       gimple_call_set_from_thunk (call, true);
+      gimple_call_set_with_bounds (call, instrumentation_clone);
       if (restmp)
 	{
           gimple_call_set_lhs (call, restmp);
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index e8c32c7..0ccda45 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -562,7 +562,8 @@ sem_function::merge (sem_item *alias_item)
       redirect_callers
 	= (!original_discardable
 	   && alias->get_availability () > AVAIL_INTERPOSABLE
-	   && original->get_availability () > AVAIL_INTERPOSABLE);
+	   && original->get_availability () > AVAIL_INTERPOSABLE
+	   && !alias->instrumented_version);
     }
   else
     {
@@ -1177,6 +1178,7 @@ sem_variable::merge (sem_item *alias_item)
       alias->analyzed = false;
 
       DECL_INITIAL (alias->decl) = NULL;
+      alias->need_bounds_init = false;
       alias->remove_all_references ();
 
       varpool_node::create_alias (alias_var->decl, decl);

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

* Re: [PATCH, Pointer Bounds Checker 40/x] Support in IPA ICF
  2014-10-28 16:40 [PATCH, Pointer Bounds Checker 40/x] Support in IPA ICF Ilya Enkovich
@ 2014-10-29 23:35 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2014-10-29 23:35 UTC (permalink / raw)
  To: Ilya Enkovich, gcc-patches

On 10/28/14 10:38, Ilya Enkovich wrote:
> Hi,
>
> After recent merge with trunk I found that new IPA pass ICF requires few modifications for instrumented code:
>   - instrumentation thunk existence means we cannot merge function into another one and should generate thunk instead
>   - thunk generation should set with_bounds flag for instrumented funnctions
>   - when DECL_INITIAL is cleaned for symbol, need_bounds_init should also be reset
>
>
> Merge also required some minor changes in other patches due to changes includes, etc.  Nothing important to repost.
>
> With these changes I get clean bootstrap and make check on linux-x86_64.  Also have clean runs of instrumented (run in NOP mode) and not isntrumented SPEC2000 and SPEC2006.
>
> I also tried to bootstrap it for Darwin but unfortunately trunk fails to bootstrap there even with patches from PR63534 applied.  Error is the same for mpx branch.
>
> Thanks,
> Ilya
> --
> 2014-10-28  Ilya Enkovich  <ilya.enkovich@intel.com>
>
> 	* cgraphunit.c (cgraph_node::expand_thunk): Set with_bounds flag
> 	for created call statement.
> 	* ipa-icf.c (sem_function::merge): Do not merge when instrumentation
> 	thunk still exists.
> 	(sem_variable::merge): Reset need_bounds_init flag.
OK.

Last few days have been hell and thus hard to find the time to look at 
the state of the Darwin world.  Thanks for trying to test Darwin.

jeff

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

end of thread, other threads:[~2014-10-29 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-28 16:40 [PATCH, Pointer Bounds Checker 40/x] Support in IPA ICF Ilya Enkovich
2014-10-29 23:35 ` Jeff Law

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).