public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1825] Reset the range info on the moved instruction in PHIOPT
@ 2021-06-26  1:49 Andrew Pinski
  0 siblings, 0 replies; only message in thread
From: Andrew Pinski @ 2021-06-26  1:49 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fbad6c62529fd2e5dcf9f7db884cee01e9dcc4bd

commit r12-1825-gfbad6c62529fd2e5dcf9f7db884cee01e9dcc4bd
Author: Andrew Pinski <apinski@marvell.com>
Date:   Fri Jun 18 17:55:51 2021 -0700

    Reset the range info on the moved instruction in PHIOPT
    
    I had missed this when wrote the patch which allowed the
    gimple to be moved from inside the conditional as it.  It
    was also missed in the review.  Anyways the range information
    needs to be reset for the moved gimple as it was under a
    conditional and the flow has changed to be unconditional.
    I have not seen any testcase in the wild that produces wrong code
    yet which is why there is no testcase but this is similar to what
    the other code in phiopt does so after moving those to match, there
    might be some.
    
    OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
    
    gcc/ChangeLog:
    
            * tree-ssa-phiopt.c (match_simplify_replacement): Reset
            flow senatitive info on the moved ssa set.

Diff:
---
 gcc/tree-ssa-phiopt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index ce5f0d50f7b..1777bff2f7c 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -836,7 +836,7 @@ match_simplify_replacement (basic_block cond_bb, basic_block middle_bb,
       if (!is_gimple_assign (stmt_to_move))
 	return false;
 
-      tree lhs = gimple_assign_lhs  (stmt_to_move);
+      tree lhs = gimple_assign_lhs (stmt_to_move);
       gimple *use_stmt;
       use_operand_p use_p;
 
@@ -892,6 +892,7 @@ match_simplify_replacement (basic_block cond_bb, basic_block middle_bb,
 	}
       gimple_stmt_iterator gsi1 = gsi_for_stmt (stmt_to_move);
       gsi_move_before (&gsi1, &gsi);
+      reset_flow_sensitive_info (gimple_assign_lhs (stmt_to_move));
     }
   if (seq)
     gsi_insert_seq_before (&gsi, seq, GSI_SAME_STMT);


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

only message in thread, other threads:[~2021-06-26  1:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-26  1:49 [gcc r12-1825] Reset the range info on the moved instruction in PHIOPT 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).