diff options
author | Kewen Lin <linkw@linux.ibm.com> | 2023-12-20 23:20:19 -0600 |
---|---|---|
committer | Kewen Lin <linkw@linux.ibm.com> | 2023-12-20 23:32:05 -0600 |
commit | 5fbc77726f68a35a938c829fe259d6c376d608ca (patch) | |
tree | 161525dc441e608968a95df3ea7ca9ebb17941ba /gcc/c/c-decl.cc | |
parent | 586e32583a0cdba9ecc6bc914bd12465c0280c22 (diff) | |
download | gcc-5fbc77726f68a35a938c829fe259d6c376d608ca.zip gcc-5fbc77726f68a35a938c829fe259d6c376d608ca.tar.gz gcc-5fbc77726f68a35a938c829fe259d6c376d608ca.tar.bz2 |
sel-sched: Verify change before replacing dest in EXPR_INSN_RTX [PR112995]
PR112995 exposed one issue in current try_replace_dest_reg
that the result rtx insn after replace_dest_with_reg_in_expr
is probably unable to match any constraints. Although there
are some checks on the changes onto dest or src of orig_insn,
none is performed on the EXPR_INSN_RTX.
Initially we have:
(insn 31 6 10 2 (set (reg/v:SI 9 9 [orig:119 c ] [119])
(reg/v:SI 64 0 [orig:119 c ] [119]))
"test.i":5:5 555 {*movsi_internal1} ... )
...
(insn 25 10 27 2 (set (reg:DI 64 0 [135])
(sign_extend:DI
(reg/v:SI 9 9 [orig:119 c ] [119])))
"test.i":6:5 31 {extendsidi2} ...)
with moving up, we have:
(insn 46 0 0 (set (reg:DI 64 0 [135])
(sign_extend:DI
(reg/v:SI 64 0 [orig:119 c ] [119])))
31 {extendsidi2} ...)
in try_replace_dest_reg, we updated the above EXPR_INSN_RTX to:
(insn 48 0 0 (set (reg:DI 32 0)
(sign_extend:DI
(reg/v:SI 64 0 [orig:119 c ] [119])))
31 {extendsidi2} ...)
The dest (reg 64) is a VR (also VSX REG), the updating makes
it become to (reg 32) which is a FPR (also VSX REG), we have
an alternative to match "VR,VR" but no one to match "FPR/VSX,
VR/VSX", so it fails with ICE.
This patch is to add the check before actually replacing dest
in expr with reg.
PR rtl-optimization/112995
gcc/ChangeLog:
* sel-sched.cc (try_replace_dest_reg): Check the validity of the
replaced insn before actually replacing dest in expr.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr112995.c: New test.
Diffstat (limited to 'gcc/c/c-decl.cc')
0 files changed, 0 insertions, 0 deletions