aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2025-05-27 23:08:54 +0200
committerHarald Anlauf <anlauf@gmx.de>2025-06-03 19:07:02 +0200
commit819b6415b639710566e4cc535241d82ccd708f76 (patch)
tree829ebeb538fbf329cf66d63022fd6aa05416d595 /gcc
parent25e46423bdfdf6e14cc1bc753f05b3b4fb5e8cc8 (diff)
downloadgcc-819b6415b639710566e4cc535241d82ccd708f76.zip
gcc-819b6415b639710566e4cc535241d82ccd708f76.tar.gz
gcc-819b6415b639710566e4cc535241d82ccd708f76.tar.bz2
Fortran: fix regression introduced by commit r16-914-g787a8dec1acedf
A last-minute cleanup before patch submission reordered a change that should not have happened. This fixes it. PR fortran/101735 gcc/fortran/ChangeLog: * primary.cc (gfc_match_varspec): Correct order of logic. (cherry picked from commit 74a2281ae18c6dbbc640f0c79f7138a495ef8f0c)
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/primary.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc
index 8443e89..794c4b3 100644
--- a/gcc/fortran/primary.cc
+++ b/gcc/fortran/primary.cc
@@ -2686,16 +2686,17 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
else if (component == NULL && !inquiry)
return MATCH_ERROR;
- /* Find end of reference chain if inquiry reference and tail not set. */
- if (tail == NULL && inquiry && tmp)
- tail = extend_ref (primary, tail);
-
/* Extend the reference chain determined by gfc_find_component or
is_inquiry_ref. */
if (primary->ref == NULL)
primary->ref = tmp;
else
{
+ /* Find end of reference chain if inquiry reference and tail not
+ set. */
+ if (tail == NULL && inquiry && tmp)
+ tail = extend_ref (primary, tail);
+
/* Set by the for loop below for the last component ref. */
gcc_assert (tail != NULL);
tail->next = tmp;