Optimization

Jeffrey A Law law@cygnus.com
Thu Apr 2 08:21:00 GMT 1998


--
Jeff Law (law@cygnus.com)
Cygnus Solutions		EGCS GNU Compiler System
http://www.cygnus.com		http://www.cygnus.com/egcs

  In message <Pine.SGI.3.96.980326123604.8153E-100000@purcell>you write:
  > 
  > Hi! I'm working with computational mathematics using c and c++.
  > 
  > Does g++/gcc have any optimization that brings out constant subexpressions
  > outside loops? Consider the following:
Yes, gcc performs loop invariant code motion.

I don't know why the loop invariants are not being hoisted out of
the loop for your example.  I haven't had the time to look at it.

jeff



More information about the Gcc mailing list