mirror of git://gcc.gnu.org/git/gcc.git
typeck2.c (process_init_constructor_array): Use the proper type for computing the array length.
2012-03-28 Richard Guenther <rguenther@suse.de> * typeck2.c (process_init_constructor_array): Use the proper type for computing the array length. From-SVN: r185919
This commit is contained in:
parent
f25a65f5d1
commit
32e8bfc3f6
|
@ -1,3 +1,8 @@
|
||||||
|
2012-03-28 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
* typeck2.c (process_init_constructor_array): Use the proper
|
||||||
|
type for computing the array length.
|
||||||
|
|
||||||
2012-03-27 Meador Inge <meadori@codesourcery.com>
|
2012-03-27 Meador Inge <meadori@codesourcery.com>
|
||||||
|
|
||||||
PR c++/52672
|
PR c++/52672
|
||||||
|
|
|
@ -1054,9 +1054,14 @@ process_init_constructor_array (tree type, tree init,
|
||||||
{
|
{
|
||||||
tree domain = TYPE_DOMAIN (type);
|
tree domain = TYPE_DOMAIN (type);
|
||||||
if (domain)
|
if (domain)
|
||||||
len = (TREE_INT_CST_LOW (TYPE_MAX_VALUE (domain))
|
len = double_int_ext
|
||||||
- TREE_INT_CST_LOW (TYPE_MIN_VALUE (domain))
|
(double_int_add
|
||||||
+ 1);
|
(double_int_sub
|
||||||
|
(tree_to_double_int (TYPE_MAX_VALUE (domain)),
|
||||||
|
tree_to_double_int (TYPE_MIN_VALUE (domain))),
|
||||||
|
double_int_one),
|
||||||
|
TYPE_PRECISION (TREE_TYPE (domain)),
|
||||||
|
TYPE_UNSIGNED (TREE_TYPE (domain))).low;
|
||||||
else
|
else
|
||||||
unbounded = true; /* Take as many as there are. */
|
unbounded = true; /* Take as many as there are. */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue