[avr-gcc-list] Use on AVR

Georg-Johann Lay avr at gjlay.de
Sat Jun 9 20:28:51 CEST 2012

Gabriel Dos Reis a écrit:
> forwarding to the avr-gcc list...
> On Sat, Jun 9, 2012 at 10:15 AM, Torbjorn Granlund <tg at gmplib.org> wrote:
>> bodrato at mail.dm.unipi.it writes:
>>  IIRC, with avr-gcc, the unsigned long type exists and it is 32 bits long.

Yes. Instead of long, sou can also use C99 and

#include <stdint.h>

uint32_t var;

>>  Using them for all operations probably is not the faster way to handle
>>  long integers, because it forces the compiler to use many registers
>>  and a lot of code, but it should work.
>> I tried avr-gcc both from FreeBSD's ports and from Debian's apt:
>> Attempt 1:
>>  tom$ avr-gcc -I. -O -S mini-gmp.c
>>  mini-gmp.c: In function 'mpz_out_str':
>>  mini-gmp.c:3996:9: warning: incompatible implicit declaration of
>>  built-in function 'fwrite' [enabled by default]
>>  mini-gmp.c: In function 'mpn_div_qr_preinv':
>>  mini-gmp.c:1012:1: error: unable to find a register to spill in class
>>  mini-gmp.c:1012:1: error: this is the insn:
>>  (insn 238 236 239 10 (set (reg/v:SI 219 [ n0 ])
>>          (mem:SI (pre_dec:HI (reg:HI 2 r2 [orig:239 ivtmp.626 ] [239]))
>>          [0 MEM[base: D.7131_301, offset: 0B]+0 S4 A8])) mini-gmp.c:885
>>          26 {*movsi}
>>       (expr_list:REG_INC (reg:HI 2 r2 [orig:239 ivtmp.626 ] [239])
>>          (nil)))
>>  mini-gmp.c:1012: confused by earlier errors, bailing out

For instructions on how to report bugs for GCC,
see http://gcc.gnu.org/bugs//#need

You probably hit http://gcc.gnu.org/PR50925

This bug appears to be hard to fix, help welcome.

>> Attempt 2:
>>  tom$ avr-gcc -mint8 -I. -O -S mini-gmp.c
>>  <built-in>:0:0: internal compiler error: Segmentation fault
>>  Please submit a full bug report,
>>  with preprocessed source if appropriate.
>>  See <http://gcc.gnu.org/bugs.html> for instructions.

See http://gcc.gnu.org/PR46261

It is fixed in 4.5.4, 4.6.4, 4.7.1 and higher.

More information about the gmp-discuss mailing list