[Bug rtl-optimization/78669] [7 Regression]: ICE: in combine_and_move_insns, at ira.c:3665 with -Os -fno-tree-ter -mavx512bw

2016-12-12 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78669

Bernd Schmidt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Bernd Schmidt  ---
Fixed.

[Bug rtl-optimization/78669] [7 Regression]: ICE: in combine_and_move_insns, at ira.c:3665 with -Os -fno-tree-ter -mavx512bw

2016-12-12 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78669

--- Comment #5 from Bernd Schmidt  ---
Author: bernds
Date: Mon Dec 12 13:29:48 2016
New Revision: 243551

URL: https://gcc.gnu.org/viewcvs?rev=243551=gcc=rev
Log:

PR rtl-optimization/78669
* ira.c (combine_and_move_insns): When deleting an insn, clear the
replace flag for all used regs in that insn.

PR rtl-optimization/78669
* gcc.target/i386/pr78669.c: New test.


Added:
trunk/gcc/testsuite/gcc.target/i386/pr78669.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ira.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/78669] [7 Regression]: ICE: in combine_and_move_insns, at ira.c:3665 with -Os -fno-tree-ter -mavx512bw

2016-12-05 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78669

--- Comment #4 from Bernd Schmidt  ---
Something like this perhaps.

Index: ira.c
===
--- ira.c   (revision 242958)
+++ ira.c   (working copy)
@@ -3705,6 +3705,14 @@ combine_and_move_insns (void)
  remove_death (regno, use_insn);
  SET_REG_N_REFS (regno, 0);
  REG_FREQ (regno) = 0;
+ df_ref use;
+ FOR_EACH_INSN_USE (use, def_insn)
+   {
+ unsigned int use_regno = DF_REF_REGNO (use);
+ if (!HARD_REGISTER_NUM_P (use_regno))
+   reg_equiv[use_regno].replace = 0;
+   }
+
  delete_insn (def_insn);

  reg_equiv[regno].init_insns = NULL;

[Bug rtl-optimization/78669] [7 Regression]: ICE: in combine_and_move_insns, at ira.c:3665 with -Os -fno-tree-ter -mavx512bw

2016-12-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78669

Jakub Jelinek  changed:

   What|Removed |Added

 CC|segher at gcc dot gnu.org  |vmakarov at gcc dot 
gnu.org

--- Comment #3 from Jakub Jelinek  ---
The insn 125 is removed in earlier iteration of the combine_and_move_insns
loop, when processing regno 119, insn 25 is deleted:
  remove_death (regno, use_insn);
  SET_REG_N_REFS (regno, 0);
  REG_FREQ (regno) = 0;
  delete_insn (def_insn);
So, I think either combine_and_move_insns should not assert there are still
some non-debug uses and instead just do partly what it does if it replaces the
uses of regno in use_insn with the equiv replacement, or when deleting some
def_insn it should also adjust the uses, or we should just continue if we find
replaceable regs without any uses.

[Bug rtl-optimization/78669] [7 Regression]: ICE: in combine_and_move_insns, at ira.c:3665 with -Os -fno-tree-ter -mavx512bw

2016-12-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78669

Jakub Jelinek  changed:

   What|Removed |Added

 CC||bernds at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org,
   ||segher at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Started with r242832.

[Bug rtl-optimization/78669] [7 Regression]: ICE: in combine_and_move_insns, at ira.c:3665 with -Os -fno-tree-ter -mavx512bw

2016-12-04 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78669

Uroš Bizjak  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-12-04
  Component|target  |rtl-optimization
   Target Milestone|--- |7.0
Summary|ICE: in |[7 Regression]: ICE: in
   |combine_and_move_insns, at  |combine_and_move_insns, at
   |ira.c:3665 with -Os |ira.c:3665 with -Os
   |-fno-tree-ter -mavx512bw|-fno-tree-ter -mavx512bw
 Ever confirmed|0   |1

--- Comment #1 from Uroš Bizjak  ---
Confirmed, the compilation breaks at:

(gdb) up
#2  0x00c0fc8a in combine_and_move_insns () at
/home/uros/gcc-svn/trunk/gcc/ira.c:3665
3665  gcc_assert (use_insn);
(gdb)
3651  if (!reg_equiv[regno].replace)
3652continue;
3653
3654  rtx_insn *use_insn = 0;
3655  for (df_ref use = DF_REG_USE_CHAIN (regno);
3656   use;
3657   use = DF_REF_NEXT_REG (use))
3658if (DF_REF_INSN_INFO (use))
3659  {
3660if (DEBUG_INSN_P (DF_REF_INSN (use))) 
3661  continue;
3662gcc_assert (!use_insn);
3663use_insn = DF_REF_INSN (use);
3664  }
3665  gcc_assert (use_insn);
3666
3667  /* Don't substitute into jumps.  indirect_jump_optimize does
3668 this for anything we are prepared to handle.  */
3669  if (JUMP_P (use_insn))
3670continue;

(gdb) p regno
$2 = 125

Suggesting, that there are no uses of r125.

But, we have in _.267r.asmcons:

(insn 24 23 25 2 (set (reg:V4DI 125)
(const_vector:V4DI [
(const_int -1 [0x])
(const_int -1 [0x])
(const_int -1 [0x])
(const_int -1 [0x])
])) 1217 {movv4di_internal}
 (nil))
(insn 25 24 152 2 (set (reg:V8DI 119)
(vec_concat:V8DI (reg:V4DI 124)
(reg:V4DI 125))) 4519 {avx_vec_concatv8di}
 (expr_list:REG_DEAD (reg:V4DI 125)
(expr_list:REG_DEAD (reg:V4DI 124)
(expr_list:REG_EQUAL (const_vector:V8DI [
(const_int 0 [0])
(const_int 1 [0x1])
(const_int 3 [0x3])
(const_int 0 [0])
(const_int -1 [0x])
(const_int -1 [0x])
(const_int -1 [0x])
(const_int -1 [0x])
])
(nil)

Looks like rtl-optimization problem, either dataflow or RA.