https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94179
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #2) > Created attachment 48036 [details] > gcc10-pr94179.patch > > Untested fix. > And/or we could limit the match.pd optimization to GIMPLE only, as at least > the C FE doesn't seem to be prepared to handle MEM_REFs and it is unclear if > this is the only spot that needs fixing. Doing it GIMPLE only may need additional "fixes" when people disable forwprop though (didn't check). IMHO the FEs better deal with all GENERIC if they call into middle-end routines. But I'm not against doing this and I don't think we need to care about people doing -fno-tree-forwprop, it's just you brought it up ... ;)