https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95979
--- Comment #4 from anlauf at gcc dot gnu.org --- (In reply to anlauf from comment #3) > Maybe the issue is related to PR87711, where the optional KIND argument > causes havoc with the elementalness of an intrinsic. (There it is LEN_TRIM). Replying to myself: it seems to be that simplification fails when one of the arguments to INDEX is array-valued. Might be a general issue.