[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-18 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #13 from Martin Liška  ---
(In reply to ncm from comment #12)
> As it is, your probability of failure in 9 and 10 is exactly 1.0.

I don't get this?

We speak a possibility that we break a stable release branch by a backport that
can somehow interact with other parts of the compiler. The purpose of stable
branches is to keep them as stable as possible.

This bug is a minor performance issue, not any wrong code or a compiler crash.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-16 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #12 from ncm at cantrip dot org ---
As it is, your probability of failure in 9 and 10 is exactly 1.0.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #11 from Jakub Jelinek  ---
We usually don't backport optimization improvements, even if they fix
regressions, to release branches.  There are quite high risks involved.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-16 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #10 from ncm at cantrip dot org ---
Don't understand, the compiler we are using (9) has the 
regression. It looks like a trivial backport.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

Martin Liška  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #9 from Martin Liška  ---
Fixed on the master, not planning to backport.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #8 from Martin Liška  ---
(In reply to ncm from comment #6)
> The referenced patch seems to have also deleted a fair bit of explanatory
> comment text, including a list of possible refinements for selected targets.

Sorry for that, I made an overhaul of the pass and I may miss porting of some
comments.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-16 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/g:5e303cdee1ff01e4b302ef2f913c0bdd84ab967e

commit r11-5049-g5e303cdee1ff01e4b302ef2f913c0bdd84ab967e
Author: Martin Liska 
Date:   Mon Nov 9 14:26:04 2020 +0100

Prefer bit-test over the jump table.

gcc/ChangeLog:

PR tree-optimization/97736
* tree-switch-conversion.c
(switch_decision_tree::analyze_switch_statement):
Prefer bit tests.

gcc/testsuite/ChangeLog:

PR tree-optimization/97736
* gcc.dg/tree-ssa/switch-1.c: Prefer bit tests.
* g++.dg/tree-ssa/pr97736.C: New test.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-09 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #6 from ncm at cantrip dot org ---
The referenced patch seems to have also deleted a fair bit of explanatory
comment text, including a list of possible refinements for selected targets.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-09 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

Martin Liška  changed:

   What|Removed |Added

 Status|RESOLVED|ASSIGNED
 Resolution|WONTFIX |---

--- Comment #5 from Martin Liška  ---
All right, let's prefer a bit-test over the jump table.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-09 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #4 from Jakub Jelinek  ---
I disagree with that resolution, expanding it as a bit test is certainly better
and shorter too.
And it seems even switchconv pass says that it is preferrable to expand it as
bit-test, but during expansion it used to be expanded as bit test, but now it
just is not.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-09 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

Martin Liška  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |WONTFIX

--- Comment #3 from Martin Liška  ---
All right. So for the mentioned test-case we can expand both as jump table and
as a bit-test. Since the revision, we prefer the jump table.
You can disable that with -fno-jump-tables for the interesting function.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-06 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
   Last reconfirmed||2020-11-06
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
Mine then.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
Started with r9-1342-g789410e4824b60f423f7855d68f234e02f9300fb

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-05 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |9.4
  Component|target  |tree-optimization
Summary|[9/10 Regression] switch|[9/10/11 Regression] switch
   |codegen |codegen
 CC||marxin at gcc dot gnu.org
   Keywords||missed-optimization