]> gcc.gnu.org Git - gcc.git/commitdiff
ipa-sra: Check also ECF_LOOPING_CONST_OR_PURE when evaluating calls
authorMartin Jambor <mjambor@suse.cz>
Wed, 1 Dec 2021 17:29:50 +0000 (18:29 +0100)
committerMartin Jambor <mjambor@suse.cz>
Wed, 1 Dec 2021 17:30:03 +0000 (18:30 +0100)
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.

gcc/tree-sra.c

index 909b4fef9a8171fdfadc5afda1c973184f86c871..252953b75126e35d34c4ce954b09a7ba87333090 100644 (file)
@@ -1530,7 +1530,8 @@ scan_function (void)
                    }
 
                  if (final_bbs
-                     && (flags & (ECF_CONST | ECF_PURE)) == 0)
+                     && ((flags & (ECF_CONST | ECF_PURE)) == 0
+                         || (flags & ECF_LOOPING_CONST_OR_PURE)))
                    bitmap_set_bit (final_bbs, bb->index);
                }
 
This page took 0.061829 seconds and 5 git commands to generate.