Hi,

This patch avoids generation of __builtin_unreachable calls marked as 
instrumented.  It follows paradigma of no instrumented builtin calls (and 
passes corresponding assert in expand_builtin from patch #18).

Thanks,
Ilya
--
2014-10-01  Ilya Enkovich  <ilya.enkov...@intel.com>

        * cgraphunit.c (walk_polymorphic_call_targets): Do not mark
        generated call to __builtin_unreachable as with_bounds.
        * ipa.c (walk_polymorphic_call_targets): Likewise.


diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index af90a79..d5e0075 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -866,6 +866,11 @@ walk_polymorphic_call_targets (hash_set<void *> 
*reachable_call_targets,
 
          edge->make_direct (target);
          edge->redirect_call_stmt_to_callee ();
+
+         /* Call to __builtin_unreachable shouldn't be instrumented.  */
+         if (!targets.length ())
+           gimple_call_set_with_bounds (edge->call_stmt, false);
+
          if (symtab->dump_file)
            {
              fprintf (symtab->dump_file,
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 78f251a..7fc3429 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -209,7 +209,13 @@ walk_polymorphic_call_targets (hash_set<void *> 
*reachable_call_targets,
          if (inline_summary_vec)
            inline_update_overall_summary (node);
          else if (edge->call_stmt)
-           edge->redirect_call_stmt_to_callee ();
+           {
+             edge->redirect_call_stmt_to_callee ();
+
+             /* Call to __builtin_unreachable shouldn't be instrumented.  */
+             if (!targets.length ())
+               gimple_call_set_with_bounds (edge->call_stmt, false);
+           }
        }
     }
 }

Reply via email to