Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #87116
| Path | csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Bo Persson <bo@bo-persson.se> |
| Newsgroups | comp.lang.c++ |
| Subject | Re: I was wrong about gcc's inlining behavior |
| Date | Fri, 21 Oct 2022 16:41:44 +0200 |
| Lines | 23 |
| Message-ID | <jrfpdaFmfs7U1@mid.individual.net> (permalink) |
| References | <tiu0n7$kv0$1@gioia.aioe.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net NQxQn3uP6c7c/LTJv5lUbwNqL3mh8cbums0ywKy7mQaBgmFuUu |
| Cancel-Lock | sha1:Al8L9eAibU1LZKkq/RkYC9hxSgo= |
| User-Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 |
| Content-Language | sv |
| In-Reply-To | <tiu0n7$kv0$1@gioia.aioe.org> |
| Xref | csiph.com comp.lang.c++:87116 |
Show key headers only | View raw
On 2022-10-21 at 13:44, Juha Nieminen wrote: > (I don't know if this applies to other compilers like clang. Could be.) > > For the longest time I thought that if gcc sees a function implementation > at the place where the function is being called, then it doesn't matter > if the keyword 'inline' appears before that function implementation or > not. I thought that gcc just ignores that keyword when making inlining > decisions. (After all, why wouldn't it?) > > Just now, however, I got a concrete counter-example to this. > > > So it appears that I have been wrong: When it comes to functions visible > at the global scope, the 'inline' keyword can make a huge difference, > even when the implementations are seen by the compiler at the call > places. > It probably doesn't make a huge difference in general, but if your function is 'close' to getting inlined, an actual 'inline' keyword might add a few points to the heuristics, and tip it over the decision point.
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
I was wrong about gcc's inlining behavior Juha Nieminen <nospam@thanks.invalid> - 2022-10-21 11:44 +0000
Re: I was wrong about gcc's inlining behavior Michael S <already5chosen@yahoo.com> - 2022-10-21 07:01 -0700
Re: I was wrong about gcc's inlining behavior Juha Nieminen <nospam@thanks.invalid> - 2022-10-24 06:45 +0000
Re: I was wrong about gcc's inlining behavior Michael S <already5chosen@yahoo.com> - 2022-10-24 10:11 -0700
Re: I was wrong about gcc's inlining behavior scott@slp53.sl.home (Scott Lurndal) - 2022-10-24 17:54 +0000
Re: I was wrong about gcc's inlining behavior Bo Persson <bo@bo-persson.se> - 2022-10-21 16:41 +0200
Re: I was wrong about gcc's inlining behavior Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-10-21 08:47 -0700
Re: I was wrong about gcc's inlining behavior scott@slp53.sl.home (Scott Lurndal) - 2022-10-21 16:04 +0000
Re: I was wrong about gcc's inlining behavior Marcel Mueller <news.5.maazl@spamgourmet.org> - 2022-10-22 09:21 +0200
Re: I was wrong about gcc's inlining behavior scott@slp53.sl.home (Scott Lurndal) - 2022-10-22 15:05 +0000
Re: I was wrong about gcc's inlining behavior Juha Nieminen <nospam@thanks.invalid> - 2022-10-24 07:00 +0000
csiph-web