https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98230
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eric Botcazou <ebotca...@gcc.gnu.org>: https://gcc.gnu.org/g:779bf1823ced0814803d2be7f7ded0317e70140c commit r11-5920-g779bf1823ced0814803d2be7f7ded0317e70140c Author: Ed Schonberg <schonb...@adacore.com> Date: Thu Dec 10 22:26:57 2020 +0100 Fix PR ada/98230 It's a rather curious malfunction of the 'Mod attribute applied to the variable of a loop whose upper bound is dynamic. gcc/ada/ChangeLog: PR ada/98230 * exp_attr.adb (Expand_N_Attribute_Reference, case Mod): Use base type of argument to obtain static bound and required size. gcc/testsuite/ChangeLog: * gnat.dg/modular6.adb: New test.