diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-12-13 08:48:45 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-12-13 08:48:45 +0000 |
commit | 98b8f2a556ab071045fe370f19049d341af41bc8 (patch) | |
tree | 8166df4ebffb4989c80fc6adbc1163d94c21c06a /gcc/ipa-pure-const.c | |
parent | ba3f376e8bd246431d94d6b07fb40b38b55d59e6 (diff) | |
download | gcc-98b8f2a556ab071045fe370f19049d341af41bc8.tar.gz |
PR ipa/77905
* ipa-pure-const.c (cdtor_p): Return true for
DECL_STATIC_{CON,DE}STRUCTOR even when it is
DECL_LOOPING_CONST_OR_PURE_P.
* g++.dg/ipa/pr77905.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243596 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r-- | gcc/ipa-pure-const.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 9732cbff12e..634decee1e3 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -1195,7 +1195,8 @@ static bool cdtor_p (cgraph_node *n, void *) { if (DECL_STATIC_CONSTRUCTOR (n->decl) || DECL_STATIC_DESTRUCTOR (n->decl)) - return !TREE_READONLY (n->decl) && !DECL_PURE_P (n->decl); + return ((!TREE_READONLY (n->decl) && !DECL_PURE_P (n->decl)) + || DECL_LOOPING_CONST_OR_PURE_P (n->decl)); return false; } |