]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PR 91832] Do not ICE on negative offsets in ipa-sra
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Sep 2019 11:16:57 +0000 (11:16 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Sep 2019 11:16:57 +0000 (11:16 +0000)
commit5b757a5c7ad8c38fe0e79378d13cae58f9fc823e
treee0e8f506f497d6d20c321c60767cd80e88ff880b
parentfdc4a806cb8fbce68aff3b23516e8f3de1f6094c
[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  <mjambor@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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@276093 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/ipa-sra.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ipa/pr91832.c [new file with mode: 0644]