*** utils2.c.ori Fri Jun 20 01:04:40 2008 --- utils2.c Fri Jun 20 01:04:52 2008 *************** compare_elmt_bitpos (const PTR rt1, cons *** 1629,1662 **** tree gnat_build_constructor (tree type, tree list) { - tree elmt; - int n_elmts; bool allconstant = (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST); bool side_effects = false; ! tree result; /* Scan the elements to see if they are all constant or if any has side effects, to let us set global flags on the resulting constructor. Count the elements along the way for possible sorting purposes below. */ for (n_elmts = 0, elmt = list; elmt; elmt = TREE_CHAIN (elmt), n_elmts ++) { ! if (!TREE_CONSTANT (TREE_VALUE (elmt)) || (TREE_CODE (type) == RECORD_TYPE ! && DECL_BIT_FIELD (TREE_PURPOSE (elmt)) ! && TREE_CODE (TREE_VALUE (elmt)) != INTEGER_CST) ! || !initializer_constant_valid_p (TREE_VALUE (elmt), ! TREE_TYPE (TREE_VALUE (elmt)))) allconstant = false; ! if (TREE_SIDE_EFFECTS (TREE_VALUE (elmt))) side_effects = true; /* Propagate an NULL_EXPR from the size of the type. We won't ever be executing the code we generate here in that case, but handle it specially to avoid the compiler blowing up. */ if (TREE_CODE (type) == RECORD_TYPE ! && (0 != (result ! = contains_null_expr (DECL_SIZE (TREE_PURPOSE (elmt)))))) return build1 (NULL_EXPR, type, TREE_OPERAND (result, 0)); } --- 1629,1664 ---- tree gnat_build_constructor (tree type, tree list) { bool allconstant = (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST); bool side_effects = false; ! tree elmt, result; ! int n_elmts; /* Scan the elements to see if they are all constant or if any has side effects, to let us set global flags on the resulting constructor. Count the elements along the way for possible sorting purposes below. */ for (n_elmts = 0, elmt = list; elmt; elmt = TREE_CHAIN (elmt), n_elmts ++) { ! tree obj = TREE_PURPOSE (elmt); ! tree val = TREE_VALUE (elmt); ! ! /* The predicate must be in keeping with output_constructor. */ ! if (!TREE_CONSTANT (val) || (TREE_CODE (type) == RECORD_TYPE ! && DECL_BIT_FIELD (obj) ! && DECL_MODE (obj) != BLKmode ! && !initializer_constant_valid_for_bitfield_p (val)) ! || !initializer_constant_valid_p (val, TREE_TYPE (val))) allconstant = false; ! if (TREE_SIDE_EFFECTS (val)) side_effects = true; /* Propagate an NULL_EXPR from the size of the type. We won't ever be executing the code we generate here in that case, but handle it specially to avoid the compiler blowing up. */ if (TREE_CODE (type) == RECORD_TYPE ! && (result = contains_null_expr (DECL_SIZE (obj))) != NULL_TREE) return build1 (NULL_EXPR, type, TREE_OPERAND (result, 0)); }