public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8255] Fix ICE in -fdiagnostics-generate-patch [PR112684]
@ 2024-01-18 17:12 David Malcolm
  0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2024-01-18 17:12 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e254d1224df306a07f3b0b572af2582f509b7d67

commit r14-8255-ge254d1224df306a07f3b0b572af2582f509b7d67
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Thu Jan 18 12:11:57 2024 -0500

    Fix ICE in -fdiagnostics-generate-patch [PR112684]
    
    gcc/ChangeLog:
            PR middle-end/112684
            * toplev.cc (toplev::main): Don't ICE in
            -fdiagnostics-generate-patch when exiting after options,
            since no edit context will have been created.
    
    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

Diff:
---
 gcc/toplev.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index 55636ff6e80..175d4cd18fa 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -2323,11 +2323,8 @@ toplev::main (int argc, char **argv)
      emit some diagnostics here.  */
   invoke_plugin_callbacks (PLUGIN_FINISH, NULL);
 
-  if (flag_diagnostics_generate_patch)
+  if (auto edit_context_ptr = global_dc->get_edit_context ())
     {
-      auto edit_context_ptr = global_dc->get_edit_context ();
-      gcc_assert (edit_context_ptr);
-
       pretty_printer pp;
       pp_show_color (&pp) = pp_show_color (global_dc->printer);
       edit_context_ptr->print_diff (&pp, true);

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

only message in thread, other threads:[~2024-01-18 17:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 17:12 [gcc r14-8255] Fix ICE in -fdiagnostics-generate-patch [PR112684] David Malcolm

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