diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-12-11 11:05:58 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-12-11 11:05:58 +0000 |
commit | cce30ea89cd30aab0b37a0b09ec56a4107fcc773 (patch) | |
tree | 6e81f0e5f2f610ef6b45fcf083757387d8acfded /gcc/ada | |
parent | 4f96985d582c4b3cd0228a760e8aedc98488adba (diff) | |
download | gcc-cce30ea89cd30aab0b37a0b09ec56a4107fcc773.zip gcc-cce30ea89cd30aab0b37a0b09ec56a4107fcc773.tar.gz gcc-cce30ea89cd30aab0b37a0b09ec56a4107fcc773.tar.bz2 |
utils2.c (gnat_build_constructor): Test the TREE_STATIC flag of elements to compute that of the constructor.
* gcc-interface/utils2.c (gnat_build_constructor): Test the TREE_STATIC
flag of elements to compute that of the constructor.
From-SVN: r182203
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils2.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6a2dd26..6adbc2a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2011-12-11 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/utils2.c (gnat_build_constructor): Test the TREE_STATIC + flag of elements to compute that of the constructor. + +2011-12-11 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/decl.c (gnat_to_gnu_param): Set the restrict qualifier on references built for parameters which aren't specifically by-ref. diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c index f9e48b79..93663b4 100644 --- a/gcc/ada/gcc-interface/utils2.c +++ b/gcc/ada/gcc-interface/utils2.c @@ -1817,7 +1817,7 @@ gnat_build_constructor (tree type, VEC(constructor_elt,gc) *v) FOR_EACH_CONSTRUCTOR_ELT (v, n_elmts, obj, val) { /* The predicate must be in keeping with output_constructor. */ - if (!TREE_CONSTANT (val) + if ((!TREE_CONSTANT (val) && !TREE_STATIC (val)) || (TREE_CODE (type) == RECORD_TYPE && CONSTRUCTOR_BITFIELD_P (obj) && !initializer_constant_valid_for_bitfield_p (val)) |