Hi,

The Fortran front-end, in gfc_trans_fail_image() emits a call to 
_gfortran_caf_fail_image with one argument (a NULL pointer):

    return build_call_expr_loc (input_location,
                                gfor_fndecl_caf_fail_image, 1,
                                build_int_cst (pchar_type_node, 0));

while the prototype for the function in libgfortran is clear that it takes no 
argument:

  void _gfortran_caf_fail_image (void) __attribute__ ((noreturn));

The bug was filed as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96947
This obvious patch removes the useless argument (which triggers wrong code 
generation on aarch64-apple-darwin20).


Regtested on x86_64-apple-darwin19 and tested on aarch64-apple-darwin20.
OK to commit?

FX

Attachment: fail_image.diff
Description: Binary data

Attachment: fail_image.ChangeLog
Description: Binary data

Reply via email to