This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/83262] SELECT CASE slower than IF/ELSE
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 03 Dec 2017 16:43:25 +0000
- Subject: [Bug tree-optimization/83262] SELECT CASE slower than IF/ELSE
- Auto-submitted: auto-generated
- References: <bug-83262-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83262
--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The speed depends on the optimization level, SELECT CASE being the fastest with
-O1
-O0
GOTO costs totally 4.667 (s)
SELECT CASE costs totally 4.578 (s)
IF-Goto costs totally 4.986 (s)
IF-noGoto costs totally 5.734 (s)
IF-ELSE costs totally 5.731 (s)
-O1
GOTO costs totally 1.231 (s)
SELECT CASE costs totally 1.181 (s)
IF-Goto costs totally 1.826 (s)
IF-noGoto costs totally 1.738 (s)
IF-ELSE costs totally 1.668 (s)
-O2
GOTO costs totally 3.721 (s)
SELECT CASE costs totally 4.274 (s)
IF-Goto costs totally 1.517 (s)
IF-noGoto costs totally 1.482 (s)
IF-ELSE costs totally 1.525 (s)
-O3
GOTO costs totally 3.755 (s)
SELECT CASE costs totally 4.234 (s)
IF-Goto costs totally 1.497 (s)
IF-noGoto costs totally 1.522 (s)
IF-ELSE costs totally 1.537 (s)
-Ofast
GOTO costs totally 3.280 (s)
SELECT CASE costs totally 4.324 (s)
IF-Goto costs totally 1.526 (s)
IF-noGoto costs totally 1.534 (s)
IF-ELSE costs totally 1.513 (s)