Commits

fearog  committed 2795191

Fixed internal compiler error: Use GCC's layout_type() on the whole aggtype instead of custom code in dt2tree_list_of_elems.

  • Participants
  • Parent commits 36b21de

Comments (0)

Files changed (1)

     // Generate type on the fly
     CtorEltMaker elts;
     ListMaker fields;
-    tree offset = size_zero_node;
 
     tree aggtype = make_node(RECORD_TYPE);
 
     {
         tree value = dt2node(dt);
         tree field = d_build_decl(FIELD_DECL, NULL_TREE, TREE_TYPE(value));
-        tree size = TYPE_SIZE_UNIT(TREE_TYPE(value));
+        // all layout information will be setup later by layout_type()
         DECL_CONTEXT(field) = aggtype;
-        DECL_FIELD_OFFSET(field) = offset;
-        DECL_FIELD_BIT_OFFSET(field) = bitsize_zero_node;
         SET_DECL_OFFSET_ALIGN(field, TYPE_ALIGN(TREE_TYPE(field)));
         DECL_ARTIFICIAL(field) = 1;
         DECL_IGNORED_P(field) = 1;
-        layout_decl(field, 0);
 
         fields.chain(field);
         elts.cons(field, value);
 
-        offset = size_binop(PLUS_EXPR, offset, size);
         dt = dt->DTnext;
     }
 
     TYPE_FIELDS(aggtype) = fields.head; // or finish_laout
-    TYPE_SIZE(aggtype) = convert(bitsizetype,
-        size_binop(MULT_EXPR, offset, size_int(BITS_PER_UNIT)));
-    TYPE_SIZE_UNIT(aggtype) = offset;
+    layout_type( aggtype );
+
     // okay no alignment -- decl (which has the correct type) should take care of it..
     // align=bits per word?
     compute_record_mode(aggtype);