* [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
@ 2022-07-18 15:33 ` mpolacek at gcc dot gnu.org
2022-07-18 15:35 ` mpolacek at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-07-18 15:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
Marek Polacek <mpolacek at gcc dot gnu.org> 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
2022-07-18 15:33 ` [Bug target/106342] " mpolacek at gcc dot gnu.org
@ 2022-07-18 15:35 ` mpolacek at gcc dot gnu.org
2022-07-19 6:40 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-07-18 15:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
gcc.dg/vect/fast-math-vect-call-1.c also ICEs like that.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
2022-07-18 15:33 ` [Bug target/106342] " mpolacek at gcc dot gnu.org
2022-07-18 15:35 ` mpolacek at gcc dot gnu.org
@ 2022-07-19 6:40 ` rguenth at gcc dot gnu.org
2022-07-19 10:34 ` marxin at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-07-19 6:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
` (2 preceding siblings ...)
2022-07-19 6:40 ` rguenth at gcc dot gnu.org
@ 2022-07-19 10:34 ` marxin at gcc dot gnu.org
2022-07-19 18:09 ` mpolacek at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-19 10:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Hm, can you see it with a cross compiler (me now)?
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
` (3 preceding siblings ...)
2022-07-19 10:34 ` marxin at gcc dot gnu.org
@ 2022-07-19 18:09 ` mpolacek at gcc dot gnu.org
2022-07-20 8:13 ` [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699 marxin at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-07-19 18:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
` (4 preceding siblings ...)
2022-07-19 18:09 ` mpolacek at gcc dot gnu.org
@ 2022-07-20 8:13 ` marxin at gcc dot gnu.org
2022-07-28 17:08 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-20 8:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
Martin Liška <marxin at gcc dot gnu.org> 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 <marxin at gcc dot gnu.org> ---
Started with r12-4240-g2b8453c401b699 where vectorization was enabled for -O2.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
` (5 preceding siblings ...)
2022-07-20 8:13 ` [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699 marxin at gcc dot gnu.org
@ 2022-07-28 17:08 ` jakub at gcc dot gnu.org
2022-07-28 22:29 ` iii at linux dot ibm.com
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-07-28 17:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
Jakub Jelinek <jakub at gcc dot gnu.org> 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 <jakub at gcc dot gnu.org> ---
I think the problem is in the
r11-3816-ga1a10a0b8c4e161070f88de3af9d20f9f866a23f
change. The "copysign<mode>3" 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<mode>" 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 "copysign<mode>3" 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.jj 2022-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 "copysign<mode>3"
- [(set (match_operand:VFT 0 "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>mode);
or perhaps something like:
--- gcc/config/s390/vector.md.jj 2022-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 "copysign<mode>3"
[(set (match_operand:VFT 0 "register_operand" "")
@@ -1731,6 +1738,20 @@
(match_operand:VFT 1 "register_operand" ""))))]
"TARGET_VX"
{
+ if (GET_MODE_SIZE (<MODE>mode) < 16)
+ {
+ rtx op0 = gen_reg_rtx (<hw_vec>mode), op1, op2;
+ op1 = simplify_gen_subreg (<hw_vec>mode,
+ force_reg (<MODE>mode, operands[1]),
+ <MODE>mode, 0);
+ op2 = simplify_gen_subreg (<hw_vec>mode,
+ force_reg (<MODE>mode, operands[2]),
+ <MODE>mode, 0);
+ emit_insn (gen_copysign<hw_vec_l>3 (op0, op1, op2));
+ emit_move_insn (operands[0],
+ simplify_gen_subreg (<MODE>mode, op0, <hw_vec>mode, 0));
+ DONE;
+ }
rtx mask = s390_build_signbit_mask (<MODE>mode);
operands[3] = force_reg (<MODE>mode, mask);
})
(dunno whether to use simplify_gen_subreg or lowpart_subreg or
simplify_gen_subreg with 8).
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
` (6 preceding siblings ...)
2022-07-28 17:08 ` jakub at gcc dot gnu.org
@ 2022-07-28 22:29 ` iii at linux dot ibm.com
2022-07-29 7:31 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: iii at linux dot ibm.com @ 2022-07-28 22:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
Ilya Leoshkevich <iii at linux dot ibm.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |iii at linux dot ibm.com
--- Comment #6 from Ilya Leoshkevich <iii at linux dot ibm.com> ---
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
` (7 preceding siblings ...)
2022-07-28 22:29 ` iii at linux dot ibm.com
@ 2022-07-29 7:31 ` jakub at gcc dot gnu.org
2022-08-10 10:36 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-07-29 7:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Maybe.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
` (8 preceding siblings ...)
2022-07-29 7:31 ` jakub at gcc dot gnu.org
@ 2022-08-10 10:36 ` jakub at gcc dot gnu.org
2023-04-19 14:32 ` [Bug target/106342] [12/13/14 " iii at linux dot ibm.com
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-08-10 10:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
commit r13-1955-g2f17f489de47d46626ed85804c3b810547ef550e
Author: Ilya Leoshkevich <iii@linux.ibm.com>
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<mode> is supposed to recognize, but can't,
because it's not defined for V2SF. Fix by defining it for all vector
modes supported by copysign<mode>3.
gcc/ChangeLog:
* config/s390/vector.md (V_HW_FT): New iterator.
* config/s390/vx-builtins.md (vsel<mode>): 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)?
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13/14 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
` (9 preceding siblings ...)
2022-08-10 10:36 ` jakub at gcc dot gnu.org
@ 2023-04-19 14:32 ` iii at linux dot ibm.com
2023-05-08 12:25 ` rguenth at gcc dot gnu.org
2024-03-15 1:15 ` law at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: iii at linux dot ibm.com @ 2023-04-19 14:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
--- Comment #10 from Ilya Leoshkevich <iii at linux dot ibm.com> ---
This bug was fixed and backported to gcc-12:
commit 06254d97b8fa3a5d1c8b6b4e091d851700801385
Author: Ilya Leoshkevich <iii@linux.ibm.com>
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<mode> is supposed to recognize, but can't,
because it's not defined for V2SF. Fix by defining it for all vector
modes supported by copysign<mode>3.
gcc/ChangeLog:
* config/s390/vector.md (V_HW_FT): New iterator.
* config/s390/vx-builtins.md (vsel<mode>): Use V_HW_FT instead
of V_HW.
(cherry picked from commit 2f17f489de47d46626ed85804c3b810547ef550e)
I think it should be closed.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13/14 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
` (10 preceding siblings ...)
2023-04-19 14:32 ` [Bug target/106342] [12/13/14 " iii at linux dot ibm.com
@ 2023-05-08 12:25 ` rguenth at gcc dot gnu.org
2024-03-15 1:15 ` law at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-08 12:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|12.3 |12.4
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 12.3 is being released, retargeting bugs to GCC 12.4.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/106342] [12/13/14 Regression] internal compiler error: in extract_insn, at recog.cc:2791 since r12-4240-g2b8453c401b699
2022-07-18 15:32 [Bug target/106342] New: [12/13 Regression] internal compiler error: in extract_insn, at recog.cc:2791 mpolacek at gcc dot gnu.org
` (11 preceding siblings ...)
2023-05-08 12:25 ` rguenth at gcc dot gnu.org
@ 2024-03-15 1:15 ` law at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-15 1:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106342
Jeffrey A. Law <law at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |law at gcc dot gnu.org
Resolution|--- |FIXED
--- Comment #12 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Per c#8 and c#10.
^ permalink raw reply [flat|nested] 14+ messages in thread