https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94188
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Richard Biener from comment #3) > Created attachment 48043 [details] > patch in testing > > This is what I have now, bootstrapped OK after the extra two hunks but I > still > see ICEs during testing. Still fixing build_fold_addr_expr_with_type looks > inevitable ... (other option would be to remove the optimization when the > type > doesn't match, but I guess that will regress as well). We can always do the match.pd change as optimization only, when the type matches or it isn't too hard to handle it, and tweak the PTA to handle the (pointer) (pointer - pointer_constant) case as lame pointer offsetting that preserves points-to of the first operand.