* [Bug target/112845] [11/12/13/14 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504
2023-12-04 14:04 [Bug target/112845] New: ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c iamanonymous.cs at gmail dot com
@ 2023-12-04 15:35 ` jakub at gcc dot gnu.org
2023-12-04 15:38 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-04 15:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112845
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
Last reconfirmed| |2023-12-04
Status|UNCONFIRMED |ASSIGNED
CC| |jakub at gcc dot gnu.org
Summary|ICE: in extract_insn, at |[11/12/13/14 Regression]
|recog.cc:2804 with -Os |ICE: in extract_insn, at
|-fcf-protection -c |recog.cc:2804 with -Os
| |-fcf-protection -c since
| |r8-3504
Ever confirmed|0 |1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Guess introduced by my r8-3504-g2891beff1aa8e627ba27b35d28d6a8e6198a0625
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/112845] [11/12/13/14 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504
2023-12-04 14:04 [Bug target/112845] New: ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c iamanonymous.cs at gmail dot com
2023-12-04 15:35 ` [Bug target/112845] [11/12/13/14 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504 jakub at gcc dot gnu.org
@ 2023-12-04 15:38 ` jakub at gcc dot gnu.org
2023-12-04 15:38 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-04 15:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112845
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/112845] [11/12/13/14 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504
2023-12-04 14:04 [Bug target/112845] New: ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c iamanonymous.cs at gmail dot com
2023-12-04 15:35 ` [Bug target/112845] [11/12/13/14 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504 jakub at gcc dot gnu.org
2023-12-04 15:38 ` jakub at gcc dot gnu.org
@ 2023-12-04 15:38 ` jakub at gcc dot gnu.org
2023-12-05 12:18 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-04 15:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112845
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 56788
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56788&action=edit
gcc14-pr112845.patch
Untested fix.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/112845] [11/12/13/14 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504
2023-12-04 14:04 [Bug target/112845] New: ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c iamanonymous.cs at gmail dot com
` (2 preceding siblings ...)
2023-12-04 15:38 ` jakub at gcc dot gnu.org
@ 2023-12-05 12:18 ` cvs-commit at gcc dot gnu.org
2023-12-05 12:19 ` [Bug target/112845] [11/12/13 " jakub at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-05 12:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112845
--- Comment #3 from GCC 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:e0786ca9a18c50ad08c40936b228e325193664b8
commit r14-6180-ge0786ca9a18c50ad08c40936b228e325193664b8
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Dec 5 13:17:57 2023 +0100
i386: Fix -fcf-protection -Os ICE due to movabsq peephole2 [PR112845]
The following testcase ICEs in the movabsq $(i32 << shift), r64 peephole2
I've added a while back to use smaller code than movabsq if possible.
If i32 is 0xfa1e0ff3 and shift is not divisible by 8, then it creates
an invalid insn (as 0xfa1e0ff3 CONST_INT is not allowed as
x86_64_immediate_operand nor x86_64_zext_immediate_operand), the peephole2
even triggers on it again and again (this time with shift 0) until it gives
up.
The following patch fixes that. As ix86_endbr_immediate_operand needs a
CONST_INT and it is hopefully rare, I chose to use FAIL rather than
handling
it in the condition (where I'd probably need to call ctz_hwi again etc.).
2023-12-05 Jakub Jelinek <jakub@redhat.com>
PR target/112845
* config/i386/i386.md (movabsq $(i32 << shift), r64 peephole2):
FAIL
if the new immediate is ix86_endbr_immediate_operand.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/112845] [11/12/13 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504
2023-12-04 14:04 [Bug target/112845] New: ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c iamanonymous.cs at gmail dot com
` (3 preceding siblings ...)
2023-12-05 12:18 ` cvs-commit at gcc dot gnu.org
@ 2023-12-05 12:19 ` jakub at gcc dot gnu.org
2023-12-05 16:33 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-05 12:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112845
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[11/12/13/14 Regression] |[11/12/13 Regression] ICE:
|ICE: in extract_insn, at |in extract_insn, at
|recog.cc:2804 with -Os |recog.cc:2804 with -Os
|-fcf-protection -c since |-fcf-protection -c since
|r8-3504 |r8-3504
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/112845] [11/12/13 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504
2023-12-04 14:04 [Bug target/112845] New: ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c iamanonymous.cs at gmail dot com
` (4 preceding siblings ...)
2023-12-05 12:19 ` [Bug target/112845] [11/12/13 " jakub at gcc dot gnu.org
@ 2023-12-05 16:33 ` cvs-commit at gcc dot gnu.org
2023-12-05 17:02 ` [Bug target/112845] [11/12 " jakub at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-05 16:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112845
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:8d057d1f1fe5bf20d32912bc65ad620810583107
commit r13-8127-g8d057d1f1fe5bf20d32912bc65ad620810583107
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Dec 5 13:17:57 2023 +0100
i386: Fix -fcf-protection -Os ICE due to movabsq peephole2 [PR112845]
The following testcase ICEs in the movabsq $(i32 << shift), r64 peephole2
I've added a while back to use smaller code than movabsq if possible.
If i32 is 0xfa1e0ff3 and shift is not divisible by 8, then it creates
an invalid insn (as 0xfa1e0ff3 CONST_INT is not allowed as
x86_64_immediate_operand nor x86_64_zext_immediate_operand), the peephole2
even triggers on it again and again (this time with shift 0) until it gives
up.
The following patch fixes that. As ix86_endbr_immediate_operand needs a
CONST_INT and it is hopefully rare, I chose to use FAIL rather than
handling
it in the condition (where I'd probably need to call ctz_hwi again etc.).
2023-12-05 Jakub Jelinek <jakub@redhat.com>
PR target/112845
* config/i386/i386.md (movabsq $(i32 << shift), r64 peephole2):
FAIL
if the new immediate is ix86_endbr_immediate_operand.
(cherry picked from commit e0786ca9a18c50ad08c40936b228e325193664b8)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/112845] [11/12 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504
2023-12-04 14:04 [Bug target/112845] New: ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c iamanonymous.cs at gmail dot com
` (5 preceding siblings ...)
2023-12-05 16:33 ` cvs-commit at gcc dot gnu.org
@ 2023-12-05 17:02 ` jakub at gcc dot gnu.org
2023-12-16 0:38 ` cvs-commit at gcc dot gnu.org
2023-12-17 13:55 ` cvs-commit at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-05 17:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112845
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[11/12/13 Regression] ICE: |[11/12 Regression] ICE: in
|in extract_insn, at |extract_insn, at
|recog.cc:2804 with -Os |recog.cc:2804 with -Os
|-fcf-protection -c since |-fcf-protection -c since
|r8-3504 |r8-3504
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Now fixed for 13.3 as well.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/112845] [11/12 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504
2023-12-04 14:04 [Bug target/112845] New: ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c iamanonymous.cs at gmail dot com
` (6 preceding siblings ...)
2023-12-05 17:02 ` [Bug target/112845] [11/12 " jakub at gcc dot gnu.org
@ 2023-12-16 0:38 ` cvs-commit at gcc dot gnu.org
2023-12-17 13:55 ` cvs-commit at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-16 0:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112845
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:87d013f7c877f944adbbaa4e94244baf990cb9f2
commit r12-10054-g87d013f7c877f944adbbaa4e94244baf990cb9f2
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Dec 5 13:17:57 2023 +0100
i386: Fix -fcf-protection -Os ICE due to movabsq peephole2 [PR112845]
The following testcase ICEs in the movabsq $(i32 << shift), r64 peephole2
I've added a while back to use smaller code than movabsq if possible.
If i32 is 0xfa1e0ff3 and shift is not divisible by 8, then it creates
an invalid insn (as 0xfa1e0ff3 CONST_INT is not allowed as
x86_64_immediate_operand nor x86_64_zext_immediate_operand), the peephole2
even triggers on it again and again (this time with shift 0) until it gives
up.
The following patch fixes that. As ix86_endbr_immediate_operand needs a
CONST_INT and it is hopefully rare, I chose to use FAIL rather than
handling
it in the condition (where I'd probably need to call ctz_hwi again etc.).
2023-12-05 Jakub Jelinek <jakub@redhat.com>
PR target/112845
* config/i386/i386.md (movabsq $(i32 << shift), r64 peephole2):
FAIL
if the new immediate is ix86_endbr_immediate_operand.
(cherry picked from commit e0786ca9a18c50ad08c40936b228e325193664b8)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/112845] [11/12 Regression] ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c since r8-3504
2023-12-04 14:04 [Bug target/112845] New: ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c iamanonymous.cs at gmail dot com
` (7 preceding siblings ...)
2023-12-16 0:38 ` cvs-commit at gcc dot gnu.org
@ 2023-12-17 13:55 ` cvs-commit at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-17 13:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112845
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:6156cbb74dabb98899f8f481bda4ae969ac22d53
commit r11-11154-g6156cbb74dabb98899f8f481bda4ae969ac22d53
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Dec 5 13:17:57 2023 +0100
i386: Fix -fcf-protection -Os ICE due to movabsq peephole2 [PR112845]
The following testcase ICEs in the movabsq $(i32 << shift), r64 peephole2
I've added a while back to use smaller code than movabsq if possible.
If i32 is 0xfa1e0ff3 and shift is not divisible by 8, then it creates
an invalid insn (as 0xfa1e0ff3 CONST_INT is not allowed as
x86_64_immediate_operand nor x86_64_zext_immediate_operand), the peephole2
even triggers on it again and again (this time with shift 0) until it gives
up.
The following patch fixes that. As ix86_endbr_immediate_operand needs a
CONST_INT and it is hopefully rare, I chose to use FAIL rather than
handling
it in the condition (where I'd probably need to call ctz_hwi again etc.).
2023-12-05 Jakub Jelinek <jakub@redhat.com>
PR target/112845
* config/i386/i386.md (movabsq $(i32 << shift), r64 peephole2):
FAIL
if the new immediate is ix86_endbr_immediate_operand.
(cherry picked from commit e0786ca9a18c50ad08c40936b228e325193664b8)
^ permalink raw reply [flat|nested] 10+ messages in thread