This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to control the offset for stack operation?
"Mohamed Shafi" <shafitvm@gmail.com> writes:
> Depending on the machine mode the compiler will generate automatically
> the offset required for the stack operation i.e for a machine with
> word size is 32, for char type the offset is 1, for int type the
> offset is 2 and so on..
>
> Is there a way to control this ? i mean say for long long the offset
> is 4 if long long is mapped to TI mode and i want the generate the
> offset such that it is 2.
>
> Is there a way to do this in gcc ?
I assume you mean that when loading a 4-byte value the stack offset is
automatically multiplied by 4. Don't think about types at this level;
all that matters is the size of the reference, which in gcc is
described as the mode.
Use a special code in the insn pattern (e.g., %L0), and adjust the
offset in the target specific PRINT_OPERAND function.
Ian