Article View: gnu.gcc.bug
Article #666Not a bug report - optimization
From: pardo
Date: Fri, 29 Sep 1989 16:28
Date: Fri, 29 Sep 1989 16:28
57 lines
1639 bytes
1639 bytes
This is not a bug report. This is a comment about one more place to
do optmizations.
Gcc 1.36 for a Vax using config.gcc.
The optimizer does not recognize some non-overlapping variable
lifetimes.
int z;
bork()
{
{
int i;
i = z + 4;
zork (&i);
}
{
int j;
j = z + 5;
zork (&j);
}
}
gcc -O -S -v foo.c
gcc version 1.36
/uns/usr/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dvax -Dunix -D__vax__ -D__unix__ -D__OPTIMIZE__ foo.c /usr/tmp/cca05236.cpp
GNU CPP version 1.36
/uns/usr/local/lib/gcc-cc1 /usr/tmp/cca05236.cpp -quiet -dumpbase foo.c -O -version -o foo.s
GNU C version 1.36 (vax) compiled by GNU C version 1.36.
default target switches: -munix
#NO_APP
gcc_compiled.:
.text
.align 1
.globl _bork
_bork:
.word 0x40
subl2 $8,sp # only needed subl2 $4.
addl3 _z,$4,-4(fp)
subl3 $4,fp,-(sp)
movab _zork,r6
calls $1,(r6)
addl3 _z,$5,-8(fp)
subl3 $8,fp,-(sp)
calls $1,(r6)
ret
.comm _z,4
The place where this optimization is important is when `i' and `j' are
replaced by arrays; the difference in stack size (and thus caching
performance) is observable.
;-D on ( Yes, GNU improves cache performance, too! ) Pardo
Technical Details
Message-ID:
<8909291628.AA05584@june.cs.washington.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!JUNE.CS.WASHINGTON.EDU!pardoShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!JUNE.CS.WASHINGTON.EDU!pardo From: pardo@JUNE.CS.WASHINGTON.EDU Newsgroups: gnu.gcc.bug Subject: Not a bug report - optimization Message-ID: <8909291628.AA05584@june.cs.washington.edu> Date: 29 Sep 89 16:28:30 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 57