public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mike Stump <mikestump@comcast.net>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: Duncan Sands <baldrick@free.fr>, gcc-patches@gcc.gnu.org
Subject: Re: [Ada] Fix bugs with volatile and components of aggregate types
Date: Sun, 19 Jun 2011 23:53:00 -0000	[thread overview]
Message-ID: <E9F46ACC-5FE5-44FB-AA8F-33D7EBEE7666@comcast.net> (raw)
In-Reply-To: <201106200124.49880.ebotcazou@adacore.com>

On Jun 19, 2011, at 4:24 PM, Eric Botcazou wrote:
>> if T is a non-volatile composite type with volatile components, and O is an
>> object of type T, are the optimizers allowed to remove the assignment "O :=
>> O"?
> 
> Good question, that I'm not really qualified to answer.  Any language lawyer?

I'd like to think that the optimizers are not allowed to remove the assignment (unless they synthesize of up the assignment of all volatile fields).  For unions, head explodes.  I think for unions, it can.  I could check the standard to ensure I have it right, but, well, that's annoying.  :-)  This answer is for the answer for C and C++, but, the middle end, _could_ decide to differ, if it had a compelling reason to.  I don't know of any reason.  Now, before someone tries to optimize structures, please be very careful.  Unions, transparent unions, frontend synthed structures with multiple offsets at the same location and the like come to mind.

  reply	other threads:[~2011-06-19 23:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-18 13:01 Eric Botcazou
2011-06-19 18:01 ` Duncan Sands
2011-06-19 23:43   ` Eric Botcazou
2011-06-19 23:53     ` Mike Stump [this message]
2011-06-20 14:20       ` Michael Matz
2011-06-20 11:46     ` Richard Guenther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E9F46ACC-5FE5-44FB-AA8F-33D7EBEE7666@comcast.net \
    --to=mikestump@comcast.net \
    --cc=baldrick@free.fr \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).