This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Question about promoted_input_arg
- To: gcc at gcc dot gnu dot org
- Subject: Question about promoted_input_arg
- From: Momchil Velikov <velco at fadata dot bg>
- Date: 05 Mar 2001 10:09:07 +0200
Hi,
Trying to understand what the function does ...
rtx
promoted_input_arg (regno, pmode, punsignedp)
unsigned int regno;
enum machine_mode *pmode;
int *punsignedp;
{
tree arg;
for (arg = DECL_ARGUMENTS (current_function_decl); arg;
arg = TREE_CHAIN (arg))
if (GET_CODE (DECL_INCOMING_RTL (arg)) == REG
&& REGNO (DECL_INCOMING_RTL (arg)) == regno
&& TYPE_MODE (DECL_ARG_TYPE (arg)) == TYPE_MODE (TREE_TYPE (arg)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Why do we check this (after the last &&) ? Isn't it possible after an
argument is promoted from TREE_TYPE (arg) to DECL_ARG_TYPE (arg), a
mode promotion to take place ?
{
enum machine_mode mode = TYPE_MODE (TREE_TYPE (arg));
int unsignedp = TREE_UNSIGNED (TREE_TYPE (arg));
mode = promote_mode (TREE_TYPE (arg), mode, &unsignedp, 1);
if (mode == GET_MODE (DECL_INCOMING_RTL (arg))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
And this ? Isn't it more like ``assert (mode == GET_MODE (DECL_INCOMING_RTL (arg))''.
&& mode != DECL_MODE (arg))
{
*pmode = DECL_MODE (arg);
*punsignedp = unsignedp;
return DECL_INCOMING_RTL (arg);
}
}
return 0;
}
Regards,
-velco