Just like I mentioned in post commit review for D33176,
this can be simplified.
May be it is possible to simplify even more,
I only tried to apply obvious simplification
changes I already did for other .gdb_index patches I worked on.
(faced with this testcase today during work on another patch and decided to
improve it while I am here).