> I think we really need Eric (as one who e.g. introduced the > DECL_INVARIANT_P apparently for this kind of stuff) to have a look at that > on the Ada side.
DECL_INVARIANT_P is only set on discriminants with no default value and those are really invariant in Ada, i.e. do not change once set. > The question is if the posted tree.cc (smallest) patch + 3 new testcases > + the 7 ada testsuite workarounds are ok for trunk if it passes > bootstrap/regtest, then I'd file a PR about the Ada regression and only once > it is dealt with would consider backporting, or if we need to wait for Eric > before making progress. Let me have a quick look first, as pessimizing loop optimizations in Ada in order to fix a 11-year old PR seems to be a little bit hasty. -- Eric Botcazou