+/* Generate code for the IARGC intrinsic. If args_only is true this is
+ actually the COMMAND_ARGUMENT_COUNT intrinsic, so return IARGC - 1. */
+
+static void
+gfc_conv_intrinsic_iargc (gfc_se * se, gfc_expr * expr, bool args_only)
+{
+ tree tmp;
+ tree fndecl;
+ tree type;
+
+ /* Call the library function. This always returns an INTEGER(4). */
+ fndecl = gfor_fndecl_iargc;
+ tmp = gfc_build_function_call (fndecl, NULL_TREE);
+
+ /* Convert it to the required type. */
+ type = gfc_typenode_for_spec (&expr->ts);
+ tmp = fold_convert (type, tmp);
+
+ if (args_only)
+ tmp = build2 (MINUS_EXPR, type, tmp, convert (type, integer_one_node));
+ se->expr = tmp;
+}
+