AVR debug insn handling fixed in 2-moves pass.
AVR's 2-moves optimization pass now correctly handles debug instructions, fixing failures with -fcompare-debug.
The AVR-specific avr_pass_2moves optimization pass has been modified to correctly handle debug instructions. Previously, transformations within this pass could be affected by the presence or absence of debug insns, leading to failures when the -fcompare-debug flag was used. The changes ensure that instruction traversal and register use chain analysis correctly ignore debug insns, resolving regressions in specific test cases.
In Details
The avr_pass_2moves optimization pass in GCC's AVR backend has been corrected to be agnostic to debug instructions. By using next_nondebug_insn_bb() for instruction traversal and ignoring debug insns when examining the DF_REG_USE_CHAIN, the pass now provides consistent results regardless of whether debug information is being generated. This resolves issues with the -fcompare-debug testing flag, which previously exposed regressions in this pass.
- AVR
- A family of microcontrollers manufactured by Atmel (now Microchip Technology), commonly used in embedded systems.
- debug insns
- Instructions or annotations added to compiled code to aid in debugging, such as DWARF information or specific debugging markers.
- -fcompare-debug
- A GCC flag used during testing to compare the output of compiled code with and without debug information, to ensure consistency.
- DF_REG_USE_CHAIN
- Data flow information that tracks the usage of registers within a basic block or function.