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: PR 6212


On Mon, May 06, 2002 at 03:56:52PM -0700, Mark Mitchell wrote:
> For now, highest_pow2_factor is only used as an argument to
> offset_address, and in offset_address, there's already a "MIN"; the
> offset address is never more aligned than the original address.
> 
> Does that help?

I don't think so.  The following will return 64-bit alignment for the memory.

This particular example doesn't fail on Alpha at the moment, since the Alpha
backend doesn't look at MEM_ALIGN for this case.  But there _is_ stuff that
uses MEM_ALIGN; it's just a matter of trying all the combinations to find
something that fails.


r~


struct S
{
  long x;
  short y[];
};

void foo(struct S *s, int *p, int *q)
{
  s->y[(char *)q - (char *)p] = 0;
}

void bar()
{
  struct S *s = alloca(100);
  char c[2];
  foo(&s, (int *)&c[0], (int *)&c[1]);
}


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