[Bug target/113615] internal compiler error: in extract_insn, at recog.cc:2812

2024-02-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113615

--- Comment #10 from GCC Commits  ---
The master branch has been updated by Thomas Schwinge :

https://gcc.gnu.org/g:641b50bffc06123853a1421c0dd5a318c353fd85

commit r14-9068-g641b50bffc06123853a1421c0dd5a318c353fd85
Author: Thomas Schwinge 
Date:   Fri Feb 16 13:04:00 2024 +0100

GCN: Conditionalize 'define_expand "reduc__scal_"' on
'!TARGET_RDNA2_PLUS' [PR113615]

On top of commit c7ec7bd1c6590cf4eed267feab490288e0b8d691
"amdgcn: add -march=gfx1030 EXPERIMENTAL" conditionalizing
'define_expand "reduc__scal_"' on
'!TARGET_RDNA2' (later: '!TARGET_RDNA2_PLUS'), we then did similar in
commit 7cc2262ec9a410dc56d1c1c6b950c922e14f621d
"gcn/gcn-valu.md: Disable fold_left_plus for TARGET_RDNA2_PLUS [PR113615]"
to conditionalize 'define_expand "fold_left_plus_"' on
'!TARGET_RDNA2_PLUS', but I found we also need to conditionalize the
related
'define_expand "reduc__scal_"' on '!TARGET_RDNA2_PLUS', to
avoid ICEs like:

[...]/gcc.dg/vect/pr108608.c: In function 'foo':
[...]/gcc.dg/vect/pr108608.c:9:1: error: unrecognizable insn:
(insn 34 33 35 2 (set (reg:V64DF 723)
(unspec:V64DF [
(reg:V64DF 690 [ vect_m_11.20 ])
(const_int 1 [0x1])
] UNSPEC_MOV_DPP_SHR)) -1
 (nil))
during RTL pass: vregs

Similar for 'gcc.dg/vect/vect-fmax-2.c', 'gcc.dg/vect/vect-fmin-2.c', and
'UNSPEC_SMAX_DPP_SHR' for 'gcc.dg/vect/vect-fmax-1.c', and
'UNSPEC_SMIN_DPP_SHR' for 'gcc.dg/vect/vect-fmin-1.c', when running
'vect.exp'
for 'check-gcc-c'.

PR target/113615
gcc/
* config/gcn/gcn-valu.md (define_expand
"reduc__scal_"):
Conditionalize on '!TARGET_RDNA2_PLUS'.
* config/gcn/gcn.cc (gcn_expand_dpp_shr_insn)
(gcn_expand_reduc_scalar):
'gcc_checking_assert (!TARGET_RDNA2_PLUS);'.

[Bug target/113615] internal compiler error: in extract_insn, at recog.cc:2812

2024-02-09 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113615

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Richard Biener  ---
This seems fixed now.

[Bug target/113615] internal compiler error: in extract_insn, at recog.cc:2812

2024-02-02 Thread doko at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113615

Matthias Klose  changed:

   What|Removed |Added

Summary|[14 Regression] internal|internal compiler error: in
   |compiler error: in  |extract_insn, at
   |extract_insn, at|recog.cc:2812
   |recog.cc:2812   |

--- Comment #8 from Matthias Klose  ---
filed PR113720 for the alpha-linux-gnu ICE

[Bug target/113615] internal compiler error: in extract_insn, at recog.cc:2812

2024-02-02 Thread doko at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113615

Matthias Klose  changed:

   What|Removed |Added

 CC||doko at gcc dot gnu.org

--- Comment #6 from Matthias Klose  ---
Created attachment 57290
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57290&action=edit
preprocessed source

see with trunk 20240131 building a cross compiler targeting alpha-linux-gnu,
attaching the preprocessed source. this worked with trunk 20240129.

