]> git.ipfire.org Git - thirdparty/gcc.git/commit
xtensa: Simplify the definition of REGNO_OK_FOR_BASE_P() and avoid calling it directly
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Tue, 16 Sep 2025 00:42:50 +0000 (09:42 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 16 Sep 2025 16:08:30 +0000 (09:08 -0700)
commitfe7cf719a975656f395aced8b18aa10526c8a8eb
tree768a248781af95bcd10fc1c935b975e038483d00
parent5b531aa5cc216b5ec4d740940b43ca7a7728cc90
xtensa: Simplify the definition of REGNO_OK_FOR_BASE_P() and avoid calling it directly

In recent gcc versions, REGNO_OK_FOR_BASE_P() is not called directly, but
rather via regno_ok_for_base_p() which is a wrapper in gcc/addresses.h.
The wrapper obtains a hard register number from pseudo via reg_renumber
array, so REGNO_OK_FOR_BASE_P() does not need to take this into
consideration.

On the other hand, since there is only one use of REGNO_OK_FOR_BASE_P()
in the target-specific code, it would make more sense to simplify the
definition of REGNO_OK_FOR_BASE_P() and replace its call with that of
regno_ok_for_base_p().

gcc/ChangeLog:

* config/xtensa/xtensa.cc (#include):
Add "addresses.h".
* config/xtensa/xtensa.h (REGNO_OK_FOR_BASE_P):
Simplify to just a call to GP_REG_P().
(BASE_REG_P): Replace REGNO_OK_FOR_BASE_P() with the equivalent
call to regno_ok_for_base_p().
gcc/config/xtensa/xtensa.cc
gcc/config/xtensa/xtensa.h