Fix checking failure in IPA-SRA
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 4 Dec 2020 09:04:56 +0000 (10:04 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Fri, 4 Dec 2020 09:07:42 +0000 (10:07 +0100)
commit241a2c498005207d52a3d64884e41953fc00275c
tree06c62e18f86f6236c9ccabcbbc9313fd97de2c2a
parent9199da4b59c34cbcf2cea912b39400d7e90525d6
Fix checking failure in IPA-SRA

This is a regression present on the mainline and 10 branch: on the one
hand, IPA-SRA does *not* disqualify accesses with zero size but, on the
other hand, it checks that accesses present in the tree have a (strictly)
positive size, thus trivially yielding an ICE in some cases.

gcc/ChangeLog:
* ipa-sra.c (verify_access_tree_1): Relax assertion on the size.

gcc/testsuite/ChangeLog:
* gnat.dg/opt91.ads, gnat.dg/opt91.adb: New test.
* gnat.dg/opt91_pkg.ads, gnat.dg/opt91_pkg.adb: New helper.
gcc/ipa-sra.c
gcc/testsuite/gnat.dg/opt91.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/opt91.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/opt91_pkg.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/opt91_pkg.ads [new file with mode: 0644]