2011/12/16 Yann Vernier <[email protected]>:
> On Friday 09 December 2011 15:14:26 Yann Vernier wrote:
>> Confirmed bug #1 and that the patch given works. It's not a very clean
>> solution; the file should be rewritten with proper care for data types.
>> Explanatory comments are missing and or32_extract is duplicated (with
>> different functionality!).
>>
>> Attaching a slight variant which should also make sign extension for signed
>> fields work properly in case long is used.
>>
>> I don't have permissions to edit bugs in the bugzilla, so I couldn't post
>> the patch there. Jeremy, care to check this out and in?
>
> I think I've found each of the places this bug particular occurs in (severe
> code duplication - shouldn't this be used from binutils libopcodes somehow?).
> Attached is a patch that changes a bunch of literals to values with semantics
> more like intented. The clean solution would probably involve rebuilding the
> cgen model, making sure cgen doesn't generate this bug, and rebuilding all
> these different places from the same source. Proper handling would probably
> mean using uint32_t rather than unsigned long (which in this case was 64bit).
>
> The bug had previously been addressed by masking the output values in a few
> places, which is why we saw it in gdb but not binutils. Those changes are
> commented 090430 - jb, and should be removed when this works correctly.
>
> Please try it and let me know how it goes (about to test myself, waiting for
> compilation - but second eyes and all that).
>
> _______________________________________________
> OpenRISC mailing list
> [email protected]
> http://lists.openrisc.net/listinfo/openrisc
>

My C skills aren't good enough to confirm right away that this works
as intended, but the first iteration of your patch solved bug #1 for
me at least, so I'm fine with this.

Should we add a testcase for this somewhere? It appears strange to me
that there doesn't already exist one that tries to disassemble and
reassemble a piece of code. Anyone with more knowledge of the test
suite who can provide more input on this?

-- 
Olof Kindgren
______________________________________________
ORSoC
Website: www.orsoc.se
Email: [email protected]
______________________________________________
FPGA, ASIC, DSP - embedded SoC design
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to