]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xtensa: Remove variables only used to pass the return of end_sequence()
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Sun, 14 Dec 2025 13:04:43 +0000 (22:04 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 16 Dec 2025 12:17:08 +0000 (04:17 -0800)
As a result of the automatic replacement by commit 4dd13988c93c24ba3605f4b9cafc97515c34f2ac,
there are several code fragments that receive the return value of
end_sequence() and immediately use it as the return value of the function
itself.

   rtx_insn *insn;
   ...
   insn = end_sequence ();
   return insn;

It is clear that in such cases, it would be more natural to pass the return
value of end_sequence() directly to the return statement without passing it
through a variable.

Applying this patch naturally does not change any functionality.

gcc/ChangeLog:

* config/xtensa/xtensa.cc
(xtensa_expand_block_set_libcall,
xtensa_expand_block_set_unrolled_loop,
xtensa_expand_block_set_small_loop, xtensa_call_tls_desc):
Change the return statement to pass the return value of
end_sequence() directly without going through a variable, and
remove the definition of that variable.

gcc/config/xtensa/xtensa.cc

index f09123d5c330ad9147014021e477dc487e72a276..43df10e4b63e1a02637dc0866adbab4cbb1da766 100644 (file)
@@ -1425,7 +1425,6 @@ xtensa_expand_block_set_libcall (rtx dst_mem,
                                 HOST_WIDE_INT bytes)
 {
   rtx reg;
-  rtx_insn *seq;
 
   start_sequence ();
 
@@ -1439,9 +1438,7 @@ xtensa_expand_block_set_libcall (rtx dst_mem,
                     GEN_INT (value), SImode,
                     GEN_INT (bytes), SImode);
 
-  seq = end_sequence ();
-
-  return seq;
+  return end_sequence ();
 }
 
 /* Worker function for xtensa_expand_block_set().
@@ -1458,7 +1455,6 @@ xtensa_expand_block_set_unrolled_loop (rtx dst_mem,
 {
   rtx reg;
   int offset;
-  rtx_insn *seq;
 
   if (bytes > 64)
     return NULL;
@@ -1500,9 +1496,7 @@ xtensa_expand_block_set_unrolled_loop (rtx dst_mem,
     }
   while (bytes > 0);
 
-  seq = end_sequence ();
-
-  return seq;
+  return end_sequence ();
 }
 
 /* Worker function for xtensa_expand_block_set(),
@@ -1520,7 +1514,6 @@ xtensa_expand_block_set_small_loop (rtx dst_mem,
   rtx reg, dst, end;
   machine_mode unit_mode;
   rtx_code_label *label;
-  rtx_insn *seq;
 
   /* Totally-aligned block only.  */
   if (bytes % align != 0)
@@ -1581,9 +1574,7 @@ xtensa_expand_block_set_small_loop (rtx dst_mem,
   emit_insn (gen_addsi3 (dst, dst, GEN_INT (align)));
   emit_cmp_and_jump_insns (dst, end, NE, const0_rtx, SImode, true, label);
 
-  seq = end_sequence ();
-
-  return seq;
+  return end_sequence ();
 }
 
 
@@ -2247,7 +2238,7 @@ static rtx_insn *
 xtensa_call_tls_desc (rtx sym, rtx *retp)
 {
   rtx fn, arg, a_io;
-  rtx_insn *call_insn, *insns;
+  rtx_insn *call_insn;
 
   start_sequence ();
   fn = gen_reg_rtx (Pmode);
@@ -2259,10 +2250,9 @@ xtensa_call_tls_desc (rtx sym, rtx *retp)
   emit_move_insn (a_io, arg);
   call_insn = emit_call_insn (gen_tls_call (a_io, fn, sym, const1_rtx));
   use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), a_io);
-  insns = end_sequence ();
 
   *retp = a_io;
-  return insns;
+  return end_sequence ();
 }