https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117878

            Bug ID: 117878
           Summary: RISC-V: ICE when build spec17 526.blender_r with -O3
                    -march=rv64gcv_zvl256b
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pan2.li at intel dot com
  Target Milestone: ---

There will be one ICE when build spec2017 with "-O3 -march=rv64gcv_zvl256b",
the ICE may looks like below:

during RTL pass: vsetvl                                                        
                                                                               
                                                                               
                             dump file: tmp.c.338r.vsetvl                      
                                                                               
                                                                               
                                                         
blender/source/blender/blenloader/intern/versioning_legacy.c: In function
'blo_do_versions_pre250':                                                      
                                                                               
                                  
blender/source/blender/blenloader/intern/versioning_legacy.c:3624:1: internal
compiler error: Segmentation fault
 3624 | }                                                                      
                                                                               
                                                                               
                                   | ^                                         
                                                                               
                                                                               
                                                          0x44c9b27
internal_error(char const*, ...)                                               
                                                                               
                                                                               
                          
/home/pli/gcc/444/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/diagnostic-global-context.cc:517
                                                                               
                                                                               
  0x1bc7ba1 crash_signal                                                       
                                                                               
                                                                               
                                      
/home/pli/gcc/444/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/toplev.cc:322
                                                                               
                                                                               
                     0x7e2c1004531f ???                                        
                                                                               
                                                                               
                                                         
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0                  
                                                                               
                                                                               
                     0x22e238b riscv_vector::vlmax_avl_type_p(rtx_insn*)       
                                                                               
                                                                               
                                                         
/home/pli/gcc/444/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/config/riscv/riscv-v.cc:5178
                                                                               
                                                                               
      0x22e8e2a get_avl                                                        
                                                                               
                                                                               
                                          
/home/pli/gcc/444/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/config/riscv/riscv-vsetvl.cc:398
                                                                               
                                                                               
  0x22f13cd vsetvl_info::parse_insn(rtl_ssa::insn_info*)                       
                                                                               
                                                                               
                                      
/home/pli/gcc/444/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/config/riscv/riscv-vsetvl.cc:1037
                                                                               
                                                                               
 0x22f08fe vsetvl_info::vsetvl_info(rtl_ssa::insn_info*)                       
                                                                               
                                                                               
                                     
/home/pli/gcc/444/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/config/riscv/riscv-vsetvl.cc:826
                                                                               
                                                                               
  0x22eb764 pre_vsetvl::fuse_local_vsetvl_info()
       
/home/pli/gcc/444/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/config/riscv/riscv-vsetvl.cc:2732
                                                                               
                                                                               
 0x22ef52c pass_vsetvl::lazy_vsetvl()                                          
                                                                               
                                                                               
                                     
/home/pli/gcc/444/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/config/riscv/riscv-vsetvl.cc:3549
0x22ef817 pass_vsetvl::execute(function*)
       
/home/pli/gcc/444/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/config/riscv/riscv-vsetvl.cc:3611
Please submit a full bug report, with preprocessed source (by using
-freport-bug).                                                                 
                                                                               
                                         Please include the complete backtrace
with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

The vsetvl pass meets one rtl insn like blow but it shouldn't be here after
split1.

(insn 38816 38815 38817 149 (set (reg:V32QI 102 v6 [20405])                    
                                                                               
                                                                               
                                     (lshiftrt:V32QI (reg:V32QI 102 v6 [20403])
                                                                               
                                                                               
                                                                     
(const_vector:V32QI [                                                          
                                                                               
                                                                               
                                     (const_int 2 [0x2]) repeated x32          
                                                                               
                                                                               
                                                              ]))) 24628
{vlshrv32qi3}                                                                  
                                                                               
                                                                               
       (nil))

This insn comes from reload(reload may generate standard name pattern), and
then
the underlying pass have no chance to split it.

Thus, we need one similar way compares to ix86_pre_reload_split, to avoid
pattern generation during reload pass. I am testing a fix but seems not easy to
reduce the test files.

Reply via email to