Hello world, here is an update to the patch. I have now included variables where the user did not specify INTENT(IN) by checking that the dummy variables to be replaced by temporaries are not, indeed, assigned a value. This also includes being passed as an actual argument to a non-INTENT(IN) dummy argument. Extending this led to being able to catch a few more bugs. I have addes one test case to check where the new temporaries are added. Regression-tested. The only change I see in the testsuite now is XPASS: gfortran.dg/goacc/kernels-loop-n.f95 -O scan-tree-dump-times parloops1 "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 So, OK for trunk? Regards Thomas 2019-11-11 Thomas Koenig PR fortran/67202 * dump-parse-tree.c (debug): Add for gfc_namespace. (show_code_node): Add INIT_ on dumping EXEC_INIT_ASSIGN. * frontent-passes.c (replace_intent_in): Add prototype. New function. (optimize_namespace): Call it. (sym_replacement): New struct. (defined_code_callback): New function. (defined_expr_callback): New function. (replace_symbol_in_expr): New function. 2019-11-11 Thomas Koenig PR fortran/67202 * gfortran.dg/intent_optimize_3.f90: New test. * gfortran.dg/intent_optimize_4.f90: New test. * gfortran.dg/pr26246_2.f90: Add -fno-frontend-optimize to flags.