]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix modref summary streaming
authorJan Hubicka <jh@suse.cz>
Wed, 17 Nov 2021 21:04:26 +0000 (22:04 +0100)
committerJan Hubicka <jh@suse.cz>
Wed, 17 Nov 2021 21:04:26 +0000 (22:04 +0100)
commit425369bf3068a9f840d1c2f04a4d4c38e924d4dc
treea5dcb79130425eae75cf594b5a331189c3a56268
parent69a5b3ca5c8fdd074fbb26fec926fa25fbec77c1
Fix modref summary streaming

Fixes bug in streaming in modref access tree that now cause a failure
of gamess benchmark.  The bug is quite old (present in GCC11 release) but it
needs quite interesting series of events to manifest. In particular
 1) At lto time ISRA turns some parameters passed by reference to scalar
 2) At lto time modref computes summaries for old parameters and then updates
    them but does so quite stupidly believing that the load from parameters
    are now unkonwn loads (rather than optimized out).
    This renders summary not very useful since it thinks every memory aliasing
    int is now accssed (as opposed as parameter dereference)
 3) At stream in we notice too early that summary is useless, set every_access
    flag and drop the list.  However while reading rest of the summary we
    overwrite the flag back to 0 which makes us to lose part of summary.
 4) right selection of partitions needs to be done to avoid late modref from
    recalculating and thus fixing the summary.

This patch fixes the stream in bug, however we also should fix updating of
summaries.

gcc/ChangeLog:

2021-11-17  Jan Hubicka  <hubicka@ucw.cz>

PR ipa/103246
* ipa-modref.c (read_modref_records): Fix streaminig in of every_access
flag.
gcc/ipa-modref.c