--- Comment #29 from mmitchel at gcc dot gnu dot org 2010-08-31 17:41
---
Jason --
I can't argue with that as a literal reading of the standard, but is there any
reason why the standard doesn't allow const float variables in (not necessarily
integral) constant expressions just as we al
--- Comment #28 from jason at gcc dot gnu dot org 2010-08-31 17:26 ---
(In reply to comment #18)
> The optimization question in Comment #11 was answered incorrectly.
>
> The C++ standard in fact requires that Y be initialized before the constructor
> is run; see [basic.start.init].
I d
--- Comment #27 from mmitchel at gcc dot gnu dot org 2005-10-11 21:05
---
Fixed in 4.0.3.
--
mmitchel at gcc dot gnu dot org changed:
What|Removed |Added
Sta
--- Comment #26 from cvs-commit at gcc dot gnu dot org 2005-10-11 20:59
---
Subject: Bug 21089
CVSROOT:/cvs/gcc
Module name:gcc
Branch: gcc-4_0-branch
Changes by: [EMAIL PROTECTED]2005-10-11 20:59:53
Modified files:
gcc/cp : call.c init.c ty
--- Comment #25 from cvs-commit at gcc dot gnu dot org 2005-10-11 20:58
---
Subject: Bug 21089
CVSROOT:/cvs/gcc
Module name:gcc
Changes by: [EMAIL PROTECTED]2005-10-11 20:58:46
Modified files:
gcc/cp : call.c init.c typeck.c ChangeLog
gcc/t
--- Comment #24 from sabre at nondot dot org 2005-10-11 17:15 ---
At pinskia's request, I filed Bug 24312 to show the miscompilation due to
mishandling this. I thought it would be better to keep this PR focused on the
missed-optimization aspect.
-Chris
--
http://gcc.gnu.org/bugzil
--- Comment #23 from sabre at nondot dot org 2005-10-11 17:10 ---
Ah, very interesting. Thanks for the clarification. Should I file another PR
about cases where this is mishandled?
-Chris
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089
--- Comment #22 from mark at codesourcery dot com 2005-10-11 17:05 ---
Subject: Re: [4.0/4.1 Regression] C++ front-end does not "inline"
the static const double
sabre at nondot dot org wrote:
> --- Comment #21 from sabre at nondot dot org 2005-10-11 17:03 ---
> "required opti
--- Comment #21 from sabre at nondot dot org 2005-10-11 17:03 ---
"required optimization" doesn't make sense to me. To put it more clearly, do
you agree that this:
"In particular, I think the C++ standard specifies that memory is zero
initialized and then ctors (within a translation un
--- Comment #20 from mark at codesourcery dot com 2005-10-11 17:00 ---
Subject: Re: [4.0/4.1 Regression] C++ front-end does not "inline"
the static const double
sabre at nondot dot org wrote:
> --- Comment #19 from sabre at nondot dot org 2005-10-11 16:58 ---
> To clarify: yo
--- Comment #19 from sabre at nondot dot org 2005-10-11 16:58 ---
To clarify: you are saying that the response in comment #12 is wrong?
-Chris
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089
--- Comment #18 from mmitchel at gcc dot gnu dot org 2005-10-11 16:49
---
The optimization question in Comment #11 was answered incorrectly.
The C++ standard in fact requires that Y be initialized before the constructor
is run; see [basic.start.init].
--
http://gcc.gnu.org/bugzill
--
mmitchel at gcc dot gnu dot org changed:
What|Removed |Added
AssignedTo|unassigned at gcc dot gnu |mark at codesourcery dot com
|dot org
--
What|Removed |Added
Target Milestone|4.0.2 |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-20
14:33 ---
*** Bug 23975 has been marked as a duplicate of this bug. ***
--
What|Removed |Added
--
What|Removed |Added
Target Milestone|4.0.1 |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089
--
What|Removed |Added
Status|REOPENED|NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089
--- Additional Comments From matz at suse dot de 2005-04-28 09:24 ---
Yes, I determined that already in the initial report; to cite myself:
> It's invalid for two reasons I think, first the missing definition, instead
> of the declaration.
[the second reason being the use of the G
--- Additional Comments From nathan at gcc dot gnu dot org 2005-04-28
08:02 ---
the example test case is invalid even with the gnu extension. As with
static const int members, you must have a single out-of-class definition of
the member EVEN IF the member is initialized in class. [9.4.2
--- 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.
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-28
02:09 ---
(In reply to comment #11)
> Is this optimization valid? Note that it will change the behavior of this c++
> program:
You are correct Chris, this was an invalid optimization.
This is a dup of bug 19320. T
--
What|Removed |Added
Target Milestone|4.0.0 |4.0.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089
--- Additional Comments From schlie at comcast dot net 2005-04-18 19:36
---
(In reply to comment #11)
I believe the optimization necessitates the variable's declaration be changed
(either explicitly, or by implication):
static const double b = a+1.0; => const double b = a+1.0;
If it'
--- Additional Comments From sabre at nondot dot org 2005-04-18 18:41
---
Is this optimization valid? Note that it will change the behavior of this c++
program:
#include
static const double X = 1.0;
static struct S { S(); } s;
static const double Y = X+2.0;
S::S() {
printf("%
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-18
18:34 ---
Looks like this was caused by:
2004-12-16 Nathan Sidwell <[EMAIL PROTECTED]>
PR c++/18905
* cp-tree.h (integral_constant_value): Declare.
* call.c (null_ptr_cst_p): Use integral_co
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-18
18:19 ---
(In reply to comment #8)
> Also note this worked with "4.0.0 20041211", so something after that date
> changed the problem.
And it was broken by "4.0.0 20050113". so there is only a month time which it
c
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-18
18:06 ---
Also note this worked with "4.0.0 2004121", so something after that date
changed the problem.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-18
18:04 ---
(In reply to comment #6)
> With -O0 we also don't inline 'a'. I thought in the past this already
> was done in the frontend, so the -O option didn't matter? If yes, this
> has changed (if not, well, I'
--- Additional Comments From matz at suse dot de 2005-04-18 17:59 ---
With -O0 we also don't inline 'a'. I thought in the past this already
was done in the frontend, so the -O option didn't matter? If yes, this
has changed (if not, well, I'm wrong ;-) ).
--
http://gcc.gnu.org/
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-18
17:53 ---
It has nothing to do with members of classes either, see the following code:
static const double a = 1.0;
static const double b = a+1.0;
double c()
{
return b;
}
We now longer inline 2.0 into c.
--
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-18
17:50 ---
Confirmed.
--
What|Removed |Added
Status|UNCONFIRMED |NEW
E
31 matches
Mail list logo