optimization/9319: slower code generated for simple loop on linux
Amnon Cohen
amnon_cohen@yahoo.com
Thu Jan 16 14:34:00 GMT 2003
Hi ebotcazou,
Thanks for getting back to me so fast.
I have done a few more tests, and it seems
that this is a regression
on all platforms (not just intel) introduced by
gcc3.1
Note that the while loop in the example is equivalent
to
for (i=0; i<n; i++) s+=i;
The for loop generates faster code.
Another problem, if we compile with
-funroll-all-loops,
the loop does not get unrolled on gcc3.2.1, whereas
it does on gcc3.0
Here is the information you asked for.
For the newer compiler which shows the regression
>gcc321 -v
Reading specs from
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/specs
Configured with: ./configure
Thread model: posix
gcc version 3.2.1
Wheras the old version
>gcc3 -v
Reading specs from
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.3/specs
Configured with: ./configure
Thread model: single
gcc version 3.0.3
I have attached the assembler files
(produced by gcc -S loop3.c)
The performance is significantly reduced on intel
linux and on Solaris (I have not sent solaris asm
files, let me know if you need them). So I do
not think that this is architecture related
Please let me know if you need any more info!
- Amnon
--- ebotcazou@gcc.gnu.org wrote:
> Synopsis: slower code generated for simple loop on
> linux
>
> Responsible-Changed-From-To: unassigned->ebotcazou
> Responsible-Changed-By: ebotcazou
> Responsible-Changed-When: Thu Jan 16 03:58:11 2003
> Responsible-Changed-Why:
> Investigating.
> State-Changed-From-To: open->feedback
> State-Changed-By: ebotcazou
> State-Changed-When: Thu Jan 16 03:58:11 2003
> State-Changed-Why:
> Could you provide us with more details ? What
> does gcc -v output for each compiler ? Could you
> post the assembly code generated for the loop by
> each compiler (gcc -O3 -S) ? On what hardware did
> you experience the performance hit ?
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9319
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loop3.linux.gcc3.s
Type: application/octet-stream
Size: 337 bytes
Desc: loop3.linux.gcc3.s
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030116/e1336516/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loop3.linux.gcc321.s
Type: application/octet-stream
Size: 330 bytes
Desc: loop3.linux.gcc321.s
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030116/e1336516/attachment-0001.obj>
More information about the Gcc-bugs
mailing list