public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4616] Fix again PR middle-end/102764
@ 2021-10-21 15:59 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2021-10-21 15:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9262ae450d6a57837c58645c2ee66365bbe08338

commit r12-4616-g9262ae450d6a57837c58645c2ee66365bbe08338
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Thu Oct 21 17:57:55 2021 +0200

    Fix again PR middle-end/102764
    
    gcc/
            PR middle-end/102764
            * cfgexpand.c (expand_gimple_basic_block): Robustify latest change.

Diff:
---
 gcc/cfgexpand.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 8b067f9d848..01d0cdc548a 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -5756,6 +5756,7 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls)
   rtx_insn *last;
   edge e;
   edge_iterator ei;
+  bool nondebug_stmt_seen = false;
 
   if (dump_file)
     fprintf (dump_file, "\n;; Generating RTL for gimple basic block %d\n",
@@ -5836,6 +5837,8 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls)
       basic_block new_bb;
 
       stmt = gsi_stmt (gsi);
+      if (!is_gimple_debug (stmt))
+	nondebug_stmt_seen = true;
 
       /* If this statement is a non-debug one, and we generate debug
 	 insns, then this one might be the last real use of a TERed
@@ -6090,7 +6093,7 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls)
   /* Expand implicit goto and convert goto_locus.  */
   FOR_EACH_EDGE (e, ei, bb->succs)
     {
-      if (e->goto_locus != UNKNOWN_LOCATION || !stmt || is_gimple_debug (stmt))
+      if (e->goto_locus != UNKNOWN_LOCATION || !nondebug_stmt_seen)
 	set_curr_insn_location (e->goto_locus);
       if ((e->flags & EDGE_FALLTHRU) && e->dest != bb->next_bb)
 	{


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

only message in thread, other threads:[~2021-10-21 15:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 15:59 [gcc r12-4616] Fix again PR middle-end/102764 Eric Botcazou

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