https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119157

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Thomas Koenig <tkoe...@gcc.gnu.org>:

https://gcc.gnu.org/g:90d9cdfa82d9a8d63e35d928e335719a495c79e3

commit r15-7909-g90d9cdfa82d9a8d63e35d928e335719a495c79e3
Author: Thomas Koenig <tkoe...@gcc.gnu.org>
Date:   Sat Mar 8 16:13:41 2025 +0100

    Fix regression with -Wexternal-argument-mismatch.

    The attached patch fixes an ICE regresseion where undo state was not
    handled properly when generating formal from actual arguments, which
    occurred under certain conditions with the newly introduced
    -Wexternal-argument-mismatch option.

    The fix is simple: When we are generating these symbols, we no
    longer need to undo anything, so we can just remove them.
    I had considered adding an extra optional argument, but decided
    against it on code clarity grounds.

    While looking at the code, I also saw that a member of gfc_symbol
    introduced with my patch should be a bitfield of width 1.

    gcc/fortran/ChangeLog:

            PR fortran/119157
            * gfortran.h (gfc_symbol): Make ext_dummy_arglist_mismatch a
            one-bit bitfield
            (gfc_pop_undo_symbol): Declare prototype.
            * symbol.cc (gfc_pop_undo_symbol): New function.
            * interface.cc (gfc_get_formal_from_actual_arglist): Call it
            for artificially introduced formal variables.

    gcc/testsuite/ChangeLog:

            PR fortran/119157
            * gfortran.dg/interface_57.f90: New test.

Reply via email to