ipa-sra: Check also ECF_LOOPING_CONST_OR_PURE when evaluating calls
in PR 103267 Honza found out that IPA-SRA does not look at
ECF_LOOPING_CONST_OR_PURE when evaluating if a call can have side
effects. Fixed with this patch. The testcase infinitely loops in a
const function, so it would not make a good addition to the testsuite.
This patch is a manual backport of commit
e5440bc08e07fd491dcccd47e1b86a5985ee117c to the old "early" IPA-SRA.
gcc/ChangeLog:
2021-12-01 Martin Jambor <mjambor@suse.cz>
PR ipa/103267
* tree-sra.c (scan_function): Also check ECF_LOOPING_CONST_OR_PURE
flag.