[Bug tree-optimization/67921] [6 Regression] "internal compiler error: in build_polynomial_chrec, at tree-chrec.h:147" when using -fsanitize=undefined

amker.cheng at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Oct 18 14:07:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67921

--- Comment #7 from bin.cheng <amker.cheng at gmail dot com> ---
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.



More information about the Gcc-bugs mailing list