https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67921
--- Comment #9 from amker at gcc dot gnu.org --- (In reply to Jakub Jelinek from comment #8) > (In reply to bin.cheng from comment #7) > > Hmm, this issue could be simply because chrec_fold_multiply doesn't use > > sizetype as CHREC_RIGHT's type to build pointer type CHREC: > > > > return build_polynomial_chrec > > (CHREC_VARIABLE (op0), > > chrec_fold_multiply (type, CHREC_LEFT (op0), op1), > > chrec_fold_multiply (type, CHREC_RIGHT (op0), op1)); > > > > It should be fixed by using sizetype for pointer type CHREC node: > > > > return build_polynomial_chrec > > (CHREC_VARIABLE (op0), > > chrec_fold_multiply (type, CHREC_LEFT (op0), op1), > > chrec_fold_multiply (POINTER_TYPE_P (type) ? sizetype : type, > > CHREC_RIGHT (op0), op1)); > > > > I will test a patch. > > Have you managed to test that change? Sorry for being late. The patch was rejected at https://gcc.gnu.org/ml/gcc-patches/2015-10/msg02013.html Since the real problem is in fold, we may not fix chrec to deal with wrong form expressions.