This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/78904] zero-extracts are not effective
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 22 Dec 2016 17:59:45 +0000
- Subject: [Bug middle-end/78904] zero-extracts are not effective
- Auto-submitted: auto-generated
- References: <bug-78904-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78904
Segher Boessenkool <segher at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-12-22
Ever confirmed|0 |1
--- Comment #1 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Before combine we have
===
(insn 9 7 10 2 (set (subreg:SI (reg:QI 97) 0)
(zero_extract:SI (reg/v:SI 95 [ b ])
(const_int 8 [0x8])
(const_int 8 [0x8]))) "78904.c":12 105 {*extzvsi}
(expr_list:REG_DEAD (reg/v:SI 95 [ b ])
(nil)))
(insn 10 9 11 2 (set (subreg:SI (reg:QI 98 [ a$val ]) 0)
(zero_extract:SI (reg/v:SI 94 [ a ])
(const_int 8 [0x8])
(const_int 8 [0x8]))) "78904.c":12 105 {*extzvsi}
(nil))
(insn 11 10 26 2 (parallel [
(set (reg:QI 88 [ _2 ])
(plus:QI (reg:QI 97)
(reg:QI 98 [ a$val ])))
(clobber (reg:CC 17 flags))
]) "78904.c":12 214 {*addqi_1}
(expr_list:REG_DEAD (reg:QI 98 [ a$val ])
(expr_list:REG_DEAD (reg:QI 97)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))))
(insn 13 12 14 2 (set (zero_extract:SI (reg:SI 92 [ D.1801 ])
(const_int 8 [0x8])
(const_int 8 [0x8]))
(subreg:SI (reg:QI 88 [ _2 ]) 0)) "78904.c":14 109 {insvsi_1}
(expr_list:REG_DEAD (reg:QI 88 [ _2 ])
(nil)))
===
and combine then does
===
Trying 10, 9 -> 11:
Failed to match this instruction:
(parallel [
(set (reg:QI 88 [ _2 ])
(plus:QI (subreg:QI (zero_extract:SI (reg/v:SI 94 [ a ])
(const_int 8 [0x8])
(const_int 8 [0x8])) 0)
(subreg:QI (zero_extract:SI (reg/v:SI 95 [ b ])
(const_int 8 [0x8])
(const_int 8 [0x8])) 0)))
(clobber (reg:CC 17 flags))
])
===
and then it later tries 10, 9 -> 11 and 9, 11 -> 13 etc., but you need
11, 10, 9 -> 13 to match your insn pattern.
Maybe you want a pattern for the result of 10, 9 -> 11? It is a valid
insn for i386 I think?