https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63573
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> --- More precise back-trace: ../../../../libgo/go/path/filepath/path.go:158:1: internal compiler error: in expand_expr_addr_expr_1, at expr.c:7665 func ToSlash(path string) string { ^ 0x10501373 expand_expr_addr_expr_1 ../../gcc/expr.c:7665 0x10501d93 expand_expr_addr_expr ../../gcc/expr.c:7779 0x10510797 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../gcc/expr.c:10604 0x105023af expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../gcc/expr.c:7947 0x1032b413 expand_normal ../../gcc/expr.h:457 0x1032d4bf precompute_register_parameters ../../gcc/calls.c:832 0x10335813 expand_call(tree_node*, rtx_def*, int) ../../gcc/calls.c:3009 0x1050f433 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../gcc/expr.c:10372 0x105023af expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../gcc/expr.c:7947 0x104f5e1f store_expr(tree_node*, rtx_def*, int, bool) ../../gcc/expr.c:5337 0x104f47e3 expand_assignment(tree_node*, tree_node*, bool) ../../gcc/expr.c:5123 0x103505a3 expand_call_stmt ../../gcc/cfgexpand.c:2321 0x103545c7 expand_gimple_stmt_1 ../../gcc/cfgexpand.c:3218 0x10354df3 expand_gimple_stmt ../../gcc/cfgexpand.c:3370 0x10354f73 expand_gimple_tailcall ../../gcc/cfgexpand.c:3417 0x1035d3d7 expand_gimple_basic_block ../../gcc/cfgexpand.c:5182 0x1035f983 execute ../../gcc/cfgexpand.c:5811 Where debug_rtx(result): (reg/v:DI 157 [ path ]) if I go up in BT: #11 0x00000000103505a4 in expand_call_stmt (stmt=0x3fffafcc5bb0) at ../../gcc/cfgexpand.c:2321 2321 expand_assignment (lhs, exp, false); (gdb) call debug_gimple_stmt(stmt) # .MEM_2 = VDEF <.MEM_1(D)> <retval> = path_filepath.FromSlash.localalias.1 (path); [return slot optimization] [tail call] I think it would be duplicate of PR63587, where we expand thunk and RESULT_DECL is given as argument for add_local_decl. Thanks, Martin