This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/67921] [6 Regression] "internal compiler error: in build_polynomial_chrec, at tree-chrec.h:147" when using -fsanitize=undefined
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 Nov 2015 16:54:11 +0000
- Subject: [Bug tree-optimization/67921] [6 Regression] "internal compiler error: in build_polynomial_chrec, at tree-chrec.h:147" when using -fsanitize=undefined
- Auto-submitted: auto-generated
- References: <bug-67921-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67921
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(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?