diff mbox series

[COMMITTED] Do not release state location until after path registry.

Message ID 20210903134323.733421-1-aldyh@redhat.com
State New
Headers show
Series [COMMITTED] Do not release state location until after path registry. | expand

Commit Message

Aldy Hernandez Sept. 3, 2021, 1:43 p.m. UTC
We are popping state and then calling the registry code.  This causes
the registry to have incorrect information.  This isn't visible in
current trunk, but will be an issue when I submit further enhancements
to the threading code.  However, it is a cleanup on its own so I am
pushing it now.

Tested on x86-64 Linux.

Committed as obvious.

gcc/ChangeLog:

	* tree-ssa-threadedge.c (jump_threader::thread_across_edge):
	Move pop until after a thread is registered.
---
 gcc/tree-ssa-threadedge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 37ee5c11be3..8a485125ff5 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -1155,9 +1155,9 @@  jump_threader::thread_across_edge (edge e)
     {
       propagate_threaded_block_debug_into (path->last ()->e->dest,
 					   e->dest);
-      m_state->pop ();
       BITMAP_FREE (visited);
       m_registry->register_jump_thread (path);
+      m_state->pop ();
       return;
     }
   else