aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2020-06-11 08:43:02 +0200
committerAldy Hernandez <aldyh@redhat.com>2020-06-11 08:43:02 +0200
commit1957047ed1c94bf17cf993a2b1866965f493ba87 (patch)
tree6fc0cd24684b7e5887ce0894f1cf400ce3ae49d2 /gcc
parent71920b87f77a16d35d99717d09345274c0d6d71d (diff)
downloadgcc-1957047ed1c94bf17cf993a2b1866965f493ba87.zip
gcc-1957047ed1c94bf17cf993a2b1866965f493ba87.tar.gz
gcc-1957047ed1c94bf17cf993a2b1866965f493ba87.tar.bz2
Fix bug where evrp was trapping on identical original and modified statements.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/misc.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/misc.cc b/gcc/misc.cc
index 6c6688b..5b05642 100644
--- a/gcc/misc.cc
+++ b/gcc/misc.cc
@@ -75,8 +75,9 @@ class highlighter highlighter;
void
highlighter::on (pretty_printer *buffer, int spc, gimple *stmt)
{
- bool need_header = new_stmt == stmt || untainted_stmt == stmt;
bool removal = untainted_stmt == stmt;
+ bool found_orig_stmt = new_stmt == stmt;
+ bool need_header = found_orig_stmt || removal;
if (need_header)
{
pp_string (buffer, ";; (STATE) filename = ");
@@ -84,16 +85,16 @@ highlighter::on (pretty_printer *buffer, int spc, gimple *stmt)
pp_newline_and_flush (buffer);
INDENT (spc);
}
- if (new_stmt == stmt)
- {
- pp_string (buffer, ";; Original statement was: ");
- pp_gimple_stmt_1 (buffer, old_stmt, spc, TDF_SLIM);
- }
- else if (removal)
+ if (removal)
{
pp_string (buffer, ";; Queued for removal LHS= ");
dump_generic_node (buffer, lhs, spc, TDF_SLIM, false);
}
+ else if (found_orig_stmt)
+ {
+ pp_string (buffer, ";; Original statement was: ");
+ pp_gimple_stmt_1 (buffer, old_stmt, spc, TDF_SLIM);
+ }
if (need_header)
{
pp_newline_and_flush (buffer);
@@ -113,7 +114,9 @@ highlighter::on (pretty_printer *buffer, int spc, gimple *stmt)
void
highlighter::off (pretty_printer *buffer, int spc, gimple *stmt)
{
- if (new_stmt == stmt || untainted_stmt == stmt)
+ bool removal = untainted_stmt == stmt;
+ bool found_orig_stmt = new_stmt == stmt;
+ if (found_orig_stmt || removal)
{
pp_newline_and_flush (buffer);
INDENT (spc);