This patch to the Go frontend delays building the struct type for a go/defer thunk until it is needed. We were building it in the determine_types pass. Now, we delay until the simplify_thunk_statements pass. That ensures that we are consistent in determining whether an argument is constant. With this change we no longer need to add a field for a call to recover, as the simplify_thunk_statements pass runs after the build_recover_thunks pass, so the additional argument will already have been added to the call. The test case for this is https://go.dev/cl/440297. This fixes https://go.dev/issue/56109. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian