Hi! bootstrap-ubsan reported taking address of a &distance->where when distance is NULL. The function has one block guarded with if (distance) and another guarded with if (failed), so I think this is just a pasto from the earlier if (distance) block.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2017-07-31 Jakub Jelinek <ja...@redhat.com> * check.c (gfc_check_num_images): Fix a pasto. --- gcc/fortran/check.c.jj 2017-03-05 22:39:52.000000000 +0100 +++ gcc/fortran/check.c 2017-07-28 14:30:40.503511275 +0200 @@ -5149,7 +5149,7 @@ gfc_check_num_images (gfc_expr *distance return false; if (!gfc_notify_std (GFC_STD_F2008_TS, "FAILED= argument to " - "NUM_IMAGES at %L", &distance->where)) + "NUM_IMAGES at %L", &failed->where)) return false; } Jakub