-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
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
Input / output parameters should be 'extended' for it transfered through registers #6354
Comments
My apologies. I should have read more closely. @esaulenka my mistake in removing the extension="inttype". I had mistakenly removed it thinking it was metatype="inttype". I'll add that into a tricore patch I'm about to commit. |
@ryanmkurtz, why you marked it as closed? I can provide samples for it, but decompiled code will be exactly the same. |
Oh, it was auto-closed due to our merge process and an misunderstanding of how our internal work linked to this issue. |
The PPC has extension="inttype" on the return value, but not on the parameters. Based on pulling up a pcode unit test PPC binary, it appears it needs it on the parameters as well.
The need for the extension tag would depend on the compiler and how it treats passing/returning smaller data types than the full register size. The mips needs extension="sign". The ABI specifies explicitly what is assumed for smaller data types in params and returns. We've been considering adding an automated test for this in the pcodeunit test binaries. This does depend on having a compiler that can cross-compile a test binary. We can do a zero based review with the test binaries we have with known small datatype parameters and return values. |
Describe the bug
It is a some continiuation of conversation #5757
Some architectures (like ARM, Power, V850, Tricore, ...) transfers function inputs and return value through registers.
If these values are smaller than register size, decompiler makes some additional noise.
To Reproduce
For clarify, lets talk about Tricore.
Callee:
decompiled as
Caller:
decompiled as
Similar behavior can be found in the input parameters:
Expected behavior
I don't understand why @emteere said (#5757 (comment)) that such extension is not needed.
If declare all input/output pentries in
cspec
file with attributeextension="inttype"
all these extraout / in_registerXX is gone.Yes, I know workaroud 'always use native-wide variables'. But I think will be better to use byte, if you sure that this variable always contains values less than 255.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: