compiler: fix loopdepth tracking in array slicing expression in escape analysis

In the gc compiler, for slicing an array, its AST has an implicit
address operation node. There isn't such node in the gofrontend
AST. During the escape analysis, we create a fake node to mimic
the gc compiler's behavior. For the fake node, the loopdepth was
not tracked correctly, causing miscompilation. Since this is an
address operation, do the same thing as we do for the address

Fixes golang/go#36404.

Change-Id: I219ef0785f548dc0685e6e1f26c221eff6051334
Reviewed-by: Than McIntosh <>
Reviewed-by: Ian Lance Taylor <>
1 file changed