On x86, r238991 caused: [hjl@gnu-6 gcc]$ ./xgcc -B./ /export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.target/i386/mpx/pr66048.cc -S -O2 -fcheck-pointer-bounds -mmpx -mavx /export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.target/i386/mpx/pr66048.cc: In function ‘c1 test.chkp(c2, #‘pointer_bounds_type’ not supported by dump_type#<type error>, void, ...)’: /export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.target/i386/mpx/pr66048.cc:16:1: internal compiler error: in create_pre_exit, at mode-switching.c:451 } ^ 0x1b3e104 create_pre_exit /export/gnu/import/git/sources/gcc/gcc/mode-switching.c:437 0x1b3e377 optimize_mode_switching /export/gnu/import/git/sources/gcc/gcc/mode-switching.c:534 0x1b3f6a6 execute /export/gnu/import/git/sources/gcc/gcc/mode-switching.c:892 0xfe1176 gcc::pass_manager::execute_pass_mode_switching() /export/gnu/import/git/sources/gcc/gcc/passes.c:123 0x14d5a3a rest_of_handle_insert_vzeroupper /export/gnu/import/git/sources/gcc/gcc/config/i386/i386.c:2685 0x14d95d2 execute /export/gnu/import/git/sources/gcc/gcc/config/i386/i386.c:4068 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. [hjl@gnu-6 gcc]$
H.J., thanks for reporting this. I am planning to fix it today.
Author: vmakarov Date: Tue Aug 2 20:57:04 2016 New Revision: 239000 URL: https://gcc.gnu.org/viewcvs?rev=239000&root=gcc&view=rev Log: 2016-08-02 Vladimir Makarov <vmakarov@redhat.com> PR middle-end/72778 * lra-spills.c (regno_in_use_p): New. (lra_final_code_change): Use it. Modified: trunk/gcc/ChangeLog trunk/gcc/lra-spills.c
The fix is not complete, I still get bootstrap failure with the above ICE when building libgo with compiler, configured with "--with-arch=core-avx-i --with-cpu=core-avx-i". To be attached preprocessed source illustrates the problem. ./cc1 -O2 -fplan9-extensions -fexceptions -fnon-call-exceptions -march=core-avx2 -fpreprocessed -quiet sema.i /home/uros/gcc-svn/trunk/libgo/runtime/sema.goc: In function ‘sync_runtime_notifyListAdd’: /home/uros/gcc-svn/trunk/libgo/runtime/sema.goc:347:1: internal compiler error: in create_pre_exit, at mode-switching.c:451 ^ 0x12a6e8e create_pre_exit /home/uros/gcc-svn/trunk/gcc/mode-switching.c:437 0x12a6e8e optimize_mode_switching /home/uros/gcc-svn/trunk/gcc/mode-switching.c:534 0x12a6e8e execute /home/uros/gcc-svn/trunk/gcc/mode-switching.c:892 0xe475fd rest_of_handle_insert_vzeroupper /home/uros/gcc-svn/trunk/gcc/config/i386/i386.c:2685 0xe475fd execute /home/uros/gcc-svn/trunk/gcc/config/i386/i386.c:4068 Please submit a full bug report, ...
Created attachment 39050 [details] Preprocessed source
single_set does not detect (insn 6 19 7 2 (parallel [ (set (reg:SI 0 ax [orig:88 _5 ] [88]) (unspec_volatile:SI [ (mem/v:SI (reg/v/f:DI 5 di [orig:90 l ] [90]) [-1 S4 A32]) (const_int 32773 [0x8005]) ] UNSPECV_XCHG)) (set (mem/v:SI (reg/v/f:DI 5 di [orig:90 l ] [90]) [-1 S4 A32]) (plus:SI (mem/v:SI (reg/v/f:DI 5 di [orig:90 l ] [90]) [-1 S4 A32]) (reg:SI 0 ax [orig:88 _5 ] [88]))) (clobber (reg:CC 17 flags)) ]) /home/uros/gcc-svn/trunk/libgo/runtime/sema.goc:345 4933 {atomic_fetch_addsi} (nil)) as a single-set insn.
Before the patch, register allocator used to leave self-assignments (e.g. insn 20) in the insn stream. Post-reload vzeroupper insertion mode-swithing pass depends on these instructions. Self-assignments are later removed by subsequent passes. ... (insn 6 19 20 2 (parallel [ (set (reg:SI 0 ax [orig:88 _5 ] [88]) (unspec_volatile:SI [ (mem/v:SI (reg/v/f:DI 5 di [orig:90 l ] [90]) [-1 S4 A32]) (const_int 32773 [0x8005]) ] UNSPECV_XCHG)) (set (mem/v:SI (reg/v/f:DI 5 di [orig:90 l ] [90]) [-1 S4 A32]) (plus:SI (mem/v:SI (reg/v/f:DI 5 di [orig:90 l ] [90]) [-1 S4 A32]) (reg:SI 0 ax [orig:88 _5 ] [88]))) (clobber (reg:CC 17 flags)) ]) /home/uros/gcc-svn/trunk/libgo/runtime/sema.goc:345 4933 {atomic_fetch_addsi} (nil)) (insn 20 6 7 2 (set (reg:SI 0 ax [orig:88 _5 ] [88]) (reg:SI 0 ax [orig:88 _5 ] [88])) /home/uros/gcc-svn/trunk/libgo/runtime/sema.goc:345 82 {*movsi_internal} (nil)) ... Can we have these self-assignments back?
(In reply to Uroš Bizjak from comment #6) Hi, Uros. Thanks for reporting this. It was my mistake that I did not check bootstrap with GO. I am going to fix it soon. > Before the patch, register allocator used to leave self-assignments (e.g. > insn 20) in the insn stream. Post-reload vzeroupper insertion mode-swithing > pass depends on these instructions. Self-assignments are later removed by > subsequent passes. > > > Can we have these self-assignments back? Unfortunately, LRA can produce wrong moves (it was even before I implemented invariant inheritance which also can do it). It is important to remove them at this stage, otherwise GCC crashes on later passes.
Author: vmakarov Date: Wed Aug 3 18:54:49 2016 New Revision: 239091 URL: https://gcc.gnu.org/viewcvs?rev=239091&root=gcc&view=rev Log: 2016-08-03 Vladimir Makarov <vmakarov@redhat.com> PR middle-end/72778 * lra-spills.c (regno_in_use_p): Check bb and regno modification. Don't stop on regular insns. Modified: trunk/gcc/ChangeLog trunk/gcc/lra-spills.c
(In reply to Vladimir Makarov from comment #7) > (In reply to Uroš Bizjak from comment #6) > > Hi, Uros. Thanks for reporting this. It was my mistake that I did not check > bootstrap with GO. I am going to fix it soon. Yes, the patch fixes bootstrap problem (all default languages + obj-c++ and go) for build with ivybridge default cpu and architecture. Thanks!