[Bug middle-end/82404] Unnecessary instructions in switch table

2017-12-20 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 --- Comment #12 from Martin Liška --- Author: marxin Date: Wed Dec 20 08:50:56 2017 New Revision: 255851 URL: https://gcc.gnu.org/viewcvs?rev=255851&root=gcc&view=rev Log: Add two test-cases for (PR middle-end/82404). 2017-12-20 Martin Liska

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-12-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 --- Comment #11 from Martin Liška --- (In reply to Antony Polukhin from comment #10) > Do we need a autotest on that to make sure that cmp won't appear again? Yes, there's patch request: https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01228.html

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-11-07 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 --- Comment #10 from Antony Polukhin --- Do we need a autotest on that to make sure that cmp won't appear again?

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-11-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 Martin Liška changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-11-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 --- Comment #8 from Martin Liška --- Author: marxin Date: Mon Nov 6 09:02:15 2017 New Revision: 254437 URL: https://gcc.gnu.org/viewcvs?rev=254437&root=gcc&view=rev Log: Instrument function exit with __builtin_unreachable in C++ 2017-11-06 Ma

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-10-03 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 --- Comment #7 from Jonathan Wakely --- Clang's transformation is not based on the valid values of the enumeration, but the fact that there's a missing return statement, so if you call it with an argument that isn't one of the cases it's UB. The

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-10-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #6

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-10-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 --- Comment #5 from Martin Liška --- (In reply to Martin Liška from comment #3) > I can work on that, Andrew can you point to differences in between C and C++ > differences of enum values? Scoper enumeration is here answer I guess.

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-10-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 --- Comment #4 from Martin Liška --- I can confirm in C, clang adds guard checks: $ cat pr82405-2.c enum eShape { eSquare, eCircle, eShpere, eTetraeder }; double test_switch_native(enum eShape shape, double r) { switch(shape) { case eSq

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-10-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 Martin Liška changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-10-02 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 --- Comment #2 from Andrew Pinski --- Oh this has to be c++ because of enum class. So gcc just does not use the undefinedness here.

[Bug middle-end/82404] Unnecessary instructions in switch table

2017-10-02 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404 Andrew Pinski changed: What|Removed |Added Component|target |middle-end --- Comment #1 from Andrew Pi