[Bug fortran/121384] Wrongly initialized associate array descriptor when the target is wrapped in parenthesis

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121384

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <[email protected]>:

https://gcc.gnu.org/g:9913a517dbd3fa3865332839ab872799037231d9

commit r17-3370-g9913a517dbd3fa3865332839ab872799037231d9
Author: Paul Thomas <[email protected]>
Date:   Tue Aug 18 15:31:31 2026 +0100

    Fortran: Fix wrongly initialized associate-name descriptor [PR121384]

    The fix posted in comment #1 of the PR turned out to be completely wrong
    because it missed the invalid error, which is now checked in the second
    testcase, associate_84.f90.

    Instead, the fix required the the removal of the bad code in
    resolve_assoc_var,converting an expression contained in paretheses to be
    the target expression. As it happens, trans-stmt(trans_associate_var) is
    perfectly capable of converting the parentheses expressions correctly.

    This verges on being an 'obvious' fix.

    2026-08-18  Paul Thomas  <[email protected]>

    gcc/fortran
            PR fortran/121384
            * resolve.cc (resolve_assoc_var): Delete symbol 'parentheses'
            and do not use the expression contained in parentheses as a
            target. Use the latter expression as an alternative to variable
            expressions for some error checking.

    gcc/testsuite
            PR fortran/121384
            * gfortran.dg/associate_83.f90: New test.
            * gfortran.dg/associate_84.f90: New test.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.