The following reverts the DCE change back to the original behavior
which should be handled well during the propagation stage.  That
should fix the failures Thomas Schwinge is reporting.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

2022-04-12  Richard Biener  <rguent...@suse.de>

        PR ipa/104303
        * tree-ssa-dce.cc (mark_stmt_if_obviously_necessary): Do not
        include local escaped memory as obviously necessary stores.
---
 gcc/tree-ssa-dce.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-ssa-dce.cc b/gcc/tree-ssa-dce.cc
index 34ce8abe33a..2067b711d5b 100644
--- a/gcc/tree-ssa-dce.cc
+++ b/gcc/tree-ssa-dce.cc
@@ -315,7 +315,7 @@ mark_stmt_if_obviously_necessary (gimple *stmt, bool 
aggressive)
     }
 
   if ((gimple_vdef (stmt) && keep_all_vdefs_p ())
-      || stmt_may_clobber_global_p (stmt, true))
+      || stmt_may_clobber_global_p (stmt, false))
     {
       mark_stmt_necessary (stmt, true);
       return;
-- 
2.34.1

Reply via email to