https://gcc.gnu.org/g:feda1cfe152e2d74ddc66278448b2cb8ec1f6234

commit r16-7514-gfeda1cfe152e2d74ddc66278448b2cb8ec1f6234
Author: Maciej W. Rozycki <[email protected]>
Date:   Sat Feb 14 14:24:46 2026 +0000

    VAX: Fix invalid RTX operand access in `nonindexed_address_p'
    
    Replace an unguarded early access to the incoming RTX's operand 0 in
    `nonindexed_address_p' with direct accesses at the actual use places,
    fixing a libgcc build error:
    
    during RTL pass: reload
    .../libgcc/libgcc2.c: In function '__udiv_w_sdiv':
    .../libgcc/libgcc2.c:649:1: internal compiler error: RTL check: expected 
elt 0 type 'e' or 'u', have 'r' (rtx reg) in nonindexed_address_p, at 
config/vax/vax.cc:1826
    
    where `--enable-checking=rtl' has been specified so as to enable RTL
    consistency checks.
    
            gcc/
            * config/vax/vax.cc (nonindexed_address_p): Move incoming RTX's
            operand 0 access to the actual use places.

Diff:
---
 gcc/config/vax/vax.cc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/config/vax/vax.cc b/gcc/config/vax/vax.cc
index 8939aa4c3afc..07267fa03031 100644
--- a/gcc/config/vax/vax.cc
+++ b/gcc/config/vax/vax.cc
@@ -1811,7 +1811,6 @@ indirectable_address_p (rtx x, bool strict, bool indirect)
 static bool
 nonindexed_address_p (rtx x, bool strict)
 {
-  rtx xfoo0;
   if (REG_P (x))
     {
       if (! reload_in_progress
@@ -1823,11 +1822,10 @@ nonindexed_address_p (rtx x, bool strict)
     return true;
   if (indirectable_address_p (x, strict, false))
     return true;
-  xfoo0 = XEXP (x, 0);
-  if (MEM_P (x) && indirectable_address_p (xfoo0, strict, true))
+  if (MEM_P (x) && indirectable_address_p (XEXP (x, 0), strict, true))
     return true;
   if ((GET_CODE (x) == PRE_DEC || GET_CODE (x) == POST_INC)
-      && BASE_REGISTER_P (xfoo0, strict))
+      && BASE_REGISTER_P (XEXP (x, 0), strict))
     return true;
   return false;
 }

Reply via email to