]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Allow CONCATs in emit_group_load_1.
authorRoger Sayle <roger@nextmovesoftware.com>
Thu, 29 Jan 2026 18:48:14 +0000 (18:48 +0000)
committerRoger Sayle <roger@nextmovesoftware.com>
Thu, 29 Jan 2026 18:48:14 +0000 (18:48 +0000)
This one line patch is a pre-requisite to a solution to PR target/123506;
an effort to improve middle-end code for returning structures.  Currently,
emit_group_load_1 contains code to handle a CONCAT returned by force_reg.
This tweak avoids the call for force_reg if the source is already a CONCAT,
which allows this subroutine to be re-used by target-specific implementations
of emit_group_load.  Many thanks to Jeff Law for cross-platform testing.

2026-01-29  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* expr.cc (emit_group_load_1): Don't call force_reg if orig_src
is already a CONCAT.

gcc/expr.cc

index d3dad6c8041c1aac0d8ed7e2223353aed4b7850b..c279341ffcbc75bbc6090429e010b9b701aa4c7c 100644 (file)
@@ -3038,6 +3038,7 @@ emit_group_load_1 (rtx *tmps, rtx dst, rtx orig_src, tree type,
       src = orig_src;
       if (!MEM_P (orig_src)
          && (!REG_P (orig_src) || HARD_REGISTER_P (orig_src))
+         && GET_CODE (orig_src) != CONCAT
          && !CONSTANT_P (orig_src))
        {
          gcc_assert (GET_MODE (orig_src) != VOIDmode);