------- Comment #8 from burnus at gcc dot gnu dot org 2009-05-27 16:43 ------- (In reply to comment #6) > The patch in comment #5 fixes most of the issues, not all. Remaining [...] > parameter_unused and blockdata_3 fail because it complains that argc and argv > are unused, even though the 003t.original shows that _gfortran_set_args is > called as it should.
See patch below. The problem is (as always) that GIMPLE requires the user to do everything - while in C the compiler does all the work :-) @@ -3903,6 +3912,8 @@ /* Call some libgfortran initialization routines, call then MAIN__(). */ /* Call _gfortran_set_args (argc, argv). */ + TREE_USED (argc) = 1; + TREE_USED (argv) = 1; tmp = build_call_expr (gfor_fndecl_set_args, 2, argc, argv); gfc_add_expr_to_block (&body, tmp); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40270