[gcc/devel/ranger] Adjust evrp trapping code to display removal of PHIs.

Aldy Hernandez aldyh@gcc.gnu.org
Wed Jun 10 16:24:51 GMT 2020


https://gcc.gnu.org/g:71920b87f77a16d35d99717d09345274c0d6d71d

commit 71920b87f77a16d35d99717d09345274c0d6d71d
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Wed Jun 10 17:49:39 2020 +0200

    Adjust evrp trapping code to display removal of PHIs.

Diff:
---
 gcc/misc.cc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gcc/misc.cc b/gcc/misc.cc
index 8a4e358eb6a..6c6688b2f11 100644
--- a/gcc/misc.cc
+++ b/gcc/misc.cc
@@ -76,6 +76,7 @@ void
 highlighter::on (pretty_printer *buffer, int spc, gimple *stmt)
 {
   bool need_header = new_stmt == stmt || untainted_stmt == stmt;
+  bool removal = untainted_stmt == stmt;
   if (need_header)
     {
       pp_string (buffer, ";; (STATE) filename = ");
@@ -88,7 +89,7 @@ highlighter::on (pretty_printer *buffer, int spc, gimple *stmt)
       pp_string (buffer, ";; Original statement was: ");
       pp_gimple_stmt_1 (buffer, old_stmt, spc, TDF_SLIM);
     }
-  else if (untainted_stmt == stmt)
+  else if (removal)
     {
       pp_string (buffer, ";; Queued for removal LHS= ");
       dump_generic_node (buffer, lhs, spc, TDF_SLIM, false);
@@ -99,6 +100,13 @@ highlighter::on (pretty_printer *buffer, int spc, gimple *stmt)
       INDENT (spc);
       pp_string (buffer, ";; VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n");
       INDENT (spc);
+      // For PHI removal, dump the PHI as well as the statement.
+      if (removal && is_a<gphi *> (new_stmt))
+	{
+	  pp_gimple_stmt_1 (buffer, new_stmt, spc, TDF_SLIM);
+	  pp_newline_and_flush (buffer);
+	  INDENT (spc);
+	}
     }
 }


More information about the Gcc-cvs mailing list