On 12/31/20 4:34 PM, Xi Ruoyao via Gcc-patches wrote: > On 2021-01-01 07:29 +0800, Xi Ruoyao wrote: >> An invalid use of MSA_SUPPORTED_MODE_P is causing ICE on mips64el with -mmsa. >> The detailed analysis is posted on bugzilla: >> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98491 >> >> The attached patch fixes this issue by handling the special case of >> MSA_SUPPORTED_MODE_P explicitly. >> >> Please keep me in CC since I'm not a subscriber. >> >> And, I don't have GIT write access. > Sorry, I forgot to include the ChangeLog: > > gcc/ChangeLog: > > 2020-12-31 Xi Ruoyao > > PR target/98491 > * config/mips/mips.c (mips_symbol_insns): Do not use > MSA_SUPPORTED_MODE_P if mode is MAX_MACHINE_MODE. So I absolutely agree the current code is wrong as it does an out of bounds array access. Would it be better to instead to change MSA_SUPPORTED_MODE_P to evaluate to zero if MODE is MAX_MACHINE_MODE?  That would protect all the uses of MSA_SUPPORTED_MODE_P.    Something like this perhaps? Jeff