Make gt_pch_nx unreachable in symbol-summary classes.

Message ID 53f4f28b-b551-59d0-88bf-c7754dfa303c@suse.cz
State New
Headers show
Series
  • Make gt_pch_nx unreachable in symbol-summary classes.
Related show

Commit Message

Martin Liška Oct. 24, 2019, 2:37 p.m.
Hello.

For the symbol/call summary we don't expect that it will be streamed
for PCH purpose. So that, I would like to mark all gt_pch_nx functions
with gcc_unreachable.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

2019-10-24  Martin Liska  <mliska@suse.cz>

	* symbol-summary.h (gt_pch_nx): Mark all functions
	with gcc_unreachable as we do not expect to be called.
---
 gcc/symbol-summary.h | 43 +++++++++++++++++--------------------------
 1 file changed, 17 insertions(+), 26 deletions(-)

Comments

Jan Hubicka Oct. 24, 2019, 2:48 p.m. | #1
> Hello.

> 

> For the symbol/call summary we don't expect that it will be streamed

> for PCH purpose. So that, I would like to mark all gt_pch_nx functions

> with gcc_unreachable.

> 

> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

> 

> Ready to be installed?

OK,
thanks!
Honza

Patch

diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h
index e90d4481a10..7f2e7218460 100644
--- a/gcc/symbol-summary.h
+++ b/gcc/symbol-summary.h
@@ -295,19 +295,16 @@  gt_ggc_mx(function_summary<T *>* const &summary)
 
 template <typename T>
 void
-gt_pch_nx(function_summary<T *>* const &summary)
+gt_pch_nx (function_summary<T *> *const &)
 {
-  gcc_checking_assert (summary->m_ggc);
-  gt_pch_nx (&summary->m_map);
+  gcc_unreachable ();
 }
 
 template <typename T>
 void
-gt_pch_nx(function_summary<T *>* const& summary, gt_pointer_operator op,
-	  void *cookie)
+gt_pch_nx (function_summary<T *> *const &, gt_pointer_operator, void *)
 {
-  gcc_checking_assert (summary->m_ggc);
-  gt_pch_nx (&summary->m_map, op, cookie);
+  gcc_unreachable ();
 }
 
 /* Help template from std c++11.  */
@@ -538,18 +535,17 @@  gt_ggc_mx (fast_function_summary<T *, va_gc>* const &summary)
 
 template <typename T>
 void
-gt_pch_nx (fast_function_summary<T *, va_gc>* const &summary)
+gt_pch_nx (fast_function_summary<T *, va_gc> *const &)
 {
-  gt_pch_nx (summary->m_vector);
+  gcc_unreachable ();
 }
 
 template <typename T>
 void
-gt_pch_nx (fast_function_summary<T *, va_gc>* const& summary,
-	   gt_pointer_operator op,
-	   void *cookie)
+gt_pch_nx (fast_function_summary<T *, va_gc> *const &, gt_pointer_operator,
+	   void *)
 {
-  gt_pch_nx (summary->m_vector, op, cookie);
+  gcc_unreachable ();
 }
 
 /* Base class for call_summary and fast_call_summary classes.  */
@@ -784,19 +780,16 @@  gt_ggc_mx(call_summary<T *>* const &summary)
 
 template <typename T>
 void
-gt_pch_nx(call_summary<T *>* const &summary)
+gt_pch_nx (call_summary<T *> *const &)
 {
-  gcc_checking_assert (summary->m_ggc);
-  gt_pch_nx (&summary->m_map);
+  gcc_unreachable ();
 }
 
 template <typename T>
 void
-gt_pch_nx(call_summary<T *>* const& summary, gt_pointer_operator op,
-	  void *cookie)
+gt_pch_nx (call_summary<T *> *const &, gt_pointer_operator, void *)
 {
-  gcc_checking_assert (summary->m_ggc);
-  gt_pch_nx (&summary->m_map, op, cookie);
+  gcc_unreachable ();
 }
 
 /* We want to pass just pointer types as argument for fast_call_summary
@@ -994,18 +987,16 @@  gt_ggc_mx (fast_call_summary<T *, va_gc>* const &summary)
 
 template <typename T>
 void
-gt_pch_nx (fast_call_summary<T *, va_gc>* const &summary)
+gt_pch_nx (fast_call_summary<T *, va_gc> *const &)
 {
-  gt_pch_nx (&summary->m_vector);
+  gcc_unreachable ();
 }
 
 template <typename T>
 void
-gt_pch_nx (fast_call_summary<T *, va_gc>* const& summary,
-	   gt_pointer_operator op,
-	   void *cookie)
+gt_pch_nx (fast_call_summary<T *, va_gc> *const &, gt_pointer_operator, void *)
 {
-  gt_pch_nx (&summary->m_vector, op, cookie);
+  gcc_unreachable ();
 }
 
 #endif  /* GCC_SYMBOL_SUMMARY_H  */