Re: [PATCH] Fix ipa-pure-const.c bug (PR ipa/77905)

2016-12-13 Thread Richard Biener
On Mon, 12 Dec 2016, Jakub Jelinek wrote: > Hi! > > The local pure const pass notices the static ctor is looping const, > so sets TREE_READONLY and DECL_LOOPING_CONST_OR_PURE_P and does not > clear DECL_STATIC_CONSTRUCTOR bit because it is looping. > Then the ipa pure const pass notices the stati

[PATCH] Fix ipa-pure-const.c bug (PR ipa/77905)

2016-12-12 Thread Jakub Jelinek
Hi! The local pure const pass notices the static ctor is looping const, so sets TREE_READONLY and DECL_LOOPING_CONST_OR_PURE_P and does not clear DECL_STATIC_CONSTRUCTOR bit because it is looping. Then the ipa pure const pass notices the static ctor is non-looping const, clears DECL_LOOPING_CONST_