This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]