[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 Richard Biener changed: What|Removed |Added Target Milestone|12.2|12.3 --- Comment #9 from Richard Biener --- GCC 12.2 is being released, retargeting bugs to GCC 12.3.
[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 --- Comment #8 from Jakub Jelinek --- commit r13-1955-g2f17f489de47d46626ed85804c3b810547ef550e Author: Ilya Leoshkevich Date: Fri Jul 29 16:14:10 2022 +0200 PR106342 - IBM zSystems: Provide vsel for all vector modes dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3 produces an insn that vsel is supposed to recognize, but can't, because it's not defined for V2SF. Fix by defining it for all vector modes supported by copysign3. gcc/ChangeLog: * config/s390/vector.md (V_HW_FT): New iterator. * config/s390/vx-builtins.md (vsel): Use V_HW_FT instead of V_HW. Unfortunately the commit didn't contain the PR number in the format hooks want. Are you going to backport this to 12.2 (RC this Friday)?
[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 --- Comment #7 from Jakub Jelinek --- Maybe.
[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 Ilya Leoshkevich changed: What|Removed |Added CC||iii at linux dot ibm.com --- Comment #6 from Ilya Leoshkevich --- Maybe that's something obvious, but still: wouldn't adding V1SF, V2SF, and V1DF to vsel also work? E.g. by changing it from using V_HW to using VT.
[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 Jakub Jelinek changed: What|Removed |Added CC||iii at gcc dot gnu.org, ||jakub at gcc dot gnu.org, ||krebbel at gcc dot gnu.org --- Comment #5 from Jakub Jelinek --- I think the problem is in the r11-3816-ga1a10a0b8c4e161070f88de3af9d20f9f866a23f change. The "copysign3" expander in config/s390/vector.md uses VFT iterator, I assume if_then_else form it was using has intructions covering all those modes, but after the change it attempts to match the "vsel" pattern from config/s390/vx-builtins.md, which uses just the V_HW iterator. VFT is V1DF V2DF without TARGET_VXE and V1SF V2SF V4SF V1DF V2DF V1TF TF with TARGET_VXE, while V_HW is V16QI V8HI V4SI V2DI V2DF without TARGET_VXE and V16QI V8HI V4SI V2DI V1TI V2DF V4SF V1TF TF with TARGET_VXE. So, for V1SF V2SF V1DF modes copysign pattern will expand to something that will not match an actual pattern. So, either "copysign3" expander in config/s390/vector.md should use VF_HW iterator instead of VFT (and thus not support V1SF, V2SF and V1DF modes), or because presumably vsel doesn't raise exceptions, it could just use a wider mode for those cases. Thus, either: --- gcc/config/s390/vector.md.jj2022-01-11 23:11:21.985295845 +0100 +++ gcc/config/s390/vector.md 2022-07-28 17:39:19.968033927 +0200 @@ -1723,12 +1723,12 @@ ; Vector copysign, implement using vector select (define_expand "copysign3" - [(set (match_operand:VFT0 "register_operand" "") - (ior:VFT -(and:VFT (match_operand:VFT 2 "register_operand" "") - (match_dup 3)) -(and:VFT (not:VFT (match_dup 3)) - (match_operand:VFT 1 "register_operand" ""] + [(set (match_operand:VF_HW 0 "register_operand" "") + (ior:VF_HW +(and:VF_HW (match_operand:VF_HW 2 "register_operand" "") + (match_dup 3)) +(and:VF_HW (not:VF_HW (match_dup 3)) + (match_operand:VF_HW 1 "register_operand" ""] "TARGET_VX" { rtx mask = s390_build_signbit_mask (mode); or perhaps something like: --- gcc/config/s390/vector.md.jj2022-01-11 23:11:21.985295845 +0100 +++ gcc/config/s390/vector.md 2022-07-28 19:02:06.527108712 +0200 @@ -1721,6 +1721,13 @@ operands[4] = CONST0_RTX (V2DImode); }) +(define_mode_attr hw_vec[(V1SF "V4SF") (V2SF "V4SF") (V4SF "V4SF") +(V1DF "V2DF") (V2DF "V2DF") +(V1TF "V1TF") (TF "TF")]) +(define_mode_attr hw_vec_l[(V1SF "v4sf") (V2SF "v4sf") (V4SF "v4sf") + (V1DF "v2df") (V2DF "v2df") + (V1TF "v1tf") (TF "tf")]) + ; Vector copysign, implement using vector select (define_expand "copysign3" [(set (match_operand:VFT0 "register_operand" "") @@ -1731,6 +1738,20 @@ (match_operand:VFT 1 "register_operand" ""] "TARGET_VX" { + if (GET_MODE_SIZE (mode) < 16) +{ + rtx op0 = gen_reg_rtx (mode), op1, op2; + op1 = simplify_gen_subreg (mode, +force_reg (mode, operands[1]), +mode, 0); + op2 = simplify_gen_subreg (mode, +force_reg (mode, operands[2]), +mode, 0); + emit_insn (gen_copysign3 (op0, op1, op2)); + emit_move_insn (operands[0], + simplify_gen_subreg (mode, op0, mode, 0)); + DONE; +} rtx mask = s390_build_signbit_mask (mode); operands[3] = force_reg (mode, mask); }) (dunno whether to use simplify_gen_subreg or lowpart_subreg or simplify_gen_subreg with 8).
[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 Martin Liška changed: What|Removed |Added Ever confirmed|0 |1 Keywords|needs-bisection | Status|UNCONFIRMED |NEW Last reconfirmed||2022-07-20 Summary|[12/13 Regression] internal |[12/13 Regression] internal |compiler error: in |compiler error: in |extract_insn, at|extract_insn, at |recog.cc:2791 |recog.cc:2791 since ||r12-4240-g2b8453c401b699 --- Comment #4 from Martin Liška --- Started with r12-4240-g2b8453c401b699 where vectorization was enabled for -O2.
[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 --- Comment #3 from Marek Polacek --- Ah, -march=z14 is needed: $ ./cc1 -quiet -O2 pr104612.c -Iinclude -march=z14 -mtune=z15 pr104612.c: In function ‘foo’: pr104612.c:15:1: error: unrecognizable insn: 15 | } | ^ (insn 9 8 10 2 (set (reg:V2SF 61 [ vect__2.10 ]) (ior:V2SF (and:V2SF (subreg:V2SF (reg/v:DI 63 [ v ]) 0) (reg:V2SF 65)) (and:V2SF (not:V2SF (reg:V2SF 65)) (reg:V2SF 64 "pr104612.c":12:11 -1 (nil)) during RTL pass: vregs pr104612.c:15:1: internal compiler error: in extract_insn, at recog.cc:2791 0x68616c _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /home/mpolacek/src/gcc/gcc/rtl-error.cc:108 0x686188 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) /home/mpolacek/src/gcc/gcc/rtl-error.cc:116 0x684bf1 extract_insn(rtx_insn*) /home/mpolacek/src/gcc/gcc/recog.cc:2791 0xaabc10 instantiate_virtual_regs_in_insn /home/mpolacek/src/gcc/gcc/function.cc:1611 0xaabc10 instantiate_virtual_regs /home/mpolacek/src/gcc/gcc/function.cc:1985 0xaabc10 execute /home/mpolacek/src/gcc/gcc/function.cc:2034
[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 --- Comment #2 from Martin Liška --- Hm, can you see it with a cross compiler (me now)?
[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 Richard Biener changed: What|Removed |Added Priority|P3 |P2
[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 --- Comment #1 from Marek Polacek --- gcc.dg/vect/fast-math-vect-call-1.c also ICEs like that.
[Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342 Marek Polacek changed: What|Removed |Added Target Milestone|--- |12.2 Target||s390x-redhat-linux Host||s390x-redhat-linux Build||s390x-redhat-linux Keywords||ice-on-valid-code