public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] Inline unsupported_range constructor.
@ 2022-08-05 12:07 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2022-08-05 12:07 UTC (permalink / raw)
  To: GCC patches

An unsupported_range temporary is instantiated in every Value_Range
for completeness sake and should be mostly a NOP.  However, it's
showing up in the callgrind stats, because it's not inline.  This
fixes the oversight.

	PR tree-optimization/106514

gcc/ChangeLog:

	* value-range.cc (unsupported_range::unsupported_range): Move...
	* value-range.h (unsupported_range::unsupported_range): ...here.
	(unsupported_range::set_undefined): New.
---
 gcc/value-range.cc |  6 ------
 gcc/value-range.h  | 10 +++++++++-
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index dd5a4303908..a2273f540e8 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -248,12 +248,6 @@ irange::set_nonnegative (tree type)
   set (build_int_cst (type, 0), TYPE_MAX_VALUE (type));
 }
 
-unsupported_range::unsupported_range ()
-{
-  m_discriminator = VR_UNKNOWN;
-  set_undefined ();
-}
-
 void
 frange::accept (const vrange_visitor &v) const
 {
diff --git a/gcc/value-range.h b/gcc/value-range.h
index 305e2cae7e6..856947d23dd 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -250,7 +250,15 @@ private:
 class unsupported_range : public vrange
 {
 public:
-  unsupported_range ();
+  unsupported_range ()
+  {
+    m_discriminator = VR_UNKNOWN;
+    set_undefined ();
+  }
+  virtual void set_undefined () final override
+  {
+    m_kind = VR_UNDEFINED;
+  }
   virtual void accept (const vrange_visitor &v) const override;
 };
 
-- 
2.37.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-05 12:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 12:07 [COMMITTED] Inline unsupported_range constructor Aldy Hernandez

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