gcc-11.0.0-alpha20200517 snapshot (g:2b9a271b2d0ba340234a138b7f8289bd7dca2fc5) ICEs when compiling the following testcase w/ -march=skylake-avx512 -O3: % x86_64-unknown-linux-gnu-gcc-11.0.0 -march=skylake-avx512 -O3 -c pvhda4vr.c during RTL pass: expand pvhda4vr.c: In function 'ml': pvhda4vr.c:11:12: internal compiler error: in emit_unop_insn, at optabs.c:3622 11 | tp[cm] = ha[cm] + 1.0f; | ~~~~~~~^~~~~~~~~~~~~~~ 0x681295 emit_unop_insn(insn_code, rtx_def*, rtx_def*, rtx_code) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/optabs.c:3622 0x681dee emit_unop_insn(insn_code, rtx_def*, rtx_def*, rtx_code) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/optabs.c:4933 0x681dee expand_float(rtx_def*, rtx_def*, int) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/optabs.c:4803 0xa1d278 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.c:9151 0xa2352a expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.c:10054 0xa2c184 expand_expr /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.h:282 0xa2c184 expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**, rtx_def**, expand_modifier) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.c:7954 0xa1b878 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.c:8850 0xa2352a expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.c:10054 0xa1d19d expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.c:8358 0xa1d19d expand_normal /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.h:288 0xa1d19d expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.c:9136 0xa2352a expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.c:10054 0xa3056a expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.c:8358 0xa3056a expand_expr /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.h:282 0xa3056a expand_assignment(tree_node*, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/expr.c:5090 0x8fdf17 expand_gimple_stmt_1 /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cfgexpand.c:3749 0x8fdf17 expand_gimple_stmt /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cfgexpand.c:3847 0x903b11 expand_gimple_basic_block /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cfgexpand.c:5887 0x9055f6 execute /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cfgexpand.c:6571
-EMISSING_TEST_CASE ;)
Uh-oh… int s6; void ml (long int *ha, int dz) { int iy[dz]; int *tp; int cm; for (cm = 0; cm < 3; ++cm) tp[cm] = ha[cm] + 1.0f; if (s6 == 0) return; }
Confirmed. sse.md includes a named pattern defined with non-conforming operands: (define_expand "float<floatunssuffix>v2div2sf2" [(set (match_operand:V4SF 0 "register_operand" "=v") (vec_concat:V4SF (any_float:V2SF (match_operand:V2DI 1 "nonimmediate_operand" "vm")) (match_dup 2)))] "TARGET_AVX512DQ && TARGET_AVX512VL" "operands[2] = CONST0_RTX (V2SFmode);") V2SF vectorization now triggers this expander. CC author.
Adjusted testcase, so that there is no UB. void bar (void); void foo (long int *x, int y, int *z, int v) { int a[y]; int b; for (b = 0; b < 3; ++b) z[b] = x[b] + 1.0f; if (v) return; bar (); }
This testcase is fixed by [1] [1] https://gcc.gnu.org/pipermail/gcc-patches/2020-May/546408.html
(In reply to Uroš Bizjak from comment #5) > This testcase is fixed by [1] > > [1] https://gcc.gnu.org/pipermail/gcc-patches/2020-May/546408.html Interesting. I've done quite a bit of cooperlake specific testing and found some bugs in gcc trunk. AFAIK cooperlake is recent Intel. Is there a newer -march setting I could usefully test or is cooperlake recent enough ? Also, AFAIK Zen version 2 is a recent AMD -march setting. Is there a newer AMD -march setting I could usefully test ? A complete compile of Fedora Linux, with about 6,700 packages, seems to be a good testcase for recent gcc trunk.
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>: https://gcc.gnu.org/g:9d0dc47de6ed9609fe7445ea0941a6a822c80f88 commit r11-621-g9d0dc47de6ed9609fe7445ea0941a6a822c80f88 Author: liuhongt <hongtao.liu@intel.com> Date: Tue May 26 11:14:31 2020 +0800 Fix non-comforming expander for floatv2div2sf2,floatunsv2div2sf2,fix_truncv2sfv2di,fixuns_truncv2sfv2di. 2020-05-26 Hongtao Liu <hongtao.liu@intel.com> Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/95211 PR target/95256 * config/i386/sse.md (<floatunssuffix>v2div2sf2): New expander. (fix<fixunssuffix>_truncv2sfv2di2): Ditto. (avx512dq_float<floatunssuffix>v2div2sf2): Renaming from float<floatunssuffix>v2div2sf2. (avx512dq_fix<fixunssuffix>_truncv2sfv2di2<mask_name>): Renaming from fix<fixunssuffix>_truncv2sfv2di2<mask_name>. (vec_pack<floatprefix>_float_<mode>): Adjust icode name. (vec_unpack_<fixprefix>fix_trunc_lo_<mode>): Ditto. (vec_unpack_<fixprefix>fix_trunc_hi_<mode>): Ditto. * config/i386/i386-builtin.def: Ditto. * emit-rtl.c (validate_subreg): Allow use of *paradoxical* vector subregs when both omode and imode are vector mode and have the same inner mode. gcc/testsuite/ChangeLog * gcc.target/i386/pr95211.c: New test.
Is there some further work pending, or should this PR be closed now?
(In reply to Arseny Solokha from comment #8) > Is there some further work pending, or should this PR be closed now? Fixed in GCC11.
.