Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ptomin
Copy link
Collaborator

@ptomin ptomin commented Mar 12, 2022

No description provided.

@ptomin ptomin self-assigned this Mar 12, 2022
@ptomin ptomin added the bug This issue describes a defect in Reko label Mar 12, 2022
@ptomin ptomin force-pushed the create-declaration-for-local-definions branch from bcd0fb7 to 1491e2d Compare March 13, 2022 07:01
@ptomin ptomin force-pushed the create-declaration-for-local-definions branch from 1491e2d to 9ac7d6b Compare March 13, 2022 07:09
@ptomin ptomin requested a review from uxmal March 13, 2022 07:30
Copy link
Owner

@uxmal uxmal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a lot of fp leaks. What is your opinion here. Ideally, once all escaped frame accesses have been taken care of, there should be no more fp references in generated code.

// Return size: 0
void fn00100000()
fn00100000_entry:
ptr32 fp
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the pseudoregister FramePointer be excluded?

Copy link
Collaborator Author

@ptomin ptomin Mar 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, it's OK. fp variable is used in followed code. So it should be declared.

// 00008334: void _start(Stack int32 dwArg00, Stack (ptr32 Eq_n) ptrArg08, Stack (ptr32 Eq_n) ptrArg0C, Stack (ptr32 void) ptrArg10)
void _start(int32 dwArg00, void (* ptrArg08)(), void (* ptrArg0C)(), void * ptrArg10)
{
ptr32 fp;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fp is there because of the fp + 4 on the next line, right? Hopefully that will go away when fp + 4 is replaced with &tArg04

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it should go away when fp + 4 is replaced with &tArg04

@ptomin
Copy link
Collaborator Author

ptomin commented Mar 13, 2022

Ideally, it should be no fp at all. But if they exist then we should add corresponding declarations.
I hope, future modifications of Escape Analysis can remove most of them.

@uxmal uxmal merged commit c93d2c5 into uxmal:master Mar 13, 2022
@uxmal
Copy link
Owner

uxmal commented Mar 13, 2022

We'll go with this. The changes in analysis/in-datatypes will also help reduce the number of "loose" fp references.

@ptomin ptomin deleted the create-declaration-for-local-definions branch March 14, 2022 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This issue describes a defect in Reko

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants