public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Inlining in g++
@ 1999-12-11  7:18 Joris van der Hoeven
  1999-12-31 22:24 ` Joris van der Hoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Joris van der Hoeven @ 1999-12-11  7:18 UTC (permalink / raw)
  To: help-gcc

Dear collegue,

Is there some way for me to decide that precisely those
functions which I declared inline are inlined and no others?
When compiling a C++ program using optimization, I have    
the following problems:    
  - The generated code is not equivalent; my program produces
    a segmentation fault, while the unoptimized code does not.
  - Not all functions which have been declared inline are 
    actually inlined.
  - Some functions which I did not declare inline are inlined.
Because of the fact that optimized code is much longer and
crashes, I would like to have full control over the inlining
process. Ideally speaking, I would appreciate non optimized
compilation with all functions declared 'extern inline'
being inlined.

If there is no way to satisfy my request, maybe you can
suggest another solution for the following problem.
I have several very elementary data structures like
'array', 'list', 'hashtable', etc... All these classes
export a function 'N', which determines the number of
elements in the array, list, etc... I declared this
function inline for most structures, since it really
corresponds to a macro definition pointing to some member.
However, for the reasons explained above, the inlining
mechanism does not correctly handle this situation.
Might there be another way out, like defining a macro
which first tests the type of the argument and
then expands as a function of the type (very dirty,
but this would be satisfactory).

Yours,

Joris van der Hoeven

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Inlining in g++
  1999-12-11  7:18 Inlining in g++ Joris van der Hoeven
@ 1999-12-31 22:24 ` Joris van der Hoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Joris van der Hoeven @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

Dear collegue,

Is there some way for me to decide that precisely those
functions which I declared inline are inlined and no others?
When compiling a C++ program using optimization, I have    
the following problems:    
  - The generated code is not equivalent; my program produces
    a segmentation fault, while the unoptimized code does not.
  - Not all functions which have been declared inline are 
    actually inlined.
  - Some functions which I did not declare inline are inlined.
Because of the fact that optimized code is much longer and
crashes, I would like to have full control over the inlining
process. Ideally speaking, I would appreciate non optimized
compilation with all functions declared 'extern inline'
being inlined.

If there is no way to satisfy my request, maybe you can
suggest another solution for the following problem.
I have several very elementary data structures like
'array', 'list', 'hashtable', etc... All these classes
export a function 'N', which determines the number of
elements in the array, list, etc... I declared this
function inline for most structures, since it really
corresponds to a macro definition pointing to some member.
However, for the reasons explained above, the inlining
mechanism does not correctly handle this situation.
Might there be another way out, like defining a macro
which first tests the type of the argument and
then expands as a function of the type (very dirty,
but this would be satisfactory).

Yours,

Joris van der Hoeven

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-12-31 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-11  7:18 Inlining in g++ Joris van der Hoeven
1999-12-31 22:24 ` Joris van der Hoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).