PR77765 exposed an ICE triggered in gfortran's acc routine parser by an uninitialized proc_name. That situation occurred because the function containing the acc routine directive has an error, so gfc_current_ns->proc_name was never set. Although it could be argued that the acc routine parser should not run if any errors have been detected inside the routine containing such a directive, this patch just teaches gfc_match_oacc_routine to check for the existence of gfc_current_ns->proc_name before comparing the procedure's name with the routine name specified by the user. Is this patch OK for trunk and gcc7? Thanks, Cesar