fix for strct-pack-1.c regressions

Richard Henderson
Wed Mar 13 11:16:00 GMT 2002

On Wed, Mar 13, 2002 at 07:45:26AM -0500, Richard Kenner wrote:
>     No.  We may access memory outside the structure entirely.
> Are you sure?  I didn't think we ever did that (well except for the stuff
> in alpha.c).

I think so.  You'd have to have nested structures to see it,
since there has to be alignment present to take advantage.
Perhaps something like

	struct foo {
	  long x;
	  short y;
	  struct bar { int a; } __attribute__((packed)) z;
	} f;

	f.z.a = 0;

In that case I don't see anything preventing us from using 
the alignment of F to work around the misalignment of A.  So
we couldn't simply strip off one layer of component_ref and
have the right alias set.

> This is the one in gcc.c-torture/execute?

Yes.  IIRC powerpc-eabi -mlittle showed the problem; Aldy
can confirm the proper configuration.


More information about the Gcc-patches mailing list