@@ -101,7 +101,7 @@ static tree handle_vector_type_attribute (tree *, tree, tree, int, bool *);
101101
102102/* Fake handler for attributes we don't properly support, typically because
103103 they'd require dragging a lot of the common-c front-end circuitry. */
104- static tree fake_attribute_handler (tree * , tree , tree , int , bool * );
104+ static tree fake_attribute_handler (tree * , tree , tree , int , bool * );
105105
106106/* Table of machine-independent internal attributes for Ada. We support
107107 this minimal set of attributes to accommodate the needs of builtins. */
@@ -222,8 +222,9 @@ static GTY((deletable)) tree free_block_chain;
222222/* A hash table of padded types. It is modelled on the generic type
223223 hash table in tree.c, which must thus be used as a reference. */
224224
225- struct GTY ((for_user )) pad_type_hash {
226- unsigned long hash ;
225+ struct GTY ((for_user )) pad_type_hash
226+ {
227+ hashval_t hash ;
227228 tree type ;
228229};
229230
@@ -4249,10 +4250,13 @@ convert (tree type, tree expr)
42494250 return convert (type , TREE_OPERAND (expr , 0 ));
42504251
42514252 /* If the inner type is of self-referential size and the expression type
4252- is a record, do this as an unchecked conversion. But first pad the
4253- expression if possible to have the same size on both sides. */
4253+ is a record, do this as an unchecked conversion unless both types are
4254+ essentially the same. But first pad the expression if possible to
4255+ have the same size on both sides. */
42544256 if (ecode == RECORD_TYPE
4255- && CONTAINS_PLACEHOLDER_P (DECL_SIZE (TYPE_FIELDS (type ))))
4257+ && CONTAINS_PLACEHOLDER_P (DECL_SIZE (TYPE_FIELDS (type )))
4258+ && TYPE_MAIN_VARIANT (etype )
4259+ != TYPE_MAIN_VARIANT (TREE_TYPE (TYPE_FIELDS (type ))))
42564260 {
42574261 if (TREE_CODE (TYPE_SIZE (etype )) == INTEGER_CST )
42584262 expr = convert (maybe_pad_type (etype , TYPE_SIZE (type ), 0 , Empty ,
0 commit comments