Why does gcc require gmp? -
as has ever built gcc source knows, gmp dependency gcc. why this? in other words, gcc use for?
see this answer similar (but not same) question.
gmp needed inside compiler (at compilation time) notably constant folding. language standards (notably recent versions of fortran) requires e.g. 1234567891234567*1234567891
computed in arbitrary precision.
even c happier bigints constant folding: way correct result expression (perhaps obtained after macro expansion, if don't put explicitly in source code) (123456789087651234*65125412651209128612+187451)%10000000141
or (140000000000041*150000000000061+134500000000139)%250000000000111
.
i forgot c or c++ standard says such constant expressions. computing them correctly not wrong. fortran requires them computed correctly, , need bigints. second example contains primes fitting in 64 bits, need bignums compute result correctly...
also, gcc when cross-compiling needs more precision the host integer. consider cross-compiling 32 64 bits machine, want constant folding compute 64 bits!
in addition, clever optimizations (notably polyhedral optimizations cloog or ppl used gcc) may require, during 1 optimization pass , internally, bigint arithmetic precise. more generally, optimizations symbolic processing, , symbolic processing needs bignums. during such optimizations, quite big numbers appear if source code has quite small constants.
Comments
Post a Comment