Bug 64617 - [5 Regression] ICE: Max. number of generated reload insns per insn is achieved (90) with -ftree-vectorize -mavx512bw -march=slm
Summary: [5 Regression] ICE: Max. number of generated reload insns per insn is achieve...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: 5.0
Assignee: Vladimir Makarov
URL:
Keywords: ice-on-valid-code, ra
: 64311 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-01-15 18:21 UTC by Zdenek Sojka
Modified: 2015-01-30 19:32 UTC (History)
5 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail: 5.0
Last reconfirmed: 2015-01-16 00:00:00


Attachments
reduced testcase (258 bytes, text/x-csrc)
2015-01-15 18:21 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2015-01-15 18:21:55 UTC
Created attachment 34458 [details]
reduced testcase

Compiler output:
$ gcc -O -ftree-vectorize -mavx512bw -march=slm testcase.c
testcase.c: In function 'foo':
testcase.c:34:1: internal compiler error: Max. number of generated reload insns per insn is achieved (90)

 }
 ^
0xadff12 lra_constraints(bool)
        /mnt/svn/gcc-trunk/gcc/lra-constraints.c:4307
0xacb97b lra(_IO_FILE*)
        /mnt/svn/gcc-trunk/gcc/lra.c:2280
0xa7ad91 do_reload
        /mnt/svn/gcc-trunk/gcc/ira.c:5407
0xa7ad91 execute
        /mnt/svn/gcc-trunk/gcc/ira.c:5578
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ gcc -v                                                  
Using built-in specs.
COLLECT_GCC=/mnt/svn/gcc-trunk/binary-latest/bin/gcc
COLLECT_LTO_WRAPPER=/mnt/svn/gcc-trunk/binary-219632-lto-fortran-checking-yes-rtl-df/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /mnt/svn/gcc-trunk//configure --enable-checking=yes,rtl,df --enable-languages=c,c++,lto,fortran --prefix=/mnt/svn/gcc-trunk/binary-219632-lto-fortran-checking-yes-rtl-df/ --without-cloog --without-ppl
Thread model: posix
gcc version 5.0.0 20150115 (experimental) (GCC) 

Tested revisions:
r219632 - ICE
Comment 1 Jakub Jelinek 2015-01-16 14:46:01 UTC
Started with my r218565.
Comment 2 Jakub Jelinek 2015-01-20 16:44:45 UTC
The patterns in question are
(define_insn "<mask_codefor><avx512>_vec_dup_gpr<mode><mask_name>"
  [(set (match_operand:VI12_AVX512VL 0 "register_operand" "=v,v")
        (vec_duplicate:VI12_AVX512VL
          (match_operand:<ssescalarmode> 1 "nonimmediate_operand" "vm,r")))]
and thus ought to support both HImode MEM as well as GPR.
(insn 60 242 62 4 (set (reg:V32HI 114 [ vect_cst_.38 ])
        (vec_duplicate:V32HI (reg/v:HI 169 [ a1 ]))) 4194 {*avx512bw_vec_dup_gprv32hi}
     (expr_list:REG_DEAD (reg/v:HI 169 [ a1 ])
        (nil)))
(insn 62 60 64 4 (set (reg:V32HI 129 [ vect_cst_.41 ])
        (vec_duplicate:V32HI (reg/v:HI 171 [ a2 ]))) 4194 {*avx512bw_vec_dup_gprv32hi}
     (expr_list:REG_DEAD (reg/v:HI 171 [ a2 ])
        (nil)))
...
Vlad, can you please have a look?
Comment 3 Vladimir Makarov 2015-01-30 17:48:18 UTC
Author: vmakarov
Date: Fri Jan 30 17:47:44 2015
New Revision: 220294

URL: https://gcc.gnu.org/viewcvs?rev=220294&root=gcc&view=rev
Log:
2015-01-30  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/64617
	* lra-constraints.c (prohibited_class_reg_set_mode_p): New
	function.
	(process_alt_operands): Use it.
	(curr_insn_transform): Check the optional reload pseudo class is
	ok for the mode.

2015-01-30  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/64617
	* gcc.target/i386/pr64617.c: New test.



Added:
    trunk/gcc/testsuite/gcc.target/i386/pr64617.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lra-constraints.c
    trunk/gcc/testsuite/ChangeLog
Comment 4 Uroš Bizjak 2015-01-30 19:00:56 UTC
*** Bug 64311 has been marked as a duplicate of this bug. ***
Comment 5 Jeffrey A. Law 2015-01-30 19:32:45 UTC
Should be fixed on trunk with Vlad's patch.