public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "matz at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/21089] [4.0/4.1 Regression] C++ front-end does not "inline" the static const double
Date: Thu, 28 Apr 2005 02:46:00 -0000	[thread overview]
Message-ID: <20050428024608.774.qmail@sourceware.org> (raw)
In-Reply-To: <20050418172616.21089.matz@suse.de>


------- Additional Comments From matz at suse dot de  2005-04-28 02:46 -------
Uhm, wait.  Perhaps the optimization would be invalid for your changed example 
from comment #5, but see below.  But it will not be invalid for my initial testcase, 
where it missed to propagate 20.0 into setPosition. 
 
Why I think the transformation is valid _also_ for comment #5: See 3.6.2 #2: 
------------------------------- 
An implementation is permitted to perform the initialization of an object of namespace scope 
with static storage duration as a static initialization even if such initialization is not required to 
be done statically, provided that 
  * the dynamic version of the initialization does not change the 
    value of any other object of namespace scope with static storage duration prior to its 
     initialization, and 
  * the static version of the initialization produces the same value in the 
    initialized object as would be produced by the dynamic initialization if all objects not required 
    to be initialized statically were initialized dynamically. 
------------------------------------- 
 
It then goes on to provide an example which uses an inline function to dynamically initialize 
something, where comment #5 uses an arithmetic expression.  So I think we are permitted 
to do this optimization, in both, by initial example, and Andrews example from comment #5. 
 
Reopening. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089


  parent reply	other threads:[~2005-04-28  2:46 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-18 17:26 [Bug c++/21089] New: c++ accepts invalid static const double members with initializer matz at suse dot de
2005-04-18 17:32 ` [Bug c++/21089] " pinskia at gcc dot gnu dot org
2005-04-18 17:40 ` matz at suse dot de
2005-04-18 17:47 ` [Bug c++/21089] C++ front-end does not "inline" the static const double members pinskia at gcc dot gnu dot org
2005-04-18 17:50 ` [Bug c++/21089] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-04-18 17:53 ` [Bug c++/21089] [4.0/4.1 Regression] C++ front-end does not "inline" the static const double pinskia at gcc dot gnu dot org
2005-04-18 17:59 ` matz at suse dot de
2005-04-18 18:04 ` pinskia at gcc dot gnu dot org
2005-04-18 18:06 ` pinskia at gcc dot gnu dot org
2005-04-18 18:19 ` pinskia at gcc dot gnu dot org
2005-04-18 18:34 ` pinskia at gcc dot gnu dot org
2005-04-18 18:41 ` sabre at nondot dot org
2005-04-18 19:36 ` schlie at comcast dot net
2005-04-21  5:03 ` mmitchel at gcc dot gnu dot org
2005-04-28  2:11 ` pinskia at gcc dot gnu dot org
2005-04-28  2:46 ` matz at suse dot de [this message]
2005-04-28  8:03 ` nathan at gcc dot gnu dot org
2005-04-28  9:24 ` matz at suse dot de
2005-05-02 14:21 ` pinskia at gcc dot gnu dot org
2005-07-08  1:42 ` mmitchel at gcc dot gnu dot org
2005-09-20 14:33 ` pinskia at gcc dot gnu dot org
2005-09-27 16:25 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-21089-183@http.gcc.gnu.org/bugzilla/>
2005-10-11  7:20 ` mmitchel at gcc dot gnu dot org
2005-10-11 16:49 ` mmitchel at gcc dot gnu dot org
2005-10-11 16:58 ` sabre at nondot dot org
2005-10-11 17:00 ` mark at codesourcery dot com
2005-10-11 17:03 ` sabre at nondot dot org
2005-10-11 17:05 ` mark at codesourcery dot com
2005-10-11 17:10 ` sabre at nondot dot org
2005-10-11 17:15 ` sabre at nondot dot org
2005-10-11 20:58 ` cvs-commit at gcc dot gnu dot org
2005-10-11 20:59 ` cvs-commit at gcc dot gnu dot org
2005-10-11 21:05 ` mmitchel at gcc dot gnu dot org
2010-08-31 17:26 ` jason at gcc dot gnu dot org
2010-08-31 17:41 ` mmitchel at gcc dot gnu dot org

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=20050428024608.774.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).