206 GCC HEAD regressions, 196 new, with your patch on 2005-08-23T19:50:19Z.
Richard Henderson
rth@redhat.com
Sun Aug 28 16:35:00 GMT 2005
On Fri, Aug 26, 2005 at 05:03:08PM +0100, Joern RENNECKE wrote:
> java uses char_type_node for its character type, which is 16 bits.
> gcc/java/decl.c:747 java_init_decl_processing:
> TYPE_PRECISION (char_type_node) = 16;
>
> On the other hand, tree.c uses char_type_node as the type of the
> smallest addressable
> unit:
>
> tree.c:489 make_node_stat
> case tcc_type:
> TYPE_UID (t) = next_type_uid++;
> TYPE_ALIGN (t) = char_type_node ? TYPE_ALIGN (char_type_node) : 0;
Indeed, fixing this avoids the need for your followup workaround.
Tested on i686-linux, which previously saw the problem as timeouts
on all libjava tests.
r~
* stor-layout.c (finalize_type_size): Revert workaround from 08-26.
* tree.c (make_node_stat): Use BITS_PER_UNIT instead of alignment
of char_type_node.
Index: stor-layout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stor-layout.c,v
retrieving revision 1.240
diff -u -p -d -r1.240 stor-layout.c
--- stor-layout.c 26 Aug 2005 17:17:05 -0000 1.240
+++ stor-layout.c 28 Aug 2005 16:26:38 -0000
@@ -1399,23 +1399,23 @@ finalize_type_size (tree type)
/* Normally, use the alignment corresponding to the mode chosen.
However, where strict alignment is not required, avoid
over-aligning structures, since most compilers do not do this
- alignment. Also, we must avoid overriding a larger alignment
- requirement coming from a user alignment of one of the fields. */
- /* ??? The non-aggregate code is also needed to reduce the alignment
- of java types with alignment less than 16 bits. The problem stems
- from java/decl.c using char_type_node for the 16 bit character type,
- while tree.c:make_node uses it as the type of the smallest addressable
- unit to initialize the alignment of all types. */
- unsigned mode_align = GET_MODE_ALIGNMENT (TYPE_MODE (type));
+ alignment. */
if (TYPE_MODE (type) != BLKmode && TYPE_MODE (type) != VOIDmode
- && ((STRICT_ALIGNMENT && mode_align >= TYPE_ALIGN (type))
+ && (STRICT_ALIGNMENT
|| (TREE_CODE (type) != RECORD_TYPE && TREE_CODE (type) != UNION_TYPE
&& TREE_CODE (type) != QUAL_UNION_TYPE
&& TREE_CODE (type) != ARRAY_TYPE)))
{
- TYPE_ALIGN (type) = mode_align;
- TYPE_USER_ALIGN (type) = 0;
+ unsigned mode_align = GET_MODE_ALIGNMENT (TYPE_MODE (type));
+
+ /* Don't override a larger alignment requirement coming from a user
+ alignment of one of the fields. */
+ if (mode_align >= TYPE_ALIGN (type))
+ {
+ TYPE_ALIGN (type) = mode_align;
+ TYPE_USER_ALIGN (type) = 0;
+ }
}
/* Do machine-dependent extra alignment. */
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.500
diff -u -p -d -r1.500 tree.c
--- tree.c 16 Aug 2005 00:35:50 -0000 1.500
+++ tree.c 28 Aug 2005 16:26:39 -0000
@@ -488,7 +488,7 @@ make_node_stat (enum tree_code code MEM_
case tcc_type:
TYPE_UID (t) = next_type_uid++;
- TYPE_ALIGN (t) = char_type_node ? TYPE_ALIGN (char_type_node) : 0;
+ TYPE_ALIGN (t) = BITS_PER_UNIT;
TYPE_USER_ALIGN (t) = 0;
TYPE_MAIN_VARIANT (t) = t;
More information about the Gcc-regression
mailing list