https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124467
Bug ID: 124467
Summary: Wrong PROMOTE_MODE for QImode and HImode?
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: law at gcc dot gnu.org, nickc at redhat dot com
Blocks: 119979
Target Milestone: ---
Target: mcore-elf
mcore has
#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
if (GET_MODE_CLASS (MODE) == MODE_INT \
&& GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
{ \
(MODE) = SImode; \
(UNSIGNEDP) = 1; \
}
-- Macro: PROMOTE_MODE (M, UNSIGNEDP, TYPE)
A macro to update M and UNSIGNEDP when an object whose type is TYPE
and which has the specified mode and signedness is to be stored in
a register. This macro is only called when TYPE is a scalar type.
It means that when storing a 8-bit/16-bit integer value into a register, the
value
is always zero-extended. It means that 8-bit/16-bit signed integer value
returned
in register is always zero-extended. Is this macro correct?
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119979
[Bug 119979] [16 Regression] Recent promote_prototypes change breaks multiple
ports