This is the mail archive of the
mailing list for the GCC project.
Re: [RFA] Fix bit/byte unit thinko in is_aliasing_offset
Geoff Keating wrote:
> > The patch included here fixes a simple bit/byte unit thinko in
> > is_aligning_offset, which is part of what's necessary to fix the general
> > issue.
> This is OK, assuming you can add the Ada testcase into the FSF GCC
> testsuite; otherwise, please try to find a C testcase.
Thanks for the review. I don't think we expect this kind of things to be
working in C.
The C version of the submitted testcase would be easy to write and would
probably appear to work, although it would not test quite the same thing.
What we are actually aiming at is something like:
#define ALIGNMENT 32
typedef int aligned_int __attribute__ ((aligned (ALIGNMENT)));
if (((long) &x % ALIGNMENT) == 0)
In Ada/GNAT, this kind of constructs either emits an error message saying
the requested alignment is too large, or issues some dynamic address
computation to have it right. The admitted upper bound depends on the target.