[Bug target/84011] Optimize switch table with -fPIE

2018-01-24 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84011 H.J. Lu changed: What|Removed |Added CC||jakub at redhat dot com Depends on|

[Bug target/84011] Optimize switch table with -fPIE

2018-01-24 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84011 --- Comment #5 from H.J. Lu --- (In reply to rguent...@suse.de from comment #4) > > The question is why run-time relocations aren't allowed. > > Probably added to save binary space? An optimization would be to I don't think so: text

[Bug target/84011] Optimize switch table with -fPIE

2018-01-24 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84011 --- Comment #4 from rguenther at suse dot de --- On Wed, 24 Jan 2018, hjl.tools at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84011 > > --- Comment #2 from H.J. Lu --- > (In reply to Richard Biener from comment #1) >

[Bug target/84011] Optimize switch table with -fPIE

2018-01-24 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84011 --- Comment #3 from H.J. Lu --- This patch works on the testcase: diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index c2538908340..a1e85407bf3 100644 --- a/gcc/tree-switch-conversion.c +++

[Bug target/84011] Optimize switch table with -fPIE

2018-01-24 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84011 --- Comment #2 from H.J. Lu --- (In reply to Richard Biener from comment #1) > Somehow switch-conversion doesn't transform the switch with -f{PIE,PIC}. > Without > we get > > phy_modes (phy_interface_t interface) > { > const char * _1; >

[Bug target/84011] Optimize switch table with -fPIE

2018-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84011 Richard Biener changed: What|Removed |Added Keywords||missed-optimization