This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] Fix bit/byte unit thinko in is_aliasing_offset
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: rth at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 Oct 03 20:32:05 EDT
- Subject: Re: [RFA] Fix bit/byte unit thinko in is_aliasing_offset
We'd have to check where it's being allocated. It's easy to support
this alignment for TREE_STATIC variables, at least for ELF. For
variables on the stack we should be limited to STACK_BOUNDARY or
PREFERRED_STACK_BOUNDARY.
But, at least in Ada, if you accept an alignment on a type, you must guarantee
it for *all* objects of that type.
What we do in Ada if you have an alignment larger than STACK_BOUNDARY but
smaller than MAX_OFILE_ALIGNMENT and are allocating a stack object is to make
a RECORD_TYPE whose size is the size of the object plus the alignment (in
bytes). Using a PLACEHOLDER_EXPR, the position of the single field of the
record is computed with an expression that looks at the address of the start
of the record modulo the requested alignment (in bytes) and thus guarantees
the requested alignment. References to the object are converted to a
COMPONENT_REF of that field in the record.