https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90811
Kito Cheng <kito at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kito at gcc dot gnu.org, | |wilson at gcc dot gnu.org --- Comment #15 from Kito Cheng <kito at gcc dot gnu.org> --- RISC-V got fail after g:26d7a5e690169ac04acde90070b0092c41b71c7e for gfortran.dg/pr45636.f90 It seems like because alignment change cause simplify_builtin_call can't simplify memset to load/store. The story for RISC-V here: - simplify_builtin_call call can_store_by_pieces check it's OK to store by pieces? - can_store_by_pieces call targetm.use_by_pieces_infrastructure_p to ask back-end - targetm.use_by_pieces_infrastructure_p call by_pieces_ninsns to calculate how many instruction needed, it was 1 for RV64*, because alignment is changed to 8 bits from 64 bits for char array due to this patch g:26d7a5e690169ac04acde90070b0092c41b71c7e. - by_pieces_ninsns got 4 instead of 1, and large than MOVE_RATIO, failed to simplify memset to load/store. - ARM (aarch32) seems like same story too. * Configure option for RV64: --target=riscv64-unknown-linux-gnu --with-arch=rv64gc --with-abi=lp64 Analysis: - align_local_variable changed policy, only ask alignment info (SET_DECL_ALIGN) from back-end only when expanding (expand pass). - So that's cause cost measurement changed, because some cost measurement are depend on the alignment.