ICE: SEGFAULT in mem rtx - GCC-4.5.1

vikram1729 vsp1729@gmail.com
Mon Nov 23 06:54:00 GMT 2015


Hi
I am building gcc-4.5.1 cross compiler. I am getting SEGFAULT ICE at
simplify-rtx.c:167, i.e. at this function

/* If X is a MEM referencing the constant pool, return the real value.                                                                                   
    Otherwise return X.  */
rtx  
avoid_constant_pool_reference (rtx x)                                                                                                                    
{ 
   rtx c, tmp, addr;
   ....
   ....
-->   addr = targetm.delegitimize_address (addr); //SEGFAULT here
   /* Split the address into a base and integer offset.  */
   if (GET_CODE (addr) == CONST
   ....
}

When debugging, call debug_rtx(x) gives this pattern:
(mem/c/i:SI (plus:SI (reg/f:SI 129 virtual-stack-vars)
        (const_int -8 [0xfffffff8])) [0 __ul+0 S4 A32])

To solve it, I tried to implement my own delegitimize function:
static rtx
target_delegitimize_address (rtx orig_x)
{
   //rtx x = orig_x;
   rtx x = delegitimize_mem_from_attrs (orig_x);

   if (GET_CODE (x) != MEM) 
     return XEXP(x, 0);
 
   x = XEXP (x, 0);
   if (GET_CODE (x) == PLUS 
          && GET_CODE (XEXP (x, 1)) == CONST_INT
          && GET_CODE (XEXP (x, 0)) == REG) 
     //DON'T KNOW WHAT TO WRITE HERE. Tried this but failed: return XVECEXP
(XEXP(x, 1), 0, 0);

  return orig_x;
}

Is it a backend problem?

Thanks & Regards
-VSP



--
View this message in context: http://gcc.1065356.n5.nabble.com/ICE-SEGFAULT-in-mem-rtx-GCC-4-5-1-tp1208515.html
Sent from the gcc - Help mailing list archive at Nabble.com.



More information about the Gcc-help mailing list