public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7429] Clear currently_expanding_gimple_stmt properly
@ 2022-03-01 14:18 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2022-03-01 14:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:88f91d8ccc8fec3a811975e3e4765b9a94d3f764

commit r12-7429-g88f91d8ccc8fec3a811975e3e4765b9a94d3f764
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Feb 28 15:18:04 2022 -0800

    Clear currently_expanding_gimple_stmt properly
    
    commit a5883ba0de68efad36db145e75c86394d8bd44ea
    Author: Michael Matz <matz@gcc.gnu.org>
    Date:   Tue Nov 24 15:37:32 2009 +0000
    
    introduced currently_expanding_gimple_stmt, which was set and cleared in
    expand_gimple_basic_block when expanding gimple statement to RTL.  But it
    isn't cleared when expand_gimple_basic_block returns inside the loop.
    
            PR middle-end/104721
            * cfgexpand.cc (expand_gimple_basic_block): Clear
            currently_expanding_gimple_stmt when returning inside the loop.

Diff:
---
 gcc/cfgexpand.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc
index d51af2e3084..87536ec7ccd 100644
--- a/gcc/cfgexpand.cc
+++ b/gcc/cfgexpand.cc
@@ -5927,7 +5927,10 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls)
 	{
 	  new_bb = expand_gimple_cond (bb, as_a <gcond *> (stmt));
 	  if (new_bb)
-	    return new_bb;
+	    {
+	      currently_expanding_gimple_stmt = NULL;
+	      return new_bb;
+	    }
 	}
       else if (is_gimple_debug (stmt))
 	{
@@ -6049,7 +6052,10 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls)
 		  if (can_fallthru)
 		    bb = new_bb;
 		  else
-		    return new_bb;
+		    {
+		      currently_expanding_gimple_stmt = NULL;
+		      return new_bb;
+		    }
 		}
 	    }
 	  else


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

only message in thread, other threads:[~2022-03-01 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 14:18 [gcc r12-7429] Clear currently_expanding_gimple_stmt properly H.J. Lu

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