Closed 5c4lar closed 2 years ago
It seems like the best we could ask for in the assembly output would be to recognize this pattern and generate:
...
mov DWORD PTR [RAX*8+.L_404050],1
movsxd RAX,DWORD PTR [RBP-4]
mov BYTE PTR [RAX*8+.L_404050+4],2
mov EAX,DWORD PTR [RBP-4]
add EAX,1
...
.L_404050:
.zero 80
The existing data access pattern propagation code already does some recognition of this kind of "synchronized" data accesses to know that it is safe to continue propagating the data access, instead of considering them a collision:
https://github.com/GrammaTech/ddisasm/blob/master/src/datalog/data_access_analysis.dl#L331
To alter the output, I think you'd need to break that recognition out into an intermediate relation, and use that to generate a moved_data_label to make the symbolic operand refer to .L_404050 instead of .L_404054.
Maybe this is a contribution you would be able to make? Note that we have a CLA that we ask every contributor sign and email to CLA@GrammaTech.com (see our CONTRIBUTING.md).
Maybe this is a contribution you would be able to make?
Thanks for telling me how to do this! Tried to achieve it according to your suggestions, but changed moved_label
instead of moved_data_label
since those addresses appear in the operand.
Note that we have a CLA that we ask every contributor sign and email to CLA@GrammaTech.com (see our CONTRIBUTING.md).
I sent the CLA but the email is rejected:
550 5.4.1 Recipient address rejected: Access denied. AS(201806281) [[CY1USG02FT011.eop-usg02.itar.protection.office365.us](http://cy1usg02ft011.eop-usg02.itar.protection.office365.us/)]
I sent the CLA but the email is rejected:
550 5.4.1 Recipient address rejected: Access denied. AS(201806281) [[CY1USG02FT011.eop-usg02.itar.protection.office365.us](http://cy1usg02ft011.eop-usg02.itar.protection.office365.us/)]
Can you try to send directly to eschulte@grammatech.com? Thanks.
I sent the CLA but the email is rejected:
550 5.4.1 Recipient address rejected: Access denied. AS(201806281) [[CY1USG02FT011.eop-usg02.itar.protection.office365.us](http://cy1usg02ft011.eop-usg02.itar.protection.office365.us/)]
Can you try to send directly to eschulte@grammatech.com? Thanks.
Sure. It has been sent successfully.
For the above C code, ddisasm will split the global struct array into two datablocks, one is of size 4 and the other is of size 76. I can understand why it results in such behavior, but can this be improved?