Fix MIPS backend's handling of zero-argument built-in functions.
MIPS backend corrected to properly define built-in functions with no arguments.
This commit resolves an issue in the MIPS backend where built-in functions declared to take no arguments were incorrectly constructed. Specifically, for functions returning int or unsigned int with void arguments, the backend was creating an incorrect function type signature. This fix ensures correct argument type lists are used, preventing C++ compilation failures.
In Details
The MIPS backend's definition of MIPS_SI_FTYPE_VOID and MIPS_USI_FTYPE_VOID in mips-ftypes.def was incorrectly passing void_type_node as part of the argument list to build_function_type_list. This resulted in a TREE_LIST structure for arguments when void_list_node should have been used for functions taking no arguments. This caused discrepancies, particularly in the C++ frontend, that are now fixed by omitting the void_type_node argument for zero-argument functions.
- MIPS backend
- The part of the GCC compiler responsible for generating machine code specifically for MIPS architectures.
- built-in function
- Functions provided by the compiler that often map directly to specific hardware instructions or provide compiler-specific functionality.
- function type signature
- Defines the return type and the types of arguments a function accepts. In C++, this is crucial for function overloading and correct linkage.
- void_list_node
- In GCC's internal representation, this node signifies a function with no arguments. It is distinct from a
TREE_LISTnode containingvoid_type_node, which can be misinterpreted.