Bug 91527 - [10 Regression] ICE in update_equiv_regs, at ira.c:3473 since r274694
Summary: [10 Regression] ICE in update_equiv_regs, at ira.c:3473 since r274694
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: 10.0
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code, ra
Depends on:
Blocks:
 
Reported: 2019-08-23 07:53 UTC by Martin Liška
Modified: 2019-08-26 10:39 UTC (History)
2 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target:
Build:
Known to work: 9.2.0
Known to fail: 10.0
Last reconfirmed: 2019-08-23 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2019-08-23 07:53:53 UTC
Since the revision, I see:

$ g++ /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/tree-ssa/pr21463.C -O3 -mabi=ms -msse4
during RTL pass: ira
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/tree-ssa/pr21463.C: In member function ‘T foo_t<T>::bar_ref(T, T) [with T = int]’:
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/tree-ssa/pr21463.C:13:2: internal compiler error: in update_equiv_regs, at ira.c:3473
   13 |  }
      |  ^
0x73fb29 update_equiv_regs
	/home/marxin/Programming/gcc/gcc/ira.c:3473
0xe03c62 ira
	/home/marxin/Programming/gcc/gcc/ira.c:5308
0xe03c62 execute
	/home/marxin/Programming/gcc/gcc/ira.c:5663
Comment 1 Richard Biener 2019-08-23 09:50:21 UTC
This looks like a latent issue to me.  IRA is confused about the reg-equiv
note in

(insn 4 24 5 2 (set (subreg:V4SI (reg/v:SI 90 [ c ]) 0)
        (subreg:V4SI (reg:SI 100) 0)) "/space/rguenther/src/svn/trunk2/gcc/testsuite/g++.dg/tree-ssa/pr21463.C":11:4 1248 {movv4si_internal}
     (expr_list:REG_DEAD (reg:SI 100)
        (expr_list:REG_EQUIV (mem/c:SI (plus:DI (reg/f:DI 16 argp)
                    (const_int 16 [0x10])) [1 c+0 S4 A64])
            (nil))))

expecting the SET_DEST to be a REG_P (it's a paradoxical subreg).  Not sure
if that's a requirement for RTL in general(?) but at least the docs say
the dest may be a strict_low_part or zero_extract as well.

STV doesn't seem to do anything with notes and DF doesn't track uses in
notes (eh).  So it's probably safest to kill all of them on converted
insns?!  For the timode chain we update equal/equiv notes for REG dests.

I have a patch.
Comment 2 Richard Biener 2019-08-26 10:36:30 UTC
Author: rguenth
Date: Mon Aug 26 10:35:59 2019
New Revision: 274926

URL: https://gcc.gnu.org/viewcvs?rev=274926&root=gcc&view=rev
Log:
2019-08-26  Richard Biener  <rguenther@suse.de>

	PR target/91522
	PR target/91527
	* config/i386/i386-features.h (general_scalar_chain::defs_map):
	New member.
	(general_scalar_chain::replace_with_subreg): Remove.
	(general_scalar_chain::replace_with_subreg_in_insn): Likewise.
	(general_scalar_chain::convert_reg): Adjust signature.
	* config/i386/i386-features.c (scalar_chain::add_insn): Do not
	iterate over all defs of a reg.
	(general_scalar_chain::replace_with_subreg): Remove.
	(general_scalar_chain::replace_with_subreg_in_insn): Likewise.
	(general_scalar_chain::make_vector_copies): Populate defs_map,
	place copy only after defs that are used as vectors in the chain.
	(general_scalar_chain::convert_reg): Emit a copy for a specific
	def in a specific instruction.
	(general_scalar_chain::convert_op): All reg uses are converted here.
	(general_scalar_chain::convert_insn): Emit copies for scalar
	uses of defs here.  Replace uses with the copies we created.
	Replace and convert the def.  Adjust REG_DEAD notes, remove
	REG_EQUIV/EQUAL notes.
	(general_scalar_chain::convert_registers): Only handle copies
	into the chain here.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386-features.c
    trunk/gcc/config/i386/i386-features.h
Comment 3 Richard Biener 2019-08-26 10:39:18 UTC
Fixed.