Bruno Haible <[EMAIL PROTECTED]> wrote: > Jim Meyering asked: >> > The compilation of these files with -g -O2 and newer gcc releases takes >> > an awful lot of time (5 minutes or so). Is there some way to make gcc work >> > faster, without decreasing the runtime speed too much? >> >> Wow. What version of gcc, and what type of CPU? > > CPU: AMD-K7 500 MHz > > gcc time make time make > version sha256.o sha512.o > > 3.2.2 6.1 sec 68 sec > 4.0.4 5.5 sec 27 sec > 4.1.2 5.1 sec 14.4 sec > 4.2.2 5.2 sec 12.5 sec > 4.3-20080215 10.8 sec 20.1 sec > > So indeed the problem is indeed not as severe as I remembered, but 20 seconds > of compilation time for a not particularly large file with the newest gcc is > still not nice. > > Is there a good workaround?
If by workaround you mean a change to sha256.c or sha512.c, then I haven't even looked. It's not worth trying to find such a workaround, when much faster CPUs are available at so little cost. With a $110/110-euro CPU (AMD X2 5200), I get a time of .25s for sha512.o. However if you present your measurements to the gcc developers, they may even address the root cause. Then again, (I don't know) they may say that -O2 now does more, and as such the increase is justified.