* [Bug rtl-optimization/101562] [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
@ 2021-07-21 17:46 ` pinskia at gcc dot gnu.org
2021-07-21 18:05 ` pinskia at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21 17:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |9.5
Component|c |rtl-optimization
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
2021-07-21 17:46 ` [Bug rtl-optimization/101562] " pinskia at gcc dot gnu.org
@ 2021-07-21 18:05 ` pinskia at gcc dot gnu.org
2021-07-21 18:07 ` pinskia at gcc dot gnu.org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21 18:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-07-21
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed
2837 wide_int o = wi::insert (rtx_mode_t (outer, temp_mode),
2838 rtx_mode_t (inner, dest_mode),
2839 offset, width);
2840
2841 combine_merges++;
2842 subst_insn = i3;
2843 subst_low_luid = DF_INSN_LUID (i2);
(gdb) p outer
$1 = (rtx) 0x7ffff6b32490
(gdb) p debug_rtx(outer)
(const_int 0 [0])
$2 = void
(gdb) p debug_rtx(inner)
(const_int 256 [0x100])
$3 = void
(gdb) p offset
$4 = 0
(gdb) p mode
No symbol "mode" in current context.
(gdb) p width
$5 = 16
(gdb) p temp_mode
$6 = QImode
(gdb) p dest_mode
$7 = HImode
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
2021-07-21 17:46 ` [Bug rtl-optimization/101562] " pinskia at gcc dot gnu.org
2021-07-21 18:05 ` pinskia at gcc dot gnu.org
@ 2021-07-21 18:07 ` pinskia at gcc dot gnu.org
2021-07-22 6:55 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21 18:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
669 /* Insert WIDTH bits from Y into X starting at START. */
670 wide_int
671 wi::insert (const wide_int &x, const wide_int &y, unsigned int start,
672 unsigned int width)
673 {
674 wide_int result;
675 wide_int mask;
676 wide_int tmp;
(gdb) p precision
$11 = 8
(gdb) p width
$12 = 16
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (2 preceding siblings ...)
2021-07-21 18:07 ` pinskia at gcc dot gnu.org
@ 2021-07-22 6:55 ` rguenth at gcc dot gnu.org
2021-07-22 8:47 ` jakub at gcc dot gnu.org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-22 6:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (3 preceding siblings ...)
2021-07-22 6:55 ` rguenth at gcc dot gnu.org
@ 2021-07-22 8:47 ` jakub at gcc dot gnu.org
2021-07-22 8:53 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-22 8:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with addition of the store merging pass in
r7-4171-gf663d9ad6eaa6ff32676981461e865f96cb7c151
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (4 preceding siblings ...)
2021-07-22 8:47 ` jakub at gcc dot gnu.org
@ 2021-07-22 8:53 ` jakub at gcc dot gnu.org
2021-07-22 9:32 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-22 8:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly modified testcase started to ICE with
r5-424-g807e902eea17f3132488c256c963823976b2348c aka wide_int merge though:
struct S { char c; };
void g (struct S a, struct S b);
void f ()
{
struct S x[1];
*(short *)&x[0] = 256;
g (x[0], x[1]);
return;
}
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (5 preceding siblings ...)
2021-07-22 8:53 ` jakub at gcc dot gnu.org
@ 2021-07-22 9:32 ` jakub at gcc dot gnu.org
2021-07-23 17:56 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-22 9:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
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 #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 51193
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51193&action=edit
gcc12-pr101562.patch
Untested fix.
The documentation says that strict_low_part operand has to be a non-paradoxical
SUBREG, but in this case we for the UB in the source emit exactly that.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (6 preceding siblings ...)
2021-07-22 9:32 ` jakub at gcc dot gnu.org
@ 2021-07-23 17:56 ` cvs-commit at gcc dot gnu.org
2021-07-23 17:57 ` [Bug rtl-optimization/101562] [9/10/11 " jakub at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-23 17:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
--- Comment #6 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:8408d34570c9fe9f3d22a25a76df2a4c64f08477
commit r12-2499-g8408d34570c9fe9f3d22a25a76df2a4c64f08477
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jul 23 19:55:16 2021 +0200
expmed: Fix store_integral_bit_field [PR101562]
Our documentation says that paradoxical subregs shouldn't appear
in strict_low_part:
'(strict_low_part (subreg:M (reg:N R) 0))'
This expression code is used in only one context: as the
destination operand of a 'set' expression. In addition, the
operand of this expression must be a non-paradoxical 'subreg'
expression.
but on the testcase below that triggers UB at runtime
store_integral_bit_field emits exactly that.
The following patch fixes it by ensuring the requirement is satisfied.
2021-07-23 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/101562
* expmed.c (store_integral_bit_field): Only use movstrict_optab
if the operand isn't paradoxical.
* gcc.c-torture/compile/pr101562.c: New test.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10/11 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (7 preceding siblings ...)
2021-07-23 17:56 ` cvs-commit at gcc dot gnu.org
@ 2021-07-23 17:57 ` jakub at gcc dot gnu.org
2021-07-28 9:06 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-23 17:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11/12 Regression] ICE |[9/10/11 Regression] ICE in
|in insert, at |insert, at wide-int.cc:682
|wide-int.cc:682 |
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10/11 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (8 preceding siblings ...)
2021-07-23 17:57 ` [Bug rtl-optimization/101562] [9/10/11 " jakub at gcc dot gnu.org
@ 2021-07-28 9:06 ` cvs-commit at gcc dot gnu.org
2021-07-28 9:08 ` [Bug rtl-optimization/101562] [9/10 " jakub at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-28 9:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
--- Comment #8 from CVS 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:6d9619f05bed26551ede7a1c781f7921af4aaff8
commit r11-8804-g6d9619f05bed26551ede7a1c781f7921af4aaff8
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jul 23 19:55:16 2021 +0200
expmed: Fix store_integral_bit_field [PR101562]
Our documentation says that paradoxical subregs shouldn't appear
in strict_low_part:
'(strict_low_part (subreg:M (reg:N R) 0))'
This expression code is used in only one context: as the
destination operand of a 'set' expression. In addition, the
operand of this expression must be a non-paradoxical 'subreg'
expression.
but on the testcase below that triggers UB at runtime
store_integral_bit_field emits exactly that.
The following patch fixes it by ensuring the requirement is satisfied.
2021-07-23 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/101562
* expmed.c (store_integral_bit_field): Only use movstrict_optab
if the operand isn't paradoxical.
* gcc.c-torture/compile/pr101562.c: New test.
(cherry picked from commit 8408d34570c9fe9f3d22a25a76df2a4c64f08477)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (9 preceding siblings ...)
2021-07-28 9:06 ` cvs-commit at gcc dot gnu.org
@ 2021-07-28 9:08 ` jakub at gcc dot gnu.org
2022-05-10 8:20 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-28 9:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11 Regression] ICE in |[9/10 Regression] ICE in
|insert, at wide-int.cc:682 |insert, at wide-int.cc:682
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.3 as well.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (10 preceding siblings ...)
2021-07-28 9:08 ` [Bug rtl-optimization/101562] [9/10 " jakub at gcc dot gnu.org
@ 2022-05-10 8:20 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:21 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:36 ` jakub at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10 8:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
--- Comment #10 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:6cb2b5581d2ca5b4175dc2cf4f32e4251a314eda
commit r10-10638-g6cb2b5581d2ca5b4175dc2cf4f32e4251a314eda
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jul 23 19:55:16 2021 +0200
expmed: Fix store_integral_bit_field [PR101562]
Our documentation says that paradoxical subregs shouldn't appear
in strict_low_part:
'(strict_low_part (subreg:M (reg:N R) 0))'
This expression code is used in only one context: as the
destination operand of a 'set' expression. In addition, the
operand of this expression must be a non-paradoxical 'subreg'
expression.
but on the testcase below that triggers UB at runtime
store_integral_bit_field emits exactly that.
The following patch fixes it by ensuring the requirement is satisfied.
2021-07-23 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/101562
* expmed.c (store_integral_bit_field): Only use movstrict_optab
if the operand isn't paradoxical.
* gcc.c-torture/compile/pr101562.c: New test.
(cherry picked from commit 8408d34570c9fe9f3d22a25a76df2a4c64f08477)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (11 preceding siblings ...)
2022-05-10 8:20 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:21 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:36 ` jakub at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11 6:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
--- Comment #11 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:f7200dd27304455d4c96c008c4aac20f23aee5f2
commit r9-10095-gf7200dd27304455d4c96c008c4aac20f23aee5f2
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jul 23 19:55:16 2021 +0200
expmed: Fix store_integral_bit_field [PR101562]
Our documentation says that paradoxical subregs shouldn't appear
in strict_low_part:
'(strict_low_part (subreg:M (reg:N R) 0))'
This expression code is used in only one context: as the
destination operand of a 'set' expression. In addition, the
operand of this expression must be a non-paradoxical 'subreg'
expression.
but on the testcase below that triggers UB at runtime
store_integral_bit_field emits exactly that.
The following patch fixes it by ensuring the requirement is satisfied.
2021-07-23 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/101562
* expmed.c (store_integral_bit_field): Only use movstrict_optab
if the operand isn't paradoxical.
* gcc.c-torture/compile/pr101562.c: New test.
(cherry picked from commit 8408d34570c9fe9f3d22a25a76df2a4c64f08477)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug rtl-optimization/101562] [9/10 Regression] ICE in insert, at wide-int.cc:682
2021-07-21 17:45 [Bug c/101562] New: [9/10/11/12 Regression] ICE in insert, at wide-int.cc:682 gscfq@t-online.de
` (12 preceding siblings ...)
2022-05-11 6:21 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:36 ` jakub at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-11 6:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101562
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 15+ messages in thread