This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gcc::context creation


On 06/05/2017 05:46 AM, Jakub Jelinek wrote:

Here is a patch to implement that.  I chose to keep the 3 dumps predefined
dumps and just tweak their registered number, otherwise the changes would be
bigger.

Yeah, that can wait for another day.

 The patch additionally renames TDI_generic to TDI_gimple (to match
the dump name and content) and because we have more than 256 dumps these
days and we register them all even at -O0, the patch avoids 4 unnecessary
reallocations.  Ok for trunk if testing passes?

LGTM, two nits below.  (I can't approve though)

+/* Allow languages and middle-end to register their dumps before the
+   optimization passes.  */
blank line needed here, I think?
+void
+gcc::dump_manager::
+register_dumps ()
+{
+  lang_hooks.register_dumps (this);
+  /* If this assert fails, some FE registered more than
+     FIRST_ME_AUTO_NUMBERED_DUMP - FIRST_AUTO_NUMBERED_DUMP
+     dump files.  Bump FIRST_ME_AUTO_NUMBERED_DUMP accordingly.  */
+  gcc_assert (m_next_dump <= FIRST_ME_AUTO_NUMBERED_DUMP);
+  if (m_next_dump < FIRST_ME_AUTO_NUMBERED_DUMP)
+    m_next_dump = FIRST_ME_AUTO_NUMBERED_DUMP;

Unconditionally set it? there's the protecting assert. It's almost as if you want 'else gcc_unreachable ()' (with suitable morph of < to <=).

nathan


--
Nathan Sidwell


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]