[Bug target/82897] Unnecessary zero-extension when loading mask register from memory

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 8 15:02:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82897

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That does something different though.  But there is in C:
              if (targetm.calls.promote_prototypes (fundecl ? TREE_TYPE
(fundecl) : 0)
                  && INTEGRAL_TYPE_P (type)
                  && (TYPE_PRECISION (type) < TYPE_PRECISION
(integer_type_node)))
                parmval = default_conversion (parmval);
and in C++:
  else if (targetm.calls.promote_prototypes (type)
           && INTEGRAL_TYPE_P (type)
           && COMPLETE_TYPE_P (type)
           && tree_int_cst_lt (TYPE_SIZE (type), TYPE_SIZE
(integer_type_node)))
    type = integer_type_node;
and
  else if (targetm.calls.promote_prototypes (type)
           && INTEGRAL_TYPE_P (type)
           && COMPLETE_TYPE_P (type)
           && tree_int_cst_lt (TYPE_SIZE (type), TYPE_SIZE
(integer_type_node)))
    val = cp_perform_integral_promotions (val, complain);
This shows a clear inconsistency between C and C++, C passes the FUNCTION_TYPE,
while C++ passes the argument type.
If all the FEs passed the FUNCTION_TYPE/METHOD_TYPE at least, then i386 target
hook could decide say based on some custom attribute you'd use on those
builtins.
Or we could change the target hook further and pass a fndecl (if known) and
type to the target hook.


More information about the Gcc-bugs mailing list