rs6000: Fix ICE in __builtin_set_fpscr_drn with variable argument
Corrects an integer mode mismatch in the rs6000 backend to prevent a compiler crash.
The rs6000 backend incorrectly used DImode for an operand in __builtin_set_fpscr_drn, while the builtin argument was SImode. This mismatch caused an Internal Compiler Error (ICE) when the function was called with an integer variable. The fix changes the operand mode to SImode and converts it to DImode as needed, resolving the ICE and adding a new test case.
In Details
The rs6000_set_fpscr_drn RTL expander had an operand mode mismatch: it expected DImode but received an SImode argument from the builtin. This commit corrects the operand mode to SImode and adds an explicit conversion to DImode, resolving an ICE in the RTL expansion phase for variable arguments. The change is confined to rs6000/rs6000.md.
- ICE
- Internal Compiler Error. A crash within the compiler itself, typically due to an unexpected internal state or a bug in the compiler's logic.
- DImode
- GCC's internal representation for a double-precision integer, typically 64 bits on most targets.
- SImode
- GCC's internal representation for a single-precision integer, typically 32 bits on most targets.
- RTL expansion
- The phase in GCC where the compiler's intermediate representation (GENERIC) is translated into RTL (Register Transfer Language), which is closer to machine code.