Hi Max, On 2026/09/13 17:03, Max Filippov wrote:
Hi Suwa-san,On Sat, Sep 12, 2026 at 1:12 PM Takayuki 'January June' Suwa <[email protected]> wrote:Cosmetics for readability. Thus no functional changes.But it introduces a regression in gcc.target/xtensa/elim_callee_saved.c, so there's definitely a functional change.gcc/ChangeLog: * config/xtensa/xtensa.cc (xtensa_adjust_reg_alloc_order): Reformat the "reg_call0_alloc_order" array. * config/xtensa/xtensa.h (REG_ALLOC_ORDER): Reformat. --- gcc/config/xtensa/xtensa.cc | 6 ++---- gcc/config/xtensa/xtensa.h | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc index b1daa0f0a99..af1e027f53d 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -4471,11 +4471,9 @@ xtensa_adjust_reg_alloc_order (void) REG_ALLOC_ORDER; static const int reg_call0_alloc_order[FIRST_PSEUDO_REGISTER] = { - 9, 10, 11, 7, 6, 5, 4, 3, 2, 8, 0, 12, 13, 14, 15, - 18, + 11, 10, 9, 7, 6, 5, 4, 3, 2, 8, 0, 12, 13, 14, 15, 18,
Oops, I accidentally used a snippet from a patch from a different attempt... Since the order of the first three elements has changed, this certainly counts as a functional change. Here is the correct one. + 9, 10, 11, 7, 6, 5, 4, 3, 2, 8, 0, 12, 13, 14, 15, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 1, 16, 17, - 35, + 1, 16, 17, 35, }; memcpy (reg_alloc_order, TARGET_WINDOWED_ABI ? diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index 5bf1645033c..4fab1e055a1 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -249,11 +249,9 @@ along with GCC; see the file COPYING3. If not see #define REG_ALLOC_ORDER \ { \ - 8, 9, 10, 11, 12, 13, 14, 15, 7, 6, 5, 4, 3, 2, \ - 18, \ + 8, 9, 10, 11, 12, 13, 14, 15, 7, 6, 5, 4, 3, 2, 18, \ 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, \ - 0, 1, 16, 17, \ - 35, \ + 0, 1, 16, 17, 35, \ } #define ADJUST_REG_ALLOC_ORDER xtensa_adjust_reg_alloc_order () -- 2.39.5
BTW, regarding the report that regression occurs in gcc.target/xtensa/elim_callee_saved.c, on our end: a. "master" branch b."master" with the old and new versions of this patch c. "master" with the two preceding patches, and this patch (in both its old and new versions) d. "master" with the seven patches (including the old and new versions of this patch) In all of the cases mentioned above, the results were all the same, as follows: $ artifact/bin/xtensa-elf-gcc -S -O2 -mabi=call0 gcc-gnu/gcc/testsuite/gcc.target/xtensa/elim_callee_saved.c $ grep -c $'mov\t\|mov.n\t' elim_callee_saved.s 20 $ grep -c "a15, 8" elim_callee_saved.s 2 It doesn't seem to be a particular problem to me. ===== mailto:[email protected]
