[gcc(refs/users/marxin/heads/marxin-gcc-benchmark-branch)] [IRA] Fix PR91052 by skipping multiple_sets insn in combine_and_move_insns

Martin Liska marxin@gcc.gnu.org
Mon Mar 30 10:59:36 GMT 2020


https://gcc.gnu.org/g:4d2248bec5d22061ab252724bd59d45c8a47e009

commit 4d2248bec5d22061ab252724bd59d45c8a47e009
Author: Kewen Lin <linkw@linux.ibm.com>
Date:   Tue Feb 11 23:22:02 2020 -0600

    [IRA] Fix PR91052 by skipping multiple_sets insn in combine_and_move_insns
    
    As PR91052's comments show, commit r272731 exposed one issue in function
    combine_and_move_insns.  Function combine_and_move_insns perform the
    unexpected movement which alter live interval of some register, leading
    incorrect value to be used.  See PR91052 for details.
    
    2020-02-12  Kewen Lin  <linkw@gcc.gnu.org>
        PR target/91052
        * ira.c (combine_and_move_insns): Skip multiple_sets def_insn.

Diff:
---
 gcc/ChangeLog | 5 +++++
 gcc/ira.c     | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3ff66205a99..e0d6c7f2787 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-12  Kewen Lin  <linkw@gcc.gnu.org>
+
+	PR target/91052
+	* ira.c (combine_and_move_insns): Skip multiple_sets def_insn.
+
 2020-02-12  Segher Boessenkool  <segher@kernel.crashing.org>
 
 	* config/rs6000/rs6000.c (rs6000_debug_print_mode): Don't use sizeof
diff --git a/gcc/ira.c b/gcc/ira.c
index c8b5f869da1..a655ae12eb2 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3784,6 +3784,11 @@ combine_and_move_insns (void)
       if (can_throw_internal (def_insn))
 	continue;
 
+      /* Instructions with multiple sets can only be moved if DF analysis is
+	 performed for all of the registers set.  See PR91052.  */
+      if (multiple_sets (def_insn))
+	continue;
+
       basic_block use_bb = BLOCK_FOR_INSN (use_insn);
       basic_block def_bb = BLOCK_FOR_INSN (def_insn);
       if (bb_loop_depth (use_bb) > bb_loop_depth (def_bb))


More information about the Gcc-cvs mailing list