* [Bug middle-end/97487] [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
@ 2020-10-19 9:47 ` rguenth at gcc dot gnu.org
2020-10-19 12:13 ` [Bug middle-end/97487] [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r10-1420-g744fd446c321f78f marxin at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-19 9:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.3
Keywords| |openmp
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r10-1420-g744fd446c321f78f
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
2020-10-19 9:47 ` [Bug middle-end/97487] " rguenth at gcc dot gnu.org
@ 2020-10-19 12:13 ` marxin at gcc dot gnu.org
2020-10-19 17:57 ` jakub at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-19 12:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11 Regression] ICE in |[10/11 Regression] ICE in
|expand_simple_binop, at |expand_simple_binop, at
|optabs.c:939 |optabs.c:939 since
| |r10-1420-g744fd446c321f78f
Last reconfirmed| |2020-10-19
Status|UNCONFIRMED |NEW
Known to fail| |10.2.0, 11.0
Known to work| |9.3.0
Ever confirmed|0 |1
CC| |marxin at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r10-1420-g744fd446c321f78f.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r10-1420-g744fd446c321f78f
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
2020-10-19 9:47 ` [Bug middle-end/97487] " rguenth at gcc dot gnu.org
2020-10-19 12:13 ` [Bug middle-end/97487] [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r10-1420-g744fd446c321f78f marxin at gcc dot gnu.org
@ 2020-10-19 17:57 ` jakub at gcc dot gnu.org
2020-10-20 8:13 ` [Bug middle-end/97487] [8/9/10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977 jakub at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-19 17:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
ifcvt throws random expressions as operand to expand_binop, which in turn
attempts to force_operand them, but force_operand handles only the most common
rtls (e.g. for binops only those that have corresponding binop optab, similarly
for unops etc.).
In this case the SET_SRC and thus if_info->b is a VEC_SELECT which
force_operand isn't able to handle (but there are many others that can't be
handled either).
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [8/9/10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
` (2 preceding siblings ...)
2020-10-19 17:57 ` jakub at gcc dot gnu.org
@ 2020-10-20 8:13 ` jakub at gcc dot gnu.org
2021-01-14 9:26 ` rguenth at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-20 8:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|openmp |
Summary|[10/11 Regression] ICE in |[8/9/10/11 Regression] ICE
|expand_simple_binop, at |in expand_simple_binop, at
|optabs.c:939 since |optabs.c:939 since r8-3977
|r10-1420-g744fd446c321f78f |
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Also, the PR has nothing to do with OpenMP:
-O2 --param max-rtl-if-conversion-unpredictable-cost=0 on x86_64-linux ICEs
too:
typedef long long int V __attribute__((vector_size (16)));
long long int
foo (V x, V y)
{
long long int t1 = y[0];
long long int t2 = x[0];
long long int t3;
if (t2 < 0)
t3 = t1;
else
t3 = 0;
return t3;
}
And that started with r8-3977-gef9eec0b599d533b58e29fe0c0bf6435e5368378 (latent
before because of different costs).
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [8/9/10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
` (3 preceding siblings ...)
2020-10-20 8:13 ` [Bug middle-end/97487] [8/9/10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977 jakub at gcc dot gnu.org
@ 2021-01-14 9:26 ` rguenth at gcc dot gnu.org
2021-02-01 16:45 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-14 9:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
Target| |x86_64-*-*
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [8/9/10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
` (4 preceding siblings ...)
2021-01-14 9:26 ` rguenth at gcc dot gnu.org
@ 2021-02-01 16:45 ` jakub at gcc dot gnu.org
2021-02-03 8:10 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-01 16:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 50112
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50112&action=edit
gcc11-pr97487.patch
Untested fix.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [8/9/10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
` (5 preceding siblings ...)
2021-02-01 16:45 ` jakub at gcc dot gnu.org
@ 2021-02-03 8:10 ` cvs-commit at gcc dot gnu.org
2021-02-03 8:12 ` [Bug middle-end/97487] [8/9/10 " jakub at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-03 8:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:176c7bd840a3902e9e67eb0796de362677905f56
commit r11-7052-g176c7bd840a3902e9e67eb0796de362677905f56
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Feb 3 09:09:26 2021 +0100
ifcvt: Avoid ICEs trying to force_operand random RTL [PR97487]
As the testcase shows, RTL ifcvt can throw random RTL (whatever it found in
some insns) at expand_binop or expand_unop and expects it to do something
(and then will check if it created valid insns and punts if not).
These functions in the end if the operands don't match try to
copy_to_mode_reg the operands, which does
if (!general_operand (x, VOIDmode))
x = force_operand (x, temp);
but, force_operand is far from handling all possible RTLs, it will ICE for
all more unusual RTL codes. Basically handles just simple arithmetic and
unary RTL operations if they have an optab and
expand_simple_binop/expand_simple_unop ICE on others.
The following patch fixes it by adding some operand verification (whether
there is a hope that copy_to_mode_reg will succeed on those). It is added
both to noce_emit_move_insn (not needed for this exact testcase,
that function simply tries to recog the insn as is and if it fails,
handles some simple binop/unop cases; the patch performs the verification
of their operands) and noce_try_sign_mask.
2021-02-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/97487
* ifcvt.c (noce_can_force_operand): New function.
(noce_emit_move_insn): Use it.
(noce_try_sign_mask): Likewise. Formatting fix.
* gcc.dg/pr97487-1.c: New test.
* gcc.dg/pr97487-2.c: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [8/9/10 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
` (6 preceding siblings ...)
2021-02-03 8:10 ` cvs-commit at gcc dot gnu.org
@ 2021-02-03 8:12 ` jakub at gcc dot gnu.org
2021-03-19 23:28 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-03 8:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[8/9/10/11 Regression] ICE |[8/9/10 Regression] ICE in
|in expand_simple_binop, at |expand_simple_binop, at
|optabs.c:939 since r8-3977 |optabs.c:939 since r8-3977
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [8/9/10 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
` (7 preceding siblings ...)
2021-02-03 8:12 ` [Bug middle-end/97487] [8/9/10 " jakub at gcc dot gnu.org
@ 2021-03-19 23:28 ` cvs-commit at gcc dot gnu.org
2021-03-20 8:06 ` [Bug middle-end/97487] [8/9 " jakub at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-19 23:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:025a0ee3911c0866c69f841df24a558c7c8df0eb
commit r10-9463-g025a0ee3911c0866c69f841df24a558c7c8df0eb
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Feb 3 09:09:26 2021 +0100
ifcvt: Avoid ICEs trying to force_operand random RTL [PR97487]
As the testcase shows, RTL ifcvt can throw random RTL (whatever it found in
some insns) at expand_binop or expand_unop and expects it to do something
(and then will check if it created valid insns and punts if not).
These functions in the end if the operands don't match try to
copy_to_mode_reg the operands, which does
if (!general_operand (x, VOIDmode))
x = force_operand (x, temp);
but, force_operand is far from handling all possible RTLs, it will ICE for
all more unusual RTL codes. Basically handles just simple arithmetic and
unary RTL operations if they have an optab and
expand_simple_binop/expand_simple_unop ICE on others.
The following patch fixes it by adding some operand verification (whether
there is a hope that copy_to_mode_reg will succeed on those). It is added
both to noce_emit_move_insn (not needed for this exact testcase,
that function simply tries to recog the insn as is and if it fails,
handles some simple binop/unop cases; the patch performs the verification
of their operands) and noce_try_sign_mask.
2021-02-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/97487
* ifcvt.c (noce_can_force_operand): New function.
(noce_emit_move_insn): Use it.
(noce_try_sign_mask): Likewise. Formatting fix.
* gcc.dg/pr97487-1.c: New test.
* gcc.dg/pr97487-2.c: New test.
(cherry picked from commit 176c7bd840a3902e9e67eb0796de362677905f56)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [8/9 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
` (8 preceding siblings ...)
2021-03-19 23:28 ` cvs-commit at gcc dot gnu.org
@ 2021-03-20 8:06 ` jakub at gcc dot gnu.org
2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-20 8:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[8/9/10 Regression] ICE in |[8/9 Regression] ICE in
|expand_simple_binop, at |expand_simple_binop, at
|optabs.c:939 since r8-3977 |optabs.c:939 since r8-3977
Target Milestone|10.3 |8.5
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.3 too.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [8/9 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
` (9 preceding siblings ...)
2021-03-20 8:06 ` [Bug middle-end/97487] [8/9 " jakub at gcc dot gnu.org
@ 2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:50 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:07 ` jakub at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-20 23:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:e55dc66ddefebef79f8d733ba6eb835c7b52d7ec
commit r9-9415-ge55dc66ddefebef79f8d733ba6eb835c7b52d7ec
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Feb 3 09:09:26 2021 +0100
ifcvt: Avoid ICEs trying to force_operand random RTL [PR97487]
As the testcase shows, RTL ifcvt can throw random RTL (whatever it found in
some insns) at expand_binop or expand_unop and expects it to do something
(and then will check if it created valid insns and punts if not).
These functions in the end if the operands don't match try to
copy_to_mode_reg the operands, which does
if (!general_operand (x, VOIDmode))
x = force_operand (x, temp);
but, force_operand is far from handling all possible RTLs, it will ICE for
all more unusual RTL codes. Basically handles just simple arithmetic and
unary RTL operations if they have an optab and
expand_simple_binop/expand_simple_unop ICE on others.
The following patch fixes it by adding some operand verification (whether
there is a hope that copy_to_mode_reg will succeed on those). It is added
both to noce_emit_move_insn (not needed for this exact testcase,
that function simply tries to recog the insn as is and if it fails,
handles some simple binop/unop cases; the patch performs the verification
of their operands) and noce_try_sign_mask.
2021-02-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/97487
* ifcvt.c (noce_can_force_operand): New function.
(noce_emit_move_insn): Use it.
(noce_try_sign_mask): Likewise. Formatting fix.
* gcc.dg/pr97487-1.c: New test.
* gcc.dg/pr97487-2.c: New test.
(cherry picked from commit 025a0ee3911c0866c69f841df24a558c7c8df0eb)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [8/9 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
` (10 preceding siblings ...)
2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 16:50 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:07 ` jakub at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-22 16:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:0afc3f561b5cf66d1ee9562369919ca19273c260
commit r8-10880-g0afc3f561b5cf66d1ee9562369919ca19273c260
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Feb 3 09:09:26 2021 +0100
ifcvt: Avoid ICEs trying to force_operand random RTL [PR97487]
As the testcase shows, RTL ifcvt can throw random RTL (whatever it found in
some insns) at expand_binop or expand_unop and expects it to do something
(and then will check if it created valid insns and punts if not).
These functions in the end if the operands don't match try to
copy_to_mode_reg the operands, which does
if (!general_operand (x, VOIDmode))
x = force_operand (x, temp);
but, force_operand is far from handling all possible RTLs, it will ICE for
all more unusual RTL codes. Basically handles just simple arithmetic and
unary RTL operations if they have an optab and
expand_simple_binop/expand_simple_unop ICE on others.
The following patch fixes it by adding some operand verification (whether
there is a hope that copy_to_mode_reg will succeed on those). It is added
both to noce_emit_move_insn (not needed for this exact testcase,
that function simply tries to recog the insn as is and if it fails,
handles some simple binop/unop cases; the patch performs the verification
of their operands) and noce_try_sign_mask.
2021-02-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/97487
* ifcvt.c (noce_can_force_operand): New function.
(noce_emit_move_insn): Use it.
(noce_try_sign_mask): Likewise. Formatting fix.
* gcc.dg/pr97487-1.c: New test.
* gcc.dg/pr97487-2.c: New test.
(cherry picked from commit 025a0ee3911c0866c69f841df24a558c7c8df0eb)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/97487] [8/9 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977
2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com
` (11 preceding siblings ...)
2021-04-22 16:50 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 17:07 ` jakub at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-22 17:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 14+ messages in thread