This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: EGCS 1.1.1 overzealous optimization on SPARC/Solaris for lmbench lat_mem_rd.c
- To: David G Hough at validgh <validgh at validgh dot com>
- Subject: Re: EGCS 1.1.1 overzealous optimization on SPARC/Solaris for lmbench lat_mem_rd.c
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Mon, 15 Feb 1999 03:09:24 -0700
- cc: egcs-bugs at cygnus dot com, lm at bitmover dot com
- Reply-To: law at cygnus dot com
In message <199902120103.RAA15325@validgh-f.validgh.com>you write:
>
> Reading specs from /net/validator/export/set/validator7/gcc/egcs111/lib/gcc
> -lib/sparc-sun-solaris2.5.1/egcs-2.91.60/specs
> gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
>
>
> lat_mem_rd.c is a program to determine memory latency.
> For every gcc version I can readily obtain, back to at least 2.6.3,
> the critical timing loop is completely optimized away at -O3. Is that
> legitimate? The critical source code is
Yes it is legitimate. -O3 turns on function inlining.
The compiler then inlines the call to "stop" within the "loads" function.
As a result of inlining the compiler is able to determine that the value
in "p" is never used. Since the value is never used the insns to compute
it are dead.
jeff