> On Fri, Feb 07, 2014 at 12:50:22AM +0100, Jan Hubicka wrote: > > Don't we want to check opt_for_fn (node->decl, cp) instead and arrange > > -fipa-cp > > to be false when !optimize? > > I can easily imagine using > !opt_for_fn (node->decl, optimize) > || !opt_for_fn (node->decl, flag_ipa_cp) > but guaranteeing flag_ipa_cp or flag_ipa_sra is never true for optimize == 0 > could be harder, what if something is built with -O0 -fipa-cp or > __attribute__((optimize (0), "fipa-cp"))) or similar? Checking optimize > value is among other things about the lack of vdef/vuse for !optimize.
I always tought it would be better to inform users that -O0 -fipa-cp is broken combination of flags (but it seems our policy to not do that) or just clear -fipa-cp while processing argument as we do for some other contradicting combinations. But yes, lets go with those two checks now, to do what gate does: static bool cgraph_gate_cp (void) { /* FIXME: We should remove the optimize check after we ensure we never run IPA passes when not optimizing. */ return flag_ipa_cp && optimize; } Honza > > Jakub