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

            Bug ID: 120782
           Summary: RISC-V: vector-strict-align not working for spec17 521
                    ref size
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pan2.li at intel dot com
  Target Milestone: ---

Created attachment 61689
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61689&action=edit
GDB snapshot

When running the spec2017 521 with ref size on K1(vl=256b) board, we meet a
mis-alignment issue similar as below with `-O3 -march=rv64gcvb`

vsetivli zero,2,e64,m1,ta,ma
vlse64.v v2,(t4),zero

The gdb shows the t4 is 0x5553f94, which is a misalign access and result in
SIGBUS from K1 board.  Thus, we have a try to add option
`-mvector-strict-align` but unfortunately it looks like not working, we still
meet this SIGBUS with almos the same asm code from dump.

error: a total of 1 children finished with errors                              
                                                                               
                                                                               
                           # specinvoke exit: rc=0

****************************************                                       
                                                                               
                                                                               
                           ****************************************
Contents of wrf.err                                                            
                                                                               
                                                                               
                           ****************************************
Program received signal SIGBUS: Access to an undefined portion of a memory
object.                                                                        
                                                                               
                                Backtrace for this error:
#0  0x3f9cf52857 in ???
#1  0x3f9cf51daf in ???
#2  0x3f9d0677ff in ???
#3  0xd20cac in __module_ra_rrtm_MOD_taugb6
        at
/xx/benchspec/CPU/521.wrf_r/build/build_base_gcc-master-250305-rv64.0000/module_ra_rrtm.fppized.f90:5172
#4  0xd22da9 in __module_ra_rrtm_MOD_gasabs
        at
/xx/benchspec/CPU/521.wrf_r/build/build_base_gcc-master-250305-rv64.0000/module_ra_rrtm.fppized.f90:6664
#5  0xd2bb9d in __module_ra_rrtm_MOD_rrtm
        at
/xxbenchspec/CPU/521.wrf_r/build/build_base_gcc-master-250305-rv64.0000/module_ra_rrtm.fppized.f90:2236
#6  0xd2c767 in __module_ra_rrtm_MOD_rrtmlwrad
        at
/xx/benchspec/CPU/521.wrf_r/build/build_base_gcc-master-250305-rv64.0000/module_ra_rrtm.fppized.f90:1994

GDB snapshot, please see the attachment. Feel free to ping me if you cannot
reproduce this.

GNU Fortran (GCC) 15.1.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Reply via email to