This is the mail archive of the gcc@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: Patch to -Os



  In message <19980131210207.45108@cerebro.laendle>you write:
  > anyway, here's a small patch that might make more sense than to disable
  > -finline-functions altogether with -Os.
  > 
  > The idea is that a function call is at least 1 instruction (call) plus 1.5
  > instructions per argument (well, constants are one or two insns, simple
  > variables are one or two insns..), so doing the inline with small functions
  > might be even better than calling them, since the actual call needs more
  > instructions (there _are_ such functions!)
  > 
  > The patch re-enables -finline-functions with -Os and sets
  > INTEGRATE_THRESHOLD to a small value when -Os is specified.
  > 
  > Another (maybe much better!) approach would be to do this for
  > all architectures, i.e. leaving flagh_inline_functions alone
  > and just making the default for INTEGRATE_THRESHOLD smaller
  > (although architectures that aslready define INTEGRATE_THRESHOLD
  > need a change, then).
  > 
  > any comments?
Well, I'd personally prefer to see flag_inline_funtions set for
-On for n > 2 (or maybe 3 since it can have much more of a size
impact than loop unrolling) in the machine independent code rather
than doing it in each backend.

Similarly for INTEGRATE_THRESHOLD, the change belongs in the target
independent code.

Can you rework your patch in that manner?
jeff


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