This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
pointer math vs named address spaces
- From: DJ Delorie <dj at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 3 Dec 2014 17:34:14 -0500
- Subject: pointer math vs named address spaces
- Authentication-results: sourceware.org; auth=none
If a target (rl78-elf in my case) has a named address space larger
than the generic address space (__far in my case), why is pointer math
in that named address space still truncated to sizetype?
N1275 recognizes that named address spaces might be a different size
than the generic address space, but I didn't see anything that
required such truncation.
volatile char __far * ptr1;
volatile char __far * ptr2;
uint32_t sival;
foo()
{
ptr2 = ptr1 + sival;
}
foo ()
{
volatile <address-space-2> char * ptr2.5;
sizetype D.2252;
long unsigned int sival.4;
volatile <address-space-2> char * ptr1.3;
sizetype _3;
;; basic block 2, loop depth 0
;; pred: ENTRY
ptr1.3_1 = ptr1;
sival.4_2 = sival;
_3 = (sizetype) sival.4_2; <------- why this truncation?
ptr2.5_4 = ptr1.3_1 + _3;
ptr2 = ptr2.5_4;
return;
;; succ: EXIT
}