public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joris van der Hoeven <TeXmacs@math.u-psud.fr>
To: help-gcc@gnu.org
Subject: Inlining in g++
Date: Fri, 31 Dec 1999 22:24:00 -0000	[thread overview]
Message-ID: <199912111517.QAA09113@anh.math.u-psud.fr> (raw)
Message-ID: <19991231222400.t8NP2r9maSLLHnZmH2NB9VsrgpSr0pUd5kEfy_jeQKY@z> (raw)

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

             reply	other threads:[~1999-12-31 22:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-11  7:18 Joris van der Hoeven [this message]
1999-12-31 22:24 ` Joris van der Hoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199912111517.QAA09113@anh.math.u-psud.fr \
    --to=texmacs@math.u-psud.fr \
    --cc=help-gcc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).