]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PR 91832] Do not ICE on negative offsets in ipa-sra
authorMartin Jambor <mjambor@suse.cz>
Tue, 24 Sep 2019 11:16:57 +0000 (13:16 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 24 Sep 2019 11:16:57 +0000 (13:16 +0200)
commit5a4d0da4f5840b9829316e93710b4bd4269b9366
treee0e8f506f497d6d20c321c60767cd80e88ff880b
parent3f9e08f57e1de90de5bc9d2a00815ea38064c733
[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.

From-SVN: r276093
gcc/ChangeLog
gcc/ipa-sra.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ipa/pr91832.c [new file with mode: 0644]