3 ms·
Debug info under high optimization is very tricky. A simple example: for (i = 0; i < 4; i++) ... If the compiler unrolls the loop four times the eliminates th
by compiler-guy 3y ago
Debug info under high optimization is very tricky. A simple example:
for (i = 0; i < 4; i++) ...
If the compiler unrolls the loop four times the eliminates the induction variable altogether, then combines the four iteration loop into a single vector instruction, what debug info should it emit for the value of i in the loop body?
You can argue that it should emit what i would have had at a given point, but now you have four different values for i all at that one vector instruction. Reasoning about that is quite difficult.
- rcxdude 3y agoTrue, but I would be happy if at least the debugger could point me at the value which is clearly being iterated over in a register, or tell me the value of a standard ABI function's arguments (and no, it hasn't been overwritten by something else).