[Bug rtl-optimization/108805] [13 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7400 at -O and above

2023-02-17 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108805

Uroš Bizjak  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Uroš Bizjak  ---
Fixed.

[Bug rtl-optimization/108805] [13 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7400 at -O and above

2023-02-17 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108805

Uroš Bizjak  changed:

   What|Removed |Added

 CC||avieira at gcc dot gnu.org

--- Comment #4 from Uroš Bizjak  ---
Caused by g:d45ec8a732f4

[Bug rtl-optimization/108805] [13 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7400 at -O and above

2023-02-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108805

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Uros Bizjak :

https://gcc.gnu.org/g:6ac3ebed5ffbac0d81c5a1d0cb1e345cfad202a8

commit r13-6117-g6ac3ebed5ffbac0d81c5a1d0cb1e345cfad202a8
Author: Uros Bizjak 
Date:   Fri Feb 17 15:58:12 2023 +0100

simplify-rtx: Fix VOIDmode operand handling in simplify_subreg [PR108805]

simplify_subreg can return VOIDmode const_int operand and will
cause ICE in simplify_gen_subreg when this operand is passed to it.

The patch uses int_outermode instead of GET_MODE of temporary as the
innermode argument of simplify_gen_subreg.

2023-02-17  Uroš Bizjak  

gcc/ChangeLog:

PR target/108805
* simplify-rtx.cc (simplify_context::simplify_subreg): Use
int_outermode instead of GET_MODE (tem) to prevent
VOIDmode from entering simplify_gen_subreg.

gcc/testsuite/ChangeLog:

PR target/108805
* gcc.dg/pr108805.c: New test.

[Bug rtl-optimization/108805] [13 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7400 at -O and above

2023-02-15 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108805

Uroš Bizjak  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |ubizjak at gmail dot com
 Status|NEW |ASSIGNED

--- Comment #2 from Uroš Bizjak  ---
Patch in testing:

--cut here--
diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
index 0a1dd88b0a8..281bc418df0 100644
--- a/gcc/simplify-rtx.cc
+++ b/gcc/simplify-rtx.cc
@@ -7664,7 +7664,7 @@ simplify_context::simplify_subreg (machine_mode
outermode, rtx op,
0).exists (_outermode))
 {
   rtx tem = simplify_subreg (int_outermode, op, innermode, byte);
-  if (tem)
+  if (tem && GET_MODE (tem) != VOIDmode)
return simplify_gen_subreg (outermode, tem, GET_MODE (tem), 0);
 }

--cut here--

[Bug rtl-optimization/108805] [13 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7400 at -O and above

2023-02-15 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108805

Uroš Bizjak  changed:

   What|Removed |Added

   Target Milestone|--- |13.0
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2023-02-15
  Component|target  |rtl-optimization
 Ever confirmed|0   |1

--- Comment #1 from Uroš Bizjak  ---
Confirmed, combine chokes itself with the RTX it cannot chew:

(gdb) bt
#0  internal_error (gmsgid=gmsgid@entry=0x2614840 "in %s, at %s:%d") at
../../git/gcc/gcc/diagnostic.cc:2138
#1  0x00891812 in fancy_abort (file=file@entry=0x20b75d8
"../../git/gcc/gcc/simplify-rtx.cc", line=line@entry=7400, 
function=function@entry=0x20b74e8 "simplify_subreg") at
../../git/gcc/gcc/diagnostic.cc:2242
#2  0x007653cb in simplify_context::simplify_subreg
(this=0x7fffd2a8, outermode=, op=, 
innermode=, byte=...) at
../../git/gcc/gcc/simplify-rtx.cc:7400
#3  0x00ecfee9 in simplify_context::simplify_gen_subreg
(this=, outermode=E_V4QImode, op=0x7fffea209480, 
innermode=E_VOIDmode, byte=...) at ../../git/gcc/gcc/simplify-rtx.cc:7694
#4  0x00ecfee9 in simplify_context::simplify_gen_subreg
(this=this@entry=0x7fffd2a8, 
outermode=outermode@entry=E_V4QImode, op=0x7fffea3e4b58,
innermode=E_DImode, byte=...) at ../../git/gcc/gcc/simplify-rtx.cc:7694
#5  0x01c92bde in simplify_gen_subreg (byte=..., innermode=, op=, outermode=E_V4QImode)
at ../../git/gcc/gcc/rtl.h:3408
#6  if_then_else_cond (x=x@entry=0x7fffea3e4558,
ptrue=ptrue@entry=0x7fffd328, pfalse=pfalse@entry=0x7fffd338)
at ../../git/gcc/gcc/combine.cc:9375
#7  0x01c929b1 in if_then_else_cond (x=x@entry=0x7fffea3e42b8,
ptrue=ptrue@entry=0x7fffd400, 
pfalse=pfalse@entry=0x7fffd408) at ../../git/gcc/gcc/combine.cc:9240
#8  0x01c9de0a in combine_simplify_rtx (x=0x7fffea3e42b8,
op0_mode=E_V4QImode, in_dest=0, in_cond=0)
at ../../git/gcc/gcc/combine.cc:5723

(gdb) f 3
#3  0x00ecfee9 in simplify_context::simplify_gen_subreg
(this=, outermode=E_V4QImode, op=0x7fffea209480, 
innermode=E_VOIDmode, byte=...) at ../../git/gcc/gcc/simplify-rtx.cc:7694
7694  newx = simplify_subreg (outermode, op, innermode, byte);
(gdb) p debug_rtx (op)
(const_int -1 [0x])