This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Adding constants to LO_SUM


kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:

>     /* For now, this is just a wrapper for change_address, but eventually
>        will do memref tracking.  */
> !   rtx addr = XEXP (memref, 0);
> ! 
> !   /* If MEMREF is a LO_SUM and the offset is within the size of the
> !      object, we can merge it into the LO_SUM.  */
> !   if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
> !       && offset >= 0 && offset < GET_MODE_SIZE (GET_MODE (memref)))
> !     addr = gen_rtx_LO_SUM (mode, XEXP (addr, 0),
> ! 			   plus_constant (XEXP (addr, 1), offset));
> !   else
> !     addr = plus_constant (addr, offset);
> ! 
> !   return change_address (memref, mode, addr);
>   }

This might fix the problem, but it isn't correct.  Just because it
happens to work on rs6000 for 'long long', it doesn't follow it'll
work everywhere.  It is an inherently target-dependent thing, because
LO_SUM is a target-dependent thing.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]