[Bug ada/98230] incorrect Type'Mod during a loop whose range is computed by a variable

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 10 21:30:39 GMT 2020


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 <ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:779bf1823ced0814803d2be7f7ded0317e70140c

commit r11-5920-g779bf1823ced0814803d2be7f7ded0317e70140c
Author: Ed Schonberg <schonberg@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.


More information about the Gcc-bugs mailing list