This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Void Pointer Alignment - GCC 3.4.6


On Thu, Jan 29, 2009 at 11:39 AM, Ian Lance Taylor <iant@google.com> wrote:
> Rohit Arul Raj <rohitarulraj@gmail.com> writes:
>
>> I am working with GCC 3.4.6 for a private target. The Alignment of all
>> pointer variables in my target is supposed to be 16bits. But it seems
>> that for void pointers, the alignment by default is taken as 8 bits. I
>> have defined the following macros to get the desired alignment but
>> still it doesn't seem to work.
>>
>> #define Pmode HImode
>> #define POINTER_SIZE 16
>>
>> Are there any other macros that are supposed to be defined to get the
>> preferred alignment or any other way of implementing this?
>
> Alignment is not set based on the size, though that often determines a
> default value.  It is set based on macros in the CPU.h file, like
> BIGGEST_ALIGNMENT, DATA_ALIGNMENT, LOCAL_ALIGNMENT,
> STACK_SLOT_ALIGNMENT, etc.  See the internals documentation.
>
> Ian
>

Hi,

Previously i had written a simple test case:

void *a, *b, *c ;
int fun()
{
  temp(a, b, c);
}

and set breakpoints at the function definitions of the DATA_ALIGNMENT,
LOCAL_ALIGNMENT in cpu.h but it doesn't seem to hit the break points.

BIGGEST_ALIGNMENT is set to 16 and i have not yet defined STACK_SLOT_ALIGNMENT.

Regards,
Rohit


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