Frank Heckenbach wrote:
Waldek Hebisch wrote:
Without mangling we have problem. With mangling (using get_unique_identifier) all test pass on i386.
Without doing anything about the getdecls() lists (current_binding_level->names)? Thanks for the information, I'll try it on AIX this weekend.
I tried the following:
diff -ru gpc-20040516.orig/p/declarations.c gpc-20040516/p/declarations.c --- gpc-20040516.orig/p/declarations.c Wed May 12 02:39:11 2004 +++ gpc-20040516/p/declarations.c Thu Jul 8 13:03:15 2004 @@ -3079,8 +3079,12 @@ DECL_REGISTER (d) = !!(qualifiers & VQ_REGISTER); PASCAL_DECL_TYPED_CONST (d) = !!(qualifiers & VQ_BP_CONST); TREE_STATIC (d) = !!(qualifiers & VQ_STATIC); + if (TREE_STATIC (d)) + DECL_CONTEXT (d) = 0; if (TREE_STATIC (d) + DECL_EXTERNAL (d) + DECL_REGISTER (d) > 1) error ("multiple storage classes in variable declaration"); + { + tree assembler_name0 = 0; if (pascal_global_bindings_p ()) { TREE_PUBLIC (d) = !TREE_STATIC (d) && !DECL_REGISTER (d) && @@ -3088,10 +3092,19 @@ TREE_STATIC (d) = !DECL_EXTERNAL (d); } else - TREE_PUBLIC (d) = DECL_EXTERNAL (d); + { + TREE_PUBLIC (d) = DECL_EXTERNAL (d); + if (TREE_STATIC (d) && !assembler_name) + assembler_name0 = get_unique_identifier ("static_"); + } + DECL_COMMON (d) = !TREE_PUBLIC (d); - SET_DECL_ASSEMBLER_NAME (d, assembler_name ? check_assembler_name (assembler_name) + if (assembler_name0) + SET_DECL_ASSEMBLER_NAME (d, assembler_name0); + else + SET_DECL_ASSEMBLER_NAME (d, assembler_name ? check_assembler_name (assembler_name) : (qualifiers & VQ_EXTERNAL) ? de_capitalize (TREE_VALUE (v)) : TREE_VALUE (v)); + } pascal_decl_attributes (&d, attributes); if (DECL_EXTERNAL (d) || TREE_STATIC (d)) {