Bug 96755 - [11 Regression] ICE in final_scan_insn_1, at final.c:3073 with -O3 -march=skylake-avx512
Summary: [11 Regression] ICE in final_scan_insn_1, at final.c:3073 with -O3 -march=sky...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: 11.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: yarpgen
  Show dependency treegraph
 
Reported: 2020-08-23 23:26 UTC by Vsevolod Livinskii
Modified: 2021-11-01 23:07 UTC (History)
7 users (show)

See Also:
Host:
Target: x86_64-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-08-24 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Livinskii 2020-08-23 23:26:17 UTC
>$ g++ -O3 -march=skylake-avx512 -c func.cpp
func.cpp: In function ‘void test(short unsigned int, unsigned char, long long int)’:
func.cpp:13:1: error: could not split insn
   13 | }
      | ^
(insn 644 21 817 50 (set (reg:DI 70 k2 [orig:83 D.4406 ] [83])
        (zero_extend:DI (not:SI (reg:SI 70 k2 [orig:505 b ] [505])))) "func.cpp":10:18 622 {*one_cmplsi2_1_zext}
     (nil))
during RTL pass: final
func.cpp:13:1: internal compiler error: in final_scan_insn_1, at final.c:3073
0x7cf5e7 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
	/gcc/rtl-error.c:108
0x75b978 final_scan_insn_1
	/gcc/final.c:3073
0xd9b5cf final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
	/gcc/final.c:3152
0xd9b8c7 final_1
	/gcc/final.c:2020
0xd9c298 rest_of_handle_final
	/gcc/final.c:4658
0xd9c298 execute
	/gcc/final.c:4736


Reproducer:
extern long var_22;
extern int arr_3[];
extern int arr_4[][20][9];
short a;
void test(unsigned short b, unsigned char e, long long g) {
  for (long c = 0; c < 20ULL; c = g)
    for (short d = 0; d < 9; d++)
      for (char f = e; f < 8; f += 4) {
        arr_3[f] = 0;
        var_22 = ~(unsigned)b;
        arr_4[c][d][f] = a;
      }
}

gcc version 11.0.0 20200823 (87c753ac241f25d222d46ba1ac66ceba89d6a200)
Comment 1 Uroš Bizjak 2020-08-24 06:32:25 UTC
Confirmed, CC author.
Comment 2 Hongtao.liu 2020-08-24 08:25:25 UTC
Sorry for TYPO
---
 (define_split
   [(set (match_operand:DI 0 "mask_reg_operand")
        (zero_extend:DI
-         (not:DI (match_operand:SI 1 "mask_reg_operand"))))]
+         (not:SI (match_operand:SI 1 "mask_reg_operand"))))]
   "TARGET_AVX512BW && reload_completed"
---
Comment 3 GCC Commits 2020-08-25 05:42:48 UTC
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>:

https://gcc.gnu.org/g:108477875f01798eecd7780207396b8c44930ae9

commit r11-2833-g108477875f01798eecd7780207396b8c44930ae9
Author: liuhongt <hongtao.liu@intel.com>
Date:   Mon Aug 24 20:52:20 2020 +0800

    Refine typo to fix ICE.
    
    2020-08-24  Hongtao Liu  <hongtao.liu@intel.com>
    
    gcc/ChangeLog:
            PR target/96755
            * config/i386/sse.md: Correct the mode of NOT operands to
            SImode.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/pr96755.c: New test.
Comment 4 Hongtao.liu 2020-08-25 05:45:42 UTC
Fixed in GCC11.
Comment 5 Richard Biener 2020-08-25 11:43:09 UTC
.