delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/31/01:42:04

Date: Fri, 30 Jan 1998 22:40:30 -0800 (PST)
Message-Id: <199801310640.WAA09918@adit.ap.net>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Inlining

At 01:48  1/30/1998 -0800, Andrew Crabtree wrote:
>
>Reinier Heeres wrote in message <34D23EAA DOT 3609B2B AT worldonline DOT nl>...
>>I have the idea that DJGPP isnt't inlining my hline routine in my
>>program, but I have defined it like this:
>
>You could always look and see what it is doing.  Just add '-S' to your
>compile line
>and gcc will stop after it has generated assembly code.  You can look at
>this to see if it was
>really inlined or not.
You can also use the option `-Winline' to have the compiler warn you if some
function you declare `inline' cannot be.
>
>>and I compile and link with the -finline-fnuctions flag...
>
>Do you also compile with a -O flags?  I don't think gcc will inline unless
>you specify optimization
>also.
This is also what the docs say. Some amplification:
* The flag you are interested in is `-finline'. `-finline-functions' makes
the compiler attempt to inline ALL functions.
* `-finline' is turned on by all `-O' options by default, so you shouldn't
need to use it at all.
>
>>Does anybody have an idea how this might happen (the functions that call
>>hline() are in the same module)
>Does the inline definition come before places that call it?  That is another
>possibility, although I don't think stock 2.7.2 has this restriction (you
>don't mention what version you use but I'll mention it anyway).
Version 2.7.2.1 still said in the documentations that this restriction
applied. Perhaps it is inaccurate though, I don't know. It would be wise to
define the function before you use it.

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019