This is the mail archive of the 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: C++ PATCH: PR 16405

> If an ADDR_EXPR applied to an expression with type T has a type
> different from pointer-to-T or reference-to-T, I believe that the front
> end is broken.

Indeed, that's my understanding too.

> However, I was concerned as I was falling asleep last night about the
> possibility that their might be alignment differences introduced by the
> casts, i.e., that pointer-to-T might be cast to pointer-to-unaligned-T
> before the dereference.  But, the existence of the ADDR_EXPR means that
> some actual object is being examined, and it can never be wrong to use
> the underlying object -- the alignment of that object is more accurate
> that whatever might be implied by a pointer type introduced along the way.

Can't we imagine an overaligning cast?

> > I think this kind of changes should be tested on a STRICT_ALIGNMENT
> > platform.
> I'll see about an IA64 HP-UX test run, but I'm not sure what shape that
> port is in at the moment.

FWIW I just rebuilt the Ada RTS with your patch on the SPARC and re-ran ACATS 
with no difference in the results.  So maybe I was overzealous.

Eric Botcazou

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