public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4595] Add dump prints when execute_fixup_cfg removes a write only var store.
@ 2021-10-21  8:20 Andrew Pinski
  0 siblings, 0 replies; only message in thread
From: Andrew Pinski @ 2021-10-21  8:20 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:005ebe1c07843e6312cd70523945fa1d729e7253

commit r12-4595-g005ebe1c07843e6312cd70523945fa1d729e7253
Author: Andrew Pinski <apinski@marvell.com>
Date:   Sat Oct 16 02:30:55 2021 +0000

    Add dump prints when execute_fixup_cfg removes a write only var store.
    
    While debugging PR 102703, I found it was hard to figure out where
    the store was being removed as there was no pass which was outputting
    why the store was removed.
    This adds to execute_fixup_cfg the output.
    Also note most of removals happen when execute_fixup_cfg is called
    from the inliner.
    
    gcc/ChangeLog:
    
            * tree-cfg.c (execute_fixup_cfg): Output when the statement
            is removed when it is a write only var.

Diff:
---
 gcc/tree-cfg.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 4b4b0b52d9a..b78e4564e4d 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -9737,6 +9737,13 @@ execute_fixup_cfg (void)
 		  && (TREE_STATIC (lhs) || DECL_EXTERNAL (lhs))
 		  && varpool_node::get (lhs)->writeonly)
 		{
+		  if (dump_file && (dump_flags & TDF_DETAILS))
+		    {
+		      fprintf (dump_file, "Removing statement, writes"
+		               " to write only var:\n");
+		      print_gimple_stmt (dump_file, stmt, 0,
+					 TDF_VOPS|TDF_MEMSYMS);
+		    }
 		  unlink_stmt_vdef (stmt);
 		  gsi_remove (&gsi, true);
 		  release_defs (stmt);


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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  8:20 [gcc r12-4595] Add dump prints when execute_fixup_cfg removes a write only var store Andrew Pinski

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