Array contents are unnecessarily initialized
See the program and the generated assembly below. It looks like the array is first initialized with pointers to itself, and then these values are overwritten by the actual values. Since it concerns create_array_
(not create_array
) of a {#Int}
I would expect that no initialization is needed, certainly not with this value?
Start = {#1,2,3}
leaq __ARRAY__+2(%rip),%rbp
movq %rbp,(%rdi)
movq $3,8(%rdi)
leaq INT+2(%rip),%rbp
movq %rbp,16(%rdi)
movq %rdi,%rcx
movq %rcx,24(%rdi) # not needed?
movq %rcx,32(%rdi) # not needed?
movq %rcx,40(%rdi) # not needed?
movq $3,40(%rcx)
movq $2,32(%rcx)
movq $1,24(%rcx)
addq $48,%rdi