fearog avatar 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.

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);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.