https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70604
Richard Biener changed:
What|Removed |Added
Keywords||missed-optimization
Status|UNCONFIRMED |NEW
Last reconfirmed||2016-04-12
CC||jamborm at gcc dot gnu.org
Component|c |tree-optimization
Ever confirmed|0 |1
--- Comment #2 from Richard Biener ---
For GCC 6 stronger value-numbering might have fixed most cases.
Are the cases you still see indirect jumps to only one active case or
is it just that if()s with multiple cases would have avoided the dead
code?
I can see
:
_139 = [(void *)cmd_84(D) + 930B];
_141 = conn_140(D)->sess;
_142 = _141->se_sess;
_143 = _84(D)->se_cmd;
transport_init_se_cmd (_143, _ops, _142, 0, 3, 32, _139);
target_get_sess_cmd (_143, 1);
switch (_58) , case 1: , case 2: , case 3: ,
case 4: , case 5: , case 6: , case 7: >
:
goto ();
:
goto ();
:
goto ();
:
goto ();
:
goto ();
:
_146 = (int) _58;
printk ("\13Unknown iSCSI TMR Function: 0x%02x\n", _146);
_351 = iscsit_add_reject_from_cmd (cmd_84(D), 10, 1, buf_55(D)); [tail call]
goto ;
:
# prephitmp_14 = PHI <1(18), 2(11), 3(12), 4(13), 5(14), 6(15), 7(16)>
:
with the default case looping back. switch conversion should probably handle
this but is run too early. OTOH it seems to be confused by the default
case not falling thru, failing to see the "simple" transform to a
if (... >= 1 && ... <= 7)
;
else
old default;
beginning to process the following SWITCH statement
(drivers/target/iscsi/iscsi_target.c:1807) : ---
switch (_74) , case 1: , case 2: , case 3: ,
case 4: , case 5: , case 6: , case 7: >
Bailing out - no common successor to all case label target blocks found
beginning to process the following SWITCH statement
(drivers/target/iscsi/iscsi_target.c:1866) : ---
switch (_74) , case 1: , case 2 ... 5: , case 6:
, case 7: , case 8: >
Bailing out - no common successor to all case label target blocks found
Not sure what the other cases are.