[patch, fortran, committed] Show details of attr->allocated in dump

Thomas Koenig <[email protected]> Sat, 18 Jul 2026 10:49:49 +0200
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------9uAk3naOYWR4ps3c4RCHeUY0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello world,

I have just committed the patch below as obvious and simple.

Best regards

	Thomas

Show details of attr->allocated with -fdump-fortran-original.

This simple and obvious patch adds output for the var_allocated enum,
to make the status of where the gfortran thinks a potential allocation
came from more clear.

Instead of (example from warn_unused_but_set_variable_4.f90)

attributes: (VARIABLE  ALLOCATABLE DIMENSION REFERENCED 
VALUE-SET(INTENT-OUT) ALLOCATED)

this now displays

attributes: (VARIABLE  ALLOCATABLE DIMENSION REFERENCED 
VALUE-SET(INTENT-OUT) ALLOCATED(ARG))

No user impact (unless the user is exceptionally curious) and no test
case.

gcc/fortran/ChangeLog:

         PR fortran/126058
         * dump-parse-tree.cc (show_attr): Show details of
         attr->allocated.

--------------9uAk3naOYWR4ps3c4RCHeUY0
Content-Type: text/x-patch; charset=UTF-8; name="p-dump.diff"
Content-Disposition: attachment; filename="p-dump.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL2djYy9mb3J0cmFuL2R1bXAtcGFyc2UtdHJlZS5jYyBiL2djYy9mb3J0
cmFuL2R1bXAtcGFyc2UtdHJlZS5jYwppbmRleCAxOWRmZmUzOGFlZC4uZWFmNjU2NWQwZTAg
MTAwNjQ0Ci0tLSBhL2djYy9mb3J0cmFuL2R1bXAtcGFyc2UtdHJlZS5jYworKysgYi9nY2Mv
Zm9ydHJhbi9kdW1wLXBhcnNlLXRyZWUuY2MKQEAgLTEwNTgsOCArMTA1OCwyMCBAQCBzaG93
X2F0dHIgKHN5bWJvbF9hdHRyaWJ1dGUgKmF0dHIsIGNvbnN0IGNoYXIgKiBtb2R1bGUpCiAg
ICAgICBnZmNfaW50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