Dear all, Am 04.11.22 um 10:53 schrieb Mikael Morin: > Le 03/11/2022 à 23:03, Harald Anlauf a écrit : >> I've spent some time not only staring at create_function_arglist, >> but trying several variations handling the declared hidden parms, >> and applying the necessary adjustments to gfc_get_function_type. >> (Managing linked trees is not the issue, just understanding them.) >> I've been unable to get the declarations in sync, and would need >> help how to debug the mess I've created.  Dropping my patch for >> the time being. >> > If you want, we can meet on IRC somewhen (tonight?). armed with the new knowledge, I could now understand what (more or less) trivially went wrong with my previous patch. The attached patch remedies that: gfc_get_function_type() now properly separates the types of the hidden parameters so that optional+value comes before string length and caf stuff, while in create_function_arglist we simply need to split the walking over the typelists so that the optional+value stuff, which is basically just booleans, is done separately from the other parts. Looking at the tree-dumps, the function decls now seem to be fine at least for the given testcases. I've adjusted one of the testcases to validate this. Regtests fine on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald