GCC Compilation Error With -O0

24 views
Skip to first unread message

Daryl Haresign

unread,
Jun 2, 2023, 10:27:18 AM6/2/23
to v8-...@googlegroups.com
Is GCC officially supported?

I ran into a compilation error when trying to build Node with -O0:

HeapAllocator::AllocateRaw (both the templated and non-templated versions) are marked as always_inline.
The non-templated version has a switch statement that calls the relevant templated version.
If v8 is compiled with the single_generation flag set to true, then the templated version calls the non-templated version with kOld if called with kYoung. GCC doesn’t like this, it reports that the function couldn’t be inlined.

When you build without the single_generation flag at -O1 or above, GCC seems to elide the recursive call entirely (the flag is read-only constexpr) so it doesn’t hit this issue.

When you build at -O0, that’s not the case, and the inlining fails.

See here for a reduced reproduction:

Jakob Kummerow

unread,
Jun 5, 2023, 4:32:48 AM6/5/23
to v8-...@googlegroups.com
GCC support is largely best-effort. We have one GCC bot that we keep green, but other build configurations and/or GCC versions tend to have issues every so often. We'd be happy to accept (reasonably non-intrusive) patches to improve GCC support.

For the smoothest building experience, use the bundled Clang. That's usually a version somewhere between upstream trunk and the latest stable Clang release; it's updated every few weeks and well-tested on all platforms.


--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAJA9qvuDMEVt%2BJZe7KzTRFvA9N0MYaH3m3D4CsogW4fSaQ9h7w%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages