On Fri, 7 Feb 2014, Jan Hubicka wrote: > > 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.
Well, we have the very same issue for other optimization passes and -O0 (and now also -Og). The idea that you can _enable_ random passes is simply not true. But yes, diagnosing that a switch is ignored would be nice ... Richard.