We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently gc generates the following code: var s1 string 400c19: 48 c7 44 24 08 00 00 movq $0x0,0x8(%rsp) 400c22: 48 c7 44 24 10 00 00 movq $0x0,0x10(%rsp) s2 := "" 400c2b: 48 8d 1c 25 20 63 42 lea 0x426320,%rbx 400c33: 48 8b 2b mov (%rbx),%rbp 400c36: 48 89 6c 24 18 mov %rbp,0x18(%rsp) 400c3b: 48 8b 6b 08 mov 0x8(%rbx),%rbp 400c3f: 48 89 6c 24 20 mov %rbp,0x20(%rsp) s3 = "" 400c44: 48 8d 1c 25 20 63 42 lea 0x426320,%rbx 400c4c: 48 8b 2b mov (%rbx),%rbp 400c4f: 48 89 2c 25 f0 34 46 mov %rbp,0x4634f0 400c57: 48 8b 6b 08 mov 0x8(%rbx),%rbp 400c5b: 48 89 2c 25 f8 34 46 mov %rbp,0x4634f8 Ideally it is: var s1 string 400c19: 48 c7 44 24 08 00 00 movq $0x0,0x8(%rsp) 400c22: 48 c7 44 24 10 00 00 movq $0x0,0x10(%rsp) s2 := "" 400c19: 48 c7 44 24 08 00 00 movq $0x0,0x8(%rsp) 400c22: 48 c7 44 24 10 00 00 movq $0x0,0x10(%rsp) s3 = "" 400c19: 48 c7 44 24 08 00 00 movq $0x0,0x8(%rsp) 400c22: 48 c7 44 24 10 00 00 movq $0x0,0x10(%rsp) For := "", compiler can just remove the initializer. For = "", compiler can recognize "" and store zeros.
The text was updated successfully, but these errors were encountered:
Comment 1:
Status changed to Duplicate.
Merged into issue #1914.
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: