To: eliz AT is DOT elta DOT co DOT il Cc: gcc AT gcc DOT gnu DOT org, djgpp-workers AT delorie DOT com References: <2 DOT 7 DOT 9 DOT 181SX DOT H8JVM1 AT pauzner DOT dnttm DOT ru> <2561-Sat11Jan2003175230+0200-eliz AT is DOT elta DOT co DOT il> Message-Id: <2.7.9.SBA.H8K8TU@pauzner.dnttm.ru> From: "Leonid Pauzner" Date: Sat, 11 Jan 2003 20:34:42 +0300 (MSK) X-Mailer: dMail [Demos Mail for DOS v2.7.9] Subject: Re: gcc 3.2.1 optimizer degradation (strlen, -O2) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=====_dMail_2.7.9.SB8.H8K8TU_pauzner.dnttm.ru===_" Reply-To: djgpp-workers AT delorie DOT com This is a message in MIME format. Your mail reader does not support MIME :( --=====_dMail_2.7.9.SB8.H8K8TU_pauzner.dnttm.ru===_ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 11-Jan-2003 17:52 Eli Zaretskii wrote: >> From: "Leonid Pauzner" >> Date: Sat, 11 Jan 2003 15:49:13 +0300 (MSK) >> >> It turns out that the libc strlen() function (compiled with -O2) >> became nearly 2 times slower when I switched from gcc 2.95.3 to gcc 3.2.1 >> on a Pentium machine. > Are you sure you get the library strlen? IIRC, GCC provides its own > inline versions of some functions, and I think strlen is one of them. > Examining the code (use the -S switch to GCC to produce it) should > show you whether my guess was true. Sure, there is a "call _strlen" line in the assembler code, and I made the test program by calling "gcc -o strlen.exe main.o strlen.o" This is a DJGPP environment. The key point in my original posting was the certain simple loop which happens to be optimized better with the old version of the compiler. Generated assembler attached. > You could use the -fno-builtin switch to force GCC to call the > (non-inline) library version of strlen. --=====_dMail_2.7.9.SB8.H8K8TU_pauzner.dnttm.ru===_ Content-Type: application/octet-stream; name=strlen.zip Content-Transfer-Encoding: x-uuencode Content-Disposition: attachment; filename=strlen.zip Content-Description: C sourses and generated assembler begin 777 strlen.zip M4$L#!!0````(`$:B*RX^'2Y1\0```!4"```)``D`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