https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105070
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Target Milestone|--- |9.5 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Last reconfirmed| |2022-03-28 Ever confirmed|0 |1 Summary|Missing debug info for |[9/10/11/12 Regression] |switch statement |Missing debug info for | |switch statement Priority|P3 |P2 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Interestingly all line number info is lost: int foo (int x) { int D.1961; int _1; int _3; int _4; unsigned int _6; _Bool _7; long unsigned int _8; long unsigned int _9; _Bool _10; <bb 2> : _6 = (unsigned int) x_2(D); _7 = _6 > 5; if (_7 != 0) goto <bb 5>; [20.00%] else goto <bb 3>; [80.00%] <bb 3> : _8 = 42 >> _6; _9 = _8 & 1; _10 = _9 != 0; if (_10 != 0) goto <bb 4>; [60.00%] else goto <bb 5>; [40.00%] <bb 4> : [t.c:8:12] _3 = 1; [t.c:8:12] goto <bb 6>; [INV] and the reason is the switchlower pass run at -O0 which does beginning to process the following SWITCH statement (t.c:4) : ------- switch (x_2(D)) <default: <L3> [INV], case 1: <L0> [INV], case 3: <L0> [INV], case 5: <L0> [INV]> ;; GIMPLE switch case clusters: BT:1-5 Removing basic block 6 but does not put any locations on the generated stmts.