[PUSHED] dce: Fix check for no_delete for removing the lhs of a call

Andrea Pinski <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <[email protected]>
I only noticed after doing a bootstrap/test and pushing the
patch that I messed up the conditional. There was no failure
there so I suspect it was not being tested and most likely
does not run into the issue of why no_delete was added either.

Pushed the fix after a build.

gcc/ChangeLog:

	* tree-ssa-dce.cc (simple_dce_from_worklist): Fix conditional
	for no_delete with a call.

Signed-off-by: Andrea Pinski <[email protected]>
---
 gcc/tree-ssa-dce.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-ssa-dce.cc b/gcc/tree-ssa-dce.cc
index 9fdd102442a..18bc851b2cd 100644
--- a/gcc/tree-ssa-dce.cc
+++ b/gcc/tree-ssa-dce.cc
@@ -2224,8 +2224,8 @@ simple_dce_from_worklist (bitmap worklist, bitmap need_eh_cleanup,
       if (gimple_has_side_effects (t))
 	{
 	  gcall *call = dyn_cast <gcall *> (t);
-	  // For no delete don't remove the lhs.
-	  if (call && no_delete)
+	  // Remove the lhs for a call if not no_delete.
+	  if (call && !no_delete)
 	    {
 	      gimple_call_set_lhs (call, NULL_TREE);
 	      update_stmt (call);
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.