public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/9881: What is an address constant expression?
Date: Thu, 06 Mar 2003 23:06:00 -0000	[thread overview]
Message-ID: <20030306230600.30462.qmail@sources.redhat.com> (raw)

The following reply was made to PR c++/9881; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Richard C Bilson <rcbilson@plg2.math.uwaterloo.ca>
Cc: asharji@uwaterloo.ca, <gcc-bugs@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>,
   <pabuhr@uwaterloo.ca>, <nathan@codesourcery.com>
Subject: Re: c++/9881: What is an address constant expression?
Date: Thu, 6 Mar 2003 17:00:49 -0600 (CST)

 [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. At least to me, it was
 not at all clear what might be the reasoning why this testcase might or
 should not fail. I think at least we now know which clauses are relevant,
 and what is the question that must be decided.
 
 > 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. 
 
 In the testcase, an element of the second class has slipped into the
 third. The question I couldn't answer was whether it belongs to class 2 or 
 3. If it is 3, then the previous behavior was in error. If it is 2, then 
 the present behavior is a regression.
 
 
 > Previously, the constant_flag was set for the expression in question (that
 > is, &((bar*)&module::storage)->p) by the function build_component_addr
 > in cp/typecheck.c.  This function was removed from the 3.3 branch:
 > 
 > 2002-08-08  Nathan Sidwell  <nathan@codesourcery.com>
 > 2002-08-15  Nathan Sidwell  <nathan@codesourcery.com>
 
 Thanks for this very good detective work of figuring out which patch 
 caused the problem!
 
 Regards
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth             email:            bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth/
 
 


             reply	other threads:[~2003-03-06 23:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-06 23:06 Wolfgang Bangerth [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-04-21 11:30 nathan
2003-04-08 18:39 nathan
2003-03-10 20:36 Richard C Bilson
2003-03-08 14:16 Nathan Sidwell
2003-03-07 19:36 Richard C Bilson
2003-03-07 16:26 Nathan Sidwell
2003-03-07 14:56 Richard C Bilson
2003-03-06 22:46 Richard C Bilson
2003-03-05 22:10 bangerth

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=20030306230600.30462.qmail@sources.redhat.com \
    --to=bangerth@ticam.utexas.edu \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@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).