https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122108
Mikael Pettersson <mikpelinux at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mikpelinux at gmail dot com
--- Comment #2 from Mikael Pettersson <mikpelinux at gmail dot com> ---
I believe Jeff is referring to PR target/68467. The issue with that change
seems to be that it hard-codes the modes to promote (QI and HI) but fixed-point
uses other modes of the same sizes. The ARM backend checks the size instead,
which seems reasonable.
The following may or may not work, I cannot test it since I cannot build a
cross to m68k with fixed-point enabled (it fails in libgcc so presumably more
changes are needed apart from gcc/configure.ac):
diff --git a/gcc/config/m68k/m68k.cc b/gcc/config/m68k/m68k.cc
index b1c9238949f..ad4dd5ad153 100644
--- a/gcc/config/m68k/m68k.cc
+++ b/gcc/config/m68k/m68k.cc
@@ -7165,7 +7165,9 @@ m68k_promote_function_mode (const_tree type, machine_mode
mode,
/* Promote libcall arguments narrower than int to match the normal C
ABI (for which promotions are handled via
TARGET_PROMOTE_PROTOTYPES). */
- if (type == NULL_TREE && !for_return && (mode == QImode || mode == HImode))
+ if (type == NULL_TREE && !for_return &&
+ GET_MODE_CLASS (mode) == MODE_INT &&
+ GET_MODE_SIZE (mode) < 4)
return SImode;
return mode;
}