This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/82897] Unnecessary zero-extension when loading mask register from memory
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 08 Nov 2017 15:02:33 +0000
- Subject: [Bug target/82897] Unnecessary zero-extension when loading mask register from memory
- Auto-submitted: auto-generated
- References: <bug-82897-4@http.gcc.gnu.org/bugzilla/>
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.