]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix regression with -Wexternal-argument-mismatch.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 8 Mar 2025 15:13:41 +0000 (16:13 +0100)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 8 Mar 2025 21:47:18 +0000 (22:47 +0100)
commit90d9cdfa82d9a8d63e35d928e335719a495c79e3
treed745bffa75e7300b3bc058577b5f31ac71532f91
parent613f8ddbe3d7da63d827e588bf0333813c184b8a
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.
gcc/fortran/gfortran.h
gcc/fortran/interface.cc
gcc/fortran/symbol.cc
gcc/testsuite/gfortran.dg/interface_57.f90 [new file with mode: 0644]