Changes for GCC version 2.5.5 from version 2.5.4. Changes in files you can reconstruct with Bison, etags, makeinfo, and TeX have been omitted. Some of these files are updated just by building the compiler. You can update rest of these files by executing this command make TAGS info dvi -f Makefile.in in the directory of GCC sources, provided the necessary tools (etags, makeinfo, TeX and texi2dvi) are installed. Before applying these diffs, go to the directory gcc-2.5.4. Then use the command patch -p1 feeding it the following diffs as input. Then rename the directory to gcc-2.5.5. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/ChangeLog gcc-2.5.5/ChangeLog *** gcc-2.5.4/ChangeLog Tue Nov 16 08:40:07 1993 --- gcc-2.5.5/ChangeLog Sat Nov 27 14:36:40 1993 *************** *** 1,2 **** --- 1,803 ---- + Sat Nov 27 06:19:22 1993 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * Version 2.5.5 released. + + * c-typeck.c (pop_init_level): Ensure never on momentary_obstack + when calling complete_array_type. + + Sat Nov 27 03:52:26 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * fixproto (scanning files_to_check): Create subdirs files are in. + + * config/m68k/m68k.md (cmpsi, cmphi, cmpqi): Handle SGS_CMP_ORDER + when outputting cmpm insn. + + Fri Nov 26 15:57:24 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * gcc.c (default_compilers): Do define __GNUC_MINOR__ if input is `-'. + + Thu Nov 25 18:16:25 1993 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * function.h (struct sequence_stack): New field sequence_rtl_expr. + (struct function): Likewise. + * emit-rtl.c: Include tree.h. + (sequence_rtl_expr): New variable. + (save_emit_status, restore_emit_status): Save and restore it. + (init_emit): Initialize it. + (start_sequence_for_rtl_expr): New function. + * function.c: Declare sequence_rtl_expr. + (struct temp_slot): New field rtl_expr. + (assign_stack_temp): Set it from sequence_rtl_expr. + ({free,pop}_temp_slots): Don't free any slot with nonzero rtl_expr. + (free_temps_for_rtl_expr): New function. + * expr.c (expand_expr, case RTL_EXPR): Call free_temps_for_rtl_expr. + * stmt.c (expand_start_stmt_expr): Call start_sequence_for_rtl_expr + instead of start_sequence. + * cp-parse.y (except_stmts): Likewise. + * cp-init.c (build_new): Likewise. + * cp-typeck.c (build_modify_expr): Likewise. + * Makefile.in (emit-rtl.o): Includes tree.h. + + Thu Nov 25 17:24:02 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Makefile.in (stmp-fixproto): Create include subdir if doesn't exist. + + Wed Nov 24 14:32:47 1993 Jim Wilson (wilson@sphagnum.cygnus.com) + + * c-common.c (shorten_compare): Correct typo from last change. + + Wed Nov 24 13:25:09 1993 Richard Earnshaw (rwe11@cl.cam.ac.uk) + + * protoize.c (save_def_or_dec): Correct typo in change of Nov 23. Make + sure pointers within def_dec_p are valid before it is freed. + + Wed Nov 24 07:02:50 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * expr.c (expand_expr, case ADDR_EXPR): Also pass const0_rtx if + necessary, to avoid multiple cleanup runs. + (expand_expr, case WITH_CLEANUP_EXPR): Pass const0_rtx if + necessary, to keep the recursive call from running the same + cleanups twice. + (expand_expr, case TARGET_EXPR): Don't try to add the cleanup if + ignore's non-zero, since we would have already done it. + + Tue Nov 23 21:10:22 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + Cygnus<->FSF C++ front-end merge. + Tue Nov 23 11:05:28 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-errfn.c (STRDUP): Cast return value of alloca to (char *). + + Mon Nov 22 00:07:17 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-lex.c (real_yylex): Move declaration of tmp inside the block + that uses it, so compilers don't try to mis-optimize it away. + + * cp-search.c (dfs_pushdecls): Make sure there's a lang_specific + node on the decl before trying to print the warning out. + + * cp-decl.c (grokdeclarator): Say the member was redeclared as + static, not just that it can't be declared static. + + * cp-search.c (get_first_matching_virtual): Don't do + SET_IDENTIFIER_ERROR_LOCUS as an attempt to avoid multiple warnings + with -Woverloaded-virtual. It changes the compiler's behavior + (elicits unwanted errors). + + Sat Nov 20 19:31:01 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-tree.h (lang_type): Add field `has_nonpublic_ctor', and delete + dummy since we used the two bits it was holding out for the MIPS + compiler. + (TYPE_HAS_NONPUBLIC_CTOR): Defined. + * cp-class.c (finish_struct_methods): Set TYPE_HAS_NONPUBLIC_CTOR + as appropriate for a copy ctor with non-public visibility. + (finish_struct): Don't generate a copy ctor if the type if one of + its fields has a private copy ctor, or a protected one for which we + aren't allowed access. + (base_info): Add member `saw_nonpublic_ctor'. + (finish_base_struct): Set b->saw_nonpublic_ctor if necessary. + + * cp-method.c (hack_identifier): Make sure there's a + DECL_LANG_SPECIFIC before getting ready to grope around a class. + + * cp-typeck.c (build_indirect_ref): Complain if we encounter a + pointer to member. + + Fri Nov 19 16:37:28 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-decl.c (start_decl): Complain when a function is declared as + part of a template definition, but the class it's supposed to be + part of wasn't a template. + + * cp-decl.c (pushdecl): Don't warn about shadowing a member of + `this' if that member is static. + + * cp-call.c (convert_harshness_old): Don't die if one of the types + isn't an aggregate with a binfo. + (convert_harshness_ansi): Likewise. + + Fri Nov 19 12:18:31 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-typeck.c (convert_for_assignment): Fix typo so initialization + of a pointer from an integer actually work, rather than emit bogus + code. + + * cp-pt.c (overload_template_name): Accept unions for templates. + (instantiate_class_template): Likewise. + * cp-parse.y (template_instantiate_once): Likewise. + + * cp-lex.c (real_yylex): Instead of using the "shorts" method to + check for overflow, use the C front-end's "parts" method (to handle + any size, and not rely on long long being 32 bits wide). + + Thu Nov 18 11:51:34 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-lex.c (cons_up_default_function): Disable earlier change; it + screws up stabs somehow. Very strange. + + Thu Nov 18 00:16:29 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-decl.c (grokdeclarator): Say what class is involved when saying + we can't declare a member inside it. + + * cp-lex.c (real_yylex): Recognize operator->() as POINTSAT, not + POINTSAT_LEFT_RIGHT. By swallowing the parens, we ended up never + building the call properly for them. + * cp-parse.y (POINTSAT_LEFT_RIGHT): Remove token. + (operator_name): Remove POINTSAT_LEFT_RIGHT rule. + * cp-spew.c (init_spew): Remove POINTSAT_LEFT_RIGHT from + toks_follow_ids. + + * cp-parse.y (primary): Only try to print out the operator's name if + it's valid. + + * cp-decl.c (grok_op_properties): Fix missing parens to keep the + logic from accidentally giving an error when it shouldn't. + + Wed Nov 17 20:04:00 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-search.c (dfs_pushdecls): TREE_PURPOSE doesn't have to be + a _DECL for class_value to be an envelope, it just can't be an + IDENTIFIER_NODE. + + Wed Nov 17 15:54:02 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-type2.c (process_init_constructor): Deal with pointers to + members as initializers for initializer lists. + + Wed Nov 17 11:48:38 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-decl.c (ambi_op_p): Add ++ and --. + + * cp-error.c: Lose the anon_parm_name stuff. + + * cp-lex.c (cons_up_default_function): Change input_filename for + synthetic code. + + * cp-error.c (dump_aggr_type): Always print const or volatile. + (dump_function_decl): Only print static if verbose. + + * cp-errfn.c (cp_sprintf): New function. + + * cp-decl.c (grokfndecl): Be more verbose in complaint about applying + method qualifiers to non-methods. + + Wed Nov 17 09:51:04 1993 Jim Wilson (wilson@sphagnum.cygnus.com) + + * cp-parse.y (attrib): Accept "noreturn" attribute. + + Tue Nov 16 12:28:49 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-decl2.c (grokoptypename): Fix handling of udc's. + + * cp-method.c (build_component_type_expr): Ditto. + + * cp-class.c (finish_struct_methods): Be more verbose in complaint + about overloaded operator delete. + + * cp-decl.c (grok_op_properties): Do more checking on operators. + (grokdeclarator): Remove check for ops being members, fix handling + of user-defined conversions. + (grokfndecl): Remove checks for ops, move call to grok_op_properties + up. + (finish_decl): Remove check for ops with default arguments. + (ambi_op_p): New fn, name for either unary or binary op + (unary_op_p): New fn, checks name for unary op + + Mon Nov 15 12:38:54 1993 Brendan Kehoe (brendan@rtl.cygnus.com) + + * g++.c (main): If they gave us -v, also show the invocation of the + gcc driver. + + Mon Nov 15 12:04:47 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-decl.c (grokdeclarator): Lose "operator ". + + * cp-method.c (build_component_type_expr): Ditto. + + * cp-decl2.c (grokoptypename): Ditto. + + Make C++ accept template parameters as type names; for example, + doing `template A {...}'. + + * cp-pt.c (end_template_parm_list): Fix a bug in gs4t's patch. + (grok_template_type): Simplify. + + * cp-typeck.c (build_modify_expr_1): Give error if trying to + get default operator= for class where you can't. + + * cp-decl.c (duplicate_decls): Uniformify, fix redeclaration of + builtins. + + Sat Nov 6 19:06:25 EST 1993 Gnanasekaran Swaminathan (gs4t@virginia.edu) + + * cp-pt.c (begin_template_parm_list): pushdecl here so that we + can push TEMPLATE PARAMETERS as type names. + (process_template_parm): build_lang_decl for TEMPLATE + PARAMETERS here. + (grok_template_type): New function. get the actual type of a + TEMPLATE PARAMETER. + (coerce_template_parms): delete pushdecl as it is moved (see + above). Don't build type decls for TEMPLATE PARAMETERS as it is + built above. + + Mon Nov 15 12:04:47 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-decl.c (duplicate_decls): If a function has been declared with + explicit language linkage, redeclaring (or defining) it without + is OK. + + Fri Nov 12 15:30:27 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-lex.c (operator_name_string): Fix handling of __ad__foo. + + * cp-error.c (dump_decl): Handle demangling of vtable names. + + * cp-tree.c (lang_printable_name): Pass everything to decl_as_string, + not just functions. + + * cp-decl2.c (check_classfn): Use cp_error. + + * cp-error.c (dump_decl): Fix IDENTIFIER_TYPENAME_P case. + + * cp-method.c (build_decl_overload): Propagate IDENTIFIER_OPNAME_P + to mangled identifier. + + * cp-type2.c (my_friendly_abort): Add "confusion" message for + abort after earlier errors. + + Wed Nov 10 18:39:17 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-decl2.c (lang_decode_option): Include warn_enum_clash among + -Wall. + + Wed Nov 10 16:18:19 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * Makefile.in (stamp-cp-parse): Update counts. + + Wed Nov 10 15:27:12 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-errfn.c (cp_thing): Allow cp_*_at to use an arbitrary argument, + not just the first, by using, for instance, `%+D'. + + Mon Nov 8 13:50:49 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-error.c (language_as_string): New function for printing language + context. Corresponds to %L. + + Mon Nov 8 10:39:28 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-pt.c (reinit_parse_for_template): Use inline_text_obstack + instead of permanent_obstack so that yylex() doesn't clobber the + growing object. + + * cp-lex.c (reinit_parse_for_block): Overhaul to reduce code size by + half and make #line directives in template definitions work. + + Sun Nov 7 15:19:28 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-pt.c (instantiate_class_template): if (!setup_parse), don't + mess with lineno and input_filename. + + Mon Nov 1 18:15:59 1993 Kung Hsu (kung@cirdan.cygnus.com) + + * cp-cvt.c(convert_to_reference): Fix when pass ref to array as + initializer, the argument type is convert to pointer and the type + in the field of the class should also convert to pointer. + + Fri Nov 5 11:57:41 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-pt.c (instantiate_template): Work properly with + -fexternal-templates. + + * cp-lex.c (extract_interface_info): #if 0 out earlier + tinst_level work pending further work. + + Fri Nov 5 07:39:00 1993 Michael Tiemann (tiemann@blues.cygnus.com) + + * cp-search.c (compute_visibility): Don't lose access to public + members from base classes of base classes. + + * cp-typeck.c (convert_for_assignment): Allocate enough space in + LHSBUF for the null terminiator. + + Tue Nov 2 07:20:03 1993 Michael Tiemann (tiemann@blues.cygnus.com) + + * cp-decl2.c (build_push_scope): Don't push the scope for + ptr-to-method declarations. Also, clarify some comments. + + * cp-parse.y (abs_member_declarator): Add `see_typename' epsilon + rule so that parser can recognize ptr-to-member functions. + + Mon Nov 1 18:15:59 1993 Kung Hsu (kung@cirdan.cygnus.com) + + * cp-cvt.c(convert_to_reference): Fix when pass ref to array as + initializer, the argument type is convert to pointer and the type + in the field of the class should also convert to pointer. + + Mon Nov 1 11:06:39 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-errfn.c: Don't include . + Don't use the return value of strcpy. + + Sun Oct 31 22:32:05 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-call.c (build_scoped_method_call): Return (void)0 if trying to + call a nonexistent destructor. + + * cp-parse.y (object): Support p.~int(). + + * cp-error.c (dump_expr): Handle error_mark_node better. + + Sat Oct 30 21:49:00 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-parse.y (primary): Support p->~int(). + + Fri Oct 29 18:09:12 1993 Mike Stump (mrs@cygnus.com) + + * cp-type2.c (build_functional_cast): Don't delete things twice. + + Thu Oct 28 15:35:55 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-tree.h (struct tinst_level): The template instantiation level + structure. Used by the code described below. + + * cp-pt.c (push_tinst_level): New function for remembering file + context when instantiating templates. Stores the identifier as well, + for error reporting. + (pop_tinst_level): Da opposite. + (tinst_for_decl): Returns a pointer to the tinst_level structure to + use for determining which file to associate the current DECL with, or + NULL to use the current file and line. To restore the old behavior, + just change this function to "return 0;". + (instantiate_class_template): push_tinst_level. + + * cp-parse.y (tmplate_instantiate_once): pop_tinst_level() after + instantiating member templates. + + * cp-lex.c (extract_interface_info): If instantiating a template, + set up interface/implementation according to the spot in the user's + code that triggered the instantiation. + + * cp-pt.c (tsubst): Associate the FUNCTION_DECL with the spot in the + user's code that triggered the instantiation. *Currently disabled* + + * cp-class.c (finish_struct): If we're instantiating a template, + associate the TYPE_DECL with the spot in the user's code that + triggered the instantiation. *Currently disabled* + + * cp-pt.c (coerce_template_parms): Do extra checking on the template + parms, since templates are more picky than initializers. + + Wed Oct 27 17:06:54 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-parse.y (datadef): Don't override a template with a forward + declaration of a template class. + + Tue Oct 26 17:54:12 1993 Kung Hsu (kung@cirdan.cygnus.com) + + * cp-parse.y (component-declarator0): fix bit field name same as type + name syntax error. + + Tue Oct 26 16:07:29 1993 Mike Stump (mrs@cygnus.com) + + * cp-cvt.c (build_up_reference): Fix typo, fixes core dump on bad + code. + + Tue Oct 26 11:52:09 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-error.c (dump_function_decl): Only print default arguments + if verbose. + (dump_type): Ditto. + + Mon Oct 25 22:18:05 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * cp-typeck.c (c_sizeof, build_c_cast): Re-enable Salzenberg's + July 10 change (set TREE_OVERFLOW as well as TREE_CONSTANT_OVERFLOW). + + Mon Oct 25 18:53:08 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-pt.c (instantiate_class_template): Don't do the + push_template_decls thang if !setup_parse; the binding level + never gets popped. + + Mon Oct 25 11:54:34 1993 Kung Hsu (kung@cirdan.cygnus.com) + + * cp-method.c (hack_identifier): fix seg fault when an + external variable does not have class context. + + Sun Oct 24 19:01:15 1993 Michael Tiemann (tiemann@blues.cygnus.com) + + * cp-spew.c (scan_tokens): Test for ';' in first pre-scan of the + tokens. + + Fri Oct 22 23:46:17 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-tree.c (get_decl_list): When consing up CLASSTYPE_ID_AS_LIST, + don't assume that `value' is a reasonable identifier to use. + (list_hash_lookup_or_cons): Ditto. + + * cp-error.c (dump_decl, CONST_DECL): Pass off non-enum cases to + dump_expr. + (dump_expr): Pass off DECLs to dump_decl. + + Fri Oct 22 20:57:46 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * cp-errfn.c (STRDUP): Change to comma expr for bdmaged cc's. + (cp_thing): Add decl for ap, initialize fmt later. + + Fri Oct 22 17:15:01 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-error.c (dump_decl): Handle CONST_DECLs for enum tags. + + * cp-type2.c (my_friendly_abort): Move abortcount to global level. + + * cp-search.c (dfs_pushdecls): Be more helpful in shadowing warning. + + * cp-pt.c (mangle_class_name_for_template): If the last template + parameter was also a template class, insert a space so that + the mangled name can be used as input for the compiler (i.e. + with default_copy_constructor_body). + + Fri Oct 22 16:40:27 1993 Mike Stump (mrs@cygnus.com) + + Handle constructors in templates better. + + * cp-call.c (build_method_call): Use constructor_name_full instead + of constructor_name. + * cp-cvt.c (convert_to_reference, convert, build_type_conversion_1, + build_type_conversion): Ditto. + * cp-decl.c (make_temporary_for_reference, grok_reference_init): + Ditto. + * cp-init.c (expand_default_init, expand_aggr_init_1, build_new): + Ditto. + * cp-typeck.c (build_modify_expr_1, convert_for_initialization): + Ditto. + * cp-search.c (lookup_field, lookup_fnfields): Check for short + constructor name, as that is how we store it. + * cp-decl2.c (constructor_name_full): New routine. + * cp-tree.h (constructor_name_full): Declare it. + * cp-call.c (build_method_call): Check for either short or the full + constructor name. + + Wed Oct 20 17:17:37 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-tree.h: Declare code_as_string. + + * cp-error.c (code_as_string): New function, translates + enum tree_code into a string. Very incomplete at the moment. + + * cp-decl.c (lookup_tag): Use cp_error more. + + Tue Oct 19 16:39:20 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-error.c (dump_type_prefix): Do the prefix/suffix thang for + ARRAY_TYPE nodes. + + Thu Oct 14 23:56:34 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-gc.c (build_dynamic_cast): Avoid doing runtime work if possible. + (build_typeid): Add logic. + + Thu Oct 14 10:56:43 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-gc.c (build_typeid): New function, allegedly returns the + Type_info object for the type of an expression, currently does + nothing. + (get_typeid): New function, allegedly returns the Type_info object + for a _TYPE node, currently does nothing. + (build_dynamic_cast): New function, supposedly implements + run-time checked casting, currently only does what can be done + at compile time. + + * cp-parse.y (.kindof_pushlevel): Only push first decl (the variable). + (primary): Add dynamic_cast and typeid expressions. + (simple_if): Use partially_scoped_stmt again. + Makes 'if' condition work. + + * cp-error.c (expr_as_string): Suppress parens on initial call + to dump_expr. + + * cp-tree.h: Add decls for Type_info_type_node, build_typeid, + get_typeid and build_dynamic_cast. + + * gplus.gperf: Add typeid and dynamic_cast. + + * cp-spew.c (init_spew): Ditto. + + Wed Oct 13 19:15:21 1993 Jason Merrill (jason@deneb.cygnus.com) + + Partial implementation of Stroustrup's proposal for declarations in + conditions from X3J16/92-0121. + + * cp-parse.y (paren_cond_or_null): New rule, use condition instead + of expr. + (xcond): Ditto. + (condition): New rule, used in the condition parts of if, while, for + and switch statements. Allows a restricted set of declarations of + the form "type_specifier declarator = expression". + (.kindof_pushlevel): Like pushlevel, but pushes all of the decls + from the previous binding level into the new one too. + (partially_scoped_stmt): Like implicitly_scoped_stmt, but uses + .kindof_pushlevel instead of .pushlevel. + (simple_if): .pushlevel before condition. + (simple_stmt, simple_if ELSE): Ditto, pop binding level. + (simple_stmt, simple_if): Ditto. + (simple_stmt, WHILE): Ditto. + (simple_stmt, forhead.1): .pushlevel before condition, use xcond + instead of xexpr, pop binding level. + (simple_stmt, forhead.2): Use xcond instead of xexpr, always pop + binding level. + (simple_stmt, SWITCH): .pushlevel before condition, etc, etc. + (forhead.2): always .pushlevel. + (datadef): Use cp_error more. + (simple_stmt, CASE): Ditto. + + * cp-decl2.c (pushdecls): New function, push all decls in the chain + into the current scope. + + Wed Oct 13 12:31:58 1993 Mike Stump (mrs@cygnus.com) + + * cp-decl.c: Remove redefinition of NULL, as some machines don't + like it. Clean up all NULL uses. + + Mon Oct 11 17:21:08 1993 Kung Hsu (kung@cirdan.cygnus.com) + + * cp-decl2.c (finish_file): Fix libg++ build problem of mismatch + blocks. + + Mon Oct 11 13:51:05 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + Mon Oct 4 11:49:48 1993 Chip Salzenberg (chip@fin.uucp) + + * cp-typeck.c (build_modify_expr): Check whether recursive calls + return error_mark_node. + + Mon Oct 4 12:41:16 1993 Chip Salzenberg (chip@fin.uucp) + + * cp-class.c (finish_struct): Too-long bitfield is an error. + * cp-decl.c (grokdeclarator): "inline main()" is an error. + (grok_op_properties): Overloaded ?: is an error. + (start_enum): Duplicate enum definition is an error. + + Mon Oct 4 12:45:11 1993 Chip Salzenberg (chip@fin.uucp) + + * cp-typeck.c (common_type): Use TYPE_MAIN_VARIANT when preferring + long int to int (when width is the same). + + Mon Oct 4 12:46:54 1993 Chip Salzenberg (chip@fin.uucp) + + * cp-typeck.c (convert_for_assignment): Mismatch in signedness + of pointer targets should not inhibit warnings for const mismatch. + + Mon Oct 4 12:53:04 1993 Chip Salzenberg (chip@fin.uucp) + + * cp-typeck.c (default_conversion): Convert to unsigned int + if original type is unsigned and of greater or equal size. + + Mon Oct 11 13:19:42 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-decl.c (build_enumerator): Call default_conversion on the VALUE + before calling constant_expression_warning. + + Mon Oct 11 10:21:37 1993 Kung Hsu (kung@cirdan.cygnus.com) + + * cp-decl.c (finish_function): fix the mismatch LBB LBE block + problem, specifically when compiler generated + destructor/constructor (pr2972) + * cp-decl2.c (finish_file): same as above + * cp-parse.y (compstmt): same as above + + Mon Oct 11 01:08:09 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-error.c (dump_type_suffix): Cope with arrays with unspecified + bounds. + + Thu Oct 7 19:35:26 1993 Jason Merrill (jason@deneb.cygnus.com) + + * cp-error.c: Deal with printing out array DECLs properly. + Use dump_char for printing out string literals, too. + + Tue Nov 23 18:08:27 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * dwarfout.c (function_start_label): New function. + (output_entry_point_die): Use it. + (output_global_subroutine_die, output_local_subroutine_die): Use it. + + * c-common.c (check_format_info): Always use TYPE_MAIN_VARIANT + when comparing cur_type against wanted_type. + + * protoize.c (save_def_or_dec): If function's aux info doesn't end + with a closeparen, ignore it. + (xmalloc, xrealloc): Cast result of malloc. + + * c-typeck.c (build_binary_op): Don't accept complex types + for max, min, lt, etc. + + Tue Nov 23 18:05:14 1993 Lisa Repka (lisa@MicroUnity.com) + + * reorg.c (rare_destination): Ensure we always correctly handle + a null JUMP_LABEL. + + Tue Nov 23 17:48:39 1993 Doug Evans (dje@canuck.cygnus.com) + + * i960/i960.h (ASM_SPEC): Pass -linkrelax, not -link-relax. + + Tue Nov 23 17:35:25 1993 Richard Earnshaw (rwe11@cl.cam.ac.uk) + + * arm.c (arm_backwards_branch): Branching to the current insn is a + backwards branch. + + Tue Nov 23 13:59:24 1993 Hallvard B Furuseth (hbf@durin.uio.no) + + * libgcc2.a (__bb_exit_func): Fix format %*d -> %*ld. + + * c-parse.in, cp-parse.y (maybe_type_qual): Don't fail to set $$. + + Tue Nov 23 15:26:28 1993 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * combine.c (try_combine, simplify_shift_const): Add initializations + for some uninitialized variables. + + * c-common.c (check_format_info): When we have INTEGER_TYPEs, + save result of signed_type or unsigned_type for later + comparison with the various forms of char types. + + * expr.c (expand_expr, case SAVE_EXPR): Properly recompute the + value of UNSIGNEDP when SAVE_EXPR_RTL is nonzero and we have promoted. + + Tue Nov 23 04:14:04 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * dwarfout.c (output_local_subroutine_die): Use the function name + from its symbol_ref, not DECL_ASSEMBLER_NAME. + + Mon Nov 22 13:59:41 1993 Steve Chamberlain (sac@mole.gnu.ai.mit.edu) + + * final.c (get_attr_length): asm_insn_count takes a body, not an + insn. + + Sun Nov 21 22:37:12 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * config/m68k/mot3300.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): + Use SIZE, not ROUNDED. + (FUNCTION_PROLOGUE, FUNCTION_EPILOGUE): Definitions turned off. + (REGISTER_PREFIX, IMMEDIATE_PREFIX): New definitions. + (PARM_BOUNDARY): New definition. + + Sun Nov 21 15:39:04 1993 Tor Egge (tegge@pvv.unit.no) + + * m88k/dolph.h (SDB_ALLOW_FORWARD_REFERENCES): Define. + (SDB_ALLOW_UNKNOWN_REFERENCES): Define. + (CPP_PREDEFINES): Redefine. + (CPP_DEFAULT): Redefine. + (INITIALIZE_TRAMPOLINE): Redefine. + * m88k/dolphin.ld: New file. + * m88k/t-m88k (realclean): Remove some generated .asm files. + * m88k/x-dolph (EXTRA_PARTS): Redefined to also contain gcc.ld. + (gcc.ld): Copied from dolphin.ld. + (X_CFLAGS): Define __m88k__. + * libgcc2.c (__enable_execute_stack): Add DolphinOS version. + + Sun Nov 21 01:00:40 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * config/m68k/isi.h (LIB_SPEC): Use -lm in addition to -lc-- + not instead of -lc. + + * fix-header.c (write_rbrac): Make added declarations conditional + on __cplusplus and nothing else. + * fixproto (stdio.h): Reenable adding protos for v*printf. + + * sys-protos.h (authdes_create): Delete arg info. + We can't count on having struct sockaddr defined. + + * fixincludes (math.h): When deleting inline sqrt and abs, + be flexible about arg name and function body. + + * Makefile.in (stmp-fixproto): Never run fixproto twice. + + Sat Nov 20 16:52:15 1993 Jim Wilson (wilson@cygnus.com) + + * stmt.c (warn_if_unused_value): Handle arbitrary number of casts + before a modify. + + Sat Nov 20 16:38:25 1993 Eric Baur (eric@synnet.com) + + * i386/perform.h (perform_divsi3, perform_modsi3): Add '&' in + constraint for DX; explicitly copy arg arg1 to cx. + + Sat Nov 20 02:26:28 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * expr.c (expand_builtin): For sin, cos, fsqrt, alloca, ffs, strlen, + strcpy, memcpy, strcmp, memcmp, if args are bad, use expand_call. + + * fix-header.c (write_rbrac): Treat rewinddir like memmove. + + Fri Nov 19 18:24:43 1993 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * protoize.c: Remove declarations for malloc and realloc. + + * expr.c (store_field): Convert EXP to MODE before calling + store_bit_field. + + * optabs.c (expand_complex_abs): Replace some erroneous + uses of MODE with SUBMODE. + + * combine.c (force_to_mode): Don't allow sign-extension of + constants when we are narrowing things in an IOR or XOR. + + Fri Nov 19 16:42:43 1993 Jim Wilson (wilson@cygnus.com) + + * rs6000.c (output_function_profiler): When TARGET_MINIMAL_TOC, + emit .long instead of .tc. + + Fri Nov 19 13:22:37 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure: Let a host set truncate_target to specify that the + installation directory names must be truncated to 14 characters. + If set, truncate the target argument. + + Fri Nov 19 17:27:58 1993 Holger Teutsch (holger@hotbso.rhein-main.de) + + * clipper.h (HARD_REGNO_MODE_OK): Allow any mode in general regs. + Float regs may only hold SFmode and DFmode. + (FUNCTION_ARG): Only MODE_INT and MODE_FLOAT with size <= 8 are + passed in registers. + (FUNCTION_ARG_ADVANCE): Update accordingly. + (FUNCTION_ARG_PARTIAL_NREG): Undefine. + + * clipper.md (movsf+1,2,movdf+1,2): Make 'f' preferred register class. + + Thu Nov 18 20:09:56 1993 Jim Wilson (wilson@sphagnum.cygnus.com) + + * fixincludes: When compute DOTS, convert /./ to / to avoid + accidentally converting it to /../. + * fixinc.dgux, fixinc.svr4: Likewise. + + Thu Nov 18 06:14:55 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * function.c (expand_function_end): New arg END_BINDINGS. + * c-decl.c (finish_function): Pass new arg to expand_function_end. + * cp-decl.c (finish_function): Pass new arg to expand_function_end. + Don't call expand_end_bindings here. + * integrate.c (output_inline_function): + Pass new arg to expand_function_end. + + Wed Nov 17 18:54:21 1993 Chip Salzenberg (chip@fin.uucp) + + * objc/objects.c: Include "tconfig.h" before "runtime.h". + + Wed Nov 17 19:15:31 1993 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * fixincludes (math.h): Add missing quoting of `*' when fixing + prototype of `sqr'. + + Tue Nov 16 07:15:52 1993 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * alpha.h (EXTRA_CONSTRAINT): New macro. + (SECONDARY_{INPUT,OUTPUT}_RELOAD_CLASS): Disallow unaligned into float + regs. + * alpha.md (movdi): Use 'Q' instead of 'm' for FP. + Tue Nov 16 02:06:01 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/INSTALL gcc-2.5.5/INSTALL *** gcc-2.5.4/INSTALL Mon Nov 15 05:40:44 1993 --- gcc-2.5.5/INSTALL Sat Nov 27 14:47:57 1993 *************** *** 215,218 **** --- 215,221 ---- currently supported by GNU CC.) + Objective C and C++ do not yet work on the Alpha. We hope to + support C++ in version 2.6. + GNU CC writes a `.verstamp' directive to the assembler output file unless it is built as a cross-compiler. It gets the *************** *** 232,240 **** `make compare' may fail on some versions of OSF/1 unless you ! add `-save-temps' to `CFLAGS'. This forces a fixed name to ! be used for the assembler input file instead of a random name ! in `/tmp'. The name of the assembler input file is stored in ! the object file and will cause miscompared if it differs ! between the `stage1' and `stage2' compilations. GNU CC now supports both the native (ECOFF) debugging format --- 235,245 ---- `make compare' may fail on some versions of OSF/1 unless you ! add `-save-temps' to `CFLAGS'. The same problem occurs on ! Irix version 5.1.1. On these systems, the name of the ! assembler input file is stored in the object file, and that ! makes comparison fail if it differs between the `stage1' and ! `stage2' compilations. The option `-save-temps' forces a ! fixed name to be used for the assembler input file, instead ! of a randomly chosen name in `/tmp'. GNU CC now supports both the native (ECOFF) debugging format *************** *** 453,456 **** --- 458,463 ---- have not been extensively tested due to lack of appropriate systems. Only AIX is supported on the PowerPC. + + Objective C does not work on this architecture. XLC version 1.3.0.0 will miscompile `jump.c'. XLC version diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/Makefile.in gcc-2.5.5/Makefile.in *** gcc-2.5.4/Makefile.in Tue Nov 16 05:33:54 1993 --- gcc-2.5.5/Makefile.in Thu Nov 25 18:08:52 1993 *************** *** 836,840 **** $(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y ! @echo expect 29 shift/reduce conflicts and 13 reduce/reduce conflicts cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y cd $(srcdir); grep '^#define[ ]*YYEMPTY' cp-parse.c >>cp-parse.h --- 836,840 ---- $(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y ! @echo expect 27 shift/reduce conflicts and 14 reduce/reduce conflicts cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y cd $(srcdir); grep '^#define[ ]*YYEMPTY' cp-parse.c >>cp-parse.h *************** *** 967,973 **** insn-config.h reload.h output.h defaults.h xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h ! emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) flags.h gvarargs.h function.h \ ! regs.h insn-config.h insn-codes.h real.h expr.h bytecode.h bc-opcode.h \ ! bc-typecd.h bc-typecd.def bc-optab.h bc-emit.h bc-opname.h real.o : real.c $(CONFIG_H) $(TREE_H) getpwd.o : getpwd.c $(CONFIG_H) --- 967,973 ---- insn-config.h reload.h output.h defaults.h xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h ! emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h gvarargs.h \ ! function.h regs.h insn-config.h insn-codes.h real.h expr.h bytecode.h \ ! bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h bc-emit.h bc-opname.h real.o : real.c $(CONFIG_H) $(TREE_H) getpwd.o : getpwd.c $(CONFIG_H) *************** *** 1615,1622 **** # stmp-headers is to make sure fixincludes has already finished. stmp-fixproto: fixhdr.ready fixproto stmp-headers @echo "Various warnings and error messages from fixproto are normal" ! CPP="$(GCC_FOR_TARGET) -E"; export CPP; \ ! ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR) touch stmp-fixproto --- 1615,1629 ---- # stmp-headers is to make sure fixincludes has already finished. + # The if statement is so that we don't run fixproto a second time + # if it has already been run on the files in `include'. stmp-fixproto: fixhdr.ready fixproto stmp-headers @echo "Various warnings and error messages from fixproto are normal" ! -if [ -d include ] ; then true; else mkdir include; fi ! if [ -f include/fixed ] ; then true; \ ! else \ ! CPP="$(GCC_FOR_TARGET) -E"; export CPP; \ ! ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \ ! touch include/fixed; \ ! fi touch stmp-fixproto diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/NEWS gcc-2.5.5/NEWS *** gcc-2.5.4/NEWS Sun Nov 14 07:15:07 1993 --- gcc-2.5.5/NEWS Sat Nov 27 14:47:13 1993 *************** *** 1,2 **** --- 1,8 ---- + Noteworthy change in GCC version 2.5.5: + + A large number of C++ bugs have been fixed. + + The fixproto script adds prototypes conditionally on __cplusplus. + Noteworthy change in GCC version 2.5.4: diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/README gcc-2.5.5/README *** gcc-2.5.4/README Tue Nov 16 05:35:25 1993 --- gcc-2.5.5/README Sat Nov 27 14:48:01 1993 *************** *** 1,3 **** ! This directory contains the version 2.5.4 release of the GNU C compiler. It includes all of the support for compiling C++ and Objective C, including a run-time library for Objective C. --- 1,3 ---- ! This directory contains the version 2.5.5 release of the GNU C compiler. It includes all of the support for compiling C++ and Objective C, including a run-time library for Objective C. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/c-common.c gcc-2.5.5/c-common.c *** gcc-2.5.4/c-common.c Thu Nov 11 05:00:40 1993 --- gcc-2.5.5/c-common.c Wed Nov 24 18:14:02 1993 *************** *** 900,912 **** /* Don't warn about differences merely in signedness. */ && !(TREE_CODE (wanted_type) == INTEGER_TYPE ! && TREE_CODE (cur_type) == INTEGER_TYPE && (TREE_UNSIGNED (wanted_type) ! ? wanted_type == unsigned_type (cur_type) ! : wanted_type == signed_type (cur_type))) /* Likewise, "signed char", "unsigned char" and "char" are equivalent but the above test won't consider them equivalent. */ && ! (wanted_type == char_type_node ! && (cur_type == signed_char_type_node ! || cur_type == unsigned_char_type_node))) { register char *this; --- 900,912 ---- /* Don't warn about differences merely in signedness. */ && !(TREE_CODE (wanted_type) == INTEGER_TYPE ! && TREE_CODE (TYPE_MAIN_VARIANT (cur_type)) == INTEGER_TYPE && (TREE_UNSIGNED (wanted_type) ! ? wanted_type == (cur_type = unsigned_type (cur_type)) ! : wanted_type == (cur_type = signed_type (cur_type)))) /* Likewise, "signed char", "unsigned char" and "char" are equivalent but the above test won't consider them equivalent. */ && ! (wanted_type == char_type_node ! && (TYPE_MAIN_VARIANT (cur_type) == signed_char_type_node ! || TYPE_MAIN_VARIANT (cur_type) == unsigned_char_type_node))) { register char *this; *************** *** 1459,1463 **** } ! if (!max_gt && !unsignedp0 && TREE_CODE (primop1) != INTEGER_CST) { /* This is the case of (char)x >?< 0x80, which people used to use --- 1459,1463 ---- } ! if (!max_gt && !unsignedp0 && TREE_CODE (primop0) != INTEGER_CST) { /* This is the case of (char)x >?< 0x80, which people used to use *************** *** 1469,1473 **** } ! if (!min_lt && unsignedp0 && TREE_CODE (primop1) != INTEGER_CST) { /* This is the case of (unsigned char)x >?< -1 or < 0. */ --- 1469,1473 ---- } ! if (!min_lt && unsignedp0 && TREE_CODE (primop0) != INTEGER_CST) { /* This is the case of (unsigned char)x >?< -1 or < 0. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/c-decl.c gcc-2.5.5/c-decl.c *** gcc-2.5.4/c-decl.c Thu Nov 4 14:39:20 1993 --- gcc-2.5.5/c-decl.c Tue Nov 23 01:20:10 1993 *************** *** 6451,6455 **** /* Generate rtl for function exit. */ ! expand_function_end (input_filename, lineno); /* So we can tell if jump_optimize sets it to 1. */ --- 6451,6455 ---- /* Generate rtl for function exit. */ ! expand_function_end (input_filename, lineno, 0); /* So we can tell if jump_optimize sets it to 1. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/c-parse.in gcc-2.5.5/c-parse.in *** gcc-2.5.4/c-parse.in Thu Oct 28 21:29:39 1993 --- gcc-2.5.5/c-parse.in Tue Nov 23 16:54:46 1993 *************** *** 1977,1981 **** maybe_type_qual: /* empty */ ! { emit_line_note (input_filename, lineno); } | TYPE_QUAL { emit_line_note (input_filename, lineno); } --- 1977,1982 ---- maybe_type_qual: /* empty */ ! { emit_line_note (input_filename, lineno); ! $$ = NULL_TREE; } | TYPE_QUAL { emit_line_note (input_filename, lineno); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/c-typeck.c gcc-2.5.5/c-typeck.c *** gcc-2.5.4/c-typeck.c Tue Nov 16 08:38:24 1993 --- gcc-2.5.5/c-typeck.c Sat Nov 27 06:19:47 1993 *************** *** 2170,2177 **** case MAX_EXPR: case MIN_EXPR: ! if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE ! || code0 == COMPLEX_TYPE) ! && (code1 == INTEGER_TYPE || code1 == REAL_TYPE ! || code1 == COMPLEX_TYPE)) shorten = 1; else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) --- 2170,2175 ---- case MAX_EXPR: case MIN_EXPR: ! if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE) ! && (code1 == INTEGER_TYPE || code1 == REAL_TYPE)) shorten = 1; else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) *************** *** 2190,2197 **** case LT_EXPR: case GT_EXPR: ! if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE ! || code0 == COMPLEX_TYPE) ! && (code1 == INTEGER_TYPE || code1 == REAL_TYPE ! || code1 == COMPLEX_TYPE)) short_compare = 1; else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) --- 2188,2193 ---- case LT_EXPR: case GT_EXPR: ! if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE) ! && (code1 == INTEGER_TYPE || code1 == REAL_TYPE)) short_compare = 1; else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) *************** *** 5240,5243 **** --- 5236,5240 ---- { int failure; + int momentary_p; push_obstacks_nochange (); *************** *** 5245,5248 **** --- 5242,5247 ---- end_temporary_allocation (); + momentary_p = suspend_momentary (); + /* We shouldn't have an incomplete array type within some other type. */ *************** *** 5257,5260 **** --- 5256,5260 ---- size = int_size_in_bytes (constructor_type); + resume_momentary (momentary_p); pop_obstacks (); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/combine.c gcc-2.5.5/combine.c *** gcc-2.5.4/combine.c Tue Nov 16 02:07:52 1993 --- gcc-2.5.5/combine.c Tue Nov 23 17:40:46 1993 *************** *** 1163,1167 **** rtx i2pat; /* Indicates if I2DEST or I1DEST is in I2SRC or I1_SRC. */ ! int i2dest_in_i2src, i1dest_in_i1src = 0, i2dest_in_i1src = 0; int i1_feeds_i3 = 0; /* Notes that must be added to REG_NOTES in I3 and I2. */ --- 1163,1167 ---- rtx i2pat; /* Indicates if I2DEST or I1DEST is in I2SRC or I1_SRC. */ ! int i2dest_in_i2src = 0, i1dest_in_i1src = 0, i2dest_in_i1src = 0; int i1_feeds_i3 = 0; /* Notes that must be added to REG_NOTES in I3 and I2. */ *************** *** 1263,1267 **** subst_low_cuid = INSN_CUID (i2); ! added_sets_2 = 0; i2dest = SET_SRC (PATTERN (i3)); --- 1263,1267 ---- subst_low_cuid = INSN_CUID (i2); ! added_sets_2 = added_sets_1 = 0; i2dest = SET_SRC (PATTERN (i3)); *************** *** 5791,5794 **** --- 5791,5802 ---- mode, mask, reg)); + /* If OP1 is a CONST_INT and X is an IOR or XOR, clear bits outside + MASK since OP1 might have been sign-extended but we never want + to turn on extra bits, since combine might have previously relied + on them being off. */ + if (GET_CODE (op1) == CONST_INT && (code == IOR || code == XOR) + && (INTVAL (op1) & mask) != 0) + op1 = GEN_INT (INTVAL (op1) & mask); + if (op_mode != GET_MODE (x) || op0 != XEXP (x, 0) || op1 != XEXP (x, 1)) x = gen_binary (code, op_mode, op0, op1); *************** *** 7250,7254 **** /* We form (outer_op (code varop count) (outer_const)). */ enum rtx_code outer_op = NIL; ! HOST_WIDE_INT outer_const; rtx const_rtx; int complement_p = 0; --- 7258,7262 ---- /* We form (outer_op (code varop count) (outer_const)). */ enum rtx_code outer_op = NIL; ! HOST_WIDE_INT outer_const = 0; rtx const_rtx; int complement_p = 0; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/alpha/alpha.h gcc-2.5.5/config/alpha/alpha.h *** gcc-2.5.4/config/alpha/alpha.h Sat Nov 13 22:56:00 1993 --- gcc-2.5.5/config/alpha/alpha.h Tue Nov 16 07:13:33 1993 *************** *** 502,505 **** --- 502,514 ---- : 0) + /* Optional extra constraints for this machine. + + For the Alpha, `Q' means that this is a memory operand but not a + reference to an unaligned location. */ + + #define EXTRA_CONSTRAINT(OP, C) \ + ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) != AND \ + : 0) + /* Given an rtx X being reloaded into a reg required to be in class CLASS, return the class of reg to actually use. *************** *** 517,521 **** /* Loading and storing HImode or QImode values to and from memory usually requires a scratch register. The exceptions are loading ! QImode and HImode from an aligned address to a general register. */ #define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,IN) \ --- 526,531 ---- /* Loading and storing HImode or QImode values to and from memory usually requires a scratch register. The exceptions are loading ! QImode and HImode from an aligned address to a general register. ! We also cannot load an unaligned address into an FP register. */ #define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,IN) \ *************** *** 530,534 **** || (((MODE) == QImode || (MODE) == HImode) \ && unaligned_memory_operand (IN, MODE)))) \ ! ? GENERAL_REGS : NO_REGS) #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS,MODE,OUT) \ --- 540,547 ---- || (((MODE) == QImode || (MODE) == HImode) \ && unaligned_memory_operand (IN, MODE)))) \ ! ? GENERAL_REGS \ ! : ((CLASS) == FLOAT_REGS && GET_CODE (IN) == MEM \ ! && GET_CODE (XEXP (IN, 0)) == AND) ? GENERAL_REGS \ ! : NO_REGS) #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS,MODE,OUT) \ *************** *** 541,545 **** && (((MODE) == HImode || (MODE) == QImode \ || ((MODE) == SImode && (CLASS) == FLOAT_REGS)))) \ ! ? GENERAL_REGS : NO_REGS) /* If we are copying between general and FP registers, we need a memory --- 554,561 ---- && (((MODE) == HImode || (MODE) == QImode \ || ((MODE) == SImode && (CLASS) == FLOAT_REGS)))) \ ! ? GENERAL_REGS \ ! : ((CLASS) == FLOAT_REGS && GET_CODE (OUT) == MEM \ ! && GET_CODE (XEXP (OUT, 0)) == AND) ? GENERAL_REGS \ ! : NO_REGS) /* If we are copying between general and FP registers, we need a memory diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/alpha/alpha.md gcc-2.5.5/config/alpha/alpha.md *** gcc-2.5.4/config/alpha/alpha.md Sat Nov 13 22:29:05 1993 --- gcc-2.5.5/config/alpha/alpha.md Tue Nov 16 07:13:41 1993 *************** *** 2615,2620 **** (define_insn "" ! [(set (match_operand:DI 0 "general_operand" "=r,r,r,r,r,r,r,m,f,f,f,m") ! (match_operand:DI 1 "input_operand" "r,J,I,K,L,s,m,rJ,f,J,m,fG"))] "register_operand (operands[0], DImode) || reg_or_0_operand (operands[1], DImode)" --- 2615,2620 ---- (define_insn "" ! [(set (match_operand:DI 0 "general_operand" "=r,r,r,r,r,r,r,m,f,f,f,Q") ! (match_operand:DI 1 "input_operand" "r,J,I,K,L,s,m,rJ,f,J,Q,fG"))] "register_operand (operands[0], DImode) || reg_or_0_operand (operands[1], DImode)" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/arm/arm.c gcc-2.5.5/config/arm/arm.c *** gcc-2.5.4/config/arm/arm.c Fri Nov 12 08:51:52 1993 --- gcc-2.5.5/config/arm/arm.c Tue Nov 23 17:34:20 1993 *************** *** 789,793 **** int from, to; { ! return (insn_addresses[to] < insn_addresses[from]); } --- 789,793 ---- int from, to; { ! return (insn_addresses[to] <= insn_addresses[from]); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/clipper/clipper.h gcc-2.5.5/config/clipper/clipper.h *** gcc-2.5.4/config/clipper/clipper.h Sat Sep 25 08:17:34 1993 --- gcc-2.5.5/config/clipper/clipper.h Fri Nov 19 16:05:37 1993 *************** *** 197,200 **** --- 197,201 ---- []') after they have been initialized from the two preceding macros. A C400 has additional floating registers f8 -> f15 */ + #define CONDITIONAL_REGISTER_USAGE \ if (target_flags & TARGET_C400) \ *************** *** 212,224 **** : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) - /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. ! On the clipper, 0-15 hold int, 16-31 hold float. DImode regs must be ! even */ ! #define HARD_REGNO_MODE_OK(REGNO, MODE) \ ! ((GET_MODE_CLASS(MODE) == MODE_FLOAT) \ ! ? (REGNO) >= 16 \ ! : (REGNO) < 16 && ((MODE) !=DImode || ((REGNO) & 1) == 0)) /* Value is 1 if it is a good idea to tie two pseudo registers --- 213,224 ---- : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. ! On the clipper 0-15 may hold any mode but DImode and DFmode must be even. ! Registers 16-31 hold SFmode and DFmode */ ! #define HARD_REGNO_MODE_OK(REGNO, MODE) \ ! ((REGNO) < 16 \ ! ? ((MODE) != DImode && (MODE) != DFmode || ((REGNO) & 1) == 0) \ ! : ((MODE) == SFmode || (MODE) == DFmode)) /* Value is 1 if it is a good idea to tie two pseudo registers *************** *** 483,500 **** (TYPE is null for libcalls where that information may not be available.) */ ! #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ ! do \ ! { \ ! if ((CUM).num == 0 && (MODE) == DImode) \ ! (CUM).num = 2; \ ! else \ ! (CUM).num++; \ ! if ((CUM).num > 2 || (MODE) == BLKmode) \ ! { \ ! int align = FUNCTION_ARG_BOUNDARY (MODE, TYPE) / BITS_PER_UNIT; \ ! (CUM).size += align - 1; \ ! (CUM).size &= align - 1; \ ! (CUM).size += CLIPPER_ARG_SIZE (MODE, TYPE); \ ! } \ } while (0) --- 483,510 ---- (TYPE is null for libcalls where that information may not be available.) */ ! #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ ! do \ ! { \ ! int reg = 0; \ ! \ ! if ((CUM).num < 2 \ ! && (GET_MODE_CLASS(MODE)==MODE_INT || GET_MODE_CLASS(MODE)==MODE_FLOAT) \ ! && (GET_MODE_SIZE (MODE) <= 8) \ ! && ((MODE) != DImode || (CUM).num == 0)) \ ! { \ ! reg = 1; \ ! if ((MODE) == DImode) \ ! (CUM).num = 1; \ ! } \ ! \ ! (CUM).num++; \ ! \ ! if (! reg) \ ! { \ ! int align = FUNCTION_ARG_BOUNDARY (MODE, TYPE) / BITS_PER_UNIT; \ ! (CUM).size += align - 1; \ ! (CUM).size &= align - 1; \ ! (CUM).size += CLIPPER_ARG_SIZE (MODE, TYPE); \ ! } \ } while (0) *************** *** 510,522 **** the preceding args and about the function being called. NAMED is nonzero if this argument is a named parameter ! (otherwise it is an extra parameter matching an ellipsis). */ ! ! /* 2 args go into regs, float in f0/f1, anything else in r0/r1 */ ! #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ ! (((CUM).num >= 2 || (MODE) == BLKmode || \ ! ((MODE) == DImode && (CUM).num)) ? 0 : \ ! gen_rtx (REG, (MODE), \ ! GET_MODE_CLASS(MODE) == MODE_FLOAT ? (CUM).num+16 : (CUM).num)) /* If defined, a C expression that gives the alignment boundary, in bits, --- 520,537 ---- the preceding args and about the function being called. NAMED is nonzero if this argument is a named parameter ! (otherwise it is an extra parameter matching an ellipsis). ! 2 args may go into regs. These must be MODE_INT or MODE_FLOAT but only ! if they really fit into ONE register. The exception is a DImode arg ! that occupies both register slots. */ ! ! #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ ! (((CUM).num < 2 \ ! && (GET_MODE_CLASS(MODE)==MODE_INT || GET_MODE_CLASS(MODE)==MODE_FLOAT) \ ! && (GET_MODE_SIZE (MODE) <= 8) \ ! && ((MODE) != DImode || (CUM).num == 0)) \ ! ? gen_rtx (REG, (MODE), \ ! GET_MODE_CLASS(MODE) == MODE_FLOAT ? (CUM).num+16 : (CUM).num) \ ! : 0) /* If defined, a C expression that gives the alignment boundary, in bits, *************** *** 530,541 **** /* For an arg passed partly in registers and partly in memory, this is the number of registers used. ! For args passed entirely in registers or entirely in memory, zero. */ ! #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0 /* Generate necessary RTL for __builtin_saveregs(). ARGLIST is the argument list; see expr.c. */ - #define EXPAND_BUILTIN_SAVEREGS(ARGLIST) clipper_builtin_saveregs (ARGLIST) /* This macro generates the assembly code for function entry. --- 545,557 ---- /* For an arg passed partly in registers and partly in memory, this is the number of registers used. ! For args passed entirely in registers or entirely in memory, zero. ! Clipper never passed args partially in regs/mem. */ ! /* #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0 */ /* Generate necessary RTL for __builtin_saveregs(). ARGLIST is the argument list; see expr.c. */ + #define EXPAND_BUILTIN_SAVEREGS(ARGLIST) clipper_builtin_saveregs (ARGLIST) /* This macro generates the assembly code for function entry. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/clipper/clipper.md gcc-2.5.5/config/clipper/clipper.md *** gcc-2.5.4/config/clipper/clipper.md Tue Oct 19 20:05:12 1993 --- gcc-2.5.5/config/clipper/clipper.md Fri Nov 19 16:05:42 1993 *************** *** 1,4 **** ;;- Machine description for GNU compiler, Clipper Version ! ;; Copyright (C) 1987, 1988, 1991 Free Software Foundation, Inc. ;; Contributed by Holger Teutsch (holger@hotbso.rhein-main.de) --- 1,4 ---- ;;- Machine description for GNU compiler, Clipper Version ! ;; Copyright (C) 1987, 1988, 1991, 1993 Free Software Foundation, Inc. ;; Contributed by Holger Teutsch (holger@hotbso.rhein-main.de) *************** *** 149,154 **** ;; (define_insn "" ! [(set (match_operand:DF 0 "register_operand" "=rf") ! (match_operand:DF 1 "nonimmediate_operand" "rfo"))] "" "* --- 149,154 ---- ;; (define_insn "" ! [(set (match_operand:DF 0 "register_operand" "=*rf") ! (match_operand:DF 1 "nonimmediate_operand" "*rfo"))] "" "* *************** *** 204,208 **** (define_insn "" [(set (match_operand:DF 0 "memory_operand" "=o,m") ! (match_operand:DF 1 "register_operand" "rf,f"))] "" "* --- 204,208 ---- (define_insn "" [(set (match_operand:DF 0 "memory_operand" "=o,m") ! (match_operand:DF 1 "register_operand" "*rf,f"))] "" "* *************** *** 248,253 **** ;; (define_insn "" ! [(set (match_operand:SF 0 "register_operand" "=rf") ! (match_operand:SF 1 "nonimmediate_operand" "rfm"))] "" "* --- 248,253 ---- ;; (define_insn "" ! [(set (match_operand:SF 0 "register_operand" "=*rf") ! (match_operand:SF 1 "nonimmediate_operand" "*rfm"))] "" "* *************** *** 285,289 **** (define_insn "" [(set (match_operand:SF 0 "memory_operand" "=m") ! (match_operand:SF 1 "register_operand" "rf"))] "" "* --- 285,289 ---- (define_insn "" [(set (match_operand:SF 0 "memory_operand" "=m") ! (match_operand:SF 1 "register_operand" "*rf"))] "" "* diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/i386/perform.h gcc-2.5.5/config/i386/perform.h *** gcc-2.5.4/config/i386/perform.h Sun Jun 27 23:43:46 1993 --- gcc-2.5.5/config/i386/perform.h Sat Nov 20 16:37:42 1993 *************** *** 1,4 **** /* Definitions for AT&T assembler syntax for the Intel 80386. ! Copyright (C) 1992 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions for AT&T assembler syntax for the Intel 80386. ! Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 42,48 **** register int dx asm("dx"); \ register int ax asm("ax"); \ \ ax = arg0; \ ! asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (arg1)); \ return ax; \ } --- 42,50 ---- register int dx asm("dx"); \ register int ax asm("ax"); \ + register int cx asm("cx"); \ \ ax = arg0; \ ! cx = arg1; \ ! asm ("cltd\n\tidivl %3" : "=a" (ax), "=&d" (dx) : "a" (ax), "c" (cx)); \ return ax; \ } *************** *** 63,69 **** register int dx asm("dx"); \ register int ax asm("ax"); \ \ ax = arg0; \ ! asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (arg1)); \ return dx; \ } --- 65,73 ---- register int dx asm("dx"); \ register int ax asm("ax"); \ + register int cx asm("cx"); \ \ ax = arg0; \ ! cx = arg1; \ ! asm ("cltd\n\tidivl %3" : "=a" (ax), "=&d" (dx) : "a" (ax), "c" (cx)); \ return dx; \ } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/i960/i960.h gcc-2.5.5/config/i960/i960.h *** gcc-2.5.4/config/i960/i960.h Mon Oct 11 07:36:03 1993 --- gcc-2.5.5/config/i960/i960.h Tue Nov 23 17:47:34 1993 *************** *** 64,68 **** %{mmc:-AMC}%{mca:-ACA}%{mcc:-ACC}%{mcf:-ACF}\ %{!mka:%{!mkb:%{!msa:%{!msb:%{!mmc:%{!mca:%{!mcc:%{!mcf:-AKB}}}}}}}}\ ! %{mlink-relax:-link-relax}" /* Specs for the linker, to handle processor variations. --- 64,68 ---- %{mmc:-AMC}%{mca:-ACA}%{mcc:-ACC}%{mcf:-ACF}\ %{!mka:%{!mkb:%{!msa:%{!msb:%{!mmc:%{!mca:%{!mcc:%{!mcf:-AKB}}}}}}}}\ ! %{mlink-relax:-linkrelax}" /* Specs for the linker, to handle processor variations. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/m68k/isi.h gcc-2.5.5/config/m68k/isi.h *** gcc-2.5.4/config/m68k/isi.h Sat Oct 2 04:20:14 1993 --- gcc-2.5.5/config/m68k/isi.h Sun Nov 21 06:24:42 1993 *************** *** 32,40 **** #define CPP_SPEC "%{!msoft-float:-D__HAVE_68881__}" ! /* If the 68881 is used, link must load libmc.a instead of libc.a */ ! #define LIB_SPEC "%{msoft-float:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}} \ ! %{!msoft-float:%{!p:%{!pg:-lmc}}%{p:-lmc_p}%{pg:-lmc_p}} \ ! %{g:-lg}" #else --- 32,39 ---- #define CPP_SPEC "%{!msoft-float:-D__HAVE_68881__}" ! /* If the 68881 is used, link must load libmc.a before libc.a. */ ! #define LIB_SPEC "%{!msoft-float:%{!p:%{!pg:-lmc}}%{p:-lmc_p}%{pg:-lmc_p}} \ ! %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} %{g:-lg}" #else *************** *** 46,52 **** /* If the 68881 is used, link must load libmc.a instead of libc.a */ ! #define LIB_SPEC "%{!m68881:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}} \ ! %{m68881:%{!p:%{!pg:-lmc}}%{p:-lmc_p}%{pg:-lmc_p}} \ ! %{g:-lg}" #endif --- 45,50 ---- /* If the 68881 is used, link must load libmc.a instead of libc.a */ ! #define LIB_SPEC "%{m68881:%{!p:%{!pg:-lmc}}%{p:-lmc_p}%{pg:-lmc_p}} \ ! %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} %{g:-lg}" #endif diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/m68k/m68k.md gcc-2.5.5/config/m68k/m68k.md *** gcc-2.5.4/config/m68k/m68k.md Mon Nov 1 12:29:02 1993 --- gcc-2.5.5/config/m68k/m68k.md Sat Nov 27 03:52:25 1993 *************** *** 388,392 **** --- 388,396 ---- { if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) + #ifdef SGS_CMP_ORDER + return \"cmpm%.l %0,%1\"; + #else return \"cmpm%.l %1,%0\"; + #endif if (REG_P (operands[1]) || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM)) *************** *** 413,417 **** --- 417,425 ---- { if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) + #ifdef SGS_CMP_ORDER + return \"cmpm%.w %0,%1\"; + #else return \"cmpm%.w %1,%0\"; + #endif if ((REG_P (operands[1]) && !ADDRESS_REG_P (operands[1])) || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM)) *************** *** 438,442 **** --- 446,454 ---- { if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) + #ifdef SGS_CMP_ORDER + return \"cmpm%.b %0,%1\"; + #else return \"cmpm%.b %1,%0\"; + #endif if (REG_P (operands[1]) || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM)) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/m68k/mot3300.h gcc-2.5.5/config/m68k/mot3300.h *** gcc-2.5.4/config/m68k/mot3300.h Sat Oct 2 04:20:24 1993 --- gcc-2.5.5/config/m68k/mot3300.h Sun Nov 21 22:37:10 1993 *************** *** 72,75 **** --- 72,80 ---- #define STRUCTURE_SIZE_BOUNDARY 16 + + /* Allocation boundary (in *bits*) for storing arguments in argument list. */ + /* Be compatible with native compiler. */ + #undef PARM_BOUNDARY + #define PARM_BOUNDARY 16 /* cpp has to support a #sccs directive for the /usr/include files */ *************** *** 81,84 **** --- 86,95 ---- #define SDB_DEBUGGING_INFO + #undef REGISTER_PREFIX + #define REGISTER_PREFIX "%" + + #undef IMMEDIATE_PREFIX + #define IMMEDIATE_PREFIX "&" + #undef REGISTER_NAMES #define REGISTER_NAMES \ *************** *** 87,90 **** --- 98,102 ---- "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"} + #if 0 /* phdm@info.ucl.ac.be says the standard ones work. */ #undef FUNCTION_PROLOGUE #define FUNCTION_PROLOGUE(FILE, SIZE) \ *************** *** 114,117 **** --- 126,130 ---- fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[15 - exact_log2 (mask)]); \ else if (mask) fprintf (FILE, "\tmovm.l &0x%x,-(%%sp)\n", mask); } + #endif /* 0 */ #undef FUNCTION_PROFILER *************** *** 119,122 **** --- 132,136 ---- fprintf (FILE, "\tmov.l &LP%%%d,%%a0\n\tjsr mcount%%\n", (LABEL_NO)) + #if 0 /* phdm@info.ucl.ac.be says the standard ones work. */ #undef FUNCTION_EPILOGUE #define FUNCTION_EPILOGUE(FILE, SIZE) \ *************** *** 175,178 **** --- 189,193 ---- fprintf (FILE, "\trtd &%d\n", current_function_pops_args); \ else fprintf (FILE, "\trts\n"); } + #endif /* 0 */ /* This is how to output an insn to push a register on the stack. *************** *** 221,224 **** --- 236,240 ---- #define CPP_PREDEFINES "-Dm68k -Dunix -DsysV68 -D__motorola__ -Asystem(unix) -Asystem(svr3) -Acpu(m68k) -Amachine(m68k)" + #if 0 /* phdm@info.ucl.ac.be says the right way is with PARM_BOUNDARY. */ /* Specify how to pad function arguments. Value should be `upward', `downward' or `none'. *************** *** 231,234 **** --- 247,251 ---- : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \ ? downward : none) + #endif /* 0 */ /* Override part of the obstack macros. */ *************** *** 736,739 **** --- 753,758 ---- } + /* phdm@info.ucl.ac.be says to pass SIZE, not ROUNDED. */ + /* This says how to output an assembler line to define a global common symbol. */ *************** *** 743,747 **** ( fputs ("\tcomm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ ! fprintf ((FILE), ",%u\n", (ROUNDED))) /* This says how to output an assembler line --- 762,766 ---- ( fputs ("\tcomm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ ! fprintf ((FILE), ",%u\n", (SIZE))) /* This says how to output an assembler line *************** *** 752,756 **** ( fputs ("\tlcomm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ ! fprintf ((FILE), ",%u\n", (ROUNDED))) --- 771,775 ---- ( fputs ("\tlcomm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ ! fprintf ((FILE), ",%u\n", (SIZE))) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/m88k/dolph.h gcc-2.5.5/config/m88k/dolph.h *** gcc-2.5.4/config/m88k/dolph.h Fri Jan 1 07:36:20 1993 --- gcc-2.5.5/config/m88k/dolph.h Sun Nov 21 15:29:05 1993 *************** *** 1,6 **** /* Definitions of target machine for GNU compiler. Motorola m88100 running the Dolphin UNIX System V/88 Release 3.2, ! Version 3.5/5.60. ! Copyright (C) 1992 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,6 ---- /* Definitions of target machine for GNU compiler. Motorola m88100 running the Dolphin UNIX System V/88 Release 3.2, ! Version 3.8/7.83 and 3.6/5.86 ! Copyright (C) 1992, 1993 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 22,36 **** #include "m88k/sysv3.h" ! /* Don't output structure tag names when it causes a forward reference. ! Symptom: ! Error messages like ! as: "/usr/tmp/cca22733.s": cannot reduce symbol table, unused symbols remain ! when compiling some programs. ! example program (C++): struct bad { bad(); }; bad::bad() {} ! ! This problem seems to have gone away, perhaps with release 3.6 of the O/S ! from Dolphin. */ ! /* #undef SDB_ALLOW_FORWARD_REFERENCES */ ! /* Use T_ARG as T_VOID. T_VOID is not defined in as it should be. */ ! #define T_VOID T_ARG --- 22,53 ---- #include "m88k/sysv3.h" ! #define SDB_ALLOW_FORWARD_REFERENCES ! #define SDB_ALLOW_UNKNOWN_REFERENCES ! /* Override m88k/sysv3.h */ ! ! #undef CPP_PREDEFINES ! #define CPP_PREDEFINES "-Dm88000 -Dm88k -DOCS88 -DDOLPHIN -Dunix -DsysV88 -D__CLASSIFY_TYPE__=2 -Asystem(unix) -Asystem(svr3) -Acpu(m88k) -Amachine(m88k)" ! ! /* ! If you want to detect dereferencing of NULL pointers, uncomment the ! following two lines. Alternatively, edit the appropriate specs file. ! ! #undef LINK_SPEC ! #define LINK_SPEC "gcc.ld%s" ! ! */ ! ! #undef CPU_DEFAULT ! #define CPU_DEFAULT MASK_88000 ! ! #undef INITIALIZE_TRAMPOLINE ! #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ ! { \ ! emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 40)), FNADDR); \ ! emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 36)), CXT); \ ! emit_call_insn (gen_call( gen_rtx (MEM, SImode, \ ! gen_rtx(SYMBOL_REF,Pmode, \ ! "__enable_execute_stack")), \ ! const0_rtx)); \ ! } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/m88k/dolphin.ld gcc-2.5.5/config/m88k/dolphin.ld *** gcc-2.5.4/config/m88k/dolphin.ld --- gcc-2.5.5/config/m88k/dolphin.ld Sun Nov 21 15:37:03 1993 *************** *** 0 **** --- 1,39 ---- + /* COFF linker directives for the Dolphin Triton88 for GNU compiler. + Copyright (C) 1993 Free Software Foundation, Inc. + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + + This file does the following: + + - Sets VIRTUAL addr of .text to 0x400200 + Sets FILE addr of .text to 0x200 (BLOCK directive) + - Depending on size of .text section rounds up to next + 4 MG boundary, adds (size of .text and vaddr of .text) mod 64K + This is to handle sections larger than 4 MG. */ + + SECTIONS { + .text 0x400200 BLOCK (0x200): + { *(.init) *(.text) *(.rodata) *(.tdesc) *(.fini)} + + GROUP BIND( (((SIZEOF(.text)+ADDR(.text)) / 0x400000 * 0x400000) + 0x400000) + + ((SIZEOF(.text) + ADDR(.text)) % 0x10000) ) : + { + .data : { } + .bss : { } + } + } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/m88k/t-m88k gcc-2.5.5/config/m88k/t-m88k *** gcc-2.5.4/config/m88k/t-m88k Thu Sep 9 16:02:30 1993 --- gcc-2.5.5/config/m88k/t-m88k Sun Nov 21 15:26:52 1993 *************** *** 16,17 **** --- 16,22 ---- EXTRA_PARTS=crtbegin.o crtend.o + + # Clean up. + + realclean:: + rm -f $(MOVE_ASM) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/m88k/x-dolph gcc-2.5.5/config/m88k/x-dolph *** gcc-2.5.4/config/m88k/x-dolph Sun Jun 28 10:06:22 1992 --- gcc-2.5.5/config/m88k/x-dolph Sun Nov 21 15:27:04 1993 *************** *** 1,4 **** ! # Green Hills C on Dolphin UNIX System V/88 Release 3.2 Version 3.5/5.60 does ! # not provide alloca. ALLOCA=alloca.o --- 1,19 ---- ! # Use link editor directives to make NULL pointers point to ! # illegal addresses. + EXTRA_PARTS=crtbegin.o crtend.o gcc.ld + + gcc.ld: $(srcdir)/config/m88k/dolphin.ld + rm -f gcc.ld; cp $(srcdir)/config/m88k/dolphin.ld gcc.ld + + # Green Hills C on Dolphin UNIX System V/88 Release 3.2 Version 3.6/5.86 does + # not provide alloca. It does not harm to have it defined on version 3.8.alfa + # even though it's not needed there. + ALLOCA=alloca.o + + # Under DolphinOS 3.8.alfa, /bin/cc defines __GNUC__, but not __m88k__, + # causing gdstarg.h to fail. Defining __m88k__ does probably not hurt on + # DolphinOS 3.6. + + X_CFLAGS =-D__m88k__ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/config/rs6000/rs6000.c gcc-2.5.5/config/rs6000/rs6000.c *** gcc-2.5.4/config/rs6000/rs6000.c Tue Oct 26 19:03:58 1993 --- gcc-2.5.5/config/rs6000/rs6000.c Fri Nov 19 16:20:23 1993 *************** *** 1974,1979 **** /* Set up a TOC entry for the profiler label. */ toc_section (); ! fprintf (file, "LPC..%d:\n\t.tc\tLP..%d[TC],LP..%d\n", ! labelno, labelno, labelno); text_section (); --- 1974,1982 ---- /* Set up a TOC entry for the profiler label. */ toc_section (); ! if (TARGET_MINIMAL_TOC) ! fprintf (file, "LPC..%d:\n\t.long LP..%d\n", labelno, labelno); ! else ! fprintf (file, "LPC..%d:\n\t.tc\tLP..%d[TC],LP..%d\n", ! labelno, labelno, labelno); text_section (); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/configure gcc-2.5.5/configure *** gcc-2.5.4/configure Wed Nov 10 18:04:36 1993 --- gcc-2.5.5/configure Fri Nov 19 16:44:34 1993 *************** *** 273,276 **** --- 273,277 ---- host_broken_install= host_install_headers_dir=install-headers-tar + host_truncate_target= # Validate the specs, and canonicalize them. *************** *** 306,309 **** --- 307,312 ---- # wants its .md file passed through cpp. cpp_md_flags= + # Set this if directory names should be truncated to 14 characters. + truncate_target= case $machine in *************** *** 426,429 **** --- 429,433 ---- tmake_file=i386/t-sco fi + truncate_target=yes ;; i[34]86-*-isc*) # 80386 running ISC system *************** *** 1646,1649 **** --- 1650,1654 ---- host_broken_install=$broken_install host_install_headers_dir=$install_headers_dir + host_truncate_target=$truncate_target pass2done=yes fi *************** *** 1709,1712 **** --- 1714,1722 ---- echo "Linked \`$link' to \`${srcdir}/config/$file'" done + + # Truncate the target if necessary + if [ x$host_truncate_target != x ]; then + target=`echo $target | sed -e 's/\(..............\).*/\1/'` + fi # Create Makefile.tem from Makefile.in. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-call.c gcc-2.5.5/cp-call.c *** gcc-2.5.4/cp-call.c Fri Nov 5 13:36:36 1993 --- gcc-2.5.5/cp-call.c Wed Nov 24 00:15:36 1993 *************** *** 227,230 **** --- 227,233 ---- p1 = TREE_TYPE (p1); p2 = TREE_TYPE (p2); + /* Don't die if we happen to be dealing with void*. */ + if (!IS_AGGR_TYPE (p1) || !IS_AGGR_TYPE (p2)) + return EVIL_RETURN (h); if (h2.distance < 0) binfo = get_binfo (p2, p1, 0); *************** *** 811,814 **** --- 814,820 ---- p1 = TREE_TYPE (p1); p2 = TREE_TYPE (p2); + /* Don't die if we happen to be dealing with void*. */ + if (!IS_AGGR_TYPE (p1) || !IS_AGGR_TYPE (p2)) + return EVIL; if (CONTRAVARIANT_HARSHNESS (new_harshness)) binfo = get_binfo (p2, p1, 0); *************** *** 2518,2539 **** tree type = TREE_TYPE (exp); - /* Destructors can be "called" for simple types; see 5.2.4 and 12.4 */ if (type == error_mark_node ! || basename == NULL_TREE ! || (TREE_CODE (name) != BIT_NOT_EXPR ! && ! is_aggr_typedef (basename, 1))) return error_mark_node; if (TREE_CODE (type) == REFERENCE_TYPE) type = TREE_TYPE (type); ! if (TREE_CODE (name) != BIT_NOT_EXPR && ! IS_AGGR_TYPE (type)) { ! error ("base object of scoped method call is not of aggregate type"); return error_mark_node; } - basetype = IDENTIFIER_TYPE_VALUE (basename); - if (binfo = binfo_or_else (basetype, type)) { --- 2524,2561 ---- tree type = TREE_TYPE (exp); if (type == error_mark_node ! || basename == NULL_TREE) return error_mark_node; + basetype = IDENTIFIER_TYPE_VALUE (basename); + if (TREE_CODE (type) == REFERENCE_TYPE) type = TREE_TYPE (type); ! /* Destructors can be "called" for simple types; see 5.2.4 and 12.4 Note ! that explicit ~int is caught in the parser; this deals with typedefs ! and template parms. */ ! if (TREE_CODE (name) == BIT_NOT_EXPR && ! is_aggr_typedef (basename, 0)) ! { ! if (type != basetype) ! cp_error ("type of `%E' does not match destructor type `%T' (type was `%T')", ! exp, basetype, type); ! name = IDENTIFIER_TYPE_VALUE (TREE_OPERAND (name, 0)); ! if (basetype != name) ! cp_error ("qualified type `%T' does not match destructor type `%T'", ! basetype, name); ! return void_zero_node; ! } ! ! if (! is_aggr_typedef (basename, 1)) ! return error_mark_node; ! ! if (! IS_AGGR_TYPE (type)) { ! cp_error ("base object `%E' of scoped method call is of non-aggregate type `%T'", ! exp, type); return error_mark_node; } if (binfo = binfo_or_else (basetype, type)) { *************** *** 2561,2564 **** --- 2583,2589 ---- return error_mark_node; } + if (! TYPE_HAS_DESTRUCTOR (TREE_TYPE (decl))) + return void_zero_node; + return build_delete (TREE_TYPE (decl), decl, integer_two_node, LOOKUP_NORMAL|LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, *************** *** 2664,2669 **** flags |= LOOKUP_DESTRUCTOR; name = TREE_OPERAND (name, 0); - if (! is_aggr_typedef (name, 1)) - return error_mark_node; if (parms) error ("destructors take no parameters"); --- 2689,2692 ---- *************** *** 2672,2680 **** basetype = IDENTIFIER_CLASS_TYPE_VALUE (name); if (! TYPE_HAS_DESTRUCTOR (basetype)) ! { ! /* A destructive destructor wouldn't be a bad idea, but let's ! not bother for now. */ ! return build_c_cast (void_type_node, instance); ! } instance = default_conversion (instance); if (TREE_CODE (TREE_TYPE (instance)) == POINTER_TYPE) --- 2695,2699 ---- basetype = IDENTIFIER_CLASS_TYPE_VALUE (name); if (! TYPE_HAS_DESTRUCTOR (basetype)) ! return void_zero_node; instance = default_conversion (instance); if (TREE_CODE (TREE_TYPE (instance)) == POINTER_TYPE) *************** *** 2734,2738 **** { basetype = IDENTIFIER_TYPE_VALUE (name); ! name = constructor_name (basetype); } else --- 2753,2757 ---- { basetype = IDENTIFIER_TYPE_VALUE (name); ! name = constructor_name_full (basetype); } else *************** *** 2747,2752 **** else { ! error ("no constructor named `%s' in visible scope", ! IDENTIFIER_POINTER (name)); return error_mark_node; } --- 2766,2771 ---- else { ! cp_error ("no constructor named `%T' in visible scope", ! name); return error_mark_node; } *************** *** 3067,3071 **** TREE_CHAIN (last) = void_list_node; method_name = build_decl_overload (name, parmtypes, ! 1 + (name == constructor_name (save_basetype))); TREE_CHAIN (last) = NULL_TREE; --- 3086,3091 ---- TREE_CHAIN (last) = void_list_node; method_name = build_decl_overload (name, parmtypes, ! 1 + (name == constructor_name (save_basetype) ! || name == constructor_name_full (save_basetype))); TREE_CHAIN (last) = NULL_TREE; *************** *** 3847,3852 **** { if (complain) ! error ("function `%s' declared overloaded, but no instances of that function declared", ! IDENTIFIER_POINTER (TREE_PURPOSE (functions))); if (final_cp) { --- 3867,3872 ---- { if (complain) ! cp_error ("function `%D' declared overloaded, but no instances of that function declared", ! TREE_PURPOSE (functions)); if (final_cp) { *************** *** 4074,4104 **** } else if (complain) ! { ! tree name; ! char *err_name; ! ! /* Initialize name for error reporting. */ ! if (TREE_CODE (functions) == TREE_LIST) ! name = TREE_PURPOSE (functions); ! else if (TREE_CODE (functions) == ADDR_EXPR) ! /* Since the implicit `operator new' and `operator delete' functions ! are set up to have IDENTIFIER_GLOBAL_VALUEs that are unary ADDR_EXPRs ! by default_conversion(), we must compensate for that here by ! using the name of the ADDR_EXPR's operand. */ ! name = DECL_NAME (TREE_OPERAND (functions, 0)); ! else ! name = DECL_NAME (functions); - if (IDENTIFIER_OPNAME_P (name)) - { - char *opname = operator_name_string (name); - err_name = (char *)alloca (strlen (opname) + 12); - sprintf (err_name, "operator %s", opname); - } - else - err_name = IDENTIFIER_POINTER (name); - - report_type_mismatch (cp, parms, "function", err_name); - } return error_mark_node; } --- 4094,4100 ---- } else if (complain) ! report_type_mismatch (cp, parms, "function", ! decl_as_string (cp->function, 1)); return error_mark_node; } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-class.c gcc-2.5.5/cp-class.c *** gcc-2.5.4/cp-class.c Fri Oct 8 14:59:31 1993 --- gcc-2.5.5/cp-class.c Wed Nov 24 18:20:16 1993 *************** *** 2076,2083 **** { /* ANSI C++ June 5 1992 WP 12.5.5.1 */ ! cp_error_at ("operator delete cannot be overloaded", fn_fields); ! cp_error_at ("previous declaration here", x); } ! if (DECL_ASSEMBLER_NAME (fn_fields) == DECL_ASSEMBLER_NAME (x)) { /* We complain about multiple destructors on sight, --- 2076,2083 ---- { /* ANSI C++ June 5 1992 WP 12.5.5.1 */ ! cp_error_at ("`%D' overloaded", fn_fields); ! cp_error_at ("previous declaration as `%D' here", x); } ! if (DECL_ASSEMBLER_NAME (fn_fields)==DECL_ASSEMBLER_NAME (x)) { /* We complain about multiple destructors on sight, *************** *** 2084,2092 **** so we do not repeat the warning here. Friend-friend ambiguities are warned about outside this loop. */ ! if (! DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (fn_fields))) ! error_with_file_and_line (DECL_SOURCE_FILE (fn_fields), ! DECL_SOURCE_LINE (fn_fields), ! "ambiguous method `%s' in structure", ! lang_printable_name (fn_fields)); break; } --- 2084,2090 ---- so we do not repeat the warning here. Friend-friend ambiguities are warned about outside this loop. */ ! if (!DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (fn_fields))) ! cp_error_at ("ambiguous method `%#D' in structure", ! fn_fields); break; } *************** *** 2110,2115 **** } ! TREE_VEC_LENGTH (method_vec) ! = (tree *)obstack_next_free (&class_obstack) - (&TREE_VEC_ELT (method_vec, 0)); obstack_finish (&class_obstack); CLASSTYPE_METHOD_VEC (t) = method_vec; --- 2108,2113 ---- } ! TREE_VEC_LENGTH (method_vec) = (tree *)obstack_next_free (&class_obstack) ! - (&TREE_VEC_ELT (method_vec, 0)); obstack_finish (&class_obstack); CLASSTYPE_METHOD_VEC (t) = method_vec; *************** *** 2128,2133 **** } if (nonprivate_method == 0) ! warning ("all member functions in class `%s' are private", ! TYPE_NAME_STRING (t)); } --- 2126,2130 ---- } if (nonprivate_method == 0) ! cp_warning ("all member functions in class `%T' are private", t); } *************** *** 2408,2421 **** if (TREE_CODE (name) == TYPE_DECL) { ! extern int lineno; ! DECL_SOURCE_FILE (name) = input_filename; ! /* For TYPE_DECL that are not typedefs (those marked with a line number ! of zero, we don't want to mark them as real typedefs. If this fails ! one needs to make sure real typedefs have a previous line number, ! even if it is wrong, that way the below will fill in the right line ! number. (mrs) */ ! if (DECL_SOURCE_LINE (name)) ! DECL_SOURCE_LINE (name) = lineno; name = DECL_NAME (name); } --- 2405,2431 ---- if (TREE_CODE (name) == TYPE_DECL) { ! #if 0 /* Maybe later. -jason */ ! struct tinst_level *til = tinst_for_decl(); ! if (til) ! { ! DECL_SOURCE_FILE (name) = til->file; ! if (DECL_SOURCE_LINE (name)) ! DECL_SOURCE_LINE (name) = til->line; ! } ! else ! #endif ! { ! extern int lineno; ! ! DECL_SOURCE_FILE (name) = input_filename; ! /* For TYPE_DECL that are not typedefs (those marked with a line ! number of zero, we don't want to mark them as real typedefs. ! If this fails one needs to make sure real typedefs have a ! previous line number, even if it is wrong, that way the below ! will fill in the right line number. (mrs) */ ! if (DECL_SOURCE_LINE (name)) ! DECL_SOURCE_LINE (name) = lineno; ! } name = DECL_NAME (name); } *************** *** 2801,2805 **** { DECL_INITIAL (x) = NULL; ! cp_warning ("width of `%D' exceeds its type", x); } } --- 2811,2815 ---- { DECL_INITIAL (x) = NULL; ! cp_error ("width of `%D' exceeds its type", x); } } *************** *** 4298,4303 **** { if (complain) ! error ("cannot resolve overloaded function `%s' based on non-function type", ! IDENTIFIER_POINTER (TREE_PURPOSE (rhs))); return error_mark_node; } --- 4308,4313 ---- { if (complain) ! cp_error ("cannot resolve overloaded function `%D' based on non-function type", ! TREE_PURPOSE (rhs)); return error_mark_node; } *************** *** 4333,4342 **** if (complain) { ! if (TREE_CHAIN (rhs)) ! error ("no appropriate overload for overloaded function `%s' exists", ! IDENTIFIER_POINTER (TREE_PURPOSE (rhs))); ! else ! error ("function `%s' has inappropriate type signature", ! IDENTIFIER_POINTER (TREE_PURPOSE (rhs))); } return error_mark_node; --- 4343,4350 ---- if (complain) { ! cp_error ("cannot resolve overload to target type `%#T';", ! lhstype); ! cp_error ("no suitable overload of function `%D' exists", ! TREE_PURPOSE (rhs)); } return error_mark_node; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-cvt.c gcc-2.5.5/cp-cvt.c *** gcc-2.5.4/cp-cvt.c Fri Oct 8 14:59:41 1993 --- gcc-2.5.5/cp-cvt.c Wed Nov 24 00:16:28 1993 *************** *** 101,104 **** --- 101,110 ---- } + /* if converting pointer to pointer + if dealing with classes, check for derived->base or vice versa + else if dealing with method pointers, delegate + else convert blindly + else if converting class, pass off to build_type_conversion + else try C-style pointer conversion */ static tree cp_convert_to_pointer (type, expr) *************** *** 257,261 **** if ((flags & LOOKUP_PROTECT) && binfo == error_mark_node) return error_mark_node; ! if (basetype == NULL_TREE) return error_not_base_type (target_type, argtype); basetype = BINFO_TYPE (binfo); --- 263,267 ---- if ((flags & LOOKUP_PROTECT) && binfo == error_mark_node) return error_mark_node; ! if (binfo == NULL_TREE) return error_not_base_type (target_type, argtype); basetype = BINFO_TYPE (binfo); *************** *** 592,595 **** --- 598,603 ---- tree rval = NULL_TREE; + if (TREE_CODE(type) == ARRAY_TYPE) + type = build_pointer_type (TREE_TYPE(type)); if (form == REFERENCE_TYPE) intype = TREE_TYPE (intype); *************** *** 657,661 **** /* Section 13. */ /* Since convert_for_initialization didn't call convert_for_assignment, ! we have to do this checking here. XXX We should have a common routine between here and convert_for_assignment. */ if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE) --- 665,669 ---- /* Section 13. */ /* Since convert_for_initialization didn't call convert_for_assignment, ! we have to do this checking here. FIXME: We should have a common routine between here and convert_for_assignment. */ if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE) *************** *** 713,717 **** if (TYPE_HAS_CONSTRUCTOR (type)) { ! tree init = build_method_call (NULL_TREE, constructor_name (type), build_tree_list (NULL_TREE, expr), TYPE_BINFO (type), LOOKUP_NO_CONVERSION); --- 721,725 ---- if (TYPE_HAS_CONSTRUCTOR (type)) { ! tree init = build_method_call (NULL_TREE, constructor_name_full (type), build_tree_list (NULL_TREE, expr), TYPE_BINFO (type), LOOKUP_NO_CONVERSION); *************** *** 733,737 **** } ! init = build_method_call (NULL_TREE, constructor_name (type), build_tree_list (NULL_TREE, expr), TYPE_BINFO (type), LOOKUP_NORMAL|LOOKUP_NO_CONVERSION); --- 741,745 ---- } ! init = build_method_call (NULL_TREE, constructor_name_full (type), build_tree_list (NULL_TREE, expr), TYPE_BINFO (type), LOOKUP_NORMAL|LOOKUP_NO_CONVERSION); *************** *** 1205,1213 **** && form == INTEGER_TYPE) { ! if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (type))) ! pedwarn ("anachronistic conversion from integer type to anonymous enumeral type"); ! else ! pedwarn ("anachronistic conversion from integer type to enumeral type `%s'", ! TYPE_NAME_STRING (type)); if (flag_pedantic_errors) --- 1213,1217 ---- && form == INTEGER_TYPE) { ! cp_pedwarn ("anachronistic conversion from `int' to `%#T'", type); if (flag_pedantic_errors) *************** *** 1216,1220 **** if (form == OFFSET_TYPE) cp_error_at ("pointer-to-member expression object not composed with type `%D' object", ! TYPE_NAME (TYPE_OFFSET_BASETYPE (intype))); else if (IS_AGGR_TYPE (intype)) { --- 1220,1224 ---- if (form == OFFSET_TYPE) cp_error_at ("pointer-to-member expression object not composed with type `%D' object", ! TYPE_NAME (TYPE_OFFSET_BASETYPE (intype))); else if (IS_AGGR_TYPE (intype)) { *************** *** 1222,1226 **** rval = build_type_conversion (CONVERT_EXPR, type, expr, 1); if (rval) return rval; ! error ("aggregate value used where an integer was expected"); return error_mark_node; } --- 1226,1230 ---- rval = build_type_conversion (CONVERT_EXPR, type, expr, 1); if (rval) return rval; ! cp_error ("`%#T' used where an `int' was expected", intype); return error_mark_node; } *************** *** 1238,1242 **** return rval; else ! error ("aggregate value used where a floating point value was expected"); } return fold (convert_to_real (type, e)); --- 1242,1247 ---- return rval; else ! cp_error ("`%#T' used where a floating point value was expected", ! TREE_TYPE (e)); } return fold (convert_to_real (type, e)); *************** *** 1273,1277 **** if (TYPE_HAS_CONSTRUCTOR (type)) { ! tree rval = build_method_call (NULL_TREE, constructor_name (type), build_tree_list (NULL_TREE, e), TYPE_BINFO (type), --- 1278,1282 ---- if (TYPE_HAS_CONSTRUCTOR (type)) { ! tree rval = build_method_call (NULL_TREE, constructor_name_full (type), build_tree_list (NULL_TREE, e), TYPE_BINFO (type), *************** *** 1328,1332 **** { tree rval; ! tree init = build_method_call (NULL_TREE, constructor_name (type), build_tree_list (NULL_TREE, e), TYPE_BINFO (type), LOOKUP_NORMAL); --- 1333,1337 ---- { tree rval; ! tree init = build_method_call (NULL_TREE, constructor_name_full (type), build_tree_list (NULL_TREE, e), TYPE_BINFO (type), LOOKUP_NORMAL); *************** *** 1404,1408 **** flags = LOOKUP_NORMAL; ! rval = build_method_call (first_arg, constructor_name (typename), NULL_TREE, NULL_TREE, flags); if (rval == error_mark_node) --- 1409,1413 ---- flags = LOOKUP_NORMAL; ! rval = build_method_call (first_arg, constructor_name_full (typename), NULL_TREE, NULL_TREE, flags); if (rval == error_mark_node) *************** *** 1533,1537 **** else flags = LOOKUP_NORMAL; ! rval = build_method_call (first_arg, constructor_name (typename), NULL_TREE, NULL_TREE, flags); if (rval == error_mark_node) --- 1538,1542 ---- else flags = LOOKUP_NORMAL; ! rval = build_method_call (first_arg, constructor_name_full (typename), NULL_TREE, NULL_TREE, flags); if (rval == error_mark_node) *************** *** 1546,1550 **** { tree init = build_method_call (NULL_TREE, ! constructor_name (type), build_tree_list (NULL_TREE, rval), NULL_TREE, LOOKUP_NORMAL); tree temp = build_cplus_new (type, init, 1); --- 1551,1555 ---- { tree init = build_method_call (NULL_TREE, ! constructor_name_full (type), build_tree_list (NULL_TREE, rval), NULL_TREE, LOOKUP_NORMAL); tree temp = build_cplus_new (type, init, 1); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-decl.c gcc-2.5.5/cp-decl.c *** gcc-2.5.4/cp-decl.c Wed Nov 10 23:20:27 1993 --- gcc-2.5.5/cp-decl.c Wed Nov 24 18:21:28 1993 *************** *** 54,60 **** static struct stack_level *decl_stack; - #undef NULL - #define NULL (char *)0 - #ifndef CHAR_TYPE_SIZE #define CHAR_TYPE_SIZE BITS_PER_UNIT --- 54,57 ---- *************** *** 610,614 **** }; ! #define NULL_BINDING_LEVEL (struct binding_level *) NULL /* The binding level currently in effect. */ --- 607,611 ---- }; ! #define NULL_BINDING_LEVEL ((struct binding_level *) NULL) /* The binding level currently in effect. */ *************** *** 1901,1905 **** #if 0 /* not yet, should get fixed properly later */ ! TYPE_STUB_DECL (type) = pushdecl (make_type_decl (NULL, type)); #else TYPE_STUB_DECL (type) = pushdecl (build_decl (TYPE_DECL, NULL_TREE, type)); --- 1898,1902 ---- #if 0 /* not yet, should get fixed properly later */ ! TYPE_STUB_DECL (type) = pushdecl (make_type_decl (NULL_TREE, type)); #else TYPE_STUB_DECL (type) = pushdecl (build_decl (TYPE_DECL, NULL_TREE, type)); *************** *** 2026,2030 **** extern struct obstack permanent_obstack; unsigned olddecl_uid = DECL_UID (olddecl); ! int olddecl_friend = 0, types_match; int new_defines_function; --- 2023,2027 ---- extern struct obstack permanent_obstack; unsigned olddecl_uid = DECL_UID (olddecl); ! int olddecl_friend = 0, types_match = 0; int new_defines_function; *************** *** 2038,2042 **** there is an ambiguity or not. */ tree olddecls = olddecl; ! tree previous_c_decl = NULL_TREE; /* If the overload list is empty, just install the decl. */ --- 2035,2039 ---- there is an ambiguity or not. */ tree olddecls = olddecl; ! tree previous_c_decl = NULL_TREE; /* If the overload list is empty, just install the decl. */ *************** *** 2142,2146 **** cp_warning ("declaration of `%#D'", newdecl); cp_warning ("conflicts with built-in declaration `%#D'", ! olddecl); return 0; } --- 2139,2143 ---- cp_warning ("declaration of `%#D'", newdecl); cp_warning ("conflicts with built-in declaration `%#D'", ! olddecl); return 0; } *************** *** 2242,2250 **** error_with_decl (newdecl, errmsg); if (DECL_NAME (olddecl) != NULL_TREE) ! error_with_decl (olddecl, ! (DECL_INITIAL (olddecl) ! && current_binding_level == global_binding_level) ! ? "`%s' previously defined here" ! : "`%s' previously declared here"); } else if (TREE_CODE (olddecl) == FUNCTION_DECL --- 2239,2246 ---- error_with_decl (newdecl, errmsg); if (DECL_NAME (olddecl) != NULL_TREE) ! cp_error_at ((DECL_INITIAL (olddecl) ! && current_binding_level == global_binding_level) ! ? "`%#D' previously defined here" ! : "`%#D' previously declared here", olddecl); } else if (TREE_CODE (olddecl) == FUNCTION_DECL *************** *** 2257,2260 **** --- 2253,2270 ---- cp_warning_at ("follows non-prototype definition here", olddecl); } + else if (TREE_CODE (olddecl) == FUNCTION_DECL + && DECL_LANGUAGE (newdecl) != DECL_LANGUAGE (olddecl)) + /* extern "C" int foo (); + int foo () { bar (); } + is OK. */ + if (current_lang_stack == current_lang_base) + DECL_LANGUAGE (newdecl) = DECL_LANGUAGE (olddecl); + else + { + cp_error_at ("previous declaration of `%#D' with %L linkage", + olddecl, DECL_LANGUAGE (olddecl)); + cp_error ("conflicts with new declaration with %L linkage", + DECL_LANGUAGE (newdecl)); + } /* These bits are logically part of the type. */ *************** *** 2690,2697 **** else cp_warning ("`%D' was declared `extern' and later `static'", ! t); ! warning_with_file_and_line (file, line, ! "previous declaration of `%s'", ! decl_as_string (t, 0)); } #if 0 --- 2700,2705 ---- else cp_warning ("`%D' was declared `extern' and later `static'", ! x); ! cp_warning_at ("previous declaration of `%D'", t); } #if 0 *************** *** 2942,2946 **** if (oldlocal != NULL_TREE && TREE_CODE (oldlocal) == PARM_DECL) warnstring = "declaration of `%s' shadows a parameter"; ! else if (IDENTIFIER_CLASS_VALUE (name) != NULL_TREE) warnstring = "declaration of `%s' shadows a member of `this'"; else if (oldlocal != NULL_TREE) --- 2950,2955 ---- if (oldlocal != NULL_TREE && TREE_CODE (oldlocal) == PARM_DECL) warnstring = "declaration of `%s' shadows a parameter"; ! else if (IDENTIFIER_CLASS_VALUE (name) != NULL_TREE ! && !TREE_STATIC (name)) warnstring = "declaration of `%s' shadows a member of `this'"; else if (oldlocal != NULL_TREE) *************** *** 3570,3574 **** { static int explained = 0; ! cp_error ("destructor needed for `%D'", TREE_PURPOSE (cleanup)); error ("where case label appears here"); if (!explained) --- 3579,3583 ---- { static int explained = 0; ! cp_error_at ("destructor needed for `%#D'", TREE_PURPOSE (cleanup)); error ("where case label appears here"); if (!explained) *************** *** 3672,3677 **** { /* Definition isn't the kind we were looking for. */ ! error ("`%s' defined as wrong kind of tag", ! IDENTIFIER_POINTER (name)); } return TREE_VALUE (tail); --- 3681,3686 ---- { /* Definition isn't the kind we were looking for. */ ! cp_error ("`%#D' redeclared as %C", TREE_VALUE (tail), ! form); } return TREE_VALUE (tail); *************** *** 3707,3712 **** if (TREE_CODE (TREE_VALUE (these_tags)) != form) { ! error ("`%s' defined as wrong kind of tag in class scope", ! IDENTIFIER_POINTER (name)); } return TREE_VALUE (tail); --- 3716,3721 ---- if (TREE_CODE (TREE_VALUE (these_tags)) != form) { ! cp_error ("`%#D' redeclared as %C in class scope", ! TREE_VALUE (tail), form); } return TREE_VALUE (tail); *************** *** 4421,4425 **** float_type_node = make_node (REAL_TYPE); TYPE_PRECISION (float_type_node) = FLOAT_TYPE_SIZE; ! record_builtin_type (RID_FLOAT, NULL, float_type_node); layout_type (float_type_node); --- 4430,4434 ---- float_type_node = make_node (REAL_TYPE); TYPE_PRECISION (float_type_node) = FLOAT_TYPE_SIZE; ! record_builtin_type (RID_FLOAT, NULL_PTR, float_type_node); layout_type (float_type_node); *************** *** 4429,4433 **** else TYPE_PRECISION (double_type_node) = DOUBLE_TYPE_SIZE; ! record_builtin_type (RID_DOUBLE, NULL, double_type_node); layout_type (double_type_node); --- 4438,4442 ---- else TYPE_PRECISION (double_type_node) = DOUBLE_TYPE_SIZE; ! record_builtin_type (RID_DOUBLE, NULL_PTR, double_type_node); layout_type (double_type_node); *************** *** 4452,4456 **** void_type_node = make_node (VOID_TYPE); ! record_builtin_type (RID_VOID, NULL, void_type_node); layout_type (void_type_node); /* Uses integer_zero_node. */ void_list_node = build_tree_list (NULL_TREE, void_type_node); --- 4461,4465 ---- void_type_node = make_node (VOID_TYPE); ! record_builtin_type (RID_VOID, NULL_PTR, void_type_node); layout_type (void_type_node); /* Uses integer_zero_node. */ void_list_node = build_tree_list (NULL_TREE, void_type_node); *************** *** 4467,4471 **** string_type_node = build_pointer_type (char_type_node); const_string_type_node = build_pointer_type (build_type_variant (char_type_node, 1, 0)); ! record_builtin_type (RID_MAX, NULL, string_type_node); /* Make a type to be the domain of a few array types --- 4476,4480 ---- string_type_node = build_pointer_type (char_type_node); const_string_type_node = build_pointer_type (build_type_variant (char_type_node, 1, 0)); ! record_builtin_type (RID_MAX, NULL_PTR, string_type_node); /* Make a type to be the domain of a few array types *************** *** 4495,4499 **** ptr_type_node = build_pointer_type (void_type_node); const_ptr_type_node = build_pointer_type (build_type_variant (void_type_node, 1, 0)); ! record_builtin_type (RID_MAX, NULL, ptr_type_node); endlink = void_list_node; int_endlink = tree_cons (NULL_TREE, integer_type_node, endlink); --- 4504,4508 ---- ptr_type_node = build_pointer_type (void_type_node); const_ptr_type_node = build_pointer_type (build_type_variant (void_type_node, 1, 0)); ! record_builtin_type (RID_MAX, NULL_PTR, ptr_type_node); endlink = void_list_node; int_endlink = tree_cons (NULL_TREE, integer_type_node, endlink); *************** *** 4590,4594 **** layout_type (vtbl_type_node); vtbl_type_node = build_type_variant (vtbl_type_node, 1, 0); ! record_builtin_type (RID_MAX, NULL, vtbl_type_node); builtin_function ("__builtin_constant_p", int_ftype_int, --- 4599,4603 ---- layout_type (vtbl_type_node); vtbl_type_node = build_type_variant (vtbl_type_node, 1, 0); ! record_builtin_type (RID_MAX, NULL_PTR, vtbl_type_node); builtin_function ("__builtin_constant_p", int_ftype_int, *************** *** 5285,5290 **** if (pedantic || list_length (declspecs) > 1) { ! error ("typedef `%s' is initialized", ! IDENTIFIER_POINTER (DECL_NAME (decl))); initialized = 0; } --- 5294,5298 ---- if (pedantic || list_length (declspecs) > 1) { ! cp_error ("typedef `%D' is initialized", decl); initialized = 0; } *************** *** 5292,5297 **** case FUNCTION_DECL: ! error ("function `%s' is initialized like a variable", ! IDENTIFIER_POINTER (DECL_NAME (decl))); initialized = 0; break; --- 5300,5304 ---- case FUNCTION_DECL: ! cp_error ("function `%#D' is initialized like a variable", decl); initialized = 0; break; *************** *** 5298,5303 **** default: ! /* Don't allow initializations for incomplete types ! except for arrays which might be completed by the initialization. */ if (TYPE_SIZE (type) != NULL_TREE) ; /* A complete type is ok. */ --- 5305,5310 ---- default: ! /* Don't allow initializations for incomplete types except for ! arrays which might be completed by the initialization. */ if (TYPE_SIZE (type) != NULL_TREE) ; /* A complete type is ok. */ *************** *** 5304,5309 **** else if (TREE_CODE (type) != ARRAY_TYPE) { ! error ("variable `%s' has initializer but incomplete type", ! IDENTIFIER_POINTER (DECL_NAME (decl))); initialized = 0; } --- 5311,5316 ---- else if (TREE_CODE (type) != ARRAY_TYPE) { ! cp_error ("variable `%#D' has initializer but incomplete type", ! decl); initialized = 0; } *************** *** 5310,5315 **** else if (TYPE_SIZE (TREE_TYPE (type)) == NULL_TREE) { ! error ("elements of array `%s' have incomplete type", ! IDENTIFIER_POINTER (DECL_NAME (decl))); initialized = 0; } --- 5317,5321 ---- else if (TYPE_SIZE (TREE_TYPE (type)) == NULL_TREE) { ! cp_error ("elements of array `%#D' have incomplete type", decl); initialized = 0; } *************** *** 5323,5328 **** if (TYPE_SIZE (type) == NULL_TREE) { ! error ("aggregate `%s' has incomplete type and cannot be initialized", ! IDENTIFIER_POINTER (DECL_NAME (decl))); /* Change the type so that assemble_variable will give DECL an rtl we can live with: (mem (const_int 0)). */ --- 5329,5334 ---- if (TYPE_SIZE (type) == NULL_TREE) { ! cp_error ("aggregate `%#D' has incomplete type and cannot be initialized", ! decl); /* Change the type so that assemble_variable will give DECL an rtl we can live with: (mem (const_int 0)). */ *************** *** 5346,5351 **** if (current_binding_level != global_binding_level && DECL_EXTERNAL (decl)) ! warning ("declaration of `%s' has `extern' and is initialized", ! IDENTIFIER_POINTER (DECL_NAME (decl))); DECL_EXTERNAL (decl) = 0; if (current_binding_level == global_binding_level) --- 5352,5357 ---- if (current_binding_level != global_binding_level && DECL_EXTERNAL (decl)) ! cp_warning ("declaration of `%#D' has `extern' and is initialized", ! decl); DECL_EXTERNAL (decl) = 0; if (current_binding_level == global_binding_level) *************** *** 5412,5416 **** tree type; type = DECL_CONTEXT (result); ! my_friendly_assert (TREE_CODE (type) == UNINSTANTIATED_P_TYPE, 145); if (/* TREE_CODE (result) == VAR_DECL */ 1) { --- 5418,5429 ---- tree type; type = DECL_CONTEXT (result); ! ! if (TREE_CODE (type) != UNINSTANTIATED_P_TYPE) ! { ! cp_error ("declaration of `%D' in non-template type `%T'", ! decl, type); ! return NULL_TREE; ! } ! if (/* TREE_CODE (result) == VAR_DECL */ 1) { *************** *** 5435,5440 **** || TREE_CODE (result) == TYPE_DECL) { ! error ("invalid template `%s'", ! IDENTIFIER_POINTER (DECL_NAME (result))); return NULL_TREE; } --- 5448,5452 ---- || TREE_CODE (result) == TYPE_DECL) { ! cp_error ("invalid template `%#D'", result); return NULL_TREE; } *************** *** 5509,5513 **** init = ctor_call; else ! init = build_method_call (tmp, constructor_name (target_type), build_tree_list (NULL_TREE, init), NULL_TREE, LOOKUP_NORMAL); --- 5521,5525 ---- init = ctor_call; else ! init = build_method_call (tmp, constructor_name_full (target_type), build_tree_list (NULL_TREE, init), NULL_TREE, LOOKUP_NORMAL); *************** *** 5654,5658 **** tmp = get_temp_name (TREE_TYPE (type), current_binding_level == global_binding_level); ! tmp = build_method_call (tmp, constructor_name (TREE_TYPE (type)), build_tree_list (NULL_TREE, init), NULL_TREE, LOOKUP_NORMAL); --- 5666,5670 ---- tmp = get_temp_name (TREE_TYPE (type), current_binding_level == global_binding_level); ! tmp = build_method_call (tmp, constructor_name_full (TREE_TYPE (type)), build_tree_list (NULL_TREE, init), NULL_TREE, LOOKUP_NORMAL); *************** *** 5818,5823 **** { if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type) ! warning ("shadowing previous type declaration of `%s'", ! IDENTIFIER_POINTER (DECL_NAME (decl))); set_identifier_type_value (DECL_NAME (decl), type); CLASSTYPE_GOT_SEMICOLON (type) = 1; --- 5830,5834 ---- { if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type) ! cp_warning ("shadowing previous type declaration of `%#D'", decl); set_identifier_type_value (DECL_NAME (decl), type); CLASSTYPE_GOT_SEMICOLON (type) = 1; *************** *** 6042,6047 **** && TREE_CODE (type) != ARRAY_TYPE && (!pedantic || !current_class_type)) ! error ("uninitialized const `%s'", ! IDENTIFIER_POINTER (DECL_NAME (decl))); } --- 6053,6057 ---- && TREE_CODE (type) != ARRAY_TYPE && (!pedantic || !current_class_type)) ! cp_error ("uninitialized const `%#D'", decl); } *************** *** 6242,6259 **** { if (TREE_STATIC (decl)) ! if (init == NULL_TREE #ifdef DEFAULT_STATIC_DEFS ! /* If this code is dead, then users must ! explicitly declare static member variables ! outside the class def'n as well. */ ! && TYPE_NEEDS_CONSTRUCTING (type) #endif ! ) ! { ! DECL_EXTERNAL (decl) = 1; ! make_decl_rtl (decl, asmspec, 1); ! } ! else ! rest_of_decl_compilation (decl, asmspec, toplev, 0); else /* Just a constant field. Should not need any rtl. */ --- 6252,6271 ---- { if (TREE_STATIC (decl)) ! { ! if (init == NULL_TREE #ifdef DEFAULT_STATIC_DEFS ! /* If this code is dead, then users must ! explicitly declare static member variables ! outside the class def'n as well. */ ! && TYPE_NEEDS_CONSTRUCTING (type) #endif ! ) ! { ! DECL_EXTERNAL (decl) = 1; ! make_decl_rtl (decl, asmspec, 1); ! } ! else ! rest_of_decl_compilation (decl, asmspec, toplev, 0); ! } else /* Just a constant field. Should not need any rtl. */ *************** *** 6297,6312 **** tree *argp; - /* ARM $13.4: An overloaded operator cannot have - default arguments. */ - if (IDENTIFIER_OPNAME_P (original_name)) - { - error ("overloaded operator cannot have default arguments", - operator_name_string (original_name)); - TREE_PURPOSE (parmtypes) = NULL_TREE; - prev = parmtypes; - parmtypes = TREE_CHAIN (parmtypes); - continue; - } - argp = prev ? & TREE_CHAIN (prev) : & TYPE_ARG_TYPES (type); --- 6309,6312 ---- *************** *** 6582,6586 **** tree object; char *type; ! int virtualp, quals, friendp, raises; { if (virtualp) --- 6582,6586 ---- tree object; char *type; ! int virtualp, quals, inlinep, friendp, raises; { if (virtualp) *************** *** 6649,6758 **** if (quals != NULL_TREE && TREE_CODE (type) == FUNCTION_TYPE) { ! error ("functions cannot have method qualifiers"); quals = NULL_TREE; } ! /* Only two styles of delete's are valid. */ ! if (declarator == ansi_opname[(int) DELETE_EXPR]) ! { ! tree args = TYPE_ARG_TYPES (type); ! int style1, style2; ! ! if (ctype && args && TREE_CODE (type) == METHOD_TYPE) ! /* remove this */ ! args = TREE_CHAIN (args); ! ! style1 = type_list_equal (args, ! tree_cons (NULL_TREE, ptr_type_node, ! void_list_node)); ! style2 = style1 != 0 ? 0 : ! type_list_equal (args, ! tree_cons (NULL_TREE, ptr_type_node, ! tree_cons (NULL_TREE, sizetype, ! void_list_node))); ! ! if (ctype == NULL_TREE) ! { ! if (! style1) ! /* ANSI C++ June 5 1992 WP 12.5.5.2 */ ! error ("global operator delete must be declared as taking a single argument of type void*"); ! } ! else ! if (! style1 && ! style2) ! /* ANSI C++ June 5 1992 WP 12.5.4.1 */ ! error ("operator delete cannot be overloaded"); ! ! #if 0 ! /* Duplicated in coerce_delete_type -jason */ ! if (TREE_TYPE (type) != void_type_node) ! error ("operator delete must return void"); ! #endif ! } ! else if (DECL_NAME (decl) == ansi_opname[(int) POSTINCREMENT_EXPR] ! || DECL_NAME (decl) == ansi_opname[(int) POSTDECREMENT_EXPR]) ! { ! /* According to ARM $13.4.7, postfix operator++ must take an int as ! its second argument. */ ! tree parmtypes, argtypes = TYPE_ARG_TYPES (TREE_TYPE (decl)); - if (argtypes) - { - parmtypes = TREE_CHAIN (argtypes); - if (parmtypes != NULL_TREE - && TREE_VALUE (parmtypes) != void_type_node - && TREE_VALUE (parmtypes) != integer_type_node) - error ("postfix operator%s may only take `int' as its argument", - POSTINCREMENT_EXPR ? "++" : "--"); - } - } - else if (declarator == ansi_opname[(int) NEW_EXPR]) - { - #if 0 - /* Partially duplicated in coerce_new_type -- but only for methods - Where should these things be resolved? -jason */ - tree args = TYPE_ARG_TYPES (type); - - if (ctype && args && TREE_CODE (type) == METHOD_TYPE) - /* remove this */ - args = TREE_CHAIN (args); - - if (TREE_VALUE (args) != sizetype) - error ("the first argument to operator new must be of type size_t"); - - if (TREE_TYPE (type) != ptr_type_node - || TREE_TYPE (TREE_TYPE (type)) != void_type_node)) - error ("operator new must return void *"); - #endif - } - else if (IDENTIFIER_OPNAME_P (declarator) - /* && declarator != ansi_opname[(int) NEW_EXPR] - && declarator != ansi_opname[(int) DELETE_EXPR] Handled above */ - && ctype == NULL_TREE) - { - /* An operator function must either be a non-static member function or - take at least one argument of a class, a reference to a class, an - enumeration, or a reference to an enumeration. 13.4 */ - tree p; - - for (p = TYPE_ARG_TYPES (type); - TREE_VALUE (p) != void_type_node; - p = TREE_CHAIN (p)) - { - tree arg = TREE_VALUE (p); - if (TREE_CODE (arg) == REFERENCE_TYPE) - arg = TREE_TYPE (arg); - - /* This lets bad template code slip through. -jason */ - if (IS_AGGR_TYPE (arg) - || TREE_CODE (arg) == ENUMERAL_TYPE - || TREE_CODE (arg) == TEMPLATE_TYPE_PARM) - goto foundaggr; - } - cp_error ("`%D' must have an argument of class or enumerated type", - declarator); - foundaggr: - ; - } - /* Caller will do the rest of this. */ if (check < 0) --- 6649,6660 ---- if (quals != NULL_TREE && TREE_CODE (type) == FUNCTION_TYPE) { ! cp_error ("%smember function `%D' cannot have `%T' method qualifier", ! (ctype ? "static " : "non-"), decl, TREE_VALUE (quals)); quals = NULL_TREE; } ! if (IDENTIFIER_OPNAME_P (DECL_NAME (decl))) ! grok_op_properties (decl, virtualp); /* Caller will do the rest of this. */ if (check < 0) *************** *** 6801,6807 **** grokclassfn (ctype, cname, decl, flags, quals); - if (IDENTIFIER_OPNAME_P (DECL_NAME (decl))) - grok_op_properties (decl, virtualp); - if (ctype != NULL_TREE && check) check_classfn (ctype, cname, decl); --- 6703,6706 ---- *************** *** 7015,7019 **** simple equality check on the list of field members. */ ! if (t = TYPE_GET_PTRMEMFUNC_TYPE (type)) return t; --- 6914,6918 ---- simple equality check on the list of field members. */ ! if ((t = TYPE_GET_PTRMEMFUNC_TYPE (type))) return t; *************** *** 7352,7369 **** case TYPE_EXPR: - if (ctype == NULL_TREE) - { - /* ANSI C++ June 5 1992 WP 12.3.2 only describes - conversion functions in terms of being declared - as a member function. */ - error ("operator `%s' must be declared as a member", - IDENTIFIER_POINTER (TREE_VALUE (TREE_TYPE (decl)))); - return NULL_TREE; - } - - ctype = NULL_TREE; my_friendly_assert (flags == NO_SPECIAL, 154); flags = TYPENAME_FLAG; ! name = "operator "; /* Go to the absdcl. */ decl = TREE_OPERAND (decl, 0); --- 7251,7257 ---- case TYPE_EXPR: my_friendly_assert (flags == NO_SPECIAL, 154); flags = TYPENAME_FLAG; ! name = "operator "; /* We don't know the type yet. */ /* Go to the absdcl. */ decl = TREE_OPERAND (decl, 0); *************** *** 8033,8037 **** if (TYPE_MAIN_VARIANT (type) == void_type_node) { ! error ("declaration of `%s' as array of voids", name); type = error_mark_node; } --- 7921,7925 ---- if (TYPE_MAIN_VARIANT (type) == void_type_node) { ! cp_error ("declaration of `%D' as array of voids", dname); type = error_mark_node; } *************** *** 8039,8043 **** if (TREE_CODE (type) == FUNCTION_TYPE) { ! error ("declaration of `%s' as array of functions", name); type = error_mark_node; } --- 7927,7931 ---- if (TREE_CODE (type) == FUNCTION_TYPE) { ! cp_error ("declaration of `%D' as array of functions", dname); type = error_mark_node; } *************** *** 8049,8053 **** if (TREE_CODE (type) == REFERENCE_TYPE) { ! error ("declaration of `%s' as array of references", name); type = error_mark_node; } --- 7937,7941 ---- if (TREE_CODE (type) == REFERENCE_TYPE) { ! cp_error ("declaration of `%D' as array of references", dname); type = error_mark_node; } *************** *** 8055,8059 **** if (TREE_CODE (type) == OFFSET_TYPE) { ! error ("declaration of `%s' as array of data members", name); type = error_mark_node; } --- 7943,7948 ---- if (TREE_CODE (type) == OFFSET_TYPE) { ! cp_error ("declaration of `%D' as array of data members", ! dname); type = error_mark_node; } *************** *** 8061,8066 **** if (TREE_CODE (type) == METHOD_TYPE) { ! error ("declaration of `%s' as array of function members", ! name); type = error_mark_node; } --- 7950,7955 ---- if (TREE_CODE (type) == METHOD_TYPE) { ! cp_error ("declaration of `%D' as array of function members", ! dname); type = error_mark_node; } *************** *** 8094,8098 **** && TREE_CODE (TREE_TYPE (size)) != ENUMERAL_TYPE) { ! error ("size of array `%s' has non-integer type", name); size = integer_one_node; } --- 7983,7988 ---- && TREE_CODE (TREE_TYPE (size)) != ENUMERAL_TYPE) { ! cp_error ("size of array `%D' has non-integer type", ! dname); size = integer_one_node; } *************** *** 8100,8104 **** size = decl_constant_value (size); if (pedantic && integer_zerop (size)) ! pedwarn ("ANSI C++ forbids zero-size array `%s'", name); if (TREE_CONSTANT (size)) { --- 7990,7994 ---- size = decl_constant_value (size); if (pedantic && integer_zerop (size)) ! cp_pedwarn ("ANSI C++ forbids zero-size array `%D'", dname); if (TREE_CONSTANT (size)) { *************** *** 8106,8110 **** if (INT_CST_LT (size, integer_zero_node)) { ! error ("size of array `%s' is negative", name); size = integer_one_node; } --- 7996,8000 ---- if (INT_CST_LT (size, integer_zero_node)) { ! cp_error ("size of array `%D' is negative", dname); size = integer_one_node; } *************** *** 8115,8119 **** { if (pedantic) ! pedwarn ("ANSI C++ forbids variable-size array `%s'", name); dont_grok_size: itype = --- 8005,8009 ---- { if (pedantic) ! cp_pedwarn ("ANSI C++ forbids variable-size array `%D'", dname); dont_grok_size: itype = *************** *** 8564,8569 **** if (TYPE_MAIN_VARIANT (ctype) != current_class_type) { ! cp_error ("cannot declare member `%T::%s' within this class", ! ctype, name); return void_type_node; } --- 8454,8459 ---- if (TYPE_MAIN_VARIANT (ctype) != current_class_type) { ! cp_error ("cannot declare member `%T::%s' within `%T'", ! ctype, name, current_class_type); return void_type_node; } *************** *** 8643,8653 **** if (explicit_int != -1) { ! if (comp_target_types (type, ! TREE_TYPE (TREE_OPERAND (declarator, 0)), ! 1) == 0) ! error ("type conversion function declared to return incongruent type"); else ! pedwarn ("return type specified for type conversion function"); } type = TREE_TYPE (TREE_OPERAND (declarator, 0)); maybe_globalize_type (type); --- 8533,8544 ---- if (explicit_int != -1) { ! tree stype = TREE_TYPE (TREE_OPERAND (declarator, 0)); ! if (comp_target_types (type, stype, 1) == 0) ! cp_error ("`operator %T' declared to return `%T'", stype, ! type); else ! cp_pedwarn ("return type specified for `operator %T'", type); } + dname = declarator; type = TREE_TYPE (TREE_OPERAND (declarator, 0)); maybe_globalize_type (type); *************** *** 8794,8799 **** --- 8685,8694 ---- { if (IDENTIFIER_OPNAME_P (declarator)) + #if 0 /* How could this happen? */ error ("operator `%s' declared void", operator_name_string (declarator)); + #else + my_friendly_abort (356); + #endif else error ("variable or field `%s' declared void", name); *************** *** 8903,8910 **** if (ctype == NULL_TREE) { ! register int op = IDENTIFIER_OPNAME_P (declarator); ! error ("can't make %s `%s' into a method -- not in a class", ! op ? "operator" : "function", ! op ? operator_name_string (declarator) : IDENTIFIER_POINTER (declarator)); return void_type_node; } --- 8798,8803 ---- if (ctype == NULL_TREE) { ! cp_error ("can't make `%D' into a method -- not in a class", ! declarator); return void_type_node; } *************** *** 9005,9022 **** if (friendp) { - tree t; - /* Friends are treated specially. */ if (ctype == current_class_type) warning ("member functions are implicitly friends of their class"); ! else if (decl && (t = DECL_NAME (decl))) ! { ! /* ARM $13.4.3 */ ! if (t == ansi_opname[(int) MODIFY_EXPR]) ! pedwarn ("operator `=' must be a member function"); ! else ! return do_friend (ctype, declarator, decl, ! last_function_parms, flags, quals); ! } else return void_type_node; --- 8898,8907 ---- if (friendp) { /* Friends are treated specially. */ if (ctype == current_class_type) warning ("member functions are implicitly friends of their class"); ! else if (decl && DECL_NAME (decl)) ! return do_friend (ctype, declarator, decl, ! last_function_parms, flags, quals); else return void_type_node; *************** *** 9035,9045 **** error ("static member `%s' must be defined separately from its declaration", IDENTIFIER_POINTER (declarator)); ! /* Note that initialization of const members is not ! mentioned in the ARM or draft ANSI standard explicitly, ! and it appears to be in common practice. However, ! reading the draft section 9.2.2, it does say that a ! member declarator can't have an initializer--it does ! not except constant members, which also qualify as ! member-declarators. */ else if (!pedantic && (!constp || flag_ansi)) warning ("ANSI C++ forbids initialization of %s `%s'", --- 8920,8929 ---- error ("static member `%s' must be defined separately from its declaration", IDENTIFIER_POINTER (declarator)); ! /* Note that initialization of const members is prohibited ! by the draft ANSI standard, though it appears to be in ! common practice. 12.6.2: The argument list is used to ! initialize the named nonstatic member.... This (or an ! aggregate) is the only way to initialize nonstatic const ! and reference members. */ else if (!pedantic && (!constp || flag_ansi)) warning ("ANSI C++ forbids initialization of %s `%s'", *************** *** 9104,9118 **** } - /* ARM $13.4.3: operator= must be a nonstatic member fn. - ARM $13.4.4: operator() must be a nonstatic member fn. - ARM $13.4.5: operator[] must be a nonstatic member fn. - ARM $13.4.6: operator-> must be a nonstatic member fn. */ - if (declarator == ansi_opname[(int) MODIFY_EXPR] - || declarator == ansi_opname[(int) CALL_EXPR] - || declarator == ansi_opname[(int) ARRAY_REF] - || declarator == ansi_opname[(int) COMPONENT_REF]) - pedwarn ("`operator %s' must be a member function", - operator_name_string (declarator)); - if (current_lang_name == lang_name_cplusplus && ! (IDENTIFIER_LENGTH (original_name) == 4 --- 8988,8991 ---- *************** *** 9188,9192 **** && ! ctype && ! strcmp (IDENTIFIER_POINTER (original_name), "main")) ! warning ("cannot inline function `main'"); else if (last && last != void_list_node) cp_warning ("cannot inline function `%D' which takes `...'", original_name); --- 9061,9065 ---- && ! ctype && ! strcmp (IDENTIFIER_POINTER (original_name), "main")) ! error ("cannot inline function `main'"); else if (last && last != void_list_node) cp_warning ("cannot inline function `%D' which takes `...'", original_name); *************** *** 9218,9223 **** if (staticp == 1) { ! error ("cannot declare member `%s' to have static linkage", ! lang_printable_name (decl)); staticp = 0; RIDBIT_RESET (RID_STATIC, specbits); --- 9091,9096 ---- if (staticp == 1) { ! cp_error ("static member `%D' re-declared as static", ! decl); staticp = 0; RIDBIT_RESET (RID_STATIC, specbits); *************** *** 9225,9230 **** if (RIDBIT_SETP (RID_EXTERN, specbits)) { ! error ("cannot explicitly declare member `%s' to have extern linkage", ! lang_printable_name (decl)); RIDBIT_RESET (RID_EXTERN, specbits); } --- 9098,9103 ---- if (RIDBIT_SETP (RID_EXTERN, specbits)) { ! cp_error ("cannot explicitly declare member `%#D' to have extern linkage", ! decl); RIDBIT_RESET (RID_EXTERN, specbits); } *************** *** 9651,9654 **** --- 9524,9549 ---- } + /* An operator with this name can be either unary or binary. */ + int ambi_op_p (name) + tree name; + { + return (name == ansi_opname [(int) INDIRECT_REF] + || name == ansi_opname [(int) ADDR_EXPR] + || name == ansi_opname [(int) NEGATE_EXPR] + || name == ansi_opname[(int) POSTINCREMENT_EXPR] + || name == ansi_opname[(int) POSTDECREMENT_EXPR] + || name == ansi_opname [(int) CONVERT_EXPR]); + } + + /* An operator with this name can only be unary. */ + int unary_op_p (name) + tree name; + { + return (name == ansi_opname [(int) TRUTH_NOT_EXPR] + || name == ansi_opname [(int) BIT_NOT_EXPR] + || name == ansi_opname [(int) COMPONENT_REF] + || OPERATOR_TYPENAME_P (name)); + } + /* Do a little sanity-checking on how they declared their operator. */ static void *************** *** 9658,9715 **** { tree argtypes = TYPE_ARG_TYPES (TREE_TYPE (decl)); ! if (DECL_STATIC_FUNCTION_P (decl)) { ! if (DECL_NAME (decl) == ansi_opname[(int) NEW_EXPR]) { ! if (virtualp) ! error ("`operator new' cannot be declared virtual"); ! ! /* Take care of function decl if we had syntax errors. */ ! if (argtypes == NULL_TREE) ! TREE_TYPE (decl) = ! build_function_type (ptr_type_node, ! hash_tree_chain (integer_type_node, ! void_list_node)); else ! decl = coerce_new_type (TREE_TYPE (decl)); } ! else if (DECL_NAME (decl) == ansi_opname[(int) DELETE_EXPR]) { ! if (virtualp) ! error ("`operator delete' cannot be declared virtual"); ! if (argtypes == NULL_TREE) ! TREE_TYPE (decl) = ! build_function_type (void_type_node, ! hash_tree_chain (ptr_type_node, ! void_list_node)); else ! decl = coerce_delete_type (TREE_TYPE (decl)); } ! else ! cp_error ("`%D' cannot be a static member function", decl); ! } ! else if (DECL_NAME (decl) == ansi_opname[(int) MODIFY_EXPR]) ! { ! tree parmtypes; ! tree parmtype; ! ! if (argtypes == NULL_TREE) { ! cp_error ("too few arguments to `%D'", decl); ! return; } ! parmtypes = TREE_CHAIN (argtypes); ! parmtype = parmtypes ? TREE_VALUE (parmtypes) : void_type_node; ! ! if (TREE_CODE (parmtype) == REFERENCE_TYPE ! && TREE_TYPE (parmtype) == current_class_type) { ! TYPE_HAS_ASSIGN_REF (current_class_type) = 1; ! TYPE_GETS_ASSIGN_REF (current_class_type) = 1; ! if (TYPE_READONLY (TREE_TYPE (parmtype))) ! TYPE_GETS_CONST_INIT_REF (current_class_type) = 1; } } } --- 9553,9710 ---- { tree argtypes = TYPE_ARG_TYPES (TREE_TYPE (decl)); + int methodp = (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE); + tree name = DECL_NAME (decl); ! if (name == ansi_opname[(int) NEW_EXPR]) { ! #if 0 /* When the compiler encounters the definition of A::operator new, it ! doesn't look at the class declaration to find out if it's static. */ ! my_friendly_assert (!methodp, 355); ! #endif ! ! /* Take care of function decl if we had syntax errors. */ ! if (argtypes == NULL_TREE) ! TREE_TYPE (decl) = ! build_function_type (ptr_type_node, ! hash_tree_chain (integer_type_node, ! void_list_node)); ! else ! decl = coerce_new_type (TREE_TYPE (decl)); ! } ! else if (name == ansi_opname[(int) DELETE_EXPR]) ! { ! #if 0 ! my_friendly_assert (!methodp, 355); ! #endif ! ! if (argtypes == NULL_TREE) ! TREE_TYPE (decl) = ! build_function_type (void_type_node, ! hash_tree_chain (ptr_type_node, ! void_list_node)); ! else ! decl = coerce_delete_type (TREE_TYPE (decl)); ! } ! /* 13.4.0.3 */ ! else if (name == ansi_opname[(int) COND_EXPR]) ! error("`operator ?:' cannot be overloaded"); ! else ! { ! /* An operator function must either be a non-static member function ! or have at least one parameter of a class, a reference to a class, ! an enumeration, or a reference to an enumeration. 13.4.0.6 */ ! if (! methodp) { ! if (OPERATOR_TYPENAME_P (name) ! || name == ansi_opname[(int) CALL_EXPR] ! || name == ansi_opname[(int) MODIFY_EXPR] ! || name == ansi_opname[(int) COMPONENT_REF] ! || name == ansi_opname[(int) ARRAY_REF]) ! cp_error ("`%D' must be a nonstatic member function", decl); else ! { ! tree p = argtypes; ! ! if (p) ! for (; TREE_VALUE (p) != void_type_node ; p = TREE_CHAIN (p)) ! { ! tree arg = TREE_VALUE (p); ! if (TREE_CODE (arg) == REFERENCE_TYPE) ! arg = TREE_TYPE (arg); ! ! /* This lets bad template code slip through. */ ! if (IS_AGGR_TYPE (arg) ! || TREE_CODE (arg) == ENUMERAL_TYPE ! || TREE_CODE (arg) == TEMPLATE_TYPE_PARM) ! goto foundaggr; ! } ! cp_error ! ("`%D' must have an argument of class or enumerated type", ! decl); ! foundaggr: ! ; ! } } ! ! if (name == ansi_opname[(int) CALL_EXPR] ! || name == ansi_opname[(int) METHOD_CALL_EXPR]) ! return; /* no restrictions on args */ ! ! if (name == ansi_opname[(int) MODIFY_EXPR]) { ! tree parmtype; ! ! if (list_length (argtypes) != 3 && methodp) ! { ! cp_error ("`%D' must take exactly one argument", decl); ! return; ! } ! parmtype = TREE_VALUE (TREE_CHAIN (argtypes)); ! if (TREE_CODE (parmtype) == REFERENCE_TYPE ! && TREE_TYPE (parmtype) == current_class_type) ! { ! TYPE_HAS_ASSIGN_REF (current_class_type) = 1; ! TYPE_GETS_ASSIGN_REF (current_class_type) = 1; ! if (TYPE_READONLY (TREE_TYPE (parmtype))) ! TYPE_GETS_CONST_INIT_REF (current_class_type) = 1; ! } ! } ! else if (ambi_op_p (name)) ! { ! if (list_length (argtypes) == 2) ! /* prefix */; ! else if (list_length (argtypes) == 3) ! { ! if ((name == ansi_opname[(int) POSTINCREMENT_EXPR] ! || name == ansi_opname[(int) POSTDECREMENT_EXPR]) ! && TREE_VALUE (TREE_CHAIN (argtypes)) != integer_type_node) ! { ! if (methodp) ! cp_error ("postfix `%D' must take `int' as its argument", ! decl); ! else ! cp_error ! ("postfix `%D' must take `int' as its second argument", ! decl); ! } ! } else ! { ! if (methodp) ! cp_error ("`%D' must take either zero or one argument", decl); ! else ! cp_error ("`%D' must take either one or two arguments", decl); ! } } ! else if (unary_op_p (name)) { ! if (list_length (argtypes) != 2) ! { ! if (methodp) ! cp_error ("`%D' must take `void'", decl); ! else ! cp_error ("`%D' must take exactly one argument", decl); ! } } ! else /* if (binary_op_p (name)) */ { ! if (list_length (argtypes) != 3) ! { ! if (methodp) ! cp_error ("`%D' must take exactly one argument", decl); ! else ! cp_error ("`%D' must take exactly two arguments", decl); ! } } + + /* 13.4.0.8 */ + if (argtypes) + for (; argtypes != void_list_node ; argtypes = TREE_CHAIN (argtypes)) + if (TREE_PURPOSE (argtypes)) + { + TREE_PURPOSE (argtypes) = NULL_TREE; + cp_error ("`%D' cannot have default arguments", decl); + } } } *************** *** 9809,9813 **** if (binfo) { ! error ("derived union `%s' invalid", IDENTIFIER_POINTER (name)); binfo = NULL_TREE; } --- 9804,9808 ---- if (binfo) { ! cp_error ("derived union `%T' invalid", name); binfo = NULL_TREE; } *************** *** 9944,9949 **** != (CLASSTYPE_DECLARED_EXCEPTION (ref) == 1))) { ! error ("type `%s' is both exception and aggregate type", ! IDENTIFIER_POINTER (name)); CLASSTYPE_DECLARED_EXCEPTION (ref) = (tag_code == exception_type); } --- 9939,9943 ---- != (CLASSTYPE_DECLARED_EXCEPTION (ref) == 1))) { ! cp_error ("type `%T' is both exception and aggregate type", ref); CLASSTYPE_DECLARED_EXCEPTION (ref) = (tag_code == exception_type); } *************** *** 9965,9970 **** if (TREE_VALUE (tt1) != TYPE_IDENTIFIER (BINFO_TYPE (TREE_VEC_ELT (tt2, i)))) { ! error ("redeclaration of derivation chain of type `%s'", ! IDENTIFIER_POINTER (name)); break; } --- 9959,9964 ---- if (TREE_VALUE (tt1) != TYPE_IDENTIFIER (BINFO_TYPE (TREE_VEC_ELT (tt2, i)))) { ! cp_error ("redeclaration of derivation chain of type `%#T'", ! ref); break; } *************** *** 10140,10144 **** enumtype = lookup_tag (ENUMERAL_TYPE, name, b, 1); ! if (enumtype == NULL_TREE || TREE_CODE (enumtype) != ENUMERAL_TYPE) { enumtype = make_node (ENUMERAL_TYPE); --- 10134,10140 ---- enumtype = lookup_tag (ENUMERAL_TYPE, name, b, 1); ! if (enumtype != NULL_TREE && TREE_CODE (enumtype) == ENUMERAL_TYPE) ! cp_error ("multiple definition of enum `%T'", enumtype); ! else { enumtype = make_node (ENUMERAL_TYPE); *************** *** 10151,10162 **** if (TYPE_VALUES (enumtype) != NULL_TREE) ! { ! /* This enum is a named one that has been declared already. */ ! error ("redeclaration of `enum %s'", IDENTIFIER_POINTER (name)); ! ! /* Completely replace its old definition. ! The old enumerators remain defined, however. */ ! TYPE_VALUES (enumtype) = NULL_TREE; ! } /* Initially, set up this enum as like `int' --- 10147,10153 ---- if (TYPE_VALUES (enumtype) != NULL_TREE) ! /* Completely replace its old definition. ! The old enumerators remain defined, however. */ ! TYPE_VALUES (enumtype) = NULL_TREE; /* Initially, set up this enum as like `int' *************** *** 10294,10298 **** if (TREE_CODE (value) == INTEGER_CST) ! constant_expression_warning (value); else { --- 10285,10292 ---- if (TREE_CODE (value) == INTEGER_CST) ! { ! value = default_conversion (value); ! constant_expression_warning (value); ! } else { *************** *** 11118,11121 **** --- 11112,11116 ---- /* Label to use if this function is supposed to return a value. */ tree no_return_label = NULL_TREE; + tree decls = NULL_TREE; /* When we get some parse errors, we can end up without a *************** *** 11292,11296 **** /* End of destructor. */ ! expand_end_bindings (NULL_TREE, 1, 0); poplevel (2, 0, 0); /* XXX change to 1 */ --- 11287,11291 ---- /* End of destructor. */ ! expand_end_bindings (NULL_TREE, getdecls() != NULL_TREE, 0); poplevel (2, 0, 0); /* XXX change to 1 */ *************** *** 11354,11358 **** if (call_poplevel) { ! tree decls = getdecls (); if (flag_handle_exceptions == 2) deactivate_exception_cleanups (); --- 11349,11353 ---- if (call_poplevel) { ! decls = getdecls (); if (flag_handle_exceptions == 2) deactivate_exception_cleanups (); *************** *** 11486,11491 **** if (call_poplevel) { ! expand_end_bindings (getdecls (), 1, 0); ! poplevel (1, 1, 0); } --- 11481,11486 ---- if (call_poplevel) { ! expand_end_bindings (decls = getdecls (), decls != NULL_TREE, 0); ! poplevel (decls != NULL_TREE, 1, 0); } *************** *** 11616,11621 **** /* Generate rtl for function exit. */ ! expand_function_end (input_filename, lineno); ! expand_end_bindings (0, 0, 0); /* This must come after expand_function_end because cleanups might --- 11611,11615 ---- /* Generate rtl for function exit. */ ! expand_function_end (input_filename, lineno, 1); /* This must come after expand_function_end because cleanups might *************** *** 11724,11728 **** current_function_decl = NULL_TREE; named_label_uses = NULL_TREE; - clear_anon_parm_name (); } --- 11718,11721 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-decl2.c gcc-2.5.5/cp-decl2.c *** gcc-2.5.4/cp-decl2.c Fri Oct 8 15:00:37 1993 --- gcc-2.5.5/cp-decl2.c Wed Nov 24 00:17:53 1993 *************** *** 501,505 **** warn_uninitialized = (setting ? 2 : 0); warn_template_debugging = setting; ! #if 0 warn_enum_clash = setting; #endif --- 501,505 ---- warn_uninitialized = (setting ? 2 : 0); warn_template_debugging = setting; ! #if 1 /* Why was this disabled? -jason */ warn_enum_clash = setting; #endif *************** *** 980,984 **** if (code != POINTER_TYPE) { ! error ("non-pointer type to `delete'"); return error_mark_node; } --- 980,985 ---- if (code != POINTER_TYPE) { ! cp_error ("type `%#T' argument given to `delete', expected pointer", ! type); return error_mark_node; } *************** *** 1016,1020 **** /* Sanity check: report error if this function FUNCTION is not really a member of the class (CTYPE) it is supposed to belong to. ! CNAME and FLAGS are the same here as they are for grokclassfn above. */ void --- 1017,1021 ---- /* Sanity check: report error if this function FUNCTION is not really a member of the class (CTYPE) it is supposed to belong to. ! CNAME is the same here as it is for grokclassfn above. */ void *************** *** 1025,1029 **** tree fndecl; int need_quotes = 0; - char *err_name; tree method_vec = CLASSTYPE_METHOD_VEC (ctype); tree *methods = 0; --- 1026,1029 ---- *************** *** 1056,1091 **** } - if (fn_name == ansi_opname[(int) TYPE_EXPR]) - { - if (TYPE_HAS_CONVERSION (ctype)) - err_name = "such type conversion operator"; - } - else if (IDENTIFIER_OPNAME_P (fn_name)) - { - err_name = (char *)alloca (1024); - sprintf (err_name, "`operator %s'", operator_name_string (fn_name)); - } - else - { - err_name = IDENTIFIER_POINTER (fn_name); - need_quotes = 1; - } - if (methods != end) ! if (need_quotes) ! error ("argument list for `%s' does not match any in class `%s'", ! err_name, IDENTIFIER_POINTER (cname)); ! else ! error ("argument list for %s does not match any in class `%s'", ! err_name, IDENTIFIER_POINTER (cname)); else { methods = 0; ! if (need_quotes) ! error ("no `%s' member function declared in class `%s'", ! err_name, IDENTIFIER_POINTER (cname)); ! else ! error ("no %s declared in class `%s'", ! err_name, IDENTIFIER_POINTER (cname)); } --- 1056,1067 ---- } if (methods != end) ! cp_error ("argument list for `%D' does not match any in class `%T'", ! fn_name, ctype); else { methods = 0; ! cp_error ("no `%D' member function declared in class `%T'", ! fn_name, ctype); } *************** *** 1597,1600 **** --- 1573,1583 ---- else TREE_OPERAND (decl, 0) = TREE_OPERAND (tmp, 0); + + last = grokdeclarator (TREE_OPERAND (decl, 0), + TREE_TYPE (decl), + TYPENAME, 0, NULL_TREE); + TREE_OPERAND (tmp, 0) = build_typename_overload (last); + TREE_TYPE (TREE_OPERAND (tmp, 0)) = last; + if (parms && TREE_CODE (TREE_VALUE (parms)) == TREE_LIST) *************** *** 1606,1610 **** { if (TREE_VALUE (parms) != void_type_node) ! error ("operator requires empty parameter list"); else /* Canonicalize parameter lists. */ --- 1589,1594 ---- { if (TREE_VALUE (parms) != void_type_node) ! cp_error ("`operator %T' requires empty parameter list", ! last); else /* Canonicalize parameter lists. */ *************** *** 1612,1620 **** } - last = grokdeclarator (TREE_OPERAND (decl, 0), - TREE_TYPE (decl), - TYPENAME, 0, NULL_TREE); - TREE_OPERAND (tmp, 0) = build_typename_overload (last); - TREE_TYPE (TREE_OPERAND (tmp, 0)) = last; return tmp; } --- 1596,1599 ---- *************** *** 1651,1660 **** } - if (call_required) - error ("operator construct requires parameter list"); - last = grokdeclarator (TREE_OPERAND (decl, 0), TREE_TYPE (decl), TYPENAME, 0, NULL_TREE); tmp = build_parse_node (CALL_EXPR, build_typename_overload (last), void_list_node, NULL_TREE); --- 1630,1640 ---- } last = grokdeclarator (TREE_OPERAND (decl, 0), TREE_TYPE (decl), TYPENAME, 0, NULL_TREE); + + if (call_required) + cp_error ("`operator %T' construct requires parameter list", last); + tmp = build_parse_node (CALL_EXPR, build_typename_overload (last), void_list_node, NULL_TREE); *************** *** 1783,1793 **** rval = build_parse_node (SCOPE_REF, cname, name); ! /* Don't need to push the scope here, but we do need to return ! a SCOPE_REF for something like ! class foo { typedef int bar (foo::*foo_fn)(void); }; */ ! if (ctype == current_class_type) return rval; #if NEW_CLASS_SCOPING push_nested_class (ctype, 3); --- 1763,1775 ---- rval = build_parse_node (SCOPE_REF, cname, name); ! /* Don't need to push the scope if we're already in it. ! We also don't need to push the scope for a ptr-to-member/method. */ ! if (ctype == current_class_type || TREE_CODE (name) != IDENTIFIER_NODE) return rval; + /* We do need to push the scope in this case, since CTYPE helps + determine subsequent intializers (i.e., Foo::Bar x = foo_enum_1;). */ + #if NEW_CLASS_SCOPING push_nested_class (ctype, 3); *************** *** 1807,1814 **** /* CONSTRUCTOR_NAME: ! Return the name for the constructor (or destructor) for the specified ! class. Argument can be RECORD_TYPE, TYPE_DECL, or IDENTIFIER_NODE. */ tree ! constructor_name (thing) tree thing; { --- 1789,1798 ---- /* CONSTRUCTOR_NAME: ! Return the name for the constructor (or destructor) for the ! specified class. Argument can be RECORD_TYPE, TYPE_DECL, or ! IDENTIFIER_NODE. When given a template, this routine doesn't ! lose the specialization. */ tree ! constructor_name_full (thing) tree thing; { *************** *** 1823,1826 **** --- 1807,1824 ---- thing = DECL_NAME (thing); my_friendly_assert (TREE_CODE (thing) == IDENTIFIER_NODE, 197); + return thing; + } + + /* CONSTRUCTOR_NAME: + Return the name for the constructor (or destructor) for the + specified class. Argument can be RECORD_TYPE, TYPE_DECL, or + IDENTIFIER_NODE. When given a template, return the plain + unspecialized name. */ + tree + constructor_name (thing) + tree thing; + { + tree t; + thing = constructor_name_full (thing); t = IDENTIFIER_TEMPLATE (thing); if (!t) *************** *** 2511,2515 **** } ! expand_end_bindings (getdecls (), 1, 0); poplevel (1, 0, 0); pop_momentary (); --- 2509,2513 ---- } ! expand_end_bindings (getdecls(), 1, 0); poplevel (1, 0, 0); pop_momentary (); *************** *** 2632,2636 **** } ! expand_end_bindings (getdecls (), 1, 0); poplevel (1, 0, 0); pop_momentary (); --- 2630,2634 ---- } ! expand_end_bindings (getdecls(), 1, 0); poplevel (1, 0, 0); pop_momentary (); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-errfn.c gcc-2.5.5/cp-errfn.c *** gcc-2.5.4/cp-errfn.c Tue Nov 16 04:03:59 1993 --- gcc-2.5.5/cp-errfn.c Wed Nov 24 00:18:05 1993 *************** *** 36,39 **** --- 36,41 ---- extern int cp_line_of PROTO((tree)); + #define STRDUP(f) (ap = (char *) alloca (strlen (f) +1), strcpy (ap, (f)), ap) + #define NARGS 3 #define arglist a1, a2, a3 *************** *** 51,61 **** char *fmt; char *f; int arg; HOST_WIDE_INT args[NARGS]; ! ARGSINIT; ! ! fmt = (char *) alloca (strlen (format) + 1); ! strcpy (fmt, format); for (f = fmt, arg = 0; *f; ++f) { --- 53,64 ---- char *fmt; char *f; + char *ap; int arg; + HOST_WIDE_INT atarg = atarg1 ? a1 : 0; HOST_WIDE_INT args[NARGS]; ! ARGSINIT + fmt = STRDUP(format); + for (f = fmt, arg = 0; *f; ++f) { *************** *** 62,65 **** --- 65,69 ---- cp_printer * function; int alternate; + int maybe_here; /* ignore text */ *************** *** 69,72 **** --- 73,77 ---- alternate = 0; + maybe_here = 0; /* ignore most flags */ *************** *** 73,77 **** while (*f == ' ' || *f == '-' || *f == '+' || *f == '#') { ! if (*f == '#') alternate = 1; ++f; --- 78,84 ---- while (*f == ' ' || *f == '-' || *f == '+' || *f == '#') { ! if (*f == '+') ! maybe_here = 1; ! else if (*f == '#') alternate = 1; ++f; *************** *** 110,122 **** if (function) { ! char *p, *p1; if (arg >= NARGS) abort (); /* Must use a temporary to avoid calling *function twice */ p = (*function) (args[arg], alternate); ! p1 = (char *) alloca (strlen (p) + 1); ! strcpy (p1, p); ! args[arg] = (HOST_WIDE_INT) p1; *f = 's'; } --- 117,130 ---- if (function) { ! char *p; if (arg >= NARGS) abort (); + if (maybe_here && atarg) + atarg = args[arg]; + /* Must use a temporary to avoid calling *function twice */ p = (*function) (args[arg], alternate); ! args[arg] = (HOST_WIDE_INT) STRDUP(p); *f = 's'; } *************** *** 127,134 **** } ! if (atarg1) { ! char *file = cp_file_of ((tree) a1); ! int line = cp_line_of ((tree) a1); (*errfn) (file, line, fmt, ARGSLIST); } --- 135,142 ---- } ! if (atarg) { ! char *file = cp_file_of ((tree) atarg); ! int line = cp_line_of ((tree) atarg); (*errfn) (file, line, fmt, ARGSLIST); } *************** *** 172,175 **** --- 180,192 ---- extern errorfn compiler_error; cp_thing (compiler_error, 0, format, arglist); + } + + void + cp_sprintf (format, arglist) + char *format; + arglist_dcl + { + extern errorfn sprintf; + cp_thing (sprintf, 0, format, arglist); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-error.c gcc-2.5.5/cp-error.c *** gcc-2.5.4/cp-error.c Fri Oct 8 20:43:56 1993 --- gcc-2.5.5/cp-error.c Wed Nov 24 00:18:15 1993 *************** *** 25,32 **** #include ! typedef char* cp_printer PROTO((tree, int)); #define D decl_as_string #define E expr_as_string #define T type_as_string --- 25,34 ---- #include ! typedef char* cp_printer (); + #define C code_as_string #define D decl_as_string #define E expr_as_string + #define L language_as_string #define T type_as_string *************** *** 39,43 **** _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x20 */ _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x30 */ ! _, _, _, _, D, E, _, _, _, _, _, _, _, _, _, _, /* 0x40 */ _, _, _, _, T, _, _, _, _, _, _, _, _, _, _, _, /* 0x50 */ _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x60 */ --- 41,45 ---- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x20 */ _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x30 */ ! _, _, _, C, D, E, _, _, _, _, _, _, L, _, _, _, /* 0x40 */ _, _, _, _, T, _, _, _, _, _, _, _, _, _, _, _, /* 0x50 */ _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x60 */ *************** *** 44,49 **** --- 46,53 ---- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x70 */ }; + #undef C #undef D #undef E + #undef L #undef T #undef _ *************** *** 56,63 **** static char *scratch_firstobj; - /* This points to a safe place to resume processing in case an expression - generates an error while we're trying to format it. */ - static int scratch_error_offset; - # define OB_INIT() (scratch_firstobj ? (obstack_free (&scratch_obstack, scratch_firstobj), 0) : 0) # define OB_PUTC(C) (obstack_1grow (&scratch_obstack, (C))) --- 60,63 ---- *************** *** 90,109 **** static int dummy_name; - tree - make_anon_parm_name () - { - char buf[32]; - - sprintf (buf, ANON_PARMNAME_FORMAT, dummy_name++); - return get_identifier (buf); - } - - void - clear_anon_parm_name () - { - /* recycle these names. */ - dummy_name = 0; - } - enum pad { none, before, after }; --- 90,93 ---- *************** *** 124,130 **** } - /* This must be large enough to hold any anonymous parm name. */ - static char anon_buffer[sizeof (ANON_PARMNAME_FORMAT) + 20]; - /* This must be large enough to hold any printed integer or floating-point value. */ --- 108,111 ---- *************** *** 146,151 **** { case ERROR_MARK: ! sprintf (anon_buffer, ANON_PARMNAME_FORMAT, dummy_name++); ! OB_PUTCP (anon_buffer); break; --- 127,131 ---- { case ERROR_MARK: ! OB_PUTS (""); break; *************** *** 160,164 **** dump_type (TREE_VALUE (t), v); /* Can this happen other than for default arguments? */ ! if (TREE_PURPOSE (t)) { OB_PUTS (" = "); --- 140,144 ---- dump_type (TREE_VALUE (t), v); /* Can this happen other than for default arguments? */ ! if (TREE_PURPOSE (t) && v) { OB_PUTS (" = "); *************** *** 257,263 **** variety = "struct"; if (v) { - dump_readonly_or_volatile (t, after); OB_PUTCP (variety); OB_PUTC (' '); --- 237,244 ---- variety = "struct"; + dump_readonly_or_volatile (t, after); + if (v) { OB_PUTCP (variety); OB_PUTC (' '); *************** *** 279,283 **** if (ANON_AGGRNAME_P (name)) { ! OB_PUTS ("(anonymous"); if (!v) { --- 260,264 ---- if (ANON_AGGRNAME_P (name)) { ! OB_PUTS ("'); } else *************** *** 299,303 **** deal with prefix and suffix. ! Arrays must also do this for DECL nodes, like int a[]. */ static void --- 280,285 ---- deal with prefix and suffix. ! Arrays must also do this for DECL nodes, like int a[], and for things like ! int *[]&. */ static void *************** *** 389,393 **** case ARRAY_TYPE: ! dump_type (TREE_TYPE (t), v); break; --- 371,375 ---- case ARRAY_TYPE: ! dump_type_prefix (TREE_TYPE (t), v); break; *************** *** 454,459 **** case ARRAY_TYPE: OB_PUTC ('['); ! OB_PUTI (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (t))) + 1); OB_PUTC (']'); break; --- 436,443 ---- case ARRAY_TYPE: OB_PUTC ('['); ! if (TYPE_DOMAIN (t)) ! OB_PUTI (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (t))) + 1); OB_PUTC (']'); + dump_type_suffix (TREE_TYPE (t), v); break; *************** *** 542,548 **** break; case FIELD_DECL: case PARM_DECL: - case VAR_DECL: if (v) { --- 526,539 ---- break; + case VAR_DECL: + if (VTABLE_NAME_P (DECL_NAME (t))) + { + OB_PUTS ("vtable for "); + dump_type (DECL_CONTEXT (t), v); + break; + } + /* else fall through */ case FIELD_DECL: case PARM_DECL: if (v) { *************** *** 550,563 **** OB_PUTC(' '); } if (DECL_NAME (t)) dump_decl (DECL_NAME (t), v); else ! { ! sprintf (anon_buffer, ANON_PARMNAME_FORMAT, dummy_name++); ! OB_PUTCP (anon_buffer); ! break; ! } if (v) dump_type_suffix (TREE_TYPE (t), v); ! return; case ARRAY_REF: --- 541,558 ---- OB_PUTC(' '); } + /* DECL_CLASS_CONTEXT isn't being set in some cases. Hmm... */ + if (TREE_CODE (t) == FIELD_DECL + || (TREE_CODE (t) == VAR_DECL && DECL_CONTEXT (t) + && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (t))) == 't')) + { + dump_type (DECL_CONTEXT (t), 0); + OB_PUTC2(':', ':'); + } if (DECL_NAME (t)) dump_decl (DECL_NAME (t), v); else ! OB_PUTS (""); if (v) dump_type_suffix (TREE_TYPE (t), v); ! break; case ARRAY_REF: *************** *** 566,570 **** dump_decl (TREE_OPERAND (t, 1), v); OB_PUTC (']'); ! return; /* So that we can do dump_decl in dump_aggr_type and have it work for --- 561,565 ---- dump_decl (TREE_OPERAND (t, 1), v); OB_PUTC (']'); ! break; /* So that we can do dump_decl in dump_aggr_type and have it work for *************** *** 596,601 **** OB_PUTS ("operator "); /* Not exactly IDENTIFIER_TYPE_VALUE. */ ! dump_type (TREE_TYPE (ident_fndecl (t)), 0); ! return; } else if (IDENTIFIER_OPNAME_P (t)) --- 591,596 ---- OB_PUTS ("operator "); /* Not exactly IDENTIFIER_TYPE_VALUE. */ ! dump_type (TREE_TYPE (t), 0); ! break; } else if (IDENTIFIER_OPNAME_P (t)) *************** *** 633,636 **** --- 628,645 ---- break; + case CONST_DECL: + if (NEXT_CODE (t) == ENUMERAL_TYPE) + { + if (DECL_CONTEXT (t)) + { + dump_decl (DECL_CONTEXT (t), 0); + OB_PUTC2 (':', ':'); + } + OB_PUTID (DECL_NAME (t)); + } + else + dump_expr (DECL_INITIAL (t), 0); + break; + default: my_friendly_abort (70); *************** *** 659,669 **** cname = TREE_TYPE (TREE_VALUE (parmtypes)); ! if (DECL_STATIC_FUNCTION_P (t)) ! OB_PUTS ("static "); ! ! if (v && ! IDENTIFIER_TYPENAME_P (name)) { ! dump_type_prefix (TREE_TYPE (fntype), 1); ! OB_PUTC (' '); } --- 668,681 ---- cname = TREE_TYPE (TREE_VALUE (parmtypes)); ! if (v) { ! if (DECL_STATIC_FUNCTION_P (t)) ! OB_PUTS ("static "); ! ! if (! IDENTIFIER_TYPENAME_P (name)) ! { ! dump_type_prefix (TREE_TYPE (fntype), 1); ! OB_PUTC (' '); ! } } *************** *** 687,691 **** if (parmtypes) ! dump_type (parmtypes, 1); else OB_PUTS ("..."); --- 699,703 ---- if (parmtypes) ! dump_type (parmtypes, v); else OB_PUTS ("..."); *************** *** 809,823 **** case PARM_DECL: case FIELD_DECL: ! OB_PUTID (DECL_NAME (t)); ! break; ! case FUNCTION_DECL: ! dump_function_name (t); break; - case CONST_DECL: - dump_expr (DECL_INITIAL (t), 0); - return; - case INTEGER_CST: { --- 821,829 ---- case PARM_DECL: case FIELD_DECL: ! case CONST_DECL: case FUNCTION_DECL: ! dump_decl (t, 0); break; case INTEGER_CST: { *************** *** 891,895 **** OB_PUTC ('\"'); } ! return; case COMPOUND_EXPR: --- 897,901 ---- OB_PUTC ('\"'); } ! break; case COMPOUND_EXPR: *************** *** 905,909 **** dump_expr (TREE_OPERAND (t, 2), 0); OB_PUTC (')'); ! return; case SAVE_EXPR: --- 911,915 ---- dump_expr (TREE_OPERAND (t, 2), 0); OB_PUTC (')'); ! break; case SAVE_EXPR: *************** *** 917,924 **** { sorry ("operand of SAVE_EXPR not understood"); ! scratch_obstack.next_free ! = obstack_base (&scratch_obstack) + scratch_error_offset; } ! return; case NEW_EXPR: --- 923,929 ---- { sorry ("operand of SAVE_EXPR not understood"); ! goto error; } ! break; case NEW_EXPR: *************** *** 927,931 **** dump_expr_list (TREE_CHAIN (TREE_OPERAND (t, 1))); OB_PUTC (')'); ! return; case CALL_EXPR: --- 932,936 ---- dump_expr_list (TREE_CHAIN (TREE_OPERAND (t, 1))); OB_PUTC (')'); ! break; case CALL_EXPR: *************** *** 934,938 **** dump_expr_list (TREE_OPERAND (t, 1)); OB_PUTC (')'); ! return; case WITH_CLEANUP_EXPR: --- 939,943 ---- dump_expr_list (TREE_OPERAND (t, 1)); OB_PUTC (')'); ! break; case WITH_CLEANUP_EXPR: *************** *** 940,944 **** builds a general cleanup, there's no way to represent it. */ dump_expr (TREE_OPERAND (t, 0), 0); ! return; case TARGET_EXPR: --- 945,949 ---- builds a general cleanup, there's no way to represent it. */ dump_expr (TREE_OPERAND (t, 0), 0); ! break; case TARGET_EXPR: *************** *** 950,954 **** if (TREE_OPERAND (t, 1)) dump_expr (TREE_OPERAND (t, 1), 0); ! return; case MODIFY_EXPR: --- 955,959 ---- if (TREE_OPERAND (t, 1)) dump_expr (TREE_OPERAND (t, 1), 0); ! break; case MODIFY_EXPR: *************** *** 975,979 **** case NE_EXPR: dump_binary_op (opname_tab[(int) TREE_CODE (t)], t); ! return; case CEIL_DIV_EXPR: --- 980,984 ---- case NE_EXPR: dump_binary_op (opname_tab[(int) TREE_CODE (t)], t); ! break; case CEIL_DIV_EXPR: *************** *** 981,985 **** case ROUND_DIV_EXPR: dump_binary_op ("/", t); ! return; case CEIL_MOD_EXPR: --- 986,990 ---- case ROUND_DIV_EXPR: dump_binary_op ("/", t); ! break; case CEIL_MOD_EXPR: *************** *** 987,999 **** case ROUND_MOD_EXPR: dump_binary_op ("%", t); ! return; case COMPONENT_REF: dump_binary_op (".", t); ! return; case CONVERT_EXPR: dump_unary_op ("+", t, nop); ! return; case ADDR_EXPR: --- 992,1004 ---- case ROUND_MOD_EXPR: dump_binary_op ("%", t); ! break; case COMPONENT_REF: dump_binary_op (".", t); ! break; case CONVERT_EXPR: dump_unary_op ("+", t, nop); ! break; case ADDR_EXPR: *************** *** 1003,1007 **** else dump_unary_op ("&", t, nop); ! return; case INDIRECT_REF: --- 1008,1012 ---- else dump_unary_op ("&", t, nop); ! break; case INDIRECT_REF: *************** *** 1017,1021 **** else dump_unary_op ("*", t, nop); ! return; case NEGATE_EXPR: --- 1022,1026 ---- else dump_unary_op ("*", t, nop); ! break; case NEGATE_EXPR: *************** *** 1025,1029 **** case PREINCREMENT_EXPR: dump_unary_op (opname_tab [(int)TREE_CODE (t)], t, nop); ! return; case POSTDECREMENT_EXPR: --- 1030,1034 ---- case PREINCREMENT_EXPR: dump_unary_op (opname_tab [(int)TREE_CODE (t)], t, nop); ! break; case POSTDECREMENT_EXPR: *************** *** 1033,1037 **** OB_PUTCP (opname_tab[(int)TREE_CODE (t)]); OB_PUTC (')'); ! return; case NON_LVALUE_EXPR: --- 1038,1042 ---- OB_PUTCP (opname_tab[(int)TREE_CODE (t)]); OB_PUTC (')'); ! break; case NON_LVALUE_EXPR: *************** *** 1057,1065 **** } dump_expr (TREE_OPERAND (t, 0), 0); ! return; case NOP_EXPR: ! dump_expr (TREE_OPERAND (t, 0), 0); ! return; case CONSTRUCTOR: --- 1062,1070 ---- } dump_expr (TREE_OPERAND (t, 0), 0); ! break; case NOP_EXPR: ! dump_expr (TREE_OPERAND (t, 0), nop); ! break; case CONSTRUCTOR: *************** *** 1067,1071 **** dump_expr_list (CONSTRUCTOR_ELTS (t), 0); OB_PUTC ('}'); ! return; /* This list is incomplete, but should suffice for now. --- 1072,1076 ---- dump_expr_list (CONSTRUCTOR_ELTS (t), 0); OB_PUTC ('}'); ! break; /* This list is incomplete, but should suffice for now. *************** *** 1073,1077 **** `report_error_function'. That could cause an infinite loop. */ default: ! sorry ("`%s' not supported for default parameters", tree_code_name[(int) TREE_CODE (t)]); --- 1078,1082 ---- `report_error_function'. That could cause an infinite loop. */ default: ! sorry ("`%s' not supported by dump_expr", tree_code_name[(int) TREE_CODE (t)]); *************** *** 1078,1084 **** /* fall through to ERROR_MARK... */ case ERROR_MARK: ! scratch_obstack.next_free ! = obstack_base (&scratch_obstack) + scratch_error_offset; ! return; } } --- 1083,1089 ---- /* fall through to ERROR_MARK... */ case ERROR_MARK: ! error: ! OB_PUTCP ("/* error */"); ! break; } } *************** *** 1142,1146 **** OB_INIT (); ! dump_expr (decl, 0); OB_FINISH (); --- 1147,1151 ---- OB_INIT (); ! dump_expr (decl, 1); OB_FINISH (); *************** *** 1183,1185 **** --- 1188,1216 ---- else return DECL_SOURCE_LINE (t); + } + + char * + code_as_string (c, v) + enum tree_code c; + int v; + { + return tree_code_name [c]; + } + + char * + language_as_string (c, v) + enum languages c; + int v; + { + switch (c) + { + case lang_c: + return "C"; + + case lang_cplusplus: + return "C++"; + + default: + my_friendly_abort (355); + } } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-expr.c gcc-2.5.5/cp-expr.c *** gcc-2.5.4/cp-expr.c Tue Sep 28 21:23:18 1993 --- gcc-2.5.5/cp-expr.c Wed Nov 24 00:18:23 1993 *************** *** 76,80 **** --- 76,82 ---- tree fn_type = TREE_TYPE (TREE_TYPE (func)); tree return_type = TREE_TYPE (fn_type); + tree call_exp; rtx call_target, return_target; + int pcc_struct_return = 0; /* The expression `init' wants to initialize what *************** *** 120,139 **** else { call_target = target; } - if (call_target) ! preserve_temp_slots (call_target); preserve_temp_slots (DECL_RTL (slot)); ! push_temp_slots (); ! return_target = expand_expr (build (CALL_EXPR, type, func, args, 0), ! call_target, mode, 0); free_temp_slots (); - pop_temp_slots (); - if (call_target == 0) ! call_target = return_target; ! else if (call_target != return_target) { if (GET_MODE (return_target) == BLKmode) emit_block_move (call_target, return_target, expr_size (exp), --- 122,172 ---- else { + #ifdef PCC_STATIC_STRUCT_RETURN + pcc_struct_return = 1; + call_target = 0; + #else call_target = target; + #endif } if (call_target) ! { ! preserve_temp_slots (call_target); ! ! /* Make this a valid memory address now. The code below assumes ! that it can compare rtx and make assumptions based on the ! result. The assumptions are true only if the address was ! valid to begin with. */ ! call_target = validize_mem (call_target); ! } ! preserve_temp_slots (DECL_RTL (slot)); ! call_exp = build (CALL_EXPR, type, func, args, 0); ! TREE_SIDE_EFFECTS (call_exp) = 1; ! return_target = expand_expr (call_exp, call_target, mode, 0); free_temp_slots (); if (call_target == 0) ! { ! if (pcc_struct_return) ! { ! tree init = build (RTL_EXPR, type, 0, return_target); ! TREE_ADDRESSABLE (init) = 1; ! expand_aggr_init (slot, init, 0); ! if (TYPE_NEEDS_DESTRUCTOR (type)) ! { ! init = build (RTL_EXPR, build_reference_type (type), 0, ! XEXP (return_target, 0)); ! init = maybe_build_cleanup (convert_from_reference (init)); ! if (init != NULL_TREE) ! expand_expr (init, 0, 0, 0); ! } ! call_target = return_target = DECL_RTL (slot); ! } ! else ! call_target = return_target; ! } ! ! if (call_target != return_target) { + my_friendly_assert (! TYPE_NEEDS_CONSTRUCTING (type), 317); if (GET_MODE (return_target) == BLKmode) emit_block_move (call_target, return_target, expr_size (exp), diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-gc.c gcc-2.5.5/cp-gc.c *** gcc-2.5.4/cp-gc.c Fri Sep 24 16:56:51 1993 --- gcc-2.5.5/cp-gc.c Wed Nov 24 00:18:30 1993 *************** *** 417,420 **** --- 417,602 ---- } + /* Return the Type_info node associated with the expression EXP. If EXP is + a reference to a polymorphic class, return the dynamic type; otherwise + return the static type of the expression. */ + tree + build_typeid (exp) + tree exp; + { + tree type; + + if (exp == error_mark_node) + return error_mark_node; + + type = TREE_TYPE (exp); + + /* if b is an instance of B, typeid(b) == typeid(B). Do this before + reference trickiness. */ + if (TREE_CODE (exp) == VAR_DECL && TREE_CODE (type) == RECORD_TYPE) + return get_typeid (type); + + /* Apply trivial conversion T -> T& for dereferenced ptrs. */ + if (TREE_CODE (type) == RECORD_TYPE) + type = build_reference_type (type); + + /* If exp is a reference to polymorphic type, get the real Type_info. */ + if (TREE_CODE (type) == REFERENCE_TYPE && TYPE_VIRTUAL_P (TREE_TYPE (type))) + { + /* build reference to Type_info from vtable. */ + + sorry ("finding Type_info for an object"); + return error_mark_node; + } + + /* otherwise return the Type_info for the static type of the expr. */ + return get_typeid (type); + } + + /* Return the Type_info object for TYPE, creating it if necessary. */ + tree + get_typeid (type) + tree type; + { + if (type == error_mark_node) + return error_mark_node; + + /* Is it useful (and/or correct) to have different typeids for `T &' + and `T'? */ + if (TREE_CODE (type) == REFERENCE_TYPE) + type = TREE_TYPE (type); + + /* build reference to static Type_info */ + #if 1 + sorry ("finding Type_info for a type"); + return error_mark_node; + #else + register tree t = TYPE_TINFO (type); + + if (t) + return t; + + /* ... */ + + #endif + } + + /* Execute a dynamic cast, as described in section 5.2.6 of the 9/93 working + paper. */ + tree + build_dynamic_cast (type, expr) + tree type, expr; + { + enum tree_code tc = TREE_CODE (type); + tree exprtype = TREE_TYPE (expr); + enum tree_code ec = TREE_CODE (exprtype); + tree retval; + + if (type == error_mark_node || expr == error_mark_node) + return error_mark_node; + + switch (tc) + { + case POINTER_TYPE: + if (TREE_TYPE (type) == void_type_node) + break; + /* else fall through */ + case REFERENCE_TYPE: + if (TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE + && TYPE_SIZE (TREE_TYPE (type)) != NULL_TREE) + break; + /* else fall through */ + default: + cp_error ("`%#T' is not a valid type argument for dynamic_cast", type); + error ("(must be either pointer or reference to defined class or void *)"); + return error_mark_node; + } + + /* Apply trivial conversion T -> T& for dereferenced ptrs. */ + if (ec == RECORD_TYPE) + { + exprtype = build_reference_type (exprtype); + ec = REFERENCE_TYPE; + } + + /* the TREE_CODE of exprtype must match that of type. */ + if (ec != tc) + { + cp_error ("`%E' (of type `%#T') fails to be of %s type", expr, exprtype, + tc == POINTER_TYPE ? "pointer" : "reference"); + return error_mark_node; + } + + /* If *type is an unambiguous accessible base class of *exprtype, + convert statically. */ + { + int distance; + tree path; + + distance = get_base_distance (TREE_TYPE (type), TREE_TYPE (exprtype), 1, + &path); + if (distance >= 0) + return build_vbase_path (PLUS_EXPR, type, expr, path, 0); + } + + /* Otherwise *exprtype must be a polymorphic class (have a vtbl). */ + if (TYPE_VIRTUAL_P (TREE_TYPE (exprtype))) + { + /* if TYPE is `void *', return pointer to complete object. */ + if (tc == POINTER_TYPE && TREE_TYPE (type) == void_type_node) + { + /* if b is an object, dynamic_cast(&b) == (void *)&b. */ + if (TREE_CODE (expr) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (expr, 0)) == VAR_DECL + && TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == RECORD_TYPE) + return build1 (NOP_EXPR, type, expr); + + sorry ("finding pointer to complete object"); + return build1 (NOP_EXPR, type, expr); + } + else + { + tree retval; + + /* If we got here, we can't convert statically. Therefore, + dynamic_cast(b) (b an object) cannot succeed. */ + if (ec == REFERENCE_TYPE) + { + if (TREE_CODE (expr) == VAR_DECL + && TREE_CODE (TREE_TYPE (expr)) == RECORD_TYPE) + { + cp_warning ("dynamic_cast of `%#D' to `%#T' can never succeed", + expr, type); + /* cplus_expand_throw (Bad_cast_node); */ + sorry ("throwing Bad_cast"); + return error_mark_node; + } + } + /* Ditto for dynamic_cast(&b). */ + else if (TREE_CODE (expr) == ADDR_EXPR) + { + tree op = TREE_OPERAND (expr, 0); + if (TREE_CODE (op) == VAR_DECL + && TREE_CODE (TREE_TYPE (op)) == RECORD_TYPE) + { + cp_warning ("dynamic_cast of `%E' to `%#T' can never succeed", + expr, type); + retval = build_int_2 (0, 0); + TREE_TYPE (retval) = type; + return retval; + } + } + /* Build run-time conversion. */ + sorry ("run-time type conversion"); + retval = build_int_2 (0, 0); + TREE_TYPE (retval) = type; + return retval; + } + } + + cp_error ("cannot dynamic_cast `%E' (of type `%#T') to type `%#T'", + expr, exprtype, type); + return error_mark_node; + } + /* Build and initialize various sorts of descriptors. Every descriptor node has a name associated with it (the name created by mangling). diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-hash.h gcc-2.5.5/cp-hash.h *** gcc-2.5.4/cp-hash.h Thu Aug 26 18:16:59 1993 --- gcc-2.5.5/cp-hash.h Wed Nov 24 00:18:38 1993 *************** *** 4,13 **** struct resword { char *name; short token; enum rid rid;}; ! #define TOTAL_KEYWORDS 82 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 13 #define MIN_HASH_VALUE 4 ! #define MAX_HASH_VALUE 142 ! /* maximum key range = 139, duplicates = 0 */ #ifdef __GNUC__ --- 4,13 ---- struct resword { char *name; short token; enum rid rid;}; ! #define TOTAL_KEYWORDS 84 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 13 #define MIN_HASH_VALUE 4 ! #define MAX_HASH_VALUE 154 ! /* maximum key range = 151, duplicates = 0 */ #ifdef __GNUC__ *************** *** 21,37 **** static unsigned char asso_values[] = { ! 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, ! 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, ! 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, ! 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, ! 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, ! 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, ! 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, ! 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, ! 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, ! 143, 143, 143, 143, 143, 0, 143, 72, 1, 67, ! 36, 0, 5, 4, 2, 34, 143, 1, 10, 24, ! 27, 0, 34, 143, 26, 0, 8, 14, 26, 53, ! 0, 46, 143, 143, 143, 143, 143, 143, }; register int hval = len; --- 21,37 ---- static unsigned char asso_values[] = { ! 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ! 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ! 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ! 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ! 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ! 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ! 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ! 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ! 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ! 155, 155, 155, 155, 155, 0, 155, 41, 1, 52, ! 25, 0, 14, 43, 28, 60, 155, 4, 19, 4, ! 13, 1, 37, 155, 20, 0, 4, 61, 48, 30, ! 1, 67, 155, 155, 155, 155, 155, 155, }; register int hval = len; *************** *** 68,174 **** {"",}, {"",}, {"__asm__", GCC_ASM_KEYWORD, NORID}, - {"goto", GOTO, NORID,}, - {"",}, - {"__headof__", HEADOF, NORID}, - {"sizeof", SIZEOF, NORID,}, {"this", THIS, NORID,}, ! {"__headof", HEADOF, NORID}, {"except", EXCEPT, NORID /* Extension */,}, {"",}, - {"switch", SWITCH, NORID,}, {"__const__", TYPE_QUAL, RID_CONST}, {"__volatile", TYPE_QUAL, RID_VOLATILE}, - {"typeof", TYPEOF, NORID,}, - {"__volatile__", TYPE_QUAL, RID_VOLATILE}, - {"__classof__", CLASSOF, NORID}, - {"long", TYPESPEC, RID_LONG,}, {"__const", TYPE_QUAL, RID_CONST}, ! {"__classof", CLASSOF, NORID}, ! {"typedef", SCSPEC, RID_TYPEDEF,}, ! {"",}, {"",}, ! {"struct", AGGR, RID_RECORD,}, ! {"__asm", GCC_ASM_KEYWORD, NORID}, {"",}, {"raise", RAISE, NORID /* Extension */,}, {"raises", RAISES, NORID /* Extension */,}, ! {"extern", SCSPEC, RID_EXTERN,}, ! {"for", FOR, NORID,}, ! {"",}, {"",}, {"",}, {"do", DO, NORID,}, {"short", TYPESPEC, RID_SHORT,}, ! {"__extension__", EXTENSION, NORID}, ! {"if", IF, NORID,}, {"delete", DELETE, NORID,}, {"double", TYPESPEC, RID_DOUBLE,}, - {"__signed__", TYPESPEC, RID_SIGNED}, - {"int", TYPESPEC, RID_INT,}, - {"union", AGGR, RID_UNION,}, - {"friend", SCSPEC, RID_FRIEND,}, - {"__alignof__", ALIGNOF, NORID}, - {"headof", HEADOF, NORID,}, - {"",}, - {"__alignof", ALIGNOF, NORID}, - {"enum", ENUM, NORID,}, - {"__attribute", ATTRIBUTE, NORID}, {"",}, - {"__attribute__", ATTRIBUTE, NORID}, - {"__typeof__", TYPEOF, NORID}, - {"try", TRY, NORID /* Extension */,}, - {"template", TEMPLATE, NORID,}, - {"__typeof", TYPEOF, NORID}, - {"operator", OPERATOR, NORID,}, - {"virtual", SCSPEC, RID_VIRTUAL,}, {"__inline", SCSPEC, RID_INLINE}, ! {"",}, {"__inline__", SCSPEC, RID_INLINE}, ! {"",}, {"throw", THROW, NORID /* Extension */,}, - {"private", VISSPEC, RID_PRIVATE,}, - {"while", WHILE, NORID,}, - {"signed", TYPESPEC, RID_SIGNED,}, - {"exception", AGGR, RID_EXCEPTION /* Extension */,}, - {"case", CASE, NORID,}, - {"class", AGGR, RID_CLASS,}, - {"return", RETURN, NORID,}, - {"inline", SCSPEC, RID_INLINE,}, {"",}, {"auto", SCSPEC, RID_AUTO,}, ! {"",}, ! {"__signed", TYPESPEC, RID_SIGNED}, {"break", BREAK, NORID,}, {"const", TYPE_QUAL, RID_CONST,}, {"static", SCSPEC, RID_STATIC,}, - {"",}, - {"new", NEW, NORID,}, - {"classof", CLASSOF, NORID,}, {"all", ALL, NORID /* Extension */,}, - {"",}, {"",}, {"",}, {"",}, {"float", TYPESPEC, RID_FLOAT,}, {"__label__", LABEL, NORID}, ! {"unsigned", TYPESPEC, RID_UNSIGNED,}, {"",}, ! {"register", SCSPEC, RID_REGISTER,}, {"protected", VISSPEC, RID_PROTECTED,}, {"",}, ! {"continue", CONTINUE, NORID,}, {"",}, ! {"asm", ASM_KEYWORD, NORID,}, {"",}, {"",}, ! {"void", TYPESPEC, RID_VOID,}, ! {"mutable", SCSPEC, RID_MUTABLE,}, {"",}, ! {"reraise", RERAISE, NORID /* Extension */,}, ! {"",}, {"",}, {"",}, {"",}, ! {"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"volatile", TYPE_QUAL, RID_VOLATILE,}, {"public", VISSPEC, RID_PUBLIC,}, ! {"",}, {"",}, {"",}, {"",}, {"",}, ! {"char", TYPESPEC, RID_CHAR,}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"default", DEFAULT, NORID,}, ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"catch", CATCH, NORID,}, ! {"overload", OVERLOAD, NORID,}, }; --- 68,176 ---- {"",}, {"",}, {"__asm__", GCC_ASM_KEYWORD, NORID}, {"this", THIS, NORID,}, ! {"__asm", GCC_ASM_KEYWORD, NORID}, {"except", EXCEPT, NORID /* Extension */,}, + {"__headof__", HEADOF, NORID}, + {"enum", ENUM, NORID,}, {"",}, {"__const__", TYPE_QUAL, RID_CONST}, {"__volatile", TYPE_QUAL, RID_VOLATILE}, {"__const", TYPE_QUAL, RID_CONST}, ! {"__volatile__", TYPE_QUAL, RID_VOLATILE}, {"",}, + {"extern", SCSPEC, RID_EXTERN,}, + {"sizeof", SIZEOF, NORID,}, + {"",}, {"",}, + {"__headof", HEADOF, NORID}, + {"typeof", TYPEOF, NORID,}, {"raise", RAISE, NORID /* Extension */,}, {"raises", RAISES, NORID /* Extension */,}, ! {"__extension__", EXTENSION, NORID}, {"do", DO, NORID,}, {"short", TYPESPEC, RID_SHORT,}, ! {"__classof__", CLASSOF, NORID}, {"delete", DELETE, NORID,}, {"double", TYPESPEC, RID_DOUBLE,}, {"",}, {"__inline", SCSPEC, RID_INLINE}, ! {"typeid", TYPEID, NORID,}, {"__inline__", SCSPEC, RID_INLINE}, ! {"for", FOR, NORID,}, ! {"switch", SWITCH, NORID,}, ! {"typedef", SCSPEC, RID_TYPEDEF,}, {"throw", THROW, NORID /* Extension */,}, {"",}, + {"__classof", CLASSOF, NORID}, + {"__alignof__", ALIGNOF, NORID}, + {"signed", TYPESPEC, RID_SIGNED,}, + {"friend", SCSPEC, RID_FRIEND,}, + {"new", NEW, NORID,}, {"auto", SCSPEC, RID_AUTO,}, ! {"asm", ASM_KEYWORD, NORID,}, ! {"goto", GOTO, NORID,}, ! {"operator", OPERATOR, NORID,}, {"break", BREAK, NORID,}, + {"mutable", SCSPEC, RID_MUTABLE,}, + {"template", TEMPLATE, NORID,}, + {"while", WHILE, NORID,}, + {"__alignof", ALIGNOF, NORID}, + {"case", CASE, NORID,}, + {"class", AGGR, RID_CLASS,}, + {"",}, {"",}, {"",}, {"const", TYPE_QUAL, RID_CONST,}, {"static", SCSPEC, RID_STATIC,}, {"all", ALL, NORID /* Extension */,}, {"float", TYPESPEC, RID_FLOAT,}, + {"",}, {"",}, + {"int", TYPESPEC, RID_INT,}, + {"reraise", RERAISE, NORID /* Extension */,}, {"__label__", LABEL, NORID}, ! {"__signed__", TYPESPEC, RID_SIGNED}, ! {"struct", AGGR, RID_RECORD,}, {"",}, ! {"headof", HEADOF, NORID,}, ! {"try", TRY, NORID /* Extension */,}, ! {"__attribute", ATTRIBUTE, NORID}, ! {"if", IF, NORID,}, ! {"__attribute__", ATTRIBUTE, NORID}, ! {"__typeof__", TYPEOF, NORID}, {"protected", VISSPEC, RID_PROTECTED,}, + {"union", AGGR, RID_UNION,}, + {"default", DEFAULT, NORID,}, + {"exception", AGGR, RID_EXCEPTION /* Extension */,}, + {"",}, {"",}, + {"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,}, {"",}, ! {"classof", CLASSOF, NORID,}, ! {"",}, {"",}, ! {"__typeof", TYPEOF, NORID}, {"",}, ! {"private", VISSPEC, RID_PRIVATE,}, ! {"__signed", TYPESPEC, RID_SIGNED}, ! {"",}, ! {"overload", OVERLOAD, NORID,}, ! {"char", TYPESPEC, RID_CHAR,}, ! {"virtual", SCSPEC, RID_VIRTUAL,}, {"",}, {"",}, ! {"return", RETURN, NORID,}, {"",}, ! {"void", TYPESPEC, RID_VOID,}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"register", SCSPEC, RID_REGISTER,}, ! {"long", TYPESPEC, RID_LONG,}, ! {"",}, {"",}, {"",}, {"",}, {"public", VISSPEC, RID_PUBLIC,}, ! {"",}, ! {"volatile", TYPE_QUAL, RID_VOLATILE,}, ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"continue", CONTINUE, NORID,}, ! {"inline", SCSPEC, RID_INLINE,}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"dynamic_cast", DYNAMIC_CAST, NORID,}, ! {"",}, {"",}, {"catch", CATCH, NORID,}, ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"unsigned", TYPESPEC, RID_UNSIGNED,}, }; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-init.c gcc-2.5.5/cp-init.c *** gcc-2.5.4/cp-init.c Sun Oct 31 16:41:49 1993 --- gcc-2.5.5/cp-init.c Thu Nov 25 18:08:23 1993 *************** *** 257,262 **** { if (DECL_NAME (field)) ! error ("multiple initializations given for member `%s'", ! IDENTIFIER_POINTER (DECL_NAME (field))); continue; } --- 257,262 ---- { if (DECL_NAME (field)) ! cp_error ("multiple initializations given for member `%D'", ! field); continue; } *************** *** 293,297 **** field = TREE_VALUE (field); if (decl_type_context (field) != current_class_type) ! error ("field `%s' not in immediate context"); } --- 293,297 ---- field = TREE_VALUE (field); if (decl_type_context (field) != current_class_type) ! cp_error ("field `%D' not in immediate context", field); } *************** *** 1297,1301 **** } ! rval = build_method_call (exp, constructor_name (type), parms, binfo, flags|xxref_init_possible); if (rval == NULL_TREE && xxref_init_possible) --- 1297,1301 ---- } ! rval = build_method_call (exp, constructor_name_full (type), parms, binfo, flags|xxref_init_possible); if (rval == NULL_TREE && xxref_init_possible) *************** *** 1324,1328 **** } else ! rval = build_method_call (exp, constructor_name (type), parms, binfo, flags); } --- 1324,1328 ---- } else ! rval = build_method_call (exp, constructor_name_full (type), parms, binfo, flags); } *************** *** 1397,1401 **** cp_error ("in base initialization for class `%T',", binfo); /* This will make an error message for us. */ ! build_method_call (exp, constructor_name (type), parms, binfo, (TYPE_USES_VIRTUAL_BASECLASSES (type) ? LOOKUP_NORMAL|LOOKUP_HAS_IN_CHARGE --- 1397,1401 ---- cp_error ("in base initialization for class `%T',", binfo); /* This will make an error message for us. */ ! build_method_call (exp, constructor_name_full (type), parms, binfo, (TYPE_USES_VIRTUAL_BASECLASSES (type) ? LOOKUP_NORMAL|LOOKUP_HAS_IN_CHARGE *************** *** 1640,1644 **** tree as_cons = NULL_TREE; if (TYPE_HAS_CONSTRUCTOR (type)) ! as_cons = build_method_call (exp, constructor_name (type), parms, binfo, LOOKUP_SPECULATIVELY|LOOKUP_NO_CONVERSION); --- 1640,1644 ---- tree as_cons = NULL_TREE; if (TYPE_HAS_CONSTRUCTOR (type)) ! as_cons = build_method_call (exp, constructor_name_full (type), parms, binfo, LOOKUP_SPECULATIVELY|LOOKUP_NO_CONVERSION); *************** *** 3213,3217 **** } ! newrval = build_method_call (rval, constructor_name (true_type), init, NULL_TREE, flags); if (newrval) --- 3213,3217 ---- } ! newrval = build_method_call (rval, constructor_name_full (true_type), init, NULL_TREE, flags); if (newrval) *************** *** 3256,3260 **** TREE_TYPE (xval) = TREE_TYPE (rval); do_pending_stack_adjust (); ! start_sequence (); /* As a matter of principle, `start_sequence' should do this. */ --- 3256,3260 ---- TREE_TYPE (xval) = TREE_TYPE (rval); do_pending_stack_adjust (); ! start_sequence_for_rtl_expr (xval); /* As a matter of principle, `start_sequence' should do this. */ *************** *** 3649,3652 **** --- 3649,3654 ---- } + my_friendly_assert (IS_AGGR_TYPE (type), 220); + if (! TYPE_NEEDS_DESTRUCTOR (type)) { *************** *** 3658,3663 **** /* Pass the size of the object down to the operator delete() in addition to the ADDR. */ ! if (!TYPE_BUILT_IN (type) && TREE_GETS_DELETE (type) ! && !use_global_delete) { /* This is probably wrong. It should be the size of the virtual --- 3660,3664 ---- /* Pass the size of the object down to the operator delete() in addition to the ADDR. */ ! if (TREE_GETS_DELETE (type) && !use_global_delete) { /* This is probably wrong. It should be the size of the virtual diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-lex.c gcc-2.5.5/cp-lex.c *** gcc-2.5.4/cp-lex.c Tue Oct 26 14:25:20 1993 --- gcc-2.5.5/cp-lex.c Wed Nov 24 00:19:16 1993 *************** *** 75,79 **** /* This obstack is needed to hold text. It is not safe to use TOKEN_BUFFER because `check_newline' calls `yylex'. */ ! static struct obstack inline_text_obstack; static char *inline_text_firstobj; --- 75,79 ---- /* This obstack is needed to hold text. It is not safe to use TOKEN_BUFFER because `check_newline' calls `yylex'. */ ! struct obstack inline_text_obstack; static char *inline_text_firstobj; *************** *** 207,211 **** return IDENTIFIER_POINTER (name); ! if (opname[0] == 'a' && opname[2] != '\0') { opname += 1; --- 207,211 ---- return IDENTIFIER_POINTER (name); ! if (opname[0] == 'a' && opname[2] != '\0' && opname[2] != '_') { opname += 1; *************** *** 264,267 **** --- 264,270 ---- int check_newline (); + /* Nonzero tells yylex to ignore \ in string constants. */ + static int ignore_escape_flag = 0; + static int skip_white_space (); *************** *** 1001,1005 **** extract_interface_info () { ! tree fileinfo = get_time_identifier (input_filename); fileinfo = IDENTIFIER_CLASS_VALUE (fileinfo); interface_only = TREE_INT_CST_LOW (fileinfo); --- 1004,1016 ---- extract_interface_info () { ! tree fileinfo; ! #if 0 /* Maybe later. -jason */ ! struct tinst_level *til; ! ! if (til = tinst_for_decl()) ! fileinfo = get_time_identifier (til->file); ! else ! #endif ! fileinfo = get_time_identifier (input_filename); fileinfo = IDENTIFIER_CLASS_VALUE (fileinfo); interface_only = TREE_INT_CST_LOW (fileinfo); *************** *** 1501,1504 **** --- 1512,1516 ---- int len; int look_for_semicolon = 0; + int look_for_lbrac = 0; if (yychar == '{') *************** *** 1505,1624 **** obstack_1grow (obstackp, '{'); else if (yychar == '=') { ! look_for_semicolon = 1; } else { - if (yychar != ':' && (yychar != RETURN || is_template)) - { - yyerror (is_template - ? "parse error in template specification" - : "parse error in method specification"); - yychar = '{'; - } obstack_1grow (obstackp, yychar); ! while (c >= 0) ! { ! int this_lineno = lineno; ! ! c = yynextch (); ! ! /* Don't lose our cool if there are lots of comments. */ ! if (lineno == this_lineno) ! ; ! else if (lineno - this_lineno < 10 /* + strlen (input_filename) */) ! { ! int i; ! for (i = lineno - this_lineno; i > 0; i--) ! obstack_1grow (obstackp, '\n'); ! } ! else ! { ! char buf[16]; ! sprintf (buf, "\n# %d \"", lineno); ! len = strlen (buf); ! obstack_grow (obstackp, buf, len); ! ! len = strlen (input_filename); ! obstack_grow (obstackp, input_filename, len); ! obstack_1grow (obstackp, '\"'); ! obstack_1grow (obstackp, '\n'); ! } ! ! /* strings must be read differently than text. */ ! if (c == '\"') ! { ! obstack_1grow (obstackp, c); ! consume_string (obstackp, c); ! c = yynextch (); ! } ! if (c == '\'') ! { ! obstack_1grow (obstackp, c); ! consume_string (obstackp, c); ! c = yynextch (); ! } ! while (c > ' ') /* ASCII dependent! */ ! { ! obstack_1grow (obstackp, c); ! if (c == '{') ! goto main_loop; ! if (c == '\"') ! consume_string (obstackp, c); ! if (c == '\'') ! consume_string (obstackp, c); ! if (c == ';') ! { ! error (is_template ! ? "template body missing" ! : "function body for constructor missing"); ! obstack_1grow (obstackp, '{'); ! obstack_1grow (obstackp, '}'); ! len += 2; ! goto done; ! } ! c = getch (); ! } ! if (c == '\n') ! lineno++; ! obstack_1grow (obstackp, c); ! } ! if (c == EOF) ! error_with_file_and_line (starting_filename, ! starting_lineno, ! "end of file read inside definition"); } ! main_loop: ! while (c >= 0) { int this_lineno = lineno; ! c = skip_white_space (getch ()); /* Don't lose our cool if there are lots of comments. */ ! if (lineno - this_lineno) { ! if (lineno - this_lineno == 1) obstack_1grow (obstackp, '\n'); ! else ! { ! char buf[16]; ! sprintf (buf, "\n# %d \"", lineno); ! len = strlen (buf); ! obstack_grow (obstackp, buf, len); ! ! len = strlen (input_filename); ! obstack_grow (obstackp, input_filename, len); ! obstack_1grow (obstackp, '\"'); ! obstack_1grow (obstackp, '\n'); ! } } ! while (c > ' ') { obstack_1grow (obstackp, c); if (c == '{') ! blev++; else if (c == '}') { --- 1517,1581 ---- obstack_1grow (obstackp, '{'); else if (yychar == '=') + look_for_semicolon = 1; + else if (yychar != ':' && (yychar != RETURN || is_template)) { ! yyerror (is_template ! ? "parse error in template specification" ! : "parse error in method specification"); ! obstack_1grow (obstackp, '{'); } else { obstack_1grow (obstackp, yychar); ! look_for_lbrac = 1; ! blev = 0; } ! if (nextchar != EOF) ! { ! c = nextchar; ! nextchar = EOF; ! } ! else ! c = getch (); ! ! while (c != EOF) { int this_lineno = lineno; ! c = skip_white_space (c); /* Don't lose our cool if there are lots of comments. */ ! if (lineno == this_lineno + 1) ! obstack_1grow (obstackp, '\n'); ! else if (lineno == this_lineno) ! ; ! else if (lineno - this_lineno < 10) { ! int i; ! for (i = lineno - this_lineno; i > 0; i--) obstack_1grow (obstackp, '\n'); ! } ! else ! { ! char buf[16]; ! sprintf (buf, "\n# %d \"", lineno); ! len = strlen (buf); ! obstack_grow (obstackp, buf, len); ! ! len = strlen (input_filename); ! obstack_grow (obstackp, input_filename, len); ! obstack_1grow (obstackp, '\"'); ! obstack_1grow (obstackp, '\n'); } ! while (c > ' ') /* ASCII dependent... */ { obstack_1grow (obstackp, c); if (c == '{') ! { ! look_for_lbrac = 0; ! blev++; ! } else if (c == '}') { *************** *** 1645,1655 **** else if (c == '\'') consume_string (obstackp, c); ! else if (c == ';' && look_for_semicolon && blev == 0) ! goto done; c = getch (); } ! if (c == '\n') ! lineno++; ! else if (c == EOF) { error_with_file_and_line (starting_filename, --- 1602,1624 ---- else if (c == '\'') consume_string (obstackp, c); ! else if (c == ';') ! { ! if (look_for_lbrac) ! { ! error (is_template ! ? "template body missing" ! : "function body for constructor missing"); ! obstack_1grow (obstackp, '{'); ! obstack_1grow (obstackp, '}'); ! len += 2; ! goto done; ! } ! else if (look_for_semicolon && blev == 0) ! goto done; ! } c = getch (); } ! ! if (c == EOF) { error_with_file_and_line (starting_filename, *************** *** 1658,1662 **** goto done; } ! obstack_1grow (obstackp, c); } done: --- 1627,1635 ---- goto done; } ! else if (c != '\n') ! { ! obstack_1grow (obstackp, c); ! c = getch (); ! } } done: *************** *** 1751,1755 **** --- 1724,1737 ---- sizeof (struct pending_inline)); t->lineno = lineno; + + #if 1 t->filename = input_filename; + #else /* This breaks; why? */ + #define MGMSG "(synthetic code at) " + t->filename = obstack_alloc (&inline_text_obstack, + strlen (input_filename) + sizeof (MGMSG) + 1); + strcpy (t->filename, MGMSG); + strcat (t->filename, input_filename); + #endif t->token = YYEMPTY; t->token_value = 0; *************** *** 2470,2475 **** /* More follows: it must be a string constant (filename). */ ! /* Read the string constant. */ token = real_yylex (); if (token != STRING || TREE_CODE (yylval.ttype) != STRING_CST) --- 2452,2459 ---- /* More follows: it must be a string constant (filename). */ ! /* Read the string constant, but don't treat \ as special. */ ! ignore_escape_flag = 1; token = real_yylex (); + ignore_escape_flag = 0; if (token != STRING || TREE_CODE (yylval.ttype) != STRING_CST) *************** *** 2995,2999 **** real_yylex () { - tree tmp; register int c; register int value; --- 2979,2982 ---- *************** *** 3220,3224 **** if (value == IDENTIFIER) { ! tmp = get_identifier (token_buffer); #if !defined(VMS) && defined(JOINER) --- 3203,3207 ---- if (value == IDENTIFIER) { ! register tree tmp = get_identifier (token_buffer); #if !defined(VMS) && defined(JOINER) *************** *** 3336,3341 **** int numdigits = 0; /* for multi-precision arithmetic, ! we store only 8 live bits in each short. */ ! short shorts[MAX_SHORTS]; int overflow = 0; --- 3319,3329 ---- int numdigits = 0; /* for multi-precision arithmetic, ! we actually store only HOST_BITS_PER_CHAR bits in each part. ! The number of parts is chosen so as to be sufficient to hold ! the enough bits to fit into the two HOST_WIDE_INTs that contain ! the integer value (this is always at least as many bits as are ! in a target `long long' value, but may be wider). */ ! #define TOTAL_PARTS ((HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR) * 2 + 2) ! int parts[TOTAL_PARTS]; int overflow = 0; *************** *** 3346,3351 **** *p++ = c; ! for (count = 0; count < MAX_SHORTS; count++) ! shorts[count] = 0; if (c == '0') --- 3334,3339 ---- *p++ = c; ! for (count = 0; count < TOTAL_PARTS; count++) ! parts[count] = 0; if (c == '0') *************** *** 3447,3464 **** numdigits++; ! for (count = 0; count < MAX_SHORTS; count++) { ! shorts[count] *= base; if (count) { ! shorts[count] += (shorts[count-1] >> 8); ! shorts[count-1] &= (1<<8)-1; } ! else shorts[0] += c; } ! if (shorts[MAX_SHORTS - 1] >= 1<<8 ! || shorts[MAX_SHORTS - 1] < - (1 << 8)) ! overflow = TRUE; if (p >= token_buffer + maxtoken - 3) --- 3435,3456 ---- numdigits++; ! for (count = 0; count < TOTAL_PARTS; count++) { ! parts[count] *= base; if (count) { ! parts[count] ! += (parts[count-1] >> HOST_BITS_PER_CHAR); ! parts[count-1] ! &= (1 << HOST_BITS_PER_CHAR) - 1; } ! else ! parts[0] += c; } ! /* If the extra highest-order part ever gets anything in it, ! the number is certainly too big. */ ! if (parts[TOTAL_PARTS - 1] != 0) ! overflow = 1; if (p >= token_buffer + maxtoken - 3) *************** *** 3623,3626 **** --- 3615,3619 ---- int spec_long = 0; int spec_long_long = 0; + int bytes, warn; while (1) *************** *** 3667,3683 **** put_back (c); ! /* ??? This code assumes that everything but long long is 32-bits. ! Probably this code needs to be replaced with code similar ! to that in c-lex.c, but I don't want to do it. -- RK. */ ! ! if ((overflow || shorts[7] || shorts[6] || shorts[5] || shorts[4]) ! && !spec_long_long) ! warning ("integer constant out of range"); ! ! /* If it won't fit in a signed long long, make it unsigned. ! We can't distinguish based on the tree node because ! any integer constant fits any long long type. */ ! if (shorts[7] >= (1<<8)) ! spec_unsigned = 1; /* This is simplified by the fact that our constant --- 3660,3684 ---- put_back (c); ! /* If the constant is not long long and it won't fit in an ! unsigned long, or if the constant is long long and won't fit ! in an unsigned long long, then warn that the constant is out ! of range. */ ! ! /* ??? This assumes that long long and long integer types are ! a multiple of 8 bits. This better than the original code ! though which assumed that long was exactly 32 bits and long ! long was exactly 64 bits. */ ! ! if (spec_long_long) ! bytes = TYPE_PRECISION (long_long_integer_type_node) / 8; ! else ! bytes = TYPE_PRECISION (long_integer_type_node) / 8; ! ! warn = overflow; ! for (i = bytes; i < TOTAL_PARTS; i++) ! if (parts[i]) ! warn = 1; ! if (warn) ! pedwarn ("integer constant out of range"); /* This is simplified by the fact that our constant *************** *** 3685,3694 **** high = low = 0; ! for (i = 0; i < MAX_SHORTS / 2; i++) { ! high |= (HOST_WIDE_INT) shorts[i + MAX_SHORTS / 2] << (i * 8); ! low |= (HOST_WIDE_INT) shorts[i] << (i * 8); } yylval.ttype = build_int_2 (low, high); TREE_TYPE (yylval.ttype) = long_long_unsigned_type_node; --- 3686,3698 ---- high = low = 0; ! for (i = 0; i < HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR; i++) { ! high |= ((HOST_WIDE_INT) parts[i + (HOST_BITS_PER_WIDE_INT ! / HOST_BITS_PER_CHAR)] ! << (i * HOST_BITS_PER_CHAR)); ! low |= (HOST_WIDE_INT) parts[i] << (i * HOST_BITS_PER_CHAR); } + yylval.ttype = build_int_2 (low, high); TREE_TYPE (yylval.ttype) = long_long_unsigned_type_node; *************** *** 3980,3984 **** while (c != '"' && c >= 0) { ! if (c == '\\') { int ignore = 0; --- 3984,3989 ---- while (c != '"' && c >= 0) { ! /* ignore_escape_flag is set for reading the filename in #line. */ ! if (!ignore_escape_flag && c == '\\') { int ignore = 0; *************** *** 4145,4159 **** { nextchar = skip_white_space (getch ()); - if (nextchar == '(') - { - int next_c = skip_white_space (getch ()); - if (next_c == ')') - { - nextchar = -1; - value = POINTSAT_LEFT_RIGHT; - goto done; - } - put_back (next_c); - } if (nextchar == '*') { --- 4150,4153 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-method.c gcc-2.5.5/cp-method.c *** gcc-2.5.4/cp-method.c Tue Nov 9 23:50:45 1993 --- gcc-2.5.5/cp-method.c Wed Nov 24 00:19:33 1993 *************** *** 422,426 **** default: ! sorry ("conversion of %s as PT parameter", tree_code_name [(int) TREE_CODE (type)]); my_friendly_abort (72); --- 422,426 ---- default: ! sorry ("conversion of %s as template parameter", tree_code_name [(int) TREE_CODE (type)]); my_friendly_abort (72); *************** *** 897,901 **** DEALLOCATE_TYPEVEC (parms); } ! return get_identifier (obstack_base (&scratch_obstack)); } --- 897,906 ---- DEALLOCATE_TYPEVEC (parms); } ! { ! tree n = get_identifier (obstack_base (&scratch_obstack)); ! if (IDENTIFIER_OPNAME_P (dname)) ! IDENTIFIER_OPNAME_P (n) = 1; ! return n; ! } } *************** *** 1462,1466 **** if (TREE_CODE_CLASS (TREE_CODE (value)) == 'd' && DECL_NONLOCAL (value)) { ! if (DECL_CLASS_CONTEXT (value) != current_class_type) { tree path; --- 1467,1472 ---- if (TREE_CODE_CLASS (TREE_CODE (value)) == 'd' && DECL_NONLOCAL (value)) { ! if (DECL_LANG_SPECIFIC (value) ! && DECL_CLASS_CONTEXT (value) != current_class_type) { tree path; *************** *** 1552,1565 **** else TREE_OPERAND (component, 0) = TREE_OPERAND (tmp, 0); if (TREE_OPERAND (tmp, 0) && TREE_OPERAND (tmp, 0) != void_list_node) { ! error ("operator requires empty parameter list"); TREE_OPERAND (tmp, 0) = NULL_TREE; } - last = groktypename (build_tree_list (TREE_TYPE (component), - TREE_OPERAND (component, 0))); - name = build_typename_overload (last); - TREE_TYPE (name) = last; if (of && TREE_CODE (of) != TYPE_DECL) --- 1558,1573 ---- else TREE_OPERAND (component, 0) = TREE_OPERAND (tmp, 0); + + last = groktypename (build_tree_list (TREE_TYPE (component), + TREE_OPERAND (component, 0))); + name = build_typename_overload (last); + TREE_TYPE (name) = last; + if (TREE_OPERAND (tmp, 0) && TREE_OPERAND (tmp, 0) != void_list_node) { ! cp_error ("`operator %T' requires empty parameter list", last); TREE_OPERAND (tmp, 0) = NULL_TREE; } if (of && TREE_CODE (of) != TYPE_DECL) *************** *** 1571,1575 **** if (current_class_decl == NULL_TREE) { ! error ("object required for `operator ' call"); return error_mark_node; } --- 1579,1584 ---- if (current_class_decl == NULL_TREE) { ! cp_error ("object required for `operator %T' call", ! TREE_TYPE (name)); return error_mark_node; } *************** *** 1582,1586 **** return build_method_call (tmp, name, NULL_TREE, NULL_TREE, flags); ! error ("object required for `operator ' call"); return error_mark_node; --- 1591,1596 ---- return build_method_call (tmp, name, NULL_TREE, NULL_TREE, flags); ! cp_error ("object required for `operator %T' call", ! TREE_TYPE (name)); return error_mark_node; *************** *** 1622,1626 **** if (current_class_decl == NULL_TREE) { ! error ("object required for `operator ' call"); return error_mark_node; } --- 1632,1637 ---- if (current_class_decl == NULL_TREE) { ! cp_error ("object required for `operator %T' call", ! TREE_TYPE (name)); return error_mark_node; } *************** *** 1634,1638 **** return build_offset_ref (current_class_name, name); ! error ("object required for `operator ' member reference"); return error_mark_node; } --- 1645,1650 ---- return build_offset_ref (current_class_name, name); ! cp_error ("object required for `operator %T' member reference", ! TREE_TYPE (name)); return error_mark_node; } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-parse.y gcc-2.5.5/cp-parse.y *** gcc-2.5.4/cp-parse.y Fri Oct 8 15:01:39 1993 --- gcc-2.5.5/cp-parse.y Thu Nov 25 18:08:08 1993 *************** *** 154,158 **** %token VISSPEC %token DELETE NEW OVERLOAD THIS OPERATOR ! %token POINTSAT_LEFT_RIGHT LEFT_RIGHT TEMPLATE %token SCOPE --- 154,159 ---- %token VISSPEC %token DELETE NEW OVERLOAD THIS OPERATOR ! %token LEFT_RIGHT TEMPLATE ! %token TYPEID DYNAMIC_CAST %token SCOPE *************** *** 252,255 **** --- 253,258 ---- %type fn_tmpl_end /* %type try_for_typename */ + %type condition partially_scoped_stmt xcond paren_cond_or_null + %type .kindof_pushlevel /* in order to recognize aggr tags as defining and thus shadowing. */ *************** *** 530,544 **** { t = TREE_VALUE (t); ! if (TREE_CODE (t) == RECORD_TYPE) ! { ! if (CLASSTYPE_USE_TEMPLATE (t) == 0) ! CLASSTYPE_USE_TEMPLATE (t) = 2; ! else if (CLASSTYPE_USE_TEMPLATE (t) == 1) ! error ("override declaration for already-expanded template"); ! } else if (TREE_CODE (t) == ENUMERAL_TYPE && !TYPE_SIZE (t)) ! error ("forward declaration of enum `%s'", ! TYPE_NAME_STRING (t)); } note_list_got_semicolon ($$); --- 533,543 ---- { t = TREE_VALUE (t); ! if (TREE_CODE (t) == RECORD_TYPE ! && TYPE_SIZE (t) ! && CLASSTYPE_USE_TEMPLATE (t) == 0) ! CLASSTYPE_USE_TEMPLATE (t) = 2; else if (TREE_CODE (t) == ENUMERAL_TYPE && !TYPE_SIZE (t)) ! cp_error ("forward declaration of `%#T'", t); } note_list_got_semicolon ($$); *************** *** 891,895 **** t = xref_tag (DECL_TEMPLATE_INFO (tmpl)->aggr, id, $2); set_current_level_tags_transparency (1); ! my_friendly_assert (TREE_CODE (t) == RECORD_TYPE, 257); $$ = t; --- 890,895 ---- t = xref_tag (DECL_TEMPLATE_INFO (tmpl)->aggr, id, $2); set_current_level_tags_transparency (1); ! my_friendly_assert (TREE_CODE (t) == RECORD_TYPE ! || TREE_CODE (t) == UNION_TYPE, 257); $$ = t; *************** *** 923,926 **** --- 923,929 ---- /* Now go after the methods & class data. */ instantiate_member_templates ($1); + + pop_tinst_level(); + CLASSTYPE_GOT_SEMICOLON ($$) = 1; } *************** *** 968,971 **** --- 971,1070 ---- ; + paren_cond_or_null: + LEFT_RIGHT + { error ("ANSI C++ forbids an empty condition for `%s'", + cond_stmt_keyword); + $$ = integer_zero_node; } + | '(' condition ')' + { $$ = $2; } + ; + + xcond: + /* empty */ + { $$ = NULL_TREE; } + | condition + | error + { $$ = NULL_TREE; } + ; + + condition: + typed_typespecs declarator maybe_raises maybeasm maybe_attribute '=' + { { + tree d; + for (d = getdecls (); d; d = TREE_CHAIN (d)) + if (TREE_CODE (d) == TYPE_DECL) { + tree s = TREE_TYPE (d); + if (TREE_CODE (s) == RECORD_TYPE) + cp_error ("definition of class `%T' in condition", s); + else if (TREE_CODE (s) == ENUMERAL_TYPE) + cp_error ("definition of enum `%T' in condition", s); + } + } + current_declspecs = $1; + $6 = suspend_momentary (); + $$ = start_decl ($2, current_declspecs, 1, $3); + cplus_decl_attributes ($$, $5); + } + init + { + finish_decl ($7, $8, $5, 0); + resume_momentary ($6); + $$ = $7; + if (TREE_CODE (TREE_TYPE ($$)) == ARRAY_TYPE) + cp_error ("definition of array `%#D' in condition", $$); + } + | expr + ; + + /* Used for the blocks controlled by a condition, to add any DECLs in + the condition to the controlled block. */ + .kindof_pushlevel: /* empty */ + { tree d = getdecls (); + emit_line_note (input_filename, lineno); + pushlevel (0); + clear_last_expr (); + push_momentary (); + expand_start_bindings (0); + if (d) pushdecl (d); + } + ; + + /* Like implicitly_scoped_stmt, but uses .kindof_pushlevel */ + partially_scoped_stmt: + '{' .kindof_pushlevel '}' + { pop_implicit_try_blocks (NULL_TREE); + expand_end_bindings (getdecls (), kept_level_p (), 1); + $$ = poplevel (kept_level_p (), 1, 0); + pop_momentary (); + finish_stmt (); } + | '{' .kindof_pushlevel maybe_label_decls stmts '}' + { pop_implicit_try_blocks (NULL_TREE); + expand_end_bindings (getdecls (), kept_level_p (), 1); + $$ = poplevel (kept_level_p (), 1, 0); + pop_momentary (); + finish_stmt (); } + | '{' .kindof_pushlevel maybe_label_decls error '}' + { pop_implicit_try_blocks (NULL_TREE); + expand_end_bindings (getdecls (), kept_level_p (), 1); + $$ = poplevel (kept_level_p (), 0, 0); + pop_momentary (); + finish_stmt (); } + | .kindof_pushlevel simple_stmt + { pop_implicit_try_blocks (NULL_TREE); + expand_end_bindings (getdecls (), kept_level_p (), 1); + $$ = poplevel (kept_level_p (), 1, 0); + pop_momentary (); } + ; + + already_scoped_stmt: + '{' '}' + { finish_stmt (); } + | '{' maybe_label_decls stmts '}' + { finish_stmt (); } + | '{' maybe_label_decls error '}' + { finish_stmt (); } + | simple_stmt + ; + nonnull_exprlist: expr_no_commas *************** *** 1220,1224 **** if ($$ == NULL_TREE) { ! error ("operator %s not defined", operator_name_string (op)); $$ = error_mark_node; } --- 1319,1325 ---- if ($$ == NULL_TREE) { ! if (op != ansi_opname[ERROR_MARK]) ! error ("operator %s not defined", ! operator_name_string (op)); $$ = error_mark_node; } *************** *** 1366,1369 **** --- 1467,1479 ---- | typespec LEFT_RIGHT { $$ = build_functional_cast ($$, NULL_TREE); } + /* Stroustrup RTTI */ + | DYNAMIC_CAST '<' typename '>' '(' expr ')' + { tree type = groktypename ($3); + $$ = build_dynamic_cast (type, $6); } + | TYPEID '(' expr ')' + { $$ = build_typeid ($3); } + | TYPEID '(' typename ')' + { tree type = groktypename ($3); + $$ = get_typeid (type); } | SCOPE typespec '(' nonnull_exprlist ')' { $$ = build_functional_cast ($2, $4); } *************** *** 1456,1459 **** --- 1566,1586 ---- | object id_scope identifier_or_opname LEFT_RIGHT { $$ = build_scoped_method_call ($$, $2, $3, NULL_TREE); } + /* p->int::~int() is valid -- 12.4 */ + | object '~' TYPESPEC LEFT_RIGHT + { + if (TREE_CODE (TREE_TYPE ($1)) + != TREE_CODE (TREE_TYPE (IDENTIFIER_GLOBAL_VALUE ($3)))) + cp_error ("`%E' is not of type `%T'", $1, $3); + $$ = void_zero_node; + } + | object TYPESPEC SCOPE '~' TYPESPEC LEFT_RIGHT + { + if ($2 != $5) + cp_error ("destructor specifier `%T::~%T()' must have matching names", $2, $5); + if (TREE_CODE (TREE_TYPE ($1)) + != TREE_CODE (TREE_TYPE (IDENTIFIER_GLOBAL_VALUE ($2)))) + cp_error ("`%E' is not of type `%T'", $1, $2); + $$ = void_zero_node; + } ; *************** *** 1542,1559 **** object: primary '.' - { - if ($$ == error_mark_node) - ; - else - { - tree type = TREE_TYPE ($$); - - if (! PROMOTES_TO_AGGR_TYPE (type, REFERENCE_TYPE)) - { - error ("object in '.' expression is not of aggregate type"); - $$ = error_mark_node; - } - } - } | primary POINTSAT { --- 1669,1672 ---- *************** *** 1802,1806 **** attrib : IDENTIFIER ! { if (strcmp (IDENTIFIER_POINTER ($1), "packed")) warning ("`%s' attribute directive ignored", IDENTIFIER_POINTER ($1)); --- 1915,1920 ---- attrib : IDENTIFIER ! { if (strcmp (IDENTIFIER_POINTER ($1), "packed") ! && strcmp (IDENTIFIER_POINTER ($1), "noreturn")) warning ("`%s' attribute directive ignored", IDENTIFIER_POINTER ($1)); *************** *** 2295,2302 **** $$ = grokbitfield ($$, current_declspecs, $3); cplus_decl_attributes ($$, $4); } ! | TYPENAME_COLON expr_no_commas maybe_attribute { current_declspecs = $0; ! $$ = grokbitfield ($$, current_declspecs, $2); ! cplus_decl_attributes ($$, $3); } | ':' expr_no_commas maybe_attribute { current_declspecs = $0; --- 2409,2416 ---- $$ = grokbitfield ($$, current_declspecs, $3); cplus_decl_attributes ($$, $4); } ! | TYPENAME ':' expr_no_commas maybe_attribute { current_declspecs = $0; ! $$ = grokbitfield ($$, current_declspecs, $3); ! cplus_decl_attributes ($$, $4); } | ':' expr_no_commas maybe_attribute { current_declspecs = $0; *************** *** 2315,2321 **** { $$ = grokbitfield ($$, current_declspecs, $3); cplus_decl_attributes ($$, $4); } ! | TYPENAME_COLON expr_no_commas maybe_attribute ! { $$ = grokbitfield ($$, current_declspecs, $2); ! cplus_decl_attributes ($$, $3); } | ':' expr_no_commas maybe_attribute { $$ = grokbitfield (NULL_TREE, NULL_TREE, $2); --- 2429,2435 ---- { $$ = grokbitfield ($$, current_declspecs, $3); cplus_decl_attributes ($$, $4); } ! | TYPENAME ':' expr_no_commas maybe_attribute ! { $$ = grokbitfield ($$, current_declspecs, $3); ! cplus_decl_attributes ($$, $4); } | ':' expr_no_commas maybe_attribute { $$ = grokbitfield (NULL_TREE, NULL_TREE, $2); *************** *** 2340,2343 **** --- 2454,2458 ---- ; + /* ANSI type-id (8.1) */ typename: typed_typespecs absdcl *************** *** 2347,2350 **** --- 2462,2466 ---- ; + /* ANSI abstract-declarator (8.1) */ absdcl: /* an abstract declarator */ /* empty */ %prec EMPTY *************** *** 2598,2602 **** abs_member_declarator: ! id_scope '*' type_quals { tree t; t = $$; --- 2714,2718 ---- abs_member_declarator: ! id_scope see_typename '*' type_quals { tree t; t = $$; *************** *** 2605,2609 **** TREE_OPERAND (t, 1) = build_parse_node (INDIRECT_REF, 0); } ! | id_scope '*' type_quals absdcl1 { tree t; t = $$; --- 2721,2725 ---- TREE_OPERAND (t, 1) = build_parse_node (INDIRECT_REF, 0); } ! | id_scope see_typename '*' type_quals absdcl1 { tree t; t = $$; *************** *** 2610,2616 **** while (TREE_OPERAND (t, 1)) t = TREE_OPERAND (t, 1); ! TREE_OPERAND (t, 1) = build_parse_node (INDIRECT_REF, $4); } ! | id_scope '&' type_quals { tree t; t = $$; --- 2726,2732 ---- while (TREE_OPERAND (t, 1)) t = TREE_OPERAND (t, 1); ! TREE_OPERAND (t, 1) = build_parse_node (INDIRECT_REF, $5); } ! | id_scope see_typename '&' type_quals { tree t; t = $$; *************** *** 2619,2623 **** TREE_OPERAND (t, 1) = build_parse_node (ADDR_EXPR, 0); } ! | id_scope '&' type_quals absdcl1 { tree t; t = $$; --- 2735,2739 ---- TREE_OPERAND (t, 1) = build_parse_node (ADDR_EXPR, 0); } ! | id_scope see_typename '&' type_quals absdcl1 { tree t; t = $$; *************** *** 2624,2628 **** while (TREE_OPERAND (t, 1)) t = TREE_OPERAND (t, 1); ! TREE_OPERAND (t, 1) = build_parse_node (ADDR_EXPR, $4); } ; --- 2740,2744 ---- while (TREE_OPERAND (t, 1)) t = TREE_OPERAND (t, 1); ! TREE_OPERAND (t, 1) = build_parse_node (ADDR_EXPR, $5); } ; *************** *** 2707,2711 **** compstmt: '{' .pushlevel '}' { pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), kept_level_p (), 1); $$ = poplevel (kept_level_p (), 1, 0); pop_momentary (); } --- 2823,2827 ---- compstmt: '{' .pushlevel '}' { pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), kept_level_p(), 1); $$ = poplevel (kept_level_p (), 1, 0); pop_momentary (); } *************** *** 2712,2716 **** | '{' .pushlevel maybe_label_decls stmts '}' { pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), kept_level_p (), 1); $$ = poplevel (kept_level_p (), 1, 0); pop_momentary (); } --- 2828,2832 ---- | '{' .pushlevel maybe_label_decls stmts '}' { pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), kept_level_p(), 1); $$ = poplevel (kept_level_p (), 1, 0); pop_momentary (); } *************** *** 2717,2721 **** | '{' .pushlevel maybe_label_decls error '}' { pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), kept_level_p (), 1); $$ = poplevel (kept_level_p (), 0, 0); pop_momentary (); } --- 2833,2837 ---- | '{' .pushlevel maybe_label_decls error '}' { pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), kept_level_p(), 1); $$ = poplevel (kept_level_p (), 0, 0); pop_momentary (); } *************** *** 2725,2732 **** IF { cond_stmt_keyword = "if"; } ! paren_expr_or_null { emit_line_note (input_filename, lineno); ! expand_start_cond (truthvalue_conversion ($3), 0); } ! implicitly_scoped_stmt ; --- 2841,2848 ---- IF { cond_stmt_keyword = "if"; } ! .pushlevel paren_cond_or_null { emit_line_note (input_filename, lineno); ! expand_start_cond (truthvalue_conversion ($4), 0); } ! partially_scoped_stmt ; *************** *** 2736,2740 **** | .pushlevel simple_stmt { pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), kept_level_p (), 1); $$ = poplevel (kept_level_p (), 1, 0); pop_momentary (); } --- 2852,2856 ---- | .pushlevel simple_stmt { pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), getdecls() != NULL_TREE, 1); $$ = poplevel (kept_level_p (), 1, 0); pop_momentary (); } *************** *** 2765,2773 **** | simple_if ELSE { expand_start_else (); } ! implicitly_scoped_stmt { expand_end_cond (); finish_stmt (); } | simple_if %prec IF { expand_end_cond (); finish_stmt (); } | WHILE --- 2881,2897 ---- | simple_if ELSE { expand_start_else (); } ! partially_scoped_stmt { expand_end_cond (); + pop_implicit_try_blocks (NULL_TREE); + expand_end_bindings (getdecls (), kept_level_p (), 1); + poplevel (kept_level_p (), 1, 0); + pop_momentary (); finish_stmt (); } | simple_if %prec IF { expand_end_cond (); + pop_implicit_try_blocks (NULL_TREE); + expand_end_bindings (getdecls (), kept_level_p (), 1); + poplevel (kept_level_p (), 1, 0); + pop_momentary (); finish_stmt (); } | WHILE *************** *** 2776,2783 **** expand_start_loop (1); cond_stmt_keyword = "while"; } ! paren_expr_or_null ! { expand_exit_loop_if_false (0, truthvalue_conversion ($3)); } ! implicitly_scoped_stmt ! { expand_end_loop (); finish_stmt (); } | DO --- 2900,2911 ---- expand_start_loop (1); cond_stmt_keyword = "while"; } ! .pushlevel paren_cond_or_null ! { expand_exit_loop_if_false (0, truthvalue_conversion ($4)); } ! already_scoped_stmt ! { pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), kept_level_p (), 1); ! poplevel (kept_level_p (), 1, 0); ! pop_momentary (); ! expand_end_loop (); finish_stmt (); } | DO *************** *** 2799,2813 **** if ($1) cplus_expand_expr_stmt ($1); expand_start_loop_continue_elsewhere (1); } ! xexpr ';' { emit_line_note (input_filename, lineno); ! if ($3) expand_exit_loop_if_false (0, truthvalue_conversion ($3)); } xexpr ')' ! /* Don't let the tree nodes for $6 be discarded by clear_momentary during the parsing of the next stmt. */ { push_momentary (); } ! implicitly_scoped_stmt { emit_line_note (input_filename, lineno); expand_loop_continue_here (); ! if ($6) cplus_expand_expr_stmt ($6); pop_momentary (); expand_end_loop (); --- 2927,2945 ---- if ($1) cplus_expand_expr_stmt ($1); expand_start_loop_continue_elsewhere (1); } ! .pushlevel xcond ';' { emit_line_note (input_filename, lineno); ! if ($4) expand_exit_loop_if_false (0, truthvalue_conversion ($4)); } xexpr ')' ! /* Don't let the tree nodes for $7 be discarded by clear_momentary during the parsing of the next stmt. */ { push_momentary (); } ! already_scoped_stmt { emit_line_note (input_filename, lineno); expand_loop_continue_here (); ! if ($7) cplus_expand_expr_stmt ($7); ! pop_momentary (); ! pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), kept_level_p (), 1); ! poplevel (kept_level_p (), 1, 0); pop_momentary (); expand_end_loop (); *************** *** 2817,2853 **** emit_line_note (input_filename, lineno); expand_start_loop_continue_elsewhere (1); } ! xexpr ';' { emit_line_note (input_filename, lineno); ! if ($3) expand_exit_loop_if_false (0, truthvalue_conversion ($3)); } xexpr ')' ! /* Don't let the tree nodes for $6 be discarded by clear_momentary during the parsing of the next stmt. */ { push_momentary (); ! $7 = lineno; } ! implicitly_scoped_stmt ! { emit_line_note (input_filename, (int) $7); expand_loop_continue_here (); ! if ($6) cplus_expand_expr_stmt ($6); pop_momentary (); - expand_end_loop (); pop_implicit_try_blocks (NULL_TREE); ! if ($1) ! { ! register int keep = $1 > 0; ! if (keep) expand_end_bindings (0, keep, 1); ! poplevel (keep, 1, 0); ! pop_momentary (); ! } finish_stmt (); } ! | SWITCH '(' expr ')' { emit_line_note (input_filename, lineno); ! c_expand_start_case ($3); ! /* Don't let the tree nodes for $3 be discarded by clear_momentary during the parsing of the next stmt. */ push_momentary (); } ! implicitly_scoped_stmt ! { expand_end_case ($3); pop_momentary (); finish_stmt (); } | CASE expr_no_commas ':' --- 2949,2985 ---- emit_line_note (input_filename, lineno); expand_start_loop_continue_elsewhere (1); } ! .pushlevel xcond ';' { emit_line_note (input_filename, lineno); ! if ($4) expand_exit_loop_if_false (0, truthvalue_conversion ($4)); } xexpr ')' ! /* Don't let the tree nodes for $7 be discarded by clear_momentary during the parsing of the next stmt. */ { push_momentary (); ! $8 = lineno; } ! already_scoped_stmt ! { emit_line_note (input_filename, (int) $8); expand_loop_continue_here (); ! if ($7) cplus_expand_expr_stmt ($7); pop_momentary (); pop_implicit_try_blocks (NULL_TREE); ! expand_end_bindings (getdecls (), kept_level_p (), 1); ! poplevel (kept_level_p (), 1, 0); ! pop_momentary (); ! expand_end_loop (); finish_stmt (); } ! | SWITCH .pushlevel '(' condition ')' { emit_line_note (input_filename, lineno); ! c_expand_start_case ($4); ! /* Don't let the tree nodes for $4 be discarded by clear_momentary during the parsing of the next stmt. */ push_momentary (); } ! partially_scoped_stmt ! { expand_end_case ($4); pop_momentary (); + pop_implicit_try_blocks (NULL_TREE); + expand_end_bindings (getdecls (), kept_level_p (), 1); + poplevel (kept_level_p (), 1, 0); + pop_momentary (); finish_stmt (); } | CASE expr_no_commas ':' *************** *** 2876,2880 **** && value != error_mark_node) { ! error ("case label does not reduce to an integer constant"); value = error_mark_node; } --- 3008,3012 ---- && value != error_mark_node) { ! cp_error ("case label `%E' does not reduce to an integer constant", $2); value = error_mark_node; } *************** *** 2888,2896 **** label, &duplicate); if (success == 1) ! error ("case label not within a switch statement"); else if (success == 2) { ! error ("duplicate case value"); ! error_with_decl (duplicate, "this is the first entry for that value"); } else if (success == 3) --- 3020,3028 ---- label, &duplicate); if (success == 1) ! cp_error ("case label `%E' not within a switch statement", $2); else if (success == 2) { ! cp_error ("duplicate case value `%E'", $2); ! cp_error_at ("`%E' previously used here", duplicate); } else if (success == 3) *************** *** 2897,2901 **** warning ("case value out of range"); else if (success == 5) ! error ("case label within scope of cleanup or variable array"); } define_case_label (label); --- 3029,3033 ---- warning ("case value out of range"); else if (success == 5) ! cp_error ("case label `%E' within scope of cleanup or variable array", $2); } define_case_label (label); *************** *** 3335,3341 **** last in the chain of exceptions handled. */ do_pending_stack_adjust (); - start_sequence (); $1 = make_node (RTL_EXPR); TREE_TYPE ($1) = void_type_node; } compstmt --- 3467,3473 ---- last in the chain of exceptions handled. */ do_pending_stack_adjust (); $1 = make_node (RTL_EXPR); TREE_TYPE ($1) = void_type_node; + start_sequence_for_rtl_expr ($1); } compstmt *************** *** 3724,3758 **** } } - | OPERATOR POINTSAT_LEFT_RIGHT type_quals %prec '.' - { - if (yychar == YYEMPTY) - yychar = YYLEX; - if (yychar == '(' || yychar == LEFT_RIGHT) - { - $$ = ansi_opname[METHOD_CALL_EXPR]; - if (current_class_type) - { - tree t = current_class_type; - while (t) - { - TYPE_OVERLOADS_METHOD_CALL_EXPR (t) = 1; - t = TYPE_NEXT_VARIANT (t); - } - } - } - else - { - $$ = build_parse_node (CALL_EXPR, ansi_opname[COMPONENT_REF], void_list_node, $3); - if (current_class_type) - { - tree t = current_class_type; - while (t) - { - TYPE_OVERLOADS_ARROW (t) = 1; - t = TYPE_NEXT_VARIANT (t); - } - } - } - } | OPERATOR LEFT_RIGHT { $$ = ansi_opname[CALL_EXPR]; --- 3856,3859 ---- *************** *** 3792,3795 **** --- 3893,3911 ---- } } + /* + | OPERATOR NEW '[' ']' + { + $$ = ansi_opname[VEC_NEW_EXPR]; + if (current_class_type) + { + tree t = current_class_type; + while (t) + { + TREE_GETS_VEC_NEW (t) = 1; + t = TYPE_NEXT_VARIANT (t); + } + } + } + */ | OPERATOR DELETE { *************** *** 3805,3808 **** --- 3921,3939 ---- } } + /* + | OPERATOR DELETE '[' ']' + { + $$ = ansi_opname[VEC_DELETE_EXPR]; + if (current_class_type) + { + tree t = current_class_type; + while (t) + { + TREE_GETS_VEC_DELETE (t) = 1; + t = TYPE_NEXT_VARIANT (t); + } + } + } + */ /* These should do `groktypename' and set up TREE_HAS_X_CONVERSION diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-pt.c gcc-2.5.5/cp-pt.c *** gcc-2.5.4/cp-pt.c Fri Oct 8 15:01:46 1993 --- gcc-2.5.5/cp-pt.c Wed Nov 24 00:20:09 1993 *************** *** 66,69 **** --- 66,70 ---- pushlevel (0); push_obstacks (&permanent_obstack, &permanent_obstack); + pushlevel (0); } *************** *** 79,82 **** --- 80,84 ---- { tree parm; + tree decl = 0; int is_type; parm = next; *************** *** 85,88 **** --- 87,92 ---- if (!is_type) { + tree tinfo = 0; + int idx = 0; parm = TREE_PURPOSE (parm); my_friendly_assert (TREE_CODE (parm) == TREE_LIST, 260); *************** *** 90,94 **** /* is a const-param */ parm = grokdeclarator (TREE_VALUE (next), TREE_PURPOSE (next), ! NORMAL, 0, NULL_TREE); /* A template parameter is not modifiable. */ TREE_READONLY (parm) = 1; --- 94,98 ---- /* is a const-param */ parm = grokdeclarator (TREE_VALUE (next), TREE_PURPOSE (next), ! PARM, 0, NULL_TREE); /* A template parameter is not modifiable. */ TREE_READONLY (parm) = 1; *************** *** 99,103 **** --- 103,126 ---- TREE_TYPE (parm) = void_type_node; } + tinfo = make_node (TEMPLATE_CONST_PARM); + my_friendly_assert (TREE_PERMANENT (tinfo), 260.5); + if (TREE_PERMANENT (parm) == 0) + { + parm = copy_node (parm); + TREE_PERMANENT (parm) = 1; + } + TREE_TYPE (tinfo) = TREE_TYPE (parm); + decl = build_decl (CONST_DECL, DECL_NAME (parm), TREE_TYPE (parm)); + DECL_INITIAL (decl) = tinfo; + DECL_INITIAL (parm) = tinfo; + } + else + { + tree t = make_node (TEMPLATE_TYPE_PARM); + decl = build_lang_decl (TYPE_DECL, TREE_PURPOSE (parm), t); + TYPE_NAME (t) = decl; + TREE_VALUE (parm) = t; } + pushdecl (decl); return chainon (list, parm); } *************** *** 119,155 **** saved_parmlist = make_tree_vec (nparms); - pushlevel (0); - for (parm = parms, nparms = 0; parm; parm = TREE_CHAIN (parm), nparms++) { ! tree p = parm, decl; if (TREE_CODE (p) == TREE_LIST) { ! tree t; p = TREE_PURPOSE (p); my_friendly_assert (TREE_CODE (p) == IDENTIFIER_NODE, 261); - t = make_node (TEMPLATE_TYPE_PARM); TEMPLATE_TYPE_SET_INFO (t, saved_parmlist, nparms); - decl = build_lang_decl (TYPE_DECL, p, t); - TYPE_NAME (t) = decl; } else { ! tree tinfo = make_node (TEMPLATE_CONST_PARM); ! my_friendly_assert (TREE_PERMANENT (tinfo), 262); ! if (!TREE_PERMANENT (p)) ! { ! tree old_p = p; ! TREE_PERMANENT (old_p) = 1; ! p = copy_node (p); ! TREE_PERMANENT (old_p) = 0; ! } TEMPLATE_CONST_SET_INFO (tinfo, saved_parmlist, nparms); - TREE_TYPE (tinfo) = TREE_TYPE (p); - decl = build_decl (CONST_DECL, DECL_NAME (p), TREE_TYPE (p)); - DECL_INITIAL (decl) = tinfo; } TREE_VEC_ELT (saved_parmlist, nparms) = p; - pushdecl (decl); } set_current_level_tags_transparency (1); --- 142,163 ---- saved_parmlist = make_tree_vec (nparms); for (parm = parms, nparms = 0; parm; parm = TREE_CHAIN (parm), nparms++) { ! tree p = parm; if (TREE_CODE (p) == TREE_LIST) { ! tree t = TREE_VALUE (p); ! TREE_VALUE (p) = NULL_TREE; p = TREE_PURPOSE (p); my_friendly_assert (TREE_CODE (p) == IDENTIFIER_NODE, 261); TEMPLATE_TYPE_SET_INFO (t, saved_parmlist, nparms); } else { ! tree tinfo = DECL_INITIAL (p); ! DECL_INITIAL (p) = NULL_TREE; TEMPLATE_CONST_SET_INFO (tinfo, saved_parmlist, nparms); } TREE_VEC_ELT (saved_parmlist, nparms) = p; } set_current_level_tags_transparency (1); *************** *** 294,297 **** --- 302,317 ---- } + /* If TYPE is a template parm type, then return its actual type found + in TVEC. Otherwise, return TYPE. */ + static tree + grok_template_type (tvec, type) + tree tvec, type; + { + if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) + return TREE_VEC_ELT (tvec, TEMPLATE_TYPE_IDX (type)); + else + return type; + } + /* Convert all template arguments to their appropriate types, and return a vector containing the resulting values. If any error occurs, return *************** *** 338,342 **** tree arg = TREE_VEC_ELT (vec, i); tree parm = TREE_VEC_ELT (parms, i); ! tree val; int is_type, requires_type; --- 358,362 ---- tree arg = TREE_VEC_ELT (vec, i); tree parm = TREE_VEC_ELT (parms, i); ! tree val = 0; int is_type, requires_type; *************** *** 353,358 **** if (is_type) val = groktypename (arg); else ! val = digest_init (TREE_TYPE (parm), arg, (tree *) 0); if (val == error_mark_node) --- 373,411 ---- if (is_type) val = groktypename (arg); + else if (TREE_CODE (arg) == STRING_CST) + { + cp_error ("string literal %E is not a valid template argument", arg); + error ("because it is the address of an object with static linkage"); + val = error_mark_node; + } else ! { ! TREE_TYPE (parm) = grok_template_type (vec, TREE_TYPE (parm)); ! val = digest_init (TREE_TYPE (parm), arg, (tree *) 0); ! ! if (val == error_mark_node) ! ; ! ! /* 14.2: Other template-arguments must be constant-expressions, ! addresses of objects or functions with external linkage, or of ! static class members. */ ! else if (!TREE_CONSTANT (val)) ! { ! cp_error ("non-const `%E' cannot be used as template argument", ! arg); ! val = error_mark_node; ! } ! else if (TREE_CODE (val) == ADDR_EXPR) ! { ! tree a = TREE_OPERAND (val, 0); ! if ((TREE_CODE (a) == VAR_DECL ! || TREE_CODE (a) == FUNCTION_DECL) ! && !TREE_PUBLIC (a)) ! { ! cp_error ("address of non-extern `%E' cannot be used as template argument", a); ! val = error_mark_node; ! } ! } ! } if (val == error_mark_node) *************** *** 367,372 **** /* Given class template name and parameter list, produce a user-friendly name ! for the instantiation. Note that this name isn't necessarily valid as ! input to the compiler, because ">" characters may be adjacent. */ static char * mangle_class_name_for_template (name, parms, arglist) --- 420,424 ---- /* Given class template name and parameter list, produce a user-friendly name ! for the instantiation. */ static char * mangle_class_name_for_template (name, parms, arglist) *************** *** 438,441 **** --- 490,497 ---- offset--; obstack_blank_fast (&scratch_obstack, offset); + + /* B >, not B> */ + if (bufp[offset - 1] == '>') + ccat (' '); } ccat ('>'); *************** *** 801,804 **** --- 857,914 ---- } + struct tinst_level *current_tinst_level = 0; + struct tinst_level *free_tinst_level = 0; + + void + push_tinst_level (name) + tree name; + { + struct tinst_level *new; + tree global = IDENTIFIER_GLOBAL_VALUE (name); + + if (free_tinst_level) + { + new = free_tinst_level; + free_tinst_level = new->next; + } + else + new = (struct tinst_level *) xmalloc (sizeof (struct tinst_level)); + + new->classname = name; + if (global) + { + new->line = DECL_SOURCE_LINE (global); + new->file = DECL_SOURCE_FILE (global); + } + else + { + new->line = lineno; + new->file = input_filename; + } + new->next = current_tinst_level; + current_tinst_level = new; + } + + void + pop_tinst_level () + { + struct tinst_level *old = current_tinst_level; + + current_tinst_level = old->next; + old->next = free_tinst_level; + free_tinst_level = old; + } + + struct tinst_level * + tinst_for_decl () + { + struct tinst_level *p = current_tinst_level; + + if (p) + for (; p->next ; p = p->next ) + ; + return p; + } + tree instantiate_class_template (classname, setup_parse) *************** *** 862,871 **** push_to_top_level (); - push_template_decls (DECL_TEMPLATE_PARMS (TREE_PURPOSE (template)), - TREE_VALUE (template), 0); - set_current_level_tags_transparency (1); template_info = DECL_TEMPLATE_INFO (t1); if (setup_parse) { feed_input (template_info->text, template_info->length, (struct obstack *)0); lineno = template_info->lineno; --- 972,982 ---- push_to_top_level (); template_info = DECL_TEMPLATE_INFO (t1); if (setup_parse) { + push_tinst_level (classname); + push_template_decls (DECL_TEMPLATE_PARMS (TREE_PURPOSE (template)), + TREE_VALUE (template), 0); + set_current_level_tags_transparency (1); feed_input (template_info->text, template_info->length, (struct obstack *)0); lineno = template_info->lineno; *************** *** 887,897 **** tmpl = TREE_PURPOSE (IDENTIFIER_TEMPLATE (id)); t = xref_tag (DECL_TEMPLATE_INFO (tmpl)->aggr, id, NULL_TREE); ! my_friendly_assert (TREE_CODE (t) == RECORD_TYPE, 280); ! #if 1 ! lineno = template_info->lineno; ! input_filename = template_info->filename; ! /* Get interface/implementation back in sync. */ ! extract_interface_info (); ! #endif /* Now, put a copy of the decl in global scope, to avoid --- 998,1003 ---- tmpl = TREE_PURPOSE (IDENTIFIER_TEMPLATE (id)); t = xref_tag (DECL_TEMPLATE_INFO (tmpl)->aggr, id, NULL_TREE); ! my_friendly_assert (TREE_CODE (t) == RECORD_TYPE ! || TREE_CODE (t) == UNION_TYPE, 280); /* Now, put a copy of the decl in global scope, to avoid *************** *** 1176,1181 **** TREE_STATIC (r) = TREE_STATIC (t); DECL_INLINE (r) = DECL_INLINE (t); ! DECL_SOURCE_FILE (r) = DECL_SOURCE_FILE (t); ! DECL_SOURCE_LINE (r) = DECL_SOURCE_LINE (t); DECL_CLASS_CONTEXT (r) = tsubst (DECL_CLASS_CONTEXT (t), args, nargs, t); make_decl_rtl (r, NULL_PTR, 1); --- 1282,1302 ---- TREE_STATIC (r) = TREE_STATIC (t); DECL_INLINE (r) = DECL_INLINE (t); ! { ! #if 0 /* Maybe later. -jason */ ! struct tinst_level *til = tinst_for_decl(); ! ! /* should always be true under new approach */ ! if (til) ! { ! DECL_SOURCE_FILE (r) = til->file; ! DECL_SOURCE_LINE (r) = til->line; ! } ! else ! #endif ! { ! DECL_SOURCE_FILE (r) = DECL_SOURCE_FILE (t); ! DECL_SOURCE_LINE (r) = DECL_SOURCE_LINE (t); ! } ! } DECL_CLASS_CONTEXT (r) = tsubst (DECL_CLASS_CONTEXT (t), args, nargs, t); make_decl_rtl (r, NULL_PTR, 1); *************** *** 1442,1456 **** p->can_free = 0; p->deja_vu = 0; - p->lineno = t->lineno; - p->filename = t->filename; p->buf = t->text; p->len = t->length; p->fndecl = fndecl; ! if (interface_unknown && flag_external_templates) ! warn_if_unknown_interface (); ! if (interface_unknown || !flag_external_templates) ! p->interface = 1; /* unknown */ ! else ! p->interface = interface_only ? 0 : 2; } else --- 1563,1590 ---- p->can_free = 0; p->deja_vu = 0; p->buf = t->text; p->len = t->length; p->fndecl = fndecl; ! { ! int l = lineno; ! char * f = input_filename; ! ! lineno = p->lineno = t->lineno; ! input_filename = p->filename = t->filename; ! ! extract_interface_info (); ! ! if (interface_unknown && flag_external_templates) ! warn_if_unknown_interface (); ! if (interface_unknown || !flag_external_templates) ! p->interface = 1; /* unknown */ ! else ! p->interface = interface_only ? 0 : 2; ! ! lineno = l; ! input_filename = f; ! ! extract_interface_info (); ! } } else *************** *** 1537,1541 **** t = xref_tag (tinfo->aggr, id, NULL_TREE); my_friendly_assert (TREE_CODE (t) == RECORD_TYPE ! || TREE_CODE (t) == UNINSTANTIATED_P_TYPE, 286); decl = build_decl (TYPE_DECL, template, t); --- 1671,1676 ---- t = xref_tag (tinfo->aggr, id, NULL_TREE); my_friendly_assert (TREE_CODE (t) == RECORD_TYPE ! || TREE_CODE (t) == UNION_TYPE ! || TREE_CODE (t) == UNINSTANTIATED_P_TYPE, 286); decl = build_decl (TYPE_DECL, template, t); *************** *** 1639,1642 **** --- 1774,1778 ---- { struct template_info *template_info; + extern struct obstack inline_text_obstack; /* see comment in cp-lex.c */ if (d2 == NULL_TREE || d2 == error_mark_node) *************** *** 1644,1648 **** lose: /* @@ Should use temp obstack, and discard results. */ ! reinit_parse_for_block (yychar, &permanent_obstack, 1); return; } --- 1780,1784 ---- lose: /* @@ Should use temp obstack, and discard results. */ ! reinit_parse_for_block (yychar, &inline_text_obstack, 1); return; } *************** *** 1661,1668 **** template_info->filename = input_filename; template_info->lineno = lineno; ! reinit_parse_for_block (yychar, &permanent_obstack, 1); ! template_info->text = obstack_base (&permanent_obstack); ! template_info->length = obstack_object_size (&permanent_obstack); ! obstack_finish (&permanent_obstack); template_info->parm_vec = d1; } --- 1797,1804 ---- template_info->filename = input_filename; template_info->lineno = lineno; ! reinit_parse_for_block (yychar, &inline_text_obstack, 1); ! template_info->text = obstack_base (&inline_text_obstack); ! template_info->length = obstack_object_size (&inline_text_obstack); ! obstack_finish (&inline_text_obstack); template_info->parm_vec = d1; } *************** *** 1756,1760 **** unify (tparms, targs, ntparms, parm, arg, nsubsts) tree tparms, *targs, parm, arg; ! int *nsubsts; { int idx; --- 1892,1896 ---- unify (tparms, targs, ntparms, parm, arg, nsubsts) tree tparms, *targs, parm, arg; ! int *nsubsts, ntparms; { int idx; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-search.c gcc-2.5.5/cp-search.c *** gcc-2.5.4/cp-search.c Thu Nov 11 02:01:29 1993 --- gcc-2.5.5/cp-search.c Wed Nov 24 18:22:09 1993 *************** *** 810,813 **** --- 810,816 ---- tree types; tree context = DECL_CLASS_CONTEXT (field); + /* Used once we go past an access gate that makes private really + deny us access from the context. */ + int really_private; if (context == NULL_TREE) *************** *** 889,892 **** --- 892,896 ---- basetype_path = reverse_path (basetype_path); types = basetype_path; + really_private = 0; while (types) *************** *** 936,944 **** if (TREE_VIA_PROTECTED (types)) { ! visibility = visibility_protected; } else if (! TREE_VIA_PUBLIC (types)) { ! if (current_class_type != type) visibility = visibility_private; } --- 940,953 ---- if (TREE_VIA_PROTECTED (types)) { ! if (really_private == 0) ! really_private = 1; ! else ! visibility = visibility_protected; } else if (! TREE_VIA_PUBLIC (types)) { ! if (really_private == 0) ! really_private = 2; ! else visibility = visibility_private; } *************** *** 1136,1139 **** --- 1145,1153 ---- int index = MEMOIZED_HASH_FN (name); + /* If we are looking for a constructor in a templated type, use the + unspecialized name, as that is how we store it. */ + if (IDENTIFIER_TEMPLATE (name)) + name = constructor_name (name); + if (TREE_CODE (xbasetype) == TREE_VEC) basetype_path = xbasetype, type = BINFO_TYPE (xbasetype); *************** *** 1592,1595 **** --- 1606,1614 ---- } + /* If we are looking for a constructor in a templated type, use the + unspecialized name, as that is how we store it. */ + if (IDENTIFIER_TEMPLATE (name)) + name = constructor_name (name); + binfo = basetype_path; binfo_h = binfo; *************** *** 2064,2073 **** } } ! if (IDENTIFIER_ERROR_LOCUS (name) == NULL_TREE ! && best == NULL_TREE && warn_overloaded_virtual) ! { ! cp_warning_at ("conflicting specification deriving virtual function `%D'", fndecl); ! SET_IDENTIFIER_ERROR_LOCUS (name, basetype); ! } if (best) { --- 2083,2089 ---- } } ! if (best == NULL_TREE && warn_overloaded_virtual) ! cp_warning_at ("conflicting specification deriving virtual function `%D'", fndecl); ! if (best) { *************** *** 3165,3170 **** install the new one and if it's a TYPE_DECL do the same to the IDENTIFIER_TYPE_VALUE. Such an envelope is recognized by seeing that ! the TREE_PURPOSE slot is a _DECL node of some sort. Because if it's ! not, it could be a set of overloaded methods from an outer scope. */ static void --- 3181,3187 ---- install the new one and if it's a TYPE_DECL do the same to the IDENTIFIER_TYPE_VALUE. Such an envelope is recognized by seeing that ! the TREE_PURPOSE slot is non-null, and that it is not an identifier. ! Because if it is, it could be a set of overloaded methods from an ! outer scope. */ static void *************** *** 3210,3215 **** if (class_value && TREE_CODE (class_value) == TREE_LIST && TREE_PURPOSE (class_value) != NULL_TREE ! && (TREE_CODE_CLASS (TREE_CODE (TREE_PURPOSE (class_value))) ! == 'd')) { tree value = TREE_PURPOSE (class_value); --- 3227,3232 ---- if (class_value && TREE_CODE (class_value) == TREE_LIST && TREE_PURPOSE (class_value) != NULL_TREE ! && (TREE_CODE (TREE_PURPOSE (class_value)) ! != IDENTIFIER_NODE)) { tree value = TREE_PURPOSE (class_value); *************** *** 3345,3353 **** { /* Only complain if we shadow something we can access. */ ! if (old && (DECL_CLASS_CONTEXT (old) == current_class_type ! || ! TREE_PRIVATE (old))) /* Should figure out visibility more accurately. */ ! warning ("shadowing member `%s' with member function", ! IDENTIFIER_POINTER (DECL_NAME (*methods))); tmp = build_tree_list (DECL_NAME (*methods), *methods); } --- 3362,3372 ---- { /* Only complain if we shadow something we can access. */ ! if (old ! && ((DECL_LANG_SPECIFIC (old) ! && DECL_CLASS_CONTEXT (old) == current_class_type) ! || ! TREE_PRIVATE (old))) /* Should figure out visibility more accurately. */ ! cp_warning ("shadowing member `%#D' with member function `%#D'", ! old, *methods); tmp = build_tree_list (DECL_NAME (*methods), *methods); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-spew.c gcc-2.5.5/cp-spew.c *** gcc-2.5.4/cp-spew.c Fri Jun 25 19:14:37 1993 --- gcc-2.5.5/cp-spew.c Wed Nov 24 00:20:42 1993 *************** *** 88,92 **** short *ps; static short toks_follow_ids[] = ! { POINTSAT_LEFT_RIGHT, ASSIGN, RANGE, OROR, ANDAND, MIN_MAX, EQCOMPARE, ARITHCOMPARE, LSHIFT, RSHIFT, UNARY, PLUSPLUS, MINUSMINUS, POINTSAT, POINTSAT_STAR, DOT_STAR, CONSTANT, STRING, SIZEOF, ENUM, IF, --- 88,92 ---- short *ps; static short toks_follow_ids[] = ! { ASSIGN, RANGE, OROR, ANDAND, MIN_MAX, EQCOMPARE, ARITHCOMPARE, LSHIFT, RSHIFT, UNARY, PLUSPLUS, MINUSMINUS, POINTSAT, POINTSAT_STAR, DOT_STAR, CONSTANT, STRING, SIZEOF, ENUM, IF, *************** *** 94,99 **** RETURN, GOTO, ASM_KEYWORD, GCC_ASM_KEYWORD, TYPEOF, ALIGNOF, HEADOF, CLASSOF, ATTRIBUTE, AGGR, VISSPEC, DELETE, RAISE, RERAISE, TRY, EXCEPT, ! CATCH, THROW, ANSI_TRY, ANSI_THROW, EXTERN_LANG_STRING, ALL, ! END_OF_SAVED_INPUT, -1 }; static short toks_follow_types[] = { IDENTIFIER, TYPENAME, SCOPED_TYPENAME, SCSPEC, TYPESPEC, TYPE_QUAL, --- 94,99 ---- RETURN, GOTO, ASM_KEYWORD, GCC_ASM_KEYWORD, TYPEOF, ALIGNOF, HEADOF, CLASSOF, ATTRIBUTE, AGGR, VISSPEC, DELETE, RAISE, RERAISE, TRY, EXCEPT, ! CATCH, THROW, ANSI_TRY, ANSI_THROW, DYNAMIC_CAST, TYPEID, ! EXTERN_LANG_STRING, ALL, END_OF_SAVED_INPUT, -1 }; static short toks_follow_types[] = { IDENTIFIER, TYPENAME, SCOPED_TYPENAME, SCSPEC, TYPESPEC, TYPE_QUAL, *************** *** 193,197 **** /* Never read past these characters: they might separate the current input stream from one we save away later. */ ! if (tmp->yychar == '{' || tmp->yychar == ':') goto pad_tokens; } --- 193,197 ---- /* Never read past these characters: they might separate the current input stream from one we save away later. */ ! if (tmp->yychar == '{' || tmp->yychar == ':' || tmp->yychar == ';') goto pad_tokens; } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-tree.c gcc-2.5.5/cp-tree.c *** gcc-2.5.4/cp-tree.c Fri Oct 8 15:02:05 1993 --- gcc-2.5.5/cp-tree.c Wed Nov 24 00:20:52 1993 *************** *** 945,949 **** tree type = IDENTIFIER_TYPE_VALUE (value); if (CLASSTYPE_ID_AS_LIST (type) == NULL_TREE) ! CLASSTYPE_ID_AS_LIST (type) = perm_tree_cons (NULL_TREE, value, NULL_TREE); list = CLASSTYPE_ID_AS_LIST (type); } --- 945,954 ---- tree type = IDENTIFIER_TYPE_VALUE (value); if (CLASSTYPE_ID_AS_LIST (type) == NULL_TREE) ! { ! /* Not just `value', which could be a template parm. */ ! tree id = DECL_NAME (TYPE_NAME (type)); ! CLASSTYPE_ID_AS_LIST (type) = ! perm_tree_cons (NULL_TREE, id, NULL_TREE); ! } list = CLASSTYPE_ID_AS_LIST (type); } *************** *** 994,999 **** tree type = IDENTIFIER_TYPE_VALUE (value); if (CLASSTYPE_ID_AS_LIST (type) == NULL_TREE) ! CLASSTYPE_ID_AS_LIST (type) = perm_tree_cons (NULL_TREE, value, ! NULL_TREE); list = CLASSTYPE_ID_AS_LIST (type); } --- 999,1008 ---- tree type = IDENTIFIER_TYPE_VALUE (value); if (CLASSTYPE_ID_AS_LIST (type) == NULL_TREE) ! { ! /* Not just `value', which could be a template parm. */ ! tree id = DECL_NAME (TYPE_NAME (type)); ! CLASSTYPE_ID_AS_LIST (type) = ! perm_tree_cons (NULL_TREE, id, NULL_TREE); ! } list = CLASSTYPE_ID_AS_LIST (type); } *************** *** 1271,1274 **** --- 1280,1293 ---- } + int + count_functions (t) + tree t; + { + if (TREE_CODE (t) == FUNCTION_DECL) + return 1; + + return decl_list_length (TREE_VALUE (t)); + } + tree fnaddr_from_vtable_entry (entry) *************** *** 1340,1354 **** int i; if (TREE_CODE (decl) != FUNCTION_DECL || DECL_LANG_SPECIFIC (decl) == 0) ! { ! if (DECL_NAME (decl)) ! { ! if (THIS_NAME_P (DECL_NAME (decl))) ! return "this"; ! return IDENTIFIER_POINTER (DECL_NAME (decl)); ! } ! return "((anonymous))"; ! } /* See if this print name is lying around. */ --- 1359,1366 ---- int i; + /* Only cache functions. */ if (TREE_CODE (decl) != FUNCTION_DECL || DECL_LANG_SPECIFIC (decl) == 0) ! return decl_as_string (decl, 1); /* See if this print name is lying around. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-tree.h gcc-2.5.5/cp-tree.h *** gcc-2.5.4/cp-tree.h Fri Oct 8 19:56:10 1993 --- gcc-2.5.5/cp-tree.h Wed Nov 24 00:21:08 1993 *************** *** 1127,1130 **** --- 1127,1131 ---- extern tree vtable_entry_type; extern tree __t_desc_type_node, __i_desc_type_node, __m_desc_type_node; + extern tree Type_info_type_node; extern tree class_star_type_node; extern tree this_identifier; *************** *** 1184,1187 **** --- 1185,1200 ---- extern int processing_template_decl, processing_template_defn; + /* The template currently being instantiated, and where the instantiation + was triggered. */ + struct tinst_level + { + tree classname; + int line; + char *file; + struct tinst_level *next; + }; + + extern struct tinst_level *current_tinst_level; + /* in cp-class.c */ extern tree current_class_name; *************** *** 1641,1644 **** --- 1654,1659 ---- extern void push_exception_cleanup PROTO((tree)); extern void revert_static_member_fn PROTO((tree *, tree *, tree *)); + extern tree get_unique_fn PROTO((tree)); + extern tree get_first_fn PROTO((tree)); /* in cp-decl2.c */ *************** *** 1655,1658 **** --- 1670,1674 ---- extern tree grokoptypename PROTO((tree, int)); extern tree build_push_scope PROTO((tree, tree)); + extern tree constructor_name_full PROTO((tree)); extern tree constructor_name PROTO((tree)); extern void setup_vtbl_ptr PROTO((void)); *************** *** 1671,1677 **** extern tree grok_x_components PROTO((tree, tree)); - /* in cp-dem.c */ - extern char *cplus_demangle PROTO((char *)); - /* in cp-edsel.c */ --- 1687,1690 ---- *************** *** 1718,1721 **** --- 1731,1737 ---- extern void lang_expand_end_bindings PROTO((struct rtx_def *, struct rtx_def *)); extern void init_gc_processing PROTO((void)); + extern tree build_typeid PROTO((tree)); + extern tree get_typeid PROTO((tree)); + extern tree build_dynamic_cast PROTO((tree, tree)); /* in cp-init.c */ *************** *** 1797,1800 **** --- 1813,1818 ---- extern char *decl_as_string PROTO((tree, int)); extern char *expr_as_string PROTO((tree, int)); + extern char *code_as_string PROTO((enum tree_code, int)); + extern char *language_as_string PROTO((enum languages, int)); /* in cp-method.c */ *************** *** 1810,1816 **** extern tree build_t_desc_overload PROTO((tree)); extern void declare_overloaded PROTO((tree)); - #ifdef NO_AUTO_OVERLOAD - extern int is_overloaded PROTO((tree)); - #endif extern tree build_opfncall PROTO((enum tree_code, int, tree, tree, tree)); extern tree hack_identifier PROTO((tree, tree, int)); --- 1828,1831 ---- *************** *** 1836,1839 **** --- 1851,1855 ---- extern int do_pending_expansions PROTO((void)); extern void do_pending_templates PROTO((void)); + struct tinst_level *tinst_for_decl PROTO((void)); /* in cp-search.c */ *************** *** 1923,1926 **** --- 1939,1943 ---- extern tree require_complete_type PROTO((tree)); extern int type_unknown_p PROTO((tree)); + extern int fntype_p PROTO((tree)); extern tree require_instantiated_type PROTO((tree, tree, tree)); extern tree commonparms PROTO((tree, tree)); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-type2.c gcc-2.5.5/cp-type2.c *** gcc-2.5.4/cp-type2.c Tue Oct 19 23:12:16 1993 --- gcc-2.5.5/cp-type2.c Wed Nov 24 00:21:21 1993 *************** *** 298,303 **** same situation (call exit). */ ! /* First used: 0 (reserved), Last used: 354. */ void my_friendly_abort (i) --- 298,305 ---- same situation (call exit). */ ! /* First used: 0 (reserved), Last used: 355. Free: 145. */ + static int abortcount = 0; + void my_friendly_abort (i) *************** *** 304,309 **** int i; { - static int abortcount = 0; - /* if the previous error came through here, i.e. report_error_function ended up calling us again, don't just exit; we want a diagnostic of --- 306,309 ---- *************** *** 320,324 **** ack ("Internal compiler error %d.", i); ack ("Please submit a full bug report to `bug-g++@prep.ai.mit.edu'."); ! } exit (34); } --- 320,327 ---- ack ("Internal compiler error %d.", i); ack ("Please submit a full bug report to `bug-g++@prep.ai.mit.edu'."); ! } ! else ! error ("confused by earlier errors, bailing out"); ! exit (34); } *************** *** 945,950 **** { tree tail1 = tail; ! next1 = digest_init (TREE_TYPE (field), ! TREE_VALUE (tail), &tail1); my_friendly_assert (tail1 == 0 || TREE_CODE (tail1) == TREE_LIST, 320); --- 948,964 ---- { tree tail1 = tail; ! ! if (TYPE_PTRMEMFUNC_P (TREE_TYPE (field))) ! { ! tree t ! = build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (field)), ! default_conversion (TREE_VALUE (tail))); ! if (t == NULL_TREE) ! return error_mark_node; ! next1 = digest_init (TREE_TYPE (field), t, &tail1); ! } ! else ! next1 = digest_init (TREE_TYPE (field), ! TREE_VALUE (tail), &tail1); my_friendly_assert (tail1 == 0 || TREE_CODE (tail1) == TREE_LIST, 320); *************** *** 1414,1419 **** goto return_function; ! error ("cannot cast null list to type `%s'", ! IDENTIFIER_POINTER (name)); return error_mark_node; } --- 1428,1432 ---- goto return_function; ! cp_error ("cannot cast null list to type `%#T'", type); return error_mark_node; } *************** *** 1421,1426 **** || (expr_as_fncall && expr_as_fncall != error_mark_node)) { ! error ("ambiguity between cast to `%s' and function call", ! IDENTIFIER_POINTER (name)); return error_mark_node; } --- 1434,1438 ---- || (expr_as_fncall && expr_as_fncall != error_mark_node)) { ! cp_error ("ambiguity between cast to `%#T' and function call", type); return error_mark_node; } *************** *** 1549,1553 **** if (current_function_decl) ! return build_cplus_new (type, expr_as_ctor, 1); { --- 1561,1565 ---- if (current_function_decl) ! return build_cplus_new (type, expr_as_ctor, 0); { diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/cp-typeck.c gcc-2.5.5/cp-typeck.c *** gcc-2.5.4/cp-typeck.c Tue Nov 2 03:42:55 1993 --- gcc-2.5.5/cp-typeck.c Thu Nov 25 18:08:40 1993 *************** *** 295,304 **** /* Same precision. Prefer longs to ints even when same size. */ ! if (t1 == long_unsigned_type_node ! || t2 == long_unsigned_type_node) return long_unsigned_type_node; ! if (t1 == long_integer_type_node ! || t2 == long_integer_type_node) { /* But preserve unsignedness from the other type, --- 295,304 ---- /* Same precision. Prefer longs to ints even when same size. */ ! if (TYPE_MAIN_VARIANT (t1) == long_unsigned_type_node ! || TYPE_MAIN_VARIANT (t2) == long_unsigned_type_node) return long_unsigned_type_node; ! if (TYPE_MAIN_VARIANT (t1) == long_integer_type_node ! || TYPE_MAIN_VARIANT (t2) == long_integer_type_node) { /* But preserve unsignedness from the other type, *************** *** 549,555 **** return 0; } - - /* The special treatment for REFERENCE_TYPE with STRICT == 2 - should not be done recursively. */ if (strict > 1) strict = 1; --- 549,552 ---- *************** *** 839,846 **** /* An unspecified parmlist matches any specified parmlist ! whose argument types don't need default promotions. */ ! if (t1 == 0) ! return self_promoting_args_p (t2); if (t2 == 0) return self_promoting_args_p (t1); --- 836,848 ---- /* An unspecified parmlist matches any specified parmlist ! whose argument types don't need default promotions. ! @@@ see 13.3.3 for a counterexample... */ ! if (t1 == 0 && t2 != 0) ! { ! cp_pedwarn ("ANSI C++ prohibits conversion from `(%#T)' to `(...)'", ! parms2); ! return self_promoting_args_p (t2); ! } if (t2 == 0) return self_promoting_args_p (t1); *************** *** 1084,1092 **** /* size_binop does not put the constant in range, so do it now. */ if (TREE_CODE (t) == INTEGER_CST && force_fit_type (t, 0)) - #if 0 TREE_CONSTANT_OVERFLOW (t) = TREE_OVERFLOW (t) = 1; - #else - TREE_CONSTANT_OVERFLOW (t) = 1; - #endif return t; } --- 1086,1090 ---- *************** *** 1196,1200 **** type = type_for_size (MAX (TYPE_PRECISION (type), TYPE_PRECISION (integer_type_node)), ! (flag_traditional && TREE_UNSIGNED (type))); return convert (type, exp); } --- 1194,1200 ---- type = type_for_size (MAX (TYPE_PRECISION (type), TYPE_PRECISION (integer_type_node)), ! ((flag_traditional ! || TYPE_PRECISION (type) >= TYPE_PRECISION (integer_type_node)) ! && TREE_UNSIGNED (type))); return convert (type, exp); } *************** *** 1448,1454 **** if (TYPE_IDENTIFIER (basetype) != TREE_OPERAND (component, 0)) { ! error_with_aggr_type (basetype, ! "destructor specifier `%s::~%s' must have matching names", ! IDENTIFIER_POINTER (TREE_OPERAND (component, 0))); return error_mark_node; } --- 1448,1453 ---- if (TYPE_IDENTIFIER (basetype) != TREE_OPERAND (component, 0)) { ! cp_error ("destructor specifier `%T::~%T' must have matching names", ! basetype, TREE_OPERAND (component, 0)); return error_mark_node; } *************** *** 1521,1531 **** if (component == ansi_opname[(int) TYPE_EXPR]) ! error ("%s has no such type conversion operator", ! code == RECORD_TYPE ? "structure" : "union"); else ! error (code == RECORD_TYPE ! ? "structure has no member named `%s'" ! : "union has no member named `%s'", ! IDENTIFIER_POINTER (component)); return error_mark_node; } --- 1520,1526 ---- if (component == ansi_opname[(int) TYPE_EXPR]) ! cp_error ("`%#T' has no such type conversion operator", basetype); else ! cp_error ("`%#T' has no member named `%D'", basetype, component); return error_mark_node; } *************** *** 1603,1622 **** if (TREE_CODE (type) == POINTER_TYPE || TREE_CODE (type) == REFERENCE_TYPE) ! if (TREE_CODE (pointer) == ADDR_EXPR ! && (TREE_TYPE (TREE_OPERAND (pointer, 0)) ! == TREE_TYPE (type))) ! return TREE_OPERAND (pointer, 0); ! else ! { ! tree t = TREE_TYPE (type); ! register tree ref = build1 (INDIRECT_REF, ! TYPE_MAIN_VARIANT (t), pointer); ! ! TREE_READONLY (ref) = TYPE_READONLY (t); ! TREE_THIS_VOLATILE (ref) = TYPE_VOLATILE (t); ! TREE_SIDE_EFFECTS (ref) ! = TYPE_VOLATILE (t) || TREE_SIDE_EFFECTS (pointer); ! return ref; ! } else if (pointer != error_mark_node) { --- 1598,1623 ---- if (TREE_CODE (type) == POINTER_TYPE || TREE_CODE (type) == REFERENCE_TYPE) ! { ! if (TREE_CODE (pointer) == ADDR_EXPR ! && (TREE_TYPE (TREE_OPERAND (pointer, 0)) ! == TREE_TYPE (type))) ! return TREE_OPERAND (pointer, 0); ! else ! { ! tree t = TREE_TYPE (type); ! register tree ref = build1 (INDIRECT_REF, ! TYPE_MAIN_VARIANT (t), pointer); ! ! TREE_READONLY (ref) = TYPE_READONLY (t); ! TREE_THIS_VOLATILE (ref) = TYPE_VOLATILE (t); ! TREE_SIDE_EFFECTS (ref) ! = TYPE_VOLATILE (t) || TREE_SIDE_EFFECTS (pointer); ! return ref; ! } ! } ! /* `pointer' won't be an error_mark_node if we were given a ! pointer to member, so it's cool to check for this here. */ ! else if (TYPE_PTRMEMFUNC_P (type)) ! error ("use of `%s' on pointer to member", errorstring); else if (pointer != error_mark_node) { *************** *** 2480,2485 **** { char *buf = (char *)alloca (32 + strlen (called_thing)); ! sprintf (buf, "too few arguments to %s `%%s'", called_thing); ! error_with_decl (fndecl, buf); error ("at this point in file"); } --- 2481,2486 ---- { char *buf = (char *)alloca (32 + strlen (called_thing)); ! sprintf (buf, "too few arguments to %s `%%#D'", called_thing); ! cp_error_at (buf, fndecl); error ("at this point in file"); } *************** *** 3477,3482 **** if (flag_gc) ! warning ("address of `%s::%s' taken", TYPE_NAME_STRING (basetype), ! IDENTIFIER_POINTER (DECL_NAME (field))); if (TREE_CODE (field) == FIELD_DECL --- 3478,3482 ---- if (flag_gc) ! cp_warning ("address of `%T::%D' taken", basetype, field); if (TREE_CODE (field) == FIELD_DECL *************** *** 3873,3877 **** /* If this function is unique, or it is a unique ! constructor, we can takes its address easily. */ if (DECL_CHAIN (targ) == NULL_TREE || (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (targ)) --- 3873,3877 ---- /* If this function is unique, or it is a unique ! constructor, we can take its address easily. */ if (DECL_CHAIN (targ) == NULL_TREE || (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (targ)) *************** *** 4699,4705 **** } ! /* When converting into a reference type, just convert into a pointer ! to the new type and deference it. While this is not exactly what ARM 5.4 ! calls for, it is pretty close for now. (int &)ri ---> *(int*)&ri */ if (TREE_CODE (type) == REFERENCE_TYPE) { --- 4699,4706 ---- } ! /* When converting into a reference type, just convert into a pointer to ! the new type and deference it. While this is not exactly what ARM 5.4 ! calls for [why not? -jason], it is pretty close for now. ! (int &)ri ---> *(int*)&ri */ if (TREE_CODE (type) == REFERENCE_TYPE) { *************** *** 4808,4814 **** if (TREE_CODE (value) == INTEGER_CST) { - #if 0 TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue); - #endif TREE_CONSTANT_OVERFLOW (value) = TREE_CONSTANT_OVERFLOW (ovalue); } --- 4809,4813 ---- *************** *** 4937,4941 **** if (modifycode == INIT_EXPR && TYPE_HAS_INIT_REF (lhstype)) { ! result = build_method_call (lhs, constructor_name (lhstype), build_tree_list (NULL_TREE, rhs), basetype_path, LOOKUP_NORMAL); --- 4936,4940 ---- if (modifycode == INIT_EXPR && TYPE_HAS_INIT_REF (lhstype)) { ! result = build_method_call (lhs, constructor_name_full (lhstype), build_tree_list (NULL_TREE, rhs), basetype_path, LOOKUP_NORMAL); *************** *** 4944,4948 **** else if (modifycode == NOP_EXPR) { ! /* `operator=' is not an inheritable operator. */ if (TYPE_LANG_SPECIFIC (lhstype) && TYPE_HAS_ASSIGNMENT (lhstype)) { --- 4943,4947 ---- else if (modifycode == NOP_EXPR) { ! /* `operator=' is not an inheritable operator; see 13.4.3. */ if (TYPE_LANG_SPECIFIC (lhstype) && TYPE_HAS_ASSIGNMENT (lhstype)) { *************** *** 5000,5003 **** --- 4999,5015 ---- continue; + if (TREE_READONLY (elt) + || TREE_CODE (TREE_TYPE (elt)) == REFERENCE_TYPE) + { + cp_error ("cannot generate default `%T::operator ='", + lhstype); + if (TREE_CODE (TREE_TYPE (elt)) == REFERENCE_TYPE) + cp_error_at ("because member `%#D' is a reference", elt); + else + cp_error_at ("because member `%#D' is const", elt); + + return error_mark_node; + } + if (IS_AGGR_TYPE (TREE_TYPE (elt)) && TYPE_LANG_SPECIFIC (TREE_TYPE (elt))) *************** *** 5137,5144 **** case COMPOUND_EXPR: pedantic_lvalue_warning (COMPOUND_EXPR); return build (COMPOUND_EXPR, lhstype, ! TREE_OPERAND (lhs, 0), ! build_modify_expr (TREE_OPERAND (lhs, 1), ! modifycode, rhs)); /* Handle (a ? b : c) used as an "lvalue". */ --- 5149,5158 ---- case COMPOUND_EXPR: pedantic_lvalue_warning (COMPOUND_EXPR); + newrhs = build_modify_expr (TREE_OPERAND (lhs, 1), + modifycode, rhs); + if (TREE_CODE (newrhs) == ERROR_MARK) + return error_mark_node; return build (COMPOUND_EXPR, lhstype, ! TREE_OPERAND (lhs, 0), newrhs); /* Handle (a ? b : c) used as an "lvalue". */ *************** *** 5156,5159 **** --- 5170,5175 ---- build_modify_expr (TREE_OPERAND (lhs, 2), modifycode, rhs)); + if (TREE_CODE (cond) == ERROR_MARK) + return cond; /* Make sure the code to compute the rhs comes out before the split. */ *************** *** 5276,5279 **** --- 5292,5297 ---- convert (TREE_TYPE (inner_lhs), convert (lhstype, newrhs))); + if (TREE_CODE (result) == ERROR_MARK) + return result; return convert (TREE_TYPE (lhs), result); } *************** *** 5510,5514 **** TREE_TYPE (result) = void_type_node; do_pending_stack_adjust (); ! start_sequence (); /* As a matter of principle, `start_sequence' should do this. */ --- 5528,5532 ---- TREE_TYPE (result) = void_type_node; do_pending_stack_adjust (); ! start_sequence_for_rtl_expr (result); /* As a matter of principle, `start_sequence' should do this. */ *************** *** 5929,5933 **** else if (TYPE_MAIN_VARIANT (ttl) == void_type_node || TYPE_MAIN_VARIANT (ttr) == void_type_node ! || comp_target_types (type, rhstype, 1)) { /* ARM $4.8, commentary on p39. */ --- 5947,5953 ---- else if (TYPE_MAIN_VARIANT (ttl) == void_type_node || TYPE_MAIN_VARIANT (ttr) == void_type_node ! || comp_target_types (type, rhstype, 1) ! || (unsigned_type (TYPE_MAIN_VARIANT (ttl)) ! == unsigned_type (TYPE_MAIN_VARIANT (ttr)))) { /* ARM $4.8, commentary on p39. */ *************** *** 6056,6060 **** tree rhs = build_decl (FUNCTION_DECL, null_name, ttr); tmpbuf = fndecl_as_string (0, lhs, 1); ! lhsbuf = (char *) alloca (strlen (tmpbuf)); strcpy (lhsbuf, tmpbuf); rhsbuf = fndecl_as_string (0, rhs, 1); --- 6076,6080 ---- tree rhs = build_decl (FUNCTION_DECL, null_name, ttr); tmpbuf = fndecl_as_string (0, lhs, 1); ! lhsbuf = (char *) alloca (strlen (tmpbuf)+1); strcpy (lhsbuf, tmpbuf); rhsbuf = fndecl_as_string (0, rhs, 1); *************** *** 6097,6101 **** /* An explicit constant 0 can convert to a pointer, but not a 0 that results from casting or folding. */ ! if (! TREE_CODE (rhs) == INTEGER_CST && integer_zerop (rhs)) { warn_for_assignment ("%s of pointer from integer lacks a cast", --- 6117,6121 ---- /* An explicit constant 0 can convert to a pointer, but not a 0 that results from casting or folding. */ ! if (! (TREE_CODE (rhs) == INTEGER_CST && integer_zerop (rhs))) { warn_for_assignment ("%s of pointer from integer lacks a cast", *************** *** 6316,6325 **** if (TYPE_HAS_INIT_REF (type)) { ! /* We have to check for template classes here, or else ! build_method_call won't be able to see the constructor. */ ! tree id = TYPE_IDENTIFIER (type); ! tree name ! = IDENTIFIER_TEMPLATE (id) ? id : constructor_name (type); ! tree init = build_method_call (exp, name, build_tree_list (NULL_TREE, rhs), NULL_TREE, LOOKUP_NORMAL); --- 6336,6340 ---- if (TYPE_HAS_INIT_REF (type)) { ! tree init = build_method_call (exp, constructor_name_full (type), build_tree_list (NULL_TREE, rhs), NULL_TREE, LOOKUP_NORMAL); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/dwarfout.c gcc-2.5.5/dwarfout.c *** gcc-2.5.4/dwarfout.c Mon Sep 27 20:11:21 1993 --- gcc-2.5.5/dwarfout.c Tue Nov 23 21:18:03 1993 *************** *** 2987,2990 **** --- 2987,3012 ---- } + /* Get the function's label, as described by its RTL. + This may be different from the DECL_NAME name used + in the source file. */ + + static char * + function_start_label (decl) + register tree decl; + { + rtx x; + char *fnname; + + x = DECL_RTL (decl); + if (GET_CODE (x) != MEM) + abort (); + x = XEXP (x, 0); + if (GET_CODE (x) != SYMBOL_REF) + abort (); + fnname = XSTR (x, 0); + return fnname; + } + + /******************************* DIEs ************************************/ *************** *** 3056,3060 **** equate_decl_number_to_die_number (decl); else ! low_pc_attribute (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))); } #endif --- 3078,3082 ---- equate_decl_number_to_die_number (decl); else ! low_pc_attribute (function_start_label (decl)); } #endif *************** *** 3215,3219 **** char label[MAX_ARTIFICIAL_LABEL_BYTES]; ! low_pc_attribute (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))); sprintf (label, FUNC_END_LABEL_FMT, current_funcdef_number); high_pc_attribute (label); --- 3237,3241 ---- char label[MAX_ARTIFICIAL_LABEL_BYTES]; ! low_pc_attribute (function_start_label (decl)); sprintf (label, FUNC_END_LABEL_FMT, current_funcdef_number); high_pc_attribute (label); *************** *** 3558,3563 **** { char label[MAX_ARTIFICIAL_LABEL_BYTES]; ! ! low_pc_attribute (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))); sprintf (label, FUNC_END_LABEL_FMT, current_funcdef_number); high_pc_attribute (label); --- 3580,3584 ---- { char label[MAX_ARTIFICIAL_LABEL_BYTES]; ! low_pc_attribute (function_start_label (decl)); sprintf (label, FUNC_END_LABEL_FMT, current_funcdef_number); high_pc_attribute (label); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/emit-rtl.c gcc-2.5.5/emit-rtl.c *** gcc-2.5.4/emit-rtl.c Fri Nov 5 01:48:54 1993 --- gcc-2.5.5/emit-rtl.c Thu Nov 25 18:07:01 1993 *************** *** 37,40 **** --- 37,41 ---- #include "gvarargs.h" #include "rtl.h" + #include "tree.h" #include "flags.h" #include "function.h" *************** *** 170,175 **** Both are reset to null at the start of rtl generation for the function. ! start_sequence saves both of these on `sequence_stack' and then ! starts a new, nested sequence of insns. */ static rtx first_insn = NULL; --- 171,176 ---- Both are reset to null at the start of rtl generation for the function. ! start_sequence saves both of these on `sequence_stack' along with ! `sequence_rtl_expr' and then starts a new, nested sequence of insns. */ static rtx first_insn = NULL; *************** *** 176,179 **** --- 177,186 ---- static rtx last_insn = NULL; + /* RTL_EXPR within which the current sequence will be placed. Use to + prevent reuse of any temporaries within the sequence until after the + RTL_EXPR is emitted. */ + + tree sequence_rtl_expr = NULL; + /* INSN_UID for next insn emitted. Reset to 1 for each function compiled. */ *************** *** 1338,1341 **** --- 1345,1349 ---- p->first_insn = first_insn; p->last_insn = last_insn; + p->sequence_rtl_expr = sequence_rtl_expr; p->sequence_stack = sequence_stack; p->cur_insn_uid = cur_insn_uid; *************** *** 1361,1364 **** --- 1369,1373 ---- first_insn = p->first_insn; last_insn = p->last_insn; + sequence_rtl_expr = p->sequence_rtl_expr; sequence_stack = p->sequence_stack; cur_insn_uid = p->cur_insn_uid; *************** *** 2774,2777 **** --- 2783,2798 ---- } + /* Similarly, but indicate that this sequence will be placed in + T, an RTL_EXPR. */ + + void + start_sequence_for_rtl_expr (t) + tree t; + { + start_sequence (); + + sequence_rtl_expr = t; + } + /* Set up the insn chain starting with FIRST as the current sequence, saving the previously current one. */ *************** *** 3048,3051 **** --- 3069,3073 ---- first_insn = NULL; last_insn = NULL; + sequence_rtl_expr = NULL; cur_insn_uid = 1; reg_rtx_no = LAST_VIRTUAL_REGISTER + 1; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/expr.c gcc-2.5.5/expr.c *** gcc-2.5.4/expr.c Sun Nov 14 19:11:28 1993 --- gcc-2.5.5/expr.c Thu Nov 25 18:07:41 1993 *************** *** 3029,3032 **** --- 3029,3039 ---- { rtx temp = expand_expr (exp, NULL_RTX, VOIDmode, 0); + + /* Unless MODE is VOIDmode or BLKmode, convert TEMP to + MODE. */ + if (mode != VOIDmode && mode != BLKmode + && mode != TYPE_MODE (TREE_TYPE (exp))) + temp = convert_modes (mode, TYPE_MODE (TREE_TYPE (exp)), temp, 1); + /* Store the value in the bitfield. */ store_bit_field (target, bitsize, bitpos, mode, temp, align, total_size); *************** *** 3939,3944 **** /* If the mode of SAVE_EXPR_RTL does not match that of the expression, it must be a promoted value. We return a SUBREG of the wanted mode, ! but mark it so that we know that it was already extended. Note ! that `unsignedp' was modified above in this case. */ if (GET_CODE (SAVE_EXPR_RTL (exp)) == REG --- 3946,3950 ---- /* If the mode of SAVE_EXPR_RTL does not match that of the expression, it must be a promoted value. We return a SUBREG of the wanted mode, ! but mark it so that we know that it was already extended. */ if (GET_CODE (SAVE_EXPR_RTL (exp)) == REG *************** *** 3945,3948 **** --- 3951,3967 ---- && GET_MODE (SAVE_EXPR_RTL (exp)) != mode) { + enum machine_mode var_mode = mode; + + if (TREE_CODE (type) == INTEGER_TYPE + || TREE_CODE (type) == ENUMERAL_TYPE + || TREE_CODE (type) == BOOLEAN_TYPE + || TREE_CODE (type) == CHAR_TYPE + || TREE_CODE (type) == REAL_TYPE + || TREE_CODE (type) == POINTER_TYPE + || TREE_CODE (type) == OFFSET_TYPE) + { + PROMOTE_MODE (var_mode, unsignedp, type); + } + temp = gen_rtx (SUBREG, mode, SAVE_EXPR_RTL (exp), 0); SUBREG_PROMOTED_VAR_P (temp) = 1; *************** *** 4039,4042 **** --- 4058,4062 ---- emit_insns (RTL_EXPR_SEQUENCE (exp)); RTL_EXPR_SEQUENCE (exp) = const0_rtx; + free_temps_for_rtl_expr (exp); return RTL_EXPR_RTL (exp); *************** *** 4584,4588 **** { RTL_EXPR_RTL (exp) ! = expand_expr (TREE_OPERAND (exp, 0), target, tmode, modifier); cleanups_this_call = tree_cons (NULL_TREE, TREE_OPERAND (exp, 2), cleanups_this_call); --- 4604,4610 ---- { RTL_EXPR_RTL (exp) ! = expand_expr (TREE_OPERAND (exp, 0), ! target ? target : const0_rtx, ! tmode, modifier); cleanups_this_call = tree_cons (NULL_TREE, TREE_OPERAND (exp, 2), cleanups_this_call); *************** *** 5593,5619 **** } ! #if 0 ! /* I bet this needs to be done, and I bet that it needs to ! be above, inside the else clause. The reason is ! simple, how else is it going to get cleaned up? (mrs) ! ! The reason is probably did not work before, and was ! commented out is because this was re-expanding already ! expanded target_exprs (target == 0 and DECL_RTL (slot) ! != 0) also cleaning them up many times as well. :-( */ ! ! /* Since SLOT is not known to the called function ! to belong to its stack frame, we must build an explicit ! cleanup. This case occurs when we must build up a reference ! to pass the reference as an argument. In this case, ! it is very likely that such a reference need not be ! built here. */ ! ! if (TREE_OPERAND (exp, 2) == 0) ! TREE_OPERAND (exp, 2) = maybe_build_cleanup (slot); ! if (TREE_OPERAND (exp, 2)) ! cleanups_this_call = tree_cons (NULL_TREE, TREE_OPERAND (exp, 2), ! cleanups_this_call); ! #endif } else --- 5615,5635 ---- } ! /* We set IGNORE when we know that we're already ! doing this for a cleanup. */ ! if (ignore == 0) ! { ! /* Since SLOT is not known to the called function ! to belong to its stack frame, we must build an explicit ! cleanup. This case occurs when we must build up a reference ! to pass the reference as an argument. In this case, ! it is very likely that such a reference need not be ! built here. */ ! ! if (TREE_OPERAND (exp, 2) == 0) ! TREE_OPERAND (exp, 2) = maybe_build_cleanup (slot); ! if (TREE_OPERAND (exp, 2)) ! cleanups_this_call = tree_cons (NULL_TREE, TREE_OPERAND (exp, 2), ! cleanups_this_call); ! } } else *************** *** 5753,5757 **** else { ! op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, (modifier == EXPAND_INITIALIZER ? modifier : EXPAND_CONST_ADDRESS)); --- 5769,5776 ---- else { ! /* We make sure to pass const0_rtx down if we came in with ! ignore set, to avoid doing the cleanups twice for something. */ ! op0 = expand_expr (TREE_OPERAND (exp, 0), ! ignore ? const0_rtx : NULL_RTX, VOIDmode, (modifier == EXPAND_INITIALIZER ? modifier : EXPAND_CONST_ADDRESS)); *************** *** 6629,6633 **** /* Arg could be wrong type if user redeclared this fcn wrong. */ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != REAL_TYPE) ! return CONST0_RTX (TYPE_MODE (TREE_TYPE (exp))); /* Stabilize and compute the argument. */ --- 6648,6652 ---- /* Arg could be wrong type if user redeclared this fcn wrong. */ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != REAL_TYPE) ! break; /* Stabilize and compute the argument. */ *************** *** 7045,7049 **** /* Arg could be non-integer if user redeclared this fcn wrong. */ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != INTEGER_TYPE) ! return const0_rtx; current_function_calls_alloca = 1; /* Compute the argument. */ --- 7064,7068 ---- /* Arg could be non-integer if user redeclared this fcn wrong. */ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != INTEGER_TYPE) ! break; current_function_calls_alloca = 1; /* Compute the argument. */ *************** *** 7066,7070 **** /* Arg could be non-integer if user redeclared this fcn wrong. */ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != INTEGER_TYPE) ! return const0_rtx; /* Compute the argument. */ --- 7085,7089 ---- /* Arg could be non-integer if user redeclared this fcn wrong. */ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != INTEGER_TYPE) ! break; /* Compute the argument. */ *************** *** 7086,7090 **** /* Arg could be non-pointer if user redeclared this fcn wrong. */ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE) ! return const0_rtx; else { --- 7105,7109 ---- /* Arg could be non-pointer if user redeclared this fcn wrong. */ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE) ! break; else { *************** *** 7170,7174 **** || TREE_CHAIN (arglist) == 0 || TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (arglist)))) != POINTER_TYPE) ! return const0_rtx; else { --- 7189,7193 ---- || TREE_CHAIN (arglist) == 0 || TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (arglist)))) != POINTER_TYPE) ! break; else { *************** *** 7196,7200 **** || TREE_CHAIN (TREE_CHAIN (arglist)) == 0 || TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))))) != INTEGER_TYPE) ! return const0_rtx; else { --- 7215,7219 ---- || TREE_CHAIN (TREE_CHAIN (arglist)) == 0 || TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))))) != INTEGER_TYPE) ! break; else { *************** *** 7248,7252 **** || TREE_CHAIN (arglist) == 0 || TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (arglist)))) != POINTER_TYPE) ! return const0_rtx; else if (!HAVE_cmpstrsi) break; --- 7267,7271 ---- || TREE_CHAIN (arglist) == 0 || TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (arglist)))) != POINTER_TYPE) ! break; else if (!HAVE_cmpstrsi) break; *************** *** 7303,7307 **** || TREE_CHAIN (TREE_CHAIN (arglist)) == 0 || TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))))) != INTEGER_TYPE) ! return const0_rtx; else if (!HAVE_cmpstrsi) break; --- 7322,7326 ---- || TREE_CHAIN (TREE_CHAIN (arglist)) == 0 || TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))))) != INTEGER_TYPE) ! break; else if (!HAVE_cmpstrsi) break; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/final.c gcc-2.5.5/final.c *** gcc-2.5.4/final.c Tue Oct 12 07:58:05 1993 --- gcc-2.5.5/final.c Mon Nov 22 14:00:49 1993 *************** *** 607,611 **** else if (GET_CODE (body) == ASM_INPUT || asm_noperands (body) >= 0) ! length = asm_insn_count (insn) * insn_default_length (insn); else if (GET_CODE (body) == SEQUENCE) for (i = 0; i < XVECLEN (body, 0); i++) --- 607,611 ---- else if (GET_CODE (body) == ASM_INPUT || asm_noperands (body) >= 0) ! length = asm_insn_count (body) * insn_default_length (insn); else if (GET_CODE (body) == SEQUENCE) for (i = 0; i < XVECLEN (body, 0); i++) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/fix-header.c gcc-2.5.5/fix-header.c *** gcc-2.5.4/fix-header.c Fri Nov 12 18:00:15 1993 --- gcc-2.5.5/fix-header.c Sun Nov 21 05:09:14 1993 *************** *** 367,371 **** if (required_unseen_count) ! fprintf (outf, "#if defined(__STDC__) || defined(__cplusplus)\n"); /* Now we print out prototypes for those functions that we haven't seen. */ --- 367,371 ---- if (required_unseen_count) ! fprintf (outf, "#ifdef __cplusplus\n"); /* Now we print out prototypes for those functions that we haven't seen. */ *************** *** 383,387 **** || !strcmp (fn->fname, "vprintf") || !strcmp (fn->fname, "vfprintf") ! || !strcmp (fn->fname, "vsprintf")) macro_protect = 1; --- 383,388 ---- || !strcmp (fn->fname, "vprintf") || !strcmp (fn->fname, "vfprintf") ! || !strcmp (fn->fname, "vsprintf") ! || !strcmp (fn->fname, "rewinddir")) macro_protect = 1; *************** *** 395,399 **** if (required_unseen_count) fprintf (outf, ! "#endif /* defined(__STDC__) || defined(__cplusplus) */\n"); switch (special_file_handling) --- 396,400 ---- if (required_unseen_count) fprintf (outf, ! "#endif /* defined(__cplusplus) */\n"); switch (special_file_handling) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/fixinc.dgux gcc-2.5.5/fixinc.dgux *** gcc-2.5.4/fixinc.dgux Mon Aug 16 15:37:27 1993 --- gcc-2.5.5/fixinc.dgux Fri Nov 19 15:17:34 1993 *************** *** 108,112 **** # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. dots=`echo "$file" | ! sed -e 's@^./@@' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` echo $file '->' $dots$y ': Making link' rm -fr ${LIB}/$file > /dev/null 2>&1 --- 108,112 ---- # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. dots=`echo "$file" | ! sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` echo $file '->' $dots$y ': Making link' rm -fr ${LIB}/$file > /dev/null 2>&1 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/fixinc.svr4 gcc-2.5.5/fixinc.svr4 *** gcc-2.5.4/fixinc.svr4 Fri Oct 29 23:08:15 1993 --- gcc-2.5.5/fixinc.svr4 Fri Nov 19 15:17:42 1993 *************** *** 116,120 **** # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. dots=`echo "$file" | ! sed -e 's@^./@@' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` echo $file '->' $dots$y ': Making link' rm -fr ${LIB}/$file > /dev/null 2>&1 --- 116,120 ---- # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. dots=`echo "$file" | ! sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` echo $file '->' $dots$y ': Making link' rm -fr ${LIB}/$file > /dev/null 2>&1 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/fixincludes gcc-2.5.5/fixincludes *** gcc-2.5.4/fixincludes Thu Nov 11 03:20:03 1993 --- gcc-2.5.5/fixincludes Sun Nov 21 01:52:58 1993 *************** *** 170,174 **** # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. dots=`echo "$file" | ! sed -e 's@^./@@' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` echo $file '->' $dots$y ': Making link' rm -fr ${LIB}/$file > /dev/null 2>&1 --- 170,174 ---- # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. dots=`echo "$file" | ! sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` echo $file '->' $dots$y ': Making link' rm -fr ${LIB}/$file > /dev/null 2>&1 *************** *** 213,217 **** # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. dots=`echo "$file" | ! sed -e 's@^./@@' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` rm -fr ${LIB}/$file > /dev/null 2>&1 ln -s ${dots}root$x ${LIB}/$file > /dev/null 2>&1 --- 213,217 ---- # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}. dots=`echo "$file" | ! sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` rm -fr ${LIB}/$file > /dev/null 2>&1 ln -s ${dots}root$x ${LIB}/$file > /dev/null 2>&1 *************** *** 1079,1086 **** echo Fixing $file, non-const arg sed -e 's@atof( char \*__nptr );@atof( const char *__nptr );@' \ ! -e 's@inline int abs(int d) { return (d>0)?d:-d; }@@' \ ! -e 's@inline double abs(double d) { return fabs(d); }@@' \ ! -e 's@inline int sqr(int x) {return(x*x);} /* For AT&T compatibility */@@' \ ! -e 's@inline double sqr(double x) {return(x*x);}@@' \ ${LIB}/$file > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file --- 1079,1086 ---- echo Fixing $file, non-const arg sed -e 's@atof( char \*__nptr );@atof( const char *__nptr );@' \ ! -e 's@inline int abs(int [a-z][a-z]*) {.*}@@' \ ! -e 's@inline double abs(double [a-z][a-z]*) {.*}@@' \ ! -e 's@inline int sqr(int [a-z][a-z]*) {.*}@@' \ ! -e 's@inline double sqr(double [a-z][a-z]*) {.*}@@' \ ${LIB}/$file > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/fixproto gcc-2.5.5/fixproto *** gcc-2.5.4/fixproto Thu Nov 11 05:59:35 1993 --- gcc-2.5.5/fixproto Sat Nov 27 05:58:13 1993 *************** *** 194,197 **** --- 194,202 ---- for file in $files_to_check ; do xxfile=`echo $file | sed -e 's|/\([^/\.][^/\.]*\)/\.\./|/|'` + # Create the dir where this file will go when fixed. + xxdir=`echo ./$file | sed -e 's|/[^/]*$||'` + if [ \! -d $abs_target_subdir/$xxdir ] ; then + mkdir $abs_target_subdir/$xxdir + fi # Just in case we have edited out a symbolic link if [ -f $src_dir_std/$file -a -f $src_dir_std/$xxfile ] ; then *************** *** 273,280 **** required_list="kill raise" ;; stdio.h) ! # Omitted vfprintf, vprintf, vsprintf because it's hard ! # to specify the right data type, and because not all systems ! # have them. ! required_list="clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell fwrite getc getchar gets perror printf putc putchar puts remove rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ungetc" if grep '[^_a-zA-Z0-9]_flsbuf' <$abs_source_file >/dev/null; then required_list="$required_list _flsbuf _filbuf" --- 278,282 ---- required_list="kill raise" ;; stdio.h) ! required_list="clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell fwrite getc getchar gets perror printf putc putchar puts remove rename rewind scanf setbuf setvbuf sprintf sscanf vprintf vsprintf vfprintf tmpfile tmpnam ungetc" if grep '[^_a-zA-Z0-9]_flsbuf' <$abs_source_file >/dev/null; then required_list="$required_list _flsbuf _filbuf" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/function.c gcc-2.5.5/function.c *** gcc-2.5.4/function.c Sun Nov 14 23:56:01 1993 --- gcc-2.5.5/function.c Thu Nov 25 18:07:16 1993 *************** *** 318,321 **** --- 318,322 ---- extern int rtx_equal_function_value_matters; + extern tree sequence_rtl_expr; extern tree bc_runtime_type_code (); extern rtx bc_build_calldesc (); *************** *** 366,369 **** --- 367,372 ---- /* The size, in units, of the slot. */ int size; + /* The value of `sequence_rtl_expr' when this temporary is allocated. */ + tree rtl_expr; /* Non-zero if this temporary is currently in use. */ char in_use; *************** *** 810,813 **** --- 813,817 ---- p->in_use = 1; + p->rtl_expr = sequence_rtl_expr; p->level = temp_slot_level; p->keep = keep; *************** *** 910,914 **** /* Free all temporaries used so far. This is normally called at the end ! of generating code for a statement. */ void --- 914,922 ---- /* Free all temporaries used so far. This is normally called at the end ! of generating code for a statement. Don't free any temporaries ! currently in use for an RTL_EXPR that hasn't yet been emitted. ! We could eventually do better than this since it can be reused while ! generating the same RTL_EXPR, but this is complex and probably not ! worthwhile. */ void *************** *** 918,922 **** for (p = temp_slots; p; p = p->next) ! if (p->in_use && p->level == temp_slot_level && ! p->keep) p->in_use = 0; --- 926,946 ---- for (p = temp_slots; p; p = p->next) ! if (p->in_use && p->level == temp_slot_level && ! p->keep ! && p->rtl_expr == 0) ! p->in_use = 0; ! ! combine_temp_slots (); ! } ! ! /* Free all temporary slots used in T, an RTL_EXPR node. */ ! ! void ! free_temps_for_rtl_expr (t) ! tree t; ! { ! struct temp_slot *p; ! ! for (p = temp_slots; p; p = p->next) ! if (p->rtl_expr == t) p->in_use = 0; *************** *** 941,945 **** for (p = temp_slots; p; p = p->next) ! if (p->in_use && p->level == temp_slot_level) p->in_use = 0; --- 965,969 ---- for (p = temp_slots; p; p = p->next) ! if (p->in_use && p->level == temp_slot_level && p->rtl_expr == 0) p->in_use = 0; *************** *** 4886,4897 **** /* Generate RTL for the end of the current function. ! FILENAME and LINE are the current position in the source file. */ ! /* It is up to language-specific callers to do cleanups for parameters. */ void ! expand_function_end (filename, line) char *filename; int line; { register int i; --- 4910,4923 ---- /* Generate RTL for the end of the current function. ! FILENAME and LINE are the current position in the source file. ! It is up to language-specific callers to do cleanups for parameters-- ! or else, supply 1 for END_BINDINGS and we will call expand_end_bindings. */ void ! expand_function_end (filename, line, end_bindings) char *filename; int line; + int end_bindings; { register int i; *************** *** 5022,5025 **** --- 5048,5055 ---- if (return_label) emit_label (return_label); + + /* C++ uses this. */ + if (end_bindings) + expand_end_bindings (0, 0, 0); /* If we had calls to alloca, and this machine needs diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/function.h gcc-2.5.5/function.h *** gcc-2.5.4/function.h Sun Oct 10 18:47:21 1993 --- gcc-2.5.5/function.h Thu Nov 25 18:06:51 1993 *************** *** 1,4 **** /* Structure for saving state for a nested function. ! Copyright (C) 1989, 1992 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Structure for saving state for a nested function. ! Copyright (C) 1989, 1992, 1993 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 43,46 **** --- 43,47 ---- /* First and last insns in the chain of the saved sequence. */ rtx first, last; + tree sequence_rtl_expr; struct sequence_stack *next; }; *************** *** 127,130 **** --- 128,132 ---- rtx first_insn; rtx last_insn; + tree sequence_rtl_expr; struct sequence_stack *sequence_stack; int cur_insn_uid; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/g++.c gcc-2.5.5/g++.c *** gcc-2.5.4/g++.c Wed Oct 20 19:12:37 1993 --- gcc-2.5.5/g++.c Wed Nov 24 00:22:09 1993 *************** *** 306,312 **** char **argv; { ! register int i, j; register char *p; int (*fn)(); /* This will be NULL if we encounter a situation where we should not --- 306,313 ---- char **argv; { ! register int i, j = 0; register char *p; int (*fn)(); + int verbose = 0; /* This will be NULL if we encounter a situation where we should not *************** *** 391,394 **** --- 392,396 ---- else if (strcmp (argv[i], "-v") == 0) { + verbose = 1; if (argc == 2) { *************** *** 480,483 **** --- 482,494 ---- arglist[0] = gcc; + if (verbose) + { + if (j == 0) + j = argc; + + for (i = 0; i < j; i++) + fprintf (stderr, " %s", arglist[i]); + fprintf (stderr, "\n"); + } #ifndef OS2 #ifdef __MSDOS__ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/g++int.texi gcc-2.5.5/g++int.texi *** gcc-2.5.4/g++int.texi Fri Oct 8 15:02:54 1993 --- gcc-2.5.5/g++int.texi Wed Nov 24 00:22:17 1993 *************** *** 102,110 **** the things that have @code{BINFO_OFFSET}s of zero are shared and will have themselves as their own @code{MAIN_VARIANT}s. The non-shared right ! ones, are copies of the left-most one, hence if it is it's own @code{MAIN_VARIENT}, we know it IS a left-most one, if it is not, it is a non-left-most one. ! @code{get_base_distance}'s path and distance matters in it's use in: @itemize @bullet --- 102,110 ---- the things that have @code{BINFO_OFFSET}s of zero are shared and will have themselves as their own @code{MAIN_VARIANT}s. The non-shared right ! ones, are copies of the left-most one, hence if it is its own @code{MAIN_VARIENT}, we know it IS a left-most one, if it is not, it is a non-left-most one. ! @code{get_base_distance}'s path and distance matters in its use in: @itemize @bullet diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/gcc.c gcc-2.5.5/gcc.c *** gcc-2.5.4/gcc.c Tue Nov 2 18:02:35 1993 --- gcc-2.5.5/gcc.c Fri Nov 26 15:57:21 1993 *************** *** 470,474 **** %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ ! -undef -D__GNUC__=%v1 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ %{!undef:%{!ansi:%p} %P} %{trigraphs}\ %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ --- 470,475 ---- %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ ! -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ ! %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ %{!undef:%{!ansi:%p} %P} %{trigraphs}\ %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/gcc.texi gcc-2.5.5/gcc.texi *** gcc-2.5.4/gcc.texi Mon Nov 15 06:06:02 1993 --- gcc-2.5.5/gcc.texi Sat Nov 27 14:13:22 1993 *************** *** 1030,1033 **** --- 1030,1040 ---- @item + The @code{fixproto} script will sometimes add prototypes for the + @code{sigsetjmp} and @code{siglongjmp} functions that reference the + @code{jmp_buf} type before that type is defined. To work around this, + edit the offending file and place the typedef in front of the + prototypes. + + @item Loop unrolling doesn't work properly for certain C++ programs. This is because of difficulty in updating the debugging information within the *************** *** 1450,1453 **** --- 1457,1463 ---- @item Objective C does not work on the RS/6000 or the Alpha. + + @item + C++ does not work on the Alpha. @item diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/install.texi gcc-2.5.5/install.texi *** gcc-2.5.4/install.texi Sun Nov 14 18:09:47 1993 --- gcc-2.5.5/install.texi Wed Nov 24 15:09:49 1993 *************** *** 264,267 **** --- 264,270 ---- systems. (VMS on the Alpha is not currently supported by GNU CC.) + Objective C and C++ do not yet work on the Alpha. We hope to support + C++ in version 2.6. + GNU CC writes a @samp{.verstamp} directive to the assembler output file unless it is built as a cross-compiler. It gets the version to use from *************** *** 279,287 **** @code{make compare} may fail on some versions of OSF/1 unless you add ! @samp{-save-temps} to @code{CFLAGS}. This forces a fixed name to ! be used for the assembler input file instead of a random name in ! @file{/tmp}. The name of the assembler input file is stored in the ! object file and will cause miscompared if it differs between the ! @code{stage1} and @code{stage2} compilations. GNU CC now supports both the native (ECOFF) debugging format used by DBX --- 282,291 ---- @code{make compare} may fail on some versions of OSF/1 unless you add ! @samp{-save-temps} to @code{CFLAGS}. The same problem occurs on Irix ! version 5.1.1. On these systems, the name of the assembler input file ! is stored in the object file, and that makes comparison fail if it ! differs between the @code{stage1} and @code{stage2} compilations. The ! option @samp{-save-temps} forces a fixed name to be used for the ! assembler input file, instead of a randomly chosen name in @file{/tmp}. GNU CC now supports both the native (ECOFF) debugging format used by DBX *************** *** 519,522 **** --- 523,528 ---- been extensively tested due to lack of appropriate systems. Only AIX is supported on the PowerPC. + + Objective C does not work on this architecture. XLC version 1.3.0.0 will miscompile @file{jump.c}. XLC version 1.3.0.1 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/integrate.c gcc-2.5.5/integrate.c *** gcc-2.5.4/integrate.c Wed Nov 10 19:30:18 1993 --- gcc-2.5.5/integrate.c Thu Nov 18 05:32:12 1993 *************** *** 2981,2985 **** return_label = 0; ! expand_function_end (DECL_SOURCE_FILE (fndecl), DECL_SOURCE_LINE (fndecl)); /* Find last insn and rebuild the constant pool. */ --- 2981,2985 ---- return_label = 0; ! expand_function_end (DECL_SOURCE_FILE (fndecl), DECL_SOURCE_LINE (fndecl), 0); /* Find last insn and rebuild the constant pool. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/libgcc2.c gcc-2.5.5/libgcc2.c *** gcc-2.5.4/libgcc2.c Wed Nov 3 13:59:49 1993 --- gcc-2.5.5/libgcc2.c Tue Nov 23 17:00:13 1993 *************** *** 1,5 **** /* More subroutines needed by GCC output code on some machines. */ /* Compile this one with gcc. */ ! /* Copyright (C) 1989, 1992 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,5 ---- /* More subroutines needed by GCC output code on some machines. */ /* Compile this one with gcc. */ ! /* Copyright (C) 1989, 1992, 1993 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 1515,1519 **** if (line_p) ! fprintf (file, " line= %*d", line_len, ptr->line_nums[i]); if (file_p) --- 1515,1519 ---- if (line_p) ! fprintf (file, " line= %*ld", line_len, ptr->line_nums[i]); if (file_p) *************** *** 1843,1846 **** --- 1843,1878 ---- } #endif /* __convex__ */ + + #ifdef __DOLPHIN__ + + /* Modified from the convex -code above. */ + + #include + #include + #include + + void + __enable_execute_stack () + { + int save_errno; + static unsigned long lowest = USRSTACK; + unsigned long current = (unsigned long) &save_errno & -NBPC; + + /* Ignore errno being set. memctl sets errno to EINVAL whenever the + address is seen as 'negative'. That is the case with the stack. */ + + save_errno=errno; + if (lowest > current) + { + unsigned len=lowest-current; + memctl(current,len,MCT_TEXT); + lowest = current; + } + else + memctl(current,NBPC,MCT_TEXT); + errno=save_errno; + } + + #endif /* __DOLPHIN__ */ #ifdef __pyr__ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/objc/objects.c gcc-2.5.5/objc/objects.c *** gcc-2.5.4/objc/objects.c Tue Nov 2 02:53:20 1993 --- gcc-2.5.5/objc/objects.c Thu Nov 18 03:07:51 1993 *************** *** 25,30 **** covered by the GNU General Public License. */ - #include "runtime.h" /* the kitchen sink */ #include "../tconfig.h" /* include defs of bzero for target */ id __objc_object_alloc(Class*); --- 25,30 ---- covered by the GNU General Public License. */ #include "../tconfig.h" /* include defs of bzero for target */ + #include "runtime.h" /* the kitchen sink */ id __objc_object_alloc(Class*); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/optabs.c gcc-2.5.5/optabs.c *** gcc-2.5.4/optabs.c Tue Nov 2 07:18:54 1993 --- gcc-2.5.5/optabs.c Fri Nov 19 18:34:40 1993 *************** *** 2031,2040 **** real = gen_realpart (submode, op0); imag = gen_imagpart (submode, op0); /* Square both parts. */ ! real = expand_mult (mode, real, real, NULL_RTX, 0); ! imag = expand_mult (mode, imag, imag, NULL_RTX, 0); /* Sum the parts. */ total = expand_binop (submode, add_optab, real, imag, 0, 0, OPTAB_LIB_WIDEN); /* Get sqrt in TARGET. Set TARGET to where the result is. */ target = expand_unop (submode, sqrt_optab, total, target, 0); --- 2031,2043 ---- real = gen_realpart (submode, op0); imag = gen_imagpart (submode, op0); + /* Square both parts. */ ! real = expand_mult (submode, real, real, NULL_RTX, 0); ! imag = expand_mult (submode, imag, imag, NULL_RTX, 0); ! /* Sum the parts. */ total = expand_binop (submode, add_optab, real, imag, 0, 0, OPTAB_LIB_WIDEN); + /* Get sqrt in TARGET. Set TARGET to where the result is. */ target = expand_unop (submode, sqrt_optab, total, target, 0); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/protoize.c gcc-2.5.5/protoize.c *** gcc-2.5.4/protoize.c Fri Nov 5 16:55:14 1993 --- gcc-2.5.5/protoize.c Wed Nov 24 14:31:26 1993 *************** *** 149,154 **** #endif /* 0 */ extern void exit (); - extern pointer_type malloc (); - extern pointer_type realloc (); extern void free (); extern int read (); --- 149,152 ---- *************** *** 614,618 **** pointer_type rv; ! rv = malloc (byte_count); if (rv == NULL) { --- 612,616 ---- pointer_type rv; ! rv = (pointer_type) malloc (byte_count); if (rv == NULL) { *************** *** 634,638 **** pointer_type rv; ! rv = realloc (old_space, byte_count); if (rv == NULL) { --- 632,636 ---- pointer_type rv; ! rv = (pointer_type) realloc (old_space, byte_count); if (rv == NULL) { *************** *** 1713,1721 **** def_dec_p->ansi_decl = dupnstr (ansi_start, (size_t) ((semicolon_p+1) - ansi_start)); ! } ! /* Backup and point at the final right paren of the final argument list. */ ! p--; /* Now isolate a whole set of formal argument lists, one-by-one. Normally, --- 1711,1730 ---- def_dec_p->ansi_decl = dupnstr (ansi_start, (size_t) ((semicolon_p+1) - ansi_start)); ! ! /* Backup and point at the final right paren of the final argument list. */ ! ! p--; ! #ifndef UNPROTOIZE ! def_dec_p->f_list_chain = NULL; ! #endif /* !defined (UNPROTOIZE) */ ! while (p != ansi_start && (p[-1] == ' ' || p[-1] == '\t')) p--; ! if (*p != ')') ! { ! free_def_dec (def_dec_p); ! return; ! } ! } /* Now isolate a whole set of formal argument lists, one-by-one. Normally, *************** *** 1723,1730 **** def_dec_p->f_list_count = 0; - - #ifndef UNPROTOIZE - def_dec_p->f_list_chain = NULL; - #endif /* !defined (UNPROTOIZE) */ for (;;) --- 1732,1735 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/reorg.c gcc-2.5.5/reorg.c *** gcc-2.5.4/reorg.c Tue Oct 5 16:27:51 1993 --- gcc-2.5.5/reorg.c Tue Nov 23 18:04:31 1993 *************** *** 1240,1244 **** } ! /* Return 1 if DEST is a destination that will be branched to rarely (the return point of a function); return 2 if DEST will be branched to very rarely (a call to a function that doesn't return). Otherwise, --- 1240,1244 ---- } ! /* Return 1 if INSN is a destination that will be branched to rarely (the return point of a function); return 2 if DEST will be branched to very rarely (a call to a function that doesn't return). Otherwise, *************** *** 1250,1255 **** { int jump_count = 0; ! for (; insn; insn = NEXT_INSN (insn)) { if (GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE) --- 1250,1256 ---- { int jump_count = 0; + rtx next; ! for (; insn; insn = next) { if (GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE) *************** *** 1256,1259 **** --- 1257,1262 ---- insn = XVECEXP (PATTERN (insn), 0, 0); + next = NEXT_INSN (insn); + switch (GET_CODE (insn)) { *************** *** 1271,1275 **** else if (simplejump_p (insn) && jump_count++ < 10) ! insn = JUMP_LABEL (insn); else return 0; --- 1274,1278 ---- else if (simplejump_p (insn) && jump_count++ < 10) ! next = JUMP_LABEL (insn); else return 0; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/stmt.c gcc-2.5.5/stmt.c *** gcc-2.5.4/stmt.c Sat Nov 13 22:42:32 1993 --- gcc-2.5.5/stmt.c Thu Nov 25 18:07:56 1993 *************** *** 1710,1722 **** return 0; /* Assignment to a cast usually results in a cast of a modify. ! Don't complain about that. */ ! if (TREE_CODE (TREE_OPERAND (exp, 0)) == MODIFY_EXPR) ! return 0; ! /* Sometimes it results in a cast of a cast of a modify. ! Don't complain about that. */ ! if ((TREE_CODE (TREE_OPERAND (exp, 0)) == CONVERT_EXPR ! || TREE_CODE (TREE_OPERAND (exp, 0)) == NOP_EXPR) ! && TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) == MODIFY_EXPR) ! return 0; default: --- 1710,1726 ---- return 0; /* Assignment to a cast usually results in a cast of a modify. ! Don't complain about that. There can be an arbitrary number of ! casts before the modify, so we must loop until we find the first ! non-cast expression and then test to see if that is a modify. */ ! { ! tree tem = TREE_OPERAND (exp, 0); ! ! while (TREE_CODE (tem) == CONVERT_EXPR || TREE_CODE (tem) == NOP_EXPR) ! tem = TREE_OPERAND (tem, 0); ! ! if (TREE_CODE (tem) == MODIFY_EXPR) ! return 0; ! } ! /* ... fall through ... */ default: *************** *** 1759,1763 **** t = make_node (RTL_EXPR); resume_momentary (momentary); ! start_sequence (); NO_DEFER_POP; expr_stmts_for_value++; --- 1763,1767 ---- t = make_node (RTL_EXPR); resume_momentary (momentary); ! start_sequence_for_rtl_expr (t); NO_DEFER_POP; expr_stmts_for_value++; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/sys-protos.h gcc-2.5.5/sys-protos.h *** gcc-2.5.4/sys-protos.h Sun Nov 14 04:28:52 1993 --- gcc-2.5.5/sys-protos.h Sun Nov 21 04:22:45 1993 *************** *** 118,122 **** extern char * atos(char *, struct netbuf *, int); extern void auth_destroy(AUTH *); ! extern AUTH * authdes_create(char *, unsigned, struct sockaddr *, des_block *); extern void authdes_getcred(struct authdes_cred *, short *, short *, short *, int *); extern AUTH * authdes_seccreate(/* ??? */); --- 118,122 ---- extern char * atos(char *, struct netbuf *, int); extern void auth_destroy(AUTH *); ! extern AUTH * authdes_create(/* ??? */); extern void authdes_getcred(struct authdes_cred *, short *, short *, short *, int *); extern AUTH * authdes_seccreate(/* ??? */); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x objc-parse.y -x cp-parse.c -x cp-parse.h -x cexp.c -x bi-parser.c -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x cpp.??s -x cpp.?? -x cpp.aux -x cpp.info* -x gcc.info* gcc-2.5.4/version.c gcc-2.5.5/version.c *** gcc-2.5.4/version.c Mon Nov 15 05:41:28 1993 --- gcc-2.5.5/version.c Sat Nov 27 14:36:11 1993 *************** *** 1 **** ! char *version_string = "2.5.4"; --- 1 ---- ! char *version_string = "2.5.5";