* lang-specs.h: Do not process -o or run the assembler if
-fsyntax-only.
+2000-08-16 Andrew Haley <aph@cygnus.com>
+
+ * typeck.c (build_java_array_type): Rewrite code to do array
+ alignment. Take into account back-end macros when aligning array
+ data. Remove setting of TYPE_USER_ALIGN; Java doesn't allow the
+ user to set alignment. Fixes gcj/252 and 160.
+
2000-08-09 Tom Tromey <tromey@cygnus.com>
* parse.y (check_abstract_method_definitions): Now return `int'.
{
tree atype = build_prim_array_type (element_type, length);
tree arfld = build_decl (FIELD_DECL, get_identifier ("data"), atype);
+
DECL_CONTEXT (arfld) = t;
TREE_CHAIN (fld) = arfld;
+
+ /* We need to force the data field to begin at an alignment at
+ least equal to the biggest alignment in an object type node
+ in order to be compatible with the way that JArray is defined
+ in CNI. However, we can't exceed BIGGEST_FIELD_ALIGNMENT. */
+ {
+ unsigned desired_align = TYPE_ALIGN (object_type_node);
+ desired_align = MAX (desired_align, TYPE_ALIGN (element_type));
+#ifdef BIGGEST_FIELD_ALIGNMENT
+ desired_align = MIN (desired_align,
+ (unsigned) BIGGEST_FIELD_ALIGNMENT);
+#endif
+#ifdef ADJUST_FIELD_ALIGN
+ desired_align = ADJUST_FIELD_ALIGN (field, desired_align);
+#endif
+ DECL_ALIGN (arfld) = desired_align;
+ }
}
else
{
- TYPE_ALIGN (t) = TYPE_ALIGN (element_type);
- TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (element_type);
+ unsigned desired_align = TYPE_ALIGN (element_type);
+#ifdef BIGGEST_FIELD_ALIGNMENT
+ desired_align = MIN (desired_align, (unsigned) BIGGEST_FIELD_ALIGNMENT);
+#endif
+ TYPE_ALIGN (t) = desired_align;
}
pop_obstacks ();