From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1938 invoked by alias); 19 Jun 2011 23:43:51 -0000 Received: (qmail 1930 invoked by uid 22791); 19 Jun 2011 23:43:50 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from qmta14.emeryville.ca.mail.comcast.net (HELO qmta14.emeryville.ca.mail.comcast.net) (76.96.27.212) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Jun 2011 23:43:27 +0000 Received: from omta09.emeryville.ca.mail.comcast.net ([76.96.30.20]) by qmta14.emeryville.ca.mail.comcast.net with comcast id xzjL1g0030S2fkCAEzjRq7; Sun, 19 Jun 2011 23:43:25 +0000 Received: from up.mrs.kithrup.com ([24.4.193.8]) by omta09.emeryville.ca.mail.comcast.net with comcast id xzjS1g00v0BKwT48VzjS3V; Sun, 19 Jun 2011 23:43:27 +0000 Subject: Re: [Ada] Fix bugs with volatile and components of aggregate types Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Mike Stump In-Reply-To: <201106200124.49880.ebotcazou@adacore.com> Date: Sun, 19 Jun 2011 23:53:00 -0000 Cc: Duncan Sands , gcc-patches@gcc.gnu.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106181255.09679.ebotcazou@adacore.com> <4DFDF18E.8090201@free.fr> <201106200124.49880.ebotcazou@adacore.com> To: Eric Botcazou X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01428.txt.bz2 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= :=3D >> O"? >=20 > Good question, that I'm not really qualified to answer. Any language law= yer? I'd like to think that the optimizers are not allowed to remove the assignm= ent (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 offs= ets at the same location and the like come to mind.