https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111660
--- Comment #10 from Hwang Joonhyung ---
(In reply to Andrew Pinski from comment #5)
> Note for non-C++11 constexpr, using switch here would most likely be better .
Thank you for the comment. It helped me to solve my problem.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111660
--- Comment #9 from Hwang Joonhyung ---
(In reply to Andrew Pinski from comment #6)
> (In reply to Hwang Joonhyung from comment #0)
> > It took more than 30 minutes when I compiled testcase.cc with g++ 14.0.0
> > 20231001 on Debian GNU/Linux 12
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111660
--- Comment #4 from Hwang Joonhyung ---
I can see the time spent changes exponentially when I change the number of
ternary operators in the constexpr function.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111660
--- Comment #3 from Hwang Joonhyung ---
Created attachment 56027
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56027&action=edit
It took 36 seconds.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111660
--- Comment #2 from Hwang Joonhyung ---
Created attachment 56026
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56026&action=edit
It took 70 seconds.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111660
--- Comment #1 from Hwang Joonhyung ---
Created attachment 56025
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56025&action=edit
It took 138 seconds.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111660
Bug ID: 111660
Summary: Compilation of constexpr function returning enum takes
exponential time with -std=c++2a
Product: gcc
Version: 14.0
Status: UNCONFIRMED