// ../../../../../src/libstdc++-v3/src/c++17/floating_to_chars.cc: In function
'std::to_chars_result std::__floating_to_chars_shortest(char*, char*, T,
chars_format) [with T = double]':
// ../../../../../src/libstdc++-v3/src/c++17/floating_to_chars.cc:1306:3:
error: unrecognizable insn:
//  1306 |   }
//   |   ^
// (insn 712 711 713 22 (set (reg:DI 686 [ highparttmp_857 ])
// (truncate:DI (lshiftrt:TI (mult:TI (zero_extend:TI (subreg:DI
(reg:TI 223 [ _319 ]) 0))
// (subreg:DI (reg:TI 225 [ _321 ]) 0))
// (const_int 64 [0x40]
"../../../../../src/libstdc++-v3/src/c++17/ryu/d2s_intrinsics.h":254:27 -1
//  (nil))
// during RTL pass: vregs
// ../../../../../src/libstdc++-v3/src/c++17/floating_to_chars.cc:1306:3:
internal compiler error: in extract_insn, at recog.cc:2812
// 0x7b030c _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
//  ../../src/gcc/rtl-error.cc:108
// 0x7b0328 _fatal_insn_not_found(rtx_def const*, char const*, int, char
const*)
//  ../../src/gcc/rtl-error.cc:116
// 0x7aed6e extract_insn(rtx_insn*)
//  ../../src/gcc/recog.cc:2812
// 0xe44cd5 instantiate_virtual_regs_in_insn
//  ../../src/gcc/function.cc:1611
// 0xe44cd5 instantiate_virtual_regs
//  ../../src/gcc/function.cc:1994
// 0xe44cd5 execute
//  ../../src/gcc/function.cc:2041
// Please submit a full bug report, with preprocessed source (by using
-freport-bug).

[Bug target/113615] internal compiler error: in extract_insn, at recog.cc:2812

2024-01-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113615

--- Comment #5 from GCC Commits  ---
The master branch has been updated by Tobias Burnus :

https://gcc.gnu.org/g:7cc2262ec9a410dc56d1c1c6b950c922e14f621d

commit r14-8493-g7cc2262ec9a410dc56d1c1c6b950c922e14f621d
Author: Tobias Burnus 
Date:   Mon Jan 29 13:51:25 2024 +0100

gcn/gcn-valu.md: Disable fold_left_plus for TARGET_RDNA2_PLUS [PR113615]

gcc/ChangeLog:

PR target/113615
* config/gcn/gcn-valu.md (fold_left_plus_): Only
define for !TARGET_RDNA2_PLUS.

Signed-off-by: Tobias Burnus 

[Bug target/113615] internal compiler error: in extract_insn, at recog.cc:2812

2024-01-29 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113615

--- Comment #4 from Tobias Burnus  ---
Patch:
  https://gcc.gnu.org/pipermail/gcc-patches/2024-January/644181.html

It fixes this issue but two other kind of issues I still see for gfx1100.

[Bug target/113615] internal compiler error: in extract_insn, at recog.cc:2812

2024-01-29 Thread ams at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113615

--- Comment #3 from Andrew Stubbs  ---
I did see these, but I hadn't had time to chase them up.

The proposed patch is exactly the sort of solution I was expecting to find,
short term. Have you confirmed that it fixes all the cases?

A proper solution is to find out how to implement reductions with the RDNA ISA,
of course, but that's probably non-trivial (as in, I'm pretty sure it's more
than renaming a few mnemonics), and low-priority as GCC does a reasonably good 
job without them.

[Bug target/113615] internal compiler error: in extract_insn, at recog.cc:2812

2024-01-28 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113615

Tobias Burnus  changed:

   What|Removed |Added

 CC||ams at gcc dot gnu.org

--- Comment #2 from Tobias Burnus  ---
> I'm seeing a lot of ICEs like this when running libgomp testsuite with
> offloading for gfx1030.

I wonder why Andrew S didn't see them (unless he did?). However, I did get a
similar/the same ICE for the testcase in PR113645.

I have not checked whether anything below applies to the PR as well or not but
as Andrew P has marked it as duplicate ...

* * *

Regarding PR113645: While, I have no real idea about GCC backend handling, the
following SEEMS TO FIX THE ISSUE for the ICE of the testcase with -O3 and
gfx1030 and gfx1100, also known as

possible patch:

--- a/gcc/config/gcn/gcn-valu.md
+++ b/gcc/config/gcn/gcn-valu.md
@@ -4273,9 +4273,10 @@
 (define_expand "fold_left_plus_"
  [(match_operand: 0 "register_operand")
   (match_operand: 1 "gcn_alu_operand")
   (match_operand:V_FP 2 "gcn_alu_operand")]
-  "can_create_pseudo_p ()
+  "!TARGET_RDNA2_PLUS
+   && can_create_pseudo_p ()
&& (flag_openacc || flag_openmp
|| flag_associative_math)"
   {
 rtx dest = operands[0];

[Bug target/113615] internal compiler error: in extract_insn, at recog.cc:2812

2024-01-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113615

Andrew Pinski  changed:

   What|Removed |Added

 CC||burnus at gcc dot gnu.org

--- Comment #1 from Andrew Pinski  ---
*** Bug 113645 has been marked as a duplicate of this bug. ***