Created attachment 46194 [details] reduced testcase The following reduced testcase ICEs on trunk: $ ./xg++ -B./ -S -m64 -O skcms.ii during RTL pass: expand skcms.ii: In function ‘void m()’: skcms.ii:7:6: internal compiler error: in emit_block_move_hints, at expr.c:1601 7 | void m() { | ^ 0x9a8f4f emit_block_move_hints(rtx_def*, rtx_def*, rtx_def*, block_op_methods, unsigned int, long long, unsigned long long, unsigned long long, unsigned long long) /vol/gcc/src/hg/trunk/local/gcc/expr.c:1601 0x9a9043 emit_block_move(rtx_def*, rtx_def*, rtx_def*, block_op_methods) /vol/gcc/src/hg/trunk/local/gcc/expr.c:1655 0xe8dd23 emit_partition_copy /vol/gcc/src/hg/trunk/local/gcc/tree-outof-ssa.c:226 0xe8dd23 insert_part_to_rtx_on_edge /vol/gcc/src/hg/trunk/local/gcc/tree-outof-ssa.c:391 0xe8dd23 elim_create /vol/gcc/src/hg/trunk/local/gcc/tree-outof-ssa.c:677 0xe8dd23 eliminate_phi /vol/gcc/src/hg/trunk/local/gcc/tree-outof-ssa.c:735 0xe8dd23 expand_phi_nodes(ssaexpand*) /vol/gcc/src/hg/trunk/local/gcc/tree-outof-ssa.c:988 0x84bd23 execute /vol/gcc/src/hg/trunk/local/gcc/cfgexpand.c:6486 While the original testcase shows the same ICE back to gcc 5, this one also ICEs on mainline.
I'd say this is a tree-outof-ssa.c bug, in elim_create it calls get_temp_reg on a SSA_NAME which has VECTOR_TYPE with one SFmode element, and as SPARC backend doesn't have V1SFmode, it has BLKmode. Creating a BLKmode pseudo of course doesn't work too well.
Created attachment 46197 [details] gcc9-pr90139.patch Untested fix.
At least on x86_64-linux on the testcase in the patch this started to ICE with r265677, so it is a recent regression.
Author: jakub Date: Fri Apr 19 11:58:11 2019 New Revision: 270457 URL: https://gcc.gnu.org/viewcvs?rev=270457&root=gcc&view=rev Log: PR middle-end/90139 * tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return assign_temp instead of gen_reg_rtx. * gcc.c-torture/compile/pr90139.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr90139.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-outof-ssa.c
Fixed.
Created attachment 46230 [details] gcc 7 reduced testcase
While my original testcase fails on gcc 7, 8, and 9, the one reduced using gcc 9 only failed on trunk. I've now ran creduce with the original testcase against both gcc 7 and 8. Each run produced a different reduced testcase, neither of which is fixed by applying the trunk patch to the branches.
Created attachment 46231 [details] gcc 8 reduced testcase
Reopening as explained in Comment 7.
That is a 7/8 regression though then. Or do you have a testcase that still fails on the trunk?
> --- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > That is a 7/8 regression though then. Or do you have a testcase that still > fails on the trunk? No: it seems the original testcase produces the same ICE in different places on gcc 7, 8, and 9. I'm not certain about the regression part, TBH: when I tried the original (preprocessed) testcase with gcc [876].1.0, it ICEd on all of them, but it wouldn't even compile on gcc 5.1.0. So I don't have a gcc release where it worked.
GCC 9.1 has been released.
GCC 9.2 has been released.
Author: jakub Date: Thu Aug 29 14:57:18 2019 New Revision: 275035 URL: https://gcc.gnu.org/viewcvs?rev=275035&root=gcc&view=rev Log: Backported from mainline 2019-04-19 Jakub Jelinek <jakub@redhat.com> PR middle-end/90139 * tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return assign_temp instead of gen_reg_rtx. * gcc.c-torture/compile/pr90139.c: New test. Added: branches/gcc-8-branch/gcc/testsuite/gcc.c-torture/compile/pr90139.c Modified: branches/gcc-8-branch/gcc/ChangeLog branches/gcc-8-branch/gcc/testsuite/ChangeLog branches/gcc-8-branch/gcc/tree-outof-ssa.c
Author: jakub Date: Fri Aug 30 12:44:03 2019 New Revision: 275156 URL: https://gcc.gnu.org/viewcvs?rev=275156&root=gcc&view=rev Log: Backported from mainline 2019-04-19 Jakub Jelinek <jakub@redhat.com> PR middle-end/90139 * tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return assign_temp instead of gen_reg_rtx. * gcc.c-torture/compile/pr90139.c: New test. Added: branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/compile/pr90139.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/testsuite/ChangeLog branches/gcc-7-branch/gcc/tree-outof-ssa.c