[coop] Protect copy_stack_data from GCC optimizations. (#3157)