From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30523 invoked by alias); 7 Mar 2003 14:56:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 30494 invoked by uid 71); 7 Mar 2003 14:56:00 -0000 Date: Fri, 07 Mar 2003 14:56:00 -0000 Message-ID: <20030307145600.30490.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Richard C Bilson Subject: Re: c++/9881: What is an address constant expression? Reply-To: Richard C Bilson X-SW-Source: 2003-03/txt/msg00352.txt.bz2 List-Id: The following reply was made to PR c++/9881; it has been noted by GNATS. From: Richard C Bilson To: bangerth@ticam.utexas.edu Cc: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, nathan@codesourcery.com, pabuhr@uwaterloo.ca Subject: Re: c++/9881: What is an address constant expression? Date: Fri, 7 Mar 2003 09:47:19 -0500 (EST) > From bangerth@ticam.utexas.edu Thu Mar 6 18:01:02 2003 > > [I cc:ed Nathan, since he might know what's going on better than at least > me.] > > > > I think this is now analyzed. We need a language lawyer > > > to look at it. > > > > Before we start bashing each other over the head with our respective > > copies of the standard, > > Well, I apologize if I seemed as if I wanted to. Not at all. But I've seen where these discussions can end up. < snip > > > Clearly, section 3.6.2 of the standard permits an implementation to > > compute static initializers at compile time even if no other part of > > the standard requires it to do so. Even if the desired behavior is > > not mandated by the standard, it's still a beneficial optimization, > > provided that gcc wasn't generating incorrect code because of it. > > While that is true, it is not the question here: the standard mandates to > initialize > - first dynamic data by zero > - then, constant initialized data by their value > - finally, dynamic data by their dynamically computed initializer > If the compiler can shortcut computations for the last category, it must > not start initialization before the second class is completed, > nevertheless. Sorry, I mis-spoke -- what I was writing did not correspond exactly with what I was thinking. What I meant to point out was that 3.6.2p2 permits an implementation to treat any initialization as a static initialization if it can (subject to certain restrictions that don't apply to the initializer in question here). To use your terminology, this allows an implementation to move an initializer from class 3 to class 2. This is why I believe that the old behavior of gcc was not in error, regardless of how 5.19.4 is interpreted. - Richard