arm-none-eabi-gcc version 8 and later produce a GMP arithmetic error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
New
|
Undecided
|
Unassigned |
Bug Description
When building GMP with arm-none-eabi-gcc version 7, everything is fine.
But when using version 8, 9 or 10 the code below produces a wrong output:
mpz_t t; mpz_init(t);
mpz_t tt; mpz_init(tt);
mpz_t ttt; mpz_init(ttt);
mpz_set_str(tt,
"25975415027868
10);
mpz_set_str(t,
"68647976601306
10);
mpz_mod(ttt, tt, t);
printf("tt = "); gmp_printf("%Zd", tt); printf("\n");
printf("t = "); gmp_printf("%Zd", t); printf("\n");
printf("ttt = "); gmp_printf("%Zd", ttt); printf("\n");
mpz_clear(t);
mpz_clear(tt);
mpz_clear(ttt);
The result is:
tt =
259754150278688
t =
686479766013060
ttt =
357894298386999
but ttt should be
524718314387928
I crosscompile for a STM32F4 board.
The GMP function "mpz_probab_
I used the binary package for linux given here: https:/
I have a test program to reproduce the bug, but I cannot attach anything here.
Best Regards,
Titouan Coladon