Paul Schlie <[EMAIL PROTECTED]> writes:
>> From: Mark Mitchell <[EMAIL PROTECTED]>
>> static const int i = f();
>
> Admittedly didn't think that was legal, as I though all "static const"
> initializer values needed to be resolvable at compile time, directly or
> indirectly from literal values by th
Hi Mark,
> That's a bug, or, rather, a place where the C++ front-end is failing
> to give full information to the optimizer. It should be
> TREE_READONLY. There are some tricky bits, in that if we're doing a
> dynamic initialization, we presently cannot mark it TREE_READONLY,
> but this is a sta
> From: Paul Schlie <[EMAIL PROTECTED]>
>> From: Mark Mitchell <[EMAIL PROTECTED]>
>>> Paul Schlie wrote:
>>> - ??? no such thing, you can't "dynamically" initialize a "static const",
>>> as then it's not a "static const", but rather simply a global "const"
>>>
>>> (as a "static const" object
> From: Mark Mitchell <[EMAIL PROTECTED]>
>> Paul Schlie wrote:
>> - ??? no such thing, you can't "dynamically" initialize a "static const",
>> as then it's not a "static const", but rather simply a global "const"
>>
>> (as a "static const" object is logically equivalent to a named/addressable
Paul Schlie wrote:
- ??? no such thing, you can't "dynamically" initialize a "static const",
as then it's not a "static const", but rather simply a global "const"
(as a "static const" object is logically equivalent to a named/addressable
literal, yes?)
No, it's not.
static const int i = f();
> Mark Mitchell writes:
>> Kazu Hirata wrote:
>> ...
>> static const int array[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2 };
>>
>> int
>> foo (int a)
>> {
>> return array[7];
>> }
>>
>> I am trying to fold array[7] into 2. It turns out that if T is an
>> ARRAY_REF,
>>
>> TREE_READONLY (TREE_OPERAND (T,
Kazu Hirata wrote:
Hi,
I have two questions about the C++ front end.
Consider a C++ program
static const int array[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2 };
int
foo (int a)
{
return array[7];
}
I am trying to fold array[7] into 2. It turns out that if T is an
ARRAY_REF,
TREE_READONLY (TREE_OPERAND (T
> Kazu Hirata writes:
>
>> Nathan writes:
>> this is untrue. the elements hold the qualification.
>
> Then how do I know that an array is declared with const (or static
> const)? When I looked at the CONSTRUCTOR stored in the DECL_INITIAL
> of an array, I saw it with the TREE_STATIC flag set regar
Nathan Sidwell schrieb:
Stefan Strasser wrote:
I don't know anything about fold but in general a c++ array in the
frontend is cv-qualified, not its elements.
this is untrue. the elements hold the qualification.
right
I have been processing large source codes including STL, boost and
custom code
On Sunday 08 May 2005 16:47, Nathan Sidwell wrote:
> Kazu,
>
> > Then how do I know that an array is declared with const (or static
> > const)? When I looked at the CONSTRUCTOR stored in the DECL_INITIAL
> > of an array, I saw it with the TREE_STATIC flag set regardless of
> > whether the array is
Kazu,
> Then how do I know that an array is declared with const (or static
> const)? When I looked at the CONSTRUCTOR stored in the DECL_INITIAL
> of an array, I saw it with the TREE_STATIC flag set regardless of
> whether the array is declared with const, so that's not useful to
> determine wheth
Hi Nathan,
> this is untrue. the elements hold the qualification.
Then how do I know that an array is declared with const (or static
const)? When I looked at the CONSTRUCTOR stored in the DECL_INITIAL
of an array, I saw it with the TREE_STATIC flag set regardless of
whether the array is declared
Stefan Strasser wrote:
> I don't know anything about fold but in general a c++ array in the
> frontend is cv-qualified, not its elements.
this is untrue. the elements hold the qualification.
> I have been processing large source codes including STL, boost and
> custom code including function bod
Kazu Hirata schrieb:
I am trying to fold array[7] into 2. It turns out that if T is an
ARRAY_REF,
TREE_READONLY (TREE_OPERAND (T, 0))
is 0. Why?
I don't know anything about fold but in general a c++ array in the
frontend is cv-qualified, not its elements.
Another question. How is a RANGE_E
On Sunday 08 May 2005 06:11, Kazu Hirata wrote:
> I created an array with more than one thousand elements. I still did
> not see a RANGE_EXPR in the array's CONSTRUCTOR. How do I get a
> RANGE_EXPR in a CONSTRUCTOR?
IIRC G++ only builds RANGE_EXPRs for all-zero constructors.
Gr.
Steven
Hi,
I have two questions about the C++ front end.
Consider a C++ program
static const int array[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2 };
int
foo (int a)
{
return array[7];
}
I am trying to fold array[7] into 2. It turns out that if T is an
ARRAY_REF,
TREE_READONLY (TREE_OPERAND (T, 0))
is 0.
16 matches
Mail list logo