[Bug tree-optimization/99383] No tree-switch-conversion under PIC

2021-09-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99383 Andrew Pinski changed: What|Removed |Added Resolution|--- |DUPLICATE Status|NEW

[Bug tree-optimization/99383] No tree-switch-conversion under PIC

2021-09-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99383 Andrew Pinski changed: What|Removed |Added Severity|normal |enhancement See Also|

[Bug tree-optimization/99383] No tree-switch-conversion under PIC

2021-03-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99383 --- Comment #7 from Jakub Jelinek --- The code would need to also verify the constants are all pointers, just having a relocation nested somewhere in a struct wouldn't work.

[Bug tree-optimization/99383] No tree-switch-conversion under PIC

2021-03-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99383 --- Comment #6 from Jakub Jelinek --- Note, it could be even POINTER_DIFF_EXPR of the value and the first value in the table or something similar. The generic code would need to ensure for flag_pic that either reloc is null_pointer_node for all e

[Bug tree-optimization/99383] No tree-switch-conversion under PIC

2021-03-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99383 --- Comment #5 from Jakub Jelinek --- Combining the separate strings into a single one if they have the same length and aren't many would have the disadvantage that the returned value then wouldn't be pointer equal to constant literal containing

[Bug tree-optimization/99383] No tree-switch-conversion under PIC

2021-03-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99383 --- Comment #4 from Jakub Jelinek --- That was an intentional change, see the PR. With -fPIC/-fPIE, when the switch isn't optimized into a table of values but kept as a switch, it doesn't need runtime relocations on many targets. Just try to com

[Bug tree-optimization/99383] No tree-switch-conversion under PIC

2021-03-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99383 --- Comment #3 from Richard Biener --- For the specific case of strings switch-conversion could also generate a combined string (with intermediate '\0's) and use a table of offsets into said string, thus doing a single relocation to the combined

[Bug tree-optimization/99383] No tree-switch-conversion under PIC

2021-03-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99383 Richard Biener changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #2

[Bug tree-optimization/99383] No tree-switch-conversion under PIC

2021-03-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99383 Richard Biener changed: What|Removed |Added CC||marxin at gcc dot gnu.org S