https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91832
--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> --- Author: jamborm Date: Tue Sep 24 11:16:57 2019 New Revision: 276093 URL: https://gcc.gnu.org/viewcvs?rev=276093&root=gcc&view=rev Log: [PR 91832] Do not ICE on negative offsets in ipa-sra Hi, IPA-SRA asserts that an offset obtained from get_ref_base_and_extent is non-negative (after it verifies it is based on a parameter). That assumption is invalid as the testcase shows. One could probably also write a testcase with defined behavior, but unless I see a reasonable one where the transformation is really desirable, I'd like to just punt on those cases. Bootstrapped and tested on x86_64-linux. OK for trunk? Thanks, Martin 2019-09-24 Martin Jambor <mjam...@suse.cz> PR ipa/91832 * ipa-sra.c (scan_expr_access): Check that offset is non-negative. testsuite/ * gcc.dg/ipa/pr91832.c: New test. Added: trunk/gcc/testsuite/gcc.dg/ipa/pr91832.c Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-sra.c trunk/gcc/testsuite/ChangeLog