Re: Miscompilation (gcc + inline asmb)

2021-09-10 Thread Ian Molton
On 15/08/2021 18:34, BERTRAND Joël wrote:
>   I remember I have used uECC a long time ago without this kind of bug. I
> have rebuilt the same code (with uECC_avr defined), but I have compiled
> this library not with gcc 11.1.0, but with 5.4.0.

Just curious - what is the difference in the assembler output in each case?

-Ian



Re: Miscompilation (gcc + inline asmb)

2021-08-15 Thread BERTRAND Joël
Some news.

I remember I have used uECC a long time ago without this kind of bug. I
have rebuilt the same code (with uECC_avr defined), but I have compiled
this library not with gcc 11.1.0, but with 5.4.0.

And I obtain :

simavr -t -m atmega1284 -f 1600 test2.elf
Loaded 18710 .text at address 0x0
Loaded 416 .data
Init...
Init alea...
Init random_ecc...
93A980352F127448C19FB0213622B13D5FEFC07CA4E6EA3A22234E7F0D9634FF8F2854B25A6E70F9E2063AB47040A341B54D39FD4845FB6D86CA33C8CFB5E308...
93A980352F127448C19FB0213622B13D5FEFC07CA4E6EA3A22234E7F0D9634FF8F2854B25A6E70F9E2063AB47040A341B54D39FD4845FB6D86CA33C8CFB5E308...
Done...

Now the question ;-) Did I find a bug or does gcc 11 need a special
build option to compile uECC ?

Best regards,

JB



Re: Miscompilation (gcc + inline asmb)

2021-08-15 Thread BERTRAND Joël
Some news.

I remember I have used uECC a long time ago without this kind of bug. I
have rebuilt the same code (with uECC_avr defined), but I have compiled
this library not with gcc 11.1.0, but with 5.4.0.

And I obtain :

simavr -t -m atmega1284 -f 1600 test2.elf
Loaded 18710 .text at address 0x0
Loaded 416 .data
Init...
Init alea...
Init random_ecc...
93A980352F127448C19FB0213622B13D5FEFC07CA4E6EA3A22234E7F0D9634FF8F2854B25A6E70F9E2063AB47040A341B54D39FD4845FB6D86CA33C8CFB5E308...
93A980352F127448C19FB0213622B13D5FEFC07CA4E6EA3A22234E7F0D9634FF8F2854B25A6E70F9E2063AB47040A341B54D39FD4845FB6D86CA33C8CFB5E308...
Done...

Now the question ;-) Did I find a bug or does gcc 11 need a special
build option to compile uECC ?

Best regards,

JB



Re: Miscompilation (gcc + inline asmb)

2021-08-13 Thread BERTRAND Joël
Some news.

I have uploaded a simple example at
https://hilbert.systella.fr/public/test_uecc.tar.gz

This tarball contains minimal code to trigger this issue, makefile and
two asmb output :
- ok.asm
- ko.asm

ok.asm runs as expected and was built with
#define uECC_PLATFORM   uECC_arch_other
in uECC.h.

ko.asm doesn't run as expected and was built with
#define uECC_PLATFORM   uECC_avr

Help will be welcome...

Best regards,

JB