Release stuff
Alexandre Petit-Bianco
apbianco@cygnus.com
Tue Mar 12 15:02:00 GMT 2002
Tom Tromey writes:
> 5876 jc1 crashes when targeting mingw32
> I believe this is the problem we think was introduced by my
> builtin function patch. Is that right?
I believe so. The offending decl passes through something that a
native linux compiler doesn't do. This particular section of the code
expect decl->common.type to be set to something and it's not the case
(AG tried to work around it.)
The type of decl is set in define_builtin through the TYPE argument
which is set from the macros in builtin.def and builtin-types.def and
is null in some cases.
For example, __builtin_alloca_, uses type BT_FN_PTR_SIZE which is
built to null because in java/builtins.c, c_size_type_node is set to
NULL and this is what BT_SIZE (on which BT_FN_PTR_SIZE is built) is.
Setting c_size_type_node to unsigned_type_node makes it go a little
further along [1], until it next breaks on __builtin_labs because
BT_FN_LONG_LONG is null: it was built null because BT_LONG is set in
builtin-types.def to long_integer_type_node, which we don't define and
is defaulted to null.
If we only stick to something that we see having a set type according
to the choices made in java/builtins.c, then we would only define a
builtin if TYPE is set to something [2]. In which case we end up
defining a bunch of buitlins [3], including the one we really want but
I don't know whether this is correct approach...
./A
[1]
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/builtins.c,v
retrieving revision 1.3.4.1
diff -u -p -r1.3.4.1 builtins.c
--- builtins.c 2002年03月05日 05:09:31 1.3.4.1
+++ builtins.c 2002年03月12日 22:50:22
@@ -283,7 +283,7 @@ initialize_builtins ()
#define intmax_type_node NULL_TREE
#define traditional_ptr_type_node NULL_TREE
#define traditional_cptr_type_node NULL_TREE
-#define c_size_type_node NULL_TREE
+#define c_size_type_node unsigned_type_node
#define const_string_type_node NULL_TREE
#define traditional_len_type_node NULL_TREE
#define va_list_ref_type_node NULL_TREE
[2]
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/builtins.c,v
retrieving revision 1.3.4.1
diff -u -p -r1.3.4.1 builtins.c
--- builtins.c 2002年03月05日 05:09:31 1.3.4.1
+++ builtins.c 2002年03月12日 22:57:37
@@ -200,7 +200,7 @@ define_builtin (val, name, class, type,
{
tree decl;
- if (! name)
+ if (! name || ! type)
return;
if (strncmp (name, "__builtin_", strlen ("__builtin_")) != 0)
[3]
__builtin_abs __builtin_fabs
__builtin_fabsf __builtin_ffs
__builtin_sqrt __builtin_sin
__builtin_cos __builtin_sqrtf
__builtin_sinf __builtin_cosf
__builtin_args_info __builtin_frame_address
__builtin_return_address __builtin_return
__builtin_setjmp __builtin_longjmp
__builtin_trap __builtin_putchar
__builtin_fputc __builtin_putchar_unlocked
__builtin_fputc_unlocked __builtin_unwind_init
__builtin_dwarf_cfa __builtin_dwarf_fp_regnum
__builtin_init_dwarf_reg_size_table __builtin_frob_return_addr
__builtin_extract_return_addr __builtin_eh_return
__builtin_eh_return_data_regno
More information about the Java
mailing list