On Tue, 23 Apr 2019 at 01:18, Jason Mancini <jayrusman@xxxxxxxxxxx> wrote: > > We've determined that the gcc perf drop is due to use of decltype(auto) as the return type for template functions. Replacing with a known type or func(...) -> decltype(...) trailing type syntax seems to avoid the performance issue. Is the code you're compiling the same in all cases, meaning decltype(auto) is faster with GCC 6 than later releases? Or are you only using decltype(auto) with the later releases? It's possible that GCC 7 and later fixes some bugs in the handling of decltype(auto) which makes it slower than GCC 6. It's unsurprising that decltype(auto) requires the compiler to do more work, but ideally that work wouldn't make compilation exponentially slower, even with less buggy behaviour than in older releases.