From cd6d518b2978157020752ae1b5627e7619923930 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 13 Dec 2016 09:48:45 +0100 Subject: re PR ipa/77905 (ICE at -Os and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in ipa_comdats, at ipa-comdats.c:352)) 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. From-SVN: r243596 --- gcc/ipa-pure-const.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/ipa-pure-const.c') diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 9732cbf..634dece 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; } -- cgit v1.1