[Bug ipa/82476] C++: Inlining fails for a simple function

2017-10-09 Thread arun11299 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82476 --- Comment #6 from Arun Muralidharan --- I understand your point on why it chose not to be inlined. I was doing a micro benchmark for a sample application (a interview question basically) and thats when this issue came up. Thanks.

[Bug ipa/82476] C++: Inlining fails for a simple function

2017-10-09 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82476 --- Comment #5 from Jonathan Wakely --- (In reply to Andrew Pinski from comment #4) > Note GCC knows main can only be called once (calling main more than once in > C/C++ is undefined IIRC) It's undefined in C++, I don't think it is in C.

[Bug ipa/82476] C++: Inlining fails for a simple function

2017-10-08 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82476 --- Comment #4 from Andrew Pinski --- Note GCC knows main can only be called once (calling main more than once in C/C++ is undefined IIRC) which is why this heuristic is there. If you change the name from main to say ff, then the function gets

[Bug ipa/82476] C++: Inlining fails for a simple function

2017-10-08 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82476 Andrew Pinski changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|---

[Bug ipa/82476] C++: Inlining fails for a simple function

2017-10-08 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82476 --- Comment #2 from Marc Glisse --- What is the point of inlining it? It isn't a hot call (called once from main). And unless you are using something like -flto of -fwhole-program (which would turn the function static), it has to be emitted as a

[Bug ipa/82476] C++: Inlining fails for a simple function

2017-10-08 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82476 Eric Botcazou changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed|