https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118594
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
For gcc 15 I'd suggest to go with
--- gcc/expr.cc.jj 2025-01-13 13:57:15.952153645 +0100
+++ gcc/expr.cc 2025-01-24 17:46:33.026188539 +0100
@@ -445,8 +445,11 @@ convert_mode_scalar (rtx to, rtx from, i
0).exists (&toi_mode))
{
start_sequence ();
- rtx fromi = force_lowpart_subreg (fromi_mode, from,
- from_mode);
+ rtx fromi;
+ if (MEM_P (from))
+ fromi = adjust_address (from, fromi_mode, 0);
+ else
+ fromi = force_lowpart_subreg (fromi_mode, from, from_mode);
rtx tof = NULL_RTX;
if (fromi)
{
and we can do something better in the lowpart subreg handling for GCC 16.