https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114715

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-04-15
      Known to fail|                            |13.2.0
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  The branches emitted by pass_lower_switch_O0 lack location info,
so does the switch itself, already since at least gimplification.

The GENERIC SWITCH_EXPR has

{file = 0x4926cc0 "/tmp/t.c", line = 12, column = 9, data = 0x0, 
  sysp = false}

we set a location on the BIND we wrap the switch with though.  The outer
switch is not wrapped in a BIND.  That one gets the location from
annotate_all_with_location_after but this function doesn't recurse into
structured gimple.

It's easy to manually set the switch stmt location, annotating random
nested GIMPLE with a location might be odd.  Maybe instead of

  gimple_set_location (bind, EXPR_LOCATION (switch_expr));

we should also set all of the BIND_BODY locations as well?

Jakub, any preference?

Reply via email to