This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: EGCS 1.1.1 overzealous optimization on SPARC/Solaris for lmbench lat_mem_rd.c



  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]