MSP430: Fix regression caused by NOOP_MOVE_INSN_CODE.
MSP430 target no longer regresses on NOOP_MOVE_INSN_CODE.
A regression affecting the MSP430 target has been fixed. The issue arose from handling of NOOP_MOVE_INSN_CODE within the msp430_insn_cost function, which previously caused an early exit and subsequent errors. The change ensures these instructions are handled correctly, preventing testsuite regressions.
In Details
The msp430_insn_cost function in config/msp430/msp430.cc now correctly handles instructions with NOOP_MOVE_INSN_CODE. Previously, after a combine pass optimization, certain (set (pc) (pc)) patterns were converted to NOOP_MOVE_INSN_CODE. The cost function would then incorrectly attempt to call get_attr_length on these, leading to failures. The fix avoids this early exit, allowing normal processing.
- MSP430
- A family of 16-bit microcontrollers from Texas Instruments, commonly used in embedded systems. GCC provides support for targeting this architecture.
- insn_cost
- A function within GCC that estimates the cost (e.g., execution time, instruction count) of a given machine instruction. This information is used by the instruction scheduler and other optimization passes.
- NOOP_MOVE_INSN_CODE
- A special instruction code used in GCC to represent a 'no-operation' move instruction, often generated during code optimization or transformation.
- combine pass
- A GCC optimization pass that performs instruction combination and simplification. It aims to replace sequences of instructions with more efficient single instructions where possible.