On Sat, 27 Dec 2025, Martin Uecker wrote:
> /* A null type means arg type is not specified.
> Take whatever the other function type has. */
> - if (TREE_VALUE (p1) == NULL_TREE)
> - {
> - TREE_VALUE (n) = TREE_VALUE (p2);
> - goto parm_done;
> - }
> - if (TREE_VALUE (p2) == NULL_TREE)
> - {
> - TREE_VALUE (n) = TREE_VALUE (p1);
> - goto parm_done;
> - }
> + if (mv1 == NULL_TREE)
> + mv2 = NULL_TREE;
> + else if (mv2 == NULL_TREE)
> + mv1 = NULL_TREE;
Is this null case actually possible (either from a C function declaration,
or from a built-in declaration)?
> + mv1 = transparent_union_replacement (mv1, mv2);
> + mv2 = transparent_union_replacement (mv2, mv1);
I don't think this would work in the null case
(transparent_union_replacement doesn't look like it would handle a null
pointer), but I suspect other code using TYPE_ARG_TYPES wouldn't work for
the case of an argument with null TREE_VALUE either. If it's not
possible, maybe an assertion somewhere would be better than a comment and
code claiming to handle it.
--
Joseph S. Myers
[email protected]