This is the mail archive of the
mailing list for the GCC project.
Re: Spurious register spill with volatile function argument
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: <Paul_Koning at Dell dot com>
- Cc: <gcc at gcc dot gnu dot org>, <cfe-dev at lists dot llvm dot org>, <sw-dev at groups dot riscv dot org>
- Date: Mon, 28 Mar 2016 17:09:55 +0200
- Subject: Re: Spurious register spill with volatile function argument
- Authentication-results: sourceware.org; auth=none
- References: <2600D96D-94BC-4259-9D39-DE4993859281 at mac dot com> <9F3C9DE6-F00B-4402-A83B-354455DEAFFA at mac dot com> <CA++6G0CK3Yu-w9fhOrvpRP49qz9=Vs20J_=R28Mq=zCJOH+-UA at mail dot gmail dot com> <238543C3-39EA-4D5D-8C54-631BF796A38B at mac dot com> <56F8F66D dot 6020002 at redhat dot com> <87egaurecx dot fsf at mid dot deneb dot enyo dot de> <9C15BEC4-998E-40C4-8246-2DE78FF785AB at dell dot com>
* Paul Koning:
>> On Mar 28, 2016, at 8:11 AM, Florian Weimer <email@example.com> wrote:
>> The problem is that âreadingâ is either not defined, or the existing
>> flatly contradicts existing practice.
>> For example, if p is a pointer to a struct, will the expression &p->m
>> read *p?
> Presumably the offset of m is substantially larger than 0? If so, my
> answer would be "it had better not". Does any compiler treat that
> statement as an access to *p ?
As I tried to explain, GCC does, for aliasing purposes. For the
expression p->m, there is an implicit read of *p, asserting that the
static and dynamic types match.