Changes for GCC version 2.7.1 from version 2.7.0. 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.7.0 and execute the following commands: rm config/alpha/config-nt.bat rm config/alpha/winnt.h rm config/alpha/x-winnt rm config/i386/config-nt.bat rm config/i386/winnt.h rm config/i386/x-winnt rm config/winnt/winnt.h Then use the command patch -p1 feeding it the following diffs as input. Then rename the directory to gcc-2.7.1. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.6.0/ChangeLog gcc-2.6.1/ChangeLog diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/COPYING gcc-2.7.1/COPYING *** gcc-2.7.0/COPYING Thu Feb 27 07:47:10 1992 --- gcc-2.7.1/COPYING Thu Oct 26 07:32:35 1995 *************** *** 3,7 **** Copyright (C) 1989, 1991 Free Software Foundation, Inc. ! 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. --- 3,7 ---- Copyright (C) 1989, 1991 Free Software Foundation, Inc. ! 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. *************** *** 306,310 **** You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software ! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. --- 306,310 ---- You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Also add information on how to contact you by electronic and paper mail. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/COPYING.LIB gcc-2.7.1/COPYING.LIB *** gcc-2.7.0/COPYING.LIB Tue May 26 23:10:58 1992 --- gcc-2.7.1/COPYING.LIB Thu Oct 26 07:33:31 1995 *************** *** 3,7 **** Copyright (C) 1991 Free Software Foundation, Inc. ! 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. --- 3,7 ---- Copyright (C) 1991 Free Software Foundation, Inc. ! 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. *************** *** 465,469 **** You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free ! Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. --- 465,470 ---- You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free ! Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ! MA 02111-1307, USA Also add information on how to contact you by electronic and paper mail. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/ChangeLog gcc-2.7.1/ChangeLog *** gcc-2.7.0/ChangeLog Fri Jun 16 06:56:43 1995 --- gcc-2.7.1/ChangeLog Sun Nov 12 18:10:01 1995 *************** *** 1,3 **** --- 1,1954 ---- + Sun Nov 12 18:09:35 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * Version 2.7.1 released. + + * function.c (put_reg_into_stack): New arg volatile_p. + (put_var_into_stack): Call with new arg. + + Sat Nov 11 08:25:34 1995 Jim Wilson + + * reload.c (output.h): Include it. + * Makefile.in (reload.o): Add dependence on output.h. + + Thu Nov 9 11:24:20 1995 Jim Wilson + + * mips.h (HARD_REGNO_NREGS): If FP_REG_P, always use UNITS_PER_FPREG + to calculate number of words needed. + + Thu Nov 9 11:04:50 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de) + + * 1750a.md (cmphf): Addd Base Reg with Offset address mode (LB,STB,..) + (movqi,movhi,movhf,addqi3,addhf3,subqi3,subhf3,mulqihi3): Likewise. + (mulhf3,divhf3,andqi3,iorqi3): Likewise. + (define_peephole): Remove the Base mode peepholes. Replace the + special addqi define_insn for "LIM Ra,sym,Rb" by a define_peephole. + (ashlqi3): Took out futile 0th alternative. + (lshrqi3, lshrhi3, ashrqi3, ahsrhi3): Correct case of non-constant + shift count. + + * 1750a.h (REG_ALLOC_ORDER): Define. + (REGNO_OK_FOR_BASE_P): Include stack pointer in test against + reg_renumber[REGNO]. + (ASM_OUTPUT_DESTRUCTOR): Remove bogus assembler comment. + + Thu Nov 9 11:01:33 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * expr.c (expand_expr, case ARRAY_REF): Properly convert types + of index, size, and multiplication. + + Wed Nov 8 09:00:22 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * arm.md (mov*cc_{,soft_}insn): Use match_operator to test the + comparison and check that the condition code register is used. + + Wed Nov 8 08:49:35 1995 Michael Meissner + + * rs6000/sysv4.h (ASM_OUTPUT_{CONSTRUCTOR,DESTRUCTOR}): Undef before + including svr4.h. + + Tue Nov 7 10:58:12 1995 Torbjorn Granlund + + * m68k.md (subxf3): Properly name pattern. + + Tue Nov 7 10:53:09 1995 Michael Meissner + + * libgcc2.c (__{C,D}TOR_LIST): For AIX, initialize these arrays to + 0,0, just like NeXT to avoid a warning message from the AIX 4.1 + linker. + + Tue Nov 7 09:58:34 1995 John F. Carr + + * cppexp.c (cpp_lex): Correctly parse character constants. + + Tue Nov 7 09:52:15 1995 Jason Merrill + + * rs6000.h (ASM_OUTPUT_{DES,CONS}TRUCTOR): Define. + + Mon Nov 6 10:27:15 1995 Doug Evans + + * combine.c (force_to_mode): Fix typo. + + Sun Nov 5 18:37:02 1995 Torbjorn Granlund + + * m68k.md (cmpxf): Don't call force_const_mem, it looses for PIC; + get predicates right instead. Get rid of separate DEFINE_EXPAND. + (addxf3, subxf3, mulxf3, divxf3): Likewise. + (All XFmode patterns): Delete `F' and `G' constraints. + (absxf2, negxf2): Delete spurious condition on TARGET_FPA. + + Sun Nov 5 11:05:44 1995 Philippe De Muyter (phdm@info.ucl.ac.be) + + * fixincludes (malloc.h): Fix return type of {m,re}alloc. + + Sun Nov 5 11:02:26 1995 J"orn Rennecke (amylaar@meolyon.hanse.de) + + * cse.c (invalidate): For a pseudo register, do a loop to + invalidate all table entries, irrespective of mode. + + Sun Nov 5 10:57:43 1995 Richard Kenner + + * combine.c (force_to_mode): Put in last change properly. + + Sun Nov 5 10:53:49 1995 Jeffrey A Law (law@cygnus.com) + + * pa.h (CONDITIONAL_REGISTER_USAGE): Make sure FP regs + get disabled regardless of PA1.0 vs PA1.1 code generation + when TARGET_SOFT_FLOAT or TARGET_DISABLE_FPREGS is on. + + Sun Nov 5 10:49:43 1995 Doug Evans + + * i960.c (emit_move_sequence): Add a scratch register to + multi-reg stores. + (i960_output_move_{double,quad}): New functions. + (i960_print_operand): Handle new operand types E, F. + * i960.md (movdi matchers): Rewrite. + (store_unaligned_di_reg): New pattern. + (movti matchers): Rewrite. + (store_unaligned_ti_reg): New pattern. + + Sun Nov 5 10:45:24 1995 Ian Lance Taylor (ian@cygnus.com) + + * mips.h (MULTILIB_DEFAULTS): Define. + * mips/elf64.h, mips/iris6.h (MULTILIB_DEFAULTS): Define. + + Sun Nov 5 10:41:48 1995 Jim Wilson + + * reload.c (push_reload): Delete abort for RELOAD_OTHER case added + in last change. + * reload1.c (emit_reload_insns): For RELOAD_OTHER output reloads, + output the reload insns in descending order of reloads. + + * sh.md (mulsidi3-1, mulsidi3, umulsidi3-1, umulsidi3): Enable. + (smulsi3_highpart-1, smulsi3_highpart): New patterns. + (umulsi3_highpart-1, umulsi3_highpart): Likewise. + (movdi-1): Add r/x constraint. + * t-sh (MULTILIB_OPTIONS): Add m2. + (MULTILIB_DIRNAMES): Add m2. + (MULTILIB_MATCHES): Define. + + * sparc.h (RTX_COSTS, case MULT): Check for TARGET_SPARCLITE. + + * abi64.h, elf64.h (CPP_SPEC): Add -EB and -EL support. + + Sat Nov 4 10:36:26 1995 Jim Wilson + + * sh.md (casesi_worker): Change constraint from = to +. + + * svr4.h (ASM_IDENTIFY_GCC_AFTER_SOURCE): Delete. + (ASM_IDENTIFY_GCC): Output stab here. + + Sat Nov 4 10:32:37 1995 John Carr + + * cpplib.c (finclude): Set current input pointer when input + is not a regular file. + + * cppmain.c: Define progname, required by cpplib. + + Sun Oct 29 07:48:36 1995 Michael Meissner + + * xcoffout.h (DBX_FINISH_SYMBOL): Deal with names created via + the __asm__ construct that start with a leading '*'. + * xcoffout.c (xcoff_declare_function): Likewise. + + Sun Oct 29 07:45:41 1995 Jim Wilson + + * stupid.c (stupid_mark_refs): Handle SUBREG of pseudo-reg in a + SET_DEST same as we handle a pseudo-reg in a SET_DEST. + + Sun Oct 29 07:43:15 1995 Pat Rankin + + * libgcc2.c (L_eh: __unwind_function): Implement for VAX. + * vax.h (RETURN_ADDRESS_OFFSET, RETURN_ADDR_RTX): Define. + + Sun Oct 29 12:39:08 1995 Richard Kenner a + + * i386/sol2.h (CPP_PREDEFINES): Add -D__SVR4. + + Sun Oct 29 07:14:36 1995 J"orn Rennecke (amylaar@meolyon.hanse.de) + + * reload.c (find_equiv_reg): Check for nonsaving setjmp. + + Fri Oct 27 15:15:56 1995 Jim Wilson + + * Makefile.in (out_object_file): Depend on TREE_H. + + Fri Oct 27 06:42:36 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * alpha.c (call_operand): Only allow reg 27 on NT too. + * alpha.md (call_value_nt, call_nt): Force non-SYMBOL_REF + into reg 27, just like for OSF. + + * rs6000.c (struct asm_option): Changed from struct option. + (expand_block_move_mem): Remove erroneously-added line. + + * expr.c (clear_storage): SIZE is now rtx, not int. + (store_constructor): Call clear_storage with rtx. + (get_inner_reference): Convert index to precision of + sizetype, not POINTER_SIZE. + (expand_expr, case ARRAY_REF): Likewise. + * expr.h (clear_storage): Second arg is rtx, not int. + + Fri Oct 27 05:45:58 1995 J"orn Rennecke (amylaar@meolyon.hanse.de) + + * combine.c (force_to_mode, case ASHIFTRT): Properly handle + mask wider than HOST_WIDE_INT. + + * c-decl.c (pushdecl): Don't test TREE_PUBLIC when deciding whether + to register a duplicate decl in the current block. + + Thu Oct 26 21:55:39 1995 Jason Merrill + + * calls.c (expand_call): Don't trust the callee to copy a + TREE_ADDRESSABLE type. + * function.c (assign_parms): Likewise. + + Thu Oct 26 19:25:05 1995 Mike Stump + + * libgcc2.c (__unwind_function): Provide a default definition for + implementations that don't yet have a function unwinder. + + Thu Oct 26 18:08:19 1995 Paul Eggert + + * cccp.c (handle_directive): Don't treat newline as white + space when coalescing white space around a backslash-newline. + + Thu Oct 26 17:57:34 1995 Ian Lance Taylor + + * mips-tdump.c (enum st): Define st_Struct, st_Union, and st_Enum. + (st_to_string): Handle them. + (type_to_string): Add fdp argument; pass it to emit_aggregate. + (print_symbol): Add fdp argument; pass it to type_to_string. + Handle st_Struct, st_Union, and st_Enum. + (emit_aggregate): Add fdp argument. Handle opaque types. Map + through RFD entries. + (print_file_desc): Pass FDR to print_symbol. + (main): Pass null FDR to type_to_string. + + Thu Oct 26 08:07:10 1995 Michael Meissner + + * configure (powerpc-ibm-aix[456789]*): Use rs6000/t-newas, + not rs6000/t-rs6000. + (rs6000-ibm-aix3.2.[456789]*): Likewise. + (rs6000-ibm-aix[456789]*): Likewise. + + * rs6000/t-newas: Copy from t-rs6000. + * t-rs6000: Don't build -mcpu=common multilib variants of libgcc.a. + + * rs6000.md (load_multiple insn): If address register is among regs, + don't load it with a lwsi instruction, which is undefined on PowerPC. + + Thu Oct 26 08:01:32 1995 Jim Wilson + + * dwarfout.c (output_compile_unit_die): Handle language_string + of "GNU F77". + + * reload.c (find_reloads_address): When check for out of range constant + plus register, accept any hard register instead of just fp, ap, sp. + + * combine.c (distribute_notes): For Oct 19 change, add additional + check to verify that place has a valid INSN_CUID. + + * sparc/t-vxsparc (LIBGCC1_TEST): Define. + + * sh.md (negdi2): Use TARGET_LITTLE_ENDIAN. + + * combine.c (force_to_mode, case ASHIFTRT): Verify mode bitsize is + within HOST_BITS_PER_WIDE_INT before shifting by it. + + * final.c (final_scan_insn): When recur for instruction in delay slot, + add loop around recursive call in case the instruction gets split. + + Thu Oct 26 07:28:45 1995 J"orn Rennecke (amylaar@meolyon.hanse.de) + + * genrecog.c (write_tree_1): Avoid emitting '-2147483648'. + + * jump.c (duplicate_loop_exit_test): Return 0 if found + a NOTE_INSN_LOOP_CONT. + + Tue Oct 24 15:30:14 1995 Jeffrey A Law + + * calls.c (expand_call): Make sure valreg is at least + a full word. + + Sun Oct 22 19:35:41 1995 Jim Wilson + + * sh.h (INIT_SECTION_ASM_OP): Delete. + (HAVE_ATEXIT): Define. + + Sun Oct 22 07:46:04 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * libgcc2.c (__fixuns[xds]fsi): #undef MIN and MAX before #include + of limits.h. + + * pa.c (pa_adjust_cost): Use pa_cpu, not pa_cpu_attr. + + Sun Oct 22 07:38:58 1995 J"orn Rennecke (amylaar@meolyon.hanse.de) + + * alpha.h (CONST_OK_FOR_LETTER_P): Use 'U' for unsigned constants. + * alpha.c (alpha_emit_set_const): Likewise. + * mips.c (gen_int_relational): Likewise. + + Sun Oct 22 07:14:35 1995 Douglas Rupp (drupp@cs.washington.edu) + + * i386.c (i386_return_pops_args): Don't need a FUNDECL to + check for type attributes in FUNTYPE. + + Sat Oct 21 18:17:42 1995 Jim Wilson + + * sh.md (define_delay): Don't accept any instruction for an annulled + slot, only accept those for which in_delay_slot is yes. + * sh.c (find_barrier): When hi_const returns true, increment count_si + by two if found_si is true. + Always use get_attr_length to compute length of instructions. + If count_hi or count_si out of range at end, need two PREV_INSN calls + not one. + When create new label, set LABEL_NUSES to 1. + (reg_unused_after): Ifdef out code for handling labels. + (prepare_scc_operands): New local variable mode. Set it from + sh_compare_op0 or sh_compare_op1. Use it instead of SImode in + force_reg calls. + + * optabs.c (expand_float): Emit missing barrier after unconditional + jump. + + Sat Oct 21 14:16:46 1995 Torbjorn Granlund + + * alpha.md (cmpdf): Make conditional on TARGET_FP. + + Fri Oct 20 19:11:12 1995 J"orn Rennecke (amylaar@meolyon.hanse.de) + + * combine.c (distribute_notes): Delete instructions without + side effect that set a subreg of an unused register. + + * m68k.h (PREFERRED_RELOAD_CLASS): Check for !G constants + for DATA_OR_FP_REGS also. + + Fri Oct 20 18:57:10 1995 Ian Lance Taylor + + * genmultilib: Output negations of unused alternatives, even if + one of the alternatives is selected. + + Fri Oct 20 18:48:50 1995 Jeff Law (law@hurl.cygnus.com) + + * integrate.c (output_inline_function): Turn on flag_no_inline + to avoid function integration once we begin writing deferred + output functions. + + Fri Oct 20 18:46:33 1995 Michael Meissner + + * rs6000.c (float_conv_temp): Delete global variable. + (stack_temps): New static array to hold stack temps. + (offsettable_mem_operand): Delete function. + (offsettable_addr_operand, rs6000_stack_temp): New functions. + (output_epilog): Zero stack_temps. + + * rs6000.h (offsettable_addr_operand): Declare instead of + offsettable_mem_operand. + (PREDICATE_CODES): Use offsettable_addr_operand. + (float_conv_temp): Delete variable. + + * rs6000.md (move_to_float insns): Change move_to_float so + that it doesn't have a clobber of the memory address, and instead + passes the stack temp's memory address as one of the unspec args. + (fix_truncdfsi2): Use rs6000_stack_temp to allocate the temp. + (multiply, shift insns): Fix all cases of multiply and shift insns so + that the right mnemonics are used for -mcpu=common with both + -m{old,new}-mnemonics. + + Fri Oct 20 17:58:19 1995 Jim Wilson + + * expr.c (safe_from_p, case RTL_EXPR): Return 0 if RTL_EXPR_SEQUENCE + exists. Delete code to return 0 if exp_rtl is zero. + + * function.c (init_function_start): Don't call init_insn_lengths here. + * toplev.c (rest_of_compilation): Call it here. + + Thu Oct 19 19:19:06 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * c-common.c (check_format_info): Make test for null pointer + more general. + + Thu Oct 19 18:56:16 1995 Satoshi Adachi (adachi@wisdom.aa.ap.titech.ac.jp) + + * fixincludes (stdlib.h): Be more general in edit to change + declaration of {c,m,re}alloc. + + Thu Oct 19 18:48:53 1995 Torbjorn Granlund + + * libgcc2.c (__udiv_w_sdiv): If we don't have sdiv_qrnnd, define + dummy variant of __udiv_w_sdiv. + + Thu Oct 19 18:45:21 1995 Jim Wilson + + * alpha.h (ASM_SPEC): If GNU as is the default, then pass -g to + the assembler if -malpha-as. If GNU as is not the default, then pass + -g to the assembler is not -mgas. + + * combine.c (distribute_notes): When search for new place to put + REG_DEAD note, call distribute_links if this new place is between + i2 and i3, and i2 uses the register. + + Thu Oct 19 18:41:36 1995 Michael Meissner + + * rs6000.md (float{,uns}sidf2): Rewrite to break the conversion + process into several general insns. + (move_to_float): New insns to move 2 integer regs into a float register + through memory, taking endianess into account. Make sure that the + floating temporary is a valid address. Use one temporary for all + floats converted. + (fix_truncdfsi2): Take endianess into account. + + * rs6000.c ({low_32_bit,offsettable_mem}_operand): The function + low_32_bit_operand is now unused, delete it. New function + offsettable_mem_operand to determine if a memory address is + offsettable. + * rs6000.h ({low_32_bit,offsettable_mem}_operand): Ditto. + (PREDICATE_CODES): Ditto. + + * rs6000.{c,h} (float_conv_temp): New global. + * rs6000.c (output_epilog): Zero out float_conv_temp. + + * Makefile.in (libgcc{1,2}.a): Allow LIB{1,2}FUNCS_EXTRA files to + end in .S as well as .c and .asm. + + Wed Oct 18 17:56:45 1995 Jose Alonso (sidinf@fpsp.fapesp.br) + + * c-typeck.c (parser_build_binary_op): Warn about x^y==z, etc. + + Mon Oct 9 12:38:06 1995 Michael Meissner + + * protoize.c (reverse_def_dec_list): Silence compiler warnings. + + Mon Oct 9 12:35:54 1995 Andrew Cagney + + * ginclude/va-ppc.h (va_arg): Deal with long longs that would be + passed in the 7th register, and are passed in the stack instead. + + Fri Oct 6 13:47:10 1995 Jim Wilson + + * alpha.h (ASM_SPEC): Add -g. + + Fri Oct 6 13:42:50 1995 Richard Kenner + + * alpha.h (alpha_{arg,auto}_offset): Make extern. + + Fri Oct 6 13:24:43 1995 Michael Meissner + + * rs6000.h (RETURN_ADDRESS_OFFSET): Correct previous change. + + Fri Oct 6 13:14:43 1995 Doug Evans + + * rtlanal.c (reg_set_last): Fix call to reg_set_between_p. + + Tue Oct 3 12:31:38 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * stor-layout.c (layout_type, case ARRAY_TYPE): Strip MAX_EXPR + from upper bound when computing length if it just protects against + negative length. + + * expr.c (emit_move_insn_1): When doing multi-word move, show + output is clobbered. + + Tue Oct 3 12:26:07 1995 Jim Wilson + + * cse.c (set_nonvarying_address_components, case AND): Add *pend to + end. Add constant to start instead of subtracting it. + + Tue Oct 3 12:23:28 1995 Torbjorn Granlund + + * combine.c (simplify_rtx): In code that attempts to simplify + conditional expressions, if the result is an NE around another + comparison, return the original expression. + + * longlong.h (mips umul_ppmm): Use `l' and `h' constraints; + remove mflo and mfhi instructions. + + Tue Oct 3 12:21:29 1995 Michael Meissner + + * ginclude/va-ppc.h (va_start, stdarg case): Call + __builtin_next_arg, and ignore the result, so that the compiler + can report the proper error, if the second argument is not the + last argument. + + Tue Oct 3 12:02:51 1995 Kohtala Marko + + * function.c (assign_stack_temp): Adjust full_size field of + temp_slot when splitting an unused slot. + + Tue Oct 3 11:51:59 1995 Mike Stump + + * expr.c (expand_builtin_return_addr): Break out functionality + from expand_builtin. + (expand_builtin): Call expand_builtin_return_addr. + * rs6000.h (RETURN_ADDR_RTX): Remove call to copy_to_reg. + Offset to return address is 4 when !TARGET_64BIT and v4_call_p, + 8 otherwise. + * sparc.h (RETURN_ADDR_RTX): Remove call to copy_to_reg. + * alpha.h (RETURN_ADDR_RTX): New definition. + + Sun Oct 1 21:23:30 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * tree.c (staticp, case INDIRECT_EXPR): Disable case. + + * expr.c (expand_expr, case COMPONENT_REF): If getting component + of union of variable size, propagate TARGET. + + Fri Sep 29 07:48:09 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * expr.c (store_expr): When storing promoted value, don't return + MEM if address contains target. + + Thu Sep 28 14:30:03 1995 Paul Eggert + + * cccp.c (rescan): Expand `#if foo && #bar' without a bogus + complaint about preprocessor directives within macro args. + Expand `foo' in `foo#bar' without requiring a space before `#'. + + Thu Sep 28 14:24:26 1995 Philippe De Muyter (phdm@info.ucl.ac.be) + + * m68k.md (anonymous DImode shift patterns setting cc0): Turned + off due to reload problems. + + Thu Sep 28 14:05:22 1995 Niklas Hallqvist (niklas@appli.se) + + * Makefile.in (USER_H): Move up so can override. + (INSTALL_ASSERT_H): New definition. + (install-headers): Use it. + (stmp-int-hdrs): Handle USER_H being empty. + * config/x-netbsd (INSTALL_ASSERT_H): Define as empty. + + * i386/netbsd.h (WCHAR_{TYPE,UNSIGNED,TYPE_SIZE}): Now int. + * m68k/netbsd.h, ns32k/netbsd.h, sparc/netbsd.h: Likewise. + * vax/netbsd.h: Likewise. + (SIZE_TYPE): Use unsigned int. + + * m68k.c (output_scc_di): Swap operands when needed. + * m68k.h (LEGITIMATE_PIC_OPERAND): Allow SYMBOL_REF_FLAG symref. + * m68k.md: Make both assembler syntaxes do the same for PIC calls. + + Tue Sep 26 16:51:44 1995 Michael Meissner + + * mips.c (override_options): Don't allow anything but integers to + go in the HI/LO registers. + + Tue Sep 26 16:36:18 1995 John F. Carr + + * c-common.c (check_format_info): Don't warn about format type + mismatch if the argument is an ERROR_MARK. + + Mon Sep 25 17:50:50 1995 Craig Burley (burley@gnu.ai.mit.edu) + + * stor-layout.c (put_pending_sizes): New function. + * tree.h (put_pending_sizes): Add declaration. + * tree.c (save_expr): Return original for ERROR_MARK. + + Fri Sep 22 19:20:01 1995 Jeff Law (law@hurl.cygnus.com) + + * expr.c (expand_builtin, case BUILT_IN_MEMCPY): Strip off + all NOP exprs from the source and destination nodes, then + set MEM_IN_STRUCT_P. + + Fri Sep 22 18:50:31 1995 Michael Meissner + + * rs6000/eabi.h (ASM_OUTPUT_INT): Test for whether the integer + being output is also a constant so &sym - &sym2 is not fixed up. + + Fri Sep 22 18:49:07 1995 Peter Flass (FLASS@LBDRSCS.BITNET) + + * i370.md (cmpsi): Add missing constraints to operand 1. + + Fri Sep 22 18:27:33 1995 Torbjorn Granlund + + * i386.h (CONST_OK_FOR_LETTER_P): Make `N' match range 0..255 + for `outb' instruction. + + * pyr.h (PRINT_OPERAND): Handle code `R' for REG. + * longlong.h (pyr umul_ppmm): Use it. + + Fri Sep 22 18:24:38 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * c-parse.in (enumlist): Propagate error_mark_node. + + * c-aux-info.c (gen_type): Handle ERROR_MARK. + + * alpha.md (movdi): Avoid memory sharing problem when in reload. + + Wed Sep 20 14:27:09 1995 Peter Flass + + * mvs.h (FUNCTION_PROLOGUE): Maintain savearea forward chain + per MVS standards. + + Wed Sep 20 14:20:52 1995 Torbjorn Granlund + + * pyr.md (cmphi recognizer): Make condition match constraints. + (cmpqi recognizer): Likewise. + + Wed Sep 20 12:42:59 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * integrate.c (expand_inline_function): Do copy something setting + the result register if it is setting it to itself and has a REG_NOTE. + + * integrate.c (set_decl_{origin_self,abstract_flags}): Treat + a DECL_INITIAL of error_mark_node the same as one of NULL_TREE. + + Tue Sep 19 19:30:18 1995 Dave Pitts (dpitts@nyx.cs.du.edu) + + * i370.md (cmphi, movhi, movstricthi, extendhisi2): Correct generation + of short integer (Halfword) + ({add,sub,mul,and,ior,xor}hi3): Likewise. + * i370/mvs.h (MACROPROLOGUE): New macro. + (FUNCTION_{PRO,EPI}LOGUE): Added ability to use IBM supplied function + prologue macros. + (FUNCTION_PROLOGUE): Corrected function "in-line" prologue alignment + problems. + (ASM_DECLARE_FUNCTION_NAME): Changed alignment to FullWord. + (ASM_OUTPUT_{SHORT,ASCII}): Reworked. + + Tue Sep 19 19:22:15 1995 Douglas Rupp (drupp@cs.washington.edu) + + * winnt/win-nt.h: Renamed from winnt/win-nt.h. + (LINK_SPEC): Add -noinhibit-exec. + * {alpha,i386}/win-nt.h: Renamed from {alpha,i386}/winnt.h. + Include winnt/win-nt.h, not winnt/winnt.h. + * winnt/oldnames.c: New file. + * winnt/headers.mak (fixinc-nt.obj): Fix typo. + * winnt/config-nt.bat: Change winnt.h to win-nt.h. + * i386/config-nt.sed: Likewise. + * configure ({alpha,i386}-*-winnt3*): Likewise. + + Mon Sep 18 14:00:45 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de) + + * 1750a.h (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): + Added R2 and R0_1. + (REG_CLASS_FROM_LETTER): New letters 't' and 'z'. + (EXTRA_CONSTRAINT): New letter 'Q'. + + Sun Sep 17 12:39:22 1995 Jeff Law (law@snake.cs.utah.edu) + + * pa.h (ASM_DECLARE_FUNCTION_NAME): If a parameter's type + has TYPE_NEEDS_CONSTRUCTING on, then it's passed by invisible + reference. + + Sat Sep 16 17:42:33 1995 Jim Wilson + + * loop.c (find_and_verify_loops): Fix error in last change. + + Sat Sep 16 08:38:22 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * alpha.h (GO_IF_LEGITIMATE_ADDRESS): Disallow SYMBOL_REF for + current function. + + * cse.c (recorded_label_ref): New variable. + (insert): Set instead of cse_jumps_altered. + (cse_main): Initialize it and return 1 if nonzero at end. + + Fri Sep 15 18:26:49 1995 Torbjorn Granlund (tege@matematik.su.se) + + * fold-const (div_and_round_double): Change `carry', `quo_est', + and `scale' from plain int to `unsigned HOST_WIDE_INT'. + + Fri Sep 15 18:24:24 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * cse.c (insert): Set cse_jumps_altered when inserting a LABEL_REF. + + Fri Sep 15 17:29:41 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de) + + * 1750a.c (b_mode_operand): New function. + (print_operand): Added code 'Q'. + + Fri Sep 15 17:27:23 1995 Jim Wilson + + * loop.c (find_and_verify_loops): When moving exit blocks out of + the loop, verify that the target of P is within the current loop. + + * reorg.c (fill_slots_from_thread): Update thread if it is split. + + Fri Sep 15 17:06:51 1995 Michael Meissner + + * rs6000.md (decrement_and_branchsi and related insns): Don't use + a "2" to select a register preference for operand 1 if operand 2 + hasn't been seen yet. + Add appropriate clobbers in decrement_and_branchsi. + Add patterns where the pc/label_ref are interchanged. + + * Makefile.in (gnucompare, stmp-multilib-sub): Remove extra . in + front of $(objext). + + * rs6000.c (output_toc): Align DF constants if STRICT_ALIGNMENT. + + * config/fp-bit.c (FLO_union_type): Add words field if double + precision to get at the separate words. + (FLO_union_type, pack_d, unpack_d): Use FLOAT_BIT_ORDER_MISMATCH + to determine when the bitfields need to be reversed, and + FLOAT_WORD_ORDER_MISMATCH when the words need to be reversed. + + Fri Sep 15 16:41:43 1995 Jeff Law (law@snake.cs.utah.edu) + + * reorg.c (fill_simple_delay_slots): When filling insn's delay slot + with JUMP_INSN, don't assume it immediately follows insn on + unfilled slots obstack. + + * Makefile.in (caller-save.o): Depend on insn-codes.h. + + Thu Sep 14 17:41:49 1995 Jim Meyering (meyering@comco.com) + + * protoize.c (do_cleaning): Don't blank out backslash-escaped + newlines in double quoted strings. + + Thu Sep 14 16:20:35 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * emit-rtl.c (gen_lowpart): If gen_lowpart_common fails + for a REG, load it into a pseudo and try again. + + Thu Sep 14 14:15:16 1995 Stan Cox (coxs@dg-rtp.dg.com) + + * m88k.h (VERSION_INFO1): Removed BCS reference. + * m88k/dgux.h (ASM_SPEC, *_LEGEND): + Added -mno-legend option. -mstandard no longer implies that legend + legend information not be produced. + (LINK_SPEC): Removed -z text + + Tue Sep 12 19:05:39 1995 Jim Wilson + + * cccp.c (is_system_include): Call skip_redundant_dir_prefix. + + Tue Sep 12 18:58:21 1995 John Carr + + * sparc.md: Change `*return "string"' to "string" in patterns. + + Tue Sep 12 18:48:47 1995 Craig Burley (burley@gnu.ai.mit.edu) + + * function.c (put_var_into_stack): For CONCAT case, order of + placement depends on FRAME_GROWS_DOWNWARD, not STACK_GROWS_DOWNWARD. + + Tue Sep 12 18:34:10 1995 Doug Evans + + * va-sparc.h (v9 varargs va_start): Handle __builtin_va_alist + being stack argument. + + * sparc.h (STATIC_CHAIN_REGNUM): Use %g5 for sparc64. + (TRAMPOLINE_TEMPLATE): Rewrite for sparc64. + (TRAMPOLINE_SIZE): Is 40 for sparc64. + * sparc.c (sparc64_initialize_trampoline): Rewrite. + + Tue Sep 12 18:30:22 1995 Douglas Rupp (drupp@cs.washington.edu) + + * cp/Make-lang.in (cc1plus) : Removed unnecessary $(exeext). + + * configure: Added code to handle gcc_extra_objs. + (alpha-winnt): Changed xmake_file to winnt/x-winnt. + Added extra_gcc_objs=spawnv.o; changed extra_programs to ld.exe. + (i386-winnt): Changed xmake_file to winnt/x-winnt. + Added extra_gcc_objs=spawnv.o; changed extra_programs to ld.exe. + * configure.bat: Changed to used common winnt/config-nt.bat. + * Makefile.in: Changed various .o's to .$(objext)'s + (specs): Removed unnecessary $(exeext). + (EXTRA_GCC_OBJS): New variable. + (clean): Removed $(LIB2FUNCS_EXTRA) + * objc/Makefile: Changed archive command for libobjc.a to use $? + for objects. + + * alpha/x-winnt, i386/x-winnt: Deleted. + * alpha/config-nt.bat, i386/config-nt.bat: Deleted. + * alpha/config-nt.sed, i386/config-nt.sed: Moved architecture + independent commands to config/winnt/config-nt.sed. + * alpha/winnt.h: Added -D_M_ALPHA to CPP_PREDEFINES. + Changed LIB_SPEC to be compatible with Gnu ld for NT. + * i386/winnt.h: Added -D_cdecl=__attribute__((__cdecl__)). + Change LIB_SPEC to be compatible with Gnu ld for NT. + * winnt/config-nt.bat, winnt/config-nt.sed: New files. + * winnt/dirent.{c,h}, winnt/fixinc-nt.c, winnt/headers.mak: New files. + * winnt/ld.c: Changed precedence of libraries to look for + libfoo.lib before libfoo.a + Changed to work like Gnu ld for NT. + * winnt/libgcc.mak, winnt/mklibgcc.c: New files. + * winnt/spawnv.c: Changed spawn function entry points to __spawn* + instead of spawn*. + * winnt/x-winnt: New file. + * fixinc-nt.sed: New file. + * fixinc.winnt: Rewritten to use fixinc-nt.sed. + + * gcc.c: Remove fix_argv kludge. + + Tue Sep 12 13:24:17 1995 Michael Meissner + + * rs6000.md (power subdi3 pattern): Fix pattern to have 5 + alternatives, and correct 4th alternative to match reality. + + * rs6000.md (adddi3, subdi3, negdi2): Add constraints so output reg + does not overlap one reg with one of the inputs. + + Tue Sep 12 13:09:48 1995 Philippe De Muyter (phdm@info.ucl.ac.be) + + * m68k.c (output_scc_di): Fixed for non-SGS_CMP_ORDER syntax. + + * collect2.c (scan_libraries): Cast lsyms' alloca to LDSYM*. + + Tue Sep 12 13:04:12 1995 Niklas Hallqvist (niklas@appli.se) + + * stmt.c (expand_start_stmt_expr): Do stack adjust in right place. + + * stdarg.h (__gnuc_va_list): Make char * for NetBSD. + + Tue Sep 12 12:44:46 1995 Jason Merrill + + * ginclude/va-ppc.h (va_arg): Reorganize to avoid BIND_EXPRs of + aggregate or array type. + + Tue Sep 12 12:42:27 1995 Ian Lance Taylor + + * fixincludes: Fix HP/UX for g++ -pedantic-errors. + + * fixincludes (curses.h): typedef bool need not take up entire line. + + Mon Sep 11 19:05:42 1995 Stan Cox (coxs@dg-rtp.dg.com) + + * c-typeck.c (digest_init): Don't recursively call digest_init + when in traditional mode if the type is invalid. + + Mon Sep 11 18:58:26 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de) + + * 1750a.md: Added DLB/DSTB peepholes for HFmode. + Corrected mnemonics for HImode DSTB peephole. + + Mon Sep 11 18:48:06 1995 Michael Meissner + + * config/fp-bit.c (FLO_union_type): Remove bitfields to set sign, + exponent, and mantissa, and add value_raw field, which is an + integer of the appropriate type. If _DEBUG_BITFLOAT is defined, + provide little and big endian bitfields. If the macro + FLOAT_BIT_ORDER_MISMATCH is defined, use explicit bitfields. + (pack_d, unpack_d): Switch to use value_raw and explicit shifts + and masks so that we don't have to worry about whether the target + is big or little endian unless FLOAT_BIT_ORDER_MISMATCH is + defined. If single precision floating point, rename to pack_f and + unpack_f, so there is no confusion in the debugger. + + * rs6000.h (rs6000_abi): New enumeration to describe which + ABI we're conforming to. + (rs6000_stack): Use abi enum, not AIX vs. V.4 boolean. + (ASM_OUTPUT_OPTIONS): New macro to print output options in .s file. + (ASM_FILE_START): Use it. + (output_options,rs6000_float_const): Declare new functions. + + * rs6000.c (output_option{,s}): New functions to write -f, -m, + and -W options to the asm file. + (rs6000_float_const): New function to generate floating point + constants portably used in signed,unsigned -> double conversions. + (rs6000_stack_info,debug_stack_info): Use ABI enumeration instead + of AIX vs. V.4 boolean. + + * rs6000.md (float{,uns}sidf2): Call rs6000_float_const to + portably build the proper floating point constant for conversions. + (movdi): Properly handle movdi of CONST_{INT,DOUBLE} on little + endian systems. + + * rs6000/sysv4.h (LIBGCC2_WORDS_BIG_ENDIAN): Define to be 0/1 + depending on the target endianess. + (ASM_FILE_START): Define, to call output_options in addition to + output_file_directive. + (TRAMPOLINE_SIZE): Correct size to match code. + + * rs6000/eabi{,le}sim.h (CPP_SPEC): Define the correct endian + macro for varargs/stdargs use. + + Mon Sep 11 18:41:58 1995 Jim Wilson + + * c-decl.c (redeclaration_error_message): For TYPE_DECLs, return 0 + if TYPE_MAIN_VARIANT of old type is same as new type. + + Mon Sep 11 17:39:35 1995 Rob Ryan (robr@cmu.edu) + + * xcoffout.c (xcoff_inlining): New variable, used in place of + xcoff_current_include_file when determining whether to use + absolute line numbers. + (xcoffout_source_file): Switched to using xcoff_inlining to + determine when to emit .bi/.ei directives. + + Mon Sep 11 16:55:06 1995 Torbjorn Granlund + + * m68k.md (cmpdi): Change patterns to allocate scratch register at + RTL generation time. + (tstdi): Likewise. + + Sun Sep 3 09:03:50 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * fold-const.c (size_binop): Don't pass 1 to NOTRUNC. + + Thu Aug 31 19:27:00 1995 Roland McGrath + + * libgcc2.c: Include longlong.h. + [L_udivdi3 || L_divdi3 || L_umoddi3 || L_moddi3] (__udivmoddi4): + Define this `static inline' when defining these, so they all + remain leaf functions. + + Thu Aug 31 18:38:21 1995 Paul Eggert + + * c-parse.in (ends_in_label): New %union member. + (stmts, stmt_or_label): Use new member to avoid lexical lookahead hack. + (lineno_stmt_or_labels): New rule. + (lineno_stmt_or_label, stmt_or_label): Yield nonzero if it ends + in a label. + + Thu Aug 31 08:31:40 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * cse.c (canon_hash, CONST_DOUBLE): Hash integer and real + differently. + * varasm.c (struct rtx_const): Add new field DI to union. + (decode_rtx_const, case CONST_DOUBLE): Use to hash CONST_DOUBLE + representing an integer. + + * va-alpha.h (__gnuc_va_list): Make __offset an int. + * alpha.c (alpha_builtin_saveregs): Properly compute address + of __offset both both OSF and WINNT. + + * xm-alpha.h (sbrk): Don't define here. + * gmon.c (sbrk): Define here for __alpha. + * toplev.c (sbrk): Likewise. + * mips-tfile.c (malloc, calloc, realloc): Don't define for anybody. + + * reload.c (push_reload): Add case for output reload of a SUBREG + of a hard reg when output mode is invalid for that mode. + In both that case and existing case for in, don't remove SUBREG. + * reload1.c (emit_reload_insn): Emit RELOAD_OTHER output reloads last. + + Tue Aug 29 19:16:06 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * c-common.c (decl_attribute, case A_PACKED): Check is_type first. + (decl_attribute, case A_T_UNION): Likewise. + Don't access TYPE_FIELDS if DECL is zero. + * c-decl.c (finish_struct): If transparent_union attribute + specified, validate it once we finish laying the union out. + + Mon Aug 28 05:58:03 1995 Paul Eggert + + * arm.c (arm_gen_movstrqi): Remove unused variable const_sxteen. + + * bi-lexer.c (buffer, inpoint): Remove unused variables. + + * i370/mvs.h, i370/mvs370.c (mvs_label_emitted): Renamed + from mvs_label_emited. + + * msdos/configur.bat: Fix misspelling of `maintainer-clean'. + + Sat Aug 26 06:57:17 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * reload.c (push_secondary_reload): If X is a paradoxical SUBREG, + get mode and thing to reload from inside. + * reload1.c (emit_reload_insns): Do nothing for SUBREG whose + operand is unused subsequently. + In secondary reload case, if paradoxical SUBREG for output, reload + thing inside SUBREG, just like gen_reload. + + Fri Aug 25 19:26:53 1995 Paul Eggert + + * c-typeck.c (set_init_label): Don't die if an entire + brace-pair level is superfluous in the containing level. + + Fri Aug 25 19:22:46 1995 Michael Meissner + + * configure (powerpc{,le}-eabisim): Add support for a new target + that works under the PSIM simulator. + * rs6000/eabisim.h, rs6000/eabilesim.h, rs6000/t-eabisim: New files. + + * rs6000/eabi.h (STRICT_ALIGNMENT): If little endian, always set + strict alignment to 1. + + Fri Aug 25 19:22:23 1995 David Edelsohn + + * rs6000.md ({add,sub,mulsi}di3): Support both endian possibilities. + (negdi2): Likewise. + + Fri Aug 25 19:10:41 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de) + + * 1750a.md: Added peephole definitions for Load/Store Base insns + and eliminating redundant load in an equivalent store/load sequence. + + Fri Aug 25 18:33:27 1995 Craig Burley (burley@gnu.ai.mit.edu) + + * toplev.c (report_error_function): Don't attempt to use input + file stack to identify nesting of #include's if file name oflocation + diagnosed is not same as input_filename. + + Fri Aug 25 07:31:47 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * integrate.c (output_inline_function): Switch to function obstack. + + Mon Aug 21 13:29:54 1995 J"orn Rennecke (amylaar@meolyon.hanse.de) + + * i386.c (arithmetic_comparison_operator): New function. + (print_operand): Take into account that overflow flag is not + set the same as after a compare instruction. + * i386.md (decrement_and_branch_until_zero): Use + arithmetic_comparison_operator to decide if there is comparison + suitable to be expressed by condition code from an arithmetic op. + + Mon Aug 21 13:26:13 1995 Philippe De Muyter (phdm@info.ucl.ac.be) + + * m68k.md (adddi3, subdi3): "&" added to clobber's constraints. + + Mon Aug 21 12:11:14 1995 Jim Wilson + + * t-sparclite (MULTILIB_*, LIBGCC, INSTALL_LIBGCC): Define. + + * sh.md (movdi-1, movdf-1): Make conditional on reload_completed, + delete conditions checking for pseudo registers and Q addresses. + Add code to handle SUBREG. + + * local-alloc.c (wipe_dead_reg): Make a register mentioned in a + REG_INC note die after the instruction. + + * m68k.md: For all dbra pattern, change constraint from 'g' to 'd*g'. + + * Makefile.in: (underscore.c): Rename rule to stamp-under, and + touch stamp-under at the end. Add new rule for underscore.c that + depends on stamp-under. + + * sh.c (reg_unused_after): For a SEQUENCE, make sure all insns are + safe before returning 1. + + * sh.h (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN): Define. + + * sh.c (output_stack_adjust): Add new argument reg. Use it instead + of stack_pointer_rtx. + (sh_expand_prologue, sh_expand_epilogue): Pass new argument to + output_stack_adjust. + + Sat Aug 19 17:34:15 1995 Jim Wilson + + * sparc/gmon-sol2.c (_mcount): Define. + * sparc/sol2.h (STARTFILE_SPEC, ENDFILE_SPEC): Delete superfluous + -pg tests. + (LINK_SPEC): Add libp directories to -Y when -pg. + + * unroll.c (calculate_giv_inc): Handle increment computed by ASHIFT. + + Sat Aug 19 17:28:56 1995 Philippe De Muyter (phdm@info.ucl.ac.be) + + * m68k.md (subdi3): Should not be commutative. + (one_cmpldi2): Fixed typo with register operand. + + Sat Aug 19 17:20:43 1995 Michael Meissner + + * rs6000.c (output_prolog): Fixup code to set stack pointer + if stack size > 32k. + * rs6000.md (sync_isync): Renamed from sync; added an isync insn + after the sync to properly deal with PowerPC's with split I/D caches. + * sysv4.h (INITIALIZE_TRAMPOLINE): Sync function now named sync_isync. + + Sat Aug 19 17:07:09 1995 Doug Evans + + * h8300.h (STATIC_CHAIN_REGNUM): Use r3. + (REGISTER_NAMES): Print r7 as sp. + (ADDITIONAL_REGISTER_NAMES): Recognize r7. + (ASM_OUTPUT_ALIGN): Alignment is power of 2. + * h8300.md (fancy_btst,fancy_btst1): Branch target must be + operand 0 for length attribute to work. + + Sat Aug 19 16:43:11 1995 Paul Franklin + + * assert.h: Declare __eprintf with attribute noreturn. + + Sat Aug 19 16:40:12 1995 Jason Merrill + + * stddef.h: Don't define wchar_t if __cplusplus is defined. + + Tue Aug 15 18:01:01 1995 Paul Eggert + + * cccp.c (warning_with_line): Fix typo in declaration when + !HAVE_VPRINTF and defined (__STDC__). + + Tue Aug 15 17:57:54 1995 Stephen L Moshier + + * real.c (ediv, emul): Set sign bit of IEEE -0.0 result. + + Tue Aug 15 17:49:47 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * expr.c (safe_from_p): Only safe if EXP is variable-size and X + is BLKmode. + + * stmt.c (fixup_gotos): When some fixups done, reset to point + to next instead of zeroing TREE_VALUE, which may be shared. + + Mon Aug 14 09:15:45 1995 Doug Evans + + * m68k/m68kemb.h (STARTFILE_SPEC): Define as empty. + + Mon Aug 14 09:08:57 1995 Pat Rankin + + * vax.c (vms_check_external): Update `pending_head' properly + when the first list element is removed. + + Mon Aug 14 09:01:32 1995 Jeffrey A. Law + + * pa.md (call expanders): Emit a blockage insn after restoring + %r19 when generating PIC. + + Sun Aug 13 21:58:49 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * toplev.c (main): Change text of unsupported -g option warning. + + Sun Aug 13 21:47:57 1995 Andrew McCallum + + * objc/selector.c (sel_get_any_typed_uid): New function. + * objc/objc-api.h (sel_get_any_typed_uid): Declare new function. + + Sun Aug 13 21:43:17 1995 John Carr + + * c-typeck.c (c_expand_asm_operands): Check for read-only output + operand where the variable is read-only but the type is not. + + Sun Aug 13 21:16:12 1995 David Edelsohn + + * rs6000.c (direct_return): Epilogue required if CR saved. + + Sun Aug 13 19:09:25 1995 Jeff Law (law@snake.cs.utah.edu) + + * configure (hppa1.?-hp-hpux10): Recognize and treat just like hpux9. + + Sun Aug 13 19:07:23 1995 Doug Evans + + * i960.md (movdi matchers): Fix src/dest order in unaligned + reg->reg case. + + Sun Aug 13 18:49:01 1995 DJ Delorie + + * i386/xm-dos.h (HAVE_STRERROR): New definition. + + * msdos/configur.bat: Add missing carriage return. + + Sun Aug 13 18:40:55 1995 Andrew Cagney + + * Makefile.in (USER_H): Add va-ppc.h. + + Sun Aug 13 18:36:17 1995 M. Warner Losh + + * stmt.c (expand_asm_operands): Type '0'..'4' operands may + allow regs, so move them to the default case. + + Sun Aug 13 18:32:35 1995 Paul Eggert + + * cccp.c (warning_with_line): New function. + (trigraph_pcp): Use it, to avoid reporting line number. + (vwarning_with_line): Don't report line number if zero. + + Sun Aug 13 18:23:08 1995 Jason Merrill + + * toplev.c (vmessage): Support four arguments. + + Sun Aug 13 18:19:51 1995 Michael Meissner + + * ginclude/stdarg.h: Add ppc svr4 calling sequence support. + * ginclude/varargs.h: Likewise. + * ginclude/va-ppc.h: New file. + + Sun Aug 13 18:05:20 1995 Michael Gschwind + + * configure (pdp-*-*): Add support for t-pdp11. + * t-pdp11: New file. + * Makefile.in (LIBGCC2_CFLAGS): Add TARGET_LIBGCC2_CFLAGS. + + Sun Aug 13 14:50:58 1995 Jim Wilson + + * final.c (final_start_function): Always call sdbout_begin_function + and xcoffout_begin_function, even if no line number info. + + * mips/abi64.h (SETUP_INCOMING_VARARGS): In if statement, only + subtract one for stdarg. Don't subtract PRETEND_SIZE from + argument pointer when calculating stack address. + * mips.h (INITIAL_ELIMINATION_OFFSET): For 64 bit ABI, subtract + current_function_pretend_args_size when converting from argument + pointer. + * va-mips.h (va_start): For stdarg, delete separate define for + 64 bit ABI. For varargs, don't subtract 64, and only add -8 when + all argument registers are used. + + * gcc.c (main): When concat gcc_exec_prefix and + standard_startfile_prefix, put machine_suffix in the middle. + + * iris6.h (INIT_SECTION_ASM_OP): Don't define. + (LD_INIT_SWITCH, LD_FINI_SWITCH, HAS_INIT_SECTION): Don't undef. + (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Ifdef out. + * configure (mips-sgi-irix6, mips-sgi-irix5cross64): Define + use_collect2 to yes. + + * combine.c (move_deaths): When have a multi-reg hard register, + if don't find a note, then recur for each individual hard register. + + * cse.c (set_nonvarying_address_components): Handle addresses + which are the sum of two constant pseudo regs. + (cse_rtx_addr_varies_p): Likewise. + + * Makefile.in (gfloat.h): Add a - before the rm command. + + * loop.c (find_and_verify_loops): Set dest_loop only if + JUMP_LABEL (insn) is non-zero. + + Mon Jul 31 14:31:53 1995 Ian Lance Taylor + + * fixincludes: Avoid clobbering VxWorks drv/netif/if_med.h file. + + Sat Jul 29 16:21:42 1995 Jason Merrill + + * collect2.c: (XCOFF_SCAN_LIBS): Define if OBJECT_FORMAT_COFF and + XCOFF_DEBUGGING_FORMAT. + (SCAN_LIBRARIES): Also define if XCOFF_SCAN_LIBS. + + Sat Jul 29 16:19:42 1995 Stuart D. Gathman + + * collect2.c (scan_libraries): Implement for AIX. + + Sat Jul 29 09:59:33 1995 Michael Gschwind + + * configure: (pdp11-*-bsd) New target. + * 2bsd.h: New file. + + * pdp11.c (output_move_double): Handle CONST_INT parameters properly. + * pdp11.h (RTX_COSTS): Fill in missing default values. + * pdp11.md (truncdfsf2, extendsfdf2, floatsidf2, fix_truncdfsi2): + Allow register parameters, required by gcc to generate correct code. + * xm-pdp11.h: Include tm.h. + + Sat Jul 29 09:55:17 1995 Andreas Schwab + + * configure (m68k-*-linux*aout*, m68k-*-linux*): New targets. + * m68k/linux-aout.h, m68k/linux.h, m68k/t-linux, m68k/xm-linux.h: New. + * m68k.md [USE_GAS]: Output `jbsr' instead of `jsr' for normal + function calls and `bsr.l' instead of `bsr' for pic function calls. + + Sat Jul 29 09:44:13 1995 Jim Wilson + + * sh.h (CAN_DEBUG_WITHOUT_FP): Comment out. + + * reload.c (find_reloads_address_1, case PLUS): When handle SUBREG, + add SUBREG_WORD offset to SUBREG_REG register number. + (find_reloads_address_1, case SUBREG): If a pseudo register inside + a SUBREG is larger than the class, then reload the entire SUBREG. + * sh.h (SUBREG_OK_FOR_INDEX_P): New macro. + (INDEX_REGISTER_RTX_P): Use it. + + Sat Jul 29 09:33:19 1995 Doug Evans + + * mips/netbsd.h (CPP_SPEC): Fix typo. + + * configure (a29k-*-vxworks*): Define extra_parts for crt{begin,end}.o. + * t-a29k, t-a29kbase, t-vx29k ({,CROSS_}LIBGCC1): Define as empty. + + Sat Jul 29 09:15:17 1995 Jeffrey A. Law + + * pa/lib2funcs.asm (gcc_plt_call): Rewrite to avoid the need + for being called by _sr4export. Inline expand $$dyncall to + avoid the need for long-call and PIC support. + + Sat Jul 29 07:30:04 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de) + + * ms1750.inc (ucim.m, ucr.m, uc.m): New. + * 1750a.md (cmpqi): Account for unsigned comparisons. + (rotrqi3, rotrhi3): Reworked. + * 1750a.c (notice_update_cc): INCM and DECM set condition codes. + (unsigned_comparison_operator, next_cc_user_is_unsigned): New fcns. + * 1750a.h (FUNCTION_EPILOGUE): Local variables freed from SP, not FP. + (ASM_OUTPUT_BYTE): Make distinct from ASM_OUTPUT_CHAR. + (ASM_OUTPUT_CONSTRUCTOR): Add FILE arg to assemble_name. + + Fri Jul 28 09:40:07 1995 Jeffrey A. Law + + * pa.h (DO_GLOBAL_DTORS_BODY): Use an asm statement to keep optimizer + from deleting an assignment it believes dead. + + Fri Jul 28 08:47:51 1995 Jim Wilson + + * unroll.c (unroll_loop): When preconditioning, output code to + execute loop once if initial value is greater than or equal to final + value. + + * configure (lang_specs_files, lang_options_files): Add $srcdir to + file names when adding them to these variables. + + * c-typeck.c (pointer_int_sum): Don't distribute if intop is unsigned + and not the same size as ptrop. + + * function.c (assign_stack_temp): When split a slot, set base_offset + and full_size in the newly created slot. + (combine_temp_slots): Update full_size when slots are combined. + + * sh.c (reg_unused_after): New function. + * sh.md (define_peephole): Add peepholes to use r0+rN addressing mode + for some address reloads. + + * final.c (final_start_function): If SDB_DEBUG, call + sdbout_begin_function. If XCOFF_DEBUG, call xcoffout_begin_function + instead of xcoffout_output_first_source_line. + (final_scan_insn): Don't call sdbout_begin_function or + xcoffout_begin_function. + * xcoffout.c (xcoffout_output_first_source_line): Delete. + (xcoffout_begin_function): Call dbxout_parms and + ASM_OUTPUT_SOURCE_LINE. + + * va-mips.h: Change every occurance of #if __mips>=3 to + #ifdef __mips64. + * mips/abi64.h (CPP_SPEC): Output -D__mips64 when -mips3, or -mips4, + or -mgp64. Output -U__mips64 when -mgp32. + * mips/dec-bsd.h, mips/elf64.h, mips/iris3.h: Likewise. + * mips/iris5.h, mips/mips.h, mips/netbsd.h, mips/osfrose.h: Likewise. + + * i960.c (i960_function_epilogue): Don't clear g14 for functions with + an argument block. + (i960_output_reg_insn): Likewise. + (i960_output_call_insn): Clear g14 for functions wtih an argument + block. + + Fri Jul 28 08:43:52 1995 Doug Evans + + * i960.c (i960_arg_size_and_align): Correct alignment of XFmode + values in library calls. + * i960.md (movdi matchers): Support odd numbered regs. + + Fri Jul 28 08:37:25 1995 Michael Gschwind + + * pdp11.md (divhi3, modhi3, divmodhi4): Rewrite. + + Wed Jul 26 10:15:52 1995 Hallvard B Furuseth (h.b.furuseth@usit.uio.no) + + * collect2.c (end_file): Fix typo in error message text. + + Wed Jul 26 09:22:22 1995 Jeff Law (law@snake.cs.utah.edu) + + * xm-pa.h (USE_C_ALLOCA): Always define. + * xm-pahpux.h (USE_C_ALLOCA): Likewise. + + * x-pa (CC): Remove useless definition. + * xm-pa.h (HAVE_STRERROR): Define. + (__BSD_NET2__): Define. + + Wed Jul 26 09:10:25 1995 Jason Merrill + + * expr.c (preexpand_calls): Don't look past a CLEANUP_POINT_EXPR. + + Wed Jul 26 08:43:42 1995 Jim Wilson + + * cse.c (cse_insn): When do special handling for (set REG0 REG1), + must delete REG_EQUAL note from insn if it mentions REG0. + + * loop.c (find_and_verify_loops): When moving blocks of code, verify + that the just destination is not in an inner nested loop. + (mark_loop_jump): Don't mark label as loop exit if it jumps to + an inner nested loop. + + Wed Jul 26 08:40:31 1995 Paul Eggert + + * cccp.c (do_include, read_name_map): Omit leading "./" and + trailing "/" when it makes sense. + (skip_redundant_dir_prefix): New function. + + Wed Jul 26 08:36:41 1995 Michael Meissner + + * stmt.c (emit_nop): Do not emit a nop if there is a single + insn before a label or at the start of a function. + + Wed Jul 26 08:21:21 1995 Doug Evans + + * Makefile.in (gfloat.h): Delete previous copy before updating. + + Wed Jul 26 08:18:29 1995 Roland McGrath + + * Makefile.in (STAGESTUFF): Add stamp-crtS. + (crtbeginS.o, crtendS.o, stamp-crtS): New rules; just like + crtbegin.o et al, but compiled using -fPIC. + * configure (*-*-gnu*): Add crtbeginS.o and crtendS.o to $extra_parts. + + Wed Jul 26 08:11:52 1995 Michael Gschwind + + * pdp11.md: Fixed typos ('bhos' -> 'bhis'). + + Wed Jul 26 08:05:41 1995 Jim Wilson + + * hp320.h, m68k.h, m68kv4.h (LEGITIMATE_PIC_OPERAND_P): Reject + CONST_DOUBLE with MEM with invalid pic address. + * reload1.c (real.h): Include it. + * Makefile.in (reload1.o): Depends on real.h. + + Wed Jul 26 07:58:22 1995 Ian Lance Taylor + + * gcc.c (MULTILIB_DIRS): Provide default if not defined. + (multilib_defaults): New static variable. + (default_arg): New static function. + (set_multilib_dir): Ignore default arguments. + (print_multilib_info): Ignore entries which use default arguments. + + Tue Jul 25 10:06:09 1995 Michael Meissner + + * rs6000.md (allocate_stack): Don't copy the LR register to + the new stack end. + * rs6000.c (rs6000_stack_info): Correctly store the LR in + the caller's frame, not the current frame, for V.4 calls. + * rs6000/eabi.asm (_save*, _rest*): Provide all mandated V.4 save + and restore functions, except for the save*_g functions which + return the GOT address. + + Fri Jul 21 14:24:25 1995 Michael Meissner + + * rs6000/eabi.h (__eabi): Load up r13 to be the small data + pointer, unless -mrelocatable. + + * rs6000/aix3newas.h (LINK_SPEC): Import machine independent + functions if -mcpu=common. + * rs6000/milli.exp: Import file referenced in aix3newas.h. + + * rs6000/eabi.asm (__eabi): Support for fixing up user initialized + pointers when -mrelocatable is used. + * rs6000/eabi.h (ASM_OUTPUT_INT): Record any pointers initialized + by the user if -mrelocatable, to be fixed up by __eabi. + (CONST_SECTION_ASM_OP): If -mrelocatable, put read-only stuff in .data, + not .rodata, to allow user initialized pointers to be updated by __eabi. + + * rs6000.h (TARGET_SWITCHES): Add -mdebug-{stack,arg}. + (TARGET_{ELF,NO_TOC,TOC}): Add defaults for non system V. + (rs6000_stack): New structure to describe stack layout. + (RS6000_{REG_SAVE,SAVE_AREA,VARARGS_*}): New macros used to + support both AIX and V.4 calling sequences. + (FP_ARG_*, GP_ARG_*): Ditto. + (FP_SAVE_INLINE): Ditto. + (STARTING_FRAME_OFFSET): Modify to support both AIX and V.4 + calling sequences. + (FIRST_PARM_OFFSET): Ditto. + (REG_PARM_STACK_SPACE): Ditto. + (STACK_POINTER_OFFSET): Ditto. + (FUNCTION_ARG_REGNO_P): Ditto. + ({,INIT_}CUMULATIVE_ARGS): Ditto. + (LEGITIMATE_LO_SUM_ADDRESS_P): Ditto. + (FUNCTION_ARG{,_ADVANCE,PARTIAL_NREGS,PASS_BY_REFERENCE}): Ditto. + (SETUP_INCOMING_VARARGS): Ditto. + (EXPAND_BUILTIN_SAVEREGS): Ditto. + (CAN_ELIMINATE): Ditto. + (INITIAL_ELIMINATION_OFFSET): Ditto. + (LEGITIMATE_CONSTANT_POOL_{BASE,ADDRESS}_P): Ditto. + (GO_IF_{LEGITIMATE_ADDRESS,MODE_DEPENDENT_ADDRESS}): Ditto. + (LEGITIMIZE_ADDRESS): Ditto. + (CONST_COSTS): Ditto. + (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Ditto. + (ASM_OUTPUT_REG_{PUSH,POP}): Use reg_names to print registers. + (function declarations): Add new rs6000.c function declarations, + and delete decls of deleted functions. + (SHIFT_COUNT_TRUNCATED): Parenthesize the expression. + + * rs6000.c (init_cumulative_args): New function to support AIX + and V.4 calling sequences. + (function_arg{,_advance,partial_nregs,pass_by_reference}): Ditto. + (setup_incoming_varargs): Ditto. + (expand_builtin_saveregs): Ditto. + (rs6000_stack_info): Ditto. + (debug_stack_info): Ditto. + (direct_return): Changes to support AIX and V.4 calling sequences. + (first_reg_to_save): Ditto. + (svr4_traceback): Ditto. + (output_{prolog,epilog}): Ditto. + (print_operand): Use reg_names to print registers. Add support + for V.4 HIGH/LO_SUM address modes. + (must_save_cr): Function deleted, in rewrite of AIX/V.4 calling + sequence support. + (rs6000_sa_size): Ditto. + (rs6000_pushes_stack): Ditto. + (output_toc): Add abort if no toc. + + * rs6000.md (call insns): Add a new argument to flag a V.4 + function needs to set bit 6 of the CR. + (elf_{low,high}): New V.4 functions to create addresses via HIGH + and LO_SUM patterns. + (movsi): Use elf_{low,high} if appropriate. + (mov{si,di}_update): Name these patterns for allocate_stack. + (allocate_stack): Support for V.4 stack layout. + (sync): New pattern for V.4 trampolines to issue the sync + instruction. + + * rs6000/sysv4.h (TARGET_SWTICHES): Add -mcall-{aix,sysv}, and + -mprototype. Remove separate flag bit for -mno-toc. + (SUBTARGET_OVERRIDE_OPTIONS): Don't test for -mno-toc. + (FP_ARG_*): Adjust for V.4 calling sequences. + (RS6000_*): Ditto. + (FP_SAVE_INLINE): Ditto. + (toc_section): Eliminate use of AIX style full TOC. + (TRAMPOLINE_{TEMPLATE,SIZE}): Redefine for V.4 support. + (INITIALIZE_TRAMPOLINE): Ditto. + + * rs6000/eabi.h (CPP_SPEC): Define _CALL_SYSV or _CALL_AIX, + depending on whether -mcall-sysv or -mcall-aix was used. + * rs6000/eabile.h (CPP_SPEC): Ditto. + * rs6000/sysv4le.h (CPP_SPEC): Ditto. + + * rs6000/t-eabigas (MULTILIB_{OPTIONS,DIRNAMES}): Delete no-toc + libraries, explicit big endian libraries. + * rs6000/t-ppcgas (MULTILIB_{OPTIONS,DIRNAMES}): Ditto. + + * rs6000/t-eabiaix: New file for eabi, using -mcall-aix as the + default. + * rs6000/eabiaix.h: Ditto. + + * rs6000/t-eabilegas: New file for eabi on little endian systems. + * rs6000/t-ppclegas: New file for V.4 on little endian systems. + + * rs6000/t-rs6000 (MULTILIB_{OPTIONS,DIRNAMES}): Build libgcc.a + for -mcpu=common. + + * configure (powerpc-*-eabiaix): New configuration for defaulting + to old-style AIX calling sequence. + (powerpcle*): Use new t-{eabi,ppc}legas files, to avoid building + explicit little endian multilib libraries. + + Fri Jul 21 13:23:06 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * toplev.c (main): Don't define sbrk #ifdef __alpha__. + + Tue Jul 18 19:23:44 1995 Paul Eggert + + * cccp.c (do_include): Prefix -H output lines with spaces, not dots. + (output_dots): Remove. + + * cccp.c (main): cplusplus_comments now defaults to 1. + But clear it if -traditional or the new option -lang-c89 is given. + * gcc.c (default_compilers, cpp): Specify -lang-c89 if -ansi is given. + This turns off C++ comment recognition. + + Tue Jul 18 19:16:38 1995 Jim Wilson + + * va-sparc.h (va_arg): Add support for 128 bit long double type. + + Tue Jul 18 19:11:18 1995 Jorn Rennecke (amylaar@meolyon.hanse.de) + + * c-common.c (decl_attributes, case A_ALIGNED): Handle is_type + case properly. + + Tue Jul 18 19:03:02 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * fold-const.c (fold, case CONVERT_EXPR): Don't merge conversions + if outer is to handle a type with differing precision. + + Mon Jul 17 14:37:35 1995 Pat Rankin (rankin@eql.caltech.edu) + + * vax/vms.h (HAVE_ATEXIT): Define. + (DO_GLOBAL_CTORS_BODY): Don't call atexit; let __do_global_ctors do it. + * vax/xm-vms.h (HAVE_VPRINTF): Define. + + Mon Jul 17 06:41:19 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * c-typeck.c ({unsigned,signed}_type): Handle intXX_type_node types. + + * xm-alpha.h (sbrk): Add declaration. + + * convert.c (convert_to_integer): If TYPE is a enumeral type or + if its precision is not the same as the size of its mode, + convert in two steps. + + * m68k.md (tstdi, cmpdi): Use match_scratch, not match_operand. + + Fri Jul 14 19:23:42 1995 Andreas Schwab + + * c-decl.c (field_decl_cmp): Rewritten to make sure that a null + name always sorts low against other names. + * c-typeck.c (lookup_field): Change name comparison to match what + field_decl_cmp does. + + Fri Jul 14 18:46:24 1995 Michael Meissner + + * rs6000.md (movsi): Convert a CONST_DOUBLE into a CONST_INT of + the low part. + + Fri Jul 14 18:30:52 1995 Doug Evans + + * toplev.c (main): Reword dwarf/c++/-g warning. + + Fri Jul 14 18:19:34 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * expr.h (NO_DEFER_POP): Remove last change. + * expr.c (stor_expr): Force stack adjust before NO_DEFER_POP. + (expand_expr, case COND_EXPR): Likewise. + * stmt.c (expand_start_stmt_expr): Likewise. + + Fri Jul 14 07:58:35 1995 Jim Wilson + + * function.c (struct temp_slot): New fields base_offset, full_size. + (assign_stack_temp): For !FRAME_GROWS_DOWNWARD, set p->size to size. + Set new fields base_offset and full_size. + (combine_temp_slots): Use new fields base_offset and full_size instead + of slot and size. + + * loop.c (loop_number_exit_count): New global variable. + (loop_optimize): Allocate space for it. + (find_and_verify_loops, mark_loop_jump): Set it. + (strength_reduce, check_dbra_loop): Use loop_number_exit_count + instead of loop_number_exit_labels. + * loop.h (loop_number_exit_count): Declare it. + * unroll.c (find_splittable_{regs,givs}, final_[bg]iv_value): Use + loop_number_exit_count instead of loop_number_exit_labels. + (reg_dead_after_loop): Check loop_number_exit_count, and fail + if the count doesn't match loop_number_exit_labels. + + * cse.c (cse_insn): Ifdef out code that pre-truncates src_folded. + + * sparc.md (sethi_di_sp64): Return null string at end. + + * function.h (struct function): Add stdarg field. + * function.c (current_function_stdarg): New global variable. + (push_function_context_to): Save it. + (pop_function_context_from): Restore it. + (assign_parms): Set it. + (init_function_start): Clear it. + * output.h (current_function_stdarg): Declare it. + * i960.md: Modify all patterns which handle stores to memory to also + check current_function_varargs and current_function_stdarg. + + * reorg.c (fill_simple_delay_slots): When trying to take instruction + from after the branch, don't continue past target label. Local + variables passed_label and target_uses are no longer necessary. + + Thu Jul 13 19:30:04 1995 Jeff Law (law@snake.cs.utah.edu) + + * pa.c (output_bb): Fix error in long backwards branch with + nullified delay slot. + + Thu Jul 13 19:26:13 1995 Jim Wilson + + * expmed.c (SHIFT_COUNT_TRUNCATED): Use #ifdef not #if. + + Mon Jul 10 20:16:44 1995 Paul Eggert + + * cccp.c (rescan): Don't address outside of array when + preprocessing C++ comments. + + Mon Jul 10 20:05:46 1995 Michael Meissner + + * rs6000.c (expand_block_move): Remove #if 0 conditionals + against using larger block moves. + + * t-rs6000 (EXTRA_PARTS): Copy milli.exp to release dir. + (milli.exp): Copy to build dir from machine dependend dir. + + Mon Jul 10 20:03:29 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * arm.md (matcher for (shiftable_op (cond-exp) (reg))): If + shiftable_op is minus, then subtract from zero when cond fails. + + Mon Jul 10 19:58:26 1995 John F. Carr + + * sparc.h (SELECT_SECTION): Use TREE_CODE_CLASS instead of directly + referencing tree_code_type. + + Mon Jul 10 19:54:31 1995 Jim Wilson + + * protoize.c (reverse_def_dec_list): Delete const qualifiers from + local variables, and delete casts which were casting away const. + + Mon Jul 10 19:14:39 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * c-lang.c (finish_file): Add missing parm to start_function call. + + * jump.c (jump_optimize): Pass outer_code arg to rtx_cost. + + * varasm.c (assemble_name, bc_assemble_integer): Call + bc_emit_labelref with proper args. + + * function.c (setjmp_args_warning): Remove bogus arg. + + Mon Jul 10 18:20:54 1995 Fergus Henderson (fjh@cs.mu.oz.au) + + * gcc.c (p{fatal,error}_with_name, perror_exec): Quote filename. + + Mon Jul 10 18:12:51 1995 Gran Uddeborg (uddeborg@carmen.se) + + * i386/iscdbx.h (STARTFILE_SPEC): Handle -Xp. + + Wed Jul 5 02:42:17 1995 Per Bothner (bothner@spiff.gnu.ai.mit.edu) + + * cpphash.h (enum node_type): Remove unneeded and non-standard + forward declaration. + + Sat Jul 1 20:15:39 1995 Jim Wilson + + * mips/t-mips, mips/t-mips-gas (MULTILIB_*, LIBGCC, INSTALL_LIBGCC): + Delete. + + * sparc/sol2.h (LINK_SPEC): Revert March 16 change. Do not add -R + for each -L. + + * collect2.c (libcompare): Verify that file name extensions are valid. + Put files with invalid extensions last in the sort. + + * integrate.c (integrate_decl_tree): Set DECL_ABTRACT_ORIGIN before + pushdecl call for local variables. + + Sat Jul 1 08:13:38 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * cpplib.c (output_line_command): If not emitting #line directives + delay returning until after adjust_position has been called. + + * arm.md (mov{si,sf,df}cc): Call gen_compare_reg to generate + the condition code register. + + Sat Jul 1 06:55:09 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * fold-const.c (decode_field_reference): New parm PAND_MASK. + (unextend): New parm MASK. + (fold_truthop): Pass new parms to decode_field_reference and unextend. + + * va-alpha.h (__va_tsize): Use __extension__ to avoid warning + on use of `long long'. + + * expr.h (NO_DEFER_POP): Do any pending stack adjusts. + + * recog.c (register_operand): Disallow subreg of reg not allowed to + change size. + + Thu Jun 29 05:51:57 1995 Jeff Law (law@snake.cs.utah.edu) + + * pa.md (reload addsi3): New pattern to avoid reload lossage + with register eliminations. + + * pa.c (output_cbranch): When checking for a jump to the given + insn's delay slot, handle the case where JUMP_LABEL for the + given insn does not point to the first label in a series of + labels. + (output_bb, output_dbra, output_movb): Likewise. + + Wed Jun 28 18:04:56 1995 Jeff Law (law@snake.cs.utah.edu) + + * pa.h (PIC_OFFEST_TABLE_REGNUM_SAVED): Define to %r4. + (CONDITIONAL_REGISTER_USAGE): Make it fixed when compiling + PIC code. + (INIT_EXPANDERS): Delete. + * pa.c (hppa_save_pic_table_rtx): Delete variable. + (hppa_expand_prologue): For PIC generation, copy the PIC + register into a fixed callee register at the end of the + prologue of non-leaf functions. + * pa.md (call expanders): Reload the PIC register from the + fixed callee saved register. Don't try to save the PIC + register before the call. + + Wed Jun 28 18:01:14 1995 Stan Cox (coxs@dg-rtp.dg.com) + + * m88k/dguxbcs.h (ASM_SPEC): Removed -h flag. + * m88k/dgux.h (ASM_SPEC): Likewise. + + Wed Jun 28 17:01:58 1995 David Edelsohn + + * rs6000.c (processor_target_table): Remove CPU name synonyms. + * rs6000.h (CPP_SPEC): Likewise. + * rs6000/sysv4.h (CPP_SPEC): Likewise. + (ASM_SPEC): Likewise. + * rs6000/sysv4le.h (CPP_SPEC): Likewise. + * rs6000/eabile.h (CPP_SPEC): Likewise. + * rs6000/powerpc.h (CPP_SPEC): Likewise. + (ASM_SPEC): Set assembler target according to compiler target. + * rs6000/aix3newas.h (CPP_SPEC): Likewise. + (ASM_SPEC): Likewise. + * rs6000/aix41.h (CPP_SPEC): Likewise. + (ASM_SPEC): Likewise. + + Wed Jun 28 16:25:53 1995 Gran Uddeborg (uddeborg@carmen.se) + + * i386/x-isc3 (INSTALL_HEADERS_DIR): Delete; done by configure. + + Wed Jun 28 16:10:47 1995 Philippe De Muyter (phdm@info.ucl.ac.be) + + * xm-rs6000.h (alloca): Extern decl added for non-GNU compiler. + + Wed Jun 28 11:31:30 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * cpplib.c (progname): Remove definition from here. + + * final.c (final_scan_insn): Fix error in last change. + + * rtlanal.c (reg_set_p_1): Now static; add extra parm. + + * stmt.c: Delete redundant forward decls. + (expand_anon_union_decl): Correctly call expand_decl. + + * toplev.c (strip_off_ending): Strip off any ending; don't + pretend we know what valid endings are. + + * svr4.h (ASM_OUTPUT_SECTION_NAME): Don't crash if DECL is null. + + * rs6000.md ({load,store}_multiple): Don't use indirect_operand + in define_insn; use explicit MEM of register_operand instead. + + Tue Jun 27 11:42:56 1995 Stephen L Moshier + + * i386/i386.c (print_operand, case `J'): Use jns for GE and js for + LT. + + Tue Jun 27 07:58:55 1995 Jason Merrill + + * expr.c (expand_expr, TARGET_EXPR): Only use original_target + if !ignore. + + Tue Jun 27 07:27:26 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * fold-const.c (fold_truthop): Commute unextend and convert on + l_const and r_const. + + * c-common.c (decl_attributes, case A_CONSTRUCTOR, A_DESTRUCTOR): + Set TREE_USED. + + * final.c (final_scan_insn): Don't call alter_cond unless + condition is on cc0. + + * stmt.c (expand_asm_operands): Handle input operands that may not + be in a register. + + Mon Jun 26 19:23:05 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * arm/lib1funcs.asm (L_dvmd_tls): Renamed from L_divmodsi_tools. + * arm/t-semi (LIB1ASMFUNCS): Rename _dvmd_tls from _divmodsi_tools. + + Mon Jun 26 19:18:06 1995 Jim Wilson + + * unroll.c (find_splittable_regs): When completely unrolling loop, + check for non-invariant initial biv values. + + Mon Jun 26 19:13:54 1995 Gran Uddeborg + + * configure (i[345]86-*-isc*): Fix misspelled "rfile" to "ifile". + + Mon Jun 26 18:58:22 1995 Mike Stump + + * expr.c (expand_expr, case COND_EXPR): Protect the condition from + being evaluated more than once. + (do_jump, case TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR): Likewise. + + Mon Jun 26 18:52:36 1995 Philippe De Muyter (phdm@info.ucl.ac.be) + + * fixincludes (string.h): Fix return value for mem{ccpy,chr,cpy,set} + and str{len,spn,cspn} on sysV68. + + Mon Jun 26 06:54:50 1995 Michael Meissner (meissner@cygnus.com) + + * i386/osfrose.h (LONG_DOUBLE_TYPE_SIZE): Go back to making long + double == double. + + Thu Jun 22 19:14:41 1995 Pat Rankin (rankin@eql.caltech.edu) + + * make-cc1.com (if DO_LINK): Skip c-parse.* processing when + only relinking. + (gas_message): Update to reflect current version, and give + a different message if/when no version of gas is found.xo + + Thu Jun 22 18:52:37 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * arm/lib1funcs.asm (___modsi3): Correctly set SIGN register for + modulo involving negative numbers. + + Thu Jun 22 18:32:27 1995 Uwe Seimet (seimet@chemie.uni-kl.de) + + * xm-atari.h (HZ): Now 100 and don't define if already defined. + + Thu Jun 22 18:26:12 1995 Jeffrey A Law (law@snake.cs.utah.edu) + + * calls.c (expand_call): Correctly handle returning BLKmode + structures in registers when the size of the structure is not + a multiple of word_size. + * stmt.c (expand_return): Likewise. + + * pa-gux7.h (LIB_SPEC): Undefine before redefining. + * pa-hpux.h (LIB_SPEC): Likewise. + * pa-hpux7.h (LIB_SPEC): Likewise. + + * genmultilib: Work around hpux8 /bin/sh case bug. + + * pa.h (LIB_SPEC): Define to avoid -lg. + + Thu Jun 22 18:19:09 1995 Jason Merrill + + * expr.c (expand_expr, TARGET_EXPR): Use original_target. + + * collect2.c (locatelib): Fix parsing of LD_LIBRARY_PATH. + + Thu Jun 22 18:15:54 1995 Paul Eggert + + * configure: Create an empty Makefile.sed first, to work + around a Nextstep 3.3 bug. + + Thu Jun 22 18:03:44 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * Makefile.in (STAGESTUFF): Add stamp-crt. + (crtbegin.o, crtend.o): Now depend on stamp-crt. + (stamp-crt): New rule, to actually build crt{begin,end}.o. + + * collect2.c (main): Unlink export_file before we return. + + Thu Jun 22 14:25:56 1995 Michael Meissner (meissner@cygnus.com) + + * rs6000.h (STRIP_NAME_ENCODING): Store NAME and strlen(NAME) into + local variables; cast result of alloca to avoid compiler warnings. + + Tue Jun 20 18:25:29 1995 Douglas Rupp (drupp@cs.washington.edu) + + * alpha/config-nt.sed, i386/config-nt.sed: Edit to add + a missing $(exeext) for CCCP. + + Tue Jun 20 18:18:00 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * protoize.c (default_include): Use name and two ints to be + compatible with definition of INCLUDE_DEFAULTS. + + Mon Jun 19 19:24:29 1995 Ted Lemon + + * mips/netbsd.h (ASM_DECLARE_FUNCTION_NAME): Don't emit function label. + + Mon Jun 19 18:34:55 1995 Jason Merrill + + * fixincludes: Don't define wchar_t under C++. + + Mon Jun 19 17:12:41 1995 Paul Eggert + + * cccp.c (collect_expansion): Work around enum bug in vax + ultrix 4.3 pcc. + * tree.c (simple_cst_equal): Likewise. + + Mon Jun 19 16:53:00 1995 Douglas Rupp (drupp@cs.washington.edu) + + * winnt/spawnv.c: New file. + + Mon Jun 19 16:30:29 1995 Glenn Brown + + * caller-save.c (save_call_clobbered_regs): If AUTO_INC_DEC, mark + register indicated by REG_INC notes as live so they will be saved. + + Mon Jun 19 16:21:12 1995 Jeffrey A Law (law@snake.cs.utah.edu) + + * pa.h (PRINT_OPERAND_ADDRESS, case LOW_SUM): Fix logic bug + in last change. + + Mon Jun 19 14:11:49 1995 Jim Wilson + + * integrate.c (integrate_decl_tree): Only set DECL_ABSTRACT_ORIGIN + if the decl returned by pushdecl is the one we started with. + + * mips.h (current_function_name): Delete declaration. + (ASM_DECLARE_FUNCTION_NAME): Don't set current_function_name. + * gnu.h (ASM_DECLARE_FUNCTION_NAME): Likewise. + * mips.c (current_function_decl): Delete declaration. + (function_prologue): New variable fnname. Use it instead of + current_function_name. + (function_epilogue): Likewise. + + Mon Jun 19 13:13:15 1995 Richard Kenner + + * alpha.h (ASM_OUTPUT_ASCII): Always reset line count when + starting new line. + + * scan-decls.c (scan_decls): Fix typo when resetting PREV_ID_START. + + * i386/config-nt.sed, alpha/config-nt.sed: Change version to 2.7.1. + + Mon Jun 19 13:06:14 1995 DJ Delorie (dj@delorie.com) + + * msdos/top.sed: Support new build variables. + * msdos/configur.bat: Make options.h and specs.h. + Change realclean to maintainer-clean. + Fri Jun 16 06:54:03 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * Version 2.7.0 Released. + + * obstack.c: Always enable this code for now. * alpha.c (alpha_builtin_saveregs): Use ptr_mode and conversions diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/INSTALL gcc-2.7.1/INSTALL *** gcc-2.7.0/INSTALL Fri Jun 16 15:45:41 1995 --- gcc-2.7.1/INSTALL Mon Nov 6 10:21:10 1995 *************** *** 1,6 **** This file documents the installation of the GNU compiler. Copyright ! (C) 1988, 1989, 1992 Free Software Foundation, Inc. You may copy, ! distribute, and modify it freely as long as you preserve this copyright ! notice and permission notice. Installing GNU CC --- 1,6 ---- This file documents the installation of the GNU compiler. Copyright ! (C) 1988, 1989, 1992, 1994, 1995 Free Software Foundation, Inc. You ! may copy, distribute, and modify it freely as long as you preserve this ! copyright notice and permission notice. Installing GNU CC *************** *** 52,59 **** Here is an example: - from an MSDOS console window or from the program manager dialog - box. Configure.bat assumes that you have already installed and in - your path a Unix-like sed program which is used to modify - Makefile.in to create a working Makefile. ./configure --build=sparc-sun-sunos4.1 --- 52,55 ---- *************** *** 176,184 **** Normally you need not be concerned with these files. ! * A symbolic link named `config.h' is made to the top-level ! config file for the machine you plan to run the compiler on ! (*note The Configuration File: (gcc.info)Config.). This file ! is responsible for defining information about the host ! machine. It includes `tm.h'. The top-level config file is located in the subdirectory --- 172,180 ---- Normally you need not be concerned with these files. ! * A file named `config.h' is created that contains a `#include' ! of the top-level config file for the machine you will run the ! compiler on (*note The Configuration File: ! (gcc.info)Config.). This file is responsible for defining ! information about the host machine. It includes `tm.h'. The top-level config file is located in the subdirectory *************** *** 190,198 **** which refers to the appropriate file. ! * A symbolic link named `tconfig.h' is made to the top-level ! config file for your target machine. This is used for ! compiling certain programs to run on that machine. ! * A symbolic link named `tm.h' is made to the machine-description macro file for your target machine. It should be in the subdirectory `config' and its name is often --- 186,194 ---- which refers to the appropriate file. ! * A file named `tconfig.h' is created which includes the ! top-level config file for your target machine. This is used ! for compiling certain programs to run on that machine. ! * A file named `tm.h' is created which includes the machine-description macro file for your target machine. It should be in the subdirectory `config' and its name is often *************** *** 199,212 **** `MACHINE.h'. - * A symbolic link named `md' will be made to the machine - description pattern file. It should be in the `config' - subdirectory and its name should be `MACHINE.md'; but MACHINE - is often not the same as the name used in the `tm.h' file - because the `md' files are more general. - - * A symbolic link named `aux-output.c' will be made to the - output subroutine file for your machine. It should be in the - `config' subdirectory and its name should be `MACHINE.c'. - * The command file `configure' also constructs the file `Makefile' by adding some text to the template file --- 195,198 ---- *************** *** 279,283 **** other files. Likewise, you should ignore warnings about "constant is so large that it is unsigned" in `insn-emit.c' and ! `insn-recog.c'. Any other compilation errors may represent bugs in the port to your machine or operating system, and should be investigated and reported. --- 265,270 ---- other files. Likewise, you should ignore warnings about "constant is so large that it is unsigned" in `insn-emit.c' and ! `insn-recog.c' and a warning about a comparison always being zero ! in `enquire.o'. Any other compilation errors may represent bugs in the port to your machine or operating system, and should be investigated and reported. *************** *** 314,318 **** 12. Recompile the compiler with itself, with this command: ! make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O" This is called making the stage 2 compiler. --- 301,305 ---- 12. Recompile the compiler with itself, with this command: ! make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2" This is called making the stage 2 compiler. *************** *** 337,341 **** is no such hardware, do this instead: ! make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O -msoft-float" 13. If you wish to test the compiler by compiling it with itself one --- 324,328 ---- is no such hardware, do this instead: ! make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -msoft-float" 13. If you wish to test the compiler by compiling it with itself one *************** *** 368,377 **** On some systems, meaningful comparison of object files is impossible; they always appear "different." This is currently ! true on Solaris and probably on all systems that use ELF object ! file format. On some versions of Irix on SGI machines and OSF/1 ! on Alpha systems, you will not be able to compare the files ! without specifying `-save-temps'; see the description of ! individual systems above to see if you get comparison failures. ! You may have similar problems on other systems. Use this command to compare the files: --- 355,364 ---- On some systems, meaningful comparison of object files is impossible; they always appear "different." This is currently ! true on Solaris and some systems that use ELF object file format. ! On some versions of Irix on SGI machines and DEC Unix (OSF/1) on ! Alpha systems, you will not be able to compare the files without ! specifying `-save-temps'; see the description of individual ! systems above to see if you get comparison failures. You may have ! similar problems on other systems. Use this command to compare the files: *************** *** 395,404 **** MIPS machines, you will not be able to compare the files. ! 15. Build the Objective C library (if you have built the Objective C ! compiler). Here is the command to do this: ! ! make objc-runtime CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" ! ! 16. Install the compiler driver, the compiler's passes and run-time support with `make install'. Use the same value for `CC', `CFLAGS' and `LANGUAGES' that you used when compiling the files --- 382,386 ---- MIPS machines, you will not be able to compare the files. ! 15. Install the compiler driver, the compiler's passes and run-time support with `make install'. Use the same value for `CC', `CFLAGS' and `LANGUAGES' that you used when compiling the files *************** *** 439,448 **** some other compiler.) ! 17. Install the Objective C library (if you are installing the ! Objective C compiler). Here is the command to do this: ! ! make install-libobjc CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" ! ! 18. If you're going to use C++, it's likely that you need to also install the libg++ distribution. It should be available from the same place where you got the GNU C distribution. Just as GNU C --- 421,425 ---- some other compiler.) ! 16. If you're going to use C++, it's likely that you need to also install the libg++ distribution. It should be available from the same place where you got the GNU C distribution. Just as GNU C *************** *** 532,536 **** longer supports the Tektronix Assembler, but instead produces output for `as1750', an assembler/linker available under the GNU ! Public License for the 1750A. Contact *okellogg@salyko.cube.net* for more details on obtaining `as1750'. A similarly licensed simulator for the 1750A is available from same address. --- 509,513 ---- longer supports the Tektronix Assembler, but instead produces output for `as1750', an assembler/linker available under the GNU ! Public License for the 1750A. Contact *kellogg@space.otn.dasa.de* for more details on obtaining `as1750'. A similarly licensed simulator for the 1750A is available from same address. *************** *** 545,558 **** Compiler, namely: ! `NREL' The program code section. ! `SREL' The read/write (RAM) data section. ! `KREL' The read-only (ROM) constants section. ! `IREL' Initialization section (code to copy KREL to SREL). --- 522,535 ---- Compiler, namely: ! `Normal' The program code section. ! `Static' The read/write (RAM) data section. ! `Konst' The read-only (ROM) constants section. ! `Init' Initialization section (code to copy KREL to SREL). *************** *** 562,582 **** are not used by GNU CC. - There is a problem with long argument lists to functions. The - compiler aborts if the sum of space needed by all arguments - exceeds 14 words. This is because the arguments are passed in - registers (R0..R13) not on the stack, and there is a problem with - passing further arguments (i.e. beyond those in R0..R13) via the - stack. - - If efficiency is less important than using long argument lists, you - can change the definition of the `FUNCTION_ARG' macro in - `config/1750/1750a.h' to always return zero. If you do that, GNU - CC will pass all parameters on the stack. - `alpha-*-osf1' Systems using processors that implement the DEC Alpha architecture ! and are running the OSF/1 operating system, for example the DEC ! Alpha AXP systems. (VMS on the Alpha is not currently supported ! by GNU CC.) GNU CC writes a `.verstamp' directive to the assembler output file --- 539,547 ---- are not used by GNU CC. `alpha-*-osf1' Systems using processors that implement the DEC Alpha architecture ! and are running the DEC Unix (OSF/1) operating system, for example ! the DEC Alpha AXP systems. (VMS on the Alpha is not currently ! supported by GNU CC.) GNU CC writes a `.verstamp' directive to the assembler output file *************** *** 583,588 **** unless it is built as a cross-compiler. It gets the version to use from the system header file `/usr/include/stamp.h'. If you ! install a new version of OSF/1, you should rebuild GCC to pick up ! the new version stamp. Note that since the Alpha is a 64-bit architecture, --- 548,553 ---- unless it is built as a cross-compiler. It gets the version to use from the system header file `/usr/include/stamp.h'. If you ! install a new version of DEC Unix, you should rebuild GCC to pick ! up the new version stamp. Note that since the Alpha is a 64-bit architecture, *************** *** 595,599 **** not work properly. ! `make compare' may fail on old versions of OSF/1 unless you add `-save-temps' to `CFLAGS'. On these systems, the name of the assembler input file is stored in the object file, and that makes --- 560,564 ---- not work properly. ! `make compare' may fail on old versions of DEC Unix unless you add `-save-temps' to `CFLAGS'. On these systems, the name of the assembler input file is stored in the object file, and that makes *************** *** 757,762 **** `i386-*-linuxaout' Use this configuration to generate a.out binaries on Linux. This ! is an obsolete configuration. You must use gas/binutils version ! 2.5.2 or later. `i386-*-linux' --- 722,727 ---- `i386-*-linuxaout' Use this configuration to generate a.out binaries on Linux. This ! configuration is being superseded. You must use gas/binutils ! version 2.5.2 or later. `i386-*-linux' *************** *** 1156,1166 **** to AIX 3.2.4 include a version of the IBM assembler which does not accept debugging directives: assembler updates are available as ! PTFs. See the file `README.RS6000' for more details on both of ! these problems. ! Only AIX is supported on the PowerPC. GNU CC does not yet support ! the 64-bit PowerPC instructions. ! Objective C does not work on this architecture. AIX on the RS/6000 provides support (NLS) for environments outside --- 1121,1133 ---- to AIX 3.2.4 include a version of the IBM assembler which does not accept debugging directives: assembler updates are available as ! PTFs. Also, if you are using AIX 3.2.5 or greater and the GNU ! assembler, you must have a version modified after October 16th, ! 1995 in order for the GNU C compiler to build. See the file ! `README.RS6000' for more details on of these problems. ! GNU CC does not yet support the 64-bit PowerPC instructions. ! Objective C does not work on this architecture because it makes ! assumptions that are incompatible with the calling conventions. AIX on the RS/6000 provides support (NLS) for environments outside *************** *** 1173,1193 **** the LANG environment variable to "C" or "En_US". `powerpc-*-elf' `powerpc-*-sysv4' ! PowerPC system in big endian mode, running System V.4. This ! system is currently under development. `powerpc-*-eabi' ! Embedded PowerPC system in big endian mode. This system is ! currently under development. `powerpcle-*-elf' ! `powerpcle-*-eabi' ! PowerPC system in little endian mode, running System V.4. This ! system is currently under development. `powerpcle-*-sysv4' ! Embedded PowerPC system in little endian mode. This system is ! currently under development. `vax-dec-ultrix' --- 1140,1194 ---- the LANG environment variable to "C" or "En_US". + Due to changes in the way that GNU CC invokes the binder (linker) + for AIX 4.1, you may now receive warnings of duplicate symbols + from the link step that were not reported before. The assembly + files generated by GNU CC for AIX have always included multiple + symbol definitions for certain global variable and function + declarations in the original program. The warnings should not + prevent the linker from producing a correct library or runnable + executable. + `powerpc-*-elf' `powerpc-*-sysv4' ! PowerPC system in big endian mode, running System V.4. ! ! This configuration is currently under development. + `powerpc-*-eabiaix' + Embedded PowerPC system in big endian mode with -mcall-aix + selected as the default. This system is currently under + development. + + `powerpc-*-eabisim' + Embedded PowerPC system in big endian mode for use in running + under the PSIM simulator. This system is currently under + development. + `powerpc-*-eabi' ! Embedded PowerPC system in big endian mode. ! ! This configuration is currently under development. `powerpcle-*-elf' ! `powerpcle-*-sysv4' ! PowerPC system in little endian mode, running System V.4. ! ! This configuration is currently under development. `powerpcle-*-sysv4' ! Embedded PowerPC system in little endian mode. ! ! This system is currently under development. ! ! `powerpcle-*-eabisim' ! Embedded PowerPC system in little endian mode for use in running ! under the PSIM simulator. ! ! This system is currently under development. ! ! `powerpcle-*-eabi' ! Embedded PowerPC system in little endian mode. ! ! This configuration is currently under development. `vax-dec-ultrix' diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/Makefile.in gcc-2.7.1/Makefile.in *** gcc-2.7.0/Makefile.in Thu Jun 15 07:01:43 1995 --- gcc-2.7.1/Makefile.in Sat Nov 11 08:24:08 1995 *************** *** 103,106 **** --- 103,122 ---- INSTALL_HEADERS_DIR = install-headers-tar + # Header files that are made available under the same name + # to programs compiled with GCC. + USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \ + $(srcdir)/ginclude/varargs.h $(srcdir)/ginclude/va-alpha.h \ + $(srcdir)/ginclude/va-h8300.h $(srcdir)/ginclude/va-i860.h \ + $(srcdir)/ginclude/va-i960.h $(srcdir)/ginclude/va-mips.h \ + $(srcdir)/ginclude/va-m88k.h $(srcdir)/ginclude/va-pa.h \ + $(srcdir)/ginclude/va-pyr.h $(srcdir)/ginclude/va-sparc.h \ + $(srcdir)/ginclude/va-clipper.h $(srcdir)/ginclude/va-spur.h \ + $(srcdir)/ginclude/iso646.h $(srcdir)/ginclude/va-ppc.h \ + $(srcdir)/ginclude/proto.h $(EXTRA_HEADERS) + + # Target to use whe installing assert.h. Some systems may + # want to set this empty. + INSTALL_ASSERT_H = install-assert-h + # The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test. # Usually the one we just built. *************** *** 230,234 **** # we use this here because that should be enough, and also # so that -g1 will be tested. ! LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) -g1 # Additional options to use when compiling libgcc2.a. --- 246,250 ---- # we use this here because that should be enough, and also # so that -g1 will be tested. ! LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) -g1 # Additional options to use when compiling libgcc2.a. *************** *** 236,239 **** --- 252,258 ---- LIBGCC2_INCLUDES = + # Additional target-dependent options for compiling libgcc2.a. + TARGET_LIBGCC2_CFLAGS = + # Things which must be built before building libgcc2.a. # Some targets override this to stmp-int-hdrs *************** *** 263,266 **** --- 282,289 ---- EXTRA_OBJS = + # List of extra object files that should be compiled and linked with + # the gcc driver. + EXTRA_GCC_OBJS = + # List of additional header files to install. # Often this is edited directly by `configure'. *************** *** 515,519 **** stamp-flags stamp-config stamp-codes \ stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \ ! stamp-attr stamp-attrtab stamp-opinit stamp-proto \ genemit$(exeext) genoutput$(exeext) genrecog$(exeext) genextract$(exeext) \ genflags$(exeext) gencodes$(exeext) genconfig$(exeext) genpeep$(exeext) \ --- 538,542 ---- stamp-flags stamp-config stamp-codes \ stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \ ! stamp-attr stamp-attrtab stamp-opinit stamp-proto stamp-crt stamp-crtS \ genemit$(exeext) genoutput$(exeext) genrecog$(exeext) genextract$(exeext) \ genflags$(exeext) gencodes$(exeext) genconfig$(exeext) genpeep$(exeext) \ *************** *** 551,566 **** _pure - # Header files that are made available under the same name - # to programs compiled with GCC. - USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \ - $(srcdir)/ginclude/varargs.h $(srcdir)/ginclude/va-alpha.h \ - $(srcdir)/ginclude/va-h8300.h $(srcdir)/ginclude/va-i860.h \ - $(srcdir)/ginclude/va-i960.h $(srcdir)/ginclude/va-mips.h \ - $(srcdir)/ginclude/va-m88k.h $(srcdir)/ginclude/va-pa.h \ - $(srcdir)/ginclude/va-pyr.h $(srcdir)/ginclude/va-sparc.h \ - $(srcdir)/ginclude/va-clipper.h $(srcdir)/ginclude/va-spur.h \ - $(srcdir)/ginclude/iso646.h \ - $(srcdir)/ginclude/proto.h $(EXTRA_HEADERS) - # The files that "belong" in CONFIG_H are deliberately omitted # because having them there would not be useful in actual practice. --- 574,577 ---- *************** *** 668,676 **** # to avoid confusion if the current directory is in the path # and CC is `gcc'. It is renamed to `gcc' when it is installed. ! xgcc: gcc.o version.o $(LIBDEPS) ! $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o version.o $(LIBS) # Dump a specs file to make -B./ read these specs over installed ones. ! specs: xgcc$(exeext) $(GCC_FOR_TARGET) -dumpspecs > tmp-specs mv tmp-specs specs --- 679,687 ---- # to avoid confusion if the current directory is in the path # and CC is `gcc'. It is renamed to `gcc' when it is installed. ! xgcc: gcc.o version.o $(LIBDEPS) $(EXTRA_GCC_OBJS) ! $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o version.o $(EXTRA_GCC_OBJS) $(LIBS) # Dump a specs file to make -B./ read these specs over installed ones. ! specs: xgcc $(GCC_FOR_TARGET) -dumpspecs > tmp-specs mv tmp-specs specs *************** *** 690,693 **** --- 701,705 ---- # Copy float.h from its source. gfloat.h: $(FLOAT_H) + -rm -f gfloat.h cp $(FLOAT_H) gfloat.h *************** *** 778,782 **** do \ if [ x$${file} != x.. ]; then \ ! name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \ echo $${name}; \ if [ $${name}.asm = $${file} ]; then \ --- 790,794 ---- do \ if [ x$${file} != x.. ]; then \ ! name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \ echo $${name}; \ if [ $${name}.asm = $${file} ]; then \ *************** *** 876,880 **** do \ if [ x$${file} != x.. ]; then \ ! name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \ oname=` echo $${name} | sed -e 's,.*/,,'`; \ echo $${name}; \ --- 888,892 ---- do \ if [ x$${file} != x.. ]; then \ ! name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \ oname=` echo $${name} | sed -e 's,.*/,,'`; \ echo $${name}; \ *************** *** 967,971 **** fi (cd tmpcopy; $(AR) x ../$(LIBGCC2)) ! (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o) rm -rf libgcc2.a tmpcopy if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi --- 979,983 ---- fi (cd tmpcopy; $(AR) x ../$(LIBGCC2)) ! (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *$(objext)) rm -rf libgcc2.a tmpcopy if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi *************** *** 1000,1015 **** # Compile two additional files that are linked with every program ! # linked using GCC on system V, for the sake of C++ constructors. ! crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \ -DCRT_BEGIN -finhibit-size-directive -fno-inline-functions \ -g0 -c $(srcdir)/crtstuff.c ! mv crtstuff$(objext) $@ ! ! crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \ -DCRT_END -finhibit-size-directive -fno-inline-functions \ -g0 -c $(srcdir)/crtstuff.c ! mv crtstuff$(objext) $@ # Compiling object files from source files. --- 1012,1045 ---- # Compile two additional files that are linked with every program ! # linked using GCC on systems using COFF or ELF, for the sake of C++ ! # constructors. ! crtbegin.o: stamp-crt ; @true ! crtend.o: stamp-crt; @true ! ! stamp-crt: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \ -DCRT_BEGIN -finhibit-size-directive -fno-inline-functions \ -g0 -c $(srcdir)/crtstuff.c ! mv crtstuff$(objext) crtbegin$(objext) $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \ -DCRT_END -finhibit-size-directive -fno-inline-functions \ -g0 -c $(srcdir)/crtstuff.c ! mv crtstuff$(objext) crtend$(objext) ! touch stamp-crt ! ! # On some systems we also want to install versions of these files ! # compiled using PIC for use in shared libraries. ! crtbeginS.o crtendS.o: stamp-crtS ; @true ! ! stamp-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h ! $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \ ! -DCRT_BEGIN -finhibit-size-directive -fno-inline-functions \ ! -g0 -c $(srcdir)/crtstuff.c -fPIC ! mv crtstuff$(objext) crtbeginS$(objext) ! $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \ ! -DCRT_END -finhibit-size-directive -fno-inline-functions \ ! -g0 -c $(srcdir)/crtstuff.c -fPIC ! mv crtstuff$(objext) crtendS$(objext) ! touch stamp-crtS # Compiling object files from source files. *************** *** 1066,1070 **** cplus-dem.o: cplus-dem.c demangle.h ! underscore.c: $(GCC_PASSES) echo "int xxy_us_dummy;" >tmp-dum.c $(GCC_FOR_TARGET) -S tmp-dum.c --- 1096,1102 ---- cplus-dem.o: cplus-dem.c demangle.h ! underscore.c: stamp-under ; @true ! ! stamp-under: $(GCC_PASSES) echo "int xxy_us_dummy;" >tmp-dum.c $(GCC_FOR_TARGET) -S tmp-dum.c *************** *** 1077,1080 **** --- 1109,1113 ---- $(srcdir)/move-if-change tmp-under.c underscore.c -rm -f tmp-dum.c tmp-dum.s + touch stamp-under # Objective C language specific files. *************** *** 1194,1204 **** basic-block.h regs.h hard-reg-set.h insn-config.h output.h ! reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \ reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h ! reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h expr.h \ reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \ basic-block.h recog.h output.h caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \ ! regs.h hard-reg-set.h insn-config.h basic-block.h recog.h reload.h expr.h reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \ basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \ --- 1227,1238 ---- basic-block.h regs.h hard-reg-set.h insn-config.h output.h ! reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h output.h \ reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h ! reload1.o : reload1.c $(CONFIG_H) $(RTL_H) real.h flags.h expr.h \ reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \ basic-block.h recog.h output.h caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \ ! regs.h hard-reg-set.h insn-codes.h insn-config.h basic-block.h recog.h \ ! reload.h expr.h reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \ basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \ *************** *** 1215,1219 **** regs.h hard-reg-set.h flags.h insn-config.h ! $(out_object_file): $(out_file) $(CONFIG_H) \ $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \ insn-flags.h output.h insn-attr.h insn-codes.h --- 1249,1253 ---- regs.h hard-reg-set.h flags.h insn-config.h ! $(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) \ $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \ insn-flags.h output.h insn-attr.h insn-codes.h *************** *** 1702,1710 **** objdir=`pwd`; \ cd $(srcdir); \ ! for file in $(USER_H); do \ ! realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ ! rm -f $$objdir/include/$$realfile; \ ! cp ginclude/$$realfile $$objdir/include; \ ! chmod a+r $$objdir/include/$$realfile; \ done rm -f include/limits.h --- 1736,1746 ---- objdir=`pwd`; \ cd $(srcdir); \ ! for file in .. $(USER_H); do \ ! if [ X$$file != X.. ]; then \ ! realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ ! rm -f $$objdir/include/$$realfile; \ ! cp ginclude/$$realfile $$objdir/include; \ ! chmod a+r $$objdir/include/$$realfile; \ ! fi; \ done rm -f include/limits.h *************** *** 1917,1921 **** # but what better way is there? -rm -f libgcc.a libgcc1.a libgcc1-asm.a libgcc2.a libgcc2.ready ! -rm -f libgcc1.null $(LIB2FUNCS_EXTRA) -rm -f *.dvi -rm -f */*.dvi --- 1953,1957 ---- # but what better way is there? -rm -f libgcc.a libgcc1.a libgcc1-asm.a libgcc2.a libgcc2.ready ! -rm -f libgcc1.null -rm -f *.dvi -rm -f */*.dvi *************** *** 2144,2148 **** # Install all the header files built in the include subdirectory. ! install-headers: install-include-dir $(INSTALL_HEADERS_DIR) install-assert-h # Fix symlinks to absolute paths in the installed include directory to # point to the installed directory, not the build directory. --- 2180,2184 ---- # Install all the header files built in the include subdirectory. ! install-headers: install-include-dir $(INSTALL_HEADERS_DIR) $(INSTALL_ASSERT_H) # Fix symlinks to absolute paths in the installed include directory to # point to the installed directory, not the build directory. *************** *** 2391,2395 **** for dir in tmp-foo $(SUBDIRS); do \ if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \ ! for file in $$dir/*.o; do \ cmp --ignore-initial=16 $$file stage2/$$file || true ; \ done; \ --- 2427,2431 ---- for dir in tmp-foo $(SUBDIRS); do \ if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \ ! for file in $$dir/*$(objext); do \ cmp --ignore-initial=16 $$file stage2/$$file || true ; \ done; \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/NEWS gcc-2.7.1/NEWS *** gcc-2.7.0/NEWS Fri Jun 16 09:02:06 1995 --- gcc-2.7.1/NEWS Tue Nov 7 10:14:12 1995 *************** *** 1,2 **** --- 1,27 ---- + Noteworthy changes in GCC version 2.7.1: + + This release fixes numerous bugs (mostly minor) in GCC 2.7.0, but + also contains a few new features, mostly related to specific targets. + + Major changes have been made in code to support Windows NT. + + The following new targets are supported: + + 2.9 BSD on PDP-11 + Linux on m68k + HP/UX version 10 on HP PA RISC (treated like version 9) + DEC Alpha running Windows NT + + When parsing C, GCC now recognizes C++ style `//' comments unless you + specify `-ansi' or `-traditional'. + + The PowerPC System V targets (powerpc-*-sysv, powerpc-*-eabi) now use the + calling sequence specified in the System V Application Binary Interface + Processor Supplement (PowerPC Processor ABI Supplement) rather than the calling + sequence used in GCC version 2.7.0. That calling sequence was based on the AIX + calling sequence without function descriptors. To compile code for that older + calling sequence, either configure the compiler for powerpc-*-eabiaix or use + the -mcall-aix switch when compiling and linking. + Noteworthy changes in GCC version 2.7.0: diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/ORDERS gcc-2.7.1/ORDERS *** gcc-2.7.0/ORDERS Fri Jun 16 18:14:00 1995 --- gcc-2.7.1/ORDERS Thu Nov 9 11:28:46 1995 *************** *** 3604,3614 **** of ten. - One copy each of the following five older CD-ROMs: - - ____ @ $200 = $ ______ for corporations and other organizations. - - ____ @ $ 50 = $ ______ for individuals. - - Please fill in the number of each older CD-ROM you order: --- 3604,3607 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/README gcc-2.7.1/README *** gcc-2.7.0/README Thu Jun 15 18:10:48 1995 --- gcc-2.7.1/README Thu Nov 9 11:27:23 1995 *************** *** 1,3 **** ! This directory contains the version 2.7.0 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.7.1 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 c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/README.DWARF gcc-2.7.1/README.DWARF *** gcc-2.7.0/README.DWARF Mon May 15 23:11:17 1995 --- gcc-2.7.1/README.DWARF Mon Aug 28 06:15:04 1995 *************** *** 450,454 **** that the issues involved in supporting a "traceback only" subset of DWARF were not well understood. Second, and perhaps more importantly, the PLSIG ! is already having enough trouble agreeing on what it means to be "conformant" to the DWARF specification, and it was felt that trying to specify multiple different *levels* of conformance would only complicate our discussions of --- 450,454 ---- that the issues involved in supporting a "traceback only" subset of DWARF were not well understood. Second, and perhaps more importantly, the PLSIG ! is already having enough trouble agreeing on what it means to be "conforming" to the DWARF specification, and it was felt that trying to specify multiple different *levels* of conformance would only complicate our discussions of diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/README.FRESCO gcc-2.7.1/README.FRESCO *** gcc-2.7.0/README.FRESCO Tue Jun 6 18:46:35 1995 --- gcc-2.7.1/README.FRESCO Mon Aug 28 06:15:06 1995 *************** *** 6,10 **** with x11r6. ! Prevous version of Fresco have not compiled using g++, partly because of the use of true and false as identifiers. (They are now reserved words in g++, as required by the --- 6,10 ---- with x11r6. ! Previous versions of Fresco have not compiled using g++, partly because of the use of true and false as identifiers. (They are now reserved words in g++, as required by the diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/README.RS6000 gcc-2.7.1/README.RS6000 *** gcc-2.7.0/README.RS6000 Tue Nov 22 16:07:34 1994 --- gcc-2.7.1/README.RS6000 Sat Nov 4 10:28:12 1995 *************** *** 39,43 **** --- 39,49 ---- for AIX/6000 and ask for the APAR fix. + If you use the GNU assembler instead of the system supplied assembler, you need + an assembler modified after October 16th, 1995 in order to build the GNU C + compiler. This is because the GNU C compiler wants to build a variant of its + library, libgcc.a with the -mcpu=common switch to support building programs + that can run on either the Power or PowerPC machines. + AIX NLS problems *************** *** 94,95 **** --- 100,111 ---- and then link with -Wl,-bI:milli.exp. + + + AIX 4.1 binder + + Due to changes in the way that GCC invokes the binder (linker) for AIX 4.1, + the link step now may produce warnings of duplicate symbols which were not + reported before. The assembly files generated by GCC for AIX always have + included multiple symbol definitions for certain global variable and + function declarations in the original program. The warnings should not + prevent the linker from producing a correct library or runnable executable. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/SERVICE gcc-2.7.1/SERVICE *** gcc-2.7.0/SERVICE Thu Jun 15 18:11:00 1995 --- gcc-2.7.1/SERVICE Thu Nov 9 11:28:51 1995 *************** *** 41,54 ****  ! Joseph Arceneaux ! PO Box 460633 San Francisco, CA 94146-0633 +1 415 285 9088 ! Former FSF staffmember. Performed X11 implementation of Emacs version ! 19 and worked on WYSIWYG Emacs. Installed and administered FSF ! network. Maintainer of GNU indent. Over 10 years experience with Unix ! systems, from writing ROM monitors to UI design and system administration. I provide installation, porting, debugging and customization or development of GNU and other Unix software. I also design and --- 41,59 ----  ! Joseph Arceneaux ! PO Box 460633 http://www.samsara.com/~jla San Francisco, CA 94146-0633 + +1 415 648 9988 +1 415 285 9088 ! Recently led the project making Wells Fargo Bank the first to provide ! secure customer account access over the Internet. + Former FSF staffmember. Performed X11 implementation of Emacs version + 19, designed and implemented WYSIWYG Emacs. Installed and + administered FSF network. Maintainer of GNU indent. Over 15 years + experience with Unix and other systems, from writing ROM monitors to + UI design and system administration. + I provide installation, porting, debugging and customization or development of GNU and other Unix software. I also design and *************** *** 57,65 **** available as well as things like LAN and compute--infrastructure design. ! Rates are upwards of $70 USD per hour, depending upon the particular ! job. I am also very interested in fixed-bid jobs. For selected ! non-profit organizations with worthy goals, I work for free. ! Updated: 5Apr94  Gerd Aschemann --- 62,70 ---- available as well as things like LAN and compute--infrastructure design. ! Time and material rates around $150 USD per hour, depending upon the ! particular job. I am also very interested in fixed-bid jobs. For ! selected non-profit organizations with worthy goals, I work for free. ! Updated: 17Oct95  Gerd Aschemann *************** *** 93,99 ****  James Craig Burley ! 4 Mountain Gate Rd. ! Ashland, MA 01721-2326 508 881-6087, -4745 Email: --preferred-- --- 98,107 ----  James Craig Burley ! 97 Arrowhead Circle ! Ashland, MA 01721-1987 508 881-6087, -4745 + (Please call only between 0900-1700 Eastern time, and only if you + are prepared to hire me -- ask me to help you for free only + via email, to which I might or might not respond.) Email: --preferred-- *************** *** 102,106 **** Expertise: Compiler Internals (author of GNU Fortran, for example) ! Operating Systems Internals (lately Linux on the ix86) Tools/Utilities Development and Maintenance Microcode Development and Maintenance (primarily VLIW machines) --- 110,114 ---- Expertise: Compiler Internals (author of GNU Fortran, for example) ! Operating Systems Internals Tools/Utilities Development and Maintenance Microcode Development and Maintenance (primarily VLIW machines) *************** *** 111,118 **** languages, and so on ! Rate: $75/hour, though somewhat volatile due to commitments regarding ! GNU Fortran -- willing to consider flat-fee arrangements ! Entered: 5Apr94  Michael I. Bushnell --- 119,125 ---- languages, and so on ! Rate: $70/hour -- willing to consider flat-fee arrangements ! Updated: 14Aug95  Michael I. Bushnell *************** *** 260,289 **** Entered: 14Apr94  ! Noah Friedman ! Building 600, Suite 214 ! One Kendall Square ! Cambridge, MA 02139 ! +1 617 876 3296 - Co-maintainer of GNU texinfo and GNU autoconf. Author of several - Emacs Lisp packages and parts of Emacs 19, as well as numerous - utilities written in shell script and perl. System administrator for - a small network of heterogenous machines. FSF employee spring 1991 to - the present. - - Installation, porting, and enhancement of all GNU software and other free - software; "auto-configuration" a specialty. System administration - for most unix-like systems. Willing to teach shell programming and - Emacs Lisp. ! Fees negotiable. I can work in the Boston area or anywhere on the ! Internet. For larger jobs I may be willing to travel. ! Updated: 5Apr94 !  ! Ron Guilmette ! 396 Ano Nuevo Ave. #216 ! Sunnyvale, CA 94086 ! 408-732-7839 Services: Development & porting of GNU software development tools. --- 267,299 ---- Entered: 14Apr94  ! Noah Friedman ! Building 600, Suite 214 2002-A Guadalupe St. #214 ! One Kendall Square Austin, TX 78705 ! Cambridge, MA 02139 (Local, faster to reach me) ! (Permanent) ! Author of several Emacs Lisp packages and parts of Emacs 19, as well as ! numerous utilities written in shell script and perl. Co-maintained GNU ! Texinfo and Autoconf for a couple of years. System administrator for a ! network of heterogenous machines. FSF employee Feb 1991--Sep 1994. ! ! I can perform installation, porting, and enhancement of all GNU software ! and any other free software; system administration for unix-type systems ! and ethernet networks; and I am willing to teach shell programming and ! Emacs Lisp. ! Fees negotiable, averaging $60-$75/hour. I can work in the Austin, TX area ! or anywhere accessible on the Internet. For larger jobs I may be willing ! to travel. ! ! Updated: 16Aug95 !  ! Ronald F. Guilmette ! Infinite Monkeys & Co. ! 1751 East Roseville Pkwy. #1828 ! Roseville, CA 95661 ! Tel: +1 916 786 7945 ! FAX: +1 916 786 5311 Services: Development & porting of GNU software development tools. *************** *** 302,309 **** processor. ! Experience: 11+ years UNIX systems experience, all working on compilers and related tools. ! 5+ years working professionally on GCC, G++, and GDB under contract to various firms including the Microelectronics and Computer Technology Corporation (MCC), Data General (DG), --- 312,319 ---- processor. ! Experience: 13+ years UNIX systems experience, all working on compilers and related tools. ! 7+ years working professionally on GCC, G++, and GDB under contract to various firms including the Microelectronics and Computer Technology Corporation (MCC), Data General (DG), *************** *** 317,326 **** Languages Special Interest Group (UI/PLSIG). ! Bachelor's and a Master's degree, both in ! Computer Science. Rates: Variable depending upon contract duration. Call for quote. ! Updated: 13Apr94  Hundred Acre Consulting --- 327,335 ---- Languages Special Interest Group (UI/PLSIG). ! Bachelor's and a Master's degrees, both in Computer Science. Rates: Variable depending upon contract duration. Call for quote. ! Updated: 23Sep95  Hundred Acre Consulting *************** *** 799,802 **** --- 808,830 ---- Updated: 27Sep94. +  + Herb Wood + phone: 1-415-789-7173 + email: + + I'm a better "planner" than I am a hacker. A really good hacker will be able + to keep many pieces of information in their short-term memory and to memorize + new pieces of information at a fast rate. This is not my strong point. + Rather, I excel in domains that require knowledge of the slightly more + theoretical parts of computer science --for example, logic, formal methods of + program development, and functional programming. I can write, and I have + "tutoring" (teaching one-on-one) experience, an, unlike some programmers, + I enjoy doing these things. + + I have spend a lot of time looking at the Emacs Lisp sources and customizing + Emacs and VM. I think I can customize Emacs and its packages quickly and + effectively. + + Entered: 30Jul95  Yggdrasil Computing, Inc./ Freesoft, Inc. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/assert.h gcc-2.7.1/assert.h *** gcc-2.7.0/assert.h Tue Apr 13 14:04:33 1993 --- gcc-2.7.1/assert.h Sat Aug 19 16:42:23 1995 *************** *** 24,31 **** #ifdef __cplusplus extern "C" { ! extern void __eprintf (const char *, const char *, unsigned, const char *); } #else ! extern void __eprintf (const char *, const char *, unsigned, const char *); #endif --- 24,33 ---- #ifdef __cplusplus extern "C" { ! extern void __eprintf (const char *, const char *, unsigned, const char *) ! __attribute__ ((noreturn)); } #else ! extern void __eprintf (const char *, const char *, unsigned, const char *) ! __attribute__ ((noreturn)); #endif *************** *** 39,43 **** #else /* no __STDC__ and not C++; i.e. -traditional. */ ! extern void __eprintf (); /* Defined in libgcc.a */ #define assert(expression) \ --- 41,45 ---- #else /* no __STDC__ and not C++; i.e. -traditional. */ ! extern void __eprintf () __attribute__ ((noreturn)); /* Defined in libgcc.a */ #define assert(expression) \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/bi-lexer.c gcc-2.7.1/bi-lexer.c *** gcc-2.7.0/bi-lexer.c Thu Jun 15 07:06:42 1995 --- gcc-2.7.1/bi-lexer.c Mon Aug 28 06:55:57 1995 *************** *** 1,4 **** /* Lexer for scanner of bytecode definition file. ! Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Lexer for scanner of bytecode definition file. ! Copyright (C) 1993, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 22,29 **** #include "hconfig.h" #include "bi-parser.h" - - /* Current read buffer and point */ - static char *buffer = NULL; - static char *inpoint = NULL; --- 22,25 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/c-aux-info.c gcc-2.7.1/c-aux-info.c *** gcc-2.7.0/c-aux-info.c Thu Jun 15 07:08:56 1995 --- gcc-2.7.1/c-aux-info.c Fri Sep 22 18:36:27 1995 *************** *** 493,496 **** --- 493,500 ---- break; + case ERROR_MARK: + data_type = "[ERROR]"; + break; + default: abort (); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/c-common.c gcc-2.7.1/c-common.c *** gcc-2.7.0/c-common.c Thu Jun 15 07:09:23 1995 --- gcc-2.7.1/c-common.c Thu Oct 19 19:18:29 1995 *************** *** 329,333 **** { case A_PACKED: ! if (decl == 0) TYPE_PACKED (type) = 1; else if (TREE_CODE (decl) == FIELD_DECL) --- 329,333 ---- { case A_PACKED: ! if (is_type) TYPE_PACKED (type) = 1; else if (TREE_CODE (decl) == FIELD_DECL) *************** *** 381,392 **** case A_T_UNION: ! if (decl != 0 && TREE_CODE (decl) == PARM_DECL && TREE_CODE (type) == UNION_TYPE ! && TYPE_MODE (type) == DECL_MODE (TYPE_FIELDS (type))) ! DECL_TRANSPARENT_UNION (decl) = 1; ! else if (is_type && TREE_CODE (type) == UNION_TYPE && TYPE_MODE (type) == DECL_MODE (TYPE_FIELDS (type))) ! TYPE_TRANSPARENT_UNION (type) = 1; else warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); --- 381,393 ---- case A_T_UNION: ! if (is_type && TREE_CODE (type) == UNION_TYPE ! && (decl == 0 ! || TYPE_MODE (type) == DECL_MODE (TYPE_FIELDS (type)))) ! TYPE_TRANSPARENT_UNION (type) = 1; ! else if (decl != 0 && TREE_CODE (decl) == PARM_DECL && TREE_CODE (type) == UNION_TYPE && TYPE_MODE (type) == DECL_MODE (TYPE_FIELDS (type))) ! DECL_TRANSPARENT_UNION (decl) = 1; else warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); *************** *** 397,401 **** && TREE_CODE (type) == FUNCTION_TYPE && decl_function_context (decl) == 0) ! DECL_STATIC_CONSTRUCTOR (decl) = 1; else warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); --- 398,405 ---- && TREE_CODE (type) == FUNCTION_TYPE && decl_function_context (decl) == 0) ! { ! DECL_STATIC_CONSTRUCTOR (decl) = 1; ! TREE_USED (decl) = 1; ! } else warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); *************** *** 406,410 **** && TREE_CODE (type) == FUNCTION_TYPE && decl_function_context (decl) == 0) ! DECL_STATIC_DESTRUCTOR (decl) = 1; else warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); --- 410,417 ---- && TREE_CODE (type) == FUNCTION_TYPE && decl_function_context (decl) == 0) ! { ! DECL_STATIC_DESTRUCTOR (decl) = 1; ! TREE_USED (decl) = 1; ! } else warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); *************** *** 511,515 **** error ("requested alignment is not a power of 2"); else if (is_type) ! TYPE_ALIGN (TREE_TYPE (decl)) = align; else if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FIELD_DECL) --- 518,522 ---- error ("requested alignment is not a power of 2"); else if (is_type) ! TYPE_ALIGN (type) = align; else if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FIELD_DECL) *************** *** 868,872 **** while (TREE_CODE (format_tree) == NOP_EXPR) format_tree = TREE_OPERAND (format_tree, 0); /* strip coercion */ ! if (format_tree == null_pointer_node) { warning ("null format string"); --- 875,879 ---- while (TREE_CODE (format_tree) == NOP_EXPR) format_tree = TREE_OPERAND (format_tree, 0); /* strip coercion */ ! if (integer_zerop (format_tree)) { warning ("null format string"); *************** *** 1218,1226 **** continue; } ! sprintf (message, ! "format argument is not a %s (arg %d)", ! ((fci->pointer_count == 1) ? "pointer" : "pointer to a pointer"), ! arg_num); ! warning (message); break; } --- 1225,1236 ---- continue; } ! if (TREE_CODE (cur_type) != ERROR_MARK) ! { ! sprintf (message, ! "format argument is not a %s (arg %d)", ! ((fci->pointer_count == 1) ? "pointer" : "pointer to a pointer"), ! arg_num); ! warning (message); ! } break; } *************** *** 1228,1231 **** --- 1238,1242 ---- /* Check the type of the "real" argument, if there's a type we want. */ if (i == fci->pointer_count && wanted_type != 0 + && TREE_CODE (cur_type) != ERROR_MARK && wanted_type != TYPE_MAIN_VARIANT (cur_type) /* If we want `void *', allow any pointer type. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/c-decl.c gcc-2.7.1/c-decl.c *** gcc-2.7.0/c-decl.c Thu Jun 15 07:10:15 1995 --- gcc-2.7.1/c-decl.c Fri Oct 27 05:44:43 1995 *************** *** 1901,1904 **** --- 1901,1905 ---- char *file; int line; + int declared_global; /* Don't type check externs here when -traditional. This is so that *************** *** 1922,1925 **** --- 1923,1929 ---- } + /* duplicate_decls might write to TREE_PUBLIC (x) and DECL_EXTERNAL (x) + to make it identical to the initial declaration. */ + declared_global = TREE_PUBLIC (x) || DECL_EXTERNAL (x); if (t != 0 && duplicate_decls (x, t)) { *************** *** 1935,1939 **** --- 1939,1946 ---- since traditional compilers don't complain. */ if (!flag_traditional && TREE_PUBLIC (name) + + /* should this be '&& ! declared_global' ? */ && ! TREE_PUBLIC (x) && ! DECL_EXTERNAL (x) + /* We used to warn also for explicit extern followed by static, but sometimes you need to do it that way. */ *************** *** 1950,1954 **** decl in a parent block, then we can't return as yet, because we need to register this decl in the current binding block. */ ! if (! TREE_PUBLIC (x) || lookup_name (name) == t) return t; } --- 1957,1963 ---- decl in a parent block, then we can't return as yet, because we need to register this decl in the current binding block. */ ! /* A test for TREE_PUBLIC (x) will fail for variables that have ! been declared static first, and extern now. */ ! if (! declared_global || lookup_name (name) == t) return t; } *************** *** 2386,2389 **** --- 2395,2407 ---- if (flag_traditional && TREE_TYPE (newdecl) == TREE_TYPE (olddecl)) return 0; + /* pushdecl creates distinct types for TYPE_DECLs by calling + build_type_copy, so the above comparison generally fails. We do + another test against the TYPE_MAIN_VARIANT of the olddecl, which + is equivalent to what this code used to do before the build_type_copy + call. The variant type distinction should not matter for traditional + code, because it doesn't have type qualifiers. */ + if (flag_traditional + && TYPE_MAIN_VARIANT (TREE_TYPE (olddecl)) == TREE_TYPE (newdecl)) + return 0; if (DECL_IN_SYSTEM_HEADER (olddecl) || DECL_IN_SYSTEM_HEADER (newdecl)) return 0; *************** *** 5384,5388 **** tree *x, *y; { ! return (long)DECL_NAME (*x) - (long)DECL_NAME (*y); } --- 5402,5414 ---- tree *x, *y; { ! if (DECL_NAME (*x) == DECL_NAME (*y)) ! return 0; ! if (DECL_NAME (*x) == NULL) ! return -1; ! if (DECL_NAME (*y) == NULL) ! return 1; ! if (DECL_NAME (*x) < DECL_NAME (*y)) ! return -1; ! return 1; } *************** *** 5670,5673 **** --- 5696,5709 ---- TREE_TYPE (x) = integer_type_node; } + + /* If this was supposed to be a transparent union, but we can't + make it one, warn and turn off the flag. */ + if (TREE_CODE (t) == UNION_TYPE + && TYPE_TRANSPARENT_UNION (t) + && TYPE_MODE (t) != DECL_MODE (TYPE_FIELDS (t))) + { + TYPE_TRANSPARENT_UNION (t) = 0; + warning ("cannot make `%s' a transparent union"); + } /* If this structure or union completes the type of any previous diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/c-lang.c gcc-2.7.1/c-lang.c *** gcc-2.7.0/c-lang.c Thu Jun 15 07:11:15 1995 --- gcc-2.7.1/c-lang.c Mon Jul 10 19:47:02 1995 *************** *** 165,169 **** build_parse_node (CALL_EXPR, fnname, void_list_node, NULL_TREE), ! NULL_TREE, 0); fnname = DECL_ASSEMBLER_NAME (current_function_decl); store_parm_decls (); --- 165,169 ---- build_parse_node (CALL_EXPR, fnname, void_list_node, NULL_TREE), ! NULL_TREE, NULL_TREE, 0); fnname = DECL_ASSEMBLER_NAME (current_function_decl); store_parm_decls (); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/c-parse.in gcc-2.7.1/c-parse.in *** gcc-2.7.0/c-parse.in Thu Jun 15 07:12:47 1995 --- gcc-2.7.1/c-parse.in Fri Sep 22 19:08:07 1995 *************** *** 104,108 **** %union {long itype; tree ttype; enum tree_code code; ! char *filename; int lineno; } /* All identifiers that are not reserved words --- 104,108 ---- %union {long itype; tree ttype; enum tree_code code; ! char *filename; int lineno; int ends_in_label; } /* All identifiers that are not reserved words *************** *** 211,214 **** --- 211,216 ---- %type setspecs + %type lineno_stmt_or_label lineno_stmt_or_labels stmt_or_label + %type save_filename %type save_lineno *************** *** 1489,1493 **** enumerator | enumlist ',' enumerator ! { $$ = chainon ($3, $1); } | error { $$ = error_mark_node; } --- 1491,1498 ---- enumerator | enumlist ',' enumerator ! { if ($1 == error_mark_node) ! $$ = $1; ! else ! $$ = chainon ($3, $1); } | error { $$ = error_mark_node; } *************** *** 1558,1564 **** stmts: lineno_stmt_or_label ! | stmts lineno_stmt_or_label ! | stmts errstmt ; --- 1563,1579 ---- stmts: + lineno_stmt_or_labels + { + if (pedantic && $1) + pedwarn ("ANSI C forbids label at end of compound statement"); + } + ; + + lineno_stmt_or_labels: lineno_stmt_or_label ! | lineno_stmt_or_labels lineno_stmt_or_label ! { $$ = $2; } ! | lineno_stmt_or_labels errstmt ! { $$ = 0; } ; *************** *** 1700,1704 **** lineno_stmt_or_label: save_filename save_lineno stmt_or_label ! { } ; --- 1715,1719 ---- lineno_stmt_or_label: save_filename save_lineno stmt_or_label ! { $$ = $3; } ; *************** *** 1705,1716 **** stmt_or_label: stmt | label ! { int next; ! position_after_white_space (); ! next = getc (finput); ! ungetc (next, finput); ! if (pedantic && next == '}') ! pedwarn ("ANSI C forbids label at end of compound statement"); ! } ; --- 1720,1726 ---- stmt_or_label: stmt + { $$ = 0; } | label ! { $$ = 1; } ; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/c-typeck.c gcc-2.7.1/c-typeck.c *** gcc-2.7.0/c-typeck.c Thu Jun 15 07:14:17 1995 --- gcc-2.7.1/c-typeck.c Wed Oct 18 17:54:55 1995 *************** *** 760,763 **** --- 760,771 ---- if (type1 == long_long_integer_type_node) return long_long_unsigned_type_node; + if (type1 == intDI_type_node) + return unsigned_intDI_type_node; + if (type1 == intSI_type_node) + return unsigned_intSI_type_node; + if (type1 == intHI_type_node) + return unsigned_intHI_type_node; + if (type1 == intQI_type_node) + return unsigned_intQI_type_node; return type; } *************** *** 780,783 **** --- 788,799 ---- if (type1 == long_long_unsigned_type_node) return long_long_integer_type_node; + if (type1 == unsigned_intDI_type_node) + return intDI_type_node; + if (type1 == unsigned_intSI_type_node) + return intSI_type_node; + if (type1 == unsigned_intHI_type_node) + return intHI_type_node; + if (type1 == unsigned_intQI_type_node) + return intQI_type_node; return type; } *************** *** 1139,1144 **** while (top - bot > 1) { - HOST_WIDE_INT cmp; - half = (top - bot + 1) >> 1; field = field_array[bot+half]; --- 1155,1158 ---- *************** *** 1168,1175 **** } ! cmp = (HOST_WIDE_INT) DECL_NAME (field) - (HOST_WIDE_INT) component; ! if (cmp == 0) break; ! if (cmp < 0) bot += half; else --- 1182,1188 ---- } ! if (DECL_NAME (field) == component) break; ! if (DECL_NAME (field) < component) bot += half; else *************** *** 1811,1814 **** --- 1824,1830 ---- || code2 == PLUS_EXPR || code2 == MINUS_EXPR) warning ("suggest parentheses around arithmetic in operand of |"); + /* Check cases like x|y==z */ + if (TREE_CODE_CLASS (code1) == '<' || TREE_CODE_CLASS (code2) == '<') + warning ("suggest parentheses around comparison in operand of |"); } *************** *** 1820,1823 **** --- 1836,1842 ---- || code2 == PLUS_EXPR || code2 == MINUS_EXPR) warning ("suggest parentheses around arithmetic in operand of ^"); + /* Check cases like x^y==z */ + if (TREE_CODE_CLASS (code1) == '<' || TREE_CODE_CLASS (code2) == '<') + warning ("suggest parentheses around comparison in operand of ^"); } *************** *** 1827,1830 **** --- 1846,1852 ---- || code2 == PLUS_EXPR || code2 == MINUS_EXPR) warning ("suggest parentheses around + or - in operand of &"); + /* Check cases like x&y==z */ + if (TREE_CODE_CLASS (code1) == '<' || TREE_CODE_CLASS (code2) == '<') + warning ("suggest parentheses around comparison in operand of &"); } } *************** *** 2636,2640 **** /* If the constant comes from pointer subtraction, skip this optimization--it would cause an error. */ ! && TREE_CODE (TREE_TYPE (TREE_OPERAND (intop, 0))) == INTEGER_TYPE) { enum tree_code subcode = resultcode; --- 2658,2668 ---- /* If the constant comes from pointer subtraction, skip this optimization--it would cause an error. */ ! && TREE_CODE (TREE_TYPE (TREE_OPERAND (intop, 0))) == INTEGER_TYPE ! /* If the constant is unsigned, and smaller than the pointer size, ! then we must skip this optimization. This is because it could cause ! an overflow error if the constant is negative but INTOP is not. */ ! && (! TREE_UNSIGNED (TREE_TYPE (intop)) ! || (TYPE_PRECISION (TREE_TYPE (intop)) ! == TYPE_PRECISION (TREE_TYPE (ptrop))))) { enum tree_code subcode = resultcode; *************** *** 4876,4880 **** if (flag_traditional) { ! tree top = 0, prev = 0; while (TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == ARRAY_TYPE --- 4904,4908 ---- if (flag_traditional) { ! tree top = 0, prev = 0, otype = type; while (TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == ARRAY_TYPE *************** *** 4898,4906 **** } } ! TREE_OPERAND (prev, 1) ! = build_tree_list (NULL_TREE, ! digest_init (type, init, require_constant, ! constructor_constant)); ! return top; } error_init ("invalid initializer%s", " for `%s'", NULL); --- 4926,4940 ---- } } ! ! if (otype != type) ! { ! TREE_OPERAND (prev, 1) ! = build_tree_list (NULL_TREE, ! digest_init (type, init, require_constant, ! constructor_constant)); ! return top; ! } ! else ! return error_mark_node; } error_init ("invalid initializer%s", " for `%s'", NULL); *************** *** 5213,5217 **** { constructor_fields = TYPE_FIELDS (constructor_type); ! /* Skip any nameless bit fields atthe beginning. */ while (constructor_fields != 0 && DECL_BIT_FIELD (constructor_fields) && DECL_NAME (constructor_fields) == 0) --- 5247,5251 ---- { constructor_fields = TYPE_FIELDS (constructor_type); ! /* Skip any nameless bit fields at the beginning. */ while (constructor_fields != 0 && DECL_BIT_FIELD (constructor_fields) && DECL_NAME (constructor_fields) == 0) *************** *** 5385,5389 **** { constructor_fields = TYPE_FIELDS (constructor_type); ! /* Skip any nameless bit fields atthe beginning. */ while (constructor_fields != 0 && DECL_BIT_FIELD (constructor_fields) && DECL_NAME (constructor_fields) == 0) --- 5419,5423 ---- { constructor_fields = TYPE_FIELDS (constructor_type); ! /* Skip any nameless bit fields at the beginning. */ while (constructor_fields != 0 && DECL_BIT_FIELD (constructor_fields) && DECL_NAME (constructor_fields) == 0) *************** *** 5719,5722 **** --- 5753,5761 ---- int passed = 0; + /* Don't die if an entire brace-pair level is superfluous + in the containing level. */ + if (constructor_type == 0) + return; + for (tail = TYPE_FIELDS (constructor_type); tail; tail = TREE_CHAIN (tail)) *************** *** 6198,6202 **** constructor_fields = TREE_CHAIN (constructor_fields); ! /* Skip any nameless bit fields atthe beginning. */ while (constructor_fields != 0 && DECL_BIT_FIELD (constructor_fields) && DECL_NAME (constructor_fields) == 0) --- 6237,6241 ---- constructor_fields = TREE_CHAIN (constructor_fields); ! /* Skip any nameless bit fields at the beginning. */ while (constructor_fields != 0 && DECL_BIT_FIELD (constructor_fields) && DECL_NAME (constructor_fields) == 0) *************** *** 6414,6418 **** { tree type = TREE_TYPE (o[i]); ! if (TYPE_READONLY (type) || ((TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE) --- 6453,6458 ---- { tree type = TREE_TYPE (o[i]); ! if (TREE_READONLY (o[i]) ! || TYPE_READONLY (type) || ((TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/caller-save.c gcc-2.7.1/caller-save.c *** gcc-2.7.0/caller-save.c Thu Jun 15 07:15:06 1995 --- gcc-2.7.1/caller-save.c Mon Jun 19 16:30:05 1995 *************** *** 474,478 **** } else ! note_stores (PATTERN (insn), set_reg_live); for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) --- 474,485 ---- } else ! { ! note_stores (PATTERN (insn), set_reg_live); ! #ifdef AUTO_INC_DEC ! for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) ! if (REG_NOTE_KIND (link) == REG_INC) ! set_reg_live (XEXP (link, 0), NULL_RTX); ! #endif ! } for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/calls.c gcc-2.7.1/calls.c *** gcc-2.7.0/calls.c Thu Jun 15 07:15:32 1995 --- gcc-2.7.1/calls.c Thu Oct 26 21:53:43 1995 *************** *** 1044,1048 **** /* ??? Is this a sufficient test? Is there a better one? */ && !(TREE_CODE (args[i].tree_value) == VAR_DECL ! && REG_P (DECL_RTL (args[i].tree_value)))) { args[i].tree_value = build1 (ADDR_EXPR, --- 1044,1049 ---- /* ??? Is this a sufficient test? Is there a better one? */ && !(TREE_CODE (args[i].tree_value) == VAR_DECL ! && REG_P (DECL_RTL (args[i].tree_value))) ! && ! TREE_ADDRESSABLE (type)) { args[i].tree_value = build1 (ADDR_EXPR, *************** *** 2048,2051 **** --- 2049,2055 ---- int i; enum machine_mode tmpmode; + rtx src, dst; + int bitsize = MIN (TYPE_ALIGN (TREE_TYPE (exp)), BITS_PER_WORD); + int bitpos, xbitpos, big_endian_correction = 0; if (target == 0) *************** *** 2056,2091 **** } ! /* We could probably emit more efficient code for machines which do not use strict alignment, but it doesn't seem worth the effort at the current time. */ ! for (i = 0; i < n_regs; i++) { ! rtx src = operand_subword_force (valreg, i, BLKmode); ! rtx dst = operand_subword (target, i, 1, BLKmode); ! int bitsize = MIN (TYPE_ALIGN (TREE_TYPE (exp)), BITS_PER_WORD); ! int bitpos, big_endian_correction = 0; ! ! /* Should never happen. */ ! if (src == NULL || dst == NULL) ! abort (); ! ! if (BYTES_BIG_ENDIAN && bytes < UNITS_PER_WORD) ! big_endian_correction ! = (BITS_PER_WORD - (bytes * BITS_PER_UNIT)); ! ! for (bitpos = 0; ! bitpos < BITS_PER_WORD && bytes > 0; ! bitpos += bitsize, bytes -= bitsize / BITS_PER_UNIT) ! { ! int xbitpos = bitpos + big_endian_correction; ! store_bit_field (dst, bitsize, xbitpos, word_mode, ! extract_bit_field (src, bitsize, bitpos, 1, ! NULL_RTX, word_mode, ! word_mode, ! bitsize / BITS_PER_UNIT, ! BITS_PER_WORD), ! bitsize / BITS_PER_UNIT, BITS_PER_WORD); ! } } } --- 2060,2112 ---- } ! /* This code assumes valreg is at least a full word. If it isn't, ! copy it into a new pseudo which is a full word. */ ! if (GET_MODE (valreg) != BLKmode ! && GET_MODE_SIZE (GET_MODE (valreg)) < UNITS_PER_WORD) ! valreg = convert_to_mode (SImode, valreg, ! TREE_UNSIGNED (TREE_TYPE (exp))); ! ! /* Structures whose size is not a multiple of a word are aligned ! to the least significant byte (to the right). On a BYTES_BIG_ENDIAN ! machine, this means we must skip the empty high order bytes when ! calculating the bit offset. */ ! if (BYTES_BIG_ENDIAN && bytes % UNITS_PER_WORD) ! big_endian_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) ! * BITS_PER_UNIT)); ! ! /* Copy the structure BITSIZE bites at a time. ! ! We could probably emit more efficient code for machines which do not use strict alignment, but it doesn't seem worth the effort at the current time. */ ! for (bitpos = 0, xbitpos = big_endian_correction; ! bitpos < bytes * BITS_PER_UNIT; ! bitpos += bitsize, xbitpos += bitsize) { ! ! /* We need a new source operand each time xbitpos is on a ! word boundary and when xbitpos == big_endian_correction ! (the first time through). */ ! if (xbitpos % BITS_PER_WORD == 0 ! || xbitpos == big_endian_correction) ! src = operand_subword_force (valreg, ! xbitpos / BITS_PER_WORD, ! BLKmode); ! ! /* We need a new destination operand each time bitpos is on ! a word boundary. */ ! if (bitpos % BITS_PER_WORD == 0) ! dst = operand_subword (target, bitpos / BITS_PER_WORD, 1, BLKmode); ! /* Use xbitpos for the source extraction (right justified) and ! xbitpos for the destination store (left justified). */ ! store_bit_field (dst, bitsize, bitpos % BITS_PER_WORD, word_mode, ! extract_bit_field (src, bitsize, ! xbitpos % BITS_PER_WORD, 1, ! NULL_RTX, word_mode, ! word_mode, ! bitsize / BITS_PER_UNIT, ! BITS_PER_WORD), ! bitsize / BITS_PER_UNIT, BITS_PER_WORD); } } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cccp.c gcc-2.7.1/cccp.c *** gcc-2.7.0/cccp.c Thu Jun 15 07:16:31 1995 --- gcc-2.7.1/cccp.c Thu Oct 26 18:07:26 1995 *************** *** 1083,1087 **** static int redundant_include_p PROTO((char *)); ! static is_system_include PROTO((char *)); static char *read_filename_string PROTO((int, FILE *)); --- 1083,1088 ---- static int redundant_include_p PROTO((char *)); ! static int is_system_include PROTO((char *)); ! static char *skip_redundant_dir_prefix PROTO((char *)); static char *read_filename_string PROTO((int, FILE *)); *************** *** 1157,1160 **** --- 1158,1162 ---- static void verror_with_line PROTO((int, char *, va_list)); static void vwarning_with_line PROTO((int, char *, va_list)); + static void warning_with_line PRINTF_PROTO_2((int, char *, ...)); void pedwarn PRINTF_PROTO_1((char *, ...)); void pedwarn_with_line PRINTF_PROTO_2((int, char *, ...)); *************** *** 1201,1205 **** static int file_size_and_mode PROTO((int, int *, long int *)); - static void output_dots PROTO((FILE *, int)); /* Read LEN bytes at PTR from descriptor DESC, for file FILENAME, --- 1203,1206 ---- *************** *** 1357,1361 **** no_output = 0; cplusplus = 0; ! cplusplus_comments = 0; bzero ((char *) pend_files, argc * sizeof (char *)); --- 1358,1362 ---- no_output = 0; cplusplus = 0; ! cplusplus_comments = 1; bzero ((char *) pend_files, argc * sizeof (char *)); *************** *** 1542,1545 **** --- 1543,1547 ---- if (!strcmp (argv[i], "-traditional")) { traditional = 1; + cplusplus_comments = 0; if (dollars_in_ident > 0) dollars_in_ident = 1; *************** *** 1551,1559 **** case 'l': if (! strcmp (argv[i], "-lang-c")) cplusplus = 0, cplusplus_comments = 0, objc = 0; if (! strcmp (argv[i], "-lang-c++")) cplusplus = 1, cplusplus_comments = 1, objc = 0; - if (! strcmp (argv[i], "-lang-c-c++-comments")) - cplusplus = 0, cplusplus_comments = 1, objc = 0; if (! strcmp (argv[i], "-lang-objc")) objc = 1, cplusplus = 0, cplusplus_comments = 1; --- 1553,1561 ---- case 'l': if (! strcmp (argv[i], "-lang-c")) + cplusplus = 0, cplusplus_comments = 1, objc = 0; + if (! strcmp (argv[i], "-lang-c89")) cplusplus = 0, cplusplus_comments = 0, objc = 0; if (! strcmp (argv[i], "-lang-c++")) cplusplus = 1, cplusplus_comments = 1, objc = 0; if (! strcmp (argv[i], "-lang-objc")) objc = 1, cplusplus = 0, cplusplus_comments = 1; *************** *** 2487,2491 **** buf->buf[buf->length] = '\0'; if (warn_trigraphs && fptr != bptr) ! warning ("%d trigraph(s) encountered", (fptr - bptr) / 2); } --- 2489,2493 ---- buf->buf[buf->length] = '\0'; if (warn_trigraphs && fptr != bptr) ! warning_with_line (0, "%d trigraph(s) encountered", (fptr - bptr) / 2); } *************** *** 2769,2772 **** --- 2771,2776 ---- case '#': if (assertions_flag) { + if (ident_length) + goto specialchar; /* Copy #foo (bar lose) without macro expansion. */ obp[-1] = '#'; /* In case it was '%'. */ *************** *** 2782,2785 **** --- 2786,2790 ---- ibp = ip->bufp; } + break; } *************** *** 2992,3027 **** start_line = ip->lineno; - --ibp; /* Back over the slash */ - --obp; - /* Comments are equivalent to spaces. */ if (! put_out_comments) ! *obp++ = ' '; ! else { ! /* must fake up a comment here */ ! *obp++ = '/'; ! *obp++ = '/'; ! } { ! U_CHAR *before_bp = ibp+2; ! while (ibp < limit) { ! if (ibp[-1] != '\\' && *ibp == '\n') { ! if (put_out_comments) { ! bcopy ((char *) before_bp, (char *) obp, ibp - before_bp); ! obp += ibp - before_bp; ! } ! break; ! } else { ! if (*ibp == '\n') { ! ++ip->lineno; ! /* Copy the newline into the output buffer, in order to ! avoid the pain of a #line every time a multiline comment ! is seen. */ ! if (!put_out_comments) ! *obp++ = '\n'; ! ++op->lineno; } ! ibp++; } } --- 2997,3023 ---- start_line = ip->lineno; /* Comments are equivalent to spaces. */ if (! put_out_comments) ! obp[-1] = ' '; ! { ! U_CHAR *before_bp = ibp; ! while (++ibp < limit) { ! if (*ibp == '\n') { ! if (ibp[-1] != '\\') { ! if (put_out_comments) { ! bcopy ((char *) before_bp, (char *) obp, ibp - before_bp); ! obp += ibp - before_bp; ! } ! break; } ! ++ip->lineno; ! /* Copy the newline into the output buffer, in order to ! avoid the pain of a #line every time a multiline comment ! is seen. */ ! if (!put_out_comments) ! *obp++ = '\n'; ! ++op->lineno; } } *************** *** 3943,3951 **** xp++; cp--; ! if (cp != buf && is_space[cp[-1]]) { ! while (cp != buf && is_space[cp[-1]]) cp--; ! cp++; SKIP_WHITE_SPACE (xp); ! } else if (is_space[*xp]) { *cp++ = *xp++; SKIP_WHITE_SPACE (xp); --- 3939,3947 ---- xp++; cp--; ! if (cp != buf && is_hor_space[cp[-1]]) { ! while (cp - 1 != buf && is_hor_space[cp[-2]]) ! cp--; SKIP_WHITE_SPACE (xp); ! } else if (is_hor_space[*xp]) { *cp++ = *xp++; SKIP_WHITE_SPACE (xp); *************** *** 4270,4274 **** struct file_name_list dsp[1]; /* First in chain, if #include "..." */ struct file_name_list *searchptr = 0; ! int flen; int f; /* file number */ --- 4266,4270 ---- struct file_name_list dsp[1]; /* First in chain, if #include "..." */ struct file_name_list *searchptr = 0; ! size_t flen; int f; /* file number */ *************** *** 4510,4516 **** if (searchptr->fname[0] == 0) continue; ! strcpy (fname, searchptr->fname); ! strcat (fname, "/"); ! fname[strlen (fname) + flen] = 0; } else { fname[0] = 0; --- 4506,4512 ---- if (searchptr->fname[0] == 0) continue; ! strcpy (fname, skip_redundant_dir_prefix (searchptr->fname)); ! if (fname[0] && fname[strlen (fname) - 1] != '/') ! strcat (fname, "/"); } else { fname[0] = 0; *************** *** 4579,4584 **** p = (char *) alloca (strlen (searchptr->fname) + strlen (fname) + 2); ! strcpy (p, searchptr->fname); ! strcat (p, "/"); strcat (p, fname); deps_output (p, ' '); --- 4575,4581 ---- p = (char *) alloca (strlen (searchptr->fname) + strlen (fname) + 2); ! strcpy (p, skip_redundant_dir_prefix (searchptr->fname)); ! if (p[0] && p[strlen (p) - 1] != '/') ! strcat (p, "/"); strcat (p, fname); deps_output (p, ' '); *************** *** 4642,4649 **** /* Handle -H option. */ ! if (print_include_names) { ! output_dots (stderr, indepth); ! fprintf (stderr, "%s\n", fname); ! } if (angle_brackets) --- 4639,4644 ---- /* Handle -H option. */ ! if (print_include_names) ! fprintf (stderr, "%*s%s\n", indepth, "", fname); if (angle_brackets) *************** *** 4743,4747 **** searchptr = searchptr->next) if (searchptr->fname) { ! register char *sys_dir = searchptr->fname; register unsigned length = strlen (sys_dir); --- 4738,4742 ---- searchptr = searchptr->next) if (searchptr->fname) { ! register char *sys_dir = skip_redundant_dir_prefix (searchptr->fname); register unsigned length = strlen (sys_dir); *************** *** 4761,4764 **** --- 4756,4774 ---- } + /* Skip leading "./" from a directory name. + This may yield the empty string, which represents the current directory. */ + + static char * + skip_redundant_dir_prefix (dir) + char *dir; + { + while (dir[0] == '.' && dir[1] == '/') + for (dir += 2; *dir == '/'; dir++) + continue; + if (dir[0] == '.' && !dir[1]) + dir++; + return dir; + } + /* The file_name_map structure holds a mapping of file names for a particular directory. This mapping is read from the file named *************** *** 4828,4832 **** --- 4838,4846 ---- char *name; FILE *f; + size_t dirlen; + int separator_needed; + dirname = skip_redundant_dir_prefix (dirname); + for (map_list_ptr = map_list; map_list_ptr; map_list_ptr = map_list_ptr->map_list_next) *************** *** 4839,4847 **** map_list_ptr->map_list_map = NULL; ! name = (char *) alloca (strlen (dirname) + strlen (FILE_NAME_MAP_FILE) + 2); strcpy (name, dirname); ! if (*dirname) ! strcat (name, "/"); ! strcat (name, FILE_NAME_MAP_FILE); f = fopen (name, "r"); if (!f) --- 4853,4862 ---- map_list_ptr->map_list_map = NULL; ! dirlen = strlen (dirname); ! separator_needed = dirlen != 0 && dirname[dirlen - 1] != '/'; ! name = (char *) alloca (dirlen + strlen (FILE_NAME_MAP_FILE) + 2); strcpy (name, dirname); ! name[dirlen] = '/'; ! strcpy (name + dirlen + separator_needed, FILE_NAME_MAP_FILE); f = fopen (name, "r"); if (!f) *************** *** 4850,4854 **** { int ch; - int dirlen = strlen (dirname); while ((ch = getc (f)) != EOF) --- 4865,4868 ---- *************** *** 4876,4880 **** strcpy (ptr->map_to, dirname); ptr->map_to[dirlen] = '/'; ! strcpy (ptr->map_to + dirlen + 1, to); free (to); } --- 4890,4894 ---- strcpy (ptr->map_to, dirname); ptr->map_to[dirlen] = '/'; ! strcpy (ptr->map_to + dirlen + separator_needed, to); free (to); } *************** *** 6027,6031 **** concat_sharp_token_type = c; if (is_hor_space[*p]) { ! concat_sharp_token_type++; p++; SKIP_WHITE_SPACE (p); --- 6041,6045 ---- concat_sharp_token_type = c; if (is_hor_space[*p]) { ! concat_sharp_token_type = c + 1; p++; SKIP_WHITE_SPACE (p); *************** *** 6041,6045 **** stringify_sharp_token_type = c; if (is_hor_space[*p]) { ! stringify_sharp_token_type++; p++; SKIP_WHITE_SPACE (p); --- 6055,6059 ---- stringify_sharp_token_type = c; if (is_hor_space[*p]) { ! stringify_sharp_token_type = c + 1; p++; SKIP_WHITE_SPACE (p); *************** *** 8994,8997 **** --- 9008,9027 ---- static void + #if defined (__STDC__) && defined (HAVE_VPRINTF) + warning_with_line (int line, PRINTF_ALIST (msg)) + #else + warning_with_line (line, PRINTF_ALIST (msg)) + int line; + PRINTF_DCL (msg) + #endif + { + va_list args; + + VA_START (args, msg); + vwarning_with_line (line, msg, args); + va_end (args); + } + + static void vwarning_with_line (line, msg, args) int line; *************** *** 9017,9021 **** if (ip != NULL) ! fprintf (stderr, "%s:%d: ", ip->nominal_fname, line); fprintf (stderr, "warning: "); vfprintf (stderr, msg, args); --- 9047,9051 ---- if (ip != NULL) ! fprintf (stderr, line ? "%s:%d: " : "%s: ", ip->nominal_fname, line); fprintf (stderr, "warning: "); vfprintf (stderr, msg, args); *************** *** 10039,10054 **** return 0; } - - static void - output_dots (fd, depth) - FILE* fd; - int depth; - { - while (depth > 0) { - putc ('.', fd); - depth--; - } - } - #ifdef VMS --- 10069,10072 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/collect2.c gcc-2.7.1/collect2.c *** gcc-2.7.0/collect2.c Thu Jun 15 07:17:35 1995 --- gcc-2.7.1/collect2.c Tue Sep 12 13:08:27 1995 *************** *** 159,162 **** --- 159,166 ---- #endif + #ifdef XCOFF_DEBUGGING_INFO + #define XCOFF_SCAN_LIBS + #endif + #endif /* OBJECT_FORMAT_COFF */ *************** *** 197,201 **** #endif ! #if defined (LDD_SUFFIX) || SUNOS4_SHARED_LIBRARIES #define SCAN_LIBRARIES #endif --- 201,205 ---- #endif ! #if defined (LDD_SUFFIX) || SUNOS4_SHARED_LIBRARIES || defined(XCOFF_SCAN_LIBS) #define SCAN_LIBRARIES #endif *************** *** 1447,1450 **** --- 1451,1458 ---- fork_execute ("strip", strip_argv); } + + #ifdef COLLECT_EXPORT_LIST + maybe_unlink (export_file); + #endif return 0; } *************** *** 2092,2095 **** --- 2100,2111 ---- } + /* If one file has an additional numeric extension past LIBNAME, then put + that one first in the sort. If both files have additional numeric + extensions, then put the one with the higher number first in the sort. + + We must verify that the extension is numeric, because Sun saves the + original versions of patched libraries with a .FCS extension. Files with + invalid extensions must go last in the sort, so that they won't be used. */ + static int libcompare (d1, d2) *************** *** 2100,2104 **** char *e2 = (*d2)->d_name + i2; ! while (*e1 && *e2) { ++e1; --- 2116,2121 ---- char *e2 = (*d2)->d_name + i2; ! while (*e1 && *e2 && *e1 == '.' && *e2 == '.' ! && e1[1] && isdigit (e1[1]) && e2[1] && isdigit (e2[1])) { ++e1; *************** *** 2111,2117 **** if (*e1) ! return 1; else if (*e2) ! return -1; else return 0; --- 2128,2148 ---- if (*e1) ! { ! /* It has a valid numeric extension, prefer this one. */ ! if (*e1 == '.' && e1[1] && isdigit (e1[1])) ! return 1; ! /* It has a invalid numeric extension, must prefer the other one. */ ! else ! return -1; ! } else if (*e2) ! { ! /* It has a valid numeric extension, prefer this one. */ ! if (*e2 == '.' && e2[1] && isdigit (e2[1])) ! return -1; ! /* It has a invalid numeric extension, must prefer the other one. */ ! else ! return 1; ! } else return 0; *************** *** 2178,2182 **** { *q++ = 0; ! *pp++ = p; } } --- 2209,2213 ---- { *q++ = 0; ! *pp++ = q; } } *************** *** 2547,2550 **** --- 2578,2740 ---- } + #ifdef XCOFF_SCAN_LIBS + /* Scan imported AIX libraries for GCC static ctors and dtors. + FIXME: it is possible to link an executable without the actual import + library by using an "import file" - a text file listing symbols + exported by a library. To support this, we would have to scan + import files as well as actual shared binaries to find GCC ctors. + TODO: use memory mapping instead of 'ld' routines, files are already + memory mapped, but we could eliminate the extra in-memory copies. + Is it worth the effort? */ + + static void + scan_libraries (prog_name) + char *prog_name; + { + LDFILE *ldptr; + SCNHDR ldsh; + static struct path_prefix libpath; /* we should only do this once */ + + if ((ldptr = ldopen (prog_name, ldptr)) == NULL) + fatal ("%s: can't open as COFF file", prog_name); + + if (!MY_ISCOFF (HEADER (ldptr).f_magic)) + fatal ("%s: not a COFF file", prog_name); + + /* find and read loader section */ + if (ldnshread (ldptr, _LOADER, &ldsh)) + { + LDHDR ldh; + char *impbuf; + int idx; + FSEEK (ldptr, ldsh.s_scnptr, BEGINNING); + FREAD (&ldh, sizeof ldh, 1, ldptr); + /* read import library list */ + impbuf = alloca (ldh.l_istlen); + FSEEK (ldptr, ldh.l_impoff + ldsh.s_scnptr, BEGINNING); + FREAD (impbuf, ldh.l_istlen, 1, ldptr); + idx = strlen (impbuf) + 1; + idx += strlen (impbuf+idx) + 1; + if (debug) + fprintf (stderr, "LIBPATH=%s\n", impbuf); + prefix_from_string (impbuf, &libpath); + while (idx < ldh.l_istlen) + { + char *implib = impbuf + idx; + char *impmem = implib + strlen (implib) + 1; + char *soname = 0; + LDFILE *libptr = NULL; + struct prefix_list *pl; + ARCHDR ah; + idx += strlen (implib) + 1; + if (!implib[0]) + continue; + idx += strlen (impmem) + 1; + if (*implib == '/') + { + if (access (soname, R_OK) == 0) + soname = implib; + } + else + { + char *temp = alloca (libpath.max_len + strlen (implib) + 1); + for (pl = libpath.plist; pl; pl = pl->next) + { + strcpy (temp, pl->prefix); + strcat (temp, implib); + if (access (temp, R_OK) == 0) + { + soname = temp; + break; + } + } + } + if (!soname) + { + fatal ("%s: library not found", implib); + continue; + } + if (debug) + { + if (impmem[0]) + fprintf (stderr, "%s (%s)\n", soname, impmem); + else + fprintf (stderr, "%s\n", soname); + } + ah.ar_name[0] = 0; + do + { + /* scan imported shared objects for GCC GLOBAL ctors */ + short type; + if ((libptr = ldopen (soname, libptr)) == NULL) + fatal ("%s: can't open import library", soname); + if (TYPE (libptr) == ARTYPE) + { + LDFILE *memptr; + if (!impmem[0]) + fatal ("%s: no archive member specified", soname); + ldahread (libptr, &ah); + if (strcmp (ah.ar_name, impmem)) + continue; + } + type = HEADER (libptr).f_magic; + if (HEADER (libptr).f_flags & F_SHROBJ) + { + SCNHDR soldsh; + LDHDR soldh; + long symcnt, i; + char *ldstrings; + LDSYM *lsyms; + if (!ldnshread (libptr, _LOADER, &soldsh)) + fatal ("%s: not an import library", soname); + FSEEK (libptr, soldsh.s_scnptr, BEGINNING); + if (FREAD (&soldh, sizeof soldh, 1, libptr) != 1) + fatal ("%s: can't read loader section", soname); + /*fprintf (stderr, "\tscanning %s\n", soname);*/ + symcnt = soldh.l_nsyms; + lsyms = (LDSYM*) alloca (symcnt * sizeof *lsyms); + symcnt = FREAD (lsyms, sizeof *lsyms, symcnt, libptr); + ldstrings = alloca (soldh.l_stlen); + FSEEK (libptr, soldsh.s_scnptr+soldh.l_stoff, BEGINNING); + FREAD (ldstrings, soldh.l_stlen, 1, libptr); + for (i = 0; i < symcnt; ++i) + { + LDSYM *l = lsyms + i; + if (LDR_EXPORT (*l)) + { + char *expname = 0; + if (l->l_zeroes) + expname = l->l_name; + else if (l->l_offset < soldh.l_stlen) + expname = ldstrings + l->l_offset; + switch (is_ctor_dtor (expname)) + { + case 3: + if (debug) + fprintf (stderr, "\t%s\n", expname); + add_to_list (&constructors, expname); + break; + + case 4: + add_to_list (&destructors, expname); + break; + + default: /* not a constructor or destructor */ + continue; + } + } + } + } + else + fprintf (stderr, "%s: type = %04X flags = %04X\n", + ah.ar_name, type, HEADER (libptr).f_flags); + } + while (ldclose (libptr) == FAILURE); + /* printf (stderr, "closed %s\n", soname); */ + } + } + } + #endif /* XCOFF_SCAN_LIBS */ + #endif /* OBJECT_FORMAT_COFF */ *************** *** 3205,3209 **** len = write (ptr->fd, ptr->start, ptr->size); if (len < 0) ! fatal_perror ("read %s", ptr->name); if (len != ptr->size) --- 3395,3399 ---- len = write (ptr->fd, ptr->start, ptr->size); if (len < 0) ! fatal_perror ("write %s", ptr->name); if (len != ptr->size) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/combine.c gcc-2.7.1/combine.c *** gcc-2.7.0/combine.c Thu Jun 15 07:18:33 1995 --- gcc-2.7.1/combine.c Tue Nov 7 10:16:48 1995 *************** *** 3058,3061 **** --- 3058,3064 ---- enum rtx_code cond_code = simplify_comparison (NE, &cond, &cop1); + if (cond_code == NE && GET_RTX_CLASS (GET_CODE (cond)) == '<') + return x; + /* Simplify the alternative arms; this may collapse the true and false arms to store-flag values. */ *************** *** 6016,6021 **** /* If we are just looking for the sign bit, we don't need this shift at all, even if it has a variable count. */ ! if (mask == ((HOST_WIDE_INT) 1 ! << (GET_MODE_BITSIZE (GET_MODE (x)) - 1))) return force_to_mode (XEXP (x, 0), mode, mask, reg, next_select); --- 6019,6025 ---- /* If we are just looking for the sign bit, we don't need this shift at all, even if it has a variable count. */ ! if (GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT ! && (mask == ((HOST_WIDE_INT) 1 ! << (GET_MODE_BITSIZE (GET_MODE (x)) - 1)))) return force_to_mode (XEXP (x, 0), mode, mask, reg, next_select); *************** *** 6032,6037 **** int i = -1; ! nonzero = GET_MODE_MASK (GET_MODE (x)); ! nonzero >>= INTVAL (XEXP (x, 1)); if ((mask & ~ nonzero) == 0 --- 6036,6063 ---- int i = -1; ! /* If the considered data is wider then HOST_WIDE_INT, we can't ! represent a mask for all its bits in a single scalar. ! But we only care about the lower bits, so calculate these. */ ! ! if (GET_MODE_BITSIZE (GET_MODE (x)) > HOST_BITS_PER_WIDE_INT) ! { ! nonzero = ~(HOST_WIDE_INT)0; ! ! /* GET_MODE_BITSIZE (GET_MODE (x)) - INTVAL (XEXP (x, 1)) ! is the number of bits a full-width mask would have set. ! We need only shift if these are fewer than nonzero can ! hold. If not, we must keep all bits set in nonzero. */ ! ! if (GET_MODE_BITSIZE (GET_MODE (x)) - INTVAL (XEXP (x, 1)) ! < HOST_BITS_PER_WIDE_INT) ! nonzero >>= INTVAL (XEXP (x, 1)) ! + HOST_BITS_PER_WIDE_INT ! - GET_MODE_BITSIZE (GET_MODE (x)) ; ! } ! else ! { ! nonzero = GET_MODE_MASK (GET_MODE (x)); ! nonzero >>= INTVAL (XEXP (x, 1)); ! } if ((mask & ~ nonzero) == 0 *************** *** 7659,7663 **** break; ! /* Convert ROTATETRT to ROTATE. */ if (code == ROTATERT) code = ROTATE, count = GET_MODE_BITSIZE (result_mode) - count; --- 7685,7689 ---- break; ! /* Convert ROTATERT to ROTATE. */ if (code == ROTATERT) code = ROTATE, count = GET_MODE_BITSIZE (result_mode) - count; *************** *** 9216,9220 **** case SUBREG: /* Check for the case where we are comparing A - C1 with C2, ! both constants are smaller than 1/2 the maxium positive value in MODE, and the comparison is equality or unsigned. In that case, if A is either zero-extended to MODE or has --- 9242,9246 ---- case SUBREG: /* Check for the case where we are comparing A - C1 with C2, ! both constants are smaller than 1/2 the maximum positive value in MODE, and the comparison is equality or unsigned. In that case, if A is either zero-extended to MODE or has *************** *** 10408,10411 **** --- 10434,10452 ---- REG_NOTES (where_dead)); } + /* If we didn't find any note, and we have a multi-reg hard + register, then to be safe we must check for REG_DEAD notes + for each register other than the first. They could have + their own REG_DEAD notes lying around. */ + else if (note == 0 && regno < FIRST_PSEUDO_REGISTER + && HARD_REGNO_NREGS (regno, GET_MODE (x)) > 1) + { + int ourend = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + int i; + rtx oldnotes = 0; + + for (i = regno + 1; i < ourend; i++) + move_deaths (gen_rtx (REG, reg_raw_mode[i], i), + from_cuid, to_insn, &oldnotes); + } if (note != 0 && GET_MODE (XEXP (note, 0)) == GET_MODE (x)) *************** *** 10728,10732 **** if (set != 0 && ! side_effects_p (SET_SRC (set)) ! && rtx_equal_p (XEXP (note, 0), SET_DEST (set))) { /* Move the notes and links of TEM elsewhere. --- 10769,10776 ---- if (set != 0 && ! side_effects_p (SET_SRC (set)) ! && (rtx_equal_p (XEXP (note, 0), SET_DEST (set)) ! || (GET_CODE (SET_DEST (set)) == SUBREG ! && rtx_equal_p (XEXP (note, 0), ! XEXP (SET_DEST (set), 0))))) { /* Move the notes and links of TEM elsewhere. *************** *** 10762,10765 **** --- 10806,10825 ---- { place = tem; + + /* If we are doing a 3->2 combination, and we have a + register which formerly died in i3 and was not used + by i2, which now no longer dies in i3 and is used in + i2 but does not die in i2, and place is between i2 + and i3, then we may need to move a link from place to + i2. */ + if (i2 && INSN_UID (place) <= max_uid_cuid + && INSN_CUID (place) > INSN_CUID (i2) + && from_insn && INSN_CUID (from_insn) > INSN_CUID (i2) + && reg_referenced_p (XEXP (note, 0), PATTERN (i2))) + { + rtx links = LOG_LINKS (place); + LOG_LINKS (place) = 0; + distribute_links (links); + } break; } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/1750a/1750a.c gcc-2.7.1/config/1750a/1750a.c *** gcc-2.7.0/config/1750a/1750a.c Thu Jun 15 09:05:41 1995 --- gcc-2.7.1/config/1750a/1750a.c Fri Sep 15 17:29:06 1995 *************** *** 1,5 **** /* Subroutines for insn-output.c for MIL-STD-1750. Copyright (C) 1994, 1995 Free Software Foundation, Inc. ! Contributed by O.M.Kellogg, DASA (okellogg@salyko.cube.net). This file is part of GNU CC. --- 1,5 ---- /* Subroutines for insn-output.c for MIL-STD-1750. Copyright (C) 1994, 1995 Free Software Foundation, Inc. ! Contributed by O.M.Kellogg, DASA (kellogg@space.otn.dasa.de) This file is part of GNU CC. *************** *** 53,68 **** if (SET_DEST (exp) == pc_rtx) return; ! /* Moving register into memory doesn't alter the cc's. ! It may invalidate the RTX's which we remember the cc's came from. */ ! if (GET_CODE (SET_DEST (exp)) == MEM) ! { ! if (cc_status.value1 && GET_CODE (cc_status.value1) == MEM) ! cc_status.value1 = 0; ! if (cc_status.value2 && GET_CODE (cc_status.value2) == MEM) ! cc_status.value2 = 0; ! return; ! } /* Function calls clobber the cc's. */ ! else if (src_code == CALL) { CC_STATUS_INIT; --- 53,62 ---- if (SET_DEST (exp) == pc_rtx) return; ! /* Moving a register or constant into memory doesn't alter the cc's. */ ! if (GET_CODE (SET_DEST (exp)) == MEM ! && (src_code == REG || src_code == CONST_INT)) ! return; /* Function calls clobber the cc's. */ ! if (src_code == CALL) { CC_STATUS_INIT; *************** *** 70,74 **** } /* Emulated longword bit-ops leave cc's incorrect */ ! else if (GET_MODE (SET_DEST (exp)) == HImode ? src_code == AND || src_code == IOR || src_code == XOR || src_code == NOT : 0) --- 64,68 ---- } /* Emulated longword bit-ops leave cc's incorrect */ ! if (GET_MODE (SET_DEST (exp)) == HImode ? src_code == AND || src_code == IOR || src_code == XOR || src_code == NOT : 0) *************** *** 78,82 **** } /* Tests and compares set the cc's in predictable ways. */ ! else if (SET_DEST (exp) == cc0_rtx) { CC_STATUS_INIT; --- 72,76 ---- } /* Tests and compares set the cc's in predictable ways. */ ! if (SET_DEST (exp) == cc0_rtx) { CC_STATUS_INIT; *************** *** 84,99 **** return; } ! /* Anything that lands in a reg will set cc_status. */ ! else if (REG_P (SET_DEST (exp))) ! { ! cc_status.flags = CC_NO_OVERFLOW; ! cc_status.value1 = SET_SRC (exp); ! cc_status.value2 = SET_DEST (exp); ! return; ! } ! else ! { ! CC_STATUS_INIT; ! } } else if (GET_CODE (exp) == PARALLEL --- 78,86 ---- return; } ! /* Anything else will set cc_status. */ ! cc_status.flags = CC_NO_OVERFLOW; ! cc_status.value1 = SET_SRC (exp); ! cc_status.value2 = SET_DEST (exp); ! return; } else if (GET_CODE (exp) == PARALLEL *************** *** 305,308 **** --- 292,321 ---- } + + /* predicate for 1750 `B' addressing mode (Base Register with Offset) + memory operand */ + int + b_mode_operand (op) + rtx op; + { + if (GET_CODE (op) == MEM) + { + rtx inner = XEXP (op, 0); + if (GET_CODE (inner) == PLUS) + { + rtx plus_op0 = XEXP (inner, 0); + if (GET_CODE (plus_op0) == REG && REG_OK_FOR_INDEX_P (plus_op0)) + { + rtx plus_op1 = XEXP (inner, 1); + if (GET_CODE (plus_op1) == CONST_INT + && INTVAL (plus_op1) >= 0 + && INTVAL (plus_op1) <= 255) + return 1; + } + } + } + return 0; + } + /* Decide whether to output a conditional jump as a "Jump Conditional" or as a "Branch Conditional": */ *************** *** 344,347 **** --- 357,394 ---- + int + unsigned_comparison_operator (insn) + rtx insn; + { + switch (GET_CODE (insn)) + { + case GEU: + case GTU: + case LEU: + case LTU: + return 1; + default: + return 0; + } + } + + int + next_cc_user_is_unsigned (insn) + rtx insn; + { + if ( !(insn = next_cc0_user (insn))) + abort (); + else if (GET_CODE (insn) == JUMP_INSN + && GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_SRC (PATTERN (insn))) == IF_THEN_ELSE) + return unsigned_comparison_operator (XEXP (SET_SRC (PATTERN (insn)), 0)); + else if (GET_CODE (insn) == INSN + && GET_CODE (PATTERN (insn)) == SET) + return unsigned_comparison_operator (SET_SRC (PATTERN (insn))); + else + abort (); + } + + /* The PRINT_OPERAND and PRINT_OPERAND_ADDRESS macros have been *************** *** 364,368 **** case CONST: case MEM: ! output_address (XEXP (x, 0)); break; case CONST_DOUBLE: --- 411,420 ---- case CONST: case MEM: ! if (kode == 'Q') ! fprintf (file, "r%d,%d", ! REGNO (XEXP (XEXP (x, 0), 0)), ! INTVAL (XEXP (XEXP (x, 0), 1))); ! else ! output_address (XEXP (x, 0)); break; case CONST_DOUBLE: diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/1750a/1750a.h gcc-2.7.1/config/1750a/1750a.h *** gcc-2.7.0/config/1750a/1750a.h Thu Jun 15 09:05:57 1995 --- gcc-2.7.1/config/1750a/1750a.h Thu Nov 9 11:04:08 1995 *************** *** 1,5 **** /* Definitions of target machine for GNU compiler. Copyright (C) 1994, 1995 Free Software Foundation, Inc. ! Contributed by O.M.Kellogg, DASA (okellogg@salyko.cube.net). This file is part of GNU CC. --- 1,5 ---- /* Definitions of target machine for GNU compiler. Copyright (C) 1994, 1995 Free Software Foundation, Inc. ! Contributed by O.M.Kellogg, DASA (kellogg@space.otn.dasa.de) This file is part of GNU CC. *************** *** 201,204 **** --- 201,211 ---- 1, 1, 1, 1, 1, 1, 1, 1 } + /* Order in which to allocate registers. Each register must be + listed once, even those in FIXED_REGISTERS. List frame pointer + late and fixed registers last. Note that, in general, we prefer + registers listed in CALL_USED_REGISTERS, keeping the others + available for storage of persistent values. */ + #define REG_ALLOC_ORDER \ + { 2, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } /* Return number of consecutive hard regs needed starting at reg REGNO to hold something of mode MODE. *************** *** 287,291 **** "Base" vs. "Index" regs. */ ! enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES }; #define N_REG_CLASSES (int) LIM_REG_CLASSES --- 294,298 ---- "Base" vs. "Index" regs. */ ! enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES }; #define N_REG_CLASSES (int) LIM_REG_CLASSES *************** *** 298,302 **** #define REG_CLASS_NAMES \ ! { "NO_REGS", "INDEX_REGS", "BASE_REGS", "ALL_REGS" } /* Define which registers fit in which classes. --- 305,309 ---- #define REG_CLASS_NAMES \ ! { "NO_REGS", "R2", "R0_1", "INDEX_REGS", "BASE_REGS", "ALL_REGS" } /* Define which registers fit in which classes. *************** *** 306,310 **** The only 1750 register not usable as BASE_REG is R0. */ ! #define REG_CLASS_CONTENTS {0, 0xf000, 0xfffe, 0xffff} /* The same information, inverted: --- 313,317 ---- The only 1750 register not usable as BASE_REG is R0. */ ! #define REG_CLASS_CONTENTS {0, 0x0004, 0x0003, 0xf000, 0xfffe, 0xffff} /* The same information, inverted: *************** *** 312,317 **** reg number REGNO. This could be a conditional expression or could index an array. */ ! #define REGNO_REG_CLASS(REGNO) \ ! ((REGNO) >= 12 ? INDEX_REGS : (REGNO) > 0 ? BASE_REGS : ALL_REGS) /* The class value for index registers, and the one for base regs. */ --- 319,324 ---- reg number REGNO. This could be a conditional expression or could index an array. */ ! #define REGNO_REG_CLASS(REGNO) ((REGNO) == 2 ? R2 : (REGNO) == 0 ? R0_1 : \ ! (REGNO) >= 12 ? INDEX_REGS : (REGNO) > 0 ? BASE_REGS : ALL_REGS) /* The class value for index registers, and the one for base regs. */ *************** *** 321,327 **** /* Get reg_class from a letter such as appears in the machine description. ! For the 1750, we have 'b' for gcc Base regs and 'x' for gcc Index regs. */ ! #define REG_CLASS_FROM_LETTER(C) ((C) == 'b' ? BASE_REGS : \ (C) == 'x' ? INDEX_REGS : NO_REGS) --- 328,337 ---- /* Get reg_class from a letter such as appears in the machine description. ! For the 1750, we have 'z' for R0_1, 't' for R2, 'b' for gcc Base regs ! and 'x' for gcc Index regs. */ ! #define REG_CLASS_FROM_LETTER(C) ((C) == 't' ? R2 : \ ! (C) == 'z' ? R0_1 : \ ! (C) == 'b' ? BASE_REGS : \ (C) == 'x' ? INDEX_REGS : NO_REGS) *************** *** 353,356 **** --- 363,376 ---- #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0 + /* Optional extra constraints for this machine. + + For the 1750, `Q' means that this is a memory operand consisting + of the sum of an Index Register (in the GCC sense, i.e. R12..R15) + and a constant in the range 0..255. This constraint is used for + the Base Register with Offset address mode instructions (LB,STB,AB,..) */ + + #define EXTRA_CONSTRAINT(OP, C) \ + ((C) == 'Q' && b_mode_operand (OP)) + /* Given an rtx X being reloaded into a reg required to be in class CLASS, return the class of reg to actually use. *************** *** 520,524 **** do not preserve any registers; in other words, if `CALL_USED_REGISTERS' has 1 for all registers. This macro enables `-fcaller-saves' by ! default. Eventually that option will be nabled by default on all machines and both the option and this macro will be eliminated. */ --- 540,544 ---- do not preserve any registers; in other words, if `CALL_USED_REGISTERS' has 1 for all registers. This macro enables `-fcaller-saves' by ! default. Eventually that option will be enabled by default on all machines and both the option and this macro will be eliminated. */ *************** *** 593,597 **** fprintf(FILE,"\tpopm\tr14,r14 ; restore previous frame ptr\n"); \ if (SIZE > 0) \ ! fprintf(FILE,"\t%s\tr14,%d ; free up local-var space\n", \ (SIZE <= 16 ? "aisp" : "aim"),SIZE); \ fprintf(FILE,"\turs\tr15\n"); } --- 613,617 ---- fprintf(FILE,"\tpopm\tr14,r14 ; restore previous frame ptr\n"); \ if (SIZE > 0) \ ! fprintf(FILE,"\t%s\tr15,%d ; free up local-var space\n", \ (SIZE <= 16 ? "aisp" : "aim"),SIZE); \ fprintf(FILE,"\turs\tr15\n"); } *************** *** 664,669 **** has been allocated, which happens in local-alloc.c. 1750 note: The words BASE and INDEX are used in their GCC senses: ! The "Index Registers", R12 through R15, can have an address displacement ! int the range 0..255 words. */ --- 684,689 ---- has been allocated, which happens in local-alloc.c. 1750 note: The words BASE and INDEX are used in their GCC senses: ! The "Index Registers", R12 through R15, are used in the 1750 ! instructions LB,STB,AB,SBB,MB,DB,LBX,STBX,... */ *************** *** 670,674 **** #define REGNO_OK_FOR_BASE_P(REGNO) \ ((REGNO) > 0 && (REGNO) <= 15 || \ ! reg_renumber[REGNO] > 0 && reg_renumber[REGNO] < 15) #define REGNO_OK_FOR_INDEX_P(REGNO) \ ((REGNO) >= 12 && (REGNO) <= 15 || \ --- 690,694 ---- #define REGNO_OK_FOR_BASE_P(REGNO) \ ((REGNO) > 0 && (REGNO) <= 15 || \ ! reg_renumber[REGNO] > 0 && reg_renumber[REGNO] <= 15) #define REGNO_OK_FOR_INDEX_P(REGNO) \ ((REGNO) >= 12 && (REGNO) <= 15 || \ *************** *** 1162,1167 **** datalbl[datalbl_ndx].size = 1; \ } \ ! fprintf(FILE, "\tdata\t"); output_addr_const(FILE,VALUE); \ ! fprintf(FILE, "\n"); } while (0) /* This is how to output an assembler line defining a `long int' constant. --- 1182,1189 ---- datalbl[datalbl_ndx].size = 1; \ } \ ! fprintf(FILE, "\tdata\t"); \ ! output_addr_const(FILE, VALUE); \ ! fprintf(FILE, "\n"); \ ! } while (0) /* This is how to output an assembler line defining a `long int' constant. *************** *** 1183,1187 **** /* This is how to output an assembler line for a numeric constant byte. */ ! #define ASM_OUTPUT_BYTE(FILE,VALUE) ASM_OUTPUT_CHAR(FILE,VALUE) /* This is how to output an insn to push a register on the stack. --- 1205,1209 ---- /* This is how to output an assembler line for a numeric constant byte. */ ! #define ASM_OUTPUT_BYTE(FILE,VALUE) fprintf(FILE, "\tdata\t#%x\n", VALUE) /* This is how to output an insn to push a register on the stack. *************** *** 1246,1254 **** #define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) do { \ ! fprintf(FILE, "\tinit\n\t"); assemble_name(NAME); \ ! fprintf(FILE," ;constructor"); } while (0) #define ASM_OUTPUT_DESTRUCTOR(FILE, NAME) do { \ ! fprintf(FILE, "\tinit\n\t"); assemble_name(NAME); \ fprintf(FILE," ;destructor"); } while (0) --- 1268,1276 ---- #define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) do { \ ! fprintf(FILE, "\tinit\n\t"); assemble_name(FILE, NAME); \ ! fprintf(FILE," ;constructor\n"); } while (0) #define ASM_OUTPUT_DESTRUCTOR(FILE, NAME) do { \ ! fprintf(FILE, "\tinit\n\t"); assemble_name(FILE, NAME); \ fprintf(FILE," ;destructor"); } while (0) *************** *** 1277,1281 **** 'F': print a label defining a floating-point constant value 'J': print the absolute value of a negative INT_CONST ! (this is used in LISN/CISN/MISN/SISP and others) */ /* 1750A: see file aux-output.c */ --- 1299,1305 ---- 'F': print a label defining a floating-point constant value 'J': print the absolute value of a negative INT_CONST ! (this is used in LISN/CISN/MISN/SISP and others) ! 'Q': print a 1750 Base-Register-with-offset instruction's operands ! */ /* 1750A: see file aux-output.c */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/1750a/1750a.md gcc-2.7.1/config/1750a/1750a.md *** gcc-2.7.0/config/1750a/1750a.md Thu Jun 15 16:44:33 1995 --- gcc-2.7.1/config/1750a/1750a.md Thu Nov 9 11:19:56 1995 *************** *** 1,6 **** ;;- Machine description for GNU compiler ;;- MIL-STD-1750A version. ! ;; Copyright (C) 1994 Free Software Foundation, Inc. ! ;; Contributed by O.M.Kellogg, DASA (okellogg@salyko.cube.net). ;; This file is part of GNU CC. --- 1,6 ---- ;;- Machine description for GNU compiler ;;- MIL-STD-1750A version. ! ;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. ! ;; Contributed by O.M.Kellogg, DASA (kellogg@space.otn.dasa.de). ;; This file is part of GNU CC. *************** *** 194,203 **** (match_operand:QI 1 "general_operand" "I,J,i,r,m")))] "" ! "@ ! cisp r%0,%1 ! cisn r%0,%J1 ! cim r%0,%1 ! cr r%0,r%1 ! c r%0,%1 ") (define_insn "cmphi" --- 194,226 ---- (match_operand:QI 1 "general_operand" "I,J,i,r,m")))] "" ! "* ! { ! if (next_cc_user_is_unsigned (insn)) ! switch (which_alternative) ! { ! case 0: ! case 1: ! case 2: ! return \"ucim.m %0,%1\"; ! case 3: ! return \"ucr.m %0,%1\"; ! case 4: ! return \"uc.m %0,%1\"; ! } ! else ! switch (which_alternative) ! { ! case 0: ! return \"cisp r%0,%1\"; ! case 1: ! return \"cisn r%0,%J1\"; ! case 2: ! return \"cim r%0,%1\"; ! case 3: ! return \"cr r%0,r%1\"; ! case 4: ! return \"c r%0,%1\"; ! } ! } ") (define_insn "cmphi" *************** *** 212,220 **** (define_insn "cmphf" [(set (cc0) ! (compare (match_operand:HF 0 "general_operand" "r,r") ! (match_operand:HF 1 "general_operand" "r,m")))] "" "@ fcr r%0,r%1 fc r%0,%1 ") --- 235,244 ---- (define_insn "cmphf" [(set (cc0) ! (compare (match_operand:HF 0 "general_operand" "r,z,r") ! (match_operand:HF 1 "general_operand" "r,Q,m")))] "" "@ fcr r%0,r%1 + fcb %Q1 fc r%0,%1 ") *************** *** 345,350 **** (define_insn "movqi" ! [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,r,r,r,m,m") ! (match_operand:QI 1 "general_operand" "O,I,J,M,i,r,m,r,K"))] "" "@ --- 369,374 ---- (define_insn "movqi" ! [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,r,r,t,r,Q,m,m") ! (match_operand:QI 1 "general_operand" "O,I,J,M,i,r,Q,m,t,r,K"))] "" "@ *************** *** 355,359 **** --- 379,385 ---- lim r%0,%1 ; 'i' constraint lr r%0,r%1 + lb %Q1 l r%0,%1 + stb %Q0 st r%1,%0 stc %1,%0 ") *************** *** 396,406 **** (define_insn "movhi" ! [(set (match_operand:HI 0 "general_operand" "=r,r,m") ! (match_operand:HI 1 "general_operand" "r,m,r"))] "" "@ ! dlr r%0,r%1 ! dl r%0,%1 ! dst r%1,%0 ") --- 422,434 ---- (define_insn "movhi" ! [(set (match_operand:HI 0 "general_operand" "=r,z,r,Q,m") ! (match_operand:HI 1 "general_operand" "r,Q,m,z,r"))] "" "@ ! dlr r%0,r%1 ! dlb %Q1 ! dl r%0,%1 ! dstb %Q0 ! dst r%1,%0 ") *************** *** 418,428 **** (define_insn "movhf" ! [(set (match_operand:HF 0 "general_operand" "=r,r,m") ! (match_operand:HF 1 "general_operand" "r,m,r"))] "" "@ ! dlr r%0,r%1 ! dl r%0,%1 ! dst r%1,%0 ") --- 446,458 ---- (define_insn "movhf" ! [(set (match_operand:HF 0 "general_operand" "=r,z,r,Q,m") ! (match_operand:HF 1 "general_operand" "r,Q,m,z,r"))] "" "@ ! dlr r%0,r%1 ! dlb %Q1 ! dl r%0,%1 ! dstb %Q0 ! dst r%1,%0 ") *************** *** 453,469 **** ;; single integer - ;; Use "LIM Ra,sym,Rb" for adding a symbol value to a register and - ;; transferring the result to a different register. - ;(define_insn "" - ; [(set (match_operand:QI 0 "register_operand" "=r") - ; (plus:QI (match_operand:QI 1 "register_operand" "b") - ; (match_operand:QI 2 "immediate_operand" "i")))] - ; "REGNO(operands[0]) != REGNO(operands[1])" - ; "lim r%0,%2,r%1 ;md special addqi") - (define_insn "addqi3" ! [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,r,m,m") ! (plus:QI (match_operand:QI 1 "general_operand" "%0,0,0,0,0,0,0") ! (match_operand:QI 2 "general_operand" "I,J,i,r,m,I,J")))] "" "* --- 483,490 ---- ;; single integer (define_insn "addqi3" ! [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,t,r,m,m") ! (plus:QI (match_operand:QI 1 "general_operand" "%0,0,0,0,0,0,0,0") ! (match_operand:QI 2 "general_operand" "I,J,i,r,Q,m,I,J")))] "" "* *************** *** 482,489 **** return \"ar r%0,r%2\"; case 4: ! return \"a r%0,%2\"; case 5: ! return \"incm %2,%0\"; case 6: return \"decm %J2,%0\"; } ") --- 503,512 ---- return \"ar r%0,r%2\"; case 4: ! return \"ab %Q2\"; case 5: ! return \"a r%0,%2\"; case 6: + return \"incm %2,%0\"; + case 7: return \"decm %J2,%0\"; } ") *************** *** 500,510 **** (define_insn "addhf3" ! [(set (match_operand:HF 0 "register_operand" "=r,r") ! (plus:HF (match_operand:HF 1 "register_operand" "%0,0") ! (match_operand:HF 2 "general_operand" "m,r")))] "" "@ ! fa r%0,%2 ! far r%0,r%2 ") (define_insn "addtqf3" --- 523,534 ---- (define_insn "addhf3" ! [(set (match_operand:HF 0 "register_operand" "=r,z,r") ! (plus:HF (match_operand:HF 1 "register_operand" "%0,0,0") ! (match_operand:HF 2 "general_operand" "r,Q,m")))] "" "@ ! far r%0,r%2 ! fab %Q2 ! fa r%0,%2 ") (define_insn "addtqf3" *************** *** 511,519 **** [(set (match_operand:TQF 0 "register_operand" "=r,r") (plus:TQF (match_operand:TQF 1 "register_operand" "%0,0") ! (match_operand:TQF 2 "general_operand" "m,r")))] "" "@ ! efa r%0,%2 ! efar r%0,r%2 ") --- 535,543 ---- [(set (match_operand:TQF 0 "register_operand" "=r,r") (plus:TQF (match_operand:TQF 1 "register_operand" "%0,0") ! (match_operand:TQF 2 "general_operand" "r,m")))] "" "@ ! efar r%0,r%2 ! efa r%0,%2 ") *************** *** 522,528 **** ;; single integer (define_insn "subqi3" ! [(set (match_operand:QI 0 "general_operand" "=r,r,r,r,m") ! (minus:QI (match_operand:QI 1 "general_operand" "0,0,0,0,0") ! (match_operand:QI 2 "general_operand" "I,i,r,m,I")))] "" "@ --- 546,552 ---- ;; single integer (define_insn "subqi3" ! [(set (match_operand:QI 0 "general_operand" "=r,r,r,t,r,m") ! (minus:QI (match_operand:QI 1 "general_operand" "0,0,0,0,0,0") ! (match_operand:QI 2 "general_operand" "I,i,r,Q,m,I")))] "" "@ *************** *** 530,533 **** --- 554,558 ---- sim r%0,%2 sr r%0,r%2 + sbb %Q2 s r%0,%2 decm %2,%0 ") *************** *** 544,553 **** (define_insn "subhf3" ! [(set (match_operand:HF 0 "register_operand" "=r,r") ! (minus:HF (match_operand:HF 1 "register_operand" "0,0") ! (match_operand:HF 2 "general_operand" "r,m")))] "" "@ fsr r%0,r%2 fs r%0,%2 ") --- 569,579 ---- (define_insn "subhf3" ! [(set (match_operand:HF 0 "register_operand" "=r,z,r") ! (minus:HF (match_operand:HF 1 "register_operand" "0,0,0") ! (match_operand:HF 2 "general_operand" "r,Q,m")))] "" "@ fsr r%0,r%2 + fsb %Q2 fs r%0,%2 ") *************** *** 579,585 **** ; 32-bit product (define_insn "mulqihi3" ! [(set (match_operand:HI 0 "register_operand" "=r,r,r") ! (mult:HI (match_operand:QI 1 "register_operand" "%0,0,0") ! (match_operand:QI 2 "general_operand" "M,r,m")))] "" "@ --- 605,611 ---- ; 32-bit product (define_insn "mulqihi3" ! [(set (match_operand:HI 0 "register_operand" "=r,r,t,r") ! (mult:HI (match_operand:QI 1 "register_operand" "%0,0,0,0") ! (match_operand:QI 2 "general_operand" "M,r,Q,m")))] "" "@ *************** *** 586,589 **** --- 612,616 ---- mim r%0,%1 mr r%0,r%2 + mb %Q2 m r%0,%2 ") *************** *** 600,609 **** (define_insn "mulhf3" ! [(set (match_operand:HF 0 "register_operand" "=r,r") ! (mult:HF (match_operand:HF 1 "register_operand" "%0,0") ! (match_operand:HF 2 "general_operand" "r,m")))] "" "@ fmr r%0,r%2 fm r%0,%2 ") --- 627,637 ---- (define_insn "mulhf3" ! [(set (match_operand:HF 0 "register_operand" "=r,z,r") ! (mult:HF (match_operand:HF 1 "register_operand" "%0,0,0") ! (match_operand:HF 2 "general_operand" "r,Q,m")))] "" "@ fmr r%0,r%2 + fmb %Q2 fm r%0,%2 ") *************** *** 672,681 **** (define_insn "divhf3" ! [(set (match_operand:HF 0 "register_operand" "=r,r") ! (div:HF (match_operand:HF 1 "register_operand" "0,0") ! (match_operand:HF 2 "general_operand" "r,m")))] "" "@ fdr r%0,r%2 fd r%0,%2 ") --- 700,710 ---- (define_insn "divhf3" ! [(set (match_operand:HF 0 "register_operand" "=r,z,r") ! (div:HF (match_operand:HF 1 "register_operand" "0,0,0") ! (match_operand:HF 2 "general_operand" "r,Q,m")))] "" "@ fdr r%0,r%2 + fdb %Q2 fd r%0,%2 ") *************** *** 751,757 **** (define_insn "andqi3" ! [(set (match_operand:QI 0 "general_operand" "=r,r,r") ! (and:QI (match_operand:QI 1 "general_operand" "%0,0,0") ! (match_operand:QI 2 "general_operand" "M,r,m")))] "" "@ --- 780,786 ---- (define_insn "andqi3" ! [(set (match_operand:QI 0 "general_operand" "=r,r,t,r") ! (and:QI (match_operand:QI 1 "general_operand" "%0,0,0,0") ! (match_operand:QI 2 "general_operand" "M,r,Q,m")))] "" "@ *************** *** 758,761 **** --- 787,791 ---- andm r%0,%2 andr r%0,r%2 + andb %Q2 and r%0,%2 ") *************** *** 771,777 **** (define_insn "iorqi3" ! [(set (match_operand:QI 0 "general_operand" "=r,r,r") ! (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0") ! (match_operand:QI 2 "general_operand" "M,r,m")))] "" "@ --- 801,807 ---- (define_insn "iorqi3" ! [(set (match_operand:QI 0 "general_operand" "=r,r,t,r") ! (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0,0") ! (match_operand:QI 2 "general_operand" "M,r,Q,m")))] "" "@ *************** *** 778,781 **** --- 808,812 ---- orim r%0,%2 orr r%0,r%2 + orb %Q2 or r%0,%2 ") *************** *** 848,857 **** ; (What to the 1750 is logical-shift-left, GCC likes to call "arithmetic") (define_insn "ashlqi3" ! [(set (match_operand:QI 0 "register_operand" "=r,r,r") ! (ashift:QI (match_operand:QI 1 "register_operand" "0,0,0") ! (match_operand:QI 2 "general_operand" "O,I,r")))] "" "@ - ; optimized away an SLL r%0,0 sll r%0,%2 slr r%0,r%2 ") --- 879,887 ---- ; (What to the 1750 is logical-shift-left, GCC likes to call "arithmetic") (define_insn "ashlqi3" ! [(set (match_operand:QI 0 "register_operand" "=r,r") ! (ashift:QI (match_operand:QI 1 "register_operand" "0,0") ! (match_operand:QI 2 "general_operand" "I,r")))] "" "@ sll r%0,%2 slr r%0,r%2 ") *************** *** 866,906 **** dslr r%0,r%2 ") ! (define_insn "lshrqi3" ! [(set (match_operand:QI 0 "register_operand" "=r,r") ! (lshiftrt:QI (match_operand:QI 1 "register_operand" "0,0") ! (match_operand:QI 2 "general_operand" "I,r")))] "" ! "@ ! srl r%0,%2 ! neg r%2,r%2\;slr r%0,r%2 ") ! (define_insn "lshrhi3" ! [(set (match_operand:HI 0 "register_operand" "=r,r") ! (lshiftrt:HI (match_operand:HI 1 "register_operand" "0,0") ! (match_operand:QI 2 "general_operand" "L,r")))] ! "" ; the 'L' constraint is a slight imprecise... ! "@ ! dsrl r%0,%2 ! neg r%2,r%2\;dslr r%0,r%2 ") ! (define_insn "ashrqi3" ! [(set (match_operand:QI 0 "register_operand" "=r,r") ! (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0") ! (match_operand:QI 2 "general_operand" "I,r")))] "" ! "@ ! sra r%0,%2 ! neg r%2,r%2\;sar r%0,r%2 ") ! (define_insn "ashrhi3" ! [(set (match_operand:HI 0 "register_operand" "=r,r") ! (ashiftrt:HI (match_operand:HI 1 "register_operand" "0,0") ! (match_operand:QI 2 "general_operand" "I,r")))] "" ! "@ ! dsra r%0,%2 ! neg r%2,r%2\;dsar r%0,r%2 ") ;; rotate instructions --- 896,1008 ---- dslr r%0,r%2 ") ! ;; Right shift by a variable shiftcount works by negating the shift count, ! ;; then emitting a right shift with the shift count negated. This means ! ;; that all actual shift counts in the RTL will be positive. This ! ;; prevents converting shifts to ZERO_EXTRACTs with negative positions, ! ;; which isn't valid. ! (define_expand "lshrqi3" ! [(set (match_operand:QI 0 "general_operand" "=g") ! (lshiftrt:QI (match_operand:QI 1 "general_operand" "0") ! (match_operand:QI 2 "general_operand" "g")))] "" ! " ! { ! if (GET_CODE (operands[2]) != CONST_INT) ! operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); ! }") ! (define_insn "" ! [(set (match_operand:QI 0 "register_operand" "=r") ! (lshiftrt:QI (match_operand:QI 1 "register_operand" "0") ! (match_operand:QI 2 "immediate_operand" "I")))] ! "" ! "srl r%0,%1") ! (define_insn "" ! [(set (match_operand:QI 0 "register_operand" "=r") ! (lshiftrt:QI (match_operand:QI 1 "register_operand" "0") ! (neg:QI (match_operand:QI 2 "register_operand" "r"))))] "" ! "slr r%0,r%2 ") ! ;; Same thing for HImode. ! (define_expand "lshrhi3" ! [(set (match_operand:HI 0 "general_operand" "=g") ! (lshiftrt:HI (match_operand:HI 1 "general_operand" "0") ! (match_operand:QI 2 "general_operand" "g")))] "" ! " ! { ! if (GET_CODE (operands[2]) != CONST_INT) ! operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); ! }") ! ! (define_insn "" ! [(set (match_operand:HI 0 "register_operand" "=r") ! (lshiftrt:HI (match_operand:HI 1 "register_operand" "0") ! (match_operand:QI 2 "immediate_operand" "L")))] ! "" ! "dsrl r%0,%1") ! ! (define_insn "" ! [(set (match_operand:HI 0 "register_operand" "=r") ! (lshiftrt:HI (match_operand:HI 1 "register_operand" "0") ! (neg:QI (match_operand:QI 2 "register_operand" "r"))))] ! "" ! "dslr r%0,r%2 ") ! ! ;; Same applies for arithmetic shift right. ! (define_expand "ashrqi3" ! [(set (match_operand:QI 0 "general_operand" "=g") ! (ashiftrt:QI (match_operand:QI 1 "general_operand" "0") ! (match_operand:QI 2 "general_operand" "g")))] ! "" ! " ! { ! if (GET_CODE (operands[2]) != CONST_INT) ! operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); ! }") ! ! (define_insn "" ! [(set (match_operand:QI 0 "register_operand" "=r") ! (ashiftrt:QI (match_operand:QI 1 "register_operand" "0") ! (match_operand:QI 2 "immediate_operand" "I")))] ! "" ! "sra r%0,%1") ! ! (define_insn "" ! [(set (match_operand:QI 0 "register_operand" "=r") ! (ashiftrt:QI (match_operand:QI 1 "register_operand" "0") ! (neg:QI (match_operand:QI 2 "register_operand" "r"))))] ! "" ! "sar r%0,r%2 ") ! ! ;; HImode arithmetic shift right. ! (define_expand "ashrhi3" ! [(set (match_operand:HI 0 "general_operand" "=g") ! (ashiftrt:HI (match_operand:HI 1 "general_operand" "0") ! (match_operand:QI 2 "general_operand" "g")))] ! "" ! " ! { ! if (GET_CODE (operands[2]) != CONST_INT) ! operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); ! }") ! ! (define_insn "" ! [(set (match_operand:HI 0 "register_operand" "=r") ! (ashiftrt:HI (match_operand:HI 1 "register_operand" "0") ! (match_operand:QI 2 "immediate_operand" "L")))] ! "" ! "dsra r%0,%1") + (define_insn "" + [(set (match_operand:HI 0 "register_operand" "=r") + (ashiftrt:HI (match_operand:HI 1 "register_operand" "0") + (neg:QI (match_operand:QI 2 "register_operand" "r"))))] + "" + "dsar r%0,r%2 ") + ;; rotate instructions *************** *** 924,943 **** (define_insn "rotrqi3" ! [(set (match_operand:QI 0 "register_operand" "=r,r") ! (rotatert:QI (match_operand:QI 1 "register_operand" "0,0") ! (match_operand:QI 2 "general_operand" "I,r")))] "" ! "@ ! slc r%0,%2 ! neg r%2,r%2\;scr r%0,r%2 ") (define_insn "rotrhi3" ! [(set (match_operand:HI 0 "register_operand" "=r,r") ! (rotatert:HI (match_operand:HI 1 "register_operand" "0,0") ! (match_operand:QI 2 "general_operand" "I,r")))] "" ! "@ ! dslc r%0,%2 ! neg r%2,r%2\;dscr r%0,r%2 ") --- 1026,1041 ---- (define_insn "rotrqi3" ! [(set (match_operand:QI 0 "register_operand" "=r") ! (rotatert:QI (match_operand:QI 1 "register_operand" "0") ! (match_operand:QI 2 "register_operand" "r")))] "" ! "neg r%2,r%2\;scr r%0,r%2 ") (define_insn "rotrhi3" ! [(set (match_operand:HI 0 "register_operand" "=r") ! (rotatert:HI (match_operand:HI 1 "register_operand" "0") ! (match_operand:QI 2 "general_operand" "r")))] "" ! "neg r%2,r%2\;dscr r%0,r%2 ") *************** *** 951,955 **** ;; Bit field instructions, general cases. ! ;; "o,d" constraint causes a nonoffsettable memref to match the "o" ;; so that its address is reloaded. --- 1049,1053 ---- ;; Bit field instructions, general cases. ! ;; "o,d" constraint causes a nonoffsetable memref to match the "o" ;; so that its address is reloaded. *************** *** 1193,1197 **** (label_ref (match_operand 0 "" "")))] "" ! "jc uc,%0") ;; Call subroutine, returning value in operand 0 --- 1291,1295 ---- (label_ref (match_operand 0 "" "")))] "" ! "jc 15,%0") ;; Call subroutine, returning value in operand 0 *************** *** 1257,1260 **** "soj r%0,%3") ! ;;;End. --- 1355,1379 ---- "soj r%0,%3") ! ;; Combine a Load Register with subsequent increment/decrement into a LIM ! (define_peephole ! [(set (match_operand:QI 0 "register_operand" "=r") ! (match_operand:QI 1 "register_operand" "b")) ! (set (match_dup 0) ! (plus:QI (match_dup 0) ! (match_operand:QI 2 "immediate_operand" "i")))] ! "REGNO(operands[1]) > 0" ! "lim r%0,%2,r%1 ; LR,inc/dec peephole") + ;; Eliminate the redundant load in a store/load sequence + (define_peephole + [(set (mem:QI (plus:QI (match_operand:QI 0 "register_operand" "r") + (match_operand:QI 1 "immediate_operand" "i"))) + (match_operand:QI 2 "register_operand" "r")) + (set (match_operand:QI 3 "register_operand" "=r") + (mem:QI (plus:QI (match_dup 0) + (match_dup 1)))) + ] + "REGNO(operands[2]) == REGNO(operands[3])" + "st r%2,%1,r%0 ; eliminated previous redundant load") + + ;;;End. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/1750a/ms1750.inc gcc-2.7.1/config/1750a/ms1750.inc *** gcc-2.7.0/config/1750a/ms1750.inc Tue Sep 20 19:26:51 1994 --- gcc-2.7.1/config/1750a/ms1750.inc Sat Jul 29 09:10:16 1995 *************** *** 72,73 **** --- 72,114 ---- ENDMACRO + ; Unsigned Compare Immediate + + MACRO UCIM.M + LAST SET `1` + 3 + PSHM R`1`,R`LAST` + LO SET `1` + 1 + LR R`LO`,R`1` + XORR R`1`,R`1` + HI SET `1` + 2 + XORR R`HI`,R`HI` + LIM R`LAST`,`2` + DCR R`1`,R`HI` + POPM R`1`,R`LAST` + ENDMACRO + + + ; Unsigned Compare Register with register + + MACRO UCR.M + PSHM R10,R13 ; R12 and R13 are assumed not to be input parameters + LR R13,R`2` + LR R11,R`1` + XORR R12,R12 + XORR R10,R10 + DCR R10,R12 + POPM R10,R13 + ENDMACRO + + + ; Unsigned Compare register with memory + + MACRO UC.M + PSHM R10,R13 + L R13,`2` + LR R11,R`1` + XORR R12,R12 + XORR R10,R10 + DCR R10,R12 + POPM R10,R13 + ENDMACRO + diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/a29k/t-a29k gcc-2.7.1/config/a29k/t-a29k *** gcc-2.7.0/config/a29k/t-a29k Wed May 31 14:54:59 1995 --- gcc-2.7.1/config/a29k/t-a29k Sat Jul 29 09:30:57 1995 *************** *** 1,4 **** ! LIBGCC1 = libgcc1.null ! CROSS_LIBGCC1 = libgcc1.null # We need crt0.o. --- 1,4 ---- ! LIBGCC1 = ! CROSS_LIBGCC1 = # We need crt0.o. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/a29k/t-a29kbare gcc-2.7.1/config/a29k/t-a29kbare *** gcc-2.7.0/config/a29k/t-a29kbare Wed May 31 14:55:03 1995 --- gcc-2.7.1/config/a29k/t-a29kbare Sat Jul 29 09:31:00 1995 *************** *** 1,4 **** ! LIBGCC1 = libgcc1.null ! CROSS_LIBGCC1 = libgcc1.null # We need crt0.o. --- 1,4 ---- ! LIBGCC1 = ! CROSS_LIBGCC1 = # We need crt0.o. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/a29k/t-vx29k gcc-2.7.1/config/a29k/t-vx29k *** gcc-2.7.0/config/a29k/t-vx29k Wed May 31 14:55:06 1995 --- gcc-2.7.1/config/a29k/t-vx29k Sat Jul 29 09:31:03 1995 *************** *** 1,4 **** ! LIBGCC1 = libgcc1.null ! CROSS_LIBGCC1 = libgcc1.null # We need crt0.o. --- 1,4 ---- ! LIBGCC1 = ! CROSS_LIBGCC1 = # We need crt0.o. *************** *** 16,19 **** echo '#define FLOAT' > fp-bit.c cat $(srcdir)/config/fp-bit.c >> fp-bit.c - - --- 16,17 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/alpha/alpha.c gcc-2.7.1/config/alpha/alpha.c *** gcc-2.7.0/config/alpha/alpha.c Fri Jun 16 06:57:32 1995 --- gcc-2.7.1/config/alpha/alpha.c Fri Oct 27 06:49:45 1995 *************** *** 371,377 **** return 0; ! return (GET_CODE (op) == SYMBOL_REF ! || (GET_CODE (op) == REG ! && (REGNO (op) == 27 || WINDOWS_NT))); } --- 371,375 ---- return 0; ! return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG); } *************** *** 696,700 **** if ((HOST_BITS_PER_WIDE_INT != 64 || c >> 31 == -1 || c >> 31 == 0) ! && c != 0x80000000u) { HOST_WIDE_INT low = (c & 0xffff) - 2 * (c & 0x8000); --- 694,698 ---- if ((HOST_BITS_PER_WIDE_INT != 64 || c >> 31 == -1 || c >> 31 == 0) ! && c != 0x80000000U) { HOST_WIDE_INT low = (c & 0xffff) - 2 * (c & 0x8000); *************** *** 1164,1170 **** RTX_UNCHANGING_P (XEXP (block, 0)) = 1; ! /* Store the address of the first integer register in the __base member. ! Note that our offsets are correct for both 32- and 64-bit pointers ! due to the alignment of the __offset field (a long). */ #ifdef POINTERS_EXTEND_UNSIGNED --- 1162,1166 ---- RTX_UNCHANGING_P (XEXP (block, 0)) = 1; ! /* Store the address of the first integer register in the __base member. */ #ifdef POINTERS_EXTEND_UNSIGNED *************** *** 1175,1182 **** /* Store the argsize as the __va_offset member. */ ! emit_move_insn (change_address (block, ptr_mode, plus_constant (XEXP (block, 0), ! GET_MODE_SIZE (ptr_mode))), ! force_operand (argsize, NULL_RTX)); /* Return the address of the va_list constructor, but don't put it in a --- 1171,1178 ---- /* Store the argsize as the __va_offset member. */ ! emit_move_insn (change_address (block, TYPE_MODE (integer_type_node), plus_constant (XEXP (block, 0), ! POINTER_SIZE/BITS_PER_UNIT)), ! argsize); /* Return the address of the va_list constructor, but don't put it in a diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/alpha/alpha.h gcc-2.7.1/config/alpha/alpha.h *** gcc-2.7.0/config/alpha/alpha.h Thu Jun 15 09:08:45 1995 --- gcc-2.7.1/config/alpha/alpha.h Sun Oct 22 07:36:59 1995 *************** *** 43,49 **** #define SIGNED_CHAR_SPEC "%{funsigned-char:-D__CHAR_UNSIGNED__}" - /* No point in running CPP on our assembler output. */ - #define ASM_SPEC "-nocpp %{pg}" - /* Under OSF/1, -p and -pg require -lprof1. */ --- 43,46 ---- *************** *** 505,509 **** && (((VALUE)) >> 31 == -1 || (VALUE) >> 31 == 0) \ && ((HOST_BITS_PER_WIDE_INT == 64 \ ! || (unsigned) (VALUE) != 0x80000000u))) \ : (C) == 'M' ? zap_mask (VALUE) \ : (C) == 'N' ? (unsigned HOST_WIDE_INT) (~ (VALUE)) < 0x100 \ --- 502,506 ---- && (((VALUE)) >> 31 == -1 || (VALUE) >> 31 == 0) \ && ((HOST_BITS_PER_WIDE_INT == 64 \ ! || (unsigned) (VALUE) != 0x80000000U))) \ : (C) == 'M' ? zap_mask (VALUE) \ : (C) == 'N' ? (unsigned HOST_WIDE_INT) (~ (VALUE)) < 0x100 \ *************** *** 1089,1092 **** --- 1086,1103 ---- perror ("mprotect of trampoline code"); \ } + + /* A C expression whose value is RTL representing the value of the return + address for the frame COUNT steps up from the current frame. + FRAMEADDR is the frame pointer of the COUNT frame, or the frame pointer of + the COUNT-1 frame if RETURN_ADDR_IN_PREVIOUS_FRAME} is defined. + + This definition for Alpha is broken, but is put in at the request of + Mike Stump. */ + + #define RETURN_ADDR_RTX(COUNT, FRAME) \ + ((COUNT == 0 && alpha_sa_size () == 0 && 0 /* not right. */) \ + ? gen_rtx (REG, Pmode, 26) \ + : gen_rtx (MEM, Pmode, \ + memory_address (Pmode, FRAME))) /* Addressing modes, and classification of registers for them. */ *************** *** 1171,1178 **** this is an "unaligned" access. - We also allow a SYMBOL_REF that is the name of the current function as - valid address. This is for CALL_INSNs. It cannot be used in any other - context. - First define the basic valid address. */ --- 1182,1185 ---- *************** *** 1192,1197 **** address that turns off the low three bits. */ - extern char *current_function_name; - #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ { GO_IF_LEGITIMATE_SIMPLE_ADDRESS (MODE, X, ADDR); \ --- 1199,1202 ---- *************** *** 1201,1207 **** && INTVAL (XEXP (X, 1)) == -8) \ GO_IF_LEGITIMATE_SIMPLE_ADDRESS (MODE, XEXP (X, 0), ADDR); \ - if ((MODE) == Pmode && GET_CODE (X) == SYMBOL_REF \ - && ! strcmp (XSTR (X, 0), current_function_name)) \ - goto ADDR; \ } --- 1206,1209 ---- *************** *** 1527,1531 **** indicate that it is for read-only data. ! The first timem we enter the readonly data sectiono for a file, we write eight bytes of zero. This works around a bug in DEC's assembler in some versions of OSF/1 V3.x. */ --- 1529,1533 ---- indicate that it is for read-only data. ! The first time we enter the readonly data section for a file, we write eight bytes of zero. This works around a bug in DEC's assembler in some versions of OSF/1 V3.x. */ *************** *** 1728,1732 **** if (i < thissize - 1 \ && p[i + 1] >= '0' && p[i + 1] <= '9') \ ! fprintf (asm_out_file, "\"\n\t.ascii \""); \ } \ } \ --- 1730,1734 ---- if (i < thissize - 1 \ && p[i + 1] >= '0' && p[i + 1] <= '9') \ ! _size_so_far = 0, fprintf (asm_out_file, "\"\n\t.ascii \""); \ } \ } \ *************** *** 1921,1926 **** accordingly. These debugger offsets are set up in output_prolog. */ ! long alpha_arg_offset; ! long alpha_auto_offset; #define DEBUGGER_AUTO_OFFSET(X) \ ((GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) + alpha_auto_offset) --- 1923,1928 ---- accordingly. These debugger offsets are set up in output_prolog. */ ! extern long alpha_arg_offset; ! extern long alpha_auto_offset; #define DEBUGGER_AUTO_OFFSET(X) \ ((GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) + alpha_auto_offset) *************** *** 2011,2014 **** --- 2013,2030 ---- #define PUT_SDB_EPILOGUE_END(NAME) + + /* No point in running CPP on our assembler output. */ + #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GAS) != 0 + /* Don't pass -g to GNU as, because some versions don't accept this option. */ + #define ASM_SPEC "%{malpha-as:-g} -nocpp %{pg}" + #else + /* In OSF/1 v3.2c, the assembler by default does not output file names which + causes mips-tfile to fail. Passing -g to the assembler fixes this problem. + ??? Stricly speaking, we only need -g if the user specifies -g. Passing + it always means that we get slightly larger than necessary object files + if the user does not specify -g. If we don't pass -g, then mips-tfile + will need to be fixed to work in this case. */ + #define ASM_SPEC "%{!mgas:-g} -nocpp %{pg}" + #endif /* Specify to run a post-processor, mips-tfile after the assembler diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/alpha/alpha.md gcc-2.7.1/config/alpha/alpha.md *** gcc-2.7.0/config/alpha/alpha.md Thu Jun 15 16:45:25 1995 --- gcc-2.7.1/config/alpha/alpha.md Fri Oct 27 06:49:59 1995 *************** *** 1884,1888 **** [(set (cc0) (compare (match_operand:DF 0 "reg_or_fp0_operand" "") (match_operand:DF 1 "reg_or_fp0_operand" "")))] ! "" " { --- 1884,1888 ---- [(set (cc0) (compare (match_operand:DF 0 "reg_or_fp0_operand" "") (match_operand:DF 1 "reg_or_fp0_operand" "")))] ! "TARGET_FP" " { *************** *** 2651,2656 **** operands[0] = XEXP (operands[0], 0); ! if (GET_CODE (operands[0]) != SYMBOL_REF) ! operands[0] = force_reg (Pmode, operands[0]); }") --- 2651,2661 ---- operands[0] = XEXP (operands[0], 0); ! if (GET_CODE (operands[1]) != SYMBOL_REF ! && ! (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == 27)) ! { ! rtx tem = gen_rtx (REG, DImode, 27); ! emit_move_insn (tem, operands[1]); ! operands[1] = tem; ! } }") *************** *** 2702,2707 **** operands[1] = XEXP (operands[1], 0); ! if (GET_CODE (operands[1]) != SYMBOL_REF) ! operands[1] = force_reg (Pmode, operands[1]); }") --- 2707,2717 ---- operands[1] = XEXP (operands[1], 0); ! if (GET_CODE (operands[1]) != SYMBOL_REF ! && ! (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == 27)) ! { ! rtx tem = gen_rtx (REG, DImode, 27); ! emit_move_insn (tem, operands[1]); ! operands[1] = tem; ! } }") *************** *** 3161,3164 **** --- 3171,3175 ---- { emit_move_insn (operands[0], XEXP (operands[1], 0)); + operands[1] = copy_rtx (operands[1]); XEXP (operands[1], 0) = operands[0]; } Only in gcc-2.7.0/config/alpha: config-nt.bat diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/alpha/config-nt.sed gcc-2.7.1/config/alpha/config-nt.sed *** gcc-2.7.0/config/alpha/config-nt.sed Mon May 22 18:54:11 1995 --- gcc-2.7.1/config/alpha/config-nt.sed Fri Sep 15 17:57:25 1995 *************** *** 24,133 **** /^host_xm_file/ c\ host_xm_file=config/alpha/xm-winnt.h ! /^lang_specs_files=/ d ! /^lang_options_files=/ d ! /^version=/ c\ ! version=2.6.3 ! s/CC = cc/CC = cl/ ! s/^SHELL =.*/SHELL =/ ! s/CFLAGS = -g/CFLAGS =/ ! s/:\$/: \$/g ! s/<\ *\$(srcdir)\//< $(srcdir)\\/g ! s/^ \$(srcdir)\/move-if-change/ copy/ ! s/^USE_/# USE_/ ! s/`echo \$(srcdir)\///g ! s/ | sed 's,\^\\\.\/,,'`//g ! s/^ cd \$(srcdir)[ ]*;/ / ! /^stamp-attrtab/,/copy/ { ! /\\$/d ! / fi/d ! /copy/ i\ ! \ genattrtab $(md_file) > tmp-attrtab.c ! } ! /^enquire[ ]*:/ s/\$(GCC_PARTS)//g ! /^enquire.o[ ]*:/ s/\$(GCC_PASSES)//g ! /^GCC_FOR_TARGET =/ c\ ! GCC_FOR_TARGET = gcc ! s/; *@true// ! /^OBJS.*stamp-objlist/ s?`cat ../stamp-objlist`?@../stamp-objlist? ! s/^\(SUBDIR_OBSTACK *=\).*$/\1 ..\/obstack.o/ ! s/^\(SUBDIR_USE_ALLOCA *=\).*$/\1/ ! s/^\(SUBDIR_MALLOC *=\).*$/\1/ ! /####target/ i\ ! STMP_FIXPROTO = \ ! OTHER_FIXINCLUDES_DIRS=/MSTOOLS/h \ ! RANLIB = : \ ! RANLIB_TEST = false \ ! OLDCC = cl \ ! MAKE = make \ ! SYMLINK = copy \ ! INSTALL = $(srcdir)/install.sh -c \ ! exeext = .exe \ ! objext = .obj \ ! oldobjext = .obj \ ! \ CC = cl \ ! CFLAGS = -Dalpha -DWIN32 -D_WIN32 -DWINNT -D_ALPHA_ \\\ -DALMOST_STDC \ - CLIB = oldnames.lib libc.lib kernel32.lib \ LDFLAGS = -subsystem:console -entry:mainCRTStartup \\\ ! -stack:1000000,1000000 \ ! \ ! EXTRA_PROGRAMS=ld.exe \ ! \ ! ld.obj: $(srcdir)/config/winnt/ld.c \ ! \ $(CC) $(CFLAGS) \\\ ! \ -I. -I$(srcdir) -I$(srcdir)/config -c $(srcdir)/config/winnt/ld.c \ ! ld.exe: ld.obj \ ! link32 -out:ld.exe ld.obj $(LDFLAGS) $(CLIB) ! \ ! EXTRA_OBJS=winnt.obj \ ! winnt.obj: $(srcdir)/config/alpha/winnt.c \ ! \ $(CC) $(CFLAGS) \\\ ! \ -I. -I$(srcdir) -I$(srcdir)/config -c $(srcdir)/config/alpha/winnt.c ! s/^C c:/Cc:/ ! s/\${OBJS}/\$(OBJS)/g ! s/\${SYSTEM_HEADER_DIR}/\$(SYSTEM_HEADER_DIR)/g ! s/\${HOST_CC}/\$(HOST_CC)/g ! s/ \${srcdir}\// /g ! s/\${mainversion}/\$(mainversion)/g ! s/\ $(srcdir)\/move-if-change$// ! s/\$(srcdir)\/move-if-change/copy/g ! /^# USE_HOST_OBSTACK/ i\ ! USE_HOST_OBSTACK=obstack.obj ! /^# USE_ALLOCA/ i\ ! USE_ALLOCA=alloca.obj ! /^# USE_HOST_ALLOCA/ i\ ! USE_HOST_ALLOCA=alloca.obj ! s/^ALLOCA =/ALLOCA = alloca.obj/ ! s/^ALLOCA_FINISH = true/ALLOCA_FINISH =/ ! s/ \.\// / ! s/^bi-\([a-z]*\) *:/bi-\1.exe :/ ! s/ bi-\([a-z]*\)$/ bi-\1.exe/ ! s/ bi-\([a-z]*\) / bi-\1.exe /g ! s/^gen\([a-z]*\) *:/gen\1.exe :/ ! s/ gen\([a-z]*\)$/ gen\1.exe/ ! s/ gen\([a-z]*\) / gen\1.exe /g ! s/genmultilib.exe/genmultilib/g ! s/^cccp *:/cccp.exe :/ ! s/cccp$/cccp.exe/ ! s/cccp /cccp.exe / ! s/CCCP=cccp.exe/CCCP=cccp/ ! s/^cpp *:/cpp.exe :/ ! s/cpp$/cpp.exe/ ! s/cpp /cpp.exe / ! s/^cc1 *:/cc1.exe :/ ! s/cc1$/cc1.exe/ ! s/cc1 /cc1.exe / ! s/^cc1obj *:/cc1obj.exe :/ ! s/cc1obj$/cc1obj.exe/ ! s/cc1obj /cc1obj.exe / ! s/^xgcc *:/xgcc.exe :/ ! s/xgcc$/xgcc.exe/ ! s/xgcc /xgcc.exe / ! s/\.o *:/.obj :/ ! s/\.o$/.obj/ ! s/\.o /.obj /g ! s/-rm -f cpp.exe/del cpp.exe/ ! s/\$(CC) \$(ALL_CFLAGS) \$(LDFLAGS) -o /link32 $(LDFLAGS) -out:/ ! s/\$(HOST_CC) \$(HOST_CFLAGS) \$(HOST_LDFLAGS) -o /link32 $(HOST_LDFLAGS) -out:/ ! s/^\ // --- 24,33 ---- /^host_xm_file/ c\ host_xm_file=config/alpha/xm-winnt.h ! /^####target/ i\ CC = cl \ ! CLIB = libc.lib kernel32.lib \ ! CFLAGS = -Dalpha -DWIN32 -D_WIN32 -D_ALPHA_ -D_M_ALPHA \\\ -DALMOST_STDC \ LDFLAGS = -subsystem:console -entry:mainCRTStartup \\\ ! -stack:1000000,1000 \ ! diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/alpha/win-nt.h gcc-2.7.1/config/alpha/win-nt.h *** gcc-2.7.0/config/alpha/win-nt.h --- gcc-2.7.1/config/alpha/win-nt.h Tue Sep 19 19:18:29 1995 *************** *** 0 **** --- 1,72 ---- + /* Definitions of target machine for GNU compiler, for DEC Alpha + running Windows/NT. + Copyright (C) 1995 Free Software Foundation, Inc. + Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + /* Say this is Windows/NT for the other config files. */ + #define WINDOWS_NT 1 + + #include "alpha/alpha.h" + + /* Names to predefine in the preprocessor for this target machine. */ + + #undef CPP_PREDEFINES + #define CPP_PREDEFINES "-DWIN32 -D_WIN32\ + -DWINNT -D__STDC__=0 -DALMOST_STDC -D_M_ALPHA\ + -D_ALPHA_ -D__alpha -D__alpha__ -D_LONGLONG -Asystem(winnt) -Acpu(alpha)\ + -Amachine(alpha)" + + #undef ASM_SPEC + #undef ASM_FINAL_SPEC + #define ASM_SPEC "-nopp -nologo" + + /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */ + #undef POINTER_SIZE + #define POINTER_SIZE 32 + #define POINTERS_EXTEND_UNSIGNED 0 + + /* "long" is 32 bits. */ + #undef LONG_TYPE_SIZE + #define LONG_TYPE_SIZE 32 + + /* We can't do any debugging. */ + #undef SDB_DEBUGGING_INFO + #undef DBX_DEBUGGING_INFO + #undef MIPS_DEBUGGING_INFO + + #include "winnt/win-nt.h" + + #undef ASM_FILE_START + #define ASM_FILE_START(FILE) \ + { \ + alpha_write_verstamp (FILE); \ + fprintf (FILE, "\t.set noreorder\n"); \ + fprintf (FILE, "\t.set volatile\n"); \ + fprintf (FILE, "\t.set noat\n"); \ + fprintf (FILE, "\t.globl\t__fltused\n"); \ + ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \ + } + + #undef LIB_SPEC + #define LIB_SPEC "%{mwindows:-subsystem windows -e _WinMainCRTStartup \ + USER32.LIB%s GDI32.LIB%s COMDLG32.LIB%s WINSPOOL.LIB%s} \ + %{!mwindows:-subsystem console -e _mainCRTStartup} \ + %{mcrtmt:LIBCMT.LIB%s KERNEL32.LIB%s} %{!mcrtmt:LIBC.LIB%s KERNEL32.LIB%s} \ + %{v}" Only in gcc-2.7.0/config/alpha: winnt.h Only in gcc-2.7.0/config/alpha: x-winnt diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/arm/arm.c gcc-2.7.1/config/arm/arm.c *** gcc-2.7.0/config/arm/arm.c Thu Jun 15 09:16:23 1995 --- gcc-2.7.1/config/arm/arm.c Mon Aug 28 06:58:22 1995 *************** *** 1,4 **** /* Output routines for GCC for ARM/RISCiX. ! Copyright (C) 1991, 1993, 1994 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). --- 1,4 ---- /* Output routines for GCC for ARM/RISCiX. ! Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). *************** *** 1604,1608 **** HOST_WIDE_INT in_words_to_go, out_words_to_go, last_bytes; int i, r; - rtx const_sxteen = gen_rtx (CONST_INT, SImode, 16); rtx src, dst; rtx st_src, st_dst, end_src, end_dst, fin_src, fin_dst; --- 1604,1607 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/arm/arm.h gcc-2.7.1/config/arm/arm.h *** gcc-2.7.0/config/arm/arm.h Thu Jun 15 09:16:42 1995 --- gcc-2.7.1/config/arm/arm.h Mon Aug 28 06:17:11 1995 *************** *** 781,785 **** All eliminations are permissible. Note that ARG_POINTER_REGNUM and ! HARD_FRAME_POINTER_REGNUM are infact the same thing. If we need a frame pointer, we must eliminate FRAME_POINTER_REGNUM into HARD_FRAME_POINTER_REGNUM and not into STACK_POINTER_REGNUM. */ --- 781,785 ---- All eliminations are permissible. Note that ARG_POINTER_REGNUM and ! HARD_FRAME_POINTER_REGNUM are in fact the same thing. If we need a frame pointer, we must eliminate FRAME_POINTER_REGNUM into HARD_FRAME_POINTER_REGNUM and not into STACK_POINTER_REGNUM. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/arm/arm.md gcc-2.7.1/config/arm/arm.md *** gcc-2.7.0/config/arm/arm.md Thu Jun 15 16:46:30 1995 --- gcc-2.7.1/config/arm/arm.md Wed Nov 8 08:59:00 1995 *************** *** 3324,3330 **** { enum rtx_code code = GET_CODE (operands[1]); ! rtx ccreg = gen_rtx (REG, ! SELECT_CC_MODE (code, arm_compare_op0, arm_compare_op1), ! CC_REGNUM); operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); --- 3324,3329 ---- { enum rtx_code code = GET_CODE (operands[1]); ! rtx ccreg = gen_compare_reg (code, arm_compare_op0, arm_compare_op1, ! arm_compare_fp); operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); *************** *** 3340,3346 **** { enum rtx_code code = GET_CODE (operands[1]); ! rtx ccreg = gen_rtx (REG, ! SELECT_CC_MODE (code, arm_compare_op0, arm_compare_op1), ! CC_REGNUM); operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); --- 3339,3344 ---- { enum rtx_code code = GET_CODE (operands[1]); ! rtx ccreg = gen_compare_reg (code, arm_compare_op0, arm_compare_op1, ! arm_compare_fp); operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); *************** *** 3356,3362 **** { enum rtx_code code = GET_CODE (operands[1]); ! rtx ccreg = gen_rtx (REG, ! SELECT_CC_MODE (code, arm_compare_op0, arm_compare_op1), ! CC_REGNUM); operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); --- 3354,3359 ---- { enum rtx_code code = GET_CODE (operands[1]); ! rtx ccreg = gen_compare_reg (code, arm_compare_op0, arm_compare_op1, ! arm_compare_fp); operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); *************** *** 3365,3369 **** (define_insn "*movsicc_insn" [(set (match_operand:SI 0 "register_operand" "=r,r") ! (if_then_else (match_operand 1 "comparison_operator" "") (match_operand:SI 2 "arm_not_operand" "rI,K") (match_operand:SI 3 "register_operand" "0,0")))] --- 3362,3367 ---- (define_insn "*movsicc_insn" [(set (match_operand:SI 0 "register_operand" "=r,r") ! (if_then_else (match_operator 1 "comparison_operator" ! [(reg 24) (const_int 0)]) (match_operand:SI 2 "arm_not_operand" "rI,K") (match_operand:SI 3 "register_operand" "0,0")))] *************** *** 3377,3381 **** (define_insn "*movsfcc_hard_insn" [(set (match_operand:SF 0 "register_operand" "=f") ! (if_then_else (match_operand 1 "comparison_operator" "") (match_operand:SF 2 "register_operand" "f") (match_operand:SF 3 "register_operand" "0")))] --- 3375,3380 ---- (define_insn "*movsfcc_hard_insn" [(set (match_operand:SF 0 "register_operand" "=f") ! (if_then_else (match_operator 1 "comparison_operator" ! [(reg 24) (const_int 0)]) (match_operand:SF 2 "register_operand" "f") (match_operand:SF 3 "register_operand" "0")))] *************** *** 3387,3391 **** (define_insn "*movsfcc_soft_insn" [(set (match_operand:SF 0 "register_operand" "=r") ! (if_then_else (match_operand 1 "comparison_operator" "") (match_operand:SF 2 "register_operand" "r") (match_operand:SF 3 "register_operand" "0")))] --- 3386,3391 ---- (define_insn "*movsfcc_soft_insn" [(set (match_operand:SF 0 "register_operand" "=r") ! (if_then_else (match_operator 1 "comparison_operator" ! [(reg 24) (const_int 0)]) (match_operand:SF 2 "register_operand" "r") (match_operand:SF 3 "register_operand" "0")))] *************** *** 3397,3401 **** (define_insn "*movdfcc_insn" [(set (match_operand:DF 0 "register_operand" "=f") ! (if_then_else (match_operand 1 "comparison_operator" "") (match_operand:DF 2 "register_operand" "f") (match_operand:DF 3 "register_operand" "0")))] --- 3397,3402 ---- (define_insn "*movdfcc_insn" [(set (match_operand:DF 0 "register_operand" "=f") ! (if_then_else (match_operator 1 "comparison_operator" ! [(reg 24) (const_int 0)]) (match_operand:DF 2 "register_operand" "f") (match_operand:DF 3 "register_operand" "0")))] *************** *** 4118,4121 **** --- 4119,4124 ---- if (GET_CODE (operands[5]) == AND) output_asm_insn (\"mov%D4\\t%0, #0\", operands); + else if (GET_CODE (operands[5]) == MINUS) + output_asm_insn (\"rsb%D4\\t%0, %1, #0\", operands); else if (which_alternative != 0) output_asm_insn (\"mov%D4\\t%0, %1\", operands); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/arm/lib1funcs.asm gcc-2.7.1/config/arm/lib1funcs.asm *** gcc-2.7.0/config/arm/lib1funcs.asm Thu Jun 15 09:17:09 1995 --- gcc-2.7.1/config/arm/lib1funcs.asm Mon Jun 26 19:22:29 1995 *************** *** 136,140 **** ifelse(S, `true', ` @ compute sign of result; if neither is negative, no problem ! eor SIGN, divisor, dividend @ compute sign cmp divisor, #0 rsbmi divisor, divisor, #0 --- 136,141 ---- ifelse(S, `true', ` @ compute sign of result; if neither is negative, no problem ! ifelse(OP, `div', `eor SIGN, divisor, dividend @ compute sign', ! `mov SIGN, dividend') cmp divisor, #0 rsbmi divisor, divisor, #0 *************** *** 1267,1271 **** stmdb sp!, {r4, r5, r6, lr} @ compute sign of result; if neither is negative, no problem ! eor r6, r1, r0 @ compute sign cmp r1, #0 rsbmi r1, r1, #0 --- 1268,1272 ---- stmdb sp!, {r4, r5, r6, lr} @ compute sign of result; if neither is negative, no problem ! mov r6, r0 cmp r1, #0 rsbmi r1, r1, #0 *************** *** 1589,1593 **** #endif /* L_modsi3 */ ! #ifdef L_divmodsi_tools .globl ___div0 --- 1590,1594 ---- #endif /* L_modsi3 */ ! #ifdef L_dvmd_tls .globl ___div0 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/arm/t-semi gcc-2.7.1/config/arm/t-semi *** gcc-2.7.0/config/arm/t-semi Sat May 13 05:34:58 1995 --- gcc-2.7.1/config/arm/t-semi Mon Jun 26 19:22:25 1995 *************** *** 9,11 **** CROSS_LIBGCC1 = libgcc1-asm.a LIB1ASMSRC = arm/lib1funcs.asm ! LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _divmodsi_tools --- 9,11 ---- CROSS_LIBGCC1 = libgcc1-asm.a LIB1ASMSRC = arm/lib1funcs.asm ! LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/dsp16xx/dsp16xx.h gcc-2.7.1/config/dsp16xx/dsp16xx.h *** gcc-2.7.0/config/dsp16xx/dsp16xx.h Thu Jun 15 09:34:49 1995 --- gcc-2.7.1/config/dsp16xx/dsp16xx.h Mon Aug 28 06:17:18 1995 *************** *** 1008,1012 **** /* A C expression for the maximum number of consecutive registers of class CLASS ! needed to hold a vlaue of mode MODE */ #define CLASS_MAX_NREGS(CLASS, MODE) \ class_max_nregs(CLASS, MODE) --- 1008,1012 ---- /* A C expression for the maximum number of consecutive registers of class CLASS ! needed to hold a value of mode MODE */ #define CLASS_MAX_NREGS(CLASS, MODE) \ class_max_nregs(CLASS, MODE) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/fp-bit.c gcc-2.7.1/config/fp-bit.c *** gcc-2.7.0/config/fp-bit.c Thu Jun 15 08:48:00 1995 --- gcc-2.7.1/config/fp-bit.c Fri Sep 15 17:05:43 1995 *************** *** 3,7 **** floating point. */ ! /* Copyright (C) 1994 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it --- 3,7 ---- floating point. */ ! /* Copyright (C) 1994, 1995 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it *************** *** 100,103 **** --- 100,105 ---- # define FRACHIGH 0x80000000L # define FRACHIGH2 0xc0000000L + # define pack_d pack_f + # define unpack_d unpack_f typedef USItype fractype; typedef UHItype halffractype; *************** *** 240,259 **** { FLO_type value; ! #ifdef _DEBUG_BITFLOAT ! int l[2]; #endif struct { - #ifndef FLOAT_BIT_ORDER_MISMATCH unsigned int sign:1 __attribute__ ((packed)); unsigned int exp:EXPBITS __attribute__ ((packed)); fractype fraction:FRACBITS __attribute__ ((packed)); ! #else fractype fraction:FRACBITS __attribute__ ((packed)); unsigned int exp:EXPBITS __attribute__ ((packed)); unsigned int sign:1 __attribute__ ((packed)); - #endif } ! bits; } FLO_union_type; --- 242,278 ---- { FLO_type value; ! fractype value_raw; ! ! #ifndef FLOAT ! halffractype words[2]; ! #endif ! ! #ifdef FLOAT_BIT_ORDER_MISMATCH ! struct ! { ! fractype fraction:FRACBITS __attribute__ ((packed)); ! unsigned int exp:EXPBITS __attribute__ ((packed)); ! unsigned int sign:1 __attribute__ ((packed)); ! } ! bits; #endif + + #ifdef _DEBUG_BITFLOAT struct { unsigned int sign:1 __attribute__ ((packed)); unsigned int exp:EXPBITS __attribute__ ((packed)); fractype fraction:FRACBITS __attribute__ ((packed)); ! } ! bits_big_endian; ! ! struct ! { fractype fraction:FRACBITS __attribute__ ((packed)); unsigned int exp:EXPBITS __attribute__ ((packed)); unsigned int sign:1 __attribute__ ((packed)); } ! bits_little_endian; ! #endif } FLO_union_type; *************** *** 315,328 **** FLO_union_type dst; fractype fraction = src->fraction.ll; /* wasn't unsigned before? */ ! ! dst.bits.sign = src->sign; if (isnan (src)) { ! dst.bits.exp = EXPMAX; ! dst.bits.fraction = src->fraction.ll; if (src->class == CLASS_QNAN || 1) { ! dst.bits.fraction |= QUIET_NAN; } } --- 334,346 ---- FLO_union_type dst; fractype fraction = src->fraction.ll; /* wasn't unsigned before? */ ! int sign = src->sign; ! int exp = 0; if (isnan (src)) { ! exp = EXPMAX; if (src->class == CLASS_QNAN || 1) { ! fraction |= QUIET_NAN; } } *************** *** 329,343 **** else if (isinf (src)) { ! dst.bits.exp = EXPMAX; ! dst.bits.fraction = 0; } else if (iszero (src)) { ! dst.bits.exp = 0; ! dst.bits.fraction = 0; } else if (fraction == 0) { ! dst.value = 0; } else --- 347,362 ---- else if (isinf (src)) { ! exp = EXPMAX; ! fraction = 0; } else if (iszero (src)) { ! exp = 0; ! fraction = 0; } else if (fraction == 0) { ! exp = 0; ! sign = 0; } else *************** *** 351,355 **** int shift = NORMAL_EXPMIN - src->normal_exp; ! dst.bits.exp = 0; if (shift > FRAC_NBITS - NGARDS) --- 370,374 ---- int shift = NORMAL_EXPMIN - src->normal_exp; ! exp = 0; if (shift > FRAC_NBITS - NGARDS) *************** *** 364,377 **** } fraction >>= NGARDS; - dst.bits.fraction = fraction; } else if (src->normal_exp > EXPBIAS) { ! dst.bits.exp = EXPMAX; ! dst.bits.fraction = 0; } else { ! dst.bits.exp = src->normal_exp + EXPBIAS; /* IF the gard bits are the all zero, but the first, then we're half way between two numbers, choose the one which makes the --- 383,395 ---- } fraction >>= NGARDS; } else if (src->normal_exp > EXPBIAS) { ! exp = EXPMAX; ! fraction = 0; } else { ! exp = src->normal_exp + EXPBIAS; /* IF the gard bits are the all zero, but the first, then we're half way between two numbers, choose the one which makes the *************** *** 390,399 **** { fraction >>= 1; ! dst.bits.exp += 1; } fraction >>= NGARDS; - dst.bits.fraction = fraction; } } return dst.value; } --- 408,438 ---- { fraction >>= 1; ! exp += 1; } fraction >>= NGARDS; } } + + /* We previously used bitfields to store the number, but this doesn't + handle little/big endian systems conviently, so use shifts and + masks */ + #ifdef FLOAT_BIT_ORDER_MISMATCH + dst.bits.fraction = fraction; + dst.bits.exp = exp; + dst.bits.sign = sign; + #else + dst.value_raw = fraction & ((((fractype)1) << FRACBITS) - (fractype)1); + dst.value_raw |= ((fractype) (exp & ((1 << EXPBITS) - 1))) << FRACBITS; + dst.value_raw |= ((fractype) (sign & 1)) << (FRACBITS | EXPBITS); + #endif + + #if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT) + { + halffractype tmp = dst.words[0]; + dst.words[0] = dst.words[1]; + dst.words[1] = tmp; + } + #endif + return dst.value; } *************** *** 402,409 **** unpack_d (FLO_union_type * src, fp_number_type * dst) { ! fractype fraction = src->bits.fraction; ! dst->sign = src->bits.sign; ! if (src->bits.exp == 0) { /* Hmm. Looks like 0 */ --- 441,471 ---- unpack_d (FLO_union_type * src, fp_number_type * dst) { ! /* We previously used bitfields to store the number, but this doesn't ! handle little/big endian systems conviently, so use shifts and ! masks */ ! fractype fraction; ! int exp; ! int sign; ! ! #if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT) ! FLO_union_type swapped; ! ! swapped.words[0] = src->words[1]; ! swapped.words[1] = src->words[0]; ! src = &swapped; ! #endif ! ! #ifdef FLOAT_BIT_ORDER_MISMATCH ! fraction = src->bits.fraction; ! exp = src->bits.exp; ! sign = src->bits.sign; ! #else ! fraction = src->value_raw & ((((fractype)1) << FRACBITS) - (fractype)1); ! exp = ((int)(src->value_raw >> FRACBITS)) & ((1 << EXPBITS) - 1); ! sign = ((int)(src->value_raw >> (FRACBITS + EXPBITS))) & 1; ! #endif ! dst->sign = sign; ! if (exp == 0) { /* Hmm. Looks like 0 */ *************** *** 418,422 **** so there isn't a leading implicit one - we'll shift it so it gets one. */ ! dst->normal_exp = src->bits.exp - EXPBIAS + 1; fraction <<= NGARDS; --- 480,484 ---- so there isn't a leading implicit one - we'll shift it so it gets one. */ ! dst->normal_exp = exp - EXPBIAS + 1; fraction <<= NGARDS; *************** *** 432,436 **** } } ! else if (src->bits.exp == EXPMAX) { /* Huge exponent*/ --- 494,498 ---- } } ! else if (exp == EXPMAX) { /* Huge exponent*/ *************** *** 443,447 **** { /* Non zero fraction, means nan */ ! if (dst->sign) { dst->class = CLASS_SNAN; --- 505,509 ---- { /* Non zero fraction, means nan */ ! if (sign) { dst->class = CLASS_SNAN; *************** *** 458,462 **** { /* Nothing strange about this number */ ! dst->normal_exp = src->bits.exp - EXPBIAS; dst->class = CLASS_NUMBER; dst->fraction.ll = (fraction << NGARDS) | IMPLICIT_1; --- 520,524 ---- { /* Nothing strange about this number */ ! dst->normal_exp = exp - EXPBIAS; dst->class = CLASS_NUMBER; dst->fraction.ll = (fraction << NGARDS) | IMPLICIT_1; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/h8300/h8300.c gcc-2.7.1/config/h8300/h8300.c *** gcc-2.7.0/config/h8300/h8300.c Thu Jun 15 09:38:12 1995 --- gcc-2.7.1/config/h8300/h8300.c Mon Aug 28 06:34:36 1995 *************** *** 1,4 **** /* Subroutines for insn-output.c for Hitachi H8/300. ! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com), Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). --- 1,4 ---- /* Subroutines for insn-output.c for Hitachi H8/300. ! Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com), Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). *************** *** 2003,2007 **** enum rtx_code type; { ! /* The bit_operand predicate accepts any memory durint RTL generation, but only 'U' memory afterwards, so if this is a MEM operand, we must force it to be valid for 'U' by reloading the address. */ --- 2003,2007 ---- enum rtx_code type; { ! /* The bit_operand predicate accepts any memory during RTL generation, but only 'U' memory afterwards, so if this is a MEM operand, we must force it to be valid for 'U' by reloading the address. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/h8300/h8300.h gcc-2.7.1/config/h8300/h8300.h *** gcc-2.7.0/config/h8300/h8300.h Thu Jun 15 09:38:24 1995 --- gcc-2.7.1/config/h8300/h8300.h Sat Aug 19 17:06:14 1995 *************** *** 100,105 **** --- 100,112 ---- { "", TARGET_DEFAULT}} + /* Merge the meaning of -mdouble64 and -fshort-double. + ??? Unfortunately, there's no way to detect -fno-short-double + (our default is the opposite of theirs). + Also do other things that must be done once at start up. */ + #define OVERRIDE_OPTIONS \ { \ + /*extern int flag_short_double; \ + flag_short_double = TARGET_DOUBLE32;*/ \ h8300_init_once (); \ } *************** *** 247,251 **** H8/300: If an even reg, then anything goes. Otherwise the mode must be QI ! or HI. H8/300H: Anything goes. */ --- 254,258 ---- H8/300: If an even reg, then anything goes. Otherwise the mode must be QI ! or HI. H8/300H: Anything goes. */ *************** *** 283,287 **** /* Register in which static-chain is passed to a function. */ ! #define STATIC_CHAIN_REGNUM 4 /* Define the classes of registers for register constraints in the --- 290,294 ---- /* Register in which static-chain is passed to a function. */ ! #define STATIC_CHAIN_REGNUM 3 /* Define the classes of registers for register constraints in the *************** *** 660,665 **** H8/300 vvvv context ! 1 0000 79001234 mov.w #0x1234,r4 ! 2 0004 5A000000 jmp @0x1234 ^^^^ function --- 667,672 ---- H8/300 vvvv context ! 1 0000 7900xxxx mov.w #0x1234,r3 ! 2 0004 5A00xxxx jmp @0x1234 ^^^^ function *************** *** 666,671 **** H8/300H vvvvvvvv context ! 2 0000 7A0012345678 mov.l #0x12345678,er4 ! 3 0006 5A000000 jmp @0x12345678 ^^^^^^ function */ --- 673,678 ---- H8/300H vvvvvvvv context ! 2 0000 7A00xxxxxxxx mov.l #0x12345678,er3 ! 3 0006 5Axxxxxx jmp @0x123456 ^^^^^^ function */ *************** *** 675,679 **** if (TARGET_H8300) \ { \ ! fprintf (FILE, "\tmov.w #0x1234,r4\n"); \ fprintf (FILE, "\tjmp @0x1234\n"); \ } \ --- 682,686 ---- if (TARGET_H8300) \ { \ ! fprintf (FILE, "\tmov.w #0x1234,r3\n"); \ fprintf (FILE, "\tjmp @0x1234\n"); \ } \ *************** *** 680,684 **** else \ { \ ! fprintf (FILE, "\tmov.l #0x12345678,er4\n"); \ fprintf (FILE, "\tjmp @0x123456\n"); \ } \ --- 687,691 ---- else \ { \ ! fprintf (FILE, "\tmov.l #0x12345678,er3\n"); \ fprintf (FILE, "\tjmp @0x123456\n"); \ } \ *************** *** 1063,1067 **** #define REGISTER_NAMES \ ! { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "ap"} /* How to renumber registers for dbx and gdb. --- 1070,1076 ---- #define REGISTER_NAMES \ ! { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "sp", "ap"} ! ! #define ADDITIONAL_REGISTER_NAMES { { "r7", 7 } } /* How to renumber registers for dbx and gdb. *************** *** 1070,1077 **** #define DBX_REGISTER_NUMBER(REGNO) (REGNO) - /* Vax specific: which type character is used for type double? */ - - #define ASM_DOUBLE_CHAR ('g') - #define SDB_DEBUGGING_INFO #define SDB_DELIM "\n" --- 1079,1082 ---- *************** *** 1198,1202 **** #define ASM_OUTPUT_ALIGN(FILE,LOG) \ if ((LOG) != 0) \ ! fprintf (FILE, "\t.align %d\n", 1 << (LOG)) /* This is how to output an assembler line --- 1203,1207 ---- #define ASM_OUTPUT_ALIGN(FILE,LOG) \ if ((LOG) != 0) \ ! fprintf (FILE, "\t.align %d\n", (LOG)) /* This is how to output an assembler line diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/h8300/h8300.md gcc-2.7.1/config/h8300/h8300.md *** gcc-2.7.0/config/h8300/h8300.md Thu Jun 15 16:50:27 1995 --- gcc-2.7.1/config/h8300/h8300.md Mon Aug 28 06:17:38 1995 *************** *** 1854,1858 **** FAIL; ! /* The bit_operand predicate accepts any memory durint RTL generation, but only 'U' memory afterwards, so if this is a MEM operand, we must force it to be valid for 'U' by reloading the address. */ --- 1854,1858 ---- FAIL; ! /* The bit_operand predicate accepts any memory during RTL generation, but only 'U' memory afterwards, so if this is a MEM operand, we must force it to be valid for 'U' by reloading the address. */ *************** *** 1898,1902 **** FAIL; ! /* The bit_operand predicate accepts any memory durint RTL generation, but only 'U' memory afterwards, so if this is a MEM operand, we must force it to be valid for 'U' by reloading the address. */ --- 1898,1902 ---- FAIL; ! /* The bit_operand predicate accepts any memory during RTL generation, but only 'U' memory afterwards, so if this is a MEM operand, we must force it to be valid for 'U' by reloading the address. */ *************** *** 2168,2176 **** (define_insn "fancy_btst" [(set (pc) ! (if_then_else (eq (zero_extract:HI (zero_extend:HI (match_operand:QI 0 "general_operand" "Ur")) (const_int 1) ! (match_operand:HI 1 "nonmemory_operand" "rn")) (const_int 0)) ! (label_ref (match_operand 2 "" "")) (pc)))] "" --- 2168,2176 ---- (define_insn "fancy_btst" [(set (pc) ! (if_then_else (eq (zero_extract:HI (zero_extend:HI (match_operand:QI 1 "general_operand" "Ur")) (const_int 1) ! (match_operand:HI 2 "nonmemory_operand" "rn")) (const_int 0)) ! (label_ref (match_operand 0 "" "")) (pc)))] "" *************** *** 2178,2186 **** { if (get_attr_length (insn) == 2) ! return \"btst %X1,%X0\;beq %l2\"; else if (get_attr_length (insn) == 4) ! return \"btst %X1,%X0\;beq %l2:16\"; else ! return \"btst %X1,%X0\;bne %L0\;jmp @%l2\;%L0:\"; }" [(set_attr "type" "branch") --- 2178,2186 ---- { if (get_attr_length (insn) == 2) ! return \"btst %X2,%X1\;beq %l0\"; else if (get_attr_length (insn) == 4) ! return \"btst %X2,%X1\;beq %l0:16\"; else ! return \"btst %X2,%X1\;bne %L1\;jmp @%l0\;%L1:\"; }" [(set_attr "type" "branch") *************** *** 2189,2197 **** (define_insn "fancy_btst1" [(set (pc) ! (if_then_else (ne (zero_extract:HI (zero_extend:HI (match_operand:QI 0 "general_operand" "Ur")) (const_int 1) ! (match_operand:HI 1 "nonmemory_operand" "rn")) (const_int 0)) ! (label_ref (match_operand 2 "" "")) (pc)))] "" --- 2189,2197 ---- (define_insn "fancy_btst1" [(set (pc) ! (if_then_else (ne (zero_extract:HI (zero_extend:HI (match_operand:QI 1 "general_operand" "Ur")) (const_int 1) ! (match_operand:HI 2 "nonmemory_operand" "rn")) (const_int 0)) ! (label_ref (match_operand 0 "" "")) (pc)))] "" *************** *** 2199,2207 **** { if (get_attr_length (insn) == 2) ! return \"btst %X1,%X0\;bne %l2\"; else if (get_attr_length (insn) == 4) ! return \"btst %X1,%X0\;bne %l2:16\"; else ! return \"btst %X1,%X0\;beq %L0\;jmp @%l2\;%L0:\"; }" [(set_attr "type" "branch") --- 2199,2207 ---- { if (get_attr_length (insn) == 2) ! return \"btst %X2,%X1\;bne %l0\"; else if (get_attr_length (insn) == 4) ! return \"btst %X2,%X1\;bne %l0:16\"; else ! return \"btst %X2,%X1\;beq %L1\;jmp @%l0\;%L1:\"; }" [(set_attr "type" "branch") diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i370/i370.md gcc-2.7.1/config/i370/i370.md *** gcc-2.7.0/config/i370/i370.md Thu Jun 15 16:50:51 1995 --- gcc-2.7.1/config/i370/i370.md Fri Sep 22 18:48:45 1995 *************** *** 1,6 **** ;;- Machine description for GNU compiler -- System/370 version. ! ;; Copyright (C) 1989, 1993, 1994 Free Software Foundation, Inc. ;; Contributed by Jan Stein (jan@cd.chalmers.se). ! ;; Modified for MVS C/370 by Dave Pitts (pitts@mcdata.com) ;; This file is part of GNU CC. --- 1,6 ---- ;;- Machine description for GNU compiler -- System/370 version. ! ;; Copyright (C) 1989, 1993, 1994, 1995 Free Software Foundation, Inc. ;; Contributed by Jan Stein (jan@cd.chalmers.se). ! ;; Modified for MVS C/370 by Dave Pitts (dpitts@nyx.cs.du.edu) ;; This file is part of GNU CC. *************** *** 221,225 **** [(set (cc0) (compare (match_operand:SI 0 "register_operand" "d") ! (match_operand:SI 1 "general_operand" "")))] "" "* --- 221,225 ---- [(set (cc0) (compare (match_operand:SI 0 "register_operand" "d") ! (match_operand:SI 1 "general_operand" "md")))] "" "* *************** *** 267,272 **** if (GET_CODE (operands[1]) == CONST_INT) { ! mvs_check_page (0, 4, 2); ! return \"CH %0,=H'%h1'\"; } mvs_check_page (0, 4, 0); --- 267,272 ---- if (GET_CODE (operands[1]) == CONST_INT) { ! mvs_check_page (0, 4, 0); ! return \"CH %0,%H1\"; } mvs_check_page (0, 4, 0); *************** *** 782,787 **** if (GET_CODE (operands[1]) == CONST_INT) { ! mvs_check_page (0, 4, 2); ! return \"LH %0,=H'%h1'\"; } mvs_check_page (0, 4, 0); --- 782,787 ---- if (GET_CODE (operands[1]) == CONST_INT) { ! mvs_check_page (0, 4, 0); ! return \"LH %0,%H1\"; } mvs_check_page (0, 4, 0); *************** *** 796,800 **** { mvs_check_page (0, 6, 0); ! return \"MVC %O0(2,%R0),=H'%h1'\"; } mvs_check_page (0, 6, 0); --- 796,800 ---- { mvs_check_page (0, 6, 0); ! return \"MVC %O0(2,%R0),%H1\"; } mvs_check_page (0, 6, 0); *************** *** 830,835 **** if (GET_CODE (operands[1]) == CONST_INT) { ! mvs_check_page (0, 4, 2); ! return \"LH %0,=H'%h1'\"; } mvs_check_page (0, 4, 0); --- 830,835 ---- if (GET_CODE (operands[1]) == CONST_INT) { ! mvs_check_page (0, 4, 0); ! return \"LH %0,%H1\"; } mvs_check_page (0, 4, 0); *************** *** 966,971 **** else if (GET_CODE (operands[1]) == CONST_INT) { ! mvs_check_page (0, 4, 2); ! return \"ICM %0,3,=H'%h1'\"; } mvs_check_page (0, 4, 0); --- 966,971 ---- else if (GET_CODE (operands[1]) == CONST_INT) { ! mvs_check_page (0, 4, 0); ! return \"ICM %0,3,%H1\"; } mvs_check_page (0, 4, 0); *************** *** 1368,1373 **** if (GET_CODE (operands[1]) == CONST_INT) { ! mvs_check_page (0, 4, 2); ! return \"LH %0,=H'%h1'\"; } mvs_check_page (0, 4, 0); --- 1368,1373 ---- if (GET_CODE (operands[1]) == CONST_INT) { ! mvs_check_page (0, 4, 0); ! return \"LH %0,%H1\"; } mvs_check_page (0, 4, 0); *************** *** 1375,1379 **** } mvs_check_page (0, 4, 0); ! return \"SLL %0,16\;SRA %0,16\;ST %1,%0\"; }") --- 1375,1379 ---- } mvs_check_page (0, 4, 0); ! return \"SLL %1,16\;SRA %1,16\;ST %1,%0\"; }") *************** *** 1781,1785 **** if (REG_P (operands[2])) { ! mvs_check_page (0, 2, 0); return \"STH %2,140(,13)\;AH %0,140(,13)\"; } --- 1781,1785 ---- if (REG_P (operands[2])) { ! mvs_check_page (0, 8, 0); return \"STH %2,140(,13)\;AH %0,140(,13)\"; } *************** *** 1792,1797 **** return \"BCTR %0,0\"; } ! mvs_check_page (0, 4, 2); ! return \"AH %0,=H'%h2'\"; } mvs_check_page (0, 4, 0); --- 1792,1797 ---- return \"BCTR %0,0\"; } ! mvs_check_page (0, 4, 0); ! return \"AH %0,%H2\"; } mvs_check_page (0, 4, 0); *************** *** 1978,1982 **** if (REG_P (operands[2])) { ! mvs_check_page (0, 2, 0); return \"STH %2,140(,13)\;SH %0,140(,13)\"; } --- 1978,1982 ---- if (REG_P (operands[2])) { ! mvs_check_page (0, 8, 0); return \"STH %2,140(,13)\;SH %0,140(,13)\"; } *************** *** 1989,1994 **** if (GET_CODE (operands[2]) == CONST_INT) { ! mvs_check_page (0, 4, 2); ! return \"SH %0,=H'%h2'\"; } mvs_check_page (0, 4, 0); --- 1989,1994 ---- if (GET_CODE (operands[2]) == CONST_INT) { ! mvs_check_page (0, 4, 0); ! return \"SH %0,%H2\"; } mvs_check_page (0, 4, 0); *************** *** 2126,2130 **** check_label_emit (); mvs_check_page (0, 4, 0); ! return \"MH %0,%2\"; }") --- 2126,2130 ---- check_label_emit (); mvs_check_page (0, 4, 0); ! return \"MH %0,%H2\"; }") *************** *** 2552,2556 **** { mvs_check_page (0, 4, 0); ! return \"N %0,%H2\"; } CC_STATUS_INIT; --- 2552,2556 ---- { mvs_check_page (0, 4, 0); ! return \"N %0,%2\"; } CC_STATUS_INIT; *************** *** 2557,2562 **** if (GET_CODE (operands[2]) == CONST_INT) { ! mvs_check_page (0, 6, 2); ! return \"NC %O0(2,%R0),=H'%h2'\"; } mvs_check_page (0, 6, 0); --- 2557,2562 ---- if (GET_CODE (operands[2]) == CONST_INT) { ! mvs_check_page (0, 6, 0); ! return \"NC %O0(2,%R0),%H2\"; } mvs_check_page (0, 6, 0); *************** *** 2575,2579 **** { mvs_check_page (0, 4, 0); ! return \"N %0,%H2\"; } mvs_check_page (0, 2, 0); --- 2575,2579 ---- { mvs_check_page (0, 4, 0); ! return \"N %0,%2\"; } mvs_check_page (0, 2, 0); *************** *** 2721,2725 **** { mvs_check_page (0, 4, 0); ! return \"O %0,%H2\"; } CC_STATUS_INIT; --- 2721,2725 ---- { mvs_check_page (0, 4, 0); ! return \"O %0,%2\"; } CC_STATUS_INIT; *************** *** 2726,2731 **** if (GET_CODE (operands[2]) == CONST_INT) { ! mvs_check_page (0, 6, 2); ! return \"OC %O0(2,%R0),=H'%h2'\"; } mvs_check_page (0, 6, 0); --- 2726,2731 ---- if (GET_CODE (operands[2]) == CONST_INT) { ! mvs_check_page (0, 6, 0); ! return \"OC %O0(2,%R0),%H2\"; } mvs_check_page (0, 6, 0); *************** *** 2744,2748 **** { mvs_check_page (0, 4, 0); ! return \"O %0,%H2\"; } mvs_check_page (0, 2, 0); --- 2744,2748 ---- { mvs_check_page (0, 4, 0); ! return \"O %0,%2\"; } mvs_check_page (0, 2, 0); *************** *** 2891,2895 **** { mvs_check_page (0, 4, 0); ! return \"X %0,%H2\"; } CC_STATUS_INIT; --- 2891,2895 ---- { mvs_check_page (0, 4, 0); ! return \"X %0,%2\"; } CC_STATUS_INIT; *************** *** 2896,2901 **** if (GET_CODE (operands[2]) == CONST_INT) { ! mvs_check_page (0, 6, 2); ! return \"XC %O0(2,%R0),=H'%h2'\"; } mvs_check_page (0, 6, 0); --- 2896,2901 ---- if (GET_CODE (operands[2]) == CONST_INT) { ! mvs_check_page (0, 6, 0); ! return \"XC %O0(2,%R0),%H2\"; } mvs_check_page (0, 6, 0); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i370/mvs.h gcc-2.7.1/config/i370/mvs.h *** gcc-2.7.0/config/i370/mvs.h Thu Jun 15 09:39:40 1995 --- gcc-2.7.1/config/i370/mvs.h Wed Sep 20 14:26:34 1995 *************** *** 2,6 **** Copyright (C) 1989, 1993, 1995 Free Software Foundation, Inc. Contributed by Jan Stein (jan@cd.chalmers.se). ! Modified for C/370 MVS by Dave Pitts (pitts@mcdata.com) This file is part of GNU CC. --- 2,6 ---- Copyright (C) 1989, 1993, 1995 Free Software Foundation, Inc. Contributed by Jan Stein (jan@cd.chalmers.se). ! Modified for C/370 MVS by Dave Pitts (dpitts@nyx.cs.du.edu) This file is part of GNU CC. *************** *** 47,51 **** /* True if a label has been emitted. */ ! extern int mvs_label_emited; /* The name of the current function. */ --- 47,51 ---- /* True if a label has been emitted. */ ! extern int mvs_label_emitted; /* The name of the current function. */ *************** *** 81,84 **** --- 81,91 ---- { "", TARGET_DEFAULT} } + /* To use IBM supplied macro function prologue and epilogue, define the + following to 1. Should only be needed if IBM changes the definition + of their prologue and epilogue. */ + + #define MACROPROLOGUE 0 + #define MACROEPILOGUE 0 + /* Target machine storage layout */ *************** *** 480,483 **** --- 487,505 ---- All of the C/370 environment is preserved. */ + #if MACROPROLOGUE == 1 + #define FUNCTION_PROLOGUE(FILE, LSIZE) \ + { \ + fprintf (FILE, "\tEDCPRLG USRDSAL=%d,BASEREG=%d\n", \ + STACK_POINTER_OFFSET + LSIZE + \ + current_function_outgoing_args_size, BASE_REGISTER); \ + fprintf (FILE, "PG%d\tEQU\t*\n", mvs_page_num ); \ + fprintf (FILE, "\tLR\t11,1\n"); \ + fprintf (FILE, "\tL\t%d,=A(PGT%d)\n", PAGE_REGISTER, mvs_page_num); \ + mvs_page_code = 6; \ + mvs_page_lit = 4; \ + mvs_check_page (FILE, 0, 0); \ + function_base_page = mvs_page_num; \ + } + #else /* MACROPROLOGUE != 1 */ #define FUNCTION_PROLOGUE(FILE, LSIZE) \ { \ *************** *** 500,530 **** function_second = function_time->tm_sec; \ } \ fprintf (FILE, "\tUSING\t*,15\n"); \ fprintf (FILE, "\tB\tFPL%03d\n", function_label_index); \ fprintf (FILE, "\tDC\tAL1(FPL%03d+4-*)\n", function_label_index + 1); \ ! fprintf (FILE, "\tDC\tX'CE',X'A0',X'10'\n"); \ ! fprintf (FILE, "\tDC\tA($PPA2)\n"); \ ! fprintf (FILE, "\tDC\tF'%d'\n", 0); \ ! fprintf (FILE, "\tDC\tF'%d'\n", STACK_POINTER_OFFSET + LSIZE \ ! + current_function_outgoing_args_size); \ fprintf (FILE, "FPL%03d\tEQU\t*\n", function_label_index + 1); \ fprintf (FILE, "\tDC\tAL2(%d),C'%s'\n", strlen (mvs_function_name), \ mvs_function_name); \ ! fprintf (FILE, "\tDS\t0F\n"); \ ! if (!function_first) \ ! { \ ! fprintf (FILE, "$PPA2\tEQU\t*\n"); \ ! fprintf (FILE, "\tDC\tX'03',X'00',X'33',X'00'\n"); \ ! fprintf (FILE, "\tDC\tV(CEESTART),A(0)\n"); \ ! fprintf (FILE, "\tDC\tA($TIMES)\n"); \ ! fprintf (FILE, "\tDS\t0F\n"); \ ! fprintf (FILE, "$TIMES\tEQU\t*\n"); \ ! fprintf (FILE, "\tDC\tCL4'%d',CL4'%02d%02d',CL6'%02d%02d00'\n", \ ! function_year, function_month, function_day, \ ! function_hour, function_minute, function_second); \ ! fprintf (FILE, "\tDC\tCL2'01',CL4'0100'\n"); \ ! } \ ! fprintf (FILE, "\tDS\t0H\n"); \ ! fprintf (FILE, "FPL%03d\tEQU\t*\n", function_label_index); \ fprintf (FILE, "\tSTM\t14,12,12(13)\n"); \ fprintf (FILE, "\tL\t2,76(,13)\n"); \ --- 522,558 ---- function_second = function_time->tm_sec; \ } \ + fprintf (FILE, "$DSD%03d\tDSECT\n", function_label_index); \ + fprintf (FILE, "\tDS\tD\n"); \ + fprintf (FILE, "\tDS\tCL(120+%d)\n", STACK_POINTER_OFFSET + LSIZE \ + + current_function_outgoing_args_size); \ + fprintf (FILE, "\tORG\t$DSD%03d\n", function_label_index); \ + fprintf (FILE, "\tDS\tCL(120+8)\n"); \ + fprintf (FILE, "\tORG\n"); \ + fprintf (FILE, "\tDS\t0D\n"); \ + fprintf (FILE, "$DSL%03d\tEQU\t*-$DSD%03d-8\n", function_label_index, \ + function_label_index); \ + fprintf (FILE, "\tDS\t0H\n"); \ + assemble_name (FILE, mvs_function_name); \ + fprintf (FILE, "\tCSECT\n"); \ fprintf (FILE, "\tUSING\t*,15\n"); \ fprintf (FILE, "\tB\tFPL%03d\n", function_label_index); \ fprintf (FILE, "\tDC\tAL1(FPL%03d+4-*)\n", function_label_index + 1); \ ! fprintf (FILE, "\tDC\tX'CE',X'A0',AL1(16)\n"); \ ! fprintf (FILE, "\tDC\tAL4($PPA%03d)\n",function_label_index); \ ! fprintf (FILE, "\tDC\tAL4(0)\n"); \ ! fprintf (FILE, "\tDC\tAL4($DSL%03d)\n", function_label_index); \ fprintf (FILE, "FPL%03d\tEQU\t*\n", function_label_index + 1); \ fprintf (FILE, "\tDC\tAL2(%d),C'%s'\n", strlen (mvs_function_name), \ mvs_function_name); \ ! fprintf (FILE, "$PPA%03d\tDS\t0F\n", function_label_index); \ ! fprintf (FILE, "\tDC\tX'03',X'00',X'33',X'00'\n"); \ ! fprintf (FILE, "\tDC\tV(CEESTART),A(0)\n"); \ ! fprintf (FILE, "\tDC\tA($TIM%03d)\n", function_label_index); \ ! fprintf (FILE, "$TIM%03d\tDS\t0F\n", function_label_index); \ ! fprintf (FILE, "\tDC\tCL4'%d',CL4'%02d%02d',CL6'%02d%02d00'\n", \ ! function_year, function_month, function_day, \ ! function_hour, function_minute, function_second); \ ! fprintf (FILE, "\tDC\tCL2'01',CL4'0100'\n"); \ ! fprintf (FILE, "FPL%03d\tDS\t0H\n", function_label_index); \ fprintf (FILE, "\tSTM\t14,12,12(13)\n"); \ fprintf (FILE, "\tL\t2,76(,13)\n"); \ *************** *** 538,544 **** fprintf (FILE, "\tSTM\t15,0,72(2)\n"); \ fprintf (FILE, "\tMVI\t0(2),X'10'\n"); \ fprintf (FILE, "\tST\t13,4(,2)\n "); \ fprintf (FILE, "\tLR\t13,2\n"); \ - fprintf (FILE, "\tLR\t11,1\n"); \ fprintf (FILE, "\tDROP\t15\n"); \ fprintf (FILE, "\tBALR\t%d,0\n", BASE_REGISTER); \ --- 566,572 ---- fprintf (FILE, "\tSTM\t15,0,72(2)\n"); \ fprintf (FILE, "\tMVI\t0(2),X'10'\n"); \ + fprintf (FILE, "\tST\t2,8(,13)\n "); \ fprintf (FILE, "\tST\t13,4(,2)\n "); \ fprintf (FILE, "\tLR\t13,2\n"); \ fprintf (FILE, "\tDROP\t15\n"); \ fprintf (FILE, "\tBALR\t%d,0\n", BASE_REGISTER); \ *************** *** 545,548 **** --- 573,577 ---- fprintf (FILE, "PG%d\tEQU\t*\n", mvs_page_num ); \ fprintf (FILE, "\tUSING\t*,%d\n", BASE_REGISTER); \ + fprintf (FILE, "\tLR\t11,1\n"); \ fprintf (FILE, "\tL\t%d,=A(PGT%d)\n", PAGE_REGISTER, mvs_page_num); \ mvs_page_code = 4; \ *************** *** 553,556 **** --- 582,586 ---- function_label_index += 2; \ } + #endif /* MACROPROLOGUE */ #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ *************** *** 576,580 **** else \ strcpy (mvs_function_name, NAME); \ ! fprintf (FILE, "\tDS\t0H\n"); \ assemble_name (FILE, mvs_function_name); \ fputs ("\tCSECT\n", FILE); \ --- 606,610 ---- else \ strcpy (mvs_function_name, NAME); \ ! fprintf (FILE, "\tDS\t0F\n"); \ assemble_name (FILE, mvs_function_name); \ fputs ("\tCSECT\n", FILE); \ *************** *** 591,594 **** --- 621,641 ---- before returning. */ + #if MACROEPILOGUE == 1 + #define FUNCTION_EPILOGUE(FILE, LSIZE) \ + { \ + int i; \ + check_label_emit(); \ + mvs_check_page (FILE,14,0); \ + fprintf (FILE, "\tEDCEPIL\n"); \ + mvs_page_num++; \ + fprintf (FILE, "\tDS\t0F\n" ); \ + fprintf (FILE, "\tLTORG\n"); \ + fprintf (FILE, "\tDS\t0F\n"); \ + fprintf (FILE, "PGT%d\tEQU\t*\n", function_base_page); \ + mvs_free_label(); \ + for ( i = function_base_page; i < mvs_page_num; i++ ) \ + fprintf (FILE, "\tDC\tA(PG%d)\n", i); \ + } + #else /* MACROEPILOGUE != 1 */ #define FUNCTION_EPILOGUE(FILE, LSIZE) \ { \ *************** *** 612,615 **** --- 659,664 ---- fprintf (FILE, "\tDC\tA(PG%d)\n", i); \ } + #endif /* MACROEPILOGUE */ + /* Output assembler code for a block containing the constant parts of a *************** *** 1064,1068 **** { \ mvs_add_label(NUM); \ ! mvs_label_emited = 1; \ } \ fprintf (FILE, "%s%d\tEQU\t*\n", PREFIX, NUM); \ --- 1113,1117 ---- { \ mvs_add_label(NUM); \ ! mvs_label_emitted = 1; \ } \ fprintf (FILE, "%s%d\tEQU\t*\n", PREFIX, NUM); \ *************** *** 1134,1140 **** #define ASM_OUTPUT_SHORT(FILE, EXP) \ { \ ! fprintf (FILE, "\tDC\tH'"); \ ! output_addr_const (FILE, EXP); \ ! fprintf (FILE, "'\n"); \ } --- 1183,1187 ---- #define ASM_OUTPUT_SHORT(FILE, EXP) \ { \ ! fprintf (FILE, "\tDC\tX'%04X'\n", INTVAL(EXP) & 0xFFFF); \ } *************** *** 1171,1175 **** { \ if (j % MVS_ASCII_TEXT_LENGTH == 0) \ ! fprintf (FILE, "\tDC\tC'", c); \ if ( c == '\'' ) \ fprintf (FILE, "%c%c", c, c); \ --- 1218,1222 ---- { \ if (j % MVS_ASCII_TEXT_LENGTH == 0) \ ! fprintf (FILE, "\tDC\tC'"); \ if ( c == '\'' ) \ fprintf (FILE, "%c%c", c, c); \ *************** *** 1325,1330 **** else if (CODE == 'H') \ { \ ! mvs_page_lit += 4; \ ! fprintf (FILE, "=F'%d'", (INTVAL (X) << 16) >> 16); \ } \ else \ --- 1372,1377 ---- else if (CODE == 'H') \ { \ ! mvs_page_lit += 2; \ ! fprintf (FILE, "=H'%d'", (INTVAL (X) << 16) >> 16); \ } \ else \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i370/mvs370.c gcc-2.7.1/config/i370/mvs370.c *** gcc-2.7.0/config/i370/mvs370.c Thu Jun 15 09:40:11 1995 --- gcc-2.7.1/config/i370/mvs370.c Tue Sep 19 19:28:37 1995 *************** *** 1,6 **** /* Subroutines for insn-output.c for System/370. ! Copyright (C) 1989, 1993 Free Software Foundation, Inc. Contributed by Jan Stein (jan@cd.chalmers.se). ! Modified for MVS C/370 by Dave Pitts (pitts@mcdata.com) This file is part of GNU CC. --- 1,6 ---- /* Subroutines for insn-output.c for System/370. ! Copyright (C) 1989, 1993, 1995 Free Software Foundation, Inc. Contributed by Jan Stein (jan@cd.chalmers.se). ! Modified for MVS C/370 by Dave Pitts (dpitts@nyx.cs.du.edu) This file is part of GNU CC. *************** *** 50,54 **** /* Is 1 when a label has been generated and the base register must be reloaded. */ ! int mvs_label_emited = 0; /* Current function starting base page. */ --- 50,54 ---- /* Is 1 when a label has been generated and the base register must be reloaded. */ ! int mvs_label_emitted = 0; /* Current function starting base page. */ *************** *** 245,251 **** check_label_emit (void) { ! if (mvs_label_emited) { ! mvs_label_emited = 0; mvs_page_code += 4; fprintf (assembler_source, "\tL\t%d,%d(,%d)\n", --- 245,251 ---- check_label_emit (void) { ! if (mvs_label_emitted) { ! mvs_label_emitted = 0; mvs_page_code += 4; fprintf (assembler_source, "\tL\t%d,%d(,%d)\n", diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i370/xm-mvs.h gcc-2.7.1/config/i370/xm-mvs.h *** gcc-2.7.0/config/i370/xm-mvs.h Thu Jun 15 09:39:54 1995 --- gcc-2.7.1/config/i370/xm-mvs.h Tue Sep 19 19:28:40 1995 *************** *** 2,6 **** Copyright (C) 1989, 1993 Free Software Foundation, Inc. Contributed by Jan Stein (jan@cd.chalmers.se). ! Modified for MVS C/370 by Dave Pitts (pitts@mcdata.com) This file is part of GNU CC. --- 2,6 ---- Copyright (C) 1989, 1993 Free Software Foundation, Inc. Contributed by Jan Stein (jan@cd.chalmers.se). ! Modified for MVS C/370 by Dave Pitts (dpitts@nyx.cs.du.edu) This file is part of GNU CC. Only in gcc-2.7.0/config/i386: config-nt.bat diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/config-nt.sed gcc-2.7.1/config/i386/config-nt.sed *** gcc-2.7.0/config/i386/config-nt.sed Mon May 22 18:54:22 1995 --- gcc-2.7.1/config/i386/config-nt.sed Tue Sep 19 19:18:36 1995 *************** *** 19,23 **** md_file=config/i386/i386.md /^tm_file/ c\ ! tm_file=config/i386/winnt.h /^build_xm_file/ c\ build_xm_file=config/i386/xm-winnt.h --- 19,23 ---- md_file=config/i386/i386.md /^tm_file/ c\ ! tm_file=config/i386/win-nt.h /^build_xm_file/ c\ build_xm_file=config/i386/xm-winnt.h *************** *** 24,84 **** /^host_xm_file/ c\ host_xm_file=config/i386/xm-winnt.h ! /^lang_specs_files=/ d ! /^lang_options_files=/ d ! /^version=/ c\ ! version=2.6.3 ! s/CC = cc/CC = cl/ ! s/^SHELL =.*/SHELL =/ ! s/CFLAGS = -g/CFLAGS =/ ! s/:\$/: \$/g ! s/<\ *\$(srcdir)\//< $(srcdir)\\/g ! s/^ \$(srcdir)\/move-if-change/ copy/ ! s/^USE_/# USE_/ ! s/`echo \$(srcdir)\///g ! s/ | sed 's,\^\\\.\/,,'`//g ! s/^ cd \$(srcdir)[ ]*;/ / ! /^stamp-attrtab/,/copy/ { ! /\\$/d ! / fi/d ! /copy/ i\ ! \ genattrtab $(md_file) > tmp-attrtab.c ! } ! /^enquire[ ]*:/ s/\$(GCC_PARTS)//g ! /^enquire.o[ ]*:/ s/\$(GCC_PASSES)//g ! /^GCC_FOR_TARGET =/ c\ ! GCC_FOR_TARGET = gcc ! s/; *@true// ! /^OBJS.*stamp-objlist/ s?`cat ../stamp-objlist`?@../stamp-objlist? ! s/^\(SUBDIR_OBSTACK *=\).*$/\1 ..\/obstack.o/ ! s/^\(SUBDIR_USE_ALLOCA *=\).*$/\1/ ! s/^\(SUBDIR_MALLOC *=\).*$/\1/ ! /####target/ i\ ! STMP_FIXPROTO = \ ! OTHER_FIXINCLUDES_DIRS=/MSTOOLS/h \ ! RANLIB = : \ ! RANLIB_TEST = false \ ! OLDCC = cl \ ! MAKE = make \ ! SYMLINK = copy \ ! INSTALL = $(srcdir)/install.sh -c \ ! exeext = .exe \ ! objext = .obj \ ! oldobjext = .obj \ ! \ CC = cl \ ! CFLAGS = -Di386 -DWIN32 -D_WIN32 -DWINNT -D_M_IX86=300 -D_X86_=1 \\\ -DALMOST_STDC -D_MSC_VER=800 \ - CLIB = libc.lib kernel32.lib \ LDFLAGS = -align:0x1000 -subsystem:console -entry:mainCRTStartup \\\ ! -stack:1000000,1000000 \ ! \ ! EXTRA_PROGRAMS=ld.exe \ ! \ ! ld.obj: $(srcdir)/config/winnt/ld.c \ ! \ $(CC) $(CFLAGS) \\\ ! \ -I. -I$(srcdir) -I$(srcdir)/config -c $(srcdir)/config/winnt/ld.c \ ! \ ! ld.exe: ld.obj \ ! link -out:ld.exe ld.obj $(LDFLAGS) $(CLIB) \ \ EXTRA_OBJS=winnt.obj \ --- 24,34 ---- /^host_xm_file/ c\ host_xm_file=config/i386/xm-winnt.h ! /^####target/ i\ CC = cl \ ! CLIB = libc.lib kernel32.lib \ ! CFLAGS = -Di386 -DWIN32 -D_WIN32 -D_M_IX86=300 -D_X86_=1 \\\ -DALMOST_STDC -D_MSC_VER=800 \ LDFLAGS = -align:0x1000 -subsystem:console -entry:mainCRTStartup \\\ ! -stack:1000000,1000 \ \ EXTRA_OBJS=winnt.obj \ *************** *** 85,134 **** winnt.obj: $(srcdir)/config/i386/winnt.c \ \ $(CC) $(CFLAGS) \\\ ! \ -I. -I$(srcdir) -I$(srcdir)/config -c $(srcdir)/config/i386/winnt.c ! s/^C c:/Cc:/ ! s/\${OBJS}/\$(OBJS)/g ! s/\${SYSTEM_HEADER_DIR}/\$(SYSTEM_HEADER_DIR)/g ! s/\${HOST_CC}/\$(HOST_CC)/g ! s/ \${srcdir}\// /g ! s/\${mainversion}/\$(mainversion)/g ! s/\ $(srcdir)\/move-if-change$// ! s/\$(srcdir)\/move-if-change/copy/g ! /^# USE_HOST_OBSTACK/ i\ ! USE_HOST_OBSTACK=obstack.obj ! /^# USE_ALLOCA/ i\ ! USE_ALLOCA=alloca.obj ! /^# USE_HOST_ALLOCA/ i\ ! USE_HOST_ALLOCA=alloca.obj ! s/^ALLOCA =/ALLOCA = alloca.obj/ ! s/^ALLOCA_FINISH = true/ALLOCA_FINISH =/ ! s/ \.\// / ! s/^bi-\([a-z]*\) *:/bi-\1.exe :/ ! s/ bi-\([a-z]*\)$/ bi-\1.exe/ ! s/ bi-\([a-z]*\) / bi-\1.exe /g ! s/^gen\([a-z]*\) *:/gen\1.exe :/ ! s/ gen\([a-z]*\)$/ gen\1.exe/ ! s/ gen\([a-z]*\) / gen\1.exe /g ! s/genmultilib.exe/genmultilib/g ! s/^cccp *:/cccp.exe :/ ! s/cccp$/cccp.exe/ ! s/cccp /cccp.exe / ! s/CCCP=cccp.exe/CCCP=cccp/ ! s/^cpp *:/cpp.exe :/ ! s/cpp$/cpp.exe/ ! s/cpp /cpp.exe / ! s/^cc1 *:/cc1.exe :/ ! s/cc1$/cc1.exe/ ! s/cc1 /cc1.exe / ! s/^cc1obj *:/cc1obj.exe :/ ! s/cc1obj$/cc1obj.exe/ ! s/cc1obj /cc1obj.exe / ! s/^xgcc *:/xgcc.exe :/ ! s/xgcc$/xgcc.exe/ ! s/xgcc /xgcc.exe / ! s/\.o *:/.obj :/ ! s/\.o$/.obj/ ! s/\.o /.obj /g ! s/-rm -f cpp.exe/del cpp.exe/ ! s/\$(CC) \$(ALL_CFLAGS) \$(LDFLAGS) -o /link $(LDFLAGS) -out:/ ! s/\$(HOST_CC) \$(HOST_CFLAGS) \$(HOST_LDFLAGS) -o /link $(HOST_LDFLAGS) -out:/ ! s/^\ // --- 35,38 ---- winnt.obj: $(srcdir)/config/i386/winnt.c \ \ $(CC) $(CFLAGS) \\\ ! \ -I. -I$(srcdir) -I$(srcdir)/config -c $(srcdir)/config/i386/winnt.c \ ! diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/i386.c gcc-2.7.1/config/i386/i386.c *** gcc-2.7.0/config/i386/i386.c Thu Jun 15 09:46:11 1995 --- gcc-2.7.1/config/i386/i386.c Sun Oct 22 07:13:21 1995 *************** *** 387,400 **** return 0; ! if (fundecl && TREE_CODE_CLASS (TREE_CODE (fundecl)) == 'd') ! { ! /* Cdecl functions override -mrtd, and never pop the stack */ ! if (lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))) ! return 0; ! ! /* Stdcall functions will pop the stack if not variable args */ ! if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (funtype))) ! rtd = 1; ! } if (rtd) --- 387,397 ---- return 0; ! /* Cdecl functions override -mrtd, and never pop the stack */ ! if (lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))) ! return 0; ! ! /* Stdcall functions will pop the stack if not variable args */ ! if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (funtype))) ! rtd = 1; if (rtd) *************** *** 1401,1404 **** --- 1398,1420 ---- return 0; } + + /* Return 1 if OP is a comparison operator that can use the condition code + generated by an arithmetic operation. */ + + int + arithmetic_comparison_operator (op, mode) + register rtx op; + enum machine_mode mode; + { + enum rtx_code code; + + if (mode != VOIDmode && mode != GET_MODE (op)) + return 0; + code = GET_CODE (op); + if (GET_RTX_CLASS (code) != '<') + return 0; + + return (code != GT && code != LE); + } /* Returns 1 if OP contains a symbol reference */ *************** *** 2374,2387 **** switch (GET_CODE (x)) { case NE: fputs ("jne", file); return; case EQ: fputs ("je", file); return; ! case GE: fputs ("jge", file); return; ! case GT: fputs ("jg", file); return; ! case LE: fputs ("jle", file); return; ! case LT: fputs ("jl", file); return; ! case GEU: fputs ("jae", file); return; ! case GTU: fputs ("ja", file); return; ! case LEU: fputs ("jbe", file); return; ! case LTU: fputs ("jb", file); return; } abort (); --- 2390,2407 ---- switch (GET_CODE (x)) { + /* These conditions are appropriate for testing the result + of an arithmetic operation, not for a compare operation. + Cases GE, LT assume CC_NO_OVERFLOW true. All cases assume + CC_Z_IN_NOT_C false and not floating point. */ case NE: fputs ("jne", file); return; case EQ: fputs ("je", file); return; ! case GE: fputs ("jns", file); return; ! case LT: fputs ("js", file); return; ! case GEU: fputs ("jmp", file); return; ! case GTU: fputs ("jne", file); return; ! case LEU: fputs ("je", file); return; ! case LTU: fputs ("#branch never", file); return; ! ! /* no matching branches for GT nor LE */ } abort (); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/i386.h gcc-2.7.1/config/i386/i386.h *** gcc-2.7.0/config/i386/i386.h Thu Jun 15 09:46:26 1995 --- gcc-2.7.1/config/i386/i386.h Fri Sep 22 18:42:57 1995 *************** *** 658,661 **** --- 658,662 ---- (C) == 'L' ? (VALUE) == 0xffff : \ (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 3 : \ + (C) == 'N' ? (VALUE) >= 0 && (VALUE) <= 255 :\ 0) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/i386.md gcc-2.7.1/config/i386/i386.md *** gcc-2.7.0/config/i386/i386.md Thu Jun 15 16:51:33 1995 --- gcc-2.7.1/config/i386/i386.md Mon Aug 21 13:27:58 1995 *************** *** 4911,4914 **** --- 4911,4917 ---- }") + ;; ??? could transform while(--i > 0) S; to if (--i > 0) do S; while(--i); + ;; if S does not change i + (define_expand "decrement_and_branch_until_zero" [(parallel [(set (pc) *************** *** 4926,4930 **** (define_insn "" [(set (pc) ! (if_then_else (match_operator 0 "comparison_operator" [(plus:SI (match_operand:SI 1 "general_operand" "+r,m") (match_operand:SI 2 "general_operand" "rmi,ri")) --- 4929,4933 ---- (define_insn "" [(set (pc) ! (if_then_else (match_operator 0 "arithmetic_comparison_operator" [(plus:SI (match_operand:SI 1 "general_operand" "+r,m") (match_operand:SI 2 "general_operand" "rmi,ri")) *************** *** 4953,4957 **** (define_insn "" [(set (pc) ! (if_then_else (match_operator 0 "comparison_operator" [(minus:SI (match_operand:SI 1 "general_operand" "+r,m") (match_operand:SI 2 "general_operand" "rmi,ri")) --- 4956,4960 ---- (define_insn "" [(set (pc) ! (if_then_else (match_operator 0 "arithmetic_comparison_operator" [(minus:SI (match_operand:SI 1 "general_operand" "+r,m") (match_operand:SI 2 "general_operand" "rmi,ri")) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/iscdbx.h gcc-2.7.1/config/i386/iscdbx.h *** gcc-2.7.0/config/i386/iscdbx.h Thu Jun 15 09:46:50 1995 --- gcc-2.7.1/config/i386/iscdbx.h Mon Jul 10 18:12:26 1995 *************** *** 2,6 **** using dbx-in-coff encapsulation. Specifically, this is for recent versions that support POSIX. ! Copyright (C) 1992 Free Software Foundation, Inc. This file is part of GNU CC. --- 2,6 ---- using dbx-in-coff encapsulation. Specifically, this is for recent versions that support POSIX. ! Copyright (C) 1992, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 35,41 **** "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\ %{!shlib:%{posix:%{pg:mcrtp1.o%s}%{!pg:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}}\ ! %{!posix:%{pg:mcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}\ %{p:-L/usr/lib/libp} %{pg:-L/usr/lib/libp}}\ ! %{shlib:%{posix:crtp1.o%s}%{!posix:crt1.o%s}}" #undef ENDFILE_SPEC --- 35,42 ---- "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\ %{!shlib:%{posix:%{pg:mcrtp1.o%s}%{!pg:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}}\ ! %{Xp:%{pg:mcrtp1.o%s}%{!pg:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}}\ ! %{!posix:%{!Xp:%{pg:mcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}\ %{p:-L/usr/lib/libp} %{pg:-L/usr/lib/libp}}\ ! %{shlib:%{posix:crtp1.o%s}%{Xp:crtp1.o%s}%{!posix:%{!Xp:crt1.o%s}}}" #undef ENDFILE_SPEC diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/netbsd.h gcc-2.7.1/config/i386/netbsd.h *** gcc-2.7.0/config/i386/netbsd.h Tue May 9 18:12:48 1995 --- gcc-2.7.1/config/i386/netbsd.h Thu Sep 28 14:00:05 1995 *************** *** 23,32 **** #undef WCHAR_TYPE ! #define WCHAR_TYPE "short unsigned int" ! #define WCHAR_UNSIGNED 1 #undef WCHAR_TYPE_SIZE ! #define WCHAR_TYPE_SIZE 16 #define HANDLE_SYSV_PRAGMA --- 23,33 ---- #undef WCHAR_TYPE ! #define WCHAR_TYPE "int" ! #undef WCHAR_UNSIGNED ! #define WCHAR_UNSIGNED 0 #undef WCHAR_TYPE_SIZE ! #define WCHAR_TYPE_SIZE 32 #define HANDLE_SYSV_PRAGMA diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/osfrose.h gcc-2.7.1/config/i386/osfrose.h *** gcc-2.7.0/config/i386/osfrose.h Thu Jun 15 09:49:20 1995 --- gcc-2.7.1/config/i386/osfrose.h Mon Jun 26 09:56:02 1995 *************** *** 186,194 **** #define NO_IMPLICIT_EXTERN_C - #ifdef NO_LONG_DOUBLE /* Turn off long double being 96 bits. */ #undef LONG_DOUBLE_TYPE_SIZE #define LONG_DOUBLE_TYPE_SIZE 64 - #endif /* This macro generates the assembly code for function entry. --- 186,192 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/sol2.h gcc-2.7.1/config/i386/sol2.h *** gcc-2.7.0/config/i386/sol2.h Thu Jun 15 09:52:26 1995 --- gcc-2.7.1/config/i386/sol2.h Sun Oct 29 07:38:56 1995 *************** *** 1,4 **** /* Target definitions for GNU compiler for Intel 80386 running Solaris 2 ! Copyright (C) 1993 Free Software Foundation, Inc. Written by Fred Fish (fnf@cygnus.com). --- 1,4 ---- /* Target definitions for GNU compiler for Intel 80386 running Solaris 2 ! Copyright (C) 1993, 1995 Free Software Foundation, Inc. Written by Fred Fish (fnf@cygnus.com). *************** *** 38,42 **** #undef CPP_PREDEFINES #define CPP_PREDEFINES \ ! "-Di386 -Dunix -D__svr4__ -Dsun \ -Asystem(unix) -Asystem(svr4) -Acpu(i386) -Amachine(i386)" --- 38,42 ---- #undef CPP_PREDEFINES #define CPP_PREDEFINES \ ! "-Di386 -Dunix -D__svr4__ -D__SVR4 -Dsun \ -Asystem(unix) -Asystem(svr4) -Acpu(i386) -Amachine(i386)" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/svr3dbx.h gcc-2.7.1/config/i386/svr3dbx.h *** gcc-2.7.0/config/i386/svr3dbx.h Thu Jun 15 09:53:16 1995 --- gcc-2.7.1/config/i386/svr3dbx.h Mon Aug 28 06:35:26 1995 *************** *** 1,4 **** /* Definitions for Intel 386 running system V, using dbx-in-coff encapsulation. ! Copyright (C) 1992 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions for Intel 386 running system V, using dbx-in-coff encapsulation. ! Copyright (C) 1992, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 38,42 **** /* With the current gas, .align N aligns to an N-byte boundary. This is done to be compatible with the system assembler. ! You have specify -DOTHER_ALIGN wenn building gas-1.38.1. */ #undef ASM_OUTPUT_ALIGN --- 38,42 ---- /* With the current gas, .align N aligns to an N-byte boundary. This is done to be compatible with the system assembler. ! You must specify -DOTHER_ALIGN when building gas-1.38.1. */ #undef ASM_OUTPUT_ALIGN diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/win-nt.h gcc-2.7.1/config/i386/win-nt.h *** gcc-2.7.0/config/i386/win-nt.h --- gcc-2.7.1/config/i386/win-nt.h Tue Sep 19 19:18:26 1995 *************** *** 0 **** --- 1,152 ---- + /* Operating system specific defines to be used when targeting GCC for + Windows NT 3.x on an i386. + Copyright (C) 1994, 1995 Free Software Foundation, Inc. + Contributed by Douglas B. Rupp (drupp@cs.washington.edu). + + 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #define YES_UNDERSCORES + + #include "i386/gas.h" + + #ifdef CPP_PREDEFINES + #undef CPP_PREDEFINES + #endif + #define CPP_PREDEFINES "-Dunix -Di386 -DWIN32 -D_WIN32 \ + -DWINNT -D_M_IX86=300 -D_X86_=1 -D__STDC__=0 -DALMOST_STDC -D_MSC_VER=800 \ + -D__stdcall=__attribute__((__stdcall__)) \ + -D__cdecl=__attribute__((__cdecl__)) \ + -D_cdecl=__attribute__((__cdecl__)) \ + -Asystem(unix) -Asystem(winnt) -Acpu(i386) -Amachine(i386)" + + #define SIZE_TYPE "unsigned int" + #define PTRDIFF_TYPE "int" + #define WCHAR_UNSIGNED 1 + #define WCHAR_TYPE_SIZE 16 + #define WCHAR_TYPE "short unsigned int" + #undef LONG_DOUBLE_TYPE_SIZE + #define LONG_DOUBLE_TYPE_SIZE 64 + #define HAVE_ATEXIT 1 + + #undef EXTRA_SECTIONS + #define EXTRA_SECTIONS in_ctor, in_dtor + + #undef EXTRA_SECTION_FUNCTIONS + #define EXTRA_SECTION_FUNCTIONS \ + CTOR_SECTION_FUNCTION \ + DTOR_SECTION_FUNCTION + + #define CTOR_SECTION_FUNCTION \ + void \ + ctor_section () \ + { \ + if (in_section != in_ctor) \ + { \ + fprintf (asm_out_file, "\t.section .ctor\n"); \ + in_section = in_ctor; \ + } \ + } + + #define DTOR_SECTION_FUNCTION \ + void \ + dtor_section () \ + { \ + if (in_section != in_dtor) \ + { \ + fprintf (asm_out_file, "\t.section .dtor\n"); \ + in_section = in_dtor; \ + } \ + } + + #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ + do { \ + ctor_section (); \ + fprintf (FILE, "%s\t", ASM_LONG); \ + assemble_name (FILE, NAME); \ + fprintf (FILE, "\n"); \ + } while (0) + + #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ + do { \ + dtor_section (); \ + fprintf (FILE, "%s\t", ASM_LONG); \ + assemble_name (FILE, NAME); \ + fprintf (FILE, "\n"); \ + } while (0) + + /* Define this macro if references to a symbol must be treated + differently depending on something about the variable or + function named by the symbol (such as what section it is in). + + On i386, if using PIC, mark a SYMBOL_REF for a non-global symbol + so that we may access it directly in the GOT. + + On i386 running Windows NT, modify the assembler name with a suffix + consisting of an atsign (@) followed by string of digits that represents + the number of bytes of arguments passed to the function, if it has the + attribute STDCALL. */ + + #ifdef ENCODE_SECTION_INFO + #undef ENCODE_SECTION_INFO + #define ENCODE_SECTION_INFO(DECL) \ + do \ + { \ + if (flag_pic) \ + { \ + rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ + ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \ + SYMBOL_REF_FLAG (XEXP (rtl, 0)) \ + = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ + || ! TREE_PUBLIC (DECL)); \ + } \ + if (TREE_CODE (DECL) == FUNCTION_DECL) \ + if (lookup_attribute ("stdcall", \ + TYPE_ATTRIBUTES (TREE_TYPE (DECL)))) \ + XEXP (DECL_RTL (DECL), 0) = \ + gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (DECL)); \ + } \ + while (0) + #endif + + /* The global __fltused is necessary to cause the printf/scanf routines + for outputting/inputting floating point numbers to be loaded. Since this + is kind of hard to detect, we just do it all the time. */ + + #ifdef ASM_FILE_START + #undef ASM_FILE_START + #endif + #define ASM_FILE_START(FILE) \ + do { fprintf (FILE, "\t.file\t"); \ + output_quoted_string (FILE, dump_base_name); \ + fprintf (FILE, "\n"); \ + fprintf (FILE, ".global\t__fltused\n"); \ + } while (0) + + /* if the switch "-mwindows" is passed to ld, then specify to the Microsoft + linker the proper switches and libraries to build a graphical program */ + + #undef LIB_SPEC + #define LIB_SPEC "%{mwindows:-subsystem windows -e _WinMainCRTStartup \ + USER32.LIB%s GDI32.LIB%s COMDLG32.LIB%s WINSPOOL.LIB%s} \ + %{!mwindows:-subsystem console -e _mainCRTStartup} \ + %{mcrtmt:LIBCMT.LIB%s KERNEL32.LIB%s ADVAPI32.LIB%s} \ + %{!mcrtmt:LIBC.LIB%s KERNEL32.LIB%s ADVAPI32.LIB%s} \ + %{v}" + + #include "winnt/win-nt.h" + Only in gcc-2.7.0/config/i386: winnt.h diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/x-isc3 gcc-2.7.1/config/i386/x-isc3 *** gcc-2.7.0/config/i386/x-isc3 Mon May 29 12:38:18 1995 --- gcc-2.7.1/config/i386/x-isc3 Wed Jun 28 16:25:17 1995 *************** *** 3,5 **** X_CFLAGS = -D_SYSV3 -Xp ENQUIRE_LDFLAGS = $(LDFLAGS) - INSTALL_HEADERS_DIR = install-headers-cpio --- 3,4 ---- Only in gcc-2.7.0/config/i386: x-winnt diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i386/xm-dos.h gcc-2.7.1/config/i386/xm-dos.h *** gcc-2.7.0/config/i386/xm-dos.h Fri May 27 17:55:27 1994 --- gcc-2.7.1/config/i386/xm-dos.h Sun Aug 13 18:51:44 1995 *************** *** 16,17 **** --- 16,20 ---- #define NO_PRECOMPILES 1 + + /* sys_errlist proto in cccp.c doesn't match djgpp */ + #define HAVE_STRERROR diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i960/i960.c gcc-2.7.1/config/i960/i960.c *** gcc-2.7.0/config/i960/i960.c Thu Jun 15 10:16:07 1995 --- gcc-2.7.1/config/i960/i960.c Sun Nov 5 10:48:22 1995 *************** *** 561,574 **** enum machine_mode mode; { - register rtx operand0 = operands[0]; - register rtx operand1 = operands[1]; - /* We can only store registers to memory. */ ! if (GET_CODE (operand0) == MEM && GET_CODE (operand1) != REG) ! operands[1] = force_reg (mode, operand1); return 0; } /* Emit insns to load a constant to non-floating point registers. --- 561,729 ---- enum machine_mode mode; { /* We can only store registers to memory. */ ! if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) != REG) ! operands[1] = force_reg (mode, operands[1]); ! ! /* Storing multi-word values in unaligned hard registers to memory may ! require a scratch since we have to store them a register at a time and ! adding 4 to the memory address may not yield a valid insn. */ ! /* ??? We don't always need the scratch, but that would complicate things. ! Maybe later. */ ! if (GET_MODE_SIZE (mode) > UNITS_PER_WORD ! && GET_CODE (operands[0]) == MEM ! && GET_CODE (operands[1]) == REG ! && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER ! && ! HARD_REGNO_MODE_OK (REGNO (operands[1]), mode)) ! { ! emit_insn (gen_rtx (PARALLEL, VOIDmode, ! gen_rtvec (2, ! gen_rtx (SET, VOIDmode, ! operands[0], operands[1]), ! gen_rtx (CLOBBER, VOIDmode, ! gen_rtx (SCRATCH, Pmode))))); ! return 1; ! } return 0; } + + /* Output assembler to move a double word value. */ + + char * + i960_output_move_double (dst, src) + rtx dst, src; + { + rtx operands[5]; + + if (GET_CODE (dst) == REG + && GET_CODE (src) == REG) + { + if ((REGNO (src) & 1) + || (REGNO (dst) & 1)) + { + /* We normally copy the low-numbered register first. However, if + the second source register is the same as the first destination + register, we must copy in the opposite order. */ + if (REGNO (src) + 1 == REGNO (dst)) + return "mov %D1,%D0\n\tmov %1,%0"; + else + return "mov %1,%0\n\tmov %D1,%D0"; + } + else + return "movl %1,%0"; + } + else if (GET_CODE (dst) == REG + && GET_CODE (src) == CONST_INT + && CONST_OK_FOR_LETTER_P (INTVAL (src), 'I')) + { + if (REGNO (dst) & 1) + return "mov %1,%0\n\tmov 0,%D0"; + else + return "movl %1,%0"; + } + else if (GET_CODE (dst) == REG + && GET_CODE (src) == MEM) + { + if (REGNO (dst) & 1) + { + /* One can optimize a few cases here, but you have to be + careful of clobbering registers used in the address and + edge conditions. */ + operands[0] = dst; + operands[1] = src; + operands[2] = gen_rtx (REG, Pmode, REGNO (dst) + 1); + operands[3] = gen_rtx (MEM, word_mode, operands[2]); + operands[4] = adj_offsettable_operand (operands[3], UNITS_PER_WORD); + output_asm_insn ("lda %1,%2\n\tld %3,%0\n\tld %4,%D0", operands); + return ""; + } + else + return "ldl %1,%0"; + } + else if (GET_CODE (dst) == MEM + && GET_CODE (src) == REG) + { + if (REGNO (src) & 1) + { + /* This is handled by emit_move_sequence so we shouldn't get here. */ + abort (); + } + return "stl %1,%0"; + } + else + abort (); + } + + /* Output assembler to move a quad word value. */ + + char * + i960_output_move_quad (dst, src) + rtx dst, src; + { + rtx operands[7]; + + if (GET_CODE (dst) == REG + && GET_CODE (src) == REG) + { + if ((REGNO (src) & 3) + || (REGNO (dst) & 3)) + { + /* We normally copy starting with the low numbered register. + However, if there is an overlap such that the first dest reg + is <= the last source reg but not < the first source reg, we + must copy in the opposite order. */ + if (REGNO (dst) <= REGNO (src) + 3 + && REGNO (dst) >= REGNO (src)) + return "mov %F1,%F0\n\tmov %E1,%E0\n\tmov %D1,%D0\n\tmov %1,%0"; + else + return "mov %1,%0\n\tmov %D1,%D0\n\tmov %E1,%E0\n\tmov %F1,%F0"; + } + else + return "movq %1,%0"; + } + else if (GET_CODE (dst) == REG + && GET_CODE (src) == CONST_INT + && CONST_OK_FOR_LETTER_P (INTVAL (src), 'I')) + { + if (REGNO (dst) & 3) + return "mov %1,%0\n\tmov 0,%D0\n\tmov 0,%E0\n\tmov 0,%F0"; + else + return "movq %1,%0"; + } + else if (GET_CODE (dst) == REG + && GET_CODE (src) == MEM) + { + if (REGNO (dst) & 3) + { + /* One can optimize a few cases here, but you have to be + careful of clobbering registers used in the address and + edge conditions. */ + operands[0] = dst; + operands[1] = src; + operands[2] = gen_rtx (REG, Pmode, REGNO (dst) + 3); + operands[3] = gen_rtx (MEM, word_mode, operands[2]); + operands[4] = adj_offsettable_operand (operands[3], UNITS_PER_WORD); + operands[5] = adj_offsettable_operand (operands[4], UNITS_PER_WORD); + operands[6] = adj_offsettable_operand (operands[5], UNITS_PER_WORD); + output_asm_insn ("lda %1,%2\n\tld %3,%0\n\tld %4,%D0\n\tld %5,%E0\n\tld %6,%F0", operands); + return ""; + } + else + return "ldq %1,%0"; + } + else if (GET_CODE (dst) == MEM + && GET_CODE (src) == REG) + { + if (REGNO (src) & 3) + { + /* This is handled by emit_move_sequence so we shouldn't get here. */ + abort (); + } + return "stq %1,%0"; + } + else + abort (); + } /* Emit insns to load a constant to non-floating point registers. *************** *** 1312,1319 **** fprintf (file, "%s", epilogue_string); ! /* Must clear g14 on return. */ ! if (current_function_args_size != 0 ! || VARARGS_STDARG_FUNCTION (current_function_decl)) fprintf (file, "\tmov 0,g14\n"); --- 1467,1474 ---- fprintf (file, "%s", epilogue_string); ! /* Must clear g14 on return if this function set it. ! Only varargs/stdarg functions modify g14. */ ! if (VARARGS_STDARG_FUNCTION (current_function_decl)) fprintf (file, "\tmov 0,g14\n"); *************** *** 1363,1368 **** --- 1518,1528 ---- output_asm_insn ("callx %0", operands); + /* If the caller sets g14 to the address of the argblock, then the caller + must clear it after the return. */ + if (current_function_args_size != 0 || varargs_stdarg_function) output_asm_insn ("mov r3,g14", operands); + else if (argsize > 48) + output_asm_insn ("mov 0,g14", operands); return ""; *************** *** 1386,1391 **** } ! if (current_function_args_size != 0 ! || VARARGS_STDARG_FUNCTION (current_function_decl)) output_asm_insn ("mov 0,g14", 0); --- 1546,1553 ---- } ! /* Must clear g14 on return if this function set it. ! Only varargs/stdarg functions modify g14. */ ! ! if (VARARGS_STDARG_FUNCTION (current_function_decl)) output_asm_insn ("mov 0,g14", 0); *************** *** 1447,1454 **** { case 'D': ! /* Second reg of a double. */ fprintf (file, "%s", reg_names[REGNO (x)+1]); break; case 0: fprintf (file, "%s", reg_names[REGNO (x)]); --- 1609,1626 ---- { case 'D': ! /* Second reg of a double or quad. */ fprintf (file, "%s", reg_names[REGNO (x)+1]); break; + case 'E': + /* Third reg of a quad. */ + fprintf (file, "%s", reg_names[REGNO (x)+2]); + break; + + case 'F': + /* Fourth reg of a quad. */ + fprintf (file, "%s", reg_names[REGNO (x)+3]); + break; + case 0: fprintf (file, "%s", reg_names[REGNO (x)]); *************** *** 2054,2058 **** if (type == 0) ! align = size; else if (TYPE_ALIGN (type) >= BITS_PER_WORD) align = TYPE_ALIGN (type) / BITS_PER_WORD; --- 2226,2237 ---- if (type == 0) ! { ! /* ??? This is a hack to properly correct the alignment of XFmode ! values without affecting anything else. */ ! if (size == 3) ! align = 4; ! else ! align = size; ! } else if (TYPE_ALIGN (type) >= BITS_PER_WORD) align = TYPE_ALIGN (type) / BITS_PER_WORD; *************** *** 2069,2073 **** Additionally, parameters with an alignment requirement stronger than ! a word must be be aligned appropriately. */ /* Update CUM to advance past an argument described by MODE and TYPE. */ --- 2248,2254 ---- Additionally, parameters with an alignment requirement stronger than ! a word must be aligned appropriately. Note that this means that a ! 64 bit object with a 32 bit alignment is not 64 bit aligned and may be ! passed in an odd/even register pair. */ /* Update CUM to advance past an argument described by MODE and TYPE. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i960/i960.h gcc-2.7.1/config/i960/i960.h *** gcc-2.7.0/config/i960/i960.h Thu Jun 15 10:15:53 1995 --- gcc-2.7.1/config/i960/i960.h Mon Aug 28 06:17:53 1995 *************** *** 309,313 **** /* Define for cross-compilation from a host with a different float format ! or endianess, as well as to support 80 bit long doubles on the i960. */ #define REAL_ARITHMETIC --- 309,313 ---- /* Define for cross-compilation from a host with a different float format ! or endianness, as well as to support 80 bit long doubles on the i960. */ #define REAL_ARITHMETIC diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/i960/i960.md gcc-2.7.1/config/i960/i960.md *** gcc-2.7.0/config/i960/i960.md Thu Jun 15 16:52:20 1995 --- gcc-2.7.1/config/i960/i960.md Sun Nov 5 10:48:29 1995 *************** *** 1,4 **** ;;- Machine description for Intel 80960 chip for GNU C compiler ! ;; Copyright (C) 1992 Free Software Foundation, Inc. ;; Contributed by Steven McGeady, Intel Corp. ;; Additional work by Glenn Colon-Bonet, Jonathan Shapiro, Andy Wilson --- 1,4 ---- ;;- Machine description for Intel 80960 chip for GNU C compiler ! ;; Copyright (C) 1992, 1995 Free Software Foundation, Inc. ;; Contributed by Steven McGeady, Intel Corp. ;; Additional work by Glenn Colon-Bonet, Jonathan Shapiro, Andy Wilson *************** *** 555,563 **** ;; overwise being used is zero. Thus, we can handle store zero to memory ;; by storing an unused arg pointer. The arg pointer will be unused if ! ;; current_function_args_size is zero. This value of this variable is not ! ;; valid until after all rtl generation is complete, including function ! ;; inlining (because a function that doesn't need an arg pointer may be ! ;; inlined into a function that does need an arg pointer), so we must also ! ;; check that rtx_equal_function_value_matters is zero. (define_insn "" --- 555,564 ---- ;; overwise being used is zero. Thus, we can handle store zero to memory ;; by storing an unused arg pointer. The arg pointer will be unused if ! ;; current_function_args_size is zero and this is not a stdarg/varargs ! ;; function. This value of the former variable is not valid until after ! ;; all rtl generation is complete, including function inlining (because a ! ;; function that doesn't need an arg pointer may be inlined into a function ! ;; that does need an arg pointer), so we must also check that ! ;; rtx_equal_function_value_matters is zero. (define_insn "" *************** *** 565,568 **** --- 566,571 ---- (match_operand:SI 1 "general_operand" "dI,i,m,dJ"))] "(current_function_args_size == 0 + && current_function_varargs == 0 + && current_function_stdarg == 0 && rtx_equal_function_value_matters == 0) && (register_operand (operands[0], SImode) *************** *** 599,602 **** --- 602,607 ---- (match_operand:SI 1 "general_operand" "dI,i,m,d"))] "(current_function_args_size != 0 + || current_function_varargs != 0 + || current_function_stdarg != 0 || rtx_equal_function_value_matters != 0) && (register_operand (operands[0], SImode) *************** *** 644,647 **** --- 649,654 ---- (match_operand:HI 1 "general_operand" "dI,i,m,dJ"))] "(current_function_args_size == 0 + && current_function_varargs == 0 + && current_function_stdarg == 0 && rtx_equal_function_value_matters == 0) && (register_operand (operands[0], HImode) *************** *** 679,682 **** --- 686,691 ---- (match_operand:HI 1 "general_operand" "dI,i,m,d"))] "(current_function_args_size != 0 + || current_function_varargs != 0 + || current_function_stdarg != 0 || rtx_equal_function_value_matters != 0) && (register_operand (operands[0], HImode) *************** *** 721,724 **** --- 730,735 ---- (match_operand:QI 1 "general_operand" "dI,i,m,dJ"))] "(current_function_args_size == 0 + && current_function_varargs == 0 + && current_function_stdarg == 0 && rtx_equal_function_value_matters == 0) && (register_operand (operands[0], QImode) *************** *** 756,759 **** --- 767,772 ---- (match_operand:QI 1 "general_operand" "dI,i,m,d"))] "(current_function_args_size != 0 + || current_function_varargs != 0 + || current_function_stdarg != 0 || rtx_equal_function_value_matters != 0) && (register_operand (operands[0], QImode) *************** *** 795,801 **** ;; The store case can not be separate. See comment above. (define_insn "" ! [(set (match_operand:DI 0 "general_operand" "=d,d,d,m,o") ! (match_operand:DI 1 "general_operand" "dI,i,m,d,J"))] "(current_function_args_size == 0 && rtx_equal_function_value_matters == 0) && (register_operand (operands[0], DImode) --- 808,816 ---- ;; The store case can not be separate. See comment above. (define_insn "" ! [(set (match_operand:DI 0 "general_operand" "=d,d,d,d,m,o") ! (match_operand:DI 1 "general_operand" "d,I,i,m,d,J"))] "(current_function_args_size == 0 + && current_function_varargs == 0 + && current_function_stdarg == 0 && rtx_equal_function_value_matters == 0) && (register_operand (operands[0], DImode) *************** *** 807,818 **** { case 0: - return \"movl %1,%0\"; case 1: - return i960_output_ldconst (operands[0], operands[1]); - case 2: - return \"ldl %1,%0\"; case 3: - return \"stl %1,%0\"; case 4: operands[1] = adj_offsettable_operand (operands[0], 4); return \"st g14,%0\;st g14,%1\"; --- 822,832 ---- { case 0: case 1: case 3: case 4: + return i960_output_move_double (operands[0], operands[1]); + case 2: + return i960_output_ldconst (operands[0], operands[1]); + case 5: operands[1] = adj_offsettable_operand (operands[0], 4); return \"st g14,%0\;st g14,%1\"; *************** *** 819,829 **** } }" ! [(set_attr "type" "move,load,load,store,store")]) ;; The store case can not be separate. See comment above. (define_insn "" ! [(set (match_operand:DI 0 "general_operand" "=d,d,d,m") ! (match_operand:DI 1 "general_operand" "dI,i,m,d"))] "(current_function_args_size != 0 || rtx_equal_function_value_matters != 0) && (register_operand (operands[0], DImode) --- 833,845 ---- } }" ! [(set_attr "type" "move,move,load,load,store,store")]) ;; The store case can not be separate. See comment above. (define_insn "" ! [(set (match_operand:DI 0 "general_operand" "=d,d,d,d,m") ! (match_operand:DI 1 "general_operand" "d,I,i,m,d"))] "(current_function_args_size != 0 + || current_function_varargs != 0 + || current_function_stdarg != 0 || rtx_equal_function_value_matters != 0) && (register_operand (operands[0], DImode) *************** *** 834,847 **** { case 0: - return \"movl %1,%0\"; case 1: - return i960_output_ldconst (operands[0], operands[1]); - case 2: - return \"ldl %1,%0\"; case 3: ! return \"stl %1,%0\"; } }" ! [(set_attr "type" "move,load,load,store")]) (define_expand "movti" --- 850,875 ---- { case 0: case 1: case 3: ! case 4: ! return i960_output_move_double (operands[0], operands[1]); ! case 2: ! return i960_output_ldconst (operands[0], operands[1]); } }" ! [(set_attr "type" "move,move,load,load,store")]) ! ! (define_insn "*store_unaligned_di_reg" ! [(set (match_operand:DI 0 "memory_operand" "=m") ! (match_operand:DI 1 "register_operand" "d")) ! (clobber (match_scratch:SI 2 "=&d"))] ! "" ! "* ! { ! operands[3] = gen_rtx (MEM, word_mode, operands[2]); ! operands[4] = adj_offsettable_operand (operands[3], UNITS_PER_WORD); ! return \"lda %0,%2\;st %1,%3\;st %D1,%4\"; ! }" ! [(set_attr "type" "store")]) (define_expand "movti" *************** *** 857,863 **** ;; The store case can not be separate. See comment above. (define_insn "" ! [(set (match_operand:TI 0 "general_operand" "=d,d,d,m,o") ! (match_operand:TI 1 "general_operand" "dI,i,m,d,J"))] "(current_function_args_size == 0 && rtx_equal_function_value_matters == 0) && (register_operand (operands[0], TImode) --- 885,893 ---- ;; The store case can not be separate. See comment above. (define_insn "" ! [(set (match_operand:TI 0 "general_operand" "=d,d,d,d,m,o") ! (match_operand:TI 1 "general_operand" "d,I,i,m,d,J"))] "(current_function_args_size == 0 + && current_function_varargs == 0 + && current_function_stdarg == 0 && rtx_equal_function_value_matters == 0) && (register_operand (operands[0], TImode) *************** *** 869,880 **** { case 0: - return \"movq %1,%0\"; case 1: - return i960_output_ldconst (operands[0], operands[1]); - case 2: - return \"ldq %1,%0\"; case 3: - return \"stq %1,%0\"; case 4: operands[1] = adj_offsettable_operand (operands[0], 4); operands[2] = adj_offsettable_operand (operands[0], 8); --- 899,909 ---- { case 0: case 1: case 3: case 4: + return i960_output_move_quad (operands[0], operands[1]); + case 2: + return i960_output_ldconst (operands[0], operands[1]); + case 5: operands[1] = adj_offsettable_operand (operands[0], 4); operands[2] = adj_offsettable_operand (operands[0], 8); *************** *** 883,893 **** } }" ! [(set_attr "type" "move,load,load,store,store")]) ;; The store case can not be separate. See comment above. (define_insn "" ! [(set (match_operand:TI 0 "general_operand" "=d,d,d,m") ! (match_operand:TI 1 "general_operand" "dI,i,m,d"))] "(current_function_args_size != 0 || rtx_equal_function_value_matters != 0) && (register_operand (operands[0], TImode) --- 912,924 ---- } }" ! [(set_attr "type" "move,move,load,load,store,store")]) ;; The store case can not be separate. See comment above. (define_insn "" ! [(set (match_operand:TI 0 "general_operand" "=d,d,d,d,m") ! (match_operand:TI 1 "general_operand" "d,I,i,m,d"))] "(current_function_args_size != 0 + || current_function_varargs != 0 + || current_function_stdarg != 0 || rtx_equal_function_value_matters != 0) && (register_operand (operands[0], TImode) *************** *** 898,911 **** { case 0: - return \"movq %1,%0\"; case 1: - return i960_output_ldconst (operands[0], operands[1]); - case 2: - return \"ldq %1,%0\"; case 3: ! return \"stq %1,%0\"; } }" ! [(set_attr "type" "move,load,load,store")]) (define_expand "store_multiple" --- 929,956 ---- { case 0: case 1: case 3: ! case 4: ! return i960_output_move_quad (operands[0], operands[1]); ! case 2: ! return i960_output_ldconst (operands[0], operands[1]); } }" ! [(set_attr "type" "move,move,load,load,store")]) ! ! (define_insn "*store_unaligned_ti_reg" ! [(set (match_operand:TI 0 "memory_operand" "=m") ! (match_operand:TI 1 "register_operand" "d")) ! (clobber (match_scratch:SI 2 "=&d"))] ! "" ! "* ! { ! operands[3] = gen_rtx (MEM, word_mode, operands[2]); ! operands[4] = adj_offsettable_operand (operands[3], UNITS_PER_WORD); ! operands[5] = adj_offsettable_operand (operands[4], UNITS_PER_WORD); ! operands[6] = adj_offsettable_operand (operands[5], UNITS_PER_WORD); ! return \"lda %0,%2\;st %1,%3\;st %D1,%4\;st %E1,%5\;st %F1,%6\"; ! }" ! [(set_attr "type" "store")]) (define_expand "store_multiple" *************** *** 978,981 **** --- 1023,1028 ---- (match_operand:DF 1 "fpmove_src_operand" "r,GH,F,m,d,G"))] "(current_function_args_size == 0 + && current_function_varargs == 0 + && current_function_stdarg == 0 && rtx_equal_function_value_matters == 0) && (register_operand (operands[0], DFmode) *************** *** 1010,1013 **** --- 1057,1062 ---- (match_operand:DF 1 "fpmove_src_operand" "r,GH,F,m,d"))] "(current_function_args_size != 0 + || current_function_varargs != 0 + || current_function_stdarg != 0 || rtx_equal_function_value_matters != 0) && (register_operand (operands[0], DFmode) *************** *** 1048,1051 **** --- 1097,1102 ---- (match_operand:SF 1 "fpmove_src_operand" "r,GH,F,m,dG"))] "(current_function_args_size == 0 + && current_function_varargs == 0 + && current_function_stdarg == 0 && rtx_equal_function_value_matters == 0) && (register_operand (operands[0], SFmode) *************** *** 1079,1082 **** --- 1130,1135 ---- (match_operand:SF 1 "fpmove_src_operand" "r,GH,F,m,d"))] "(current_function_args_size != 0 + || current_function_varargs != 0 + || current_function_stdarg != 0 || rtx_equal_function_value_matters != 0) && (register_operand (operands[0], SFmode) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/dpx2.h gcc-2.7.1/config/m68k/dpx2.h *** gcc-2.7.0/config/m68k/dpx2.h Thu Jun 15 15:06:31 1995 --- gcc-2.7.1/config/m68k/dpx2.h Mon Aug 28 06:36:10 1995 *************** *** 1,5 **** /* Definitions of target machine for GNU compiler. Bull DPX/2 200 and 300 systems (m68k, SysVr3). ! Copyright (C) 1987, 1993, 1994 Free Software Foundation, Inc. Contributed by Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr). --- 1,5 ---- /* Definitions of target machine for GNU compiler. Bull DPX/2 200 and 300 systems (m68k, SysVr3). ! Copyright (C) 1987, 1993, 1994, 1995 Free Software Foundation, Inc. Contributed by Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr). *************** *** 76,80 **** */ ! /* See m68k.h. 3 means 68020 with 68881 and no bitfiled * bitfield instructions do not seem to work a clean way. */ --- 76,80 ---- */ ! /* See m68k.h. 3 means 68020 with 68881 and no bitfield * bitfield instructions do not seem to work a clean way. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/hp320.h gcc-2.7.1/config/m68k/hp320.h *** gcc-2.7.0/config/m68k/hp320.h Thu Jun 15 15:07:22 1995 --- gcc-2.7.1/config/m68k/hp320.h Wed Jul 26 08:02:54 1995 *************** *** 1,4 **** /* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version. ! Copyright (C) 1987, 1988, 1993, 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version. ! Copyright (C) 1987, 1988, 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 596,599 **** --- 596,600 ---- #endif /* not HPUX_ASM */ + /* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an operand of a function call. */ *************** *** 600,605 **** #undef LEGITIMATE_PIC_OPERAND_P #define LEGITIMATE_PIC_OPERAND_P(X) \ ! (! symbolic_operand (X, VOIDmode) \ ! || ((GET_CODE(X) == SYMBOL_REF) && SYMBOL_REF_FLAG(X))) /* hpux8 and later have C++ compatible include files, so do not --- 601,609 ---- #undef LEGITIMATE_PIC_OPERAND_P #define LEGITIMATE_PIC_OPERAND_P(X) \ ! ((! symbolic_operand (X, VOIDmode) \ ! && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \ ! && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \ ! && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \ ! || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X))) /* hpux8 and later have C++ compatible include files, so do not diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/linux-aout.h gcc-2.7.1/config/m68k/linux-aout.h *** gcc-2.7.0/config/m68k/linux-aout.h --- gcc-2.7.1/config/m68k/linux-aout.h Sat Jul 29 09:51:08 1995 *************** *** 0 **** --- 1,75 ---- + /* Definitions for Motorola m68k running Linux + Copyright (C) 1995 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 1, 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #include + #include + + /* 68020 with 68881 */ + #define TARGET_DEFAULT 7 + + #define DBX_DEBUGGING_INFO + + #define CPP_PREDEFINES \ + "-Dunix -Dmc68000 -Dmc68020 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(m68k) -Amachine(m68k)" + + #undef CPP_SPEC + #if TARGET_DEFAULT & 2 + #define CPP_SPEC \ + "%{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE}" + #else + #define CPP_SPEC \ + "%{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE}" + #endif + + #undef SUBTARGET_SWITCHES + #define SUBTARGET_SWITCHES {"ieee-fp", 0}, + + #undef ASM_SPEC + #define ASM_SPEC \ + "%{m68030} %{m68040} %{fpic:-k} %{fPIC:-k}" + + #undef LIB_SPEC + #if 1 + /* We no longer link with libc_p.a or libg.a by default. If you want + to profile or debug the Linux C library, please add -lc_p or -ggdb + to LDFLAGS at the link time, respectively. */ + #define LIB_SPEC \ + "%{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} %{!ggdb:-lc} %{ggdb:-lg}" + #else + #define LIB_SPEC \ + "%{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}" + #endif + + /* We want to pass -v to linker */ + #undef LINK_SPEC + #define LINK_SPEC "-m m68klinux %{v:-dll-verbose}" + + #define SIZE_TYPE "unsigned int" + #define PTRDIFF_TYPE "int" + + /* Generate calls to memcpy, memcmp and memset. */ + #define TARGET_MEM_FUNCTIONS + + /* Don't default to pcc-struct-return, because gcc is the only compiler. */ + #undef PCC_STATIC_STRUCT_RETURN + #define DEFAULT_PCC_STRUCT_RETURN 0 + + /* Allow folding division by zero. */ + #define REAL_INFINITY diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/linux.h gcc-2.7.1/config/m68k/linux.h *** gcc-2.7.0/config/m68k/linux.h --- gcc-2.7.1/config/m68k/linux.h Sat Jul 29 09:51:09 1995 *************** *** 0 **** --- 1,285 ---- + /* Definitions for Motorola 68k running Linux with ELF format. + Copyright (C) 1995 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 1, 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #define LINUX_DEFAULT_ELF + #define MOTOROLA /* Use Motorola syntax */ + #define USE_GAS /* But GAS wants jbsr instead of jsr */ + + #include + #include /* some common stuff */ + + #undef TARGET_VERSION + #define TARGET_VERSION fprintf (stderr, " (68k Linux/ELF)"); + + /* 68020 with 68881 */ + #define TARGET_DEFAULT 7 + + #undef SUBTARGET_SWITCHES + #define SUBTARGET_SWITCHES {"ieee-fp", 0}, + + /* Here are four prefixes that are used by asm_fprintf to + facilitate customization for alternate assembler syntaxes. + Machines with no likelihood of an alternate syntax need not + define these and need not use asm_fprintf. */ + + /* The prefix for register names. Note that REGISTER_NAMES + is supposed to include this prefix. Also note that this is NOT an + fprintf format string, it is a literal string */ + + #undef REGISTER_PREFIX + #define REGISTER_PREFIX "%" + + /* The prefix for local (compiler generated) labels. + These labels will not appear in the symbol table. */ + + #undef LOCAL_LABEL_PREFIX + #define LOCAL_LABEL_PREFIX "." + + /* The prefix to add to user-visible assembler symbols. */ + + #undef USER_LABEL_PREFIX + #define USER_LABEL_PREFIX "" + + /* How to refer to registers in assembler output. + This sequence is indexed by compiler's hard-register-number. + Motorola format uses different register names than defined in m68k.h. */ + + #undef REGISTER_NAMES + + #ifndef SUPPORT_SUN_FPA + + #define REGISTER_NAMES \ + {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \ + "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \ + "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" } + + #else /* SUPPORTED_SUN_FPA */ + + #define REGISTER_NAMES \ + {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \ + "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \ + "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7", \ + "%fpa0", "%fpa1", "%fpa2", "%fpa3", "%fpa4", "%fpa5", "%fpa6", "%fpa7", \ + "%fpa8", "%fpa9", "%fpa10","%fpa11","%fpa12","%fpa13","%fpa14","%fpa15", \ + "%fpa16","%fpa17","%fpa18","%fpa19","%fpa20","%fpa21","%fpa22","%fpa23", \ + "%fpa24","%fpa25","%fpa26","%fpa27","%fpa28","%fpa29","%fpa30","%fpa31" } + + #endif /* defined SUPPORT_SUN_FPA */ + + #undef SIZE_TYPE + #define SIZE_TYPE "unsigned int" + + #undef PTRDIFF_TYPE + #define PTRDIFF_TYPE "int" + + #undef WCHAR_TYPE + #define WCHAR_TYPE "long int" + + #undef WCHAR_TYPE_SIZE + #define WCHAR_TYPE_SIZE BITS_PER_WORD + + #undef ASM_SPEC + #define ASM_SPEC "%{m68030} %{m68040} %{fpic:-k} %{fPIC:-k}" + + #define CPP_PREDEFINES \ + "-D__ELF__ -Dunix -Dmc68000 -Dmc68020 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(m68k) -Amachine(m68k)" + + #undef CPP_SPEC + #if TARGET_DEFAULT & 2 + #define CPP_SPEC \ + "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE}" + #else + #define CPP_SPEC \ + "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE}" + #endif + + #undef LIB_SPEC + #if 1 + /* We no longer link with libc_p.a or libg.a by default. If you want + to profile or debug the Linux C library, please add -lc_p or -ggdb + to LDFLAGS at the link time, respectively. */ + #define LIB_SPEC \ + "%{!shared:%{!symbolic: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \ + %{!ggdb:-lc} %{ggdb:-lg}}}" + #else + #define LIB_SPEC \ + "%{!shared:%{!symbolic: \ + %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \ + %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}}" + #endif + + /* Provide a LINK_SPEC appropriate for Linux. Here we provide support + for the special GCC options -static and -shared, which allow us to + link things in one of these three modes by applying the appropriate + combinations of options at link-time. We like to support here for + as many of the other GNU linker options as possible. But I don't + have the time to search for those flags. I am sure how to add + support for -soname shared_object_name. H.J. + + I took out %{v:%{!V:-V}}. It is too much :-(. They can use + -Wl,-V. + + When the -shared link option is used a final link is not being + done. */ + + /* If ELF is the default format, we should not use /lib/elf. */ + + #undef LINK_SPEC + #ifndef LINUX_DEFAULT_ELF + #define LINK_SPEC "-m m68kelf %{shared} %{symbolic:-shared -Bsymbolic} \ + %{!shared:%{!symbolic: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker*:-dynamic-linker /lib/elf/ld-linux.so.1} \ + %{!rpath*:-rpath /lib/elf/}} %{static}}}" + #else + #define LINK_SPEC "-m m68kelf %{shared} %{symbolic:-shared -Bsymbolic} \ + %{!shared:%{!symbolic: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker*:-dynamic-linker /lib/ld-linux.so.1}} \ + %{static}}}" + #endif + + /* For compatibility with linux/a.out */ + + #undef PCC_BITFIELD_TYPE_MATTERS + + /* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to + keep switch tables in the text section. */ + + #define JUMP_TABLES_IN_TEXT_SECTION 1 + + /* Use the default action for outputting the case label. */ + #undef ASM_OUTPUT_CASE_LABEL + + #define ASM_RETURN_CASE_JUMP \ + return "jmp (2,%%pc,%0.w)" + + /* This is how to output an assembler line that says to advance the + location counter to a multiple of 2**LOG bytes. */ + + #undef ASM_OUTPUT_ALIGN + #define ASM_OUTPUT_ALIGN(FILE,LOG) \ + if ((LOG) > 0) \ + fprintf ((FILE), "\t%s \t%u\n", ALIGN_ASM_OP, 1 << (LOG)); + + /* Output assembler code to FILE to increment profiler label # LABELNO + for profiling a function entry. */ + + #undef FUNCTION_PROFILER + #define FUNCTION_PROFILER(FILE, LABELNO) \ + { \ + asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \ + if (flag_pic) \ + fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ + else \ + fprintf (FILE, "\tjbsr _mcount\n"); \ + } + + /* How to renumber registers for dbx and gdb. + On the Sun-3, the floating point registers have numbers + 18 to 25, not 16 to 23 as they do in the compiler. */ + + #define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) + + /* Do not break .stabs pseudos into continuations. */ + + #define DBX_CONTIN_LENGTH 0 + + /* Allow folding division by zero. */ + #define REAL_INFINITY + + /* 1 if N is a possible register number for a function value. For + m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, + pointer, or floating types, respectively. Reject fp0 if not using + a 68881 coprocessor. */ + + #undef FUNCTION_VALUE_REGNO_P + #define FUNCTION_VALUE_REGNO_P(N) \ + ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) + + /* Define this to be true when FUNCTION_VALUE_REGNO_P is true for + more than one register. */ + + #undef NEEDS_UNTYPED_CALL + #define NEEDS_UNTYPED_CALL 1 + + /* Define how to generate (in the callee) the output value of a + function and how to find (in the caller) the value returned by a + function. VALTYPE is the data type of the value (as a tree). If + the precise function being called is known, FUNC is its + FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the + result in d0, a0, or fp0 as appropriate. */ + + #undef FUNCTION_VALUE + #define FUNCTION_VALUE(VALTYPE, FUNC) \ + (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ + ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \ + : (POINTER_TYPE_P (VALTYPE) \ + ? gen_rtx (REG, TYPE_MODE (VALTYPE), 8) \ + : gen_rtx (REG, TYPE_MODE (VALTYPE), 0))) + + /* For compatibility with the large body of existing code which does + not always properly declare external functions returning pointer + types, the m68k/SVR4 convention is to copy the value returned for + pointer functions from a0 to d0 in the function epilogue, so that + callers that have neglected to properly declare the callee can + still find the correct return value. */ + + extern int current_function_returns_pointer; + #define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ + do { \ + if ((current_function_returns_pointer) && \ + ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ + asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ + } while (0); + + /* Define how to find the value returned by a library function + assuming the value has mode MODE. + For m68k/SVR4 look for integer values in d0, pointer values in d0 + (returned in both d0 and a0), and floating values in fp0. */ + + #undef LIBCALL_VALUE + #define LIBCALL_VALUE(MODE) \ + (((MODE) == SFmode || (MODE) == DFmode) && TARGET_68881 \ + ? gen_rtx (REG, (MODE), 16) \ + : gen_rtx (REG, (MODE), 0)) + + /* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is + an operand of a function call. */ + #undef LEGITIMATE_PIC_OPERAND_P + #define LEGITIMATE_PIC_OPERAND_P(X) \ + (! symbolic_operand (X, VOIDmode) \ + || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X))) + + /* Turn off function cse if we are doing PIC. We always want function + call to be done as `bsr foo@PLTPC', so it will force the assembler + to create the PLT entry for `foo'. Doing function cse will cause + the address of `foo' to be loaded into a register, which is exactly + what we want to avoid when we are doing PIC on svr4 m68k. */ + #undef SUBTARGET_OVERRIDE_OPTIONS + #define SUBTARGET_OVERRIDE_OPTIONS \ + if (flag_pic) flag_no_function_cse = 1; + + /* For m68k SVR4, structures are returned using the reentrant + technique. */ + #undef PCC_STATIC_STRUCT_RETURN + #define DEFAULT_PCC_STRUCT_RETURN 0 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/m68k.c gcc-2.7.1/config/m68k/m68k.c *** gcc-2.7.0/config/m68k/m68k.c Thu Jun 15 15:12:45 1995 --- gcc-2.7.1/config/m68k/m68k.c Thu Sep 28 14:00:17 1995 *************** *** 707,711 **** --- 707,723 ---- { rtx loperands[7]; + enum rtx_code op_code = GET_CODE (op); + /* The m68k cmp.l instruction requires operand1 to be a reg as used + below. Swap the operands and change the op if these requirements + are not fulfilled. */ + if (GET_CODE (operand2) == REG && GET_CODE (operand1) != REG) + { + rtx tmp = operand1; + + operand1 = operand2; + operand2 = tmp; + op_code = swap_condition (op_code); + } loperands[0] = operand1; if (GET_CODE (operand1) == REG) *************** *** 724,730 **** --- 736,750 ---- if (operand2 != const0_rtx) #ifdef MOTOROLA + #ifdef SGS_CMP_ORDER output_asm_insn ("cmp%.l %0,%2\n\tjbne %l4\n\tcmp%.l %1,%3", loperands); #else + output_asm_insn ("cmp%.l %2,%0\n\tjbne %l4\n\tcmp%.l %3,%1", loperands); + #endif + #else + #ifdef SGS_CMP_ORDER output_asm_insn ("cmp%.l %0,%2\n\tjne %l4\n\tcmp%.l %1,%3", loperands); + #else + output_asm_insn ("cmp%.l %2,%0\n\tjne %l4\n\tcmp%.l %3,%1", loperands); + #endif #endif else *************** *** 736,740 **** loperands[5] = dest; ! switch (GET_CODE (op)) { case EQ: --- 756,760 ---- loperands[5] = dest; ! switch (op_code) { case EQ: diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/m68k.h gcc-2.7.1/config/m68k/m68k.h *** gcc-2.7.0/config/m68k/m68k.h Thu Jun 15 15:13:04 1995 --- gcc-2.7.1/config/m68k/m68k.h Fri Oct 20 19:10:26 1995 *************** *** 680,684 **** && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \ ? (! CONST_DOUBLE_OK_FOR_LETTER_P (X, 'G') \ ! && CLASS == FP_REGS \ ? FP_REGS : NO_REGS) \ : (CLASS)) --- 680,684 ---- && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \ ? (! CONST_DOUBLE_OK_FOR_LETTER_P (X, 'G') \ ! && (CLASS == FP_REGS || CLASS == DATA_OR_FP_REGS) \ ? FP_REGS : NO_REGS) \ : (CLASS)) *************** *** 1081,1085 **** #define LEGITIMATE_PIC_OPERAND_P(X) \ ! (! symbolic_operand (X, VOIDmode)) /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx --- 1081,1090 ---- #define LEGITIMATE_PIC_OPERAND_P(X) \ ! ((! symbolic_operand (X, VOIDmode) \ ! && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \ ! && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \ ! && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), \ ! VOIDmode))) \ ! || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X))) /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/m68k.md gcc-2.7.1/config/m68k/m68k.md *** gcc-2.7.0/config/m68k/m68k.md Thu Jun 15 16:52:50 1995 --- gcc-2.7.1/config/m68k/m68k.md Tue Nov 7 10:57:30 1995 *************** *** 287,296 **** [(set (cc0) (match_operand:DI 0 "nonimmediate_operand" "d")) ! (clobber (match_dup 1))])] "" ! " ! { ! operands[1] = gen_reg_rtx (DImode); ! }") (define_insn "" --- 287,293 ---- [(set (cc0) (match_operand:DI 0 "nonimmediate_operand" "d")) ! (clobber (match_dup 1))])] "" ! "operands[1] = gen_reg_rtx (DImode);") (define_insn "" *************** *** 415,422 **** (clobber (match_dup 2))])] "" ! " ! { ! operands[2] = gen_reg_rtx (DImode); ! }") (define_insn "" --- 412,416 ---- (clobber (match_dup 2))])] "" ! "operands[2] = gen_reg_rtx (DImode);") (define_insn "" *************** *** 2056,2060 **** (plus:DI (match_operand:DI 1 "general_operand" "%0,0,0,0") (match_operand:DI 2 "general_operand" "d,<,*ao>,d"))) ! (clobber (match_scratch:SI 3 "=X,X,d,d"))] "" "* --- 2050,2054 ---- (plus:DI (match_operand:DI 1 "general_operand" "%0,0,0,0") (match_operand:DI 2 "general_operand" "d,<,*ao>,d"))) ! (clobber (match_scratch:SI 3 "=X,X,&d,&d"))] "" "* *************** *** 2643,2649 **** (define_insn "subdi3" [(set (match_operand:DI 0 "general_operand" "=d,<,d,o<>") ! (minus:DI (match_operand:DI 1 "general_operand" "%0,0,0,0") (match_operand:DI 2 "general_operand" "d,<,*ao>,d"))) ! (clobber (match_scratch:SI 3 "=X,X,d,d"))] "" "* --- 2637,2643 ---- (define_insn "subdi3" [(set (match_operand:DI 0 "general_operand" "=d,<,d,o<>") ! (minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0") (match_operand:DI 2 "general_operand" "d,<,*ao>,d"))) ! (clobber (match_scratch:SI 3 "=X,X,&d,&d"))] "" "* *************** *** 4025,4029 **** CC_STATUS_INIT; if (GET_CODE (operands[0]) == REG) ! operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) --- 4019,4023 ---- CC_STATUS_INIT; if (GET_CODE (operands[0]) == REG) ! operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) *************** *** 4391,4423 **** ;; logical shift instructions ! (define_insn "" ! [(set (cc0) ! (subreg:SI (lshiftrt:DI (match_operand:DI 0 "general_operand" "ro") ! (const_int 32)) 1)) ! (set (match_operand:SI 1 "general_operand" "=dm") ! (subreg:SI (lshiftrt:DI (match_operand:DI 2 "general_operand" "0") ! (const_int 32)) 1))] ! "" ! "* ! { ! return \"move%.l %0,%1\"; ! } ") ! ! (define_insn "" ! [(set (cc0) ! (subreg:SI (lshiftrt:DI (match_operand:DI 0 "general_operand" "ro") ! (const_int 32)) 0)) ! (set (match_operand:DI 1 "general_operand" "=do") ! (lshiftrt:DI (match_operand:DI 2 "general_operand" "0") ! (const_int 32)))] ! "" ! "* ! { ! if (GET_CODE (operands[1]) == REG) ! operands[2] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); ! else ! operands[2] = adj_offsettable_operand (operands[1], 4); ! return \"move%.l %0,%2\;clr%.l %1\"; ! } ") (define_insn "subreg1lshrdi_const32" --- 4385,4418 ---- ;; logical shift instructions ! ;; commented out because of reload problems in 950612-1.c ! ;;(define_insn "" ! ;; [(set (cc0) ! ;; (subreg:SI (lshiftrt:DI (match_operand:DI 0 "general_operand" "ro") ! ;; (const_int 32)) 1)) ! ;; (set (match_operand:SI 1 "general_operand" "=dm") ! ;; (subreg:SI (lshiftrt:DI (match_dup 0) ! ;; (const_int 32)) 1))] ! ;; "" ! ;; "* ! ;;{ ! ;; return \"move%.l %0,%1\"; ! ;;} ") ! ;; ! ;;(define_insn "" ! ;; [(set (cc0) ! ;; (subreg:SI (lshiftrt:DI (match_operand:DI 0 "general_operand" "ro") ! ;; (const_int 32)) 0)) ! ;; (set (match_operand:DI 1 "general_operand" "=do") ! ;; (lshiftrt:DI (match_dup 0) ! ;; (const_int 32)))] ! ;; "" ! ;; "* ! ;;{ ! ;; if (GET_CODE (operands[1]) == REG) ! ;; operands[2] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); ! ;; else ! ;; operands[2] = adj_offsettable_operand (operands[1], 4); ! ;; return \"move%.l %0,%2\;clr%.l %1\"; ! ;;} ") (define_insn "subreg1lshrdi_const32" *************** *** 5657,5661 **** [(set (pc) (if_then_else ! (ne (match_operand:HI 0 "general_operand" "+g") (const_int 0)) (label_ref (match_operand 1 "" "")) --- 5652,5656 ---- [(set (pc) (if_then_else ! (ne (match_operand:HI 0 "general_operand" "+d*g") (const_int 0)) (label_ref (match_operand 1 "" "")) *************** *** 5700,5704 **** [(set (pc) (if_then_else ! (ne (match_operand:SI 0 "general_operand" "+g") (const_int 0)) (label_ref (match_operand 1 "" "")) --- 5695,5699 ---- [(set (pc) (if_then_else ! (ne (match_operand:SI 0 "general_operand" "+d*g") (const_int 0)) (label_ref (match_operand 1 "" "")) *************** *** 5834,5837 **** --- 5829,5836 ---- + ;; For PIC calls, in order to be able to support + ;; dynamic linker LAZY BINDING, all the procedure calls need to go + ;; through the PLT (Procedure Linkage Table) section in PIC mode. + ;; ;; PIC calls are handled by loading the address of the function into a ;; register (via movsi), then emitting a register indirect call using *************** *** 5838,5854 **** ;; the "jsr" function call syntax. ;; ! ;; It is important to note that the "jsr" syntax is always used for ! ;; PIC calls, even on machines in which GCC normally uses the "jbsr" ! ;; syntax for non-PIC calls. This keeps at least 1 assembler (Sun) ! ;; from emitting incorrect code for a PIC call. ;; ;; We have different patterns for PIC calls and non-PIC calls. The ! ;; different patterns are only used to choose the right syntax ! ;; ("jsr" vs "jbsr"). ;; ! ;; On svr4 m68k, PIC stuff is done differently. To be able to support ! ;; dynamic linker LAZY BINDING, all the procedure calls need to go ! ;; through the PLT (Procedure Linkage Table) section in PIC mode. The ! ;; svr4 m68k assembler recognizes this syntax: `bsr FUNC@PLTPC' and it ;; will create the correct relocation entry (R_68K_PLT32) for `FUNC', ;; that tells the linker editor to create an entry for `FUNC' in PLT --- 5837,5848 ---- ;; the "jsr" function call syntax. ;; ! ;; When outputting MIT syntax (e.g. on Suns), we add a bogus extra ! ;; operand to the jbsr statement to indicate that this call should ! ;; go through the PLT (why? because this is the way that Sun does it). ;; ;; We have different patterns for PIC calls and non-PIC calls. The ! ;; different patterns are only used to choose the right syntax. ;; ! ;; The svr4 m68k assembler recognizes this syntax: `bsr FUNC@PLTPC' and it ;; will create the correct relocation entry (R_68K_PLT32) for `FUNC', ;; that tells the linker editor to create an entry for `FUNC' in PLT *************** *** 5882,5891 **** { if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) - #ifdef MOTOROLA SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1; - #else - operands[0] = gen_rtx (MEM, GET_MODE (operands[0]), - force_reg (Pmode, XEXP (operands[0], 0))); - #endif }") --- 5876,5880 ---- *************** *** 5898,5902 **** "! flag_pic" "* ! #ifdef MOTOROLA #ifdef MOTOROLA_BSR if (GET_CODE (operands[0]) == MEM --- 5887,5891 ---- "! flag_pic" "* ! #if defined (MOTOROLA) && !defined (USE_GAS) #ifdef MOTOROLA_BSR if (GET_CODE (operands[0]) == MEM *************** *** 5918,5930 **** "flag_pic" "* - #ifdef MOTOROLA if (GET_CODE (operands[0]) == MEM && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) #ifdef HPUX_ASM return \"bsr.l %0\"; #else return \"bsr %0@PLTPC\"; #endif #endif return \"jsr %0\"; ") --- 5907,5927 ---- "flag_pic" "* if (GET_CODE (operands[0]) == MEM && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) + #ifdef MOTOROLA #ifdef HPUX_ASM return \"bsr.l %0\"; #else + #ifdef USE_GAS + return \"bsr.l %0@PLTPC\"; + #else return \"bsr %0@PLTPC\"; #endif #endif + #else + /* The ',a1' is a dummy argument telling the Sun assembler we want PIC, + GAS just plain ignores it. */ + return \"jbsr %0,a1\"; + #endif return \"jsr %0\"; ") *************** *** 5942,5951 **** { if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) - #ifdef MOTOROLA SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1; - #else - operands[1] = gen_rtx (MEM, GET_MODE (operands[1]), - force_reg (Pmode, XEXP (operands[1], 0))); - #endif }") --- 5939,5943 ---- *************** *** 5958,5962 **** "! flag_pic" "* ! #ifdef MOTOROLA #ifdef MOTOROLA_BSR if (GET_CODE (operands[1]) == MEM --- 5950,5954 ---- "! flag_pic" "* ! #if defined (MOTOROLA) && !defined (USE_GAS) #ifdef MOTOROLA_BSR if (GET_CODE (operands[1]) == MEM *************** *** 5978,5990 **** "flag_pic" "* - #ifdef MOTOROLA if (GET_CODE (operands[1]) == MEM && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) #ifdef HPUX_ASM return \"bsr.l %1\"; #else return \"bsr %1@PLTPC\"; #endif #endif return \"jsr %1\"; ") --- 5970,5990 ---- "flag_pic" "* if (GET_CODE (operands[1]) == MEM && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) + #ifdef MOTOROLA #ifdef HPUX_ASM return \"bsr.l %1\"; #else + #ifdef USE_GAS + return \"bsr.l %1@PLTPC\"; + #else return \"bsr %1@PLTPC\"; #endif #endif + #else + /* The ',a1' is a dummy argument telling the Sun assembler we want PIC + GAS just plain ignores it. */ + return \"jbsr %1,a1\"; + #endif return \"jsr %1\"; ") *************** *** 6455,6476 **** }") ! ! (define_expand "cmpxf" ! [(set (cc0) ! (compare (match_operand:XF 0 "general_operand" "f,mG") ! (match_operand:XF 1 "general_operand" "fmG,f")))] ! "TARGET_68881" ! " ! { ! if (CONSTANT_P (operands[0])) ! operands[0] = force_const_mem (XFmode, operands[0]); ! if (CONSTANT_P (operands[1])) ! operands[1] = force_const_mem (XFmode, operands[1]); ! }") ! ! (define_insn "" [(set (cc0) ! (compare (match_operand:XF 0 "nonimmediate_operand" "f,mG") ! (match_operand:XF 1 "nonimmediate_operand" "fmG,f")))] "TARGET_68881" "* --- 6455,6462 ---- }") ! (define_insn "cmpxf" [(set (cc0) ! (compare (match_operand:XF 0 "nonimmediate_operand" "f,m") ! (match_operand:XF 1 "nonimmediate_operand" "fm,f")))] "TARGET_68881" "* *************** *** 6618,6638 **** "fmove%.l %1,%0") - (define_expand "addxf3" - [(set (match_operand:XF 0 "general_operand" "") - (plus:XF (match_operand:XF 1 "general_operand" "") - (match_operand:XF 2 "general_operand" "")))] - "TARGET_68881" - " - { - if (CONSTANT_P (operands[1])) - operands[1] = force_const_mem (XFmode, operands[1]); - if (CONSTANT_P (operands[2])) - operands[2] = force_const_mem (XFmode, operands[2]); - }") - (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") (plus:XF (float:XF (match_operand:SI 2 "general_operand" "dmi")) ! (match_operand:XF 1 "general_operand" "0")))] "TARGET_68881" "fadd%.l %2,%0") --- 6604,6611 ---- "fmove%.l %1,%0") (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") (plus:XF (float:XF (match_operand:SI 2 "general_operand" "dmi")) ! (match_operand:XF 1 "nonimmediate_operand" "0")))] "TARGET_68881" "fadd%.l %2,%0") *************** *** 6641,6645 **** [(set (match_operand:XF 0 "general_operand" "=f") (plus:XF (float:XF (match_operand:HI 2 "general_operand" "dmn")) ! (match_operand:XF 1 "general_operand" "0")))] "TARGET_68881" "fadd%.w %2,%0") --- 6614,6618 ---- [(set (match_operand:XF 0 "general_operand" "=f") (plus:XF (float:XF (match_operand:HI 2 "general_operand" "dmn")) ! (match_operand:XF 1 "nonimmediate_operand" "0")))] "TARGET_68881" "fadd%.w %2,%0") *************** *** 6652,6659 **** "fadd%.b %2,%0") ! (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") (plus:XF (match_operand:XF 1 "nonimmediate_operand" "%0") ! (match_operand:XF 2 "nonimmediate_operand" "fmG")))] "TARGET_68881" "* --- 6625,6632 ---- "fadd%.b %2,%0") ! (define_insn "addxf3" [(set (match_operand:XF 0 "general_operand" "=f") (plus:XF (match_operand:XF 1 "nonimmediate_operand" "%0") ! (match_operand:XF 2 "nonimmediate_operand" "fm")))] "TARGET_68881" "* *************** *** 6664,6683 **** }") - (define_expand "subxf3" - [(set (match_operand:XF 0 "general_operand" "") - (minus:XF (match_operand:XF 1 "general_operand" "") - (match_operand:XF 2 "general_operand" "")))] - "TARGET_68881" - " - { - if (CONSTANT_P (operands[1])) - operands[1] = force_const_mem (XFmode, operands[1]); - if (CONSTANT_P (operands[2])) - operands[2] = force_const_mem (XFmode, operands[2]); - }") - (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (minus:XF (match_operand:XF 1 "general_operand" "0") (float:XF (match_operand:SI 2 "general_operand" "dmi"))))] "TARGET_68881" --- 6637,6643 ---- }") (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (minus:XF (match_operand:XF 1 "nonimmediate_operand" "0") (float:XF (match_operand:SI 2 "general_operand" "dmi"))))] "TARGET_68881" *************** *** 6686,6690 **** (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (minus:XF (match_operand:XF 1 "general_operand" "0") (float:XF (match_operand:HI 2 "general_operand" "dmn"))))] "TARGET_68881" --- 6646,6650 ---- (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (minus:XF (match_operand:XF 1 "nonimmediate_operand" "0") (float:XF (match_operand:HI 2 "general_operand" "dmn"))))] "TARGET_68881" *************** *** 6693,6697 **** (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (minus:XF (match_operand:XF 1 "general_operand" "0") (float:XF (match_operand:QI 2 "general_operand" "dmn"))))] "TARGET_68881" --- 6653,6657 ---- (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (minus:XF (match_operand:XF 1 "nonimmediate_operand" "0") (float:XF (match_operand:QI 2 "general_operand" "dmn"))))] "TARGET_68881" *************** *** 6698,6705 **** "fsub%.b %2,%0") ! (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") (minus:XF (match_operand:XF 1 "nonimmediate_operand" "0") ! (match_operand:XF 2 "nonimmediate_operand" "fmG")))] "TARGET_68881" "* --- 6658,6665 ---- "fsub%.b %2,%0") ! (define_insn "subxf3" [(set (match_operand:XF 0 "general_operand" "=f") (minus:XF (match_operand:XF 1 "nonimmediate_operand" "0") ! (match_operand:XF 2 "nonimmediate_operand" "fm")))] "TARGET_68881" "* *************** *** 6710,6730 **** }") - (define_expand "mulxf3" - [(set (match_operand:XF 0 "general_operand" "") - (mult:XF (match_operand:XF 1 "general_operand" "") - (match_operand:XF 2 "general_operand" "")))] - "TARGET_68881" - " - { - if (CONSTANT_P (operands[1])) - operands[1] = force_const_mem (XFmode, operands[1]); - if (CONSTANT_P (operands[2])) - operands[2] = force_const_mem (XFmode, operands[2]); - }") - (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") (mult:XF (float:XF (match_operand:SI 2 "general_operand" "dmi")) ! (match_operand:XF 1 "general_operand" "0")))] "TARGET_68881" "fmul%.l %2,%0") --- 6670,6677 ---- }") (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") (mult:XF (float:XF (match_operand:SI 2 "general_operand" "dmi")) ! (match_operand:XF 1 "nonimmediate_operand" "0")))] "TARGET_68881" "fmul%.l %2,%0") *************** *** 6733,6737 **** [(set (match_operand:XF 0 "general_operand" "=f") (mult:XF (float:XF (match_operand:HI 2 "general_operand" "dmn")) ! (match_operand:XF 1 "general_operand" "0")))] "TARGET_68881" "fmul%.w %2,%0") --- 6680,6684 ---- [(set (match_operand:XF 0 "general_operand" "=f") (mult:XF (float:XF (match_operand:HI 2 "general_operand" "dmn")) ! (match_operand:XF 1 "nonimmediate_operand" "0")))] "TARGET_68881" "fmul%.w %2,%0") *************** *** 6740,6751 **** [(set (match_operand:XF 0 "general_operand" "=f") (mult:XF (float:XF (match_operand:QI 2 "general_operand" "dmn")) ! (match_operand:XF 1 "general_operand" "0")))] "TARGET_68881" "fmul%.b %2,%0") ! (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") (mult:XF (match_operand:XF 1 "nonimmediate_operand" "%0") ! (match_operand:XF 2 "nonimmediate_operand" "fmG")))] "TARGET_68881" "* --- 6687,6698 ---- [(set (match_operand:XF 0 "general_operand" "=f") (mult:XF (float:XF (match_operand:QI 2 "general_operand" "dmn")) ! (match_operand:XF 1 "nonimmediate_operand" "0")))] "TARGET_68881" "fmul%.b %2,%0") ! (define_insn "mulxf3" [(set (match_operand:XF 0 "general_operand" "=f") (mult:XF (match_operand:XF 1 "nonimmediate_operand" "%0") ! (match_operand:XF 2 "nonimmediate_operand" "fm")))] "TARGET_68881" "* *************** *** 6756,6775 **** }") - (define_expand "divxf3" - [(set (match_operand:XF 0 "general_operand" "") - (div:XF (match_operand:XF 1 "general_operand" "") - (match_operand:XF 2 "general_operand" "")))] - "TARGET_68881" - " - { - if (CONSTANT_P (operands[1])) - operands[1] = force_const_mem (XFmode, operands[1]); - if (CONSTANT_P (operands[2])) - operands[2] = force_const_mem (XFmode, operands[2]); - }") - (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (div:XF (match_operand:XF 1 "general_operand" "0") (float:XF (match_operand:SI 2 "general_operand" "dmi"))))] "TARGET_68881" --- 6703,6709 ---- }") (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (div:XF (match_operand:XF 1 "nonimmediate_operand" "0") (float:XF (match_operand:SI 2 "general_operand" "dmi"))))] "TARGET_68881" *************** *** 6778,6782 **** (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (div:XF (match_operand:XF 1 "general_operand" "0") (float:XF (match_operand:HI 2 "general_operand" "dmn"))))] "TARGET_68881" --- 6712,6716 ---- (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (div:XF (match_operand:XF 1 "nonimmediate_operand" "0") (float:XF (match_operand:HI 2 "general_operand" "dmn"))))] "TARGET_68881" *************** *** 6785,6789 **** (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (div:XF (match_operand:XF 1 "general_operand" "0") (float:XF (match_operand:QI 2 "general_operand" "dmn"))))] "TARGET_68881" --- 6719,6723 ---- (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") ! (div:XF (match_operand:XF 1 "nonimmediate_operand" "0") (float:XF (match_operand:QI 2 "general_operand" "dmn"))))] "TARGET_68881" *************** *** 6790,6797 **** "fdiv%.b %2,%0") ! (define_insn "" [(set (match_operand:XF 0 "general_operand" "=f") (div:XF (match_operand:XF 1 "nonimmediate_operand" "0") ! (match_operand:XF 2 "nonimmediate_operand" "fmG")))] "TARGET_68881" "* --- 6724,6731 ---- "fdiv%.b %2,%0") ! (define_insn "divxf3" [(set (match_operand:XF 0 "general_operand" "=f") (div:XF (match_operand:XF 1 "nonimmediate_operand" "0") ! (match_operand:XF 2 "nonimmediate_operand" "fm")))] "TARGET_68881" "* *************** *** 6804,6808 **** (define_expand "negxf2" [(set (match_operand:XF 0 "general_operand" "") ! (neg:XF (match_operand:XF 1 "general_operand" "")))] "" " --- 6738,6742 ---- (define_expand "negxf2" [(set (match_operand:XF 0 "general_operand" "") ! (neg:XF (match_operand:XF 1 "nonimmediate_operand" "")))] "" " *************** *** 6810,6814 **** /* ??? There isn't an FPA define_insn so we could handle it here too. For now we don't (paranoia). */ ! if (!TARGET_FPA && !TARGET_68881) { rtx result; --- 6744,6748 ---- /* ??? There isn't an FPA define_insn so we could handle it here too. For now we don't (paranoia). */ ! if (!TARGET_68881) { rtx result; *************** *** 6842,6846 **** (define_insn "negxf2_68881" [(set (match_operand:XF 0 "general_operand" "=f") ! (neg:XF (match_operand:XF 1 "nonimmediate_operand" "fmF")))] "TARGET_68881" "* --- 6776,6780 ---- (define_insn "negxf2_68881" [(set (match_operand:XF 0 "general_operand" "=f") ! (neg:XF (match_operand:XF 1 "nonimmediate_operand" "fm")))] "TARGET_68881" "* *************** *** 6853,6857 **** (define_expand "absxf2" [(set (match_operand:XF 0 "general_operand" "") ! (abs:XF (match_operand:XF 1 "general_operand" "")))] "" " --- 6787,6791 ---- (define_expand "absxf2" [(set (match_operand:XF 0 "general_operand" "") ! (abs:XF (match_operand:XF 1 "nonimmediate_operand" "")))] "" " *************** *** 6859,6863 **** /* ??? There isn't an FPA define_insn so we could handle it here too. For now we don't (paranoia). */ ! if (!TARGET_FPA && !TARGET_68881) { rtx result; --- 6793,6797 ---- /* ??? There isn't an FPA define_insn so we could handle it here too. For now we don't (paranoia). */ ! if (!TARGET_68881) { rtx result; *************** *** 6891,6895 **** (define_insn "absxf2_68881" [(set (match_operand:XF 0 "general_operand" "=f") ! (abs:XF (match_operand:XF 1 "nonimmediate_operand" "fmF")))] "TARGET_68881" "* --- 6825,6829 ---- (define_insn "absxf2_68881" [(set (match_operand:XF 0 "general_operand" "=f") ! (abs:XF (match_operand:XF 1 "nonimmediate_operand" "fm")))] "TARGET_68881" "* *************** *** 6904,6911 **** (sqrt:XF (match_operand:XF 1 "nonimmediate_operand" "fm")))] "TARGET_68881" ! "* ! { ! return \"fsqrt%.x %1,%0\"; ! }") (define_insn "sinsf2" --- 6838,6842 ---- (sqrt:XF (match_operand:XF 1 "nonimmediate_operand" "fm")))] "TARGET_68881" ! "fsqrt%.x %1,%0") (define_insn "sinsf2" *************** *** 6937,6944 **** (unspec:XF [(match_operand:XF 1 "nonimmediate_operand" "fm")] 1))] "TARGET_68881 && flag_fast_math" ! "* ! { ! return \"fsin%.x %1,%0\"; ! }") (define_insn "cossf2" --- 6868,6872 ---- (unspec:XF [(match_operand:XF 1 "nonimmediate_operand" "fm")] 1))] "TARGET_68881 && flag_fast_math" ! "fsin%.x %1,%0") (define_insn "cossf2" *************** *** 6970,6975 **** (unspec:XF [(match_operand:XF 1 "nonimmediate_operand" "fm")] 2))] "TARGET_68881 && flag_fast_math" ! "* ! { ! return \"fcos%.x %1,%0\"; ! }") --- 6898,6900 ---- (unspec:XF [(match_operand:XF 1 "nonimmediate_operand" "fm")] 2))] "TARGET_68881 && flag_fast_math" ! "fcos%.x %1,%0") diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/m68kemb.h gcc-2.7.1/config/m68k/m68kemb.h *** gcc-2.7.0/config/m68k/m68kemb.h Thu Nov 17 14:57:34 1994 --- gcc-2.7.1/config/m68k/m68kemb.h Mon Aug 14 09:15:33 1995 *************** *** 1,5 **** /* Definitions of target machine for GNU compiler. "embedded" 68XXX. This is meant to be included after m68k.h. ! Copyright (C) 1994 Free Software Foundation, Inc. */ #define PTRDIFF_TYPE "long int" --- 1,5 ---- /* Definitions of target machine for GNU compiler. "embedded" 68XXX. This is meant to be included after m68k.h. ! Copyright (C) 1994, 1995 Free Software Foundation, Inc. */ #define PTRDIFF_TYPE "long int" *************** *** 38,39 **** --- 38,43 ---- #undef NEEDS_UNTYPED_CALL #define NEEDS_UNTYPED_CALL 1 + + /* crt0.o should be specified in the linker script. */ + #undef STARTFILE_SPEC + #define STARTFILE_SPEC "" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/m68kv4.h gcc-2.7.1/config/m68k/m68kv4.h *** gcc-2.7.0/config/m68k/m68kv4.h Thu Jun 15 15:13:18 1995 --- gcc-2.7.1/config/m68k/m68kv4.h Mon Aug 28 06:18:07 1995 *************** *** 1,4 **** /* Target definitions for GNU compiler for mc680x0 running System V.4 ! Copyright (C) 1991, 1993, 1994 Free Software Foundation, Inc. Written by Ron Guilmette (rfg@netcom.com) and Fred Fish (fnf@cygnus.com). --- 1,4 ---- /* Target definitions for GNU compiler for mc680x0 running System V.4 ! Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc. Written by Ron Guilmette (rfg@netcom.com) and Fred Fish (fnf@cygnus.com). *************** *** 210,214 **** #define BIGGEST_ALIGNMENT 64 ! /* SVR4 m68k assembler is bitching on the `comm i,1,1' which askes for 1 byte alignment. Don't generate alignment for COMMON seems to be safer until we the assembler is fixed. */ --- 210,214 ---- #define BIGGEST_ALIGNMENT 64 ! /* SVR4 m68k assembler is bitching on the `comm i,1,1' which asks for 1 byte alignment. Don't generate alignment for COMMON seems to be safer until we the assembler is fixed. */ *************** *** 285,290 **** #undef LEGITIMATE_PIC_OPERAND_P #define LEGITIMATE_PIC_OPERAND_P(X) \ ! (! symbolic_operand (X, VOIDmode) \ ! || ((GET_CODE(X) == SYMBOL_REF) && SYMBOL_REF_FLAG(X))) /* Turn off function cse if we are doing PIC. We always want function call --- 285,293 ---- #undef LEGITIMATE_PIC_OPERAND_P #define LEGITIMATE_PIC_OPERAND_P(X) \ ! ((! symbolic_operand (X, VOIDmode) \ ! && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \ ! && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \ ! && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \ ! || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X))) /* Turn off function cse if we are doing PIC. We always want function call diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/netbsd.h gcc-2.7.1/config/m68k/netbsd.h *** gcc-2.7.0/config/m68k/netbsd.h Tue May 9 18:18:42 1995 --- gcc-2.7.1/config/m68k/netbsd.h Thu Sep 28 14:00:52 1995 *************** *** 29,38 **** #undef WCHAR_TYPE ! #define WCHAR_TYPE "short unsigned int" ! #define WCHAR_UNSIGNED 1 #undef WCHAR_TYPE_SIZE ! #define WCHAR_TYPE_SIZE 16 /* Every structure or union's size must be a multiple of 2 bytes. */ --- 29,39 ---- #undef WCHAR_TYPE ! #define WCHAR_TYPE "int" ! #undef WCHAR_UNSIGNED ! #define WCHAR_UNSIGNED 0 #undef WCHAR_TYPE_SIZE ! #define WCHAR_TYPE_SIZE 32 /* Every structure or union's size must be a multiple of 2 bytes. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/t-linux gcc-2.7.1/config/m68k/t-linux *** gcc-2.7.0/config/m68k/t-linux --- gcc-2.7.1/config/m68k/t-linux Sat Jul 29 09:51:28 1995 *************** *** 0 **** --- 1,5 ---- + # Don't make libgcc1.a + LIBGCC1 = + CROSS_LIBGCC1 = + # On Linux we can print long double + ENQUIRE_CFLAGS = -DNO_MEM -O0 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/xm-atari.h gcc-2.7.1/config/m68k/xm-atari.h *** gcc-2.7.0/config/m68k/xm-atari.h Thu Jun 15 15:16:41 1995 --- gcc-2.7.1/config/m68k/xm-atari.h Thu Jun 22 18:31:50 1995 *************** *** 1,5 **** /* Definitions of host machine for GNU compiler. Atari TT ASV version. ! Copyright (C) 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,5 ---- /* Definitions of host machine for GNU compiler. Atari TT ASV version. ! Copyright (C) 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 24,30 **** #define HAVE_VPRINTF /* Host has vprintf() in library */ ! /* ASV does not define HZ, so we have to do it ourselves. */ ! #define HZ 128 /* System clock */ /* Define FULL_PROTOTYPES for protoize.c, to get included. --- 24,32 ---- #define HAVE_VPRINTF /* Host has vprintf() in library */ ! /* Add HZ define if missing */ ! #ifndef HZ ! #define HZ 100 /* System clock */ ! #endif /* Define FULL_PROTOTYPES for protoize.c, to get included. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m68k/xm-linux.h gcc-2.7.1/config/m68k/xm-linux.h *** gcc-2.7.0/config/m68k/xm-linux.h --- gcc-2.7.1/config/m68k/xm-linux.h Sat Jul 29 09:51:29 1995 *************** *** 0 **** --- 1,4 ---- + /* Configuration for GCC for Motorola m68k running Linux. */ + + #include + #include diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m88k/dgux.h gcc-2.7.1/config/m88k/dgux.h *** gcc-2.7.0/config/m88k/dgux.h Thu Jun 15 15:18:01 1995 --- gcc-2.7.1/config/m88k/dgux.h Mon Oct 2 16:45:20 1995 *************** *** 31,35 **** #ifndef VERSION_INFO2 ! #define VERSION_INFO2 "$Revision: 1.18 $" #endif #ifndef NO_BUGS --- 31,35 ---- #ifndef VERSION_INFO2 ! #define VERSION_INFO2 "$Revision: 1.20 $" #endif #ifndef NO_BUGS *************** *** 44,52 **** /* Augment TARGET_SWITCHES with the MXDB options. */ #define MASK_STANDARD 0x40000000 /* Retain standard information */ ! #define MASK_LEGEND 0x20000000 /* Retain legend information */ #define MASK_EXTERNAL_LEGEND 0x10000000 /* Make external legends */ #define TARGET_STANDARD (target_flags & MASK_STANDARD) ! #define TARGET_LEGEND (target_flags & MASK_LEGEND) #define TARGET_EXTERNAL_LEGEND (target_flags & MASK_EXTERNAL_LEGEND) --- 44,52 ---- /* Augment TARGET_SWITCHES with the MXDB options. */ #define MASK_STANDARD 0x40000000 /* Retain standard information */ ! #define MASK_NOLEGEND 0x20000000 /* Discard legend information */ #define MASK_EXTERNAL_LEGEND 0x10000000 /* Make external legends */ #define TARGET_STANDARD (target_flags & MASK_STANDARD) ! #define TARGET_NOLEGEND (target_flags & MASK_NOLEGEND) #define TARGET_EXTERNAL_LEGEND (target_flags & MASK_EXTERNAL_LEGEND) *************** *** 54,58 **** #define SUBTARGET_SWITCHES \ { "standard", MASK_STANDARD }, \ ! { "legend", MASK_LEGEND }, \ { "external-legend", MASK_EXTERNAL_LEGEND }, \ /* the following is used only in the *_SPEC's */ \ --- 54,59 ---- #define SUBTARGET_SWITCHES \ { "standard", MASK_STANDARD }, \ ! { "legend", -MASK_NOLEGEND }, \ ! { "no-legend", MASK_NOLEGEND }, \ { "external-legend", MASK_EXTERNAL_LEGEND }, \ /* the following is used only in the *_SPEC's */ \ *************** *** 93,98 **** %{V} %{v:%{!V:-V}} %{pipe:%{!.s: - }\ %{!msvr3:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}\ ! %{!mlegend:%{mstandard:-Wc,off}}\ ! %{mlegend:-Wc,-fix-bb,-h\"gcc-" VERSION_INFO2 "\",-s\"%i\"\ %{traditional:,-lc}%{!traditional:,-lansi-c}\ %{mstandard:,-keep-std}\ --- 94,100 ---- %{V} %{v:%{!V:-V}} %{pipe:%{!.s: - }\ %{!msvr3:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}\ ! %{g:\ ! %{mno-legend:-Wc,off}\ ! %{!mno-legend:-Wc,-fix-bb,-s\"%i\"\ %{traditional:,-lc}%{!traditional:,-lansi-c}\ %{mstandard:,-keep-std}\ *************** *** 99,103 **** %{mkeep-coff:,-keep-coff}\ %{mexternal-legend:,-external}\ ! %{mocs-frame-position:,-ocs}}" /* Override svr4.h. */ --- 101,105 ---- %{mkeep-coff:,-keep-coff}\ %{mexternal-legend:,-external}\ ! %{mocs-frame-position:,-ocs}}}" /* Override svr4.h. */ *************** *** 121,126 **** #define LINK_SPEC "%{z*} %{h*} %{V} %{v:%{!V:-V}} \ %{static:-dn -Bstatic} \ ! %{shared:-G -dy -z text} \ ! %{symbolic:-Bsymbolic -G -dy -z text} \ %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}" #undef STARTFILE_SPEC --- 123,128 ---- #define LINK_SPEC "%{z*} %{h*} %{V} %{v:%{!V:-V}} \ %{static:-dn -Bstatic} \ ! %{shared:-G -dy} \ ! %{symbolic:-Bsymbolic -G -dy} \ %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}" #undef STARTFILE_SPEC *************** *** 154,159 **** fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "03.00"); \ } \ ! if (write_symbols != NO_DEBUG \ ! && ! (TARGET_STANDARD && ! TARGET_LEGEND)) \ { \ fprintf (FILE, ";legend_info -fix-bb -h\"gcc-%s\" -s\"%s\"", \ --- 156,160 ---- fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "03.00"); \ } \ ! if (write_symbols != NO_DEBUG && !TARGET_NOLEGEND) \ { \ fprintf (FILE, ";legend_info -fix-bb -h\"gcc-%s\" -s\"%s\"", \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m88k/dguxbcs.h gcc-2.7.1/config/m88k/dguxbcs.h *** gcc-2.7.0/config/m88k/dguxbcs.h Thu Jun 15 15:18:32 1995 --- gcc-2.7.1/config/m88k/dguxbcs.h Wed Jun 28 17:59:46 1995 *************** *** 41,45 **** %{msvr4:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}\ %{!mlegend:%{mstandard:-Wc,off}}\ ! %{mlegend:-Wc,-fix-bb,-h\"gcc-" VERSION_INFO2 "\",-s\"%i\"\ %{traditional:,-lc}%{!traditional:,-lansi-c}\ %{mstandard:,-keep-std}\ --- 41,45 ---- %{msvr4:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}\ %{!mlegend:%{mstandard:-Wc,off}}\ ! %{mlegend:-Wc,-fix-bb,-s\"%i\"\ %{traditional:,-lc}%{!traditional:,-lansi-c}\ %{mstandard:,-keep-std}\ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/m88k/m88k.md gcc-2.7.1/config/m88k/m88k.md *** gcc-2.7.0/config/m88k/m88k.md Thu Jun 15 16:53:25 1995 --- gcc-2.7.1/config/m88k/m88k.md Thu Oct 26 19:05:14 1995 *************** *** 2718,2722 **** ;;- multiply instructions ;; ! ;; There is an unfounded silicon eratta for E.1 requiring that an ;; immediate constant value in div/divu/mul instructions be less than ;; 0x800. This is no longer provided for. --- 2718,2722 ---- ;;- multiply instructions ;; ! ;; There is an unfounded silicon errata for E.1 requiring that an ;; immediate constant value in div/divu/mul instructions be less than ;; 0x800. This is no longer provided for. *************** *** 2813,2819 **** ;; used, the O/S must complete the operation if the operands are ;; negative. The O/S will signal an overflow condition if the most ! ;; negative number (-214783648) is divided by negative 1. ;; ! ;; There is an unfounded silicon eratta for E.1 requiring that an ;; immediate constant value in div/divu/mul instructions be less than ;; 0x800. This is no longer provided for. --- 2813,2819 ---- ;; used, the O/S must complete the operation if the operands are ;; negative. The O/S will signal an overflow condition if the most ! ;; negative number (-2147483648) is divided by negative 1. ;; ! ;; There is an unfounded silicon errata for E.1 requiring that an ;; immediate constant value in div/divu/mul instructions be less than ;; 0x800. This is no longer provided for. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/abi64.h gcc-2.7.1/config/mips/abi64.h *** gcc-2.7.0/config/mips/abi64.h Thu Jun 15 15:24:49 1995 --- gcc-2.7.1/config/mips/abi64.h Sun Nov 5 10:40:36 1995 *************** *** 1,4 **** /* Definitions of target machine for GNU compiler. 64 bit ABI support. ! Copyright (C) 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions of target machine for GNU compiler. 64 bit ABI support. ! Copyright (C) 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 67,72 **** %{mips2: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ %{!mips1:%{!mips2: -D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}} \ ! %{mips3:-U__mips -D__mips=3} \ ! %{!mips1:%{!mips2:-U__mips -D__mips=4}}" #undef EMPTY_FIELD_BOUNDARY --- 67,75 ---- %{mips2: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ %{!mips1:%{!mips2: -D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}} \ ! %{mips3:-U__mips -D__mips=3 -D__mips64} \ ! %{!mips1:%{!mips2:-U__mips -D__mips=4 -D__mips64}} \ ! %{mgp32:-U__mips64} %{mgp64:-D__mips64} \ ! %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ ! %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" #undef EMPTY_FIELD_BOUNDARY *************** *** 132,136 **** is a real argument. */ #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \ ! { if (mips_isa >= 3 && (CUM).arg_words < MAX_ARGS_IN_REGISTERS - 1) \ { \ PRETEND_SIZE \ --- 135,141 ---- is a real argument. */ #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \ ! { if (mips_isa >= 3 \ ! && ((CUM).arg_words \ ! < (MAX_ARGS_IN_REGISTERS - ! current_function_varargs))) \ { \ PRETEND_SIZE \ *************** *** 140,146 **** if (! (NO_RTL)) \ { \ ! rtx mem = gen_rtx (MEM, BLKmode, \ ! plus_constant (virtual_incoming_args_rtx, \ ! - PRETEND_SIZE)); \ /* va_arg is an array access in this case, which causes it to \ get MEM_IN_STRUCT_P set. We must set it here so that the \ --- 145,149 ---- if (! (NO_RTL)) \ { \ ! rtx mem = gen_rtx (MEM, BLKmode, virtual_incoming_args_rtx); \ /* va_arg is an array access in this case, which causes it to \ get MEM_IN_STRUCT_P set. We must set it here so that the \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/dec-bsd.h gcc-2.7.1/config/mips/dec-bsd.h *** gcc-2.7.0/config/mips/dec-bsd.h Thu Jun 15 15:27:39 1995 --- gcc-2.7.1/config/mips/dec-bsd.h Fri Jul 28 08:53:48 1995 *************** *** 1,4 **** /* Definitions for DECstation running BSD as target machine for GNU compiler. ! Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions for DECstation running BSD as target machine for GNU compiler. ! Copyright (C) 1993, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 52,56 **** %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3} \ %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" --- 52,57 ---- %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3 -D__mips64} \ ! %{mgp32:-U__mips64} %{mgp64:-D__mips64} \ %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/elf64.h gcc-2.7.1/config/mips/elf64.h *** gcc-2.7.0/config/mips/elf64.h Thu Jun 15 15:29:29 1995 --- gcc-2.7.1/config/mips/elf64.h Sun Nov 5 10:43:57 1995 *************** *** 1,5 **** /* Definitions of target machine for GNU compiler. MIPS R4000 version with GOFAST floating point library. ! Copyright (C) 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,5 ---- /* Definitions of target machine for GNU compiler. MIPS R4000 version with GOFAST floating point library. ! Copyright (C) 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 26,29 **** --- 26,35 ---- #define MIPS_ISA_DEFAULT 3 + #ifndef TARGET_ENDIAN_DEFAULT + #define MULTILIB_DEFAULTS { "EB", "mips3" } + #else + #define MULTILIB_DEFAULTS { "EL", "mips3" } + #endif + /* Until we figure out what MIPS ELF targets normally use, just do stabs in ELF. */ *************** *** 49,53 **** %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{!mips1:%{!mips2:-U__mips -D__mips=3}}" /* Use memcpy, et. al., rather than bcopy. */ --- 55,62 ---- %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{!mips1:%{!mips2:-U__mips -D__mips=3 -D__mips64}} \ ! %{mgp32:-U__mips64} %{mgp64:-D__mips64} \ ! %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ ! %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" /* Use memcpy, et. al., rather than bcopy. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/gnu.h gcc-2.7.1/config/mips/gnu.h *** gcc-2.7.0/config/mips/gnu.h Thu Jun 15 15:30:26 1995 --- gcc-2.7.1/config/mips/gnu.h Mon Jun 19 13:42:19 1995 *************** *** 76,80 **** putc ('\n', STREAM); \ ASM_DECLARE_RESULT (STREAM, DECL_RESULT (DECL)); \ - current_function_name = NAME; \ HALF_PIC_DECLARE (NAME); \ } while (0) --- 76,79 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/iris3.h gcc-2.7.1/config/mips/iris3.h *** gcc-2.7.0/config/mips/iris3.h Thu Jun 15 15:30:45 1995 --- gcc-2.7.1/config/mips/iris3.h Fri Jul 28 08:55:53 1995 *************** *** 1,4 **** /* Definitions of target machine for GNU compiler. Iris version. ! Copyright (C) 1991, 1993 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions of target machine for GNU compiler. Iris version. ! Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 40,44 **** %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3} \ %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" --- 40,45 ---- %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3 -D__mips64} \ ! %{mgp32:-U__mips64} %{mgp64:-D__mips64} \ %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/iris5.h gcc-2.7.1/config/mips/iris5.h *** gcc-2.7.0/config/mips/iris5.h Thu Jun 15 15:31:17 1995 --- gcc-2.7.1/config/mips/iris5.h Fri Jul 28 08:52:08 1995 *************** *** 80,84 **** %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3} \ %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" --- 80,85 ---- %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3 -D__mips64} \ ! %{mgp32:-U__mips64} %{mgp64:-D__mips64} \ %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/iris6.h gcc-2.7.1/config/mips/iris6.h *** gcc-2.7.0/config/mips/iris6.h Thu Jun 15 15:31:27 1995 --- gcc-2.7.1/config/mips/iris6.h Sun Nov 5 10:44:00 1995 *************** *** 1,4 **** /* Definitions of target machine for GNU compiler. Iris version 6. ! Copyright (C) 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions of target machine for GNU compiler. Iris version 6. ! Copyright (C) 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 26,29 **** --- 26,30 ---- #define TARGET_DEFAULT MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT #define MIPS_ISA_DEFAULT 4 + #define MULTILIB_DEFAULTS { "EB", "mips4" } #include "mips/iris5gas.h" *************** *** 58,67 **** #define POPSECTION_ASM_OP ".popsection" - /* To enable use of init and fini sections. */ - #define INIT_SECTION_ASM_OP ".section\t.init" - #undef LD_INIT_SWITCH - #undef LD_FINI_SWITCH - #undef HAS_INIT_SECTION - #define DEBUG_SECTION ".debug,1,0,0,1" #define LINE_SECTION ".line,1,0,0,1" --- 59,62 ---- *************** *** 112,115 **** --- 107,116 ---- /* Stuff for constructors. Start here. */ + /* The assembler now accepts .section pseudo-ops, but it does not allow + one to change the section in the middle of a function. crtstuff relies + on this hack, and thus crtstuff won't work here. So, we do init and + fini sections exactly the same way as they are done for Irix 5, and + we ifdef out the ASM_OUTPUT_{CON,DE}STRUCTOR macros below. */ + #define CONST_SECTION_ASM_OP_32 "\t.rdata" #define CONST_SECTION_ASM_OP_64 ".section\t.rodata" *************** *** 186,189 **** --- 187,192 ---- } + #if 0 + /* A C statement (sans semicolon) to output an element in the table of global constructors. */ *************** *** 205,208 **** --- 208,213 ---- fprintf (FILE, "\n"); \ } while (0) + + #endif /* Stuff for constructors. End here. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/mips.c gcc-2.7.1/config/mips/mips.c *** gcc-2.7.0/config/mips/mips.c Thu Jun 15 15:32:16 1995 --- gcc-2.7.1/config/mips/mips.c Sun Oct 22 07:37:20 1995 *************** *** 83,87 **** extern void warning (); - extern tree current_function_decl; extern FILE *asm_out_file; --- 83,86 ---- *************** *** 875,879 **** embedded_pic_fnaddr_rtx = gen_reg_rtx (Pmode); ! /* Output code at function start to initialize the psuedo-reg. */ /* ??? We used to do this in FINALIZE_PIC, but that does not work for inline functions, because it is called after RTL for the function --- 874,878 ---- embedded_pic_fnaddr_rtx = gen_reg_rtx (Pmode); ! /* Output code at function start to initialize the pseudo-reg. */ /* ??? We used to do this in FINALIZE_PIC, but that does not work for inline functions, because it is called after RTL for the function *************** *** 881,885 **** does not get copied, and ends up not matching the rest of the RTL. This solution works, but means that we get unnecessary code to ! initialize this value everytime a function is inlined into another function. */ start_sequence (); --- 880,884 ---- does not get copied, and ends up not matching the rest of the RTL. This solution works, but means that we get unnecessary code to ! initialize this value every time a function is inlined into another function. */ start_sequence (); *************** *** 1846,1850 **** /* If modification of cmp1 caused overflow, we would get the wrong answer if we follow the usual path; ! thus, x > 0xffffffffu would turn into x > 0u. */ if ((p_info->unsignedp ? (unsigned HOST_WIDE_INT) new > INTVAL (cmp1) --- 1845,1849 ---- /* If modification of cmp1 caused overflow, we would get the wrong answer if we follow the usual path; ! thus, x > 0xffffffffU would turn into x > 0U. */ if ((p_info->unsignedp ? (unsigned HOST_WIDE_INT) new > INTVAL (cmp1) *************** *** 3455,3460 **** else if (MD_REG_P (regno)) ! temp = (size <= UNITS_PER_WORD ! || (regno == MD_REG_FIRST && size == 2 * UNITS_PER_WORD)); else --- 3454,3460 ---- else if (MD_REG_P (regno)) ! temp = (class == MODE_INT ! && (size <= UNITS_PER_WORD ! || (regno == MD_REG_FIRST && size == 2 * UNITS_PER_WORD))); else *************** *** 4830,4833 **** --- 4830,4834 ---- int size; { + char *fnname; long tsize = current_frame_info.total_size; *************** *** 4839,4848 **** #endif inside_function = 1; fputs ("\t.ent\t", file); ! assemble_name (file, current_function_name); fputs ("\n", file); ! assemble_name (file, current_function_name); fputs (":\n", file); --- 4840,4854 ---- #endif + /* Get the function name the same way that toplev.c does before calling + assemble_start_function. This is needed so that the name used here + exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */ + fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + inside_function = 1; fputs ("\t.ent\t", file); ! assemble_name (file, fnname); fputs ("\n", file); ! assemble_name (file, fnname); fputs (":\n", file); *************** *** 5068,5071 **** --- 5074,5078 ---- int size; { + char *fnname; long tsize; char *sp_str = reg_names[STACK_POINTER_REGNUM]; *************** *** 5233,5238 **** } fputs ("\t.end\t", file); ! assemble_name (file, current_function_name); fputs ("\n", file); --- 5240,5250 ---- } + /* Get the function name the same way that toplev.c does before calling + assemble_start_function. This is needed so that the name used here + exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */ + fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + fputs ("\t.end\t", file); ! assemble_name (file, fnname); fputs ("\n", file); *************** *** 5242,5246 **** int num_fp_regs = current_frame_info.fp_reg_size / 8; int num_regs = num_gp_regs + num_fp_regs; ! char *name = current_function_name; if (name[0] == '*') --- 5254,5258 ---- int num_fp_regs = current_frame_info.fp_reg_size / 8; int num_regs = num_gp_regs + num_fp_regs; ! char *name = fnname; if (name[0] == '*') diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/mips.h gcc-2.7.1/config/mips/mips.h *** gcc-2.7.0/config/mips/mips.h Thu Jun 15 15:32:41 1995 --- gcc-2.7.1/config/mips/mips.h Thu Nov 9 11:23:09 1995 *************** *** 96,100 **** extern char mips_reg_names[][8]; /* register names (a0 vs. $4). */ extern char mips_print_operand_punct[]; /* print_operand punctuation chars */ - extern char *current_function_name; /* current function being compiled */ extern char *current_function_file; /* filename current function is in */ extern int num_source_filenames; /* current .file # */ --- 96,99 ---- *************** *** 425,428 **** --- 424,435 ---- #endif + #ifndef MULTILIB_DEFAULTS + #if TARGET_ENDIAN_DEFAULT == 0 + #define MULTILIB_DEFAULTS { "EL", "mips1" } + #else + #define MULTILIB_DEFAULTS { "EB", "mips1" } + #endif + #endif + /* This macro is similar to `TARGET_SWITCHES' but defines names of command options that have values. Its definition is an *************** *** 701,706 **** %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3} \ ! %{mips4:-U__mips -D__mips=4} \ %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" --- 708,714 ---- %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3 -D__mips64} \ ! %{mips4:-U__mips -D__mips=4 -D__mips64} \ ! %{mgp32:-U__mips64} %{mgp64:-D__mips64} \ %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" *************** *** 1248,1254 **** (! FP_REG_P (REGNO) \ ? ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) \ ! : (TARGET_SINGLE_FLOAT \ ! ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG) \ ! : (((GET_MODE_SIZE (MODE) + 7) / 8) << (TARGET_FLOAT64 == 0)))) /* Value is 1 if hard register REGNO can hold a value of machine-mode --- 1256,1260 ---- (! FP_REG_P (REGNO) \ ? ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) \ ! : ((GET_MODE_SIZE (MODE) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG)) /* Value is 1 if hard register REGNO can hold a value of machine-mode *************** *** 1752,1759 **** if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ (OFFSET) = 0; \ ! else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \ ! (OFFSET) = current_frame_info.total_size; \ ! else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ ! (OFFSET) = current_frame_info.total_size; \ else \ abort (); \ --- 1758,1768 ---- if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ (OFFSET) = 0; \ ! else if ((FROM) == ARG_POINTER_REGNUM \ ! && ((TO) == FRAME_POINTER_REGNUM \ ! || (TO) == STACK_POINTER_REGNUM)) \ ! (OFFSET) = (current_frame_info.total_size \ ! - (ABI_64BIT && mips_isa >= 3 \ ! ? current_function_pretend_args_size \ ! : 0)); \ else \ abort (); \ *************** *** 1760,1764 **** } - /* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. --- 1769,1772 ---- *************** *** 3447,3451 **** } \ \ - current_function_name = NAME; \ HALF_PIC_DECLARE (NAME); \ } --- 3455,3458 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/netbsd.h gcc-2.7.1/config/mips/netbsd.h *** gcc-2.7.0/config/mips/netbsd.h Thu Jun 15 15:34:12 1995 --- gcc-2.7.1/config/mips/netbsd.h Sat Jul 29 16:24:02 1995 *************** *** 1,4 **** /* Definitions for DECstation running BSD as target machine for GNU compiler. ! Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions for DECstation running BSD as target machine for GNU compiler. ! Copyright (C) 1993, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 88,92 **** %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3}" #endif --- 88,93 ---- %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3 -D__mips64} \ ! %{mgp32:-U__mips64} %{mgp64:-D__mips64}" #endif *************** *** 158,162 **** putc ('\n', FILE); \ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ - ASM_OUTPUT_LABEL(FILE, NAME); \ } while (0) --- 159,162 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/osfrose.h gcc-2.7.1/config/mips/osfrose.h *** gcc-2.7.0/config/mips/osfrose.h Thu Jun 15 15:35:14 1995 --- gcc-2.7.1/config/mips/osfrose.h Fri Jul 28 08:58:31 1995 *************** *** 1,5 **** /* Definitions of target machine for GNU compiler. DECstation (OSF/1 reference port with OSF/rose) version. ! Copyright (C) 1991, 1992 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,5 ---- /* Definitions of target machine for GNU compiler. DECstation (OSF/1 reference port with OSF/rose) version. ! Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 82,86 **** %{mlong64:-D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3} \ %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" --- 82,87 ---- %{mlong64:-D__PTRDIFF_TYPE__=long\\ int} \ %{!mlong64:-D__PTRDIFF_TYPE__=int} \ ! %{mips3:-U__mips -D__mips=3 -D__mips64} \ ! %{mgp32:-U__mips64} %{mgp64:-D__mips64} \ %{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ %{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/t-mips gcc-2.7.1/config/mips/t-mips *** gcc-2.7.0/config/mips/t-mips Thu Jan 12 13:25:50 1995 --- gcc-2.7.1/config/mips/t-mips Sat Jul 1 22:27:08 1995 *************** *** 7,15 **** LIBGCC1 = CROSS_LIBGCC1 = - - MULTILIB_OPTIONS=EL/EB - MULTILIB_DIRNAMES=el eb - MULTILIB_MATCHES= - - LIBGCC = stmp-multilib - INSTALL_LIBGCC = install-multilib --- 7,8 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/mips/t-mips-gas gcc-2.7.1/config/mips/t-mips-gas *** gcc-2.7.0/config/mips/t-mips-gas Thu Jan 12 13:25:53 1995 --- gcc-2.7.1/config/mips/t-mips-gas Sat Jul 1 22:27:11 1995 *************** *** 3,11 **** LIBGCC1 = CROSS_LIBGCC1 = - - MULTILIB_OPTIONS=EL/EB - MULTILIB_DIRNAMES=el eb - MULTILIB_MATCHES= - - LIBGCC = stmp-multilib - INSTALL_LIBGCC = install-multilib --- 3,4 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/msdos/configur.bat gcc-2.7.1/config/msdos/configur.bat *** gcc-2.7.0/config/msdos/configur.bat Tue Dec 20 09:32:16 1994 --- gcc-2.7.1/config/msdos/configur.bat Mon Aug 28 05:55:47 1995 *************** *** 27,31 **** echo lang.clean: %LANG% | sed "s/&/clean/g" >> Makefile echo lang.distclean: %LANG% | sed "s/&/distclean/g" >> Makefile ! echo lang.realclean: %LANG% | sed "s/&/realclean/g" >> Makefile echo #define MULTILIB_SELECT ". ;" > multilib.h1 --- 27,39 ---- echo lang.clean: %LANG% | sed "s/&/clean/g" >> Makefile echo lang.distclean: %LANG% | sed "s/&/distclean/g" >> Makefile ! echo lang.maintainer-clean: %LANG% | sed "s/&/maintainer-clean/g" >> Makefile ! echo /* options.h */ > options.h ! if exist cp\lang-options.h echo #include "cp/lang-options.h" >> options.h ! if exist ada\lang-options.h echo #include "ada/lang-options.h" >> options.h ! if exist f\lang-options.h echo #include "f/lang-options.h" >> options.h ! echo /* specs.h */ > specs.h ! if exist cp\lang-specs.h echo #include "cp/lang-specs.h" >> specs.h ! if exist ada\lang-specs.h echo #include "ada/lang-specs.h" >> specs.h ! if exist f\lang-specs.h echo #include "f/lang-specs.h" >> specs.h echo #define MULTILIB_SELECT ". ;" > multilib.h1 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/msdos/top.sed gcc-2.7.1/config/msdos/top.sed *** gcc-2.7.0/config/msdos/top.sed Tue Dec 20 09:32:19 1994 --- gcc-2.7.1/config/msdos/top.sed Mon Jun 19 13:03:22 1995 *************** *** 3,10 **** /^target=/ c\ target=go32 /^xmake_file=/ d /^tmake_file=/ d /^version=/ c\ ! version=2.6.1 s/CC = cc/CC = gcc/ s/:\$/: \$/g --- 3,26 ---- /^target=/ c\ target=go32 + /^out_file=/ c\ + out_file=config/i386/i386.c + /^out_object_file=/ c\ + out_object_file=i386.o + /^md_file=/ c\ + md_file=config/i386/i386.md + /^tm_file=/ c\ + tm_file=config/i386/go32.h + /^build_xm_file=/ c\ + build_xm_file=config/i386/xm-dos.h + /^host_xm_file=/ c\ + host_xm_file=config/i386/xm-dos.h + /^lang_specs_files=/ d + /^lang_options_files=/ d /^xmake_file=/ d /^tmake_file=/ d /^version=/ c\ ! version=2.7.1 ! /^mainversion=/ c\ ! mainversion=2.7.1 s/CC = cc/CC = gcc/ s/:\$/: \$/g *************** *** 20,24 **** /^stamp-attrtab/,/update/ { /\\/d ! /fi/d /update/ i\ go32 genattrtab md > t-attrtab.c --- 36,40 ---- /^stamp-attrtab/,/update/ { /\\/d ! /[ ]fi[ ]/d /update/ i\ go32 genattrtab md > t-attrtab.c diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/ns32k/netbsd.h gcc-2.7.1/config/ns32k/netbsd.h *** gcc-2.7.0/config/ns32k/netbsd.h Thu Jun 15 15:39:03 1995 --- gcc-2.7.1/config/ns32k/netbsd.h Thu Sep 28 14:00:56 1995 *************** *** 82,85 **** --- 82,86 ---- #define WCHAR_TYPE "int" + #undef WCHAR_UNSIGNED #define WCHAR_UNSIGNED 0 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pa/lib2funcs.asm gcc-2.7.1/config/pa/lib2funcs.asm *** gcc-2.7.0/config/pa/lib2funcs.asm Thu Jun 15 15:41:56 1995 --- gcc-2.7.1/config/pa/lib2funcs.asm Sat Jul 29 09:14:52 1995 *************** *** 1,4 **** ; Subroutines for calling unbound dynamic functions from within GDB for HPPA. ! ; Copyright (C) 1994 Free Software Foundation, Inc. ; This file is part of GNU CC. --- 1,4 ---- ; Subroutines for calling unbound dynamic functions from within GDB for HPPA. ! ; Copyright (C) 1994, 1995 Free Software Foundation, Inc. ; This file is part of GNU CC. *************** *** 37,47 **** __gcc_plt_call .PROC ! .CALLINFO FRAME=64,CALLS,SAVE_RP .ENTRY ! stw %r2,-8(0,%r30) ! bl $$dyncall,%r31 copy %r31,%r2 ldw -8(0,%r30),%r2 ! bv,n 0(%r2) .EXIT .PROCEND --- 37,63 ---- __gcc_plt_call .PROC ! .CALLINFO .ENTRY ! ; Our return address comes in %r31, not %r2! ! stw %r31,-8(0,%r30) ! ! ; An inline version of dyncall so we don't have to worry ! ; about long calls to millicode, PIC and other complexities. ! bb,>=,n %r22,30,L$foo ! depi 0,31,2,%r22 ! ldw 4(%r22),%r19 ! ldw 0(%r22),%r22 ! L$foo ! ldsid (%r22),%r1 ! mtsp %r1,%sr0 ! ble 0(%sr0,%r22) copy %r31,%r2 ldw -8(0,%r30),%r2 ! ! ; We're going to be returning to a stack address, so we ! ; need to do an intra-space return. ! ldsid (%rp),%r1 ! mtsp %r1,%sr0 ! be,n 0(%sr0,%rp) .EXIT .PROCEND diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pa/pa-gux7.h gcc-2.7.1/config/pa/pa-gux7.h *** gcc-2.7.0/config/pa/pa-gux7.h Thu Jun 15 15:42:48 1995 --- gcc-2.7.1/config/pa/pa-gux7.h Thu Jun 22 19:23:37 1995 *************** *** 1,4 **** /* Definitions of target machine for GNU compiler, for HP-UX using GNU as. ! Copyright (C) 1991 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions of target machine for GNU compiler, for HP-UX using GNU as. ! Copyright (C) 1991, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 33,36 **** --- 33,37 ---- /* Like the default, except no -lg. */ + #undef LIB_SPEC #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pa/pa-hpux.h gcc-2.7.1/config/pa/pa-hpux.h *** gcc-2.7.0/config/pa/pa-hpux.h Thu Jun 15 15:43:06 1995 --- gcc-2.7.1/config/pa/pa-hpux.h Thu Jun 22 19:24:00 1995 *************** *** 1,4 **** /* Definitions of target machine for GNU compiler, for HP-UX. ! Copyright (C) 1991 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions of target machine for GNU compiler, for HP-UX. ! Copyright (C) 1991, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 38,41 **** --- 38,42 ---- /* Like the default, except no -lg. */ + #undef LIB_SPEC #define LIB_SPEC "%{!shared:%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pa/pa-hpux7.h gcc-2.7.1/config/pa/pa-hpux7.h *** gcc-2.7.0/config/pa/pa-hpux7.h Thu Jun 15 15:43:18 1995 --- gcc-2.7.1/config/pa/pa-hpux7.h Thu Jun 22 19:24:28 1995 *************** *** 1,4 **** /* Definitions of target machine for GNU compiler, for HP-UX. ! Copyright (C) 1991 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions of target machine for GNU compiler, for HP-UX. ! Copyright (C) 1991, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 41,44 **** --- 41,45 ---- /* Like the default, except no -lg. */ + #undef LIB_SPEC #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pa/pa.c gcc-2.7.1/config/pa/pa.c *** gcc-2.7.0/config/pa/pa.c Thu Jun 15 15:44:09 1995 --- gcc-2.7.1/config/pa/pa.c Sun Oct 22 07:45:20 1995 *************** *** 49,54 **** char *pa_cpu_string; - rtx hppa_save_pic_table_rtx; - /* Set by the FUNCTION_PROFILER macro. */ int hp_profile_labelno; --- 49,52 ---- *************** *** 518,522 **** rtx pic_ref = orig; ! /* Lables need special handling. */ if (pic_label_operand (orig)) { --- 516,520 ---- rtx pic_ref = orig; ! /* Labels need special handling. */ if (pic_label_operand (orig)) { *************** *** 2349,2352 **** --- 2347,2371 ---- } } + + /* When generating PIC code it is necessary to save/restore the + PIC register around each function call. We used to do this + in the call patterns themselves, but that implementation + made incorrect assumptions about using global variables to hold + per-function rtl code generated in the backend. + + So instead, we copy the PIC register into a reserved callee saved + register in the prologue. Then after each call we reload the PIC + register from the callee saved register. We also reload the PIC + register from the callee saved register in the epilogue ensure the + PIC register is valid at function exit. + + This may (depending on the exact characteristics of the function) + even be more efficient. + + Avoid this if the callee saved register wasn't used (these are + leaf functions. */ + if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM_SAVED]) + emit_move_insn (gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED), + gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM)); } *************** *** 2603,2607 **** /* This cost 3 cycles, not 2 as the md says for the 700 and 7100. Note scaling of cost for 7100. */ ! return cost + (pa_cpu_attr == PROCESSOR_700) ? 1 : 2; case TYPE_FPALU: --- 2622,2626 ---- /* This cost 3 cycles, not 2 as the md says for the 700 and 7100. Note scaling of cost for 7100. */ ! return cost + (pa_cpu == PROCESSOR_700) ? 1 : 2; case TYPE_FPALU: *************** *** 2614,2618 **** /* In these important cases, we save one cycle compared to when flop instruction feed each other. */ ! return cost - (pa_cpu_attr == PROCESSOR_700) ? 1 : 2; default: --- 2633,2637 ---- /* In these important cases, we save one cycle compared to when flop instruction feed each other. */ ! return cost - (pa_cpu == PROCESSOR_700) ? 1 : 2; default: *************** *** 2662,2666 **** the target of the fpload is any of the sources (or destination) of the arithmetic operation. */ ! return cost - (pa_cpu_attr == PROCESSOR_700) ? 1 : 2; default: --- 2681,2685 ---- the target of the fpload is any of the sources (or destination) of the arithmetic operation. */ ! return cost - (pa_cpu == PROCESSOR_700) ? 1 : 2; default: *************** *** 2697,2701 **** the target of the ALU flop is any of the sources (or destination) of the divide or sqrt operation. */ ! return cost - (pa_cpu_attr == PROCESSOR_700) ? 2 : 4; default: --- 2716,2720 ---- the target of the ALU flop is any of the sources (or destination) of the divide or sqrt operation. */ ! return cost - (pa_cpu == PROCESSOR_700) ? 2 : 4; default: *************** *** 2743,2747 **** the target of the fpload is the destination of the arithmetic operation. */ ! return cost - (pa_cpu_attr == PROCESSOR_700) ? 1 : 2; default: --- 2762,2766 ---- the target of the fpload is the destination of the arithmetic operation. */ ! return cost - (pa_cpu == PROCESSOR_700) ? 1 : 2; default: *************** *** 2778,2782 **** the target of the ALU flop is also the target of of the divide or sqrt operation. */ ! return cost - (pa_cpu_attr == PROCESSOR_700) ? 2 : 4; default: --- 2797,2801 ---- the target of the ALU flop is also the target of of the divide or sqrt operation. */ ! return cost - (pa_cpu == PROCESSOR_700) ? 2 : 4; default: *************** *** 3597,3601 **** In such cases it is safe to emit nothing. */ ! if (JUMP_LABEL (insn) == next_nonnote_insn (insn)) return ""; --- 3616,3620 ---- In such cases it is safe to emit nothing. */ ! if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) return ""; *************** *** 3713,3717 **** jump. But be prepared just in case. */ ! if (JUMP_LABEL (insn) == next_nonnote_insn (insn)) return ""; --- 3732,3736 ---- jump. But be prepared just in case. */ ! if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) return ""; *************** *** 3781,3787 **** strcat (buf, ">="); if (negated) ! strcat (buf, " %0,%1,.+12\n\tbl %3,0"); else ! strcat (buf, " %0,%1,.+12\n\tbl %2,0"); } /* Handle short backwards branch with an unfilled delay slot. --- 3800,3806 ---- strcat (buf, ">="); if (negated) ! strcat (buf, ",n %0,%1,.+12\n\tbl %3,0"); else ! strcat (buf, ",n %0,%1,.+12\n\tbl %2,0"); } /* Handle short backwards branch with an unfilled delay slot. *************** *** 3844,3848 **** asking for a disaster. Be prepared! */ ! if (JUMP_LABEL (insn) == next_nonnote_insn (insn)) { if (which_alternative == 0) --- 3863,3867 ---- asking for a disaster. Be prepared! */ ! if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) { if (which_alternative == 0) *************** *** 3950,3954 **** asking for a disaster. Be prepared! */ ! if (JUMP_LABEL (insn) == next_nonnote_insn (insn)) { if (which_alternative == 0) --- 3969,3973 ---- asking for a disaster. Be prepared! */ ! if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) { if (which_alternative == 0) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pa/pa.h gcc-2.7.1/config/pa/pa.h *** gcc-2.7.0/config/pa/pa.h Thu Jun 15 15:44:39 1995 --- gcc-2.7.1/config/pa/pa.h Sun Nov 5 10:52:50 1995 *************** *** 228,231 **** --- 228,236 ---- #define LINK_SPEC "%{!shared:-u main} %{shared:-b}" + /* We don't want -lg. */ + #ifndef LIB_SPEC + #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" + #endif + /* Allow $ in identifiers. */ #define DOLLARS_IN_IDENTIFIERS 2 *************** *** 461,466 **** fixed_regs[i] = call_used_regs[i] = 1; \ } \ ! else if (TARGET_DISABLE_FPREGS \ ! || TARGET_SOFT_FLOAT) \ { \ for (i = 32; i < 88; i++) \ --- 466,470 ---- fixed_regs[i] = call_used_regs[i] = 1; \ } \ ! if (TARGET_DISABLE_FPREGS || TARGET_SOFT_FLOAT)\ { \ for (i = 32; i < 88; i++) \ *************** *** 468,472 **** } \ if (flag_pic) \ ! fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ } --- 472,479 ---- } \ if (flag_pic) \ ! { \ ! fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ ! fixed_regs[PIC_OFFSET_TABLE_REGNUM_SAVED] = 1;\ ! } \ } *************** *** 571,578 **** #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED 1 ! /* Initialize hppa_save_pic_table_rtx before RTL generation for ! each function. We used to do this in FINALIZE_PIC, but FINALIZE_PIC ! isn't always called for static inline functions. */ ! #define INIT_EXPANDERS hppa_save_pic_table_rtx = 0; /* SOM ABI says that objects larger than 64 bits are returned in memory. */ --- 578,584 ---- #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED 1 ! /* Register into which we save the PIC_OFFEST_TABLE_REGNUM so that it ! can be restore across function calls. */ ! #define PIC_OFFSET_TABLE_REGNUM_SAVED 4 /* SOM ABI says that objects larger than 64 bits are returned in memory. */ *************** *** 1061,1065 **** /* Passing structs by invisible reference uses \ one general register. */ \ ! if (arg_size > 2) \ arg_size = 1; \ if (arg_size == 2 && i <= 2) \ --- 1067,1072 ---- /* Passing structs by invisible reference uses \ one general register. */ \ ! if (arg_size > 2 \ ! || TYPE_NEEDS_CONSTRUCTING (DECL_ARG_TYPE (parm)))\ arg_size = 1; \ if (arg_size == 2 && i <= 2) \ *************** *** 2104,2114 **** break; \ case LO_SUM: \ ! if (flag_pic == 0) \ ! { \ ! if (!symbolic_operand (XEXP (addr, 1))) \ ! fputs ("R'", FILE); \ ! else \ ! fputs ("RR'", FILE); \ ! } \ else if (flag_pic == 1) \ abort (); \ --- 2111,2118 ---- break; \ case LO_SUM: \ ! if (!symbolic_operand (XEXP (addr, 1))) \ ! fputs ("R'", FILE); \ ! else if (flag_pic == 0) \ ! fputs ("RR'", FILE); \ else if (flag_pic == 1) \ abort (); \ *************** *** 2151,2156 **** extern void hppa_encode_label (); - extern struct rtx_def *hppa_save_pic_table_rtx; - #if 0 #define PREDICATE_CODES \ --- 2155,2158 ---- *************** *** 2189,2193 **** /* We want __gcc_plt_call to appear in every program built by ! gcc, so we make a reference to it out of __main. */ #define DO_GLOBAL_DTORS_BODY \ do { \ --- 2191,2199 ---- /* We want __gcc_plt_call to appear in every program built by ! gcc, so we make a reference to it out of __main. ! We use the asm statement to fool the optimizer into not ! removing the dead (but important) initialization of ! REFERENCE. */ ! #define DO_GLOBAL_DTORS_BODY \ do { \ *************** *** 2195,2200 **** void (*reference)() = &__gcc_plt_call; \ func_ptr *p; \ for (p = __DTOR_LIST__ + 1; *p; ) \ (*p++) (); \ } while (0) - --- 2201,2206 ---- void (*reference)() = &__gcc_plt_call; \ func_ptr *p; \ + __asm__ ("" : : "r" (reference)); \ for (p = __DTOR_LIST__ + 1; *p; ) \ (*p++) (); \ } while (0) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pa/pa.md gcc-2.7.1/config/pa/pa.md *** gcc-2.7.0/config/pa/pa.md Thu Jun 15 16:55:28 1995 --- gcc-2.7.1/config/pa/pa.md Mon Aug 14 09:00:49 1995 *************** *** 2538,2541 **** --- 2538,2560 ---- (set_attr "length" "4,4")]) + ;; Disgusting kludge to work around reload bugs with frame pointer + ;; elimination. Similar to other magic reload patterns in the + ;; indexed memory operations. + (define_insn "" + [(set (match_operand:SI 0 "register_operand" "=&r") + (plus:SI (plus:SI (match_operand:SI 1 "register_operand" "%r") + (match_operand:SI 2 "register_operand" "r")) + (match_operand:SI 3 "const_int_operand" "rL")))] + "reload_in_progress" + "* + { + if (GET_CODE (operands[3]) == CONST_INT) + return \"ldo %3(%2),%0\;addl %1,%0,%0\"; + else + return \"addl %3,%2,%0\;addl %1,%0,%0\"; + }" + [(set_attr "type" "binary") + (set_attr "length" "8")]) + (define_insn "subdi3" [(set (match_operand:DI 0 "register_operand" "=r") *************** *** 3498,3519 **** op = XEXP (operands[0], 0); - if (flag_pic) - { - if (!hppa_save_pic_table_rtx) - hppa_save_pic_table_rtx = gen_reg_rtx (Pmode); - - /* We must save and restore the PIC register around every call - since we don't have flow information to determine if this save - is redundant with a previous save. The old code assumed once - the register was saved it never needs to be saved again, but - the save could have been on a path which doesn't always - execute; a call site physically later in the program would - then attempt a restore from an uninitialized register! */ - emit_insn (gen_rtx (SET, VOIDmode, - hppa_save_pic_table_rtx, - pic_offset_table_rtx)); - - } - /* Use two different patterns for calls to explicitly named functions and calls through function pointers. This is necessary as these two --- 3517,3520 ---- *************** *** 3531,3536 **** use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx); ! emit_insn (gen_rtx (SET, VOIDmode, pic_offset_table_rtx, ! hppa_save_pic_table_rtx)); } DONE; --- 3532,3543 ---- use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx); ! /* After each call we must restore the PIC register, even if it ! doesn't appear to be used. ! ! This will set regs_ever_live for the callee saved register we ! stored the PIC register in. */ ! emit_move_insn (pic_offset_table_rtx, ! gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED)); ! emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx)); } DONE; *************** *** 3600,3621 **** op = XEXP (operands[1], 0); - if (flag_pic) - { - if (!hppa_save_pic_table_rtx) - hppa_save_pic_table_rtx = gen_reg_rtx (Pmode); - - /* We must save and restore the PIC register around every call - since we don't have flow information to determine if this save - is redundant with a previous save. The old code assumed once - the register was saved it never needs to be saved again, but - the save could have been on a path which doesn't always - execute; a call site physically later in the program would - then attempt a restore from an uninitialized register! */ - emit_insn (gen_rtx (SET, VOIDmode, - hppa_save_pic_table_rtx, - pic_offset_table_rtx)); - - } - /* Use two different patterns for calls to explicitly named functions and calls through function pointers. This is necessary as these two --- 3607,3610 ---- *************** *** 3636,3641 **** use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx); ! emit_insn (gen_rtx (SET, VOIDmode, pic_offset_table_rtx, ! hppa_save_pic_table_rtx)); } DONE; --- 3625,3656 ---- use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx); ! /* After each call we must restore the PIC register, even if it ! doesn't appear to be used. ! ! This will set regs_ever_live for the callee saved register we ! stored the PIC register in. */ ! emit_move_insn (pic_offset_table_rtx, ! gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED)); ! emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx)); ! ! /* Gross. We have to keep the scheduler from moving the restore ! of the PIC register away from the call. SCHED_GROUP_P is ! supposed to do this, but for some reason the compiler will ! go into an infinite loop when we use that. ! ! This method (blockage insn) may make worse code (then again ! it may not since calls are nearly blockages anyway), but at ! least it should work. */ ! emit_insn (gen_blockage ()); ! ! /* Gross. We have to keep the scheduler from moving the restore ! of the PIC register away from the call. SCHED_GROUP_P is ! supposed to do this, but for some reason the compiler will ! go into an infinite loop when we use that. ! ! This method (blockage insn) may make worse code (then again ! it may not since calls are nearly blockages anyway), but at ! least it should work. */ ! emit_insn (gen_blockage ()); } DONE; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pa/x-pa gcc-2.7.1/config/pa/x-pa *** gcc-2.7.0/config/pa/x-pa Tue May 16 07:32:43 1995 --- gcc-2.7.1/config/pa/x-pa Wed Jul 26 09:21:01 1995 *************** *** 1,3 **** - CC=gcc -DUSE_C_ALLOCA -D__inline= -Dbsd4_4 # BSD on the PA already has ANSI include files which are c++ compatible. INSTALL_HEADERS= --- 1,2 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pa/xm-pa.h gcc-2.7.1/config/pa/xm-pa.h *** gcc-2.7.0/config/pa/xm-pa.h Thu Jun 15 16:01:08 1995 --- gcc-2.7.1/config/pa/xm-pa.h Wed Jul 26 09:25:02 1995 *************** *** 1,4 **** /* Configuration for GNU C-compiler for PA-RISC. ! Copyright (C) 1988 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com). --- 1,4 ---- /* Configuration for GNU C-compiler for PA-RISC. ! Copyright (C) 1988, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com). *************** *** 51,59 **** #define NO_SYS_SIGLIST /* HP's compiler has problems with enum bitfields. */ #define ONLY_INT_FIELDS ! /* If not compiled with GNU C, use C alloca. */ ! #ifndef __GNUC__ #define USE_C_ALLOCA - #endif --- 51,65 ---- #define NO_SYS_SIGLIST + /* We have strerror, don't try to use sys_errlist. */ + #define HAVE_STRERROR + + /* 4.3BSD, OSF1 and Lites on the PA are all derived from NET2 or + later code from Berkeley. */ + #define __BSD_NET2__ + /* HP's compiler has problems with enum bitfields. */ #define ONLY_INT_FIELDS ! /* Always claim to use C alloca; this prevents losing if building with ! gcc -fno-builtin ... " */ #define USE_C_ALLOCA diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pa/xm-pahpux.h gcc-2.7.1/config/pa/xm-pahpux.h *** gcc-2.7.0/config/pa/xm-pahpux.h Thu Jun 15 16:01:17 1995 --- gcc-2.7.1/config/pa/xm-pahpux.h Wed Jul 26 09:26:02 1995 *************** *** 1,4 **** /* Configuration for GNU C-compiler for PA-RISC. ! Copyright (C) 1988 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com). --- 1,4 ---- /* Configuration for GNU C-compiler for PA-RISC. ! Copyright (C) 1988, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com). *************** *** 64,69 **** #define ONLY_INT_FIELDS ! /* If not compiled with GNU C, use C alloca. */ ! #ifndef __GNUC__ #define USE_C_ALLOCA - #endif --- 64,68 ---- #define ONLY_INT_FIELDS ! /* Always claim to use C alloca; this prevents losing if building with ! gcc -fno-builtin ... " */ #define USE_C_ALLOCA diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pdp11/2bsd.h gcc-2.7.1/config/pdp11/2bsd.h *** gcc-2.7.0/config/pdp11/2bsd.h --- gcc-2.7.1/config/pdp11/2bsd.h Sat Jul 29 10:08:00 1995 *************** *** 0 **** --- 1,88 ---- + /* Definitions of target machine for GNU compiler, for a PDP with 2BSD + Copyright (C) 1995 Free Software Foundation, Inc. + Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). + + 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 1, 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. */ + + #include "pdp11/pdp11.h" + + /* This macro generates the assembly code for function entry. */ + #undef FUNCTION_PROLOGUE + #define FUNCTION_PROLOGUE(FILE, SIZE) \ + do { \ + fprintf(FILE, "\tjsr r5, csv\n"); \ + if ((SIZE) != 0) \ + { \ + fprintf(FILE, "\t/*abuse empty parameter slot for locals!*/\n"); \ + if ((SIZE) > 2) \ + fprintf(FILE, "\tsub $%d, sp\n", (SIZE)-2); \ + }; \ + } while (0) + + /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, + the stack pointer does not matter. The value is tested only in + functions that have frame pointers. + No definition is equivalent to always zero. */ + + #undef EXIT_IGNORE_STACK + #define EXIT_IGNORE_STACK 1 + + /* This macro generates the assembly code for function exit, + on machines that need it. If FUNCTION_EPILOGUE is not defined + then individual return instructions are generated for each + return statement. Args are same as for FUNCTION_PROLOGUE. + */ + + #undef FUNCTION_EPILOGUE + #define FUNCTION_EPILOGUE(FILE, SIZE) \ + do { \ + fprintf(FILE, "\t/* SP ignored by cret? */\n"); \ + fprintf(FILE, "\tjmp cret\n"); \ + } while (0) + + #undef INITIAL_FRAME_POINTER_OFFSET + #define INITIAL_FRAME_POINTER_OFFSET(DEPTH_VAR) \ + { \ + int offset, regno; \ + offset = get_frame_size(); \ + offset = (offset <= 2)? 0: (offset -2); \ + (DEPTH_VAR) = offset+10; \ + } + + /* Value should be nonzero if functions must have frame pointers. + Zero means the frame pointer need not be set up (and parms + may be accessed via the stack pointer) in functions that seem suitable. + This is computed in `reload', in reload1.c. + */ + + #undef FRAME_POINTER_REQUIRED + #define FRAME_POINTER_REQUIRED 1 + + /* Offset within stack frame to start allocating local variables at. + If FRAME_GROWS_DOWNWARD, this is the offset to the END of the + first local allocated. Otherwise, it is the offset to the BEGINNING + of the first local allocated. */ + #undef STARTING_FRAME_OFFSET + #define STARTING_FRAME_OFFSET -8 + + + #undef ASM_DECLARE_FUNCTION_NAME + #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ + do { \ + ASM_OUTPUT_LABEL (STREAM, NAME); \ + fprintf (STREAM, "~~%s:\n", NAME); \ + } while (0) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pdp11/pdp11.c gcc-2.7.1/config/pdp11/pdp11.c *** gcc-2.7.0/config/pdp11/pdp11.c Thu Jun 15 16:01:29 1995 --- gcc-2.7.1/config/pdp11/pdp11.c Sat Jul 29 09:58:21 1995 *************** *** 1,4 **** /* Subroutines for gcc2 for pdp11. ! Copyright (C) 1994 Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). --- 1,4 ---- /* Subroutines for gcc2 for pdp11. ! Copyright (C) 1994, 1995 Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). *************** *** 650,653 **** --- 650,660 ---- #endif /* HOST_WORDS_BIG_ENDIAN */ } + else if (GET_CODE(operands[1]) == CONST_INT) + { + latehalf[1] = gen_rtx (CONST_INT, VOIDmode, 0); + } + else + abort(); + } else diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pdp11/pdp11.h gcc-2.7.1/config/pdp11/pdp11.h *** gcc-2.7.0/config/pdp11/pdp11.h Thu Jun 15 16:01:41 1995 --- gcc-2.7.1/config/pdp11/pdp11.h Mon Aug 28 06:19:05 1995 *************** *** 567,571 **** we fill up all regs! ! have to, else we crash - exceptio: maybe return result in ac0 if DFmode and FPU present - compatibility problem with libraries for non-floating point ... --- 567,571 ---- we fill up all regs! ! have to, else we crash - exception: maybe return result in ac0 if DFmode and FPU present - compatibility problem with libraries for non-floating point ... *************** *** 1355,1359 **** total = COSTS_N_INSNS(6); \ else \ ! abort(); \ break; \ /* case LSHIFT: */ \ --- 1355,1359 ---- total = COSTS_N_INSNS(6); \ else \ ! total = COSTS_N_INSNS(2); \ break; \ /* case LSHIFT: */ \ *************** *** 1366,1370 **** { \ if (GET_CODE(XEXP (X,1)) != CONST_INT) \ ! abort(); \ total = COSTS_N_INSNS(INTVAL(XEXP (X,1))); \ } \ --- 1366,1371 ---- { \ if (GET_CODE(XEXP (X,1)) != CONST_INT) \ ! total = COSTS_N_INSNS(8); /* worst case */ \ ! else \ total = COSTS_N_INSNS(INTVAL(XEXP (X,1))); \ } \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pdp11/pdp11.md gcc-2.7.1/config/pdp11/pdp11.md *** gcc-2.7.0/config/pdp11/pdp11.md Tue May 16 07:33:02 1995 --- gcc-2.7.1/config/pdp11/pdp11.md Sat Jul 29 09:57:57 1995 *************** *** 366,370 **** (pc)))] "" ! "* return output_jump(\"blo\", \"bhos\", get_attr_length(insn));" [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0) (pc)) --- 366,370 ---- (pc)))] "" ! "* return output_jump(\"blo\", \"bhis\", get_attr_length(insn));" [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0) (pc)) *************** *** 539,543 **** (label_ref (match_operand 0 "" ""))))] "" ! "* return output_jump(\"bhos\", \"blo\", get_attr_length(insn));" [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0) (pc)) --- 539,543 ---- (label_ref (match_operand 0 "" ""))))] "" ! "* return output_jump(\"bhis\", \"blo\", get_attr_length(insn));" [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0) (pc)) *************** *** 573,577 **** (label_ref (match_operand 0 "" ""))))] "" ! "* return output_jump(\"blo\", \"bhos\", get_attr_length(insn));" [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0) (pc)) --- 573,577 ---- (label_ref (match_operand 0 "" ""))))] "" ! "* return output_jump(\"blo\", \"bhis\", get_attr_length(insn));" [(set (attr "length") (if_then_else (ior (le (minus (match_dup 0) (pc)) *************** *** 719,728 **** (define_insn "truncdfsf2" ! [(set (match_operand:SF 0 "memory_operand" "=R,Q") ! (float_truncate:SF (match_operand:DF 1 "register_operand" "a,a")))] "TARGET_FPU" ! "stcdf %1, %0" ! [(set_attr "length" "1,2")]) (define_expand "truncsihi2" [(set (match_operand:HI 0 "general_operand" "=g") --- 719,741 ---- (define_insn "truncdfsf2" ! [(set (match_operand:SF 0 "general_operand" "=r,R,Q") ! (float_truncate:SF (match_operand:DF 1 "register_operand" "a,a,a")))] "TARGET_FPU" ! "* if (which_alternative ==0) ! { ! output_asm_insn(\"stcdf %1, -(sp)\", operands); ! output_asm_insn(\"mov (sp)+, %0\", operands); ! operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1); ! output_asm_insn(\"mov (sp)+, %0\", operands); ! return \"\"; ! } ! else if (which_alternative == 1) ! return \"stcdf %1, %0\"; ! else ! return \"stcdf %1, %0\"; ! " ! [(set_attr "length" "3,1,2")]) + (define_expand "truncsihi2" [(set (match_operand:HI 0 "general_operand" "=g") *************** *** 759,767 **** (define_insn "extendsfdf2" ! [(set (match_operand:DF 0 "register_operand" "=a,a") ! (float_extend:SF (match_operand:SF 1 "memory_operand" "R,Q")))] "TARGET_FPU" ! "ldcfd %1, %0" ! [(set_attr "length" "1,2")]) ;; does movb sign extend in register-to-register move? --- 772,783 ---- (define_insn "extendsfdf2" ! [(set (match_operand:DF 0 "register_operand" "=a,a,a") ! (float_extend:SF (match_operand:SF 1 "general_operand" "r,R,Q")))] "TARGET_FPU" ! "@ ! mov %1, -(sp)\;ldcfd (sp)+,%0 ! ldcfd %1, %0 ! ldcfd %1, %0" ! [(set_attr "length" "2,1,2")]) ;; does movb sign extend in register-to-register move? *************** *** 888,896 **** (define_insn "floatsidf2" ! [(set (match_operand:DF 0 "register_operand" "=a,a") ! (float:DF (match_operand:SI 1 "memory_operand" "R,Q")))] "TARGET_FPU" ! "setl\;ldcld %1, %0\;seti" ! [(set_attr "length" "3,4")]) (define_insn "floathidf2" --- 904,930 ---- (define_insn "floatsidf2" ! [(set (match_operand:DF 0 "register_operand" "=a,a,a") ! (float:DF (match_operand:SI 1 "general_operand" "r,R,Q")))] "TARGET_FPU" ! "* if (which_alternative ==0) ! { ! rtx latehalf[2]; ! ! latehalf[0] = NULL; ! latehalf[1] = gen_rtx(REG, HImode, REGNO (operands[0])+1); ! output_asm_insn(\"mov %1, -(sp)\", latehalf); ! output_asm_insn(\"mov %1, -(sp)\", operands); ! ! output_asm_insn(\"setl\", operands); ! output_asm_insn(\"ldcld (sp)+, %0\", operands); ! output_asm_insn(\"seti\", operands); ! return \"\"; ! } ! else if (which_alternative == 1) ! return \"setl\;ldcld %1, %0\;seti\"; ! else ! return \"setl\;ldcld %1, %0\;seti\"; ! " ! [(set_attr "length" "5,3,4")]) (define_insn "floathidf2" *************** *** 903,911 **** ;; cut float to int (define_insn "fix_truncdfsi2" ! [(set (match_operand:SI 0 "memory_operand" "=R,Q") ! (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "a,a"))))] "TARGET_FPU" ! "setl\;stcdl %1, %0\;seti" ! [(set_attr "length" "3,4")]) (define_insn "fix_truncdfhi2" --- 937,959 ---- ;; cut float to int (define_insn "fix_truncdfsi2" ! [(set (match_operand:SI 0 "general_operand" "=r,R,Q") ! (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "a,a,a"))))] "TARGET_FPU" ! "* if (which_alternative ==0) ! { ! output_asm_insn(\"setl\", operands); ! output_asm_insn(\"stcdl %1, -(sp)\", operands); ! output_asm_insn(\"seti\", operands); ! output_asm_insn(\"mov (sp)+, %0\", operands); ! operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1); ! output_asm_insn(\"mov (sp)+, %0\", operands); ! return \"\"; ! } ! else if (which_alternative == 1) ! return \"setl\;stcdl %1, %0\;seti\"; ! else ! return \"setl\;stcdl %1, %0\;seti\"; ! " ! [(set_attr "length" "5,3,4")]) (define_insn "fix_truncdfhi2" *************** *** 1700,1706 **** ;;- divide - ;; how can I use the remainder ? - - ;; modsidi and move upper register to lower ???? - (define_insn "divdf3" [(set (match_operand:DF 0 "register_operand" "=a,a,a") --- 1748,1751 ---- *************** *** 1711,1833 **** [(set_attr "length" "1,2,5")]) ! (define_insn "" ! [(set (match_operand:HI 0 "general_operand" "=r,r") ! (truncate:HI ! (div:SI ! (match_operand:SI 1 "general_operand" "0,0") ! (sign_extend:SI (match_operand:HI 2 "general_operand" "rR,Q")))))] ! "TARGET_45" ! "div %2,%0" ! [(set_attr "length" "1,2")]) ! ! ;; - problem matching the (sign_extend:SI (const_int ...)) ! ; used without -O ! (define_insn "" ! [(set (match_operand:HI 0 "general_operand" "=r") ! (truncate:HI ! (div:SI ! (match_operand:SI 1 "general_operand" "0") ! (sign_extend:SI (match_operand 2 "immediate_operand" "n")))))] ! "TARGET_45" ! "div %2,%0" ! [(set_attr "length" "2")]) ! ! ; used with -O ! (define_insn "" ! [(set (match_operand:HI 0 "general_operand" "=r") ! (truncate:HI ! (div:SI ! (match_operand:SI 1 "general_operand" "0") ! (match_operand:SI 2 "immediate_operand" "i"))))] ! "TARGET_45" ! "div %2,%0" ! [(set_attr "length" "2")]) ! (define_expand "divhi3" ! [(set (match_dup 3) ! (sign_extend:SI (match_operand:HI 1 "general_operand" "g"))) ! (set (match_operand:HI 0 "general_operand" "g") ! (truncate:HI ! (div:SI ! (match_dup 3) ! (sign_extend:SI (match_operand:HI 2 "general_operand" "g")))))] ! "TARGET_45" ! "operands[3] = gen_reg_rtx (SImode);") ! ! (define_expand "udivqi" ! [(set (subreg:HI (match_dup 3) 1) ! (zero_extend:HI (match_operand:QI 1 "general_operand" "g"))) ! (set (subreg:HI (match_dup 3) 0) ! (const_int 0)) ! (set (match_dup 4) ! (sign_extend:HI (match_operand:QI 2 "general_operand" "g"))) ! (set (match_dup 5) ! (and:HI (match_dup 4) ! (const_int 255))) ! (set (match_dup 6) ! (truncate:HI ! (div:SI ! (match_dup 3) ! (sign_extend:SI (match_dup 5))))) ! (set (match_operand:QI 0 "general_operand" "g") ! (truncate:QI (match_dup 6)))] ! "TARGET_45" ! " ! { ! operands[3] = gen_reg_rtx (SImode); ! operands[4] = gen_reg_rtx (HImode); ! operands[5] = gen_reg_rtx (HImode); ! operands[6] = gen_reg_rtx (HImode); ! }") ! ! ;; we must restrict it to divide by 15-bit constant... ! (define_expand "udivhi3" ! [(set (subreg:HI (match_dup 3) 1) ! (match_operand:HI 1 "general_operand" "g")) ! (set (subreg:HI (match_dup 3) 0) ! (const_int 0)) ! (set (match_operand:HI 0 "general_operand" "g") ! (truncate:HI ! (div:SI ! (match_dup 3) ! (sign_extend:SI (match_operand:HI 2 "immediate15_operand" "n")))))] ! "TARGET_45" ! " ! { ! operands[3] = gen_reg_rtx (SImode); ! ! if (GET_CODE (operands[2]) != CONST_INT ! || ((INTVAL (operands[2]) & 0x8000) != 0x0000)) ! FAIL; ! }") ! ! (define_insn "" ! [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r,r") 1) ! (truncate:HI ! (mod:SI ! (match_operand:SI 1 "general_operand" "0,0") ! (sign_extend:SI (match_operand:HI 2 "nonimmediate_operand" "rR,Q")))))] "TARGET_45" ! "div %2,%0" ! [(set_attr "length" "1,2")]) - ;; (sign_extend:SI (const_int )) - ; w/o -O - (define_insn "" - [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 1) - (truncate:HI - (mod:SI - (match_operand:SI 1 "general_operand" "0") - (sign_extend:SI (match_operand 2 "immediate_operand" "i")))))] - "TARGET_45" - "div %2,%0" - [(set_attr "length" "2")]) - ; w/ -O (define_insn "" ! [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 1) ! (truncate:HI ! (mod:SI ! (match_operand:SI 1 "general_operand" "0") ! (match_operand:SI 2 "immediate_operand" "i"))))] "TARGET_45" "div %2,%0" --- 1756,1773 ---- [(set_attr "length" "1,2,5")]) ! (define_expand "divhi3" ! [(set (subreg:HI (match_dup 1) 0) ! (div:HI (match_operand:SI 1 "general_operand" "0") ! (match_operand:HI 2 "general_operand" "g"))) ! (set (match_operand:HI 0 "general_operand" "=r") ! (subreg:HI (match_dup 1) 0))] "TARGET_45" ! "") (define_insn "" ! [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0) ! (div:HI (match_operand:SI 1 "general_operand" "0") ! (match_operand:HI 2 "general_operand" "g")))] "TARGET_45" "div %2,%0" *************** *** 1835,1978 **** (define_expand "modhi3" ! [(set (match_dup 3) ! (sign_extend:SI (match_operand:HI 1 "general_operand" "g"))) ! (set (subreg:HI (match_dup 3) 1) ! (truncate:HI ! (mod:SI ! (match_dup 3) ! (sign_extend:SI (match_operand:HI 2 "general_operand" "g"))))) ! (set (match_operand:HI 0 "general_operand" "g") ! (subreg:HI (match_dup 3) 1))] "TARGET_45" ! "operands[3] = gen_reg_rtx (SImode);") ! ! ;; we must restrict it to mod by 15 bit constant ! (define_expand "umodhi3" ! [(set (subreg:HI (match_dup 3) 0) ! (match_operand:HI 1 "general_operand" "g")) ! (set (subreg:HI (match_dup 3) 1) ! (const_int 0)) ! (set (subreg:HI (match_dup 3) 1) ! (truncate:HI ! (mod:SI ! (match_dup 3) ! (sign_extend:SI (match_operand:HI 2 "immediate15_operand" "n"))))) ! (set (match_operand:HI 0 "general_operand" "g") ! (subreg:HI (match_dup 3) 1))] ! "TARGET_45" ! " ! { ! operands[3] = gen_reg_rtx (SImode); ! ! if (GET_CODE (operands[2]) != CONST_INT ! || ((INTVAL (operands[2]) & 0x8000) != 0x0000)) ! FAIL; ! }") ! ! (define_insn "" ! [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r,r") 0) ! (truncate:HI ! (div:SI ! (match_operand:SI 1 "general_operand" "0,0") ! (sign_extend:SI (match_operand:HI 2 "nonimmediate_operand" "rR,Q"))))) ! (set (subreg:HI (match_dup 0) 1) ! (truncate:HI ! (mod:SI ! (match_dup 1) ! (sign_extend:SI (match_dup 2)))))] ! "TARGET_45" ! "div %2, %0" ! [(set_attr "length" "1,2")]) - ;; (sign_extend:SI (const_int)) - ; w/o -O (define_insn "" ! [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0) ! (truncate:HI ! (div:SI ! (match_operand:SI 1 "general_operand" "0") ! (sign_extend:SI (match_operand 2 "immediate_operand" "i"))))) ! (set (subreg:HI (match_dup 0) 1) ! (truncate:HI ! (mod:SI ! (match_dup 1) ! (sign_extend:SI (match_dup 2)))))] ! "TARGET_45" ! "div %2, %0" ! [(set_attr "length" "2")]) ! ; w/ -O ! (define_insn "" ! [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0) ! (truncate:HI ! (div:SI ! (match_operand:SI 1 "general_operand" "0") ! (match_operand:SI 2 "immediate_operand" "i")))) ! (set (subreg:HI (match_dup 0) 1) ! (truncate:HI ! (mod:SI ! (match_dup 1) ! (match_dup 2))))] "TARGET_45" ! "div %2, %0" [(set_attr "length" "2")]) ! (define_expand "divmodhi4" ! [(set (match_dup 4) ! (sign_extend:SI (match_operand:HI 1 "general_operand" "g"))) ! (set (subreg:HI (match_dup 4) 0) ! (truncate:HI ! (div:SI ! (match_dup 4) ! (sign_extend:SI (match_operand:HI 2 "general_operand" "g"))))) ! (set (subreg:HI (match_dup 4) 1) ! (truncate:HI ! (mod:SI ! (match_dup 4) ! (sign_extend:SI (match_dup 2))))) ! (set (match_operand:HI 0 "general_operand" "g") ! (subreg:HI (match_dup 4) 0)) ! (set (match_operand:HI 3 "general_operand" "g") ! (subreg:HI (match_dup 4) 1))] ! "TARGET_45" ! "operands[4] = gen_reg_rtx(SImode);") ! ! (define_expand "udivmodhi4" ! [(set (subreg:HI (match_dup 3) 1) ! (match_operand:HI 1 "general_operand" "g")) ! (set (subreg:HI (match_dup 3) 0) ! (const_int 0)) ! (set (subreg:HI (match_dup 4) 0) ! (truncate:HI ! (div:SI ! (match_dup 4) ! (sign_extend:SI (match_operand:HI 2 "immediate15_operand" "n"))))) ! (set (subreg:HI (match_dup 4) 1) ! (truncate:HI ! (mod:SI ! (match_dup 4) ! (sign_extend:SI (match_dup 2))))) ! (set (match_operand:HI 0 "general_operand" "g") ! (subreg:HI (match_dup 4) 0)) ! (set (match_operand:HI 3 "general_operand" "g") ! (subreg:HI (match_dup 4) 1))] ! "TARGET_45" ! " ! { ! operands[3] = gen_reg_rtx (SImode); ! ! if (GET_CODE (operands[2]) != CONST_INT ! || ((INTVAL (operands[2]) & 0x8000) != 0x0000)) ! FAIL; ! }") ! ! ;; truncate used in div/mod patterns ! (define_insn "" ! [(set (match_operand:QI 0 "general_operand" "=r,r") ! (truncate:QI (match_operand:HI 1 "general_operand" "0,r")))] ! "TARGET_45" ! "@ ! ; nop ! movb %1, %0" ! [(set_attr "length" "0,1")]) ;; is rotate doing the right thing to be included here ???? --- 1775,1818 ---- (define_expand "modhi3" ! [(set (subreg:HI (match_dup 1) 1) ! (mod:HI (match_operand:SI 1 "general_operand" "0") ! (match_operand:HI 2 "general_operand" "g"))) ! (set (match_operand:HI 0 "general_operand" "=r") ! (subreg:HI (match_dup 1) 1))] "TARGET_45" ! "") (define_insn "" ! [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 1) ! (mod:HI (match_operand:SI 1 "general_operand" "0") ! (match_operand:HI 2 "general_operand" "g")))] "TARGET_45" ! "div %2,%0" [(set_attr "length" "2")]) ! ;(define_expand "divmodhi4" ! ; [(parallel [(set (subreg:HI (match_dup 1) 0) ! ; (div:HI (match_operand:SI 1 "general_operand" "0") ! ; (match_operand:HI 2 "general_operand" "g"))) ! ; (set (subreg:HI (match_dup 1) 1) ! ; (mod:HI (match_dup 1) ! ; (match_dup 2)))]) ! ; (set (match_operand:HI 3 "general_operand" "=r") ! ; (subreg:HI (match_dup 1) 1)) ! ; (set (match_operand:HI 0 "general_operand" "=r") ! ; (subreg:HI (match_dup 1) 0))] ! ; "TARGET_45" ! ; "") ! ; ! ;(define_insn "" ! ; [(set (subreg:HI (match_operand:SI 0 "general_operand" "=r") 0) ! ; (div:HI (match_operand:SI 1 "general_operand" "0") ! ; (match_operand:HI 2 "general_operand" "g"))) ! ; (set (subreg:HI (match_dup 0) 1) ! ; (mod:HI (match_dup 1) ! ; (match_dup 2)))] ! ; "TARGET_45" ! ; "div %2, %0") ! ; ;; is rotate doing the right thing to be included here ???? diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pdp11/t-pdp11 gcc-2.7.1/config/pdp11/t-pdp11 *** gcc-2.7.0/config/pdp11/t-pdp11 --- gcc-2.7.1/config/pdp11/t-pdp11 Sun Aug 13 15:40:25 1995 *************** *** 0 **** --- 1,8 ---- + LIBGCC1 = libgcc1.null + CROSS_LIBGCC1 = libgcc1.null + + # forget the libgcc1... + LIBGCC1_TEST = + + TARGET_LIBGCC2_CFLAGS = -O2 -mfloat32 + #LIB2FUNCS_EXTRA = diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pdp11/xm-pdp11.h gcc-2.7.1/config/pdp11/xm-pdp11.h *** gcc-2.7.0/config/pdp11/xm-pdp11.h Thu Jun 15 16:03:19 1995 --- gcc-2.7.1/config/pdp11/xm-pdp11.h Sat Jul 29 10:05:52 1995 *************** *** 1,4 **** /* Configuration for GNU C-compiler for pdp-11 family. ! Copyright (C) 1994 Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). --- 1,4 ---- /* Configuration for GNU C-compiler for pdp-11 family. ! Copyright (C) 1994, 1995 Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). *************** *** 20,28 **** Boston, MA 02111-1307, USA. */ ! /* ???? */ ! /* xm is if you want to run gcc here ??? */ ! /* too big !!! */ ! #error YOU LOSE! Gcc cannot run on a pdp-11 due to size problems! ! ! --- 20,27 ---- Boston, MA 02111-1307, USA. */ ! /* gcc can never run on a PDP, since it needs too much memory */ ! /* but we need the xm-pdp.h file to compile libgcc2 */ ! /* target machine dependencies. ! tm.h is a symbolic link to the actual target specific file. */ ! #include "tm.h" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pyr/pyr.h gcc-2.7.1/config/pyr/pyr.h *** gcc-2.7.0/config/pyr/pyr.h Thu Jun 15 16:03:55 1995 --- gcc-2.7.1/config/pyr/pyr.h Fri Sep 22 18:26:35 1995 *************** *** 1319,1323 **** #define PRINT_OPERAND(FILE, X, CODE) \ { if (GET_CODE (X) == REG) \ ! fprintf (FILE, "%s", reg_names [REGNO (X)]); \ \ else if (GET_CODE (X) == MEM) \ --- 1319,1323 ---- #define PRINT_OPERAND(FILE, X, CODE) \ { if (GET_CODE (X) == REG) \ ! fprintf (FILE, "%s", reg_names [REGNO (X) + ((CODE) == 'R')]); \ \ else if (GET_CODE (X) == MEM) \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/pyr/pyr.md gcc-2.7.1/config/pyr/pyr.md *** gcc-2.7.0/config/pyr/pyr.md Thu Jun 15 16:55:53 1995 --- gcc-2.7.1/config/pyr/pyr.md Wed Sep 20 14:20:37 1995 *************** *** 1,4 **** ;; GNU C machine description for Pyramid 90x, 9000, MIServer Series ! ;; Copyright (C) 1989, 1990 Free Software Foundation, Inc. ;; This file is part of GNU CC. --- 1,4 ---- ;; GNU C machine description for Pyramid 90x, 9000, MIServer Series ! ;; Copyright (C) 1989, 1990, 1995 Free Software Foundation, Inc. ;; This file is part of GNU CC. *************** *** 225,229 **** (match_operand:HI 1 "nonimmediate_operand" "m,r")))] "(!TRULY_UNSIGNED_COMPARE_P (GET_CODE (XEXP (SET_SRC (PATTERN (NEXT_INSN (insn))), 0)))) ! && (GET_CODE (operands[0]) != GET_CODE (operands[1]))" "* { --- 225,229 ---- (match_operand:HI 1 "nonimmediate_operand" "m,r")))] "(!TRULY_UNSIGNED_COMPARE_P (GET_CODE (XEXP (SET_SRC (PATTERN (NEXT_INSN (insn))), 0)))) ! && ((GET_CODE (operands[0]) == MEM) != (GET_CODE (operands[1]) == MEM))" "* { *************** *** 307,311 **** (compare (match_operand:QI 0 "nonimmediate_operand" "r,m") (match_operand:QI 1 "nonimmediate_operand" "m,r")))] ! "(GET_CODE (operands[0]) != GET_CODE (operands[1]))" "* { --- 307,311 ---- (compare (match_operand:QI 0 "nonimmediate_operand" "r,m") (match_operand:QI 1 "nonimmediate_operand" "m,r")))] ! "((GET_CODE (operands[0]) == MEM) != (GET_CODE (operands[1]) == MEM))" "* { diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/aix3newas.h gcc-2.7.1/config/rs6000/aix3newas.h *** gcc-2.7.0/config/rs6000/aix3newas.h Thu Jun 15 16:26:44 1995 --- gcc-2.7.1/config/rs6000/aix3newas.h Fri Jul 21 14:18:59 1995 *************** *** 27,31 **** #undef ASM_SPEC ! #define ASM_SPEC "-u" /* These are not necessary when we pass -u to the assembler, and undefining --- 27,73 ---- #undef ASM_SPEC ! #define ASM_SPEC "-u \ ! %{!mcpu*: \ ! %{mpower: %{!mpowerpc*: %{!mpower2: -mpwr}}} \ ! %{mpower2: -mpwrx} \ ! %{mno-power: %{mpowerpc*: -mppc}} \ ! %{mno-power: %{!mpowerpc*: -mcom}} \ ! %{!mno-power: %{mpowerpc*: -m601}} \ ! %{!mno-power: %{!mpowerpc*: %{!mpower2: -mpwr}}}} \ ! %{mcpu=common: -mcom} \ ! %{mcpu=power: -mpwr} \ ! %{mcpu=powerpc: -mppc} \ ! %{mcpu=rios: -mpwr} \ ! %{mcpu=rios1: -mpwr} \ ! %{mcpu=rios2: -mpwrx} \ ! %{mcpu=rsc: -mpwr} \ ! %{mcpu=rsc1: -mpwr} \ ! %{mcpu=403: -mppc} \ ! %{mcpu=601: -m601} \ ! %{mcpu=603: -mppc} \ ! %{mcpu=604: -mppc}" ! ! /* Define the options for the binder: Start text at 512, align all segments ! to 512 bytes, and warn if there is text relocation. ! ! The -bhalt:4 option supposedly changes the level at which ld will abort, ! but it also suppresses warnings about multiply defined symbols and is ! used by the AIX cc command. So we use it here. ! ! -bnodelcsect undoes a poor choice of default relating to multiply-defined ! csects. See AIX documentation for more information about this. ! ! -bM:SRE tells the linker that the output file is Shared REusable. Note ! that to actually build a shared library you will also need to specify an ! export list with the -Wl,-bE option. ! ! If -mcpu=common, export the architecture dependent multiply/divide routines ! as per README.RS6000. */ ! ! #undef LINK_SPEC ! #define LINK_SPEC "-T512 -H512 %{!r:-btextro} -bhalt:4 -bnodelcsect\ ! %{static:-bnso -bI:/lib/syscalls.exp} \ ! %{mcpu=common: milli.exp%s} \ ! %{!shared:%{g*:-bexport:/usr/lib/libg.exp}} %{shared:-bM:SRE}" /* These are not necessary when we pass -u to the assembler, and undefining diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/aix41.h gcc-2.7.1/config/rs6000/aix41.h *** gcc-2.7.0/config/rs6000/aix41.h Thu Jun 15 16:26:51 1995 --- gcc-2.7.1/config/rs6000/aix41.h Fri Jul 21 14:19:00 1995 *************** *** 1,5 **** /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX version 4.1. ! Copyright (C) 1994 Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@npac.syr.edu). --- 1,5 ---- /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX version 4.1. ! Copyright (C) 1994, 1995 Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@npac.syr.edu). *************** *** 25,29 **** #undef ASM_SPEC ! #define ASM_SPEC "-u -mpwr" /* These are not necessary when we pass -u to the assembler, and undefining --- 25,48 ---- #undef ASM_SPEC ! #define ASM_SPEC "-u \ ! %{!mcpu*: \ ! %{mpower: %{!mpowerpc*: %{!mpower2: -mpwr}}} \ ! %{mpower2: -mpwrx} \ ! %{mno-power: %{mpowerpc*: -mppc}} \ ! %{mno-power: %{!mpowerpc*: -mcom}} \ ! %{!mno-power: %{mpowerpc*: -m601}} \ ! %{!mno-power: %{!mpowerpc*: %{!mpower2: -mpwr}}}} \ ! %{mcpu=common: -mcom} \ ! %{mcpu=power: -mpwr} \ ! %{mcpu=powerpc: -mppc} \ ! %{mcpu=rios: -mpwr} \ ! %{mcpu=rios1: -mpwr} \ ! %{mcpu=rios2: -mpwrx} \ ! %{mcpu=rsc: -mpwr} \ ! %{mcpu=rsc1: -mpwr} \ ! %{mcpu=403: -mppc} \ ! %{mcpu=601: -m601} \ ! %{mcpu=603: -mppc} \ ! %{mcpu=604: -mppc}" /* These are not necessary when we pass -u to the assembler, and undefining diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/eabi.asm gcc-2.7.1/config/rs6000/eabi.asm *** gcc-2.7.0/config/rs6000/eabi.asm Tue May 16 07:33:05 1995 --- gcc-2.7.1/config/rs6000/eabi.asm Tue Jul 25 10:18:49 1995 *************** *** 28,31 **** --- 28,37 ---- .long _GOT2_END_ # -mrelocatable GOT pointers end + .Lfixups = .-.LCTOC1 + .long _FIXUP_START_ # start of .fixup section + + .Lfixupe = .-.LCTOC1 + .long _FIXUP_END_ # end of .fixup section + .text .Lptr: *************** *** 53,57 **** # Normal program, load up register 2 ! lwz 2,.Lgot(11) # normal GOT address b __do_global_ctors # do any C++ global constructors (which returns to caller) --- 59,64 ---- # Normal program, load up register 2 ! lwz 2,.Lgot(11) # normal GOT address (obsolete in register 2) ! mr 13,2 # also same as _SDA_BASE_ (V.4 small data ptr) b __do_global_ctors # do any C++ global constructors (which returns to caller) *************** *** 65,74 **** cmpw 1,3,4 # any pointers to adjust ! bc 12,6,.Ldone .Lloop: ! lwz 11,0(3) # next pointer ! add 11,11,12 # adjust ! stw 11,0(3) addi 3,3,4 # bump to next word cmpw 1,3,4 # more pointers to adjust? --- 72,81 ---- cmpw 1,3,4 # any pointers to adjust ! bc 12,6,.Lfix .Lloop: ! lwz 5,0(3) # next pointer ! add 5,5,12 # adjust ! stw 5,0(3) addi 3,3,4 # bump to next word cmpw 1,3,4 # more pointers to adjust? *************** *** 75,78 **** --- 82,105 ---- bc 4,6,.Lloop + # Fixup any user initialized pointers now (the compiler drops pointers to + # each of the relocs that it does in the .fixup section). Note, the pointers + # themselves have already been fixed up by the previous loop. + + .Lfix: + lwz 3,.Lfixups(11) # fixup pointers start + lwz 4,.Lfixupe(11) # fixup pointers end + + cmpw 1,3,4 # any user pointers to adjust + bc 12,6,.Ldone + + .Lfloop: + lwz 5,0(3) # next pointer + lwz 6,0(5) # get the pointer it points to + add 6,6,12 # adjust + stw 6,0(5) + addi 3,3,4 # bump to next word + cmpw 1,3,4 # more pointers to adjust? + bc 4,6,.Lfloop + # Done adjusting pointers, return *************** *** 84,128 **** # function, just beyond the end of the floating point save area. ! .globl _savefpr_14_l ! .globl _savefpr_15_l ! .globl _savefpr_16_l ! .globl _savefpr_17_l ! .globl _savefpr_18_l ! .globl _savefpr_19_l ! .globl _savefpr_20_l ! .globl _savefpr_21_l ! .globl _savefpr_22_l ! .globl _savefpr_23_l ! .globl _savefpr_24_l ! .globl _savefpr_25_l ! .globl _savefpr_26_l ! .globl _savefpr_27_l ! .globl _savefpr_28_l ! .globl _savefpr_29_l ! .globl _savefpr_30_l ! .globl _savefpr_31_l .long 0x00400000 # traceback tag ! _savefpr_14_l: stfd 14,-144(11) # save fp registers ! _savefpr_15_l: stfd 15,-136(11) ! _savefpr_16_l: stfd 16,-128(11) ! _savefpr_17_l: stfd 17,-120(11) ! _savefpr_18_l: stfd 18,-112(11) ! _savefpr_19_l: stfd 19,-104(11) ! _savefpr_20_l: stfd 20,-96(11) ! _savefpr_21_l: stfd 21,-88(11) ! _savefpr_22_l: stfd 22,-80(11) ! _savefpr_23_l: stfd 23,-72(11) ! _savefpr_24_l: stfd 24,-64(11) ! _savefpr_25_l: stfd 25,-56(11) ! _savefpr_26_l: stfd 26,-48(11) ! _savefpr_27_l: stfd 27,-40(11) ! _savefpr_28_l: stfd 28,-32(11) ! _savefpr_29_l: stfd 29,-24(11) ! _savefpr_30_l: stfd 30,-16(11) ! _savefpr_31_l: stfd 31,-8(11) ! stw 0,4(11) # save return address also blr # Routines for restoring floating point registers, called by the compiler. --- 111,285 ---- # function, just beyond the end of the floating point save area. ! .globl _savefpr_14 ! .globl _savefpr_15 ! .globl _savefpr_16 ! .globl _savefpr_17 ! .globl _savefpr_18 ! .globl _savefpr_19 ! .globl _savefpr_20 ! .globl _savefpr_21 ! .globl _savefpr_22 ! .globl _savefpr_23 ! .globl _savefpr_24 ! .globl _savefpr_25 ! .globl _savefpr_26 ! .globl _savefpr_27 ! .globl _savefpr_28 ! .globl _savefpr_29 ! .globl _savefpr_30 ! .globl _savefpr_31 .long 0x00400000 # traceback tag ! _savefpr_14: stfd 14,-144(11) # save fp registers ! _savefpr_15: stfd 15,-136(11) ! _savefpr_16: stfd 16,-128(11) ! _savefpr_17: stfd 17,-120(11) ! _savefpr_18: stfd 18,-112(11) ! _savefpr_19: stfd 19,-104(11) ! _savefpr_20: stfd 20,-96(11) ! _savefpr_21: stfd 21,-88(11) ! _savefpr_22: stfd 22,-80(11) ! _savefpr_23: stfd 23,-72(11) ! _savefpr_24: stfd 24,-64(11) ! _savefpr_25: stfd 25,-56(11) ! _savefpr_26: stfd 26,-48(11) ! _savefpr_27: stfd 27,-40(11) ! _savefpr_28: stfd 28,-32(11) ! _savefpr_29: stfd 29,-24(11) ! _savefpr_30: stfd 30,-16(11) ! _savefpr_31: stfd 31,-8(11) ! blr ! ! # Routines for saving integer registers, called by the compiler. ! # Called with r11 pointing to the stack header word of the caller of the ! # function, just beyond the end of the integer save area. ! ! .globl _savegpr_14 ! .globl _savegpr_15 ! .globl _savegpr_16 ! .globl _savegpr_17 ! .globl _savegpr_18 ! .globl _savegpr_19 ! .globl _savegpr_20 ! .globl _savegpr_21 ! .globl _savegpr_22 ! .globl _savegpr_23 ! .globl _savegpr_24 ! .globl _savegpr_25 ! .globl _savegpr_26 ! .globl _savegpr_27 ! .globl _savegpr_28 ! .globl _savegpr_29 ! .globl _savegpr_30 ! .globl _savegpr_31 ! ! .long 0x00400000 # traceback tag ! _savegpr_14: stw 14,-72(11) # save gp registers ! _savegpr_15: stw 15,-68(11) ! _savegpr_16: stw 16,-64(11) ! _savegpr_17: stw 17,-60(11) ! _savegpr_18: stw 18,-56(11) ! _savegpr_19: stw 19,-52(11) ! _savegpr_20: stw 20,-48(11) ! _savegpr_21: stw 21,-44(11) ! _savegpr_22: stw 22,-40(11) ! _savegpr_23: stw 23,-36(11) ! _savegpr_24: stw 24,-32(11) ! _savegpr_25: stw 25,-28(11) ! _savegpr_26: stw 26,-24(11) ! _savegpr_27: stw 27,-20(11) ! _savegpr_28: stw 28,-16(11) ! _savegpr_29: stw 29,-12(11) ! _savegpr_30: stw 30,-8(11) ! _savegpr_31: stw 31,-4(11) ! blr ! ! # Routines for restoring floating point registers, called by the compiler. ! # Called with r11 pointing to the stack header word of the caller of the ! # function, just beyond the end of the floating point save area. ! ! .globl _restfpr_14 ! .globl _restfpr_15 ! .globl _restfpr_16 ! .globl _restfpr_17 ! .globl _restfpr_18 ! .globl _restfpr_19 ! .globl _restfpr_20 ! .globl _restfpr_21 ! .globl _restfpr_22 ! .globl _restfpr_23 ! .globl _restfpr_24 ! .globl _restfpr_25 ! .globl _restfpr_26 ! .globl _restfpr_27 ! .globl _restfpr_28 ! .globl _restfpr_29 ! .globl _restfpr_30 ! .globl _restfpr_31 ! ! .long 0x00600000 # traceback tag ! _restfpr_14: lfd 14,-144(11) # restore fp registers ! _restfpr_15: lfd 15,-136(11) ! _restfpr_16: lfd 16,-128(11) ! _restfpr_17: lfd 17,-120(11) ! _restfpr_18: lfd 18,-112(11) ! _restfpr_19: lfd 19,-104(11) ! _restfpr_20: lfd 20,-96(11) ! _restfpr_21: lfd 21,-88(11) ! _restfpr_22: lfd 22,-80(11) ! _restfpr_23: lfd 23,-72(11) ! _restfpr_24: lfd 24,-64(11) ! _restfpr_25: lfd 25,-56(11) ! _restfpr_26: lfd 26,-48(11) ! _restfpr_27: lfd 27,-40(11) ! _restfpr_28: lfd 28,-32(11) ! _restfpr_29: lfd 29,-24(11) ! _restfpr_30: lfd 30,-16(11) ! _restfpr_31: lfd 31,-8(11) blr + # Routines for restoring integer registers, called by the compiler. + # Called with r11 pointing to the stack header word of the caller of the + # function, just beyond the end of the integer restore area. + + .globl _restgpr_14 + .globl _restgpr_15 + .globl _restgpr_16 + .globl _restgpr_17 + .globl _restgpr_18 + .globl _restgpr_19 + .globl _restgpr_20 + .globl _restgpr_21 + .globl _restgpr_22 + .globl _restgpr_23 + .globl _restgpr_24 + .globl _restgpr_25 + .globl _restgpr_26 + .globl _restgpr_27 + .globl _restgpr_28 + .globl _restgpr_29 + .globl _restgpr_30 + .globl _restgpr_31 + + .long 0x00600000 # traceback tag + _restgpr_14: lwz 14,-72(11) # rest gp registers + _restgpr_15: lwz 15,-68(11) + _restgpr_16: lwz 16,-64(11) + _restgpr_17: lwz 17,-60(11) + _restgpr_18: lwz 18,-56(11) + _restgpr_19: lwz 19,-52(11) + _restgpr_20: lwz 20,-48(11) + _restgpr_21: lwz 21,-44(11) + _restgpr_22: lwz 22,-40(11) + _restgpr_23: lwz 23,-36(11) + _restgpr_24: lwz 24,-32(11) + _restgpr_25: lwz 25,-28(11) + _restgpr_26: lwz 26,-24(11) + _restgpr_27: lwz 27,-20(11) + _restgpr_28: lwz 28,-16(11) + _restgpr_29: lwz 29,-12(11) + _restgpr_30: lwz 30,-8(11) + _restgpr_31: lwz 31,-4(11) + blr # Routines for restoring floating point registers, called by the compiler. *************** *** 129,172 **** # Called with r11 pointing to the stack header word of the caller of the # function, just beyond the end of the floating point save area. ! .globl _restfpr_14_l ! .globl _restfpr_15_l ! .globl _restfpr_16_l ! .globl _restfpr_17_l ! .globl _restfpr_18_l ! .globl _restfpr_19_l ! .globl _restfpr_20_l ! .globl _restfpr_21_l ! .globl _restfpr_22_l ! .globl _restfpr_23_l ! .globl _restfpr_24_l ! .globl _restfpr_25_l ! .globl _restfpr_26_l ! .globl _restfpr_27_l ! .globl _restfpr_28_l ! .globl _restfpr_29_l ! .globl _restfpr_30_l ! .globl _restfpr_31_l .long 0x00600000 # traceback tag ! _restfpr_14_l: lfd 14,-144(11) # restore fp registers ! _restfpr_15_l: lfd 15,-136(11) ! _restfpr_16_l: lfd 16,-128(11) ! _restfpr_17_l: lfd 17,-120(11) ! _restfpr_18_l: lfd 18,-112(11) ! _restfpr_19_l: lfd 19,-104(11) ! _restfpr_20_l: lfd 20,-96(11) ! _restfpr_21_l: lfd 21,-88(11) ! _restfpr_22_l: lfd 22,-80(11) ! _restfpr_23_l: lfd 23,-72(11) ! _restfpr_24_l: lfd 24,-64(11) ! _restfpr_25_l: lfd 25,-56(11) ! _restfpr_26_l: lfd 26,-48(11) ! _restfpr_27_l: lfd 27,-40(11) ! _restfpr_28_l: lfd 28,-32(11) ! _restfpr_29_l: lfd 29,-24(11) ! _restfpr_30_l: lfd 30,-16(11) ! _restfpr_31_l: lwz 0,4(11) # caller's caller address lfd 31,-8(11) mtlr 0 mr 1,11 --- 286,378 ---- # Called with r11 pointing to the stack header word of the caller of the # function, just beyond the end of the floating point save area. + # In addition to restoring the fp registers, it will return to the caller's + # caller ! .globl _restfpr_14_x ! .globl _restfpr_15_x ! .globl _restfpr_16_x ! .globl _restfpr_17_x ! .globl _restfpr_18_x ! .globl _restfpr_19_x ! .globl _restfpr_20_x ! .globl _restfpr_21_x ! .globl _restfpr_22_x ! .globl _restfpr_23_x ! .globl _restfpr_24_x ! .globl _restfpr_25_x ! .globl _restfpr_26_x ! .globl _restfpr_27_x ! .globl _restfpr_28_x ! .globl _restfpr_29_x ! .globl _restfpr_30_x ! .globl _restfpr_31_x .long 0x00600000 # traceback tag ! _restfpr_14_x: lfd 14,-144(11) # restore fp registers ! _restfpr_15_x: lfd 15,-136(11) ! _restfpr_16_x: lfd 16,-128(11) ! _restfpr_17_x: lfd 17,-120(11) ! _restfpr_18_x: lfd 18,-112(11) ! _restfpr_19_x: lfd 19,-104(11) ! _restfpr_20_x: lfd 20,-96(11) ! _restfpr_21_x: lfd 21,-88(11) ! _restfpr_22_x: lfd 22,-80(11) ! _restfpr_23_x: lfd 23,-72(11) ! _restfpr_24_x: lfd 24,-64(11) ! _restfpr_25_x: lfd 25,-56(11) ! _restfpr_26_x: lfd 26,-48(11) ! _restfpr_27_x: lfd 27,-40(11) ! _restfpr_28_x: lfd 28,-32(11) ! _restfpr_29_x: lfd 29,-24(11) ! _restfpr_30_x: lfd 30,-16(11) ! _restfpr_31_x: lwz 0,4(11) lfd 31,-8(11) + mtlr 0 + mr 1,11 + blr + + # Routines for restoring integer registers, called by the compiler. + # Called with r11 pointing to the stack header word of the caller of the + # function, just beyond the end of the integer restore area. + + .globl _restgpr_14_x + .globl _restgpr_15_x + .globl _restgpr_16_x + .globl _restgpr_17_x + .globl _restgpr_18_x + .globl _restgpr_19_x + .globl _restgpr_20_x + .globl _restgpr_21_x + .globl _restgpr_22_x + .globl _restgpr_23_x + .globl _restgpr_24_x + .globl _restgpr_25_x + .globl _restgpr_26_x + .globl _restgpr_27_x + .globl _restgpr_28_x + .globl _restgpr_29_x + .globl _restgpr_30_x + .globl _restgpr_31_x + + .long 0x00600000 # traceback tag + _restgpr_14_x: lwz 14,-72(11) # rest gp registers + _restgpr_15_x: lwz 15,-68(11) + _restgpr_16_x: lwz 16,-64(11) + _restgpr_17_x: lwz 17,-60(11) + _restgpr_18_x: lwz 18,-56(11) + _restgpr_19_x: lwz 19,-52(11) + _restgpr_20_x: lwz 20,-48(11) + _restgpr_21_x: lwz 21,-44(11) + _restgpr_22_x: lwz 22,-40(11) + _restgpr_23_x: lwz 23,-36(11) + _restgpr_24_x: lwz 24,-32(11) + _restgpr_25_x: lwz 25,-28(11) + _restgpr_26_x: lwz 26,-24(11) + _restgpr_27_x: lwz 27,-20(11) + _restgpr_28_x: lwz 28,-16(11) + _restgpr_29_x: lwz 29,-12(11) + _restgpr_30_x: lwz 30,-8(11) + _restgpr_31_x: lwz 0,4(11) + lwz 31,-4(11) mtlr 0 mr 1,11 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/eabi.h gcc-2.7.1/config/rs6000/eabi.h *** gcc-2.7.0/config/rs6000/eabi.h Thu Jun 15 16:27:25 1995 --- gcc-2.7.1/config/rs6000/eabi.h Fri Sep 22 18:50:03 1995 *************** *** 34,40 **** /* Define this macro to be the value 1 if instructions will fail to work if given data not on the nominal alignment. If instructions ! will merely go slower in that case, define this macro as 0. */ #undef STRICT_ALIGNMENT ! #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN) /* Align stack to 8 byte boundaries, rather than 16 bytes Sys V.4 uses */ --- 34,43 ---- /* Define this macro to be the value 1 if instructions will fail to work if given data not on the nominal alignment. If instructions ! will merely go slower in that case, define this macro as 0. ! ! Note, little endian systems trap on unaligned addresses, so never ! turn off strict alignment in that case. */ #undef STRICT_ALIGNMENT ! #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN || TARGET_LITTLE_ENDIAN) /* Align stack to 8 byte boundaries, rather than 16 bytes Sys V.4 uses */ *************** *** 51,54 **** --- 54,62 ---- ((TARGET_RELOCATABLE) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"") + /* Put relocatable data in .data, not .rodata so initialized pointers can be updated */ + #undef CONST_SECTION_ASM_OP + #define CONST_SECTION_ASM_OP \ + ((TARGET_RELOCATABLE) ? "\t.section\t\".data\"\t# .rodata" : "\t.section\t\".rodata\"") + /* Invoke an initializer function to set up the GOT */ #define NAME__MAIN "__eabi" *************** *** 74,76 **** --- 82,125 ---- #undef ENDFILE_SPEC #define ENDFILE_SPEC "" + + /* This is how to output an assembler line defining an `int' constant. + For -mrelocatable, we mark all addresses that need to be fixed up + in the .fixup section. */ + #undef ASM_OUTPUT_INT + #define ASM_OUTPUT_INT(FILE,VALUE) \ + do { \ + static int recurse = 0; \ + if (TARGET_RELOCATABLE \ + && in_section != in_toc \ + && in_section != in_text \ + && in_section != in_ctors \ + && in_section != in_dtors \ + && !recurse \ + && GET_CODE (VALUE) != CONST_INT \ + && GET_CODE (VALUE) != CONST_DOUBLE \ + && CONSTANT_P (VALUE)) \ + { \ + static int labelno = 0; \ + char buf[256], *p; \ + \ + recurse = 1; \ + ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", labelno++); \ + STRIP_NAME_ENCODING (p, buf); \ + fprintf (FILE, "%s:\n", p); \ + fprintf (FILE, "\t.long ("); \ + output_addr_const (FILE, (VALUE)); \ + fprintf (FILE, ")@fixup\n"); \ + fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n"); \ + ASM_OUTPUT_ALIGN (FILE, 2); \ + fprintf (FILE, "\t.long\t%s\n", p); \ + fprintf (FILE, "\t.previous\n"); \ + recurse = 0; \ + } \ + else \ + { \ + fprintf (FILE, "\t.long "); \ + output_addr_const (FILE, (VALUE)); \ + fprintf (FILE, "\n"); \ + } \ + } while (0) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/eabiaix.h gcc-2.7.1/config/rs6000/eabiaix.h *** gcc-2.7.0/config/rs6000/eabiaix.h --- gcc-2.7.1/config/rs6000/eabiaix.h Fri Jul 21 14:19:03 1995 *************** *** 0 **** --- 1,53 ---- + /* Embedded ELF system support, using old AIX based calling sequence. + Copyright (C) 1995 Free Software Foundation, Inc. + Contributed by Cygnus Support. + + 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #include "rs6000/eabi.h" + + #undef TARGET_DEFAULT + #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_AIX_CALLS) + + #undef CPP_SPEC + #define CPP_SPEC "\ + %{posix: -D_POSIX_SOURCE} \ + %{mrelocatable: -D_RELOCATABLE} \ + %{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_AIX}} \ + %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \ + %{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \ + %{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \ + %{!mlittle: %{!mlittle-endian: -D_BIG_ENDIAN -Amachine(bigendian)}} \ + %{!mcpu*: \ + %{mpower: %{!mpower2: -D_ARCH_PWR}} \ + %{mpower2: -D_ARCH_PWR2} \ + %{mpowerpc*: -D_ARCH_PPC} \ + %{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \ + %{!mno-powerpc: -D_ARCH_PPC}} \ + %{mcpu=common: -D_ARCH_COM} \ + %{mcpu=power: -D_ARCH_PWR} \ + %{mcpu=powerpc: -D_ARCH_PPC} \ + %{mcpu=rios: -D_ARCH_PWR} \ + %{mcpu=rios1: -D_ARCH_PWR} \ + %{mcpu=rios2: -D_ARCH_PWR2} \ + %{mcpu=rsc: -D_ARCH_PWR} \ + %{mcpu=rsc1: -D_ARCH_PWR} \ + %{mcpu=403: -D_ARCH_PPC} \ + %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ + %{mcpu=603: -D_ARCH_PPC} \ + %{mcpu=604: -D_ARCH_PPC}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/eabile.h gcc-2.7.1/config/rs6000/eabile.h *** gcc-2.7.0/config/rs6000/eabile.h Thu Jun 15 16:27:36 1995 --- gcc-2.7.1/config/rs6000/eabile.h Fri Jul 21 14:19:04 1995 *************** *** 30,33 **** --- 30,35 ---- %{posix: -D_POSIX_SOURCE} \ %{mrelocatable: -D_RELOCATABLE} \ + %{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}} \ + %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \ %{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \ %{mbig-endian: -D_BIG_ENDIAN -Amachine(bigendian)} \ *************** *** 48,60 **** %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=403: -D_ARCH_PPC} \ - %{mcpu=mpc403: -D_ARCH_PPC} \ - %{mcpu=ppc403: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=mpc601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=ppc601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=603: -D_ARCH_PPC} \ ! %{mcpu=mpc603: -D_ARCH_PPC} \ ! %{mcpu=ppc603: -D_ARCH_PPC} \ ! %{mcpu=604: -D_ARCH_PPC} \ ! %{mcpu=mpc604: -D_ARCH_PPC} \ ! %{mcpu=ppc604: -D_ARCH_PPC}" --- 50,54 ---- %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=403: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=603: -D_ARCH_PPC} \ ! %{mcpu=604: -D_ARCH_PPC}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/eabilesim.h gcc-2.7.1/config/rs6000/eabilesim.h *** gcc-2.7.0/config/rs6000/eabilesim.h --- gcc-2.7.1/config/rs6000/eabilesim.h Mon Sep 11 19:19:39 1995 *************** *** 0 **** --- 1,76 ---- + /* Support for GCC on simulated PowerPC systems targeted to embedded ELF + systems. + Copyright (C) 1995 Free Software Foundation, Inc. + Contributed by Cygnus Support. + + 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #include "rs6000/eabile.h" + + /* Right now, the simulator doesn't handle floating point, so disable it + by default. */ + #undef TARGET_DEFAULT + #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_LITTLE_ENDIAN | MASK_SOFT_FLOAT) + + #undef TARGET_VERSION + #define TARGET_VERSION fprintf (stderr, " (PowerPC Simulated)"); + + #undef CPP_PREDEFINES + #define CPP_PREDEFINES \ + "-DPPC -D__embedded__ -D__simulator__ -Asystem(embedded) -Asystem(simulator) -Acpu(powerpc) -Amachine(powerpc)" + + #undef CPP_SPEC + #define CPP_SPEC "\ + %{posix: -D_POSIX_SOURCE} \ + %{mrelocatable: -D_RELOCATABLE} \ + %{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}} \ + %{!mhard-float: -D_SOFT_FLOAT} \ + %{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \ + %{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \ + %{!mlittle: %{!mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)}} \ + %{!mcpu*: \ + %{mpower: %{!mpower2: -D_ARCH_PWR}} \ + %{mpower2: -D_ARCH_PWR2} \ + %{mpowerpc*: -D_ARCH_PPC} \ + %{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \ + %{!mno-powerpc: -D_ARCH_PPC}} \ + %{mcpu=common: -D_ARCH_COM} \ + %{mcpu=power: -D_ARCH_PWR} \ + %{mcpu=powerpc: -D_ARCH_PPC} \ + %{mcpu=rios: -D_ARCH_PWR} \ + %{mcpu=rios1: -D_ARCH_PWR} \ + %{mcpu=rios2: -D_ARCH_PWR2} \ + %{mcpu=rsc: -D_ARCH_PWR} \ + %{mcpu=rsc1: -D_ARCH_PWR} \ + %{mcpu=403: -D_ARCH_PPC} \ + %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ + %{mcpu=603: -D_ARCH_PPC} \ + %{mcpu=604: -D_ARCH_PPC}" + + /* Use the simulator crt0 and libgloss/newlib libraries */ + #undef STARTFILE_SPEC + #define STARTFILE_SPEC "sim-crt0.o%s" + + #undef LIB_SPEC + #define LIB_SPEC "-lsim -lc -lsim" + + #undef LIBGCC_SPEC + #define LIBGCC_SPEC "libgcc.a%s" + + #undef ENDFILE_SPEC + #define ENDFILE_SPEC "" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/eabisim.h gcc-2.7.1/config/rs6000/eabisim.h *** gcc-2.7.0/config/rs6000/eabisim.h --- gcc-2.7.1/config/rs6000/eabisim.h Mon Sep 11 19:19:36 1995 *************** *** 0 **** --- 1,76 ---- + /* Support for GCC on simulated PowerPC systems targeted to embedded ELF + systems. + Copyright (C) 1995 Free Software Foundation, Inc. + Contributed by Cygnus Support. + + 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #include "rs6000/eabi.h" + + /* Right now, the simulator doesn't handle floating point, so disable it + by default. */ + #undef TARGET_DEFAULT + #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_SOFT_FLOAT) + + #undef TARGET_VERSION + #define TARGET_VERSION fprintf (stderr, " (PowerPC Simulated)"); + + #undef CPP_PREDEFINES + #define CPP_PREDEFINES \ + "-DPPC -D__embedded__ -D__simulator__ -Asystem(embedded) -Asystem(simulator) -Acpu(powerpc) -Amachine(powerpc)" + + #undef CPP_SPEC + #define CPP_SPEC "\ + %{posix: -D_POSIX_SOURCE} \ + %{mrelocatable: -D_RELOCATABLE} \ + %{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}} \ + %{!mhard-float: -D_SOFT_FLOAT} \ + %{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \ + %{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \ + %{!mlittle: %{!mlittle-endian: -D_BIG_ENDIAN -Amachine(bigendian)}} \ + %{!mcpu*: \ + %{mpower: %{!mpower2: -D_ARCH_PWR}} \ + %{mpower2: -D_ARCH_PWR2} \ + %{mpowerpc*: -D_ARCH_PPC} \ + %{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \ + %{!mno-powerpc: -D_ARCH_PPC}} \ + %{mcpu=common: -D_ARCH_COM} \ + %{mcpu=power: -D_ARCH_PWR} \ + %{mcpu=powerpc: -D_ARCH_PPC} \ + %{mcpu=rios: -D_ARCH_PWR} \ + %{mcpu=rios1: -D_ARCH_PWR} \ + %{mcpu=rios2: -D_ARCH_PWR2} \ + %{mcpu=rsc: -D_ARCH_PWR} \ + %{mcpu=rsc1: -D_ARCH_PWR} \ + %{mcpu=403: -D_ARCH_PPC} \ + %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ + %{mcpu=603: -D_ARCH_PPC} \ + %{mcpu=604: -D_ARCH_PPC}" + + /* Use the simulator crt0 and libgloss/newlib libraries */ + #undef STARTFILE_SPEC + #define STARTFILE_SPEC "sim-crt0.o%s" + + #undef LIB_SPEC + #define LIB_SPEC "-lsim -lc -lsim" + + #undef LIBGCC_SPEC + #define LIBGCC_SPEC "libgcc.a%s" + + #undef ENDFILE_SPEC + #define ENDFILE_SPEC "" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/milli.exp gcc-2.7.1/config/rs6000/milli.exp *** gcc-2.7.0/config/rs6000/milli.exp --- gcc-2.7.1/config/rs6000/milli.exp Fri Jul 21 14:19:06 1995 *************** *** 0 **** --- 1,7 ---- + #! + __mulh 0x3100 + __mull 0x3180 + __divss 0x3200 + __divus 0x3280 + __quoss 0x3300 + __quous 0x3380 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/netware.h gcc-2.7.1/config/rs6000/netware.h *** gcc-2.7.0/config/rs6000/netware.h --- gcc-2.7.1/config/rs6000/netware.h Sun Jul 16 20:05:48 1995 *************** *** 0 **** --- 1,274 ---- + /* Core target definitions for GNU compiler + for IBM RS/6000 PowerPC running NetWare + Copyright (C) 1994 Free Software Foundation, Inc. + Contributed by Cygnus Support. + + 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. */ + + #include "rs6000/powerpc.h" + + /* Don't generate XCOFF debugging information. */ + + #undef XCOFF_DEBUGGING_INFO + + /* Don't use the COFF object file format. */ + + #undef OBJECT_FORMAT_COFF + + /* The XCOFF support uses weird symbol suffixes, which we don't want + for ELF. */ + + #undef RS6000_OUTPUT_BASENAME + #define RS6000_OUTPUT_BASENAME(FILE, NAME) assemble_name (FILE, NAME) + + /* Don't bother to output .extern pseudo-ops. They are not needed by + ELF assemblers. */ + + #undef ASM_OUTPUT_EXTERNAL + + /* Undefine some things which are defined by the generic svr4.h. */ + + #undef ASM_FILE_END + #undef ASM_OUTPUT_EXTERNAL_LIBCALL + #undef READONLY_DATA_SECTION + #undef SELECT_SECTION + #undef ASM_DECLARE_FUNCTION_NAME + + /* Use the regular svr4 definitions. */ + + #include "svr4.h" + #include "netware.h" + + /* Create a function descriptor when we declare a function name. This + is a mixture of the ASM_DECLARE_FUNCTION_NAME macros in rs6000.h + and svr4.h. The unmodified function name is used to name the + descriptor. The function name with an initial `.' is used to name + the code. */ + + #undef ASM_DECLARE_FUNCTION_NAME + #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ + do { \ + fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ + assemble_name (FILE, NAME); \ + putc (',', FILE); \ + fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ + putc ('\n', FILE); \ + ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ + if (TREE_PUBLIC (DECL)) \ + { \ + fprintf (FILE, "\t.globl ."); \ + assemble_name (FILE, NAME); \ + fprintf (FILE, "\n"); \ + } \ + data_section (); \ + ASM_OUTPUT_ALIGN (FILE, 2); \ + ASM_OUTPUT_LABEL (FILE, NAME); \ + fprintf (FILE, "\t.long ."); \ + assemble_name (FILE, NAME); \ + fprintf (FILE, ", __GOT0, 0\n"); \ + text_section (); \ + fprintf (FILE, "."); \ + ASM_OUTPUT_LABEL (FILE, NAME); \ + } while (0) + + /* We need to override the .size output in order to put a `.' before + the function name. */ + + #undef ASM_DECLARE_FUNCTION_SIZE + #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ + do { \ + if (!flag_inhibit_size_directive) \ + { \ + char label[256]; \ + static int labelno; \ + labelno++; \ + ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \ + ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \ + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ + assemble_name (FILE, (FNAME)); \ + fprintf (FILE, ","); \ + assemble_name (FILE, label); \ + fprintf (FILE, "-."); \ + assemble_name (FILE, (FNAME)); \ + putc ('\n', FILE); \ + } \ + } while (0) + + /* Use ELF style section commands. */ + + #undef TEXT_SECTION_ASM_OP + #define TEXT_SECTION_ASM_OP "\t.section\t\".text\"" + + #undef DATA_SECTION_ASM_OP + #define DATA_SECTION_ASM_OP "\t.section\t\".data\"" + + /* Besides the usual ELF sections, we need a toc section. */ + + #undef EXTRA_SECTIONS + #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_toc + + #undef EXTRA_SECTION_FUNCTIONS + #define EXTRA_SECTION_FUNCTIONS \ + CONST_SECTION_FUNCTION \ + CTORS_SECTION_FUNCTION \ + DTORS_SECTION_FUNCTION \ + TOC_SECTION_FUNCTION + + #define TOC_SECTION_FUNCTION \ + void \ + toc_section () \ + { \ + if (TARGET_MINIMAL_TOC) \ + { \ + static int toc_initialized = 0; \ + \ + if (! toc_initialized) \ + { \ + fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ + fprintf (asm_out_file, ".LCTOC0:\n"); \ + fprintf (asm_out_file, "\t.tc .LCTOC1\n"); \ + fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ + fprintf (asm_out_file, ".LCTOC1:\n"); \ + toc_initialized = 1; \ + } \ + } \ + \ + if (in_section != in_toc) \ + { \ + fprintf (asm_out_file, "%s\n", \ + (TARGET_MINIMAL_TOC \ + ? MINIMAL_TOC_SECTION_ASM_OP \ + : TOC_SECTION_ASM_OP)); \ + in_section = in_toc; \ + } \ + } + + #define TOC_SECTION_ASM_OP "\t.section\t.got,\"aw\"" + #define MINIMAL_TOC_SECTION_ASM_OP "\t.section\t.got1,\"aw\"" + + /* Use the TOC section for TOC entries. */ + + #undef SELECT_RTX_SECTION + #define SELECT_RTX_SECTION(MODE, X) \ + { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \ + toc_section (); \ + else \ + const_section (); \ + } + + /* How to renumber registers for dbx and gdb. */ + + #define DBX_REGISTER_NUMBER(REGNO) (REGNO) + + /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */ + + #undef ASM_OUTPUT_INTERNAL_LABEL_PREFIX + #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \ + fprintf (FILE, ".%s", PREFIX) + + /* Pass -m601 to the assembler, since that is what powerpc.h currently + implies. */ + #undef ASM_SPEC + #define ASM_SPEC \ + "-u -m601 %{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}" + /* This is the end of what might become sysv4.h. */ + + /* Enable output of DBX (stabs) debugging information when asked for it. */ + + #define DBX_DEBUGGING_INFO + + /* Prefer DBX (stabs) debugging information over the native (DWARF) format. */ + + #undef PREFERRED_DEBUGGING_TYPE + #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG + + /* Line numbers are relative to the current function. */ + + #undef ASM_OUTPUT_SOURCE_LINE + #define ASM_OUTPUT_SOURCE_LINE(file, line) \ + { static int sym_lineno = 1; \ + fprintf (file, ".stabn 68,0,%d,.LM%d-.%s\n.LM%d:\n",\ + line, sym_lineno, \ + XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0), \ + sym_lineno); \ + sym_lineno += 1; } + + /* But, to make this work, we have to output the stabs for the function + name *first*... */ + + #define DBX_FUNCTION_FIRST + + /* We need to output LBRAC and RBRAC lines specially to include the + dot in from of the text symbol for a function. */ + + #define DBX_OUTPUT_LBRAC(FILE, BUF) \ + do \ + { \ + fprintf (FILE, "%s %d,0,0,", ASM_STABN_OP, N_LBRAC); \ + assemble_name (FILE, BUF); \ + fprintf (FILE, "-."); \ + assemble_name (asmfile, \ + XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ + fprintf (asmfile, "\n"); \ + } \ + while (0) + + #define DBX_OUTPUT_RBRAC(FILE, BUF) \ + do \ + { \ + fprintf (FILE, "%s %d,0,0,", ASM_STABN_OP, N_RBRAC); \ + assemble_name (FILE, BUF); \ + fprintf (FILE, "-."); \ + assemble_name (asmfile, \ + XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ + fprintf (asmfile, "\n"); \ + } \ + while (0) + + /* We are using function descriptors, so the value of a function + symbol is in the .data section. However, we want the stabs entry + for that function to point at the actual function code in the .text + section, which we get by prefixing the symbol with a dot. */ + + #define DBX_FINISH_SYMBOL(sym) \ + do { \ + int line = 0; \ + if (use_gnu_debug_info_extensions && sym != 0) \ + line = DECL_SOURCE_LINE (sym); \ + \ + fprintf (asmfile, "\",%d,0,%d,", current_sym_code, line); \ + if (current_sym_addr) \ + { \ + if (TREE_CODE (sym) == FUNCTION_DECL) \ + fprintf (asmfile, "."); \ + output_addr_const (asmfile, current_sym_addr); \ + } \ + else \ + fprintf (asmfile, "%d", current_sym_value); \ + putc ('\n', asmfile); \ + } while (0) + + /* This is the end of what might become sysv4dbx.h. */ + + #undef TARGET_VERSION + #define TARGET_VERSION fprintf (stderr, " (PowerPC Netware)"); + + /* FIXME: These should actually indicate PowerPC, when there is some + standard way of expressing that. */ + #undef CPP_PREDEFINES + #define CPP_PREDEFINES \ + "-DPPC D__netware__ -Asystem(netware) -Acpu(powerpc) -Amachine(powerpc)" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/powerpc.h gcc-2.7.1/config/rs6000/powerpc.h *** gcc-2.7.0/config/rs6000/powerpc.h Thu Jun 15 16:28:03 1995 --- gcc-2.7.1/config/rs6000/powerpc.h Fri Jul 21 14:19:06 1995 *************** *** 25,29 **** #undef ASM_SPEC ! #define ASM_SPEC "-u -mppc" #undef CPP_PREDEFINES --- 25,48 ---- #undef ASM_SPEC ! #define ASM_SPEC "-u \ ! %{!mcpu*: \ ! %{mpower2: -mpwrx} \ ! %{mpowerpc*: %{!mpower: -mppc}} \ ! %{mno-powerpc: %{!mpower: %{!mpower2: -mcom}}} \ ! %{mno-powerpc: %{mpower: %{!mpower2: -mpwr}}} \ ! %{!mno-powerpc: %{mpower: -m601}} \ ! %{!mno-powerpc: %{!mpower: -mppc}}} \ ! %{mcpu=common: -mcom} \ ! %{mcpu=power: -mpwr} \ ! %{mcpu=powerpc: -mppc} \ ! %{mcpu=rios: -mpwr} \ ! %{mcpu=rios1: -mpwr} \ ! %{mcpu=rios2: -mpwrx} \ ! %{mcpu=rsc: -mpwr} \ ! %{mcpu=rsc1: -mpwr} \ ! %{mcpu=403: -mppc} \ ! %{mcpu=601: -m601} \ ! %{mcpu=603: -mppc} \ ! %{mcpu=604: -mppc}" #undef CPP_PREDEFINES *************** *** 49,63 **** %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=403: -D_ARCH_PPC} \ - %{mcpu=mpc403: -D_ARCH_PPC} \ - %{mcpu=ppc403: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=mpc601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=ppc601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=603: -D_ARCH_PPC} \ ! %{mcpu=mpc603: -D_ARCH_PPC} \ ! %{mcpu=ppc603: -D_ARCH_PPC} \ ! %{mcpu=604: -D_ARCH_PPC} \ ! %{mcpu=mpc604: -D_ARCH_PPC} \ ! %{mcpu=ppc604: -D_ARCH_PPC}" #undef TARGET_DEFAULT --- 68,74 ---- %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=403: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=603: -D_ARCH_PPC} \ ! %{mcpu=604: -D_ARCH_PPC}" #undef TARGET_DEFAULT diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/rs6000.c gcc-2.7.1/config/rs6000/rs6000.c *** gcc-2.7.0/config/rs6000/rs6000.c Thu Jun 15 16:28:15 1995 --- gcc-2.7.1/config/rs6000/rs6000.c Fri Oct 27 06:45:25 1995 *************** *** 71,74 **** --- 71,175 ---- int rs6000_pic_labelno; #endif + + /* Whether a System V.4 varargs area was created. */ + int rs6000_sysv_varargs_p; + + /* Temporary memory used to convert integer -> float */ + static rtx stack_temps[NUM_MACHINE_MODES]; + + + /* Print the options used in the assembly file. */ + + extern char *version_string, *language_string; + + struct asm_option + { + char *string; + int *variable; + int on_value; + }; + + #define MAX_LINE 79 + + static int + output_option (file, type, name, pos) + FILE *file; + char *type; + char *name; + int pos; + { + int type_len = strlen (type); + int name_len = strlen (name); + + if (1 + type_len + name_len + pos > MAX_LINE) + { + fprintf (file, "\n # %s%s", type, name); + return 3 + type_len + name_len; + } + fprintf (file, " %s%s", type, name); + return pos + 1 + type_len + name_len; + } + + static struct { char *name; int value; } m_options[] = TARGET_SWITCHES; + + void + output_options (file, f_options, f_len, W_options, W_len) + FILE *file; + struct asm_option *f_options; + int f_len; + struct asm_option *W_options; + int W_len; + { + int j; + int flags = target_flags; + int pos = 32767; + + fprintf (file, " # %s %s", language_string, version_string); + + if (optimize) + { + char opt_string[20]; + sprintf (opt_string, "%d", optimize); + pos = output_option (file, "-O", opt_string, pos); + } + + if (profile_flag) + pos = output_option (file, "-p", "", pos); + + if (profile_block_flag) + pos = output_option (file, "-a", "", pos); + + if (inhibit_warnings) + pos = output_option (file, "-w", "", pos); + + for (j = 0; j < f_len; j++) + { + if (*f_options[j].variable == f_options[j].on_value) + pos = output_option (file, "-f", f_options[j].string, pos); + } + + for (j = 0; j < W_len; j++) + { + if (*W_options[j].variable == W_options[j].on_value) + pos = output_option (file, "-W", W_options[j].string, pos); + } + + for (j = 0; j < sizeof m_options / sizeof m_options[0]; j++) + { + if (m_options[j].name[0] != '\0' + && m_options[j].value > 0 + && ((m_options[j].value & flags) == m_options[j].value)) + { + pos = output_option (file, "-m", m_options[j].name, pos); + flags &= ~ m_options[j].value; + } + } + + if (rs6000_cpu_string != (char *)0) + pos = output_option (file, "-mcpu=", rs6000_cpu_string, pos); + + fputs ("\n\n", file); + } + /* Override command line options. Mostly we process the processor *************** *** 120,156 **** MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"mpc403", PROCESSOR_PPC403, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"ppc403", PROCESSOR_PPC403, - MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, - POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, {"601", PROCESSOR_PPC601, MASK_POWER | MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_MULTIPLE | MASK_STRING, MASK_POWER2 | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"mpc601", PROCESSOR_PPC601, - MASK_POWER | MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_MULTIPLE | MASK_STRING, - MASK_POWER2 | POWERPC_OPT_MASKS | MASK_POWERPC64}, - {"ppc601", PROCESSOR_PPC601, - MASK_POWER | MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_MULTIPLE | MASK_STRING, - MASK_POWER2 | POWERPC_OPT_MASKS | MASK_POWERPC64}, {"603", PROCESSOR_PPC603, MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"mpc603", PROCESSOR_PPC603, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, - {"ppc603", PROCESSOR_PPC603, - MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, - POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, {"604", PROCESSOR_PPC604, MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, ! POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, ! {"mpc604", PROCESSOR_PPC604, ! MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, ! POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, ! {"ppc604", PROCESSOR_PPC604, ! MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, ! POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}}; int ptt_size = sizeof (processor_target_table) / sizeof (struct ptt); --- 221,233 ---- MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, {"601", PROCESSOR_PPC601, MASK_POWER | MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_MULTIPLE | MASK_STRING, MASK_POWER2 | POWERPC_OPT_MASKS | MASK_POWERPC64}, {"603", PROCESSOR_PPC603, MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, {"604", PROCESSOR_PPC604, MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, ! POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}}; int ptt_size = sizeof (processor_target_table) / sizeof (struct ptt); *************** *** 217,224 **** } /* Create a CONST_DOUBLE like immed_double_const, except reverse the two parts of the constant if the target is little endian. */ ! struct rtx_def *rs6000_immed_double_const (i0, i1, mode) HOST_WIDE_INT i0, i1; enum machine_mode mode; --- 294,314 ---- } + /* Create a CONST_DOUBLE from a string. */ + + struct rtx_def * + rs6000_float_const (string, mode) + char *string; + enum machine_mode mode; + { + REAL_VALUE_TYPE value = REAL_VALUE_ATOF (string, mode); + return immed_real_const_1 (value, mode); + } + + /* Create a CONST_DOUBLE like immed_double_const, except reverse the two parts of the constant if the target is little endian. */ ! struct rtx_def * ! rs6000_immed_double_const (i0, i1, mode) HOST_WIDE_INT i0, i1; enum machine_mode mode; *************** *** 236,244 **** direct_return () { ! return (reload_completed ! && first_reg_to_save () == 32 ! && first_fp_reg_to_save () == 64 ! && ! regs_ever_live[65] ! && ! rs6000_pushes_stack ()); } --- 326,342 ---- direct_return () { ! if (reload_completed) ! { ! rs6000_stack_t *info = rs6000_stack_info (); ! ! if (info->first_gp_reg_save == 32 ! && info->first_fp_reg_save == 64 ! && !info->lr_save_p ! && !info->cr_save_p ! && !info->push_p) ! return 1; ! } ! ! return 0; } *************** *** 388,407 **** || (low != 0 && input_operand (low, word_mode))); } ! ! /* Return 1 if the operand is a constant whose low-order 32 bits are ! zero. */ int ! low_32_bit_operand (op, mode) register rtx op; enum machine_mode mode; { ! rtx low; ! ! if (GET_CODE (op) != CONST_DOUBLE && GET_CODE (op) != CONST_INT) ! return 0; ! ! low = operand_subword (op, 1, 0, mode); ! return low != 0 && GET_CODE (low) == CONST_INT && INTVAL (low) == 0; } --- 486,499 ---- || (low != 0 && input_operand (low, word_mode))); } ! ! /* Return 1 if the operand is an offsettable memory address. */ int ! offsettable_addr_operand (op, mode) register rtx op; enum machine_mode mode; { ! return offsettable_address_p (reload_completed | reload_in_progress, ! mode, op); } *************** *** 646,649 **** --- 738,1173 ---- } + /* Initialize a variable CUM of type CUMULATIVE_ARGS + for a call to a function whose data type is FNTYPE. + For a library call, FNTYPE is 0. + + For incoming args we set the number of arguments in the prototype large + so we never return an EXPR_LIST. */ + + void + init_cumulative_args (cum, fntype, libname, incoming) + CUMULATIVE_ARGS *cum; + tree fntype; + rtx libname; + int incoming; + { + static CUMULATIVE_ARGS zero_cumulative; + + *cum = zero_cumulative; + cum->words = 0; + cum->fregno = FP_ARG_MIN_REG; + cum->prototype = (fntype && TYPE_ARG_TYPES (fntype)); + + if (incoming) + { + cum->nargs_prototype = 1000; /* don't return an EXPR_LIST */ + #ifdef TARGET_V4_CALLS + if (TARGET_V4_CALLS) + cum->varargs_offset = RS6000_VARARGS_OFFSET; + #endif + } + + else if (cum->prototype) + cum->nargs_prototype = (list_length (TYPE_ARG_TYPES (fntype)) - 1 + + (TYPE_MODE (TREE_TYPE (fntype)) == BLKmode + || RETURN_IN_MEMORY (TREE_TYPE (fntype)))); + + else + cum->nargs_prototype = 0; + + cum->orig_nargs = cum->nargs_prototype; + if (TARGET_DEBUG_ARG) + { + fprintf (stderr, "\ninit_cumulative_args:"); + if (fntype) + { + tree ret_type = TREE_TYPE (fntype); + fprintf (stderr, " ret code = %s,", + tree_code_name[ (int)TREE_CODE (ret_type) ]); + } + + #ifdef TARGET_V4_CALLS + if (TARGET_V4_CALLS && incoming) + fprintf (stderr, " varargs = %d, ", cum->varargs_offset); + #endif + + fprintf (stderr, " proto = %d, nargs = %d\n", + cum->prototype, cum->nargs_prototype); + } + } + + /* Update the data in CUM to advance over an argument + of mode MODE and data type TYPE. + (TYPE is null for libcalls where that information may not be available.) */ + + void + function_arg_advance (cum, mode, type, named) + CUMULATIVE_ARGS *cum; + enum machine_mode mode; + tree type; + int named; + { + cum->nargs_prototype--; + + #ifdef TARGET_V4_CALLS + if (TARGET_V4_CALLS) + { + /* Long longs must not be split between registers and stack */ + if ((GET_MODE_CLASS (mode) != MODE_FLOAT || TARGET_SOFT_FLOAT) + && type && !AGGREGATE_TYPE_P (type) + && cum->words < GP_ARG_NUM_REG + && cum->words + RS6000_ARG_SIZE (mode, type, named) > GP_ARG_NUM_REG) + { + cum->words = GP_ARG_NUM_REG; + } + + /* Aggregates get passed as pointers */ + if (type && AGGREGATE_TYPE_P (type)) + cum->words++; + + /* Floats go in registers, & don't occupy space in the GP registers + like they do for AIX unless software floating point. */ + else if (GET_MODE_CLASS (mode) == MODE_FLOAT + && TARGET_HARD_FLOAT + && cum->fregno <= FP_ARG_V4_MAX_REG) + cum->fregno++; + + else + cum->words += RS6000_ARG_SIZE (mode, type, 1); + } + else + #endif + if (named) + { + cum->words += RS6000_ARG_SIZE (mode, type, named); + if (GET_MODE_CLASS (mode) == MODE_FLOAT && TARGET_HARD_FLOAT) + cum->fregno++; + } + + if (TARGET_DEBUG_ARG) + fprintf (stderr, + "function_adv: words = %2d, fregno = %2d, nargs = %4d, proto = %d, mode = %4s, named = %d\n", + cum->words, cum->fregno, cum->nargs_prototype, cum->prototype, GET_MODE_NAME (mode), named); + } + + /* Determine where to put an argument to a function. + Value is zero to push the argument on the stack, + or a hard register in which to store the argument. + + MODE is the argument's machine mode. + TYPE is the data type of the argument (as a tree). + This is null for libcalls where that information may + not be available. + CUM is a variable of type CUMULATIVE_ARGS which gives info about + 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). + + On RS/6000 the first eight words of non-FP are normally in registers + and the rest are pushed. Under AIX, the first 13 FP args are in registers. + Under V.4, the first 8 FP args are in registers. + + If this is floating-point and no prototype is specified, we use + both an FP and integer register (or possibly FP reg and stack). Library + functions (when TYPE is zero) always have the proper types for args, + so we can pass the FP value just in one register. emit_library_function + doesn't support EXPR_LIST anyway. */ + + struct rtx_def * + function_arg (cum, mode, type, named) + CUMULATIVE_ARGS *cum; + enum machine_mode mode; + tree type; + int named; + { + if (TARGET_DEBUG_ARG) + fprintf (stderr, + "function_arg: words = %2d, fregno = %2d, nargs = %4d, proto = %d, mode = %4s, named = %d\n", + cum->words, cum->fregno, cum->nargs_prototype, cum->prototype, GET_MODE_NAME (mode), named); + + /* Return a marker to indicate whether CR1 needs to set or clear the bit that V.4 + uses to say fp args were passed in registers. Assume that we don't need the + marker for software floating point, or compiler generated library calls. */ + if (mode == VOIDmode) + { + #ifdef TARGET_V4_CALLS + if (TARGET_V4_CALLS && TARGET_HARD_FLOAT && cum->nargs_prototype < 0 + && type && (cum->prototype || TARGET_NO_PROTOTYPE)) + return GEN_INT ((cum->fregno == FP_ARG_MIN_REG) ? -1 : 1); + #endif + + return GEN_INT (0); + } + + if (!named) + { + #ifdef TARGET_V4_CALLS + if (!TARGET_V4_CALLS) + #endif + return NULL_RTX; + } + + if (type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) + return NULL_RTX; + + if (USE_FP_FOR_ARG_P (*cum, mode, type)) + { + if ((cum->nargs_prototype > 0) + #ifdef TARGET_V4_CALLS + || TARGET_V4_CALLS /* V.4 never passes FP values in GP registers */ + #endif + || !type) + return gen_rtx (REG, mode, cum->fregno); + + return gen_rtx (EXPR_LIST, VOIDmode, + ((cum->words < GP_ARG_NUM_REG) + ? gen_rtx (REG, mode, GP_ARG_MIN_REG + cum->words) + : NULL_RTX), + gen_rtx (REG, mode, cum->fregno)); + } + + #ifdef TARGET_V4_CALLS + /* Long longs won't be split between register and stack */ + else if (TARGET_V4_CALLS && + cum->words + RS6000_ARG_SIZE (mode, type, named) > GP_ARG_NUM_REG) + { + return NULL_RTX; + } + #endif + + else if (cum->words < GP_ARG_NUM_REG) + return gen_rtx (REG, mode, GP_ARG_MIN_REG + cum->words); + + return NULL_RTX; + } + + /* 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. */ + + int + function_arg_partial_nregs (cum, mode, type, named) + CUMULATIVE_ARGS *cum; + enum machine_mode mode; + tree type; + int named; + { + if (! named) + return 0; + + #ifdef TARGET_V4_CALLS + if (TARGET_V4_CALLS) + return 0; + #endif + + if (USE_FP_FOR_ARG_P (*cum, mode, type)) + { + if (cum->nargs_prototype >= 0) + return 0; + } + + if (cum->words < GP_ARG_NUM_REG + && GP_ARG_NUM_REG < (cum->words + RS6000_ARG_SIZE (mode, type, named))) + { + int ret = GP_ARG_NUM_REG - cum->words; + if (ret && TARGET_DEBUG_ARG) + fprintf (stderr, "function_arg_partial_nregs: %d\n", ret); + + return ret; + } + + return 0; + } + + /* A C expression that indicates when an argument must be passed by + reference. If nonzero for an argument, a copy of that argument is + made in memory and a pointer to the argument is passed instead of + the argument itself. The pointer is passed in whatever way is + appropriate for passing a pointer to that type. + + Under V.4, structures and unions are passed by reference. */ + + int + function_arg_pass_by_reference (cum, mode, type, named) + CUMULATIVE_ARGS *cum; + enum machine_mode mode; + tree type; + int named; + { + #ifdef TARGET_V4_CALLS + if (TARGET_V4_CALLS && type && AGGREGATE_TYPE_P (type)) + { + if (TARGET_DEBUG_ARG) + fprintf (stderr, "function_arg_pass_by_reference: aggregate\n"); + + return 1; + } + #endif + + return 0; + } + + + /* Perform any needed actions needed for a function that is receiving a + variable number of arguments. + + CUM is as above. + + MODE and TYPE are the mode and type of the current parameter. + + PRETEND_SIZE is a variable that should be set to the amount of stack + that must be pushed by the prolog to pretend that our caller pushed + it. + + Normally, this macro will push all remaining incoming registers on the + stack and set PRETEND_SIZE to the length of the registers pushed. */ + + void + setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) + CUMULATIVE_ARGS *cum; + enum machine_mode mode; + tree type; + int *pretend_size; + int no_rtl; + + { + rtx save_area = virtual_incoming_args_rtx; + int reg_size = (TARGET_64BIT) ? 8 : 4; + + if (TARGET_DEBUG_ARG) + fprintf (stderr, + "setup_vararg: words = %2d, fregno = %2d, nargs = %4d, proto = %d, mode = %4s, no_rtl= %d\n", + cum->words, cum->fregno, cum->nargs_prototype, cum->prototype, GET_MODE_NAME (mode), no_rtl); + + #ifdef TARGET_V4_CALLS + if (TARGET_V4_CALLS && !no_rtl) + { + rs6000_sysv_varargs_p = 1; + save_area = plus_constant (frame_pointer_rtx, RS6000_VARARGS_OFFSET); + } + #endif + + if (cum->words < 8) + { + int first_reg_offset = cum->words; + + if (MUST_PASS_IN_STACK (mode, type)) + first_reg_offset += RS6000_ARG_SIZE (TYPE_MODE (type), type, 1); + + if (first_reg_offset > GP_ARG_NUM_REG) + first_reg_offset = GP_ARG_NUM_REG; + + if (!no_rtl && first_reg_offset != GP_ARG_NUM_REG) + move_block_from_reg + (GP_ARG_MIN_REG + first_reg_offset, + gen_rtx (MEM, BLKmode, + plus_constant (save_area, first_reg_offset * reg_size)), + GP_ARG_NUM_REG - first_reg_offset, + (GP_ARG_NUM_REG - first_reg_offset) * UNITS_PER_WORD); + + *pretend_size = (GP_ARG_NUM_REG - first_reg_offset) * UNITS_PER_WORD; + } + + #ifdef TARGET_V4_CALLS + /* Save FP registers if needed. */ + if (TARGET_V4_CALLS && TARGET_HARD_FLOAT && !no_rtl) + { + int fregno = cum->fregno; + int num_fp_reg = FP_ARG_V4_MAX_REG + 1 - fregno; + + if (num_fp_reg >= 0) + { + rtx cr1 = gen_rtx (REG, CCmode, 69); + rtx lab = gen_label_rtx (); + int off = (GP_ARG_NUM_REG * reg_size) + ((fregno - FP_ARG_MIN_REG) * 8); + + emit_jump_insn (gen_rtx (SET, VOIDmode, + pc_rtx, + gen_rtx (IF_THEN_ELSE, VOIDmode, + gen_rtx (NE, VOIDmode, cr1, const0_rtx), + gen_rtx (LABEL_REF, VOIDmode, lab), + pc_rtx))); + + while ( num_fp_reg-- >= 0) + { + emit_move_insn (gen_rtx (MEM, DFmode, plus_constant (save_area, off)), + gen_rtx (REG, DFmode, fregno++)); + off += 8; + } + + emit_label (lab); + } + } + #endif + } + + /* If defined, is a C expression that produces the machine-specific + code for a call to `__builtin_saveregs'. This code will be moved + to the very beginning of the function, before any parameter access + are made. The return value of this function should be an RTX that + contains the value to use as the return of `__builtin_saveregs'. + + The argument ARGS is a `tree_list' containing the arguments that + were passed to `__builtin_saveregs'. + + If this macro is not defined, the compiler will output an ordinary + call to the library function `__builtin_saveregs'. + + On the Power/PowerPC return the address of the area on the stack + used to hold arguments. Under AIX, this includes the 8 word register + save area. Under V.4 this does not. */ + + struct rtx_def * + expand_builtin_saveregs (args) + tree args; + { + return virtual_incoming_args_rtx; + } + + + /* Allocate a stack temp. Only allocate one stack temp per type for a + function. */ + + struct rtx_def * + rs6000_stack_temp (mode, size) + enum machine_mode mode; + int size; + { + rtx temp = stack_temps[ (int)mode ]; + rtx addr; + + if (temp == NULL_RTX) + { + temp = assign_stack_local (mode, size, 0); + addr = XEXP (temp, 0); + + if ((size > 4 && !offsettable_address_p (0, mode, addr)) + || (size <= 4 && !memory_address_p (mode, addr))) + { + XEXP (temp, 0) = copy_addr_to_reg (addr); + } + + stack_temps[ (int)mode ] = temp; + } + + return temp; + } + + + /* Generate a memory reference for expand_block_move, copying volatile, + and other bits from an original memory reference. */ + + static rtx + expand_block_move_mem (mode, addr, orig_mem) + enum machine_mode mode; + rtx addr; + rtx orig_mem; + { + rtx mem = gen_rtx (MEM, mode, addr); + MEM_VOLATILE_P (mem) = MEM_VOLATILE_P (orig_mem); + MEM_IN_STRUCT_P (mem) = MEM_IN_STRUCT_P (orig_mem); + return mem; + } + /* Expand a block move operation, and return 1 if successful. Return 0 if we should let the compiler generate normal code. *************** *** 708,713 **** for ( ; bytes > 0; bytes -= move_bytes) { - #if 0 - /* XXX Don't move so many bytes right now, it causes the compiler to not bootstrap */ if (bytes > 24 /* move up to 32 bytes at a time */ && !fixed_regs[5] --- 1232,1235 ---- *************** *** 752,758 **** align_rtx)); } ! else ! #endif ! if (bytes > 4 && !TARGET_64BIT) { /* move up to 8 bytes at a time */ move_bytes = (bytes > 8) ? 8 : bytes; --- 1274,1278 ---- align_rtx)); } ! else if (bytes > 4 && !TARGET_64BIT) { /* move up to 8 bytes at a time */ move_bytes = (bytes > 8) ? 8 : bytes; *************** *** 1233,1237 **** case '*': /* Write the register number of the TOC register. */ ! fputs (TARGET_MINIMAL_TOC ? "30" : "2", file); return; --- 1753,1757 ---- case '*': /* Write the register number of the TOC register. */ ! fputs (TARGET_MINIMAL_TOC ? reg_names[30] : reg_names[2], file); return; *************** *** 1661,1665 **** { if (GET_CODE (x) == REG) ! fprintf (file, "0(%d)", REGNO (x)); else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == CONST) { --- 2181,2185 ---- { if (GET_CODE (x) == REG) ! fprintf (file, "0(%s)", reg_names[ REGNO (x) ]); else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == CONST) { *************** *** 1667,1674 **** /* When TARGET_MINIMAL_TOC, use the indirected toc table pointer instead of the toc pointer. */ ! if (TARGET_MINIMAL_TOC) ! fprintf (file, "(30)"); else ! fprintf (file, "(2)"); } else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == REG) --- 2187,2196 ---- /* When TARGET_MINIMAL_TOC, use the indirected toc table pointer instead of the toc pointer. */ ! #ifdef TARGET_NO_TOC ! if (TARGET_NO_TOC) ! ; else ! #endif ! fprintf (file, "(%s)", reg_names[ TARGET_MINIMAL_TOC ? 30 : 2 ]); } else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == REG) *************** *** 1675,1684 **** { if (REGNO (XEXP (x, 0)) == 0) ! fprintf (file, "%d,%d", REGNO (XEXP (x, 1)), REGNO (XEXP (x, 0))); else ! fprintf (file, "%d,%d", REGNO (XEXP (x, 0)), REGNO (XEXP (x, 1))); } else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT) ! fprintf (file, "%d(%d)", INTVAL (XEXP (x, 1)), REGNO (XEXP (x, 0))); else abort (); --- 2197,2214 ---- { if (REGNO (XEXP (x, 0)) == 0) ! fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (x, 1)) ], ! reg_names[ REGNO (XEXP (x, 0)) ]); else ! fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (x, 0)) ], ! reg_names[ REGNO (XEXP (x, 1)) ]); } else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT) ! fprintf (file, "%d(%s)", INTVAL (XEXP (x, 1)), reg_names[ REGNO (XEXP (x, 0)) ]); ! else if (TARGET_ELF && !TARGET_64BIT && GET_CODE (x) == LO_SUM ! && GET_CODE (XEXP (x, 0)) == REG && CONSTANT_P (XEXP (x, 1))) ! { ! output_addr_const (file, XEXP (x, 1)); ! fprintf (file, "@l(%s)", reg_names[ REGNO (XEXP (x, 0)) ]); ! } else abort (); *************** *** 1706,1712 **** --- 2236,2244 ---- For now, save enough room for all of the parameter registers. */ + #ifndef USING_SVR4_H if (profile_flag) if (first_reg > 23) first_reg = 23; + #endif return first_reg; *************** *** 1728,1756 **** } - /* Return 1 if we need to save CR. */ - - int - must_save_cr () - { - return regs_ever_live[70] || regs_ever_live[71] || regs_ever_live[72]; - } - - /* Compute the size of the save area in the stack, including the space for - the fixed area. */ - - int - rs6000_sa_size () - { - int size; - - /* We have the six fixed words, plus the size of the register save - areas, rounded to a double-word. */ - size = 6 + (32 - first_reg_to_save ()) + (64 - first_fp_reg_to_save ()) * 2; - if (size & 1) - size++; - - return size * 4; - } - /* Return non-zero if this function makes calls. */ --- 2260,2263 ---- *************** *** 1771,1791 **** } ! /* Return non-zero if this function needs to push space on the stack. */ ! int ! rs6000_pushes_stack () { ! int total_size = (rs6000_sa_size () + get_frame_size () ! + current_function_outgoing_args_size); ! /* We need to push the stack if a frame pointer is needed (because the ! stack might be dynamically adjusted), if we are debugging, if the ! total stack size is more than 220 bytes, or if we make calls. */ ! return (frame_pointer_needed || write_symbols != NO_DEBUG ! || total_size > 220 ! || rs6000_makes_calls ()); } #ifdef USING_SVR4_H /* Write out a System V.4 style traceback table before the prologue --- 2278,2549 ---- } ! ! /* Calculate the stack information for the current function. This is ! complicated by having two separate calling sequences, the AIX calling ! sequence and the V.4 calling sequence. ! ! AIX stack frames look like: ! ! SP----> +---------------------------------------+ ! | back chain to caller | 0 ! +---------------------------------------+ ! | saved CR | 4 ! +---------------------------------------+ ! | saved LR | 8 ! +---------------------------------------+ ! | reserved for compilers | 12 ! +---------------------------------------+ ! | reserved for binders | 16 ! +---------------------------------------+ ! | saved TOC pointer | 20 ! +---------------------------------------+ ! | Parameter save area (P) | 24 ! +---------------------------------------+ ! | Alloca space (A) | 24+P ! +---------------------------------------+ ! | Local variable space (L) | 24+P+A ! +---------------------------------------+ ! | Save area for GP registers (G) | 24+P+A+L ! +---------------------------------------+ ! | Save area for FP registers (F) | 24+P+A+L+G ! +---------------------------------------+ ! old SP->| back chain to caller's caller | ! +---------------------------------------+ ! ! V.4 stack frames look like: ! ! SP----> +---------------------------------------+ ! | back chain to caller | 0 ! +---------------------------------------+ ! | caller's saved LR | 4 ! +---------------------------------------+ ! | Parameter save area (P) | 8 ! +---------------------------------------+ ! | Alloca space (A) | 8+P ! +---------------------------------------+ ! | Varargs save area (V) | 8+P+A ! +---------------------------------------+ ! | Local variable space (L) | 8+P+A+V ! +---------------------------------------+ ! | saved CR (C) | 8+P+A+V+L ! +---------------------------------------+ ! | Save area for GP registers (G) | 8+P+A+V+L+C ! +---------------------------------------+ ! | Save area for FP registers (F) | 8+P+A+V+L+C+G ! +---------------------------------------+ ! old SP->| back chain to caller's caller | ! +---------------------------------------+ ! */ ! rs6000_stack_t * ! rs6000_stack_info () ! { ! static rs6000_stack_t info, zero_info; ! rs6000_stack_t *info_ptr = &info; ! int reg_size = TARGET_64BIT ? 8 : 4; ! enum rs6000_abi abi; ! ! /* Zero all fields portably */ ! info = zero_info; ! ! /* Select which calling sequence */ ! #ifdef TARGET_V4_CALLS ! if (TARGET_V4_CALLS) ! abi = ABI_V4; ! else ! #endif ! abi = ABI_AIX; ! ! info_ptr->abi = abi; ! ! /* Calculate which registers need to be saved & save area size */ ! info_ptr->first_gp_reg_save = first_reg_to_save (); ! info_ptr->gp_size = reg_size * (32 - info_ptr->first_gp_reg_save); ! ! info_ptr->first_fp_reg_save = first_fp_reg_to_save (); ! info_ptr->fp_size = 8 * (64 - info_ptr->first_fp_reg_save); ! ! /* Does this function call anything? */ ! info_ptr->calls_p = rs6000_makes_calls (); ! ! /* Determine if we need to save the link register */ ! if (regs_ever_live[65] || profile_flag ! #ifdef TARGET_RELOCATABLE ! || (TARGET_RELOCATABLE && (get_pool_size () != 0)) ! #endif ! || (info_ptr->first_fp_reg_save != 64 ! && !FP_SAVE_INLINE (info_ptr->first_fp_reg_save)) ! || (abi == ABI_V4 && current_function_calls_alloca) ! || info_ptr->calls_p) ! { ! info_ptr->lr_save_p = 1; ! regs_ever_live[65] = 1; ! } ! ! /* Determine if we need to save the condition code registers */ ! if (regs_ever_live[70] || regs_ever_live[71] || regs_ever_live[72]) ! { ! info_ptr->cr_save_p = 1; ! if (abi == ABI_V4) ! info_ptr->cr_size = reg_size; ! } ! ! /* Determine various sizes */ ! info_ptr->reg_size = reg_size; ! info_ptr->fixed_size = RS6000_SAVE_AREA; ! info_ptr->varargs_size = RS6000_VARARGS_AREA; ! info_ptr->vars_size = ALIGN (get_frame_size (), 8); ! info_ptr->parm_size = ALIGN (current_function_outgoing_args_size, 8); ! info_ptr->save_size = ALIGN (info_ptr->fp_size + info_ptr->gp_size + info_ptr->cr_size, 8); ! info_ptr->total_size = ALIGN (info_ptr->vars_size ! + info_ptr->parm_size ! + info_ptr->save_size ! + info_ptr->varargs_size ! + info_ptr->fixed_size, STACK_BOUNDARY / BITS_PER_UNIT); ! ! /* Determine if we need to allocate any stack frame. ! For AIX We need to push the stack if a frame pointer is needed (because ! the stack might be dynamically adjusted), if we are debugging, if the ! total stack size is more than 220 bytes, or if we make calls. ! ! For V.4 we don't have the stack cushion that AIX uses, but assume that ! the debugger can handle stackless frames. */ ! ! if (info_ptr->calls_p) ! info_ptr->push_p = 1; ! ! else if (abi == ABI_V4) ! info_ptr->push_p = (info_ptr->total_size > info_ptr->fixed_size ! || info_ptr->lr_save_p); ! ! else ! info_ptr->push_p = (frame_pointer_needed ! || write_symbols != NO_DEBUG ! || info_ptr->total_size > 220); ! ! /* Calculate the offsets */ ! info_ptr->fp_save_offset = - info_ptr->fp_size; ! info_ptr->gp_save_offset = info_ptr->fp_save_offset - info_ptr->gp_size; ! switch (abi) ! { ! default: ! info_ptr->cr_save_offset = 4; ! info_ptr->lr_save_offset = 8; ! break; ! ! case ABI_V4: ! info_ptr->cr_save_offset = info_ptr->gp_save_offset - reg_size; ! info_ptr->lr_save_offset = reg_size; ! break; ! } ! ! /* Zero offsets if we're not saving those registers */ ! if (!info_ptr->fp_size) ! info_ptr->fp_save_offset = 0; ! ! if (!info_ptr->gp_size) ! info_ptr->gp_save_offset = 0; ! ! if (!info_ptr->lr_save_p) ! info_ptr->lr_save_offset = 0; ! ! if (!info_ptr->cr_save_p) ! info_ptr->cr_save_offset = 0; ! ! return info_ptr; ! } ! ! void ! debug_stack_info (info) ! rs6000_stack_t *info; { ! char *abi_string; ! ! if (!info) ! info = rs6000_stack_info (); ! ! fprintf (stderr, "\nStack information for function %s:\n", ! ((current_function_decl && DECL_NAME (current_function_decl)) ! ? IDENTIFIER_POINTER (DECL_NAME (current_function_decl)) ! : "")); ! ! switch (info->abi) ! { ! default: abi_string = "Unknown"; break; ! case ABI_NONE: abi_string = "NONE"; break; ! case ABI_AIX: abi_string = "AIX"; break; ! case ABI_V4: abi_string = "V.4"; break; ! } ! ! fprintf (stderr, "\tABI = %5s\n", abi_string); ! ! if (info->first_gp_reg_save != 32) ! fprintf (stderr, "\tfirst_gp_reg_save = %5d\n", info->first_gp_reg_save); ! ! if (info->first_fp_reg_save != 64) ! fprintf (stderr, "\tfirst_fp_reg_save = %5d\n", info->first_fp_reg_save); ! ! if (info->lr_save_p) ! fprintf (stderr, "\tlr_save_p = %5d\n", info->lr_save_p); ! ! if (info->cr_save_p) ! fprintf (stderr, "\tcr_save_p = %5d\n", info->cr_save_p); ! if (info->push_p) ! fprintf (stderr, "\tpush_p = %5d\n", info->push_p); ! if (info->calls_p) ! fprintf (stderr, "\tcalls_p = %5d\n", info->calls_p); ! ! if (info->gp_save_offset) ! fprintf (stderr, "\tgp_save_offset = %5d\n", info->gp_save_offset); ! ! if (info->fp_save_offset) ! fprintf (stderr, "\tfp_save_offset = %5d\n", info->fp_save_offset); ! ! if (info->lr_save_offset) ! fprintf (stderr, "\tlr_save_offset = %5d\n", info->lr_save_offset); ! ! if (info->cr_save_offset) ! fprintf (stderr, "\tcr_save_offset = %5d\n", info->cr_save_offset); ! ! if (info->varargs_save_offset) ! fprintf (stderr, "\tvarargs_save_offset = %5d\n", info->varargs_save_offset); ! ! if (info->total_size) ! fprintf (stderr, "\ttotal_size = %5d\n", info->total_size); ! ! if (info->varargs_size) ! fprintf (stderr, "\tvarargs_size = %5d\n", info->varargs_size); ! ! if (info->vars_size) ! fprintf (stderr, "\tvars_size = %5d\n", info->vars_size); ! ! if (info->parm_size) ! fprintf (stderr, "\tparm_size = %5d\n", info->parm_size); ! ! if (info->fixed_size) ! fprintf (stderr, "\tfixed_size = %5d\n", info->fixed_size); ! ! if (info->gp_size) ! fprintf (stderr, "\tgp_size = %5d\n", info->gp_size); ! ! if (info->fp_size) ! fprintf (stderr, "\tfp_size = %5d\n", info->fp_size); ! ! if (info->cr_size) ! fprintf (stderr, "\tcr_size = %5d\n", info->cr_size); ! ! if (info->save_size) ! fprintf (stderr, "\tsave_size = %5d\n", info->save_size); ! ! if (info->reg_size != 4) ! fprintf (stderr, "\treg_size = %5d\n", info->reg_size); ! ! fprintf (stderr, "\n"); } + + #ifdef USING_SVR4_H /* Write out a System V.4 style traceback table before the prologue *************** *** 1809,1828 **** tree name, decl; { ! ! int first_reg = first_reg_to_save (); ! int first_fp_reg = first_fp_reg_to_save (); ! int pushes_stack = rs6000_pushes_stack (); long tag; ! long version = 0; /* version number */ ! long tag_type = 0; /* function type */ ! long extended_tag = 0; /* additional tag words needed */ ! long spare = 0; /* reserved for future use */ ! long alloca_reg; /* stack/frame register */ ! long fpr_max = 64 - first_fp_reg; /* # of floating point registers saved */ ! long gpr_max = 32 - first_reg; /* # of general purpose registers saved */ ! long sp_max; /* 1 if the function acquires a stack frame */ ! long lr_max; /* 1 if the function stores the link register */ ! long cr_max; /* 1 if the function has a CR save word */ ! long fpscr_max = 0; /* 1 if the function has a FPSCR save word */ if (frame_pointer_needed) --- 2567,2580 ---- tree name, decl; { ! rs6000_stack_t *info = rs6000_stack_info (); long tag; ! long version = 0; /* version number */ ! long tag_type = 0; /* function type */ ! long extended_tag = 0; /* additional tag words needed */ ! long spare = 0; /* reserved for future use */ ! long fpscr_max = 0; /* 1 if the function has a FPSCR save word */ ! long fpr_max = 64 - info->first_fp_reg_save; /* # of floating point registers saved */ ! long gpr_max = 32 - info->first_gp_reg_save; /* # of general purpose registers saved */ ! long alloca_reg; /* stack/frame register */ if (frame_pointer_needed) *************** *** 1829,1833 **** alloca_reg = 31; ! else if (pushes_stack != 0) alloca_reg = 1; --- 2581,2585 ---- alloca_reg = 31; ! else if (info->push_p != 0) alloca_reg = 1; *************** *** 1835,1853 **** alloca_reg = 0; ! lr_max = (regs_ever_live[65] || first_fp_reg < 62 || profile_flag); ! cr_max = (must_save_cr () != 0); ! sp_max = (pushes_stack != 0); ! ! tag = (((version & 3) << 24) ! | ((tag_type & 7) << 21) ! | ((extended_tag & 1) << 20) ! | ((spare & 1) << 19) ! | ((alloca_reg & 0x1f) << 14) ! | ((fpr_max & 0x1f) << 9) ! | ((gpr_max & 0x1f) << 4) ! | ((sp_max & 1) << 3) ! | ((lr_max & 1) << 2) ! | ((cr_max & 1) << 1) ! | ((fpscr_max & 1) << 0)); fprintf (file, "\t.long 0x%lx\n", tag); --- 2587,2601 ---- alloca_reg = 0; ! tag = ((version << 24) ! | (tag_type << 21) ! | (extended_tag << 20) ! | (spare << 19) ! | (alloca_reg << 14) ! | (fpr_max << 9) ! | (gpr_max << 4) ! | (info->push_p << 3) ! | (info->lr_save_p << 2) ! | (info->cr_save_p << 1) ! | (fpscr_max << 0)); fprintf (file, "\t.long 0x%lx\n", tag); *************** *** 1855,1861 **** #endif /* USING_SVR4_H */ ! /* Write function prologue. */ - void output_prolog (file, size) --- 2603,2608 ---- #endif /* USING_SVR4_H */ ! /* Write function prologue. */ void output_prolog (file, size) *************** *** 1863,1875 **** int size; { ! int first_reg = first_reg_to_save (); ! int must_push = rs6000_pushes_stack (); ! int first_fp_reg = first_fp_reg_to_save (); ! int basic_size = rs6000_sa_size (); ! int total_size = (basic_size + size + current_function_outgoing_args_size); ! char buf[256]; ! /* Round size to multiple of 8 bytes. */ ! total_size = (total_size + 7) & ~7; /* Write .extern for any function we will call to save and restore fp --- 2610,2618 ---- int size; { ! rs6000_stack_t *info = rs6000_stack_info (); ! char *store_reg = (TARGET_64BIT) ? "\tstd %s,%d(%s)" : "\t{st|stw} %s,%d(%s)\n"; ! if (TARGET_DEBUG_STACK) ! debug_stack_info (info); /* Write .extern for any function we will call to save and restore fp *************** *** 1876,1883 **** values. */ #ifndef USING_SVR4_H ! if (first_fp_reg < 62) fprintf (file, "\t.extern %s%d%s\n\t.extern %s%d%s\n", ! SAVE_FP_PREFIX, first_fp_reg - 32, SAVE_FP_SUFFIX, ! RESTORE_FP_PREFIX, first_fp_reg - 32, RESTORE_FP_SUFFIX); #endif --- 2619,2626 ---- values. */ #ifndef USING_SVR4_H ! if (info->first_fp_reg_save < 62) fprintf (file, "\t.extern %s%d%s\n\t.extern %s%d%s\n", ! SAVE_FP_PREFIX, info->first_fp_reg_save - 32, SAVE_FP_SUFFIX, ! RESTORE_FP_PREFIX, info->first_fp_reg_save - 32, RESTORE_FP_SUFFIX); #endif *************** *** 1889,1892 **** --- 2632,2636 ---- trunc_defined = 1; } + /* Write .extern for AIX common mode routines, if needed. */ if (! TARGET_POWER && ! TARGET_POWERPC && ! common_mode_defined) *************** *** 1901,1927 **** } - #ifdef USING_SVR4_H - /* If we have a relocatable GOT section, we need to save the LR. */ - if (TARGET_RELOCATABLE && get_pool_size () != 0) - regs_ever_live[65] = 1; - #endif - - /* If we have to call a function to save fpr's, or if we are doing profiling, - then we will be using LR. */ - if (profile_flag) - regs_ever_live[65] = 1; - - #ifndef USING_SVR4_H - if (first_fp_reg < 62) - regs_ever_live[65] = 1; - #endif - /* If we use the link register, get it into r0. */ ! if (regs_ever_live[65]) ! asm_fprintf (file, "\tmflr 0\n"); /* If we need to save CR, put it into r12. */ ! if (must_save_cr ()) ! asm_fprintf (file, "\tmfcr 12\n"); /* Do any required saving of fpr's. If only one or two to save, do it --- 2645,2655 ---- } /* If we use the link register, get it into r0. */ ! if (info->lr_save_p) ! asm_fprintf (file, "\tmflr %s\n", reg_names[0]); /* If we need to save CR, put it into r12. */ ! if (info->cr_save_p) ! asm_fprintf (file, "\tmfcr %s\n", reg_names[12]); /* Do any required saving of fpr's. If only one or two to save, do it *************** *** 1928,1988 **** ourself. Otherwise, call function. Note that since they are statically linked, we do not need a nop following them. */ ! if (first_fp_reg == 62) ! asm_fprintf (file, "\tstfd 30,-16(1)\n\tstfd 31,-8(1)\n"); ! else if (first_fp_reg == 63) ! asm_fprintf (file, "\tstfd 31,-8(1)\n"); ! else if (first_fp_reg != 64) { ! #ifndef USING_SVR4_H ! asm_fprintf (file, "\tbl %s%d%s\n", SAVE_FP_PREFIX, first_fp_reg - 32, SAVE_FP_SUFFIX); ! #else ! int regno, loc; ! ! for (regno = first_fp_reg, ! loc = - (64 - first_fp_reg) * 8; ! regno < 64; ! regno++, loc += 8) ! asm_fprintf (file, "\tstfd %d,%d(1)\n", regno - 32, loc); ! #endif } /* Now save gpr's. */ ! if (! TARGET_MULTIPLE || first_reg == 31) { ! int regno, loc; ! for (regno = first_reg, ! loc = - (32 - first_reg) * 4 - (64 - first_fp_reg) * 8; ! regno < 32; ! regno++, loc += 4) ! asm_fprintf (file, "\t{st|stw} %d,%d(1)\n", regno, loc); } ! else if (first_reg != 32) ! asm_fprintf (file, "\t{stm|stmw} %d,%d(1)\n", first_reg, ! - (32 - first_reg) * 4 - (64 - first_fp_reg) * 8); /* Save lr if we used it. */ ! if (regs_ever_live[65]) ! asm_fprintf (file, "\t{st|stw} 0,8(1)\n"); /* Save CR if we use any that must be preserved. */ ! if (must_save_cr ()) ! asm_fprintf (file, "\t{st|stw} 12,4(1)\n"); /* Update stack and set back pointer. */ ! if (must_push) { ! if (total_size < 32767) ! asm_fprintf (file, "\t{stu|stwu} 1,%d(1)\n", - total_size); else { ! asm_fprintf (file, "\t{liu|lis} 0,%d\n\t{oril|ori} 0,0,%d\n", ! (total_size >> 16) & 0xffff, total_size & 0xffff); ! if (TARGET_POWERPC) ! asm_fprintf (file, "\tsubf 12,0,1\n"); ! else ! asm_fprintf (file, "\t{sf|subfc} 12,0,1\n"); ! asm_fprintf (file, "\t{st|stw} 1,0(12)\n\tmr 1,12\n"); } } --- 2656,2712 ---- ourself. Otherwise, call function. Note that since they are statically linked, we do not need a nop following them. */ ! if (FP_SAVE_INLINE (info->first_fp_reg_save)) { ! int regno = info->first_fp_reg_save; ! int loc = info->fp_save_offset; ! ! for ( ; regno < 64; regno++, loc += 8) ! asm_fprintf (file, "\tstfd %s,%d(%s)\n", reg_names[regno], loc, reg_names[1]); } + else if (info->first_fp_reg_save != 64) + asm_fprintf (file, "\tbl %s%d%s\n", SAVE_FP_PREFIX, + info->first_fp_reg_save - 32, SAVE_FP_SUFFIX); /* Now save gpr's. */ ! if (! TARGET_MULTIPLE || info->first_gp_reg_save == 31 || TARGET_64BIT) { ! int regno = info->first_gp_reg_save; ! int loc = info->gp_save_offset; ! int reg_size = (TARGET_64BIT) ? 8 : 4; ! for ( ; regno < 32; regno++, loc += reg_size) ! asm_fprintf (file, store_reg, reg_names[regno], loc, reg_names[1]); } ! else if (info->first_gp_reg_save != 32) ! asm_fprintf (file, "\t{stm|stmw} %s,%d(%s)\n", ! reg_names[info->first_gp_reg_save], ! info->gp_save_offset, ! reg_names[1]); /* Save lr if we used it. */ ! if (info->lr_save_p) ! asm_fprintf (file, store_reg, reg_names[0], info->lr_save_offset, reg_names[1]); /* Save CR if we use any that must be preserved. */ ! if (info->cr_save_p) ! asm_fprintf (file, store_reg, reg_names[12], info->cr_save_offset, reg_names[1]); /* Update stack and set back pointer. */ ! if (info->push_p) { ! if (info->total_size < 32767) ! asm_fprintf (file, ! (TARGET_64BIT) ? "\tstdu %s,%d(%s)\n" : "\t{stu|stwu} %s,%d(%s)\n", ! reg_names[1], - info->total_size, reg_names[1]); else { ! int neg_size = - info->total_size; ! asm_fprintf (file, "\t{liu|lis} %s,%d\n\t{oril|ori} %s,%s,%d\n", ! reg_names[0], (neg_size >> 16) & 0xffff, ! reg_names[0], reg_names[0], neg_size & 0xffff); ! asm_fprintf (file, ! (TARGET_64BIT) ? "\tstdux %s,%s,%s\n" : "\t{stux|stwux} %s,%s,%s\n", ! reg_names[1], reg_names[1], reg_names[0]); } } *************** *** 1990,1998 **** /* Set frame pointer, if needed. */ if (frame_pointer_needed) ! asm_fprintf (file, "\tmr 31,1\n"); /* If TARGET_MINIMAL_TOC, and the constant pool is needed, then load the TOC_TABLE address into register 30. */ ! if (TARGET_MINIMAL_TOC && get_pool_size () != 0) { char buf[256]; --- 2714,2722 ---- /* Set frame pointer, if needed. */ if (frame_pointer_needed) ! asm_fprintf (file, "\tmr %s,%s\n", reg_names[31], reg_names[1]); /* If TARGET_MINIMAL_TOC, and the constant pool is needed, then load the TOC_TABLE address into register 30. */ ! if (TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0) { char buf[256]; *************** *** 2007,2020 **** ASM_OUTPUT_INTERNAL_LABEL (file, "LCF", rs6000_pic_labelno); ! fprintf (file, "\tmflr 30\n"); if (TARGET_POWERPC64) ! fprintf (file, "\tld 0,"); else if (TARGET_NEW_MNEMONICS) ! fprintf (file, "\tlwz 0,"); else ! fprintf (file, "\tl 0,"); ! fprintf (file, "("); ASM_GENERATE_INTERNAL_LABEL (buf, "LCL", rs6000_pic_labelno); assemble_name (file, buf); --- 2731,2744 ---- ASM_OUTPUT_INTERNAL_LABEL (file, "LCF", rs6000_pic_labelno); ! fprintf (file, "\tmflr %s\n", reg_names[30]); if (TARGET_POWERPC64) ! fprintf (file, "\tld"); else if (TARGET_NEW_MNEMONICS) ! fprintf (file, "\tlwz"); else ! fprintf (file, "\tl"); ! fprintf (file, " %s,(", reg_names[0]); ASM_GENERATE_INTERNAL_LABEL (buf, "LCL", rs6000_pic_labelno); assemble_name (file, buf); *************** *** 2022,2047 **** ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); assemble_name (file, buf); ! fprintf (file, ")(30)\n"); ! asm_fprintf (file, "\t{cax|add} 30,0,30\n"); rs6000_pic_labelno++; } ! else if (TARGET_NO_TOC) { ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); ! asm_fprintf (file, "\t{cau|addis} 30,0,"); assemble_name (file, buf); asm_fprintf (file, "@ha\n"); ! asm_fprintf (file, "\t{cal|addi} 30,30,"); ! assemble_name (file, buf); ! asm_fprintf (file, "@l\n"); } else #endif /* USING_SVR4_H */ - { - ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 0); - asm_fprintf (file, "\t{l|lwz} 30,"); - assemble_name (file, buf); - asm_fprintf (file, "(2)\n"); - } } } --- 2746,2782 ---- ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); assemble_name (file, buf); ! fprintf (file, ")(%s)\n", reg_names[30]); ! asm_fprintf (file, "\t{cax|add} %s,%s,%s\n", ! reg_names[30], reg_names[0], reg_names[30]); rs6000_pic_labelno++; } ! else if (!TARGET_64BIT) { ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); ! asm_fprintf (file, "\t{cau|addis} %s,%s,", reg_names[30], reg_names[0]); assemble_name (file, buf); asm_fprintf (file, "@ha\n"); ! if (TARGET_NEW_MNEMONICS) ! { ! asm_fprintf (file, "\taddi %s,%s,", reg_names[30], reg_names[30]); ! assemble_name (file, buf); ! asm_fprintf (file, "@l\n"); ! } ! else ! { ! asm_fprintf (file, "\tcal %s,", reg_names[30]); ! assemble_name (file, buf); ! asm_fprintf (file, "@l(%s)\n", reg_names[30]); ! } } else + abort (); + + #else /* !USING_SVR4_H */ + ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 0); + asm_fprintf (file, "\t{l|lwz} %s,", reg_names[30]); + assemble_name (file, buf); + asm_fprintf (file, "(%s)\n", reg_names[2]); #endif /* USING_SVR4_H */ } } *************** *** 2054,2066 **** int size; { ! int first_reg = first_reg_to_save (); ! int must_push = rs6000_pushes_stack (); ! int first_fp_reg = first_fp_reg_to_save (); ! int basic_size = rs6000_sa_size (); ! int total_size = (basic_size + size + current_function_outgoing_args_size); rtx insn = get_last_insn (); ! /* Round size to multiple of 8 bytes. */ ! total_size = (total_size + 7) & ~7; /* If the last insn was a BARRIER, we don't have to write anything except --- 2789,2800 ---- int size; { ! rs6000_stack_t *info = rs6000_stack_info (); ! char *load_reg = (TARGET_64BIT) ? "\tld %s,%d(%s)" : "\t{l|lwz} %s,%d(%s)\n"; rtx insn = get_last_insn (); + int i; ! /* Forget about any temporaries created */ ! for (i = 0; i < NUM_MACHINE_MODES; i++) ! stack_temps[i] = NULL_RTX; /* If the last insn was a BARRIER, we don't have to write anything except *************** *** 2074,2142 **** we know what size to update it with. */ if (frame_pointer_needed || current_function_calls_alloca ! || total_size > 32767) ! asm_fprintf (file, "\t{l|lwz} 1,0(1)\n"); ! else if (must_push) ! asm_fprintf (file, "\t{cal 1,%d(1)|addi 1,1,%d}\n", total_size); /* Get the old lr if we saved it. */ ! if (regs_ever_live[65]) ! asm_fprintf (file, "\t{l|lwz} 0,8(1)\n"); /* Get the old cr if we saved it. */ ! if (must_save_cr ()) ! asm_fprintf (file, "\t{l|lwz} 12,4(1)\n"); /* Set LR here to try to overlap restores below. */ ! if (regs_ever_live[65]) ! asm_fprintf (file, "\tmtlr 0\n"); /* Restore gpr's. */ ! if (! TARGET_MULTIPLE || first_reg == 31) { ! int regno, loc; ! for (regno = first_reg, ! loc = - (32 - first_reg) * 4 - (64 - first_fp_reg) * 8; ! regno < 32; ! regno++, loc += 4) ! asm_fprintf (file, "\t{l|lwz} %d,%d(1)\n", regno, loc); } ! else if (first_reg != 32) ! asm_fprintf (file, "\t{lm|lmw} %d,%d(1)\n", first_reg, ! - (32 - first_reg) * 4 - (64 - first_fp_reg) * 8); /* Restore fpr's if we can do it without calling a function. */ ! if (first_fp_reg == 62) ! asm_fprintf (file, "\tlfd 30,-16(1)\n\tlfd 31,-8(1)\n"); ! else if (first_fp_reg == 63) ! asm_fprintf (file, "\tlfd 31,-8(1)\n"); /* If we saved cr, restore it here. Just those of cr2, cr3, and cr4 that were used. */ ! if (must_save_cr ()) ! asm_fprintf (file, "\tmtcrf %d,12\n", (regs_ever_live[70] != 0) * 0x20 + (regs_ever_live[71] != 0) * 0x10 ! + (regs_ever_live[72] != 0) * 0x8); /* If we have to restore more than two FP registers, branch to the restore function. It will return to our caller. */ ! if (first_fp_reg < 62) ! { ! #ifndef USING_SVR4_H ! asm_fprintf (file, "\tb %s%d%s\n", RESTORE_FP_PREFIX, first_fp_reg - 32, RESTORE_FP_SUFFIX); ! #else ! int regno, loc; ! ! for (regno = first_fp_reg, ! loc = - (64 - first_fp_reg) * 8; ! regno < 64; ! regno++, loc += 8) ! asm_fprintf (file, "\tlfd %d,%d(1)\n", regno - 32, loc); ! ! asm_fprintf (file, "\t{br|blr}\n"); ! #endif ! } else asm_fprintf (file, "\t{br|blr}\n"); --- 2808,2873 ---- we know what size to update it with. */ if (frame_pointer_needed || current_function_calls_alloca ! || info->total_size > 32767) ! asm_fprintf (file, load_reg, reg_names[1], 0, reg_names[1]); ! else if (info->push_p) ! { ! if (TARGET_NEW_MNEMONICS) ! asm_fprintf (file, "\taddi %s,%s,%d\n", reg_names[1], reg_names[1], info->total_size); ! else ! asm_fprintf (file, "\tcal %s,%d(%s)\n", reg_names[1], info->total_size, reg_names[1]); ! } /* Get the old lr if we saved it. */ ! if (info->lr_save_p) ! asm_fprintf (file, load_reg, reg_names[0], info->lr_save_offset, reg_names[1]); /* Get the old cr if we saved it. */ ! if (info->cr_save_p) ! asm_fprintf (file, load_reg, reg_names[12], info->cr_save_offset, reg_names[1]); /* Set LR here to try to overlap restores below. */ ! if (info->lr_save_p) ! asm_fprintf (file, "\tmtlr %s\n", reg_names[0]); /* Restore gpr's. */ ! if (! TARGET_MULTIPLE || info->first_gp_reg_save == 31 || TARGET_64BIT) { ! int regno = info->first_gp_reg_save; ! int loc = info->gp_save_offset; ! int reg_size = (TARGET_64BIT) ? 8 : 4; ! for ( ; regno < 32; regno++, loc += reg_size) ! asm_fprintf (file, load_reg, reg_names[regno], loc, reg_names[1]); } ! else if (info->first_gp_reg_save != 32) ! asm_fprintf (file, "\t{lm|lmw} %s,%d(%s)\n", ! reg_names[info->first_gp_reg_save], ! info->gp_save_offset, ! reg_names[1]); /* Restore fpr's if we can do it without calling a function. */ ! if (FP_SAVE_INLINE (info->first_fp_reg_save)) ! { ! int regno = info->first_fp_reg_save; ! int loc = info->fp_save_offset; ! ! for ( ; regno < 64; regno++, loc += 8) ! asm_fprintf (file, "\tlfd %s,%d(%s)\n", reg_names[regno], loc, reg_names[1]); ! } /* If we saved cr, restore it here. Just those of cr2, cr3, and cr4 that were used. */ ! if (info->cr_save_p) ! asm_fprintf (file, "\tmtcrf %d,%s\n", (regs_ever_live[70] != 0) * 0x20 + (regs_ever_live[71] != 0) * 0x10 ! + (regs_ever_live[72] != 0) * 0x8, reg_names[12]); /* If we have to restore more than two FP registers, branch to the restore function. It will return to our caller. */ ! if (info->first_fp_reg_save != 64 && !FP_SAVE_INLINE (info->first_fp_reg_save)) ! asm_fprintf (file, "\tb %s%d%s\n", RESTORE_FP_PREFIX, ! info->first_fp_reg_save - 32, RESTORE_FP_SUFFIX); else asm_fprintf (file, "\t{br|blr}\n"); *************** *** 2212,2216 **** function logs/aborts fp operations. */ /* Assume that fp operations are used if any fp reg must be saved. */ ! fprintf (file, "%d,", (1 << 5) | ((first_fp_reg != 64) << 1)); /* 6 bitfields: function is interrupt handler, name present in --- 2943,2947 ---- function logs/aborts fp operations. */ /* Assume that fp operations are used if any fp reg must be saved. */ ! fprintf (file, "%d,", (1 << 5) | ((info->first_fp_reg_save != 64) << 1)); /* 6 bitfields: function is interrupt handler, name present in *************** *** 2222,2226 **** fprintf (file, "%d,", ((1 << 6) | (frame_pointer_needed << 5) ! | (must_save_cr () << 1) | (regs_ever_live[65]))); /* 3 bitfields: saves backchain, spare bit, number of fpr saved --- 2953,2957 ---- fprintf (file, "%d,", ((1 << 6) | (frame_pointer_needed << 5) ! | (info->cr_save_p << 1) | (info->lr_save_p))); /* 3 bitfields: saves backchain, spare bit, number of fpr saved *************** *** 2227,2231 **** (6 bits). */ fprintf (file, "%d,", ! (must_push << 7) | (64 - first_fp_reg_to_save ())); /* 2 bitfields: spare bits (2 bits), number of gpr saved (6 bits). */ --- 2958,2962 ---- (6 bits). */ fprintf (file, "%d,", ! (info->push_p << 7) | (64 - info->first_fp_reg_save)); /* 2 bitfields: spare bits (2 bits), number of gpr saved (6 bits). */ *************** *** 2336,2339 **** --- 3067,3073 ---- } #endif /* !USING_SVR4_H */ + + /* Reset varargs indicator */ + rs6000_sysv_varargs_p = 0; } *************** *** 2351,2354 **** --- 3085,3101 ---- rtx base = x; int offset = 0; + + if (TARGET_NO_TOC) + abort (); + + /* if we're going to put a double constant in the TOC, make sure it's + aligned properly when strict alignment is on. */ + if (GET_CODE (x) == CONST_DOUBLE + && STRICT_ALIGNMENT + && GET_MODE (x) == DFmode + && ! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC)) { + ASM_OUTPUT_ALIGN (file, 3); + } + #ifdef USING_SVR4_H diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/rs6000.h gcc-2.7.1/config/rs6000/rs6000.h *** gcc-2.7.0/config/rs6000/rs6000.h Thu Jun 15 16:28:37 1995 --- gcc-2.7.1/config/rs6000/rs6000.h Wed Nov 8 08:53:00 1995 *************** *** 63,77 **** %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=403: -D_ARCH_PPC} \ - %{mcpu=mpc403: -D_ARCH_PPC} \ - %{mcpu=ppc403: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=mpc601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=ppc601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=603: -D_ARCH_PPC} \ ! %{mcpu=mpc603: -D_ARCH_PPC} \ ! %{mcpu=ppc603: -D_ARCH_PPC} \ ! %{mcpu=604: -D_ARCH_PPC} \ ! %{mcpu=mpc604: -D_ARCH_PPC} \ ! %{mcpu=ppc604: -D_ARCH_PPC}" /* Define the options for the binder: Start text at 512, align all segments --- 63,69 ---- %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=403: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=603: -D_ARCH_PPC} \ ! %{mcpu=604: -D_ARCH_PPC}" /* Define the options for the binder: Start text at 512, align all segments *************** *** 159,162 **** --- 151,158 ---- #define MASK_STRING_SET 0x8000 + /* Temporary debug switches */ + #define MASK_DEBUG_STACK 0x10000 + #define MASK_DEBUG_ARG 0x20000 + #define TARGET_POWER (target_flags & MASK_POWER) #define TARGET_POWER2 (target_flags & MASK_POWER2) *************** *** 175,181 **** --- 171,191 ---- #define TARGET_STRING (target_flags & MASK_STRING) #define TARGET_STRING_SET (target_flags & MASK_STRING_SET) + #define TARGET_DEBUG_STACK (target_flags & MASK_DEBUG_STACK) + #define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG) #define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT) + /* Pseudo target to indicate whether the object format is ELF + (to get around not having conditional compilation in the md file) */ + #ifndef TARGET_ELF + #define TARGET_ELF 0 + #endif + + /* If this isn't V.4, don't support -mno-toc. */ + #ifndef TARGET_NO_TOC + #define TARGET_NO_TOC 0 + #define TARGET_TOC 1 + #endif + /* Run-time compilation parameters selecting different hardware subsets. *************** *** 224,227 **** --- 234,239 ---- {"no-string", - MASK_STRING}, \ {"no-string", MASK_STRING_SET}, \ + {"debug-stack", MASK_DEBUG_STACK}, \ + {"debug-arg", MASK_DEBUG_ARG}, \ SUBTARGET_SWITCHES \ {"", TARGET_DEFAULT}} *************** *** 842,845 **** --- 854,890 ---- /* Stack layout; function entry, exit and calling. */ + /* Enumeration to give which calling sequence to use. */ + enum rs6000_abi { + ABI_NONE, + ABI_AIX, /* IBM's AIX */ + ABI_V4 /* System V.4/eabi */ + }; + + /* Structure used to define the rs6000 stack */ + typedef struct rs6000_stack { + int first_gp_reg_save; /* first callee saved GP register used */ + int first_fp_reg_save; /* first callee saved FP register used */ + int lr_save_p; /* true if the link reg needs to be saved */ + int cr_save_p; /* true if the CR reg needs to be saved */ + int push_p; /* true if we need to allocate stack space */ + int calls_p; /* true if the function makes any calls */ + enum rs6000_abi abi; /* which ABI to use */ + int gp_save_offset; /* offset to save GP regs from initial SP */ + int fp_save_offset; /* offset to save FP regs from initial SP */ + int lr_save_offset; /* offset to save LR from initial SP */ + int cr_save_offset; /* offset to save CR from initial SP */ + int varargs_save_offset; /* offset to save the varargs registers */ + int reg_size; /* register size (4 or 8) */ + int varargs_size; /* size to hold V.4 args passed in regs */ + int vars_size; /* variable save area size */ + int parm_size; /* outgoing parameter size */ + int save_size; /* save area size */ + int fixed_size; /* fixed size of stack frame */ + int gp_size; /* size of saved GP registers */ + int fp_size; /* size of saved FP registers */ + int cr_size; /* size to hold CR if not in save_size */ + int total_size; /* total bytes allocated for stack */ + } rs6000_stack_t; + /* Define this if pushing a word on the stack makes the stack pointer a smaller address. */ *************** *** 855,858 **** --- 900,926 ---- /* #define FRAME_GROWS_DOWNWARD */ + /* Size of the outgoing register save area */ + #define RS6000_REG_SAVE (TARGET_64BIT ? 64 : 32) + + /* Size of the fixed area on the stack */ + #define RS6000_SAVE_AREA (TARGET_64BIT ? 48 : 24) + + /* Size of the V.4 varargs area if needed */ + #define RS6000_VARARGS_AREA 0 + + /* Whether a V.4 varargs area is needed */ + extern int rs6000_sysv_varargs_p; + + /* Align an address */ + #define ALIGN(n,a) (((n) + (a) - 1) & ~((a) - 1)) + + /* Size of V.4 varargs area in bytes */ + #define RS6000_VARARGS_SIZE \ + ((GP_ARG_NUM_REG * (TARGET_64BIT ? 8 : 4)) + (FP_ARG_NUM_REG * 8) + 8) + + /* Offset of V.4 varargs area */ + #define RS6000_VARARGS_OFFSET \ + (ALIGN (current_function_outgoing_args_size, 8) + RS6000_SAVE_AREA) + /* Offset within stack frame to start allocating local variables at. If FRAME_GROWS_DOWNWARD, this is the offset to the END of the *************** *** 864,869 **** outgoing parameter area. */ ! #define STARTING_FRAME_OFFSET (current_function_outgoing_args_size \ ! + (TARGET_64BIT ? 48 : 24)) /* If we generate an insn to push BYTES bytes, --- 932,938 ---- outgoing parameter area. */ ! #define STARTING_FRAME_OFFSET (ALIGN (current_function_outgoing_args_size, 8) \ ! + RS6000_VARARGS_AREA \ ! + RS6000_SAVE_AREA) /* If we generate an insn to push BYTES bytes, *************** *** 875,879 **** On the RS/6000, we define the argument pointer to the start of the fixed area. */ ! #define FIRST_PARM_OFFSET(FNDECL) (TARGET_64BIT ? 48 : 24) /* Define this if stack space is still allocated for a parameter passed --- 944,948 ---- On the RS/6000, we define the argument pointer to the start of the fixed area. */ ! #define FIRST_PARM_OFFSET(FNDECL) RS6000_SAVE_AREA /* Define this if stack space is still allocated for a parameter passed *************** *** 880,884 **** in a register. The value is the number of bytes allocated to this area. */ ! #define REG_PARM_STACK_SPACE(FNDECL) (TARGET_64BIT ? 64 : 32) /* Define this if the above stack space is to be considered part of the --- 949,953 ---- in a register. The value is the number of bytes allocated to this area. */ ! #define REG_PARM_STACK_SPACE(FNDECL) RS6000_REG_SAVE /* Define this if the above stack space is to be considered part of the *************** *** 889,893 **** For the RS/6000, sp points past the fixed area. */ ! #define STACK_POINTER_OFFSET (TARGET_64BIT ? 48 : 24) /* Define this if the maximum size of all the outgoing args is to be --- 958,962 ---- For the RS/6000, sp points past the fixed area. */ ! #define STACK_POINTER_OFFSET RS6000_SAVE_AREA /* Define this if the maximum size of all the outgoing args is to be *************** *** 931,934 **** --- 1000,1020 ---- (TYPE_MODE (TYPE) == BLKmode) + /* Minimum and maximum general purpose registers used to hold arguments. */ + #define GP_ARG_MIN_REG 3 + #define GP_ARG_MAX_REG 10 + #define GP_ARG_NUM_REG (GP_ARG_MAX_REG - GP_ARG_MIN_REG + 1) + + /* Minimum and maximum floating point registers used to hold arguments. */ + #define FP_ARG_MIN_REG 33 + #define FP_ARG_MAX_REG 45 + #define FP_ARG_NUM_REG (FP_ARG_MAX_REG - FP_ARG_MIN_REG + 1) + + /* Return registers */ + #define GP_ARG_RETURN GP_ARG_MIN_REG + #define FP_ARG_RETURN FP_ARG_MIN_REG + + /* Define cutoff for using external functions to save floating point */ + #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) == 62 || (FIRST_REG) == 63) + /* 1 if N is a possible register number for a function value as seen by the caller. *************** *** 935,946 **** On RS/6000, this is r3 and fp1. */ - #define FUNCTION_VALUE_REGNO_P(N) ((N) == 3 || ((N) == 33)) - /* 1 if N is a possible register number for function argument passing. On RS/6000, these are r3-r10 and fp1-fp13. */ - #define FUNCTION_ARG_REGNO_P(N) \ - (((N) <= 10 && (N) >= 3) || ((N) >= 33 && (N) <= 45)) /* Define a data type for recording info about an argument list --- 1021,1032 ---- On RS/6000, this is r3 and fp1. */ + #define FUNCTION_VALUE_REGNO_P(N) ((N) == GP_ARG_RETURN || ((N) == FP_ARG_RETURN)) /* 1 if N is a possible register number for function argument passing. On RS/6000, these are r3-r10 and fp1-fp13. */ + #define FUNCTION_ARG_REGNO_P(N) \ + (((unsigned)((N) - GP_ARG_MIN_REG) < (unsigned)(GP_ARG_NUM_REG)) \ + || ((unsigned)((N) - FP_ARG_MIN_REG) < (unsigned)(FP_ARG_NUM_REG))) /* Define a data type for recording info about an argument list *************** *** 953,960 **** total argument words, the second is used to store the next floating-point register number, and the third says how many more args we ! have prototype types for. */ ! struct rs6000_args {int words, fregno, nargs_prototype; }; ! #define CUMULATIVE_ARGS struct rs6000_args /* Define intermediate macro to compute the size (in registers) of an argument --- 1039,1057 ---- total argument words, the second is used to store the next floating-point register number, and the third says how many more args we ! have prototype types for. ! The System V.4 varargs/stdarg support requires that this structure's size ! be a multiple of sizeof(int), and that WORDS, FREGNO, NARGS_PROTOTYPE, ! ORIG_NARGS, and VARARGS_OFFSET be the first five ints. */ ! ! typedef struct rs6000_args ! { ! int words; /* # words uses for passing GP registers */ ! int fregno; /* next available FP register */ ! int nargs_prototype; /* # args left in the current prototype */ ! int orig_nargs; /* Original value of nargs_prototype */ ! int varargs_offset; /* offset of the varargs save area */ ! int prototype; /* Whether a prototype was defined */ ! } CUMULATIVE_ARGS; /* Define intermediate macro to compute the size (in registers) of an argument *************** *** 971,982 **** For a library call, FNTYPE is 0. */ ! #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME) \ ! (CUM).words = 0, \ ! (CUM).fregno = 33, \ ! (CUM).nargs_prototype = (FNTYPE && TYPE_ARG_TYPES (FNTYPE) \ ! ? (list_length (TYPE_ARG_TYPES (FNTYPE)) - 1 \ ! + (TYPE_MODE (TREE_TYPE (FNTYPE)) == BLKmode \ ! || RETURN_IN_MEMORY (TREE_TYPE (FNTYPE)))) \ ! : 0) /* Similar, but when scanning the definition of a procedure. We always --- 1068,1073 ---- For a library call, FNTYPE is 0. */ ! #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME) \ ! init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE) /* Similar, but when scanning the definition of a procedure. We always *************** *** 983,990 **** set NARGS_PROTOTYPE large so we never return an EXPR_LIST. */ ! #define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,IGNORE) \ ! (CUM).words = 0, \ ! (CUM).fregno = 33, \ ! (CUM).nargs_prototype = 1000 /* Update the data in CUM to advance over an argument --- 1074,1079 ---- set NARGS_PROTOTYPE large so we never return an EXPR_LIST. */ ! #define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,LIBNAME) \ ! init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE) /* Update the data in CUM to advance over an argument *************** *** 993,1008 **** #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ ! { (CUM).nargs_prototype--; \ ! if (NAMED) \ ! { \ ! (CUM).words += RS6000_ARG_SIZE (MODE, TYPE, NAMED); \ ! if (GET_MODE_CLASS (MODE) == MODE_FLOAT) \ ! (CUM).fregno++; \ ! } \ ! } /* Non-zero if we can use a floating-point register to pass this arg. */ ! #define USE_FP_FOR_ARG_P(CUM,MODE,TYPE) \ ! (GET_MODE_CLASS (MODE) == MODE_FLOAT && (CUM).fregno < 46 && TARGET_HARD_FLOAT) /* Determine where to put an argument to a function. --- 1082,1092 ---- #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ ! function_arg_advance (&CUM, MODE, TYPE, NAMED) /* Non-zero if we can use a floating-point register to pass this arg. */ ! #define USE_FP_FOR_ARG_P(CUM,MODE,TYPE) \ ! (GET_MODE_CLASS (MODE) == MODE_FLOAT \ ! && (CUM).fregno <= FP_ARG_MAX_REG \ ! && TARGET_HARD_FLOAT) /* Determine where to put an argument to a function. *************** *** 1028,1044 **** doesn't support EXPR_LIST anyway. */ ! #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ ! (! (NAMED) ? 0 \ ! : ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST) ? 0 \ ! : USE_FP_FOR_ARG_P (CUM, MODE, TYPE) \ ! ? ((CUM).nargs_prototype > 0 || (TYPE) == 0 \ ! ? gen_rtx (REG, MODE, (CUM).fregno) \ ! : ((CUM).words < 8 \ ! ? gen_rtx (EXPR_LIST, VOIDmode, \ ! gen_rtx (REG, (MODE), 3 + (CUM).words), \ ! gen_rtx (REG, (MODE), (CUM).fregno)) \ ! : gen_rtx (EXPR_LIST, VOIDmode, 0, \ ! gen_rtx (REG, (MODE), (CUM).fregno)))) \ ! : (CUM).words < 8 ? gen_rtx(REG, (MODE), 3 + (CUM).words) : 0) /* For an arg passed partly in registers and partly in memory, --- 1112,1117 ---- doesn't support EXPR_LIST anyway. */ ! #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ ! function_arg (&CUM, MODE, TYPE, NAMED) /* For an arg passed partly in registers and partly in memory, *************** *** 1046,1056 **** For args passed entirely in registers or entirely in memory, zero. */ ! #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ ! (! (NAMED) ? 0 \ ! : USE_FP_FOR_ARG_P (CUM, MODE, TYPE) && (CUM).nargs_prototype >= 0 ? 0 \ ! : (((CUM).words < 8 \ ! && 8 < ((CUM).words + RS6000_ARG_SIZE (MODE, TYPE, NAMED))) \ ! ? 8 - (CUM).words : 0)) /* Perform any needed actions needed for a function that is receiving a variable number of arguments. --- 1119,1134 ---- For args passed entirely in registers or entirely in memory, zero. */ ! #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ ! function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED) + /* A C expression that indicates when an argument must be passed by + reference. If nonzero for an argument, a copy of that argument is + made in memory and a pointer to the argument is passed instead of + the argument itself. The pointer is passed in whatever way is + appropriate for passing a pointer to that type. */ + + #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ + function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED) + /* Perform any needed actions needed for a function that is receiving a variable number of arguments. *************** *** 1067,1092 **** stack and set PRETEND_SIZE to the length of the registers pushed. */ ! #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \ ! { if ((CUM).words < 8) \ ! { \ ! int first_reg_offset = (CUM).words; \ ! \ ! if (MUST_PASS_IN_STACK (MODE, TYPE)) \ ! first_reg_offset += RS6000_ARG_SIZE (TYPE_MODE (TYPE), TYPE, 1); \ ! \ ! if (first_reg_offset > 8) \ ! first_reg_offset = 8; \ ! \ ! if (! (NO_RTL) && first_reg_offset != 8) \ ! move_block_from_reg \ ! (3 + first_reg_offset, \ ! gen_rtx (MEM, BLKmode, \ ! plus_constant (virtual_incoming_args_rtx, \ ! first_reg_offset * 4)), \ ! 8 - first_reg_offset, (8 - first_reg_offset) * UNITS_PER_WORD); \ ! PRETEND_SIZE = (8 - first_reg_offset) * UNITS_PER_WORD; \ ! } \ ! } /* This macro generates the assembly code for function entry. FILE is a stdio stream to output the code to. --- 1145,1166 ---- stack and set PRETEND_SIZE to the length of the registers pushed. */ ! #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \ ! setup_incoming_varargs (&CUM, MODE, TYPE, &PRETEND_SIZE, NO_RTL) ! ! /* If defined, is a C expression that produces the machine-specific ! code for a call to `__builtin_saveregs'. This code will be moved ! to the very beginning of the function, before any parameter access ! are made. The return value of this function should be an RTX that ! contains the value to use as the return of `__builtin_saveregs'. ! ! The argument ARGS is a `tree_list' containing the arguments that ! were passed to `__builtin_saveregs'. ! ! If this macro is not defined, the compiler will output an ordinary ! call to the library function `__builtin_saveregs'. */ + #define EXPAND_BUILTIN_SAVEREGS(ARGS) \ + expand_builtin_saveregs (ARGS) + /* This macro generates the assembly code for function entry. FILE is a stdio stream to output the code to. *************** *** 1173,1176 **** --- 1247,1259 ---- (mrs) */ /* #define RETURN_ADDR_IN_PREVIOUS_FRAME */ + + /* Number of bytes into the frame return addresses can be found. */ + #ifndef TARGET_V4_CALLS + #define RETURN_ADDRESS_OFFSET 8 + #else + #define RETURN_ADDRESS_OFFSET \ + ((TARGET_V4_CALLS) ? (TARGET_64BIT ? 8 : 4) : 8) + #endif + /* The current return address is in link register (65). The return address of anything farther back is accessed normally at an offset of 8 from the *************** *** 1179,1187 **** ((count == -1) \ ? gen_rtx (REG, Pmode, 65) \ ! : copy_to_reg (gen_rtx (MEM, Pmode, \ ! memory_address (Pmode, \ ! plus_constant (copy_to_reg (gen_rtx (MEM, Pmode, \ ! memory_address (Pmode, frame))), \ ! 8))))) /* Definitions for register eliminations. --- 1262,1270 ---- ((count == -1) \ ? gen_rtx (REG, Pmode, 65) \ ! : gen_rtx (MEM, Pmode, \ ! memory_address (Pmode, \ ! plus_constant (copy_to_reg (gen_rtx (MEM, Pmode, \ ! memory_address (Pmode, frame))), \ ! RETURN_ADDRESS_OFFSET)))) /* Definitions for register eliminations. *************** *** 1213,1217 **** to convert ap into fp, not sp. ! We need r30 if -mmininal-toc was specified, and there are constant pool references. */ --- 1296,1300 ---- to convert ap into fp, not sp. ! We need r30 if -mminimal-toc was specified, and there are constant pool references. */ *************** *** 1219,1223 **** ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ ? ! frame_pointer_needed \ ! : (FROM) == 30 ? ! TARGET_MINIMAL_TOC || get_pool_size () == 0 \ : 1) --- 1302,1306 ---- ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ ? ! frame_pointer_needed \ ! : (FROM) == 30 ? ! TARGET_MINIMAL_TOC || TARGET_NO_TOC || get_pool_size () == 0 \ : 1) *************** *** 1226,1250 **** #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ { \ ! int total_stack_size = (rs6000_sa_size () + get_frame_size () \ ! + current_function_outgoing_args_size); \ ! \ ! total_stack_size = (total_stack_size + 7) & ~7; \ \ if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ ! { \ ! if (rs6000_pushes_stack ()) \ ! (OFFSET) = 0; \ ! else \ ! (OFFSET) = - total_stack_size; \ ! } \ ! else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \ ! (OFFSET) = total_stack_size; \ ! else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ ! { \ ! if (rs6000_pushes_stack ()) \ ! (OFFSET) = total_stack_size; \ ! else \ ! (OFFSET) = 0; \ ! } \ else if ((FROM) == 30) \ (OFFSET) = 0; \ --- 1309,1320 ---- #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ { \ ! rs6000_stack_t *info = rs6000_stack_info (); \ \ if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ ! (OFFSET) = (info->push_p) ? 0 : - info->total_size; \ ! else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \ ! (OFFSET) = info->total_size; \ ! else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ ! (OFFSET) = (info->push_p) ? info->total_size : 0; \ else if ((FROM) == 30) \ (OFFSET) = 0; \ *************** *** 1350,1354 **** #define LEGITIMATE_CONSTANT_POOL_BASE_P(X) \ ! (GET_CODE (X) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (X) \ && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (X))) --- 1420,1425 ---- #define LEGITIMATE_CONSTANT_POOL_BASE_P(X) \ ! (TARGET_TOC && GET_CODE (X) == SYMBOL_REF \ ! && CONSTANT_POOL_ADDRESS_P (X) \ && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (X))) *************** *** 1355,1359 **** #define LEGITIMATE_CONSTANT_POOL_ADDRESS_P(X) \ (LEGITIMATE_CONSTANT_POOL_BASE_P (X) \ ! || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT \ && LEGITIMATE_CONSTANT_POOL_BASE_P (XEXP (XEXP (X, 0), 0)))) --- 1426,1431 ---- #define LEGITIMATE_CONSTANT_POOL_ADDRESS_P(X) \ (LEGITIMATE_CONSTANT_POOL_BASE_P (X) \ ! || (TARGET_TOC \ ! && GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT \ && LEGITIMATE_CONSTANT_POOL_BASE_P (XEXP (XEXP (X, 0), 0)))) *************** *** 1383,1386 **** --- 1455,1468 ---- (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) + #define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X) \ + (TARGET_ELF \ + && (MODE) != DImode \ + && (MODE) != TImode \ + && (TARGET_HARD_FLOAT || (MODE) != DFmode) \ + && GET_CODE (X) == LO_SUM \ + && GET_CODE (XEXP (X, 0)) == REG \ + && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ + && CONSTANT_P (XEXP (X, 1))) + #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ { if (LEGITIMATE_INDIRECT_ADDRESS_P (X)) \ *************** *** 1400,1403 **** --- 1482,1487 ---- && LEGITIMATE_INDEXED_ADDRESS_P (X)) \ goto ADDR; \ + if (LEGITIMATE_LO_SUM_ADDRESS_P (MODE, X)) \ + goto ADDR; \ } *************** *** 1425,1454 **** load the other things into a register and return the sum. */ ! #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ ! { if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \ ! && GET_CODE (XEXP (X, 1)) == CONST_INT \ ! && (unsigned) (INTVAL (XEXP (X, 1)) + 0x8000) >= 0x10000) \ ! { int high_int, low_int; \ ! high_int = INTVAL (XEXP (X, 1)) >> 16; \ ! low_int = INTVAL (XEXP (X, 1)) & 0xffff; \ ! if (low_int & 0x8000) \ ! high_int += 1, low_int |= 0xffff0000; \ ! (X) = gen_rtx (PLUS, SImode, \ ! force_operand \ ! (gen_rtx (PLUS, SImode, XEXP (X, 0), \ ! gen_rtx (CONST_INT, VOIDmode, \ ! high_int << 16)), 0),\ ! gen_rtx (CONST_INT, VOIDmode, low_int)); \ ! goto WIN; \ ! } \ ! else if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \ ! && GET_CODE (XEXP (X, 1)) != CONST_INT \ ! && (TARGET_HARD_FLOAT || (MODE) != DFmode) \ ! && (MODE) != DImode && (MODE) != TImode) \ ! { \ ! (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ force_reg (SImode, force_operand (XEXP (X, 1), 0))); \ ! goto WIN; \ ! } \ } --- 1509,1548 ---- load the other things into a register and return the sum. */ ! #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ ! { if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \ ! && GET_CODE (XEXP (X, 1)) == CONST_INT \ ! && (unsigned) (INTVAL (XEXP (X, 1)) + 0x8000) >= 0x10000) \ ! { int high_int, low_int; \ ! high_int = INTVAL (XEXP (X, 1)) >> 16; \ ! low_int = INTVAL (XEXP (X, 1)) & 0xffff; \ ! if (low_int & 0x8000) \ ! high_int += 1, low_int |= 0xffff0000; \ ! (X) = gen_rtx (PLUS, SImode, \ ! force_operand \ ! (gen_rtx (PLUS, SImode, XEXP (X, 0), \ ! gen_rtx (CONST_INT, VOIDmode, \ ! high_int << 16)), 0), \ ! gen_rtx (CONST_INT, VOIDmode, low_int)); \ ! goto WIN; \ ! } \ ! else if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \ ! && GET_CODE (XEXP (X, 1)) != CONST_INT \ ! && (TARGET_HARD_FLOAT || (MODE) != DFmode) \ ! && (MODE) != DImode && (MODE) != TImode) \ ! { \ ! (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ force_reg (SImode, force_operand (XEXP (X, 1), 0))); \ ! goto WIN; \ ! } \ ! else if (TARGET_ELF && !TARGET_64BIT && TARGET_NO_TOC \ ! && GET_CODE (X) != CONST_INT \ ! && GET_CODE (X) != CONST_DOUBLE && CONSTANT_P (X) \ ! && (TARGET_HARD_FLOAT || (MODE) != DFmode) \ ! && (MODE) != DImode && (MODE) != TImode) \ ! { \ ! rtx reg = gen_reg_rtx (Pmode); \ ! emit_insn (gen_elf_high (reg, (X))); \ ! (X) = gen_rtx (LO_SUM, Pmode, reg, (X)); \ ! } \ } *************** *** 1471,1474 **** --- 1565,1570 ---- if (GET_CODE (ADDR) == PRE_DEC) \ goto LABEL; \ + if (GET_CODE (ADDR) == LO_SUM) \ + goto LABEL; \ } *************** *** 1543,1546 **** --- 1639,1644 ---- #define FASCIST_ASSEMBLER + #define ASM_OUTPUT_CONSTRUCTOR(file, name) + #define ASM_OUTPUT_DESTRUCTOR(file, name) /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits *************** *** 1570,1574 **** have been dropped from the PowerPC architecture. */ ! #define SHIFT_COUNT_TRUNCATED TARGET_POWER ? 1 : 0 /* Use atexit for static constructors/destructors, instead of defining --- 1668,1672 ---- have been dropped from the PowerPC architecture. */ ! #define SHIFT_COUNT_TRUNCATED (TARGET_POWER ? 1 : 0) /* Use atexit for static constructors/destructors, instead of defining *************** *** 1584,1588 **** always returns 0. */ ! #define CONST_COSTS(RTX,CODE,OUTER_CODE) \ case CONST_INT: \ case CONST: \ --- 1682,1686 ---- always returns 0. */ ! #define CONST_COSTS(RTX,CODE,OUTER_CODE) \ case CONST_INT: \ case CONST: \ *************** *** 1590,1593 **** --- 1688,1692 ---- case SYMBOL_REF: \ case CONST_DOUBLE: \ + case HIGH: \ return 0; *************** *** 1719,1722 **** --- 1818,1827 ---- /* Control the assembler format that we output. */ + /* Common macro to output the options used to the asm file. */ + #define ASM_OUTPUT_OPTIONS(FILE) \ + output_options (FILE, \ + f_options, sizeof (f_options) / sizeof (f_options[0]), \ + W_options, sizeof (W_options) / sizeof (W_options[0])) \ + /* Output at beginning of assembler file. *************** *** 1736,1739 **** --- 1841,1845 ---- #define ASM_FILE_START(FILE) \ { \ + ASM_OUTPUT_OPTIONS (FILE); \ rs6000_gen_section_name (&xcoff_bss_section_name, \ main_input_filename, ".bss_"); \ *************** *** 1903,1907 **** RS6000_OUTPUT_BASENAME (FILE, NAME); \ fprintf (FILE, ", TOC[tc0], 0\n"); \ ! fprintf (FILE, ".csect .text[PR]\n."); \ RS6000_OUTPUT_BASENAME (FILE, NAME); \ fprintf (FILE, ":\n"); \ --- 2009,2013 ---- RS6000_OUTPUT_BASENAME (FILE, NAME); \ fprintf (FILE, ", TOC[tc0], 0\n"); \ ! fprintf (FILE, ".csect .text[PR]\n."); \ RS6000_OUTPUT_BASENAME (FILE, NAME); \ fprintf (FILE, ":\n"); \ *************** *** 1918,1930 **** GO_IF_LEGITIMATE_ADDRESS_P includes real.h. */ ! #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \ ! (GET_CODE (X) == SYMBOL_REF \ ! || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ ! && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ ! || GET_CODE (X) == LABEL_REF \ ! || (! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC) \ ! && GET_CODE (X) == CONST_DOUBLE \ ! && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ ! && BITS_PER_WORD == HOST_BITS_PER_INT)) /* Select section for constant in constant pool. --- 2024,2037 ---- GO_IF_LEGITIMATE_ADDRESS_P includes real.h. */ ! #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \ ! (TARGET_TOC \ ! && (GET_CODE (X) == SYMBOL_REF \ ! || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ ! && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ ! || GET_CODE (X) == LABEL_REF \ ! || (! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC) \ ! && GET_CODE (X) == CONST_DOUBLE \ ! && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ ! && BITS_PER_WORD == HOST_BITS_PER_INT))) /* Select section for constant in constant pool. *************** *** 1996,2015 **** /* Remove any trailing [DS] or the like from the symbol name. */ ! #define STRIP_NAME_ENCODING(VAR,NAME) \ ! do \ ! { \ ! if ((NAME)[0] == '*') \ ! (VAR) = (NAME)+1; \ ! else if ((NAME)[strlen (NAME) - 1] != ']') \ ! (VAR) = (NAME); \ ! else \ ! { \ ! int _len = strlen (NAME); \ ! (VAR) = alloca (_len + 1); \ ! \ ! strcpy ((VAR), NAME); \ ! (VAR)[_len - 4] = '\0'; \ ! } \ ! } \ while (0) --- 2103,2125 ---- /* Remove any trailing [DS] or the like from the symbol name. */ ! #define STRIP_NAME_ENCODING(VAR,NAME) \ ! do \ ! { \ ! char *_name = (NAME); \ ! if (_name[0] == '*') \ ! (VAR) = _name+1; \ ! else \ ! { \ ! int _len = strlen (_name); \ ! if (_name[_len - 1] != ']') \ ! (VAR) = _name; \ ! else \ ! { \ ! (VAR) = (char *) alloca (_len + 1); \ ! strcpy ((VAR), _name); \ ! (VAR)[_len - 4] = '\0'; \ ! } \ ! } \ ! } \ while (0) *************** *** 2236,2241 **** It need not be very fast code. */ ! #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ ! asm_fprintf (FILE, "\{tstu|stwu} %s,-4(r1)\n", reg_names[REGNO]); /* This is how to output an insn to pop a register from the stack. --- 2346,2355 ---- It need not be very fast code. */ ! #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ ! do { \ ! extern char *reg_names[]; \ ! asm_fprintf (FILE, "\{tstu|stwu} %s,-4(%s)\n", reg_names[REGNO], \ ! reg_names[1]); \ ! } while (0) /* This is how to output an insn to pop a register from the stack. *************** *** 2242,2248 **** It need not be very fast code. */ ! #define ASM_OUTPUT_REG_POP(FILE,REGNO) \ ! asm_fprintf (FILE, "\t{l|lwz} %s,0(r1)\n\t{ai|addic} r1,r1,4\n", \ ! reg_names[REGNO]) /* This is how to output an element of a case-vector that is absolute. --- 2356,2366 ---- It need not be very fast code. */ ! #define ASM_OUTPUT_REG_POP(FILE,REGNO) \ ! do { \ ! extern char *reg_names[]; \ ! asm_fprintf (FILE, "\t{l|lwz} %s,0(%s)\n\t{ai|addic} %s,%s,4\n", \ ! reg_names[REGNO], reg_names[1], reg_names[1], \ ! reg_names[1]); \ ! } while (0) /* This is how to output an element of a case-vector that is absolute. *************** *** 2351,2355 **** {"reg_or_mem_operand", {SUBREG, MEM, REG}}, \ {"lwa_operand", {SUBREG, MEM, REG}}, \ ! {"low_32_bit_operand", {CONST_DOUBLE, CONST_INT}}, \ {"fp_reg_or_mem_operand", {SUBREG, MEM, REG}}, \ {"mem_or_easy_const_operand", {SUBREG, MEM, CONST_DOUBLE}}, \ --- 2469,2473 ---- {"reg_or_mem_operand", {SUBREG, MEM, REG}}, \ {"lwa_operand", {SUBREG, MEM, REG}}, \ ! {"offsettable_addr_operand", {REG, SUBREG, PLUS}}, \ {"fp_reg_or_mem_operand", {SUBREG, MEM, REG}}, \ {"mem_or_easy_const_operand", {SUBREG, MEM, CONST_DOUBLE}}, \ *************** *** 2372,2376 **** --- 2490,2496 ---- /* Declare functions in rs6000.c */ + extern void output_options (); extern void rs6000_override_options (); + extern struct rtx_def *rs6000_float_const (); extern struct rtx_def *rs6000_immed_double_const (); extern int direct_return (); *************** *** 2386,2390 **** extern int reg_or_cint_operand (); extern int easy_fp_constant (); ! extern int low_32_bit_operand (); extern int fp_reg_or_mem_operand (); extern int mem_or_easy_const_operand (); --- 2506,2511 ---- extern int reg_or_cint_operand (); extern int easy_fp_constant (); ! extern int volatile_mem_operand (); ! extern int offsettable_addr_operand (); extern int fp_reg_or_mem_operand (); extern int mem_or_easy_const_operand (); *************** *** 2402,2405 **** --- 2523,2534 ---- extern int current_file_function_operand (); extern int input_operand (); + extern void init_cumulative_args (); + extern void function_arg_advance (); + extern struct rtx_def *function_arg (); + extern int function_arg_partial_nregs (); + extern int function_arg_pass_by_reference (); + extern void setup_incoming_varargs (); + extern struct rtx_def *expand_builtin_saveregs (); + extern struct rtx_def *rs6000_stack_temp (); extern int expand_block_move (); extern int load_multiple_operation (); *************** *** 2417,2424 **** extern int first_reg_to_save (); extern int first_fp_reg_to_save (); - extern int must_save_cr (); - extern int rs6000_sa_size (); extern int rs6000_makes_calls (); ! extern int rs6000_pushes_stack (); extern void svr4_traceback (); extern void output_prolog (); --- 2546,2551 ---- extern int first_reg_to_save (); extern int first_fp_reg_to_save (); extern int rs6000_makes_calls (); ! extern rs6000_stack_t *rs6000_stack_info (); extern void svr4_traceback (); extern void output_prolog (); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/rs6000.md gcc-2.7.1/config/rs6000/rs6000.md *** gcc-2.7.0/config/rs6000/rs6000.md Thu Jun 15 16:56:45 1995 --- gcc-2.7.1/config/rs6000/rs6000.md Thu Oct 26 08:05:55 1995 *************** *** 1156,1161 **** "! TARGET_POWER" "@ ! mullw %0,%1,%2 ! mulli %0,%1,%2" [(set_attr "type" "imul")]) --- 1156,1161 ---- "! TARGET_POWER" "@ ! {muls|mullw} %0,%1,%2 ! {muli|mulli} %0,%1,%2" [(set_attr "type" "imul")]) *************** *** 1178,1182 **** (clobber (match_scratch:SI 3 "=r"))] "! TARGET_POWER" ! "mullw. %3,%1,%2" [(set_attr "type" "delayed_compare")]) --- 1178,1182 ---- (clobber (match_scratch:SI 3 "=r"))] "! TARGET_POWER" ! "{muls.|mullw.} %3,%1,%2" [(set_attr "type" "delayed_compare")]) *************** *** 1201,1205 **** (mult:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWER" ! "mullw. %0,%1,%2" [(set_attr "type" "delayed_compare")]) --- 1201,1205 ---- (mult:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWER" ! "{muls.|mullw.} %0,%1,%2" [(set_attr "type" "delayed_compare")]) *************** *** 2301,2305 **** (match_operand:SI 2 "reg_or_cint_operand" "ri")))] "! TARGET_POWER" ! "slw%I2 %0,%1,%h2" [(set_attr "length" "8")]) --- 2301,2305 ---- (match_operand:SI 2 "reg_or_cint_operand" "ri")))] "! TARGET_POWER" ! "{sl|slw}%I2 %0,%1,%h2" [(set_attr "length" "8")]) *************** *** 2324,2328 **** (clobber (match_scratch:SI 3 "=r"))] "! TARGET_POWER" ! "slw%I2. %3,%1,%h2" [(set_attr "type" "delayed_compare")]) --- 2324,2328 ---- (clobber (match_scratch:SI 3 "=r"))] "! TARGET_POWER" ! "{sl|slw}%I2. %3,%1,%h2" [(set_attr "type" "delayed_compare")]) *************** *** 2349,2353 **** (ashift:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWER" ! "slw%I2. %0,%1,%h2" [(set_attr "type" "delayed_compare")]) --- 2349,2353 ---- (ashift:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWER" ! "{sl|slw}%I2. %0,%1,%h2" [(set_attr "type" "delayed_compare")]) *************** *** 2416,2420 **** (match_operand:SI 2 "reg_or_cint_operand" "ri")))] "! TARGET_POWER" ! "srw%I2 %0,%1,%h2") (define_insn "" --- 2416,2420 ---- (match_operand:SI 2 "reg_or_cint_operand" "ri")))] "! TARGET_POWER" ! "{sr|srw}%I2 %0,%1,%h2") (define_insn "" *************** *** 2438,2442 **** (clobber (match_scratch:SI 3 "=r"))] "! TARGET_POWER" ! "srw%I2. %3,%1,%h2" [(set_attr "type" "delayed_compare")]) --- 2438,2442 ---- (clobber (match_scratch:SI 3 "=r"))] "! TARGET_POWER" ! "{sr|srw}%I2. %3,%1,%h2" [(set_attr "type" "delayed_compare")]) *************** *** 2463,2467 **** (lshiftrt:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWER" ! "srw%I2. %0,%1,%h2" [(set_attr "type" "delayed_compare")]) --- 2463,2467 ---- (lshiftrt:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWER" ! "{sr|srw}%I2. %0,%1,%h2" [(set_attr "type" "delayed_compare")]) *************** *** 2628,2632 **** (match_operand:SI 2 "reg_or_cint_operand" "ri")))] "! TARGET_POWER" ! "sraw%I2 %0,%1,%h2") (define_insn "" --- 2628,2632 ---- (match_operand:SI 2 "reg_or_cint_operand" "ri")))] "! TARGET_POWER" ! "{sra|sraw}%I2 %0,%1,%h2") (define_insn "" *************** *** 2650,2654 **** (clobber (match_scratch:SI 3 "=r"))] "! TARGET_POWER" ! "sraw%I2. %3,%1,%h2" [(set_attr "type" "delayed_compare")]) --- 2650,2654 ---- (clobber (match_scratch:SI 3 "=r"))] "! TARGET_POWER" ! "{sra|sraw}%I2. %3,%1,%h2" [(set_attr "type" "delayed_compare")]) *************** *** 2675,2679 **** (ashiftrt:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWER" ! "sraw%I2. %0,%1,%h2" [(set_attr "type" "delayed_compare")]) --- 2675,2679 ---- (ashiftrt:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWER" ! "{sra|sraw}%I2. %0,%1,%h2" [(set_attr "type" "delayed_compare")]) *************** *** 3325,3412 **** ;; Conversions to and from floating-point. (define_expand "floatsidf2" ! [(set (match_dup 2) ! (plus:DI (zero_extend:DI ! (xor:SI (match_operand:SI 1 "gpc_reg_operand" "") ! (match_dup 3))) ! (match_dup 4))) ! (set (match_operand:DF 0 "gpc_reg_operand" "") ! (minus:DF (subreg:DF (match_dup 2) 0) ! (match_dup 5)))] "! TARGET_POWERPC64 && TARGET_HARD_FLOAT" " { ! operands[2] = gen_reg_rtx (DImode); ! operands[3] = gen_rtx (CONST_INT, VOIDmode, 0x80000000); ! operands[4] = rs6000_immed_double_const (0, 0x43300000, DImode); ! operands[5] = force_reg (DFmode, rs6000_immed_double_const (0x43300000, ! 0x80000000, ! DFmode)); }") (define_expand "floatunssidf2" ! [(set (match_dup 2) ! (plus:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")) ! (match_dup 3))) ! (set (match_operand:DF 0 "gpc_reg_operand" "") ! (minus:DF (subreg:DF (match_dup 2) 0) ! (match_dup 4)))] "! TARGET_POWERPC64 && TARGET_HARD_FLOAT" " { ! operands[2] = gen_reg_rtx (DImode); ! operands[3] = rs6000_immed_double_const (0, 0x43300000, DImode); ! operands[4] = force_reg (DFmode, rs6000_immed_double_const (0x43300000, 0, DFmode)); }") ! ;; For the above two cases, we always split. ! (define_split ! [(set (match_operand:DI 0 "gpc_reg_operand" "") ! (plus:DI (zero_extend:DI ! (xor:SI (match_operand:SI 1 "gpc_reg_operand" "") ! (match_operand:SI 2 "logical_operand" ""))) ! (match_operand:DI 3 "low_32_bit_operand" "")))] ! "reload_completed" ! [(set (match_dup 6) (xor:SI (match_dup 1) (match_dup 2))) ! (set (match_dup 4) (match_dup 5))] " ! { operands[4] = operand_subword (operands[0], 0, 0, DImode); ! operands[5] = operand_subword (operands[3], 0, 0, DImode); ! operands[6] = operand_subword (operands[0], 1, 0, DImode); }") - (define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (plus:DI (zero_extend:DI - (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r") - (match_operand:SI 2 "logical_operand" "rKJ"))) - (match_operand:DI 3 "low_32_bit_operand" "n")))] - "" - "#" - [(set_attr "length" "8")]) - (define_split ! [(set (match_operand:DI 0 "gpc_reg_operand" "=") ! (plus:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")) ! (match_operand:DI 2 "low_32_bit_operand" "")))] "reload_completed" ! [(set (match_dup 3) (match_dup 4)) ! (set (match_dup 5) (match_dup 1))] " ! { operands[3] = operand_subword (operands[0], 0, 0, DImode); ! operands[4] = operand_subword (operands[2], 0, 0, DImode); ! operands[5] = operand_subword (operands[0], 1, 0, DImode); ! if (rtx_equal_p (operands[1], operands[5])) { ! emit_move_insn (operands[3], operands[4]); ! DONE; } ! ! if (rtx_equal_p (operands[1], operands[3])) { ! rtx temp; ! ! temp = operands[3]; operands[3] = operands[5]; operands[5] = temp; ! temp = operands[4]; operands[4] = operands[1]; operands[1] = temp; } }") --- 3325,3402 ---- ;; Conversions to and from floating-point. (define_expand "floatsidf2" ! [(set (match_operand:DF 0 "gpc_reg_operand" "") ! (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))] "! TARGET_POWERPC64 && TARGET_HARD_FLOAT" " { ! if (operands[0]) ! { /* prevent unused warning messages */ ! rtx high = force_reg (SImode, GEN_INT (0x43300000)); ! rtx low = gen_reg_rtx (SImode); ! rtx df = gen_reg_rtx (DFmode); ! rtx adjust = force_reg (DFmode, rs6000_float_const (\"4503601774854144\", DFmode)); ! ! emit_insn (gen_xorsi3 (low, operands[1], GEN_INT (0x80000000))); ! emit_insn (gen_move_to_float (df, low, high)); ! emit_insn (gen_subdf3 (operands[0], df, adjust)); ! DONE; ! } }") (define_expand "floatunssidf2" ! [(set (match_operand:DF 0 "gpc_reg_operand" "") ! (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))] "! TARGET_POWERPC64 && TARGET_HARD_FLOAT" " { ! if (operands[0]) ! { /* prevent unused warning messages */ ! rtx high = force_reg (SImode, GEN_INT (0x43300000)); ! rtx df = gen_reg_rtx (DFmode); ! rtx adjust = force_reg (DFmode, rs6000_float_const (\"4503599627370496\", DFmode)); ! ! emit_insn (gen_move_to_float (df, operands[1], high)); ! emit_insn (gen_subdf3 (operands[0], df, adjust)); ! DONE; ! } }") ! (define_expand "move_to_float" ! [(set (match_operand:DF 0 "gpc_reg_operand" "") ! (unspec [(match_operand:SI 1 "gpc_reg_operand" "") ! (match_operand:SI 2 "gpc_reg_operand" "") ! (match_dup 3)] 2))] ! "! TARGET_POWERPC64 && TARGET_HARD_FLOAT" " ! { ! operands[3] = XEXP (rs6000_stack_temp (DFmode, 8, 1), 0); }") (define_split ! [(set (match_operand:DF 0 "gpc_reg_operand" "") ! (unspec [(match_operand:SI 1 "gpc_reg_operand" "") ! (match_operand:SI 2 "gpc_reg_operand" "") ! (match_operand:SI 3 "offsettable_addr_operand" "")] 2))] "reload_completed" ! [(set (match_dup 4) (match_dup 1)) ! (set (match_dup 5) (match_dup 2)) ! (set (match_dup 0) (mem:DF (match_dup 3)))] " ! { ! rtx word1 = gen_rtx (MEM, SImode, operands[3]); ! rtx word2 = gen_rtx (MEM, SImode, plus_constant (operands[3], 4)); ! ! MEM_IN_STRUCT_P (word1) = 1; ! MEM_IN_STRUCT_P (word2) = 1; ! if (WORDS_BIG_ENDIAN) { ! operands[4] = word2; ! operands[5] = word1; } ! else { ! operands[4] = word1; ! operands[5] = word2; } }") *************** *** 3413,3422 **** (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=r") ! (plus:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r")) ! (match_operand:DI 2 "low_32_bit_operand" "n")))] ! "" "#" ! [(set_attr "length" "8")]) (define_expand "fix_truncdfsi2" --- 3403,3413 ---- (define_insn "" ! [(set (match_operand:DF 0 "gpc_reg_operand" "=f") ! (unspec [(match_operand:SI 1 "gpc_reg_operand" "r") ! (match_operand:SI 2 "gpc_reg_operand" "r") ! (match_operand:SI 3 "offsettable_addr_operand" "p")] 2))] ! "! TARGET_POWERPC64 && TARGET_HARD_FLOAT" "#" ! [(set_attr "length" "12")]) (define_expand "fix_truncdfsi2" *************** *** 3428,3433 **** if (TARGET_POWER2 || TARGET_POWERPC) { ! rtx stack_slot = assign_stack_temp (DImode, 8, 0), ! temp = gen_reg_rtx (DImode); emit_insn (gen_fpcvtsi (temp, operands[1])); --- 3419,3425 ---- if (TARGET_POWER2 || TARGET_POWERPC) { ! int endian = (WORDS_BIG_ENDIAN == 0); ! rtx stack_slot = rs6000_stack_temp (DImode, 8, 1); ! rtx temp = gen_reg_rtx (DImode); emit_insn (gen_fpcvtsi (temp, operands[1])); *************** *** 3434,3438 **** emit_move_insn (stack_slot, temp); emit_move_insn (operands[0], ! operand_subword (stack_slot, 1, 0, DImode)); DONE; } --- 3426,3430 ---- emit_move_insn (stack_slot, temp); emit_move_insn (operands[0], ! operand_subword (stack_slot, 1 - endian, 0, DImode)); DONE; } *************** *** 3488,3491 **** --- 3480,3484 ---- (parallel [(set (reg:SI 3) (call (mem:SI (match_operand 2 "" "")) (const_int 0))) + (use (const_int 0)) (clobber (scratch:SI))]) (set (match_operand:SI 0 "gpc_reg_operand" "") *************** *** 3512,3516 **** ;; Define the DImode operations that can be done in a small number ! ;; of instructions. (define_expand "adddi3" [(set (match_operand:DI 0 "gpc_reg_operand" "") --- 3505,3513 ---- ;; Define the DImode operations that can be done in a small number ! ;; of instructions. The & constraints are to prevent the register ! ;; allocator from allocating registers that overlap with the inputs ! ;; (for example, having an input in 7,8 and an output in 6,7). We ! ;; also allow for the the output being the same as one of the inputs. ! (define_expand "adddi3" [(set (match_operand:DI 0 "gpc_reg_operand" "") *************** *** 3526,3535 **** (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") ! (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r") ! (match_operand:DI 2 "reg_or_short_operand" "r,I")))] "TARGET_POWER && ! TARGET_POWERPC64" "@ {a|addc} %L0,%L1,%L2\;{ae|adde} %0,%1,%2 {ai|addic} %L0,%L1,%2\;{a%G2e|add%G2e} %0,%1" [(set_attr "length" "8")]) --- 3523,3534 ---- (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r") ! (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,0,0") ! (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I")))] "TARGET_POWER && ! TARGET_POWERPC64" "@ {a|addc} %L0,%L1,%L2\;{ae|adde} %0,%1,%2 + {ai|addic} %L0,%L1,%2\;{a%G2e|add%G2e} %0,%1 + {a|addc} %L0,%L1,%L2\;{ae|adde} %0,%1,%2 {ai|addic} %L0,%L1,%2\;{a%G2e|add%G2e} %0,%1" [(set_attr "length" "8")]) *************** *** 3536,3550 **** (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=r") ! (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r") ! (match_operand:DI 2 "gpc_reg_operand" "r")))] "! TARGET_POWER && ! TARGET_POWERPC64" ! "addc %L0,%L1,%L2\;adde %0,%1,%2" [(set_attr "length" "8")]) (define_expand "subdi3" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") ! (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I") ! (match_operand:DI 2 "gpc_reg_operand" "r,r")))] "" " --- 3535,3554 ---- (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r") ! (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,0") ! (match_operand:DI 2 "gpc_reg_operand" "r,r")))] "! TARGET_POWER && ! TARGET_POWERPC64" ! "* ! { ! return (WORDS_BIG_ENDIAN) ! ? \"addc %L0,%L1,%L2\;adde %0,%1,%2\" ! : \"addc %0,%1,%2\;adde %L0,%L1,%L2\"; ! }" [(set_attr "length" "8")]) (define_expand "subdi3" ! [(set (match_operand:DI 0 "gpc_reg_operand" "") ! (minus:DI (match_operand:DI 1 "reg_or_short_operand" "") ! (match_operand:DI 2 "gpc_reg_operand" "")))] "" " *************** *** 3556,3565 **** (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") ! (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I") ! (match_operand:DI 2 "gpc_reg_operand" "r,r")))] "TARGET_POWER && ! TARGET_POWERPC64" "@ {sf|subfc} %L0,%L2,%L1\;{sfe|subfe} %0,%2,%1 {sfi|subfic} %L0,%L2,%1\;{sf%G1e|subf%G1e} %0,%2" [(set_attr "length" "8")]) --- 3560,3572 ---- (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r,r") ! (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I,0,r,I") ! (match_operand:DI 2 "gpc_reg_operand" "r,r,r,0,0")))] "TARGET_POWER && ! TARGET_POWERPC64" "@ {sf|subfc} %L0,%L2,%L1\;{sfe|subfe} %0,%2,%1 + {sfi|subfic} %L0,%L2,%1\;{sf%G1e|subf%G1e} %0,%2 + {sf|subfc} %L0,%L2,%L1\;{sfe|subfe} %0,%2,%1 + {sf|subfc} %L0,%L2,%L1\;{sfe|subfe} %0,%2,%1 {sfi|subfic} %L0,%L2,%1\;{sf%G1e|subf%G1e} %0,%2" [(set_attr "length" "8")]) *************** *** 3566,3574 **** (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=r") ! (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r") ! (match_operand:DI 2 "gpc_reg_operand" "r")))] "! TARGET_POWER && ! TARGET_POWERPC64" ! "subfc %L0,%L2,%L1\;subfe %0,%2,%1" [(set_attr "length" "8")]) --- 3573,3586 ---- (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r,r") ! (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,0,r") ! (match_operand:DI 2 "gpc_reg_operand" "r,r,0")))] "! TARGET_POWER && ! TARGET_POWERPC64" ! "* ! { ! return (WORDS_BIG_ENDIAN) ! ? \"{sf|subfc} %L0,%L2,%L1\;{sfe|subfe} %0,%2,%1\" ! : \"{sf|subfc} %0,%2,%1\;{sfe|subfe} %L0,%L2,%L1\"; ! }" [(set_attr "length" "8")]) *************** *** 3580,3587 **** (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=r") ! (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r")))] "! TARGET_POWERPC64" ! "{sfi|subfic} %L0,%L1,0\;{sfze|subfze} %0,%1" [(set_attr "length" "8")]) --- 3592,3604 ---- (define_insn "" ! [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r") ! (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))] "! TARGET_POWERPC64" ! "* ! { ! return (WORDS_BIG_ENDIAN) ! ? \"{sfi|subfic} %L0,%L1,0\;{sfze|subfze} %0,%1\" ! : \"{sfi|subfic} %0,%1,0\;{sfze|subfze} %L0,%L1\"; ! }" [(set_attr "length" "8")]) *************** *** 3595,3604 **** if (! TARGET_POWER && ! TARGET_POWERPC) { emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]); emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]); emit_insn (gen_mull_call ()); ! emit_move_insn (operand_subword (operands[0], 0, 0, DImode), gen_rtx (REG, SImode, 3)); ! emit_move_insn (operand_subword (operands[0], 1, 0, DImode), gen_rtx (REG, SImode, 4)); DONE; --- 3612,3622 ---- if (! TARGET_POWER && ! TARGET_POWERPC) { + int endian = (WORDS_BIG_ENDIAN == 0); emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]); emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]); emit_insn (gen_mull_call ()); ! emit_move_insn (operand_subword (operands[0], endian, 0, DImode), gen_rtx (REG, SImode, 3)); ! emit_move_insn (operand_subword (operands[0], 1 - endian, 0, DImode), gen_rtx (REG, SImode, 4)); DONE; *************** *** 3626,3630 **** (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))] "TARGET_POWERPC && ! TARGET_POWERPC64" ! "mulhw %0,%1,%2\;mullw %L0,%1,%2" [(set_attr "type" "imul") (set_attr "length" "8")]) --- 3644,3653 ---- (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))] "TARGET_POWERPC && ! TARGET_POWERPC64" ! "* ! { ! return (WORDS_BIG_ENDIAN) ! ? \"mulhw %0,%1,%2\;mullw %L0,%1,%2\" ! : \"mulhw %L0,%1,%2\;mullw %0,%1,%2\"; ! }" [(set_attr "type" "imul") (set_attr "length" "8")]) *************** *** 3833,3837 **** ;; Now define ways of moving data around. ! ;; ;; For SI, we special-case integers that can't be loaded in one insn. We ;; do the load 16-bits at a time. We could do this by loading from memory, --- 3856,3877 ---- ;; Now define ways of moving data around. ! ! ;; Elf specific ways of loading addresses for non-PIC code. ! ;; The output of this could be r0, but we limit it to base ! ;; registers, since almost all uses of this will need it ! ;; in a base register shortly. ! (define_insn "elf_high" ! [(set (match_operand:SI 0 "register_operand" "=b") ! (high:SI (match_operand 1 "" "")))] ! "TARGET_ELF && !TARGET_64BIT" ! "{cau|addis} %0,0,%1@ha") ! ! (define_insn "elf_low" ! [(set (match_operand:SI 0 "register_operand" "=r") ! (lo_sum:SI (match_operand:SI 1 "register_operand" "b") ! (match_operand 2 "" "")))] ! "TARGET_ELF && !TARGET_64BIT" ! "{cal %0,%a2@l(%1)|addi %0,%1,%2@l}") ! ;; For SI, we special-case integers that can't be loaded in one insn. We ;; do the load 16-bits at a time. We could do this by loading from memory, *************** *** 3847,3851 **** operands[1] = force_reg (SImode, operands[1]); ! if (CONSTANT_P (operands[1]) && GET_CODE (operands[1]) != CONST_INT && ! LEGITIMATE_CONSTANT_POOL_ADDRESS_P (operands[1])) { --- 3887,3910 ---- operands[1] = force_reg (SImode, operands[1]); ! /* Convert a move of a CONST_DOUBLE into a CONST_INT */ ! if (GET_CODE (operands[1]) == CONST_DOUBLE) ! operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); ! ! if (TARGET_ELF && TARGET_NO_TOC && !TARGET_64BIT ! && CONSTANT_P (operands[1]) ! && GET_CODE (operands[1]) != HIGH ! && GET_CODE (operands[1]) != CONST_INT) ! { ! rtx target = (reload_completed || reload_in_progress) ! ? operands[0] : gen_reg_rtx (SImode); ! ! emit_insn (gen_elf_high (target, operands[1])); ! emit_insn (gen_elf_low (operands[0], target, operands[1])); ! DONE; ! } ! ! if (CONSTANT_P (operands[1]) ! && GET_CODE (operands[1]) != CONST_INT ! && GET_CODE (operands[1]) != HIGH && ! LEGITIMATE_CONSTANT_POOL_ADDRESS_P (operands[1])) { *************** *** 3852,3856 **** /* If we are to limit the number of things we put in the TOC and this is a symbol plus a constant we can add in one insn, ! just put the sumbol in the TOC and add the constant. Don't do this if reload is in progress. */ if (GET_CODE (operands[1]) == CONST --- 3911,3915 ---- /* If we are to limit the number of things we put in the TOC and this is a symbol plus a constant we can add in one insn, ! just put the symbol in the TOC and add the constant. Don't do this if reload is in progress. */ if (GET_CODE (operands[1]) == CONST *************** *** 4337,4353 **** " { if (GET_CODE (operands[1]) == CONST_DOUBLE || GET_CODE (operands[1]) == CONST_INT) { ! emit_move_insn (operand_subword (operands[0], 0, 0, DImode), ! operand_subword (operands[1], 0, 0, DImode)); ! emit_move_insn (operand_subword (operands[0], 1, 0, DImode), ! operand_subword (operands[1], 1, 0, DImode)); DONE; } - if (GET_CODE (operands[0]) == MEM) - operands[1] = force_reg (DImode, operands[1]); - /* Stores between FPR and any non-FPR registers must go through a temporary stack slot. */ --- 4396,4427 ---- " { + if (GET_CODE (operands[0]) == MEM) + operands[1] = force_reg (DImode, operands[1]); + if (GET_CODE (operands[1]) == CONST_DOUBLE || GET_CODE (operands[1]) == CONST_INT) { ! HOST_WIDE_INT low; ! HOST_WIDE_INT high; ! ! if (GET_CODE (operands[1]) == CONST_DOUBLE) ! { ! low = CONST_DOUBLE_LOW (operands[1]); ! high = CONST_DOUBLE_HIGH (operands[1]); ! } ! else ! { ! low = INTVAL (operands[1]); ! high = (low < 0) ? ~0 : 0; ! } ! ! emit_move_insn (gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN), ! GEN_INT (low)); ! ! emit_move_insn (gen_rtx (SUBREG, SImode, operands[0], !WORDS_BIG_ENDIAN), ! GEN_INT (high)); DONE; } /* Stores between FPR and any non-FPR registers must go through a temporary stack slot. */ *************** *** 4628,4632 **** [(match_parallel 0 "load_multiple_operation" [(set (match_operand:SI 1 "gpc_reg_operand" "=r") ! (match_operand:SI 2 "indirect_operand" "Q"))])] "TARGET_STRING" "* --- 4702,4706 ---- [(match_parallel 0 "load_multiple_operation" [(set (match_operand:SI 1 "gpc_reg_operand" "=r") ! (mem:SI (match_operand:SI 2 "register_operand" "b")))])] "TARGET_STRING" "* *************** *** 4633,4659 **** { /* We have to handle the case where the pseudo used to contain the address ! is assigned to one of the output registers. In that case, do the ! lsi, but then load the correct value. This is a bit of a mess, but is ! the best we can do. ! We set the length attribute to the maximum possible size (8 bytes). */ ! static char result[100]; ! char newload[40]; ! int i; ! strcpy (result, \"{lsi|lswi} %1,%P2,%N0\"); ! for (i = 0; i < XVECLEN (operands[0], 0); i++) if (refers_to_regno_p (REGNO (operands[1]) + i, REGNO (operands[1]) + i + 1, operands[2], 0)) { ! sprintf (newload, \"\;{l|lwz} %d,%d(%d)\", ! REGNO (operands[1]) + i, ! i * 4, REGNO (XEXP (operands[2], 0))); ! strcat (result, newload); } ! return result; }" [(set_attr "type" "load") ! (set_attr "length" "8")]) --- 4707,4759 ---- { /* We have to handle the case where the pseudo used to contain the address ! is assigned to one of the output registers. */ ! int i, j; ! int words = XVECLEN (operands[0], 0); ! rtx xop[10]; ! ! if (XVECLEN (operands[0], 0) == 1) ! return \"{l|lwz} %1,0(%2)\"; ! for (i = 0; i < words; i++) if (refers_to_regno_p (REGNO (operands[1]) + i, REGNO (operands[1]) + i + 1, operands[2], 0)) { ! if (i == words-1) ! { ! xop[0] = operands[1]; ! xop[1] = operands[2]; ! xop[2] = GEN_INT (4 * (words-1)); ! output_asm_insn (\"{lsi|lswi} %0,%1,%2\;lwz %1,%2(%1)\", xop); ! return \"\"; ! } ! else if (i == 0) ! { ! xop[0] = operands[1]; ! xop[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); ! xop[2] = GEN_INT (4 * (words-1)); ! output_asm_insn (\"{cal %0,4(%0)|addi %0,%0,4}\;{lsi|lswi} %1,%0,%2\;{l|lwz} %0,-4(%0)\", xop); ! return \"\"; ! } ! else ! { ! for (j = 0; j < words; j++) ! if (j != i) ! { ! xop[0] = gen_rtx (REG, SImode, REGNO (operands[1]) + j); ! xop[1] = operands[2]; ! xop[2] = GEN_INT (j * 4); ! output_asm_insn (\"{l|lwz} %0,%2(%1)\", xop); ! } ! xop[0] = operands[2]; ! xop[1] = GEN_INT (i * 4); ! output_asm_insn (\"{l|lwz} %0,%1(%0)\", xop); ! return \"\"; ! } } ! return \"{lsi|lswi} %1,%2,%N0\"; }" [(set_attr "type" "load") ! (set_attr "length" "32")]) *************** *** 4710,4718 **** (define_insn "" [(match_parallel 0 "store_multiple_operation" ! [(set (match_operand:SI 1 "indirect_operand" "=Q") (match_operand:SI 2 "gpc_reg_operand" "r")) (clobber (match_scratch:SI 3 "X"))])] "TARGET_STRING && !TARGET_POWER" ! "{stsi|stswi} %2,%P1,%O0") --- 4810,4818 ---- (define_insn "" [(match_parallel 0 "store_multiple_operation" ! [(set (mem:SI (match_operand:SI 1 "register_operand" "b")) (match_operand:SI 2 "gpc_reg_operand" "r")) (clobber (match_scratch:SI 3 "X"))])] "TARGET_STRING && !TARGET_POWER" ! "{stsi|stswi} %2,%1,%O0") *************** *** 5011,5015 **** [(set_attr "type" "load")]) ! (define_insn "" [(set (mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0") (match_operand:DI 2 "reg_or_short_operand" "r,I"))) --- 5111,5115 ---- [(set_attr "type" "load")]) ! (define_insn "movdi_update" [(set (mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0") (match_operand:DI 2 "reg_or_short_operand" "r,I"))) *************** *** 5034,5038 **** [(set_attr "type" "load")]) ! (define_insn "" [(set (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0") (match_operand:SI 2 "reg_or_short_operand" "r,I"))) --- 5134,5138 ---- [(set_attr "type" "load")]) ! (define_insn "movsi_update" [(set (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0") (match_operand:SI 2 "reg_or_short_operand" "r,I"))) *************** *** 5212,5221 **** "" " ! { rtx chain = gen_reg_rtx (SImode); rtx stack_bot = gen_rtx (MEM, Pmode, stack_pointer_rtx); emit_move_insn (chain, stack_bot); ! emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx, operands[0])); ! emit_move_insn (stack_bot, chain); DONE; }") --- 5312,5339 ---- "" " ! { rtx chain = gen_reg_rtx (Pmode); rtx stack_bot = gen_rtx (MEM, Pmode, stack_pointer_rtx); + rtx neg_op0; emit_move_insn (chain, stack_bot); ! ! if (GET_CODE (operands[0]) != CONST_INT ! || INTVAL (operands[0]) < -32767 ! || INTVAL (operands[0]) > 32768) ! { ! neg_op0 = gen_reg_rtx (Pmode); ! if (TARGET_POWERPC64) ! emit_insn (gen_negdi2 (neg_op0, operands[0])); ! else ! emit_insn (gen_negsi2 (neg_op0, operands[0])); ! } ! else ! neg_op0 = GEN_INT (- INTVAL (operands[0])); ! ! if (TARGET_POWERPC64) ! emit_insn (gen_movdi_update (stack_pointer_rtx, stack_pointer_rtx, neg_op0, chain)); ! else ! emit_insn (gen_movsi_update (stack_pointer_rtx, stack_pointer_rtx, neg_op0, chain)); ! DONE; }") *************** *** 5307,5310 **** --- 5425,5429 ---- [(parallel [(call (mem:SI (match_operand:SI 0 "address_operand" "")) (match_operand 1 "" "")) + (use (match_operand 2 "" "")) (clobber (scratch:SI))])] "" *************** *** 5331,5334 **** --- 5450,5454 ---- (call (mem:SI (match_operand:SI 1 "address_operand" "")) (match_operand 2 "" ""))) + (use (match_operand 3 "" "")) (clobber (scratch:SI))])] "" *************** *** 5352,5373 **** ;; Call to function in current module. No TOC pointer reload needed. (define_insn "" ! [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s")) ! (match_operand 1 "" "g")) ! (clobber (match_scratch:SI 2 "=l"))] "" ! "bl %z0") ;; Call to function which may be in another module. Restore the TOC ;; pointer (r2) after the call unless this is System V. (define_insn "" ! [(call (mem:SI (match_operand:SI 0 "call_operand" "l,s")) ! (match_operand 1 "" "fg,fg")) ! (clobber (match_scratch:SI 2 "=l,l"))] "" "* { #ifndef USING_SVR4_H if (GET_CODE (operands[0]) == REG) --- 5472,5519 ---- ;; Call to function in current module. No TOC pointer reload needed. + ;; Operand2 is non-zero if we are using the V.4 calling sequence and + ;; either the function was not prototyped, or it was prototyped as a + ;; variable argument function. It is > 0 if FP registers were passed + ;; and < 0 if they were not. (define_insn "" ! [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s")) ! (match_operand 1 "" "g,g")) ! (use (match_operand:SI 2 "immediate_operand" "O,n")) ! (clobber (match_scratch:SI 3 "=l,l"))] "" ! "* ! { ! if (INTVAL (operands[2]) > 0) ! return \"creqv 6,6,6\;bl %z0\"; ! ! else if (INTVAL (operands[2]) < 0) ! return \"crxor 6,6,6\;bl %z0\"; ! ! return \"bl %z0\"; ! }" ! [(set_attr "length" "4,8")]) ;; Call to function which may be in another module. Restore the TOC ;; pointer (r2) after the call unless this is System V. + ;; Operand2 is non-zero if we are using the V.4 calling sequence and + ;; either the function was not prototyped, or it was prototyped as a + ;; variable argument function. It is > 0 if FP registers were passed + ;; and < 0 if they were not. (define_insn "" ! [(call (mem:SI (match_operand:SI 0 "call_operand" "l,s,l,s")) ! (match_operand 1 "" "fg,fg,fg,fg")) ! (use (match_operand:SI 2 "immediate_operand" "O,O,n,n")) ! (clobber (match_scratch:SI 3 "=l,l,l,l"))] "" "* { + if (INTVAL (operands[2]) > 0) + output_asm_insn (\"creqv 6,6,6\", operands); + + else if (INTVAL (operands[2]) < 0) + output_asm_insn (\"crxor 6,6,6\", operands); + #ifndef USING_SVR4_H if (GET_CODE (operands[0]) == REG) *************** *** 5383,5404 **** #endif }" ! [(set_attr "length" "8")]) (define_insn "" ! [(set (match_operand 0 "" "=fg") ! (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s")) ! (match_operand 2 "" "g"))) ! (clobber (match_scratch:SI 3 "=l"))] "" ! "bl %z1") (define_insn "" ! [(set (match_operand 0 "" "=fg,fg") ! (call (mem:SI (match_operand:SI 1 "call_operand" "l,s")) ! (match_operand 2 "" "fg,fg"))) ! (clobber (match_scratch:SI 3 "=l,l"))] "" "* { #ifndef USING_SVR4_H if (GET_CODE (operands[1]) == REG) --- 5529,5568 ---- #endif }" ! [(set_attr "length" "8,8,12,12")]) (define_insn "" ! [(set (match_operand 0 "" "=fg,fg") ! (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s")) ! (match_operand 2 "" "g,g"))) ! (use (match_operand:SI 3 "immediate_operand" "O,n")) ! (clobber (match_scratch:SI 4 "=l,l"))] "" ! "* ! { ! if (INTVAL (operands[3]) > 0) ! return \"creqv 6,6,6\;bl %z1\"; ! ! else if (INTVAL (operands[3]) < 0) ! return \"crxor 6,6,6\;bl %z1\"; + return \"bl %z1\"; + }" + [(set_attr "length" "4,8")]) + (define_insn "" ! [(set (match_operand 0 "" "=fg,fg,fg,fg") ! (call (mem:SI (match_operand:SI 1 "call_operand" "l,s,l,s")) ! (match_operand 2 "" "fg,fg,fg,fg"))) ! (use (match_operand:SI 3 "immediate_operand" "O,O,n,n")) ! (clobber (match_scratch:SI 4 "=l,l,l,l"))] "" "* { + if (INTVAL (operands[3]) > 0) + output_asm_insn (\"creqv 6,6,6\", operands); + + else if (INTVAL (operands[3]) < 0) + output_asm_insn (\"crxor 6,6,6\", operands); + #ifndef USING_SVR4_H if (GET_CODE (operands[1]) == REG) *************** *** 5414,5418 **** #endif }" ! [(set_attr "length" "8")]) ;; Call subroutine returning any type. --- 5578,5582 ---- #endif }" ! [(set_attr "length" "8,8,12,12")]) ;; Call subroutine returning any type. *************** *** 5428,5432 **** int i; ! emit_call_insn (gen_call (operands[0], const0_rtx, NULL, const0_rtx)); for (i = 0; i < XVECLEN (operands[2], 0); i++) --- 5592,5596 ---- int i; ! emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx, const0_rtx)); for (i = 0; i < XVECLEN (operands[2], 0); i++) *************** *** 5452,5455 **** --- 5616,5627 ---- "" "") + + ;; Synchronize instruction/data caches for V.4 trampolines + (define_insn "sync_isync" + [(unspec [(match_operand 0 "memory_operand" "=m")] 1)] + "" + "{dcs|sync}\;{ics|isync}" + [(set_attr "length" "8")]) + ;; Compare insns are next. Note that the RS/6000 has two types of compares, *************** *** 7115,7123 **** (define_expand "decrement_and_branchsi" ! [(parallel [(set (pc) (if_then_else (ne (match_operand:SI 0 "register_operand" "c") (const_int 1)) (label_ref (match_operand 1 "" "")) (pc))) ! (set (match_dup 0) (plus:SI (match_dup 0) (const_int -1)))])] "" "") --- 7287,7299 ---- (define_expand "decrement_and_branchsi" ! [(parallel [(set (match_operand:SI 0 "register_operand" "") ! (plus:SI (match_dup 0) ! (const_int -1))) ! (set (pc) (if_then_else (ne (match_dup 0) (const_int 1)) (label_ref (match_operand 1 "" "")) (pc))) ! (clobber (match_scratch:CC 2 "")) ! (clobber (match_scratch:SI 3 ""))])] "" "") *************** *** 7126,7137 **** ;; will cause reload to blow up since we don't allow output reloads on ;; JUMP_INSNs. (define_insn "" [(set (pc) ! (if_then_else (ne (match_operand:SI 1 "register_operand" "2,*r,*r") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) ! (set (match_operand:SI 2 "register_operand" "=c,*r,m*q*c*l") ! (plus:SI (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "=X,&x,&x")) (clobber (match_scratch:SI 4 "=X,X,r"))] --- 7302,7317 ---- ;; will cause reload to blow up since we don't allow output reloads on ;; JUMP_INSNs. + ;; In order that the length attribute is calculated correctly, the + ;; label MUST be operand 0. + (define_insn "" [(set (pc) ! (if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) ! (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l") ! (plus:SI (match_dup 1) ! (const_int -1))) (clobber (match_scratch:CC 3 "=X,&x,&x")) (clobber (match_scratch:SI 4 "=X,X,r"))] *************** *** 7149,7161 **** (set_attr "length" "*,12,16")]) ;; Similar, but we can use GE since we have a REG_NONNEG. (define_insn "" [(set (pc) ! (if_then_else (ge (match_operand:SI 1 "register_operand" "2,*r,*r") (const_int 0)) (label_ref (match_operand 0 "" "")) (pc))) ! (set (match_operand:SI 2 "register_operand" "=c,*r,m*q*c*l") ! (plus:SI (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "=X,&x,&X")) (clobber (match_scratch:SI 4 "=X,X,r"))] --- 7329,7366 ---- (set_attr "length" "*,12,16")]) + (define_insn "" + [(set (pc) + (if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r") + (const_int 1)) + (pc) + (label_ref (match_operand 0 "" "")))) + (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l") + (plus:SI (match_dup 1) + (const_int -1))) + (clobber (match_scratch:CC 3 "=X,&x,&x")) + (clobber (match_scratch:SI 4 "=X,X,r"))] + "" + "* + { + if (which_alternative != 0) + return \"#\"; + else if (get_attr_length (insn) == 8) + return \"bdz %l0\"; + else + return \"{bdn|bdnz} $+8\;b %l0\"; + }" + [(set_attr "type" "branch") + (set_attr "length" "*,12,16")]) + ;; Similar, but we can use GE since we have a REG_NONNEG. (define_insn "" [(set (pc) ! (if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r") (const_int 0)) (label_ref (match_operand 0 "" "")) (pc))) ! (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l") ! (plus:SI (match_dup 1) ! (const_int -1))) (clobber (match_scratch:CC 3 "=X,&x,&X")) (clobber (match_scratch:SI 4 "=X,X,r"))] *************** *** 7175,7184 **** (define_insn "" [(set (pc) ! (if_then_else (eq (match_operand:SI 1 "register_operand" "2,*r,*r") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) ! (set (match_operand:SI 2 "register_operand" "=c,*r,m*q*c*l") ! (plus:SI (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "=X,&x,&x")) (clobber (match_scratch:SI 4 "=X,X,r"))] --- 7380,7414 ---- (define_insn "" [(set (pc) ! (if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r") ! (const_int 0)) ! (pc) ! (label_ref (match_operand 0 "" "")))) ! (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l") ! (plus:SI (match_dup 1) ! (const_int -1))) ! (clobber (match_scratch:CC 3 "=X,&x,&X")) ! (clobber (match_scratch:SI 4 "=X,X,r"))] ! "find_reg_note (insn, REG_NONNEG, 0)" ! "* ! { ! if (which_alternative != 0) ! return \"#\"; ! else if (get_attr_length (insn) == 8) ! return \"bdz %l0\"; ! else ! return \"{bdn|bdnz} $+8\;b %l0\"; ! }" ! [(set_attr "type" "branch") ! (set_attr "length" "*,12,16")]) ! ! (define_insn "" ! [(set (pc) ! (if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) ! (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l") ! (plus:SI (match_dup 1) ! (const_int -1))) (clobber (match_scratch:CC 3 "=X,&x,&x")) (clobber (match_scratch:SI 4 "=X,X,r"))] *************** *** 7196,7199 **** --- 7426,7453 ---- (set_attr "length" "*,12,16")]) + (define_insn "" + [(set (pc) + (if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r") + (const_int 1)) + (pc) + (label_ref (match_operand 0 "" "")))) + (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l") + (plus:SI (match_dup 1) + (const_int -1))) + (clobber (match_scratch:CC 3 "=X,&x,&x")) + (clobber (match_scratch:SI 4 "=X,X,r"))] + "" + "* + { + if (which_alternative != 0) + return \"#\"; + else if (get_attr_length (insn) == 8) + return \"{bdn|bdnz} %l0\"; + else + return \"bdz $+8\;b %l0\"; + }" + [(set_attr "type" "branch") + (set_attr "length" "*,12,16")]) + (define_split [(set (pc) *************** *** 7204,7208 **** (match_operand 6 "" ""))) (set (match_operand:SI 0 "gpc_reg_operand" "") ! (plus:SI (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "")) (clobber (match_scratch:SI 4 ""))] --- 7458,7463 ---- (match_operand 6 "" ""))) (set (match_operand:SI 0 "gpc_reg_operand" "") ! (plus:SI (match_dup 1) ! (const_int -1))) (clobber (match_scratch:CC 3 "")) (clobber (match_scratch:SI 4 ""))] *************** *** 7209,7216 **** "reload_completed" [(parallel [(set (match_dup 3) ! (compare:CC (plus:SI (match_dup 1) (const_int -1)) (const_int 0))) ! (set (match_dup 0) (plus:SI (match_dup 1) (const_int -1)))]) ! (set (pc) (if_then_else (match_dup 7) (match_dup 5) (match_dup 6)))] " { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], --- 7464,7476 ---- "reload_completed" [(parallel [(set (match_dup 3) ! (compare:CC (plus:SI (match_dup 1) ! (const_int -1)) (const_int 0))) ! (set (match_dup 0) ! (plus:SI (match_dup 1) ! (const_int -1)))]) ! (set (pc) (if_then_else (match_dup 7) ! (match_dup 5) ! (match_dup 6)))] " { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], *************** *** 7230,7238 **** "reload_completed && ! gpc_reg_operand (operands[0], SImode)" [(parallel [(set (match_dup 3) ! (compare:CC (plus:SI (match_dup 1) (const_int -1)) (const_int 0))) ! (set (match_dup 4) (plus:SI (match_dup 1) (const_int -1)))]) ! (set (match_dup 0) (match_dup 4)) ! (set (pc) (if_then_else (match_dup 7) (match_dup 5) (match_dup 6)))] " { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], --- 7490,7504 ---- "reload_completed && ! gpc_reg_operand (operands[0], SImode)" [(parallel [(set (match_dup 3) ! (compare:CC (plus:SI (match_dup 1) ! (const_int -1)) (const_int 0))) ! (set (match_dup 4) ! (plus:SI (match_dup 1) ! (const_int -1)))]) ! (set (match_dup 0) ! (match_dup 4)) ! (set (pc) (if_then_else (match_dup 7) ! (match_dup 5) ! (match_dup 6)))] " { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/sysv4.h gcc-2.7.1/config/rs6000/sysv4.h *** gcc-2.7.0/config/rs6000/sysv4.h Thu Jun 15 16:28:53 1995 --- gcc-2.7.1/config/rs6000/sysv4.h Wed Nov 8 08:53:41 1995 *************** *** 28,32 **** #define MASK_NO_TRACEBACK 0x08000000 /* eliminate traceback words */ #define MASK_LITTLE_ENDIAN 0x04000000 /* target is little endian */ ! #define MASK_NO_TOC 0x02000000 /* do not use TOC for loading addresses */ #define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE) --- 28,33 ---- #define MASK_NO_TRACEBACK 0x08000000 /* eliminate traceback words */ #define MASK_LITTLE_ENDIAN 0x04000000 /* target is little endian */ ! #define MASK_AIX_CALLS 0x02000000 /* Use AIX calling sequence */ ! #define MASK_PROTOTYPE 0x01000000 /* Only prototyped fcns pass variable args */ #define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE) *************** *** 35,39 **** #define TARGET_NO_TRACEBACK (target_flags & MASK_NO_TRACEBACK) #define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN) ! #define TARGET_NO_TOC (target_flags & MASK_NO_TOC) #define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE) --- 36,44 ---- #define TARGET_NO_TRACEBACK (target_flags & MASK_NO_TRACEBACK) #define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN) ! #define TARGET_AIX_CALLS (target_flags & MASK_AIX_CALLS) ! #define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE) ! #define TARGET_TOC (target_flags & (MASK_64BIT \ ! | MASK_RELOCATABLE \ ! | MASK_MINIMAL_TOC)) #define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE) *************** *** 40,45 **** #define TARGET_TRACEBACK (! TARGET_NO_TRACEBACK) #define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) ! #define TARGET_TOC (! TARGET_NO_TOC) #undef SUBTARGET_SWITCHES #define SUBTARGET_SWITCHES \ --- 45,60 ---- #define TARGET_TRACEBACK (! TARGET_NO_TRACEBACK) #define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) ! #define TARGET_NO_AIX_CALLS (! TARGET_AIX_CALLS) ! #define TARGET_NO_PROTOTYPE (! TARGET_PROTOTYPE) ! #define TARGET_NO_TOC (! TARGET_TOC) ! ! #define TARGET_V4_CALLS TARGET_NO_AIX_CALLS ! ! /* Pseudo target to indicate whether the object format is ELF ! (to get around not having conditional compilation in the md file) */ ! #define TARGET_ELF 1 + /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just + the same as -mminimal-toc. */ #undef SUBTARGET_SWITCHES #define SUBTARGET_SWITCHES \ *************** *** 56,61 **** { "big-endian", -MASK_LITTLE_ENDIAN }, \ { "big", -MASK_LITTLE_ENDIAN }, \ ! { "no-toc", MASK_NO_TOC | MASK_MINIMAL_TOC }, \ ! { "toc", -MASK_NO_TOC }, /* Sometimes certain combinations of command options do not make sense --- 71,81 ---- { "big-endian", -MASK_LITTLE_ENDIAN }, \ { "big", -MASK_LITTLE_ENDIAN }, \ ! { "no-toc", 0 }, \ ! { "toc", MASK_MINIMAL_TOC }, \ ! { "full-toc", MASK_MINIMAL_TOC }, \ ! { "call-aix", MASK_AIX_CALLS }, \ ! { "call-sysv", -MASK_AIX_CALLS }, \ ! { "prototype", MASK_PROTOTYPE }, \ ! { "no-prototype", -MASK_PROTOTYPE }, /* Sometimes certain combinations of command options do not make sense *************** *** 70,79 **** #define SUBTARGET_OVERRIDE_OPTIONS \ do { \ - if (TARGET_RELOCATABLE && TARGET_NO_TOC) \ - { \ - target_flags &= ~ MASK_NO_TOC; \ - error ("-mrelocatable and -mno-toc are incompatible."); \ - } \ - \ if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \ { \ --- 90,93 ---- *************** *** 81,90 **** error ("-mrelocatable and -mno-minimal-toc are incompatible."); \ } \ - \ - if (TARGET_NO_TOC && !TARGET_MINIMAL_TOC) \ - { \ - target_flags |= MASK_MINIMAL_TOC; \ - error ("-mno-toc and -mno-minimal-toc are incompatible."); \ - } \ } while (0) --- 95,98 ---- *************** *** 97,100 **** --- 105,119 ---- #define FIXED_R13 1 + /* System V.4 passes the first 8 floating arguments in registers, + instead of the first 13 like AIX does. */ + #undef FP_ARG_MAX_REG + #define FP_ARG_AIX_MAX_REG 45 + #define FP_ARG_V4_MAX_REG 40 + #define FP_ARG_MAX_REG ((TARGET_AIX_CALLS) ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG) + + /* Size of the V.4 varargs area if needed */ + #undef RS6000_VARARGS_AREA + #define RS6000_VARARGS_AREA ((rs6000_sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0) + /* Override default big endianism */ #undef BYTES_BIG_ENDIAN *************** *** 103,106 **** --- 122,148 ---- #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN) + /* Define this to set the endianness to use in libgcc2.c, which can + not depend on target_flags. */ + #ifndef _LITTLE_ENDIAN + #define LIBGCC2_WORDS_BIG_ENDIAN 1 + #else + #define LIBGCC2_WORDS_BIG_ENDIAN 0 + #endif + + /* Size of the outgoing register save area */ + #undef RS6000_REG_SAVE + #define RS6000_REG_SAVE (TARGET_AIX_CALLS ? (TARGET_64BIT ? 64 : 32) : 0) + + /* Size of the fixed area on the stack. For AIX, use the standard 6 word + area, otherwise use 2 words to store back chain & LR. */ + #undef RS6000_SAVE_AREA + #define RS6000_SAVE_AREA \ + ((TARGET_AIX_CALLS ? 24 : 8) << (TARGET_64BIT ? 1 : 0)) + + /* Define cutoff for using external functions to save floating point. + Currently on V.4, always use inline stores */ + #undef FP_SAVE_INLINE + #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64) + /* Don't generate XCOFF debugging information. */ *************** *** 129,132 **** --- 171,176 ---- #undef SELECT_SECTION #undef ASM_DECLARE_FUNCTION_NAME + #undef ASM_OUTPUT_CONSTRUCTOR + #undef ASM_OUTPUT_DESTRUCTOR /* Use the regular svr4 definitions. */ *************** *** 193,227 **** if (in_section != in_toc) \ { \ if (! toc_initialized) \ { \ ! if (!TARGET_RELOCATABLE && !TARGET_NO_TOC) \ ! fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ ! \ ! if (TARGET_MINIMAL_TOC) \ ! { \ ! if (!TARGET_RELOCATABLE && !TARGET_NO_TOC) \ ! { \ ! ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0); \ ! fprintf (asm_out_file, "\t.tc "); \ ! ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \ ! ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ ! fprintf (asm_out_file, "\n"); \ ! } \ ! \ ! fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ ! ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ ! fprintf (asm_out_file, " = .+32768\n"); \ ! } \ ! \ toc_initialized = 1; \ } \ - \ - else \ - fprintf (asm_out_file, "%s\n", \ - (TARGET_MINIMAL_TOC \ - ? MINIMAL_TOC_SECTION_ASM_OP \ - : TOC_SECTION_ASM_OP)); \ - \ - in_section = in_toc; \ } \ } --- 237,248 ---- if (in_section != in_toc) \ { \ + in_section = in_toc; \ + fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ if (! toc_initialized) \ { \ ! ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ ! fprintf (asm_out_file, " = .+32768\n"); \ toc_initialized = 1; \ } \ } \ } *************** *** 297,302 **** #define ASM_SPEC \ "-u \ ! %{mcpu=601: -m601} %{mcpu=ppc601: -m601} %{mcpu=mpc601: -m601} \ ! %{!mcpu=601: %{!mcpu=ppc601: %{!mcpu=mpc601: -mppc }}} \ %{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ %{mrelocatable} \ --- 318,322 ---- #define ASM_SPEC \ "-u \ ! %{mcpu=601: -m601} %{!mcpu=601: -mppc} \ %{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ %{mrelocatable} \ *************** *** 303,306 **** --- 323,334 ---- %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}" + /* Output .file and comments listing what options there are */ + #undef ASM_FILE_START + #define ASM_FILE_START(FILE) \ + do { \ + ASM_OUTPUT_OPTIONS (FILE); \ + output_file_directive ((FILE), main_input_filename); \ + } while (0) + /* This is the end of what might become sysv4.h. */ *************** *** 344,348 **** --- 372,447 ---- #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)"); + + + /* Output assembler code for a block containing the constant parts + of a trampoline, leaving space for the variable parts. + + The trampoline should set the static chain pointer to value placed + into the trampoline and should branch to the specified routine. + + Unlike AIX, this needs real code. */ + + #undef TRAMPOLINE_TEMPLATE + #define TRAMPOLINE_TEMPLATE(FILE) \ + do { \ + char *sc = reg_names[STATIC_CHAIN_REGNUM]; \ + char *r0 = reg_names[0]; \ + \ + if (STATIC_CHAIN_REGNUM == 0 || !TARGET_NEW_MNEMONICS) \ + abort (); \ + \ + if (TARGET_64BIT) \ + { \ + fprintf (FILE, "\tmflr %s\n", r0); /* offset 0 */ \ + fprintf (FILE, "\tbl .LTRAMP1\n"); /* offset 4 */ \ + fprintf (FILE, "\t.long 0,0,0,0\n"); /* offset 8 */ \ + fprintf (FILE, ".LTRAMP1:\n"); \ + fprintf (FILE, "\tmflr %s\n", sc); /* offset 28 */ \ + fprintf (FILE, "\tmtlr %s\n", r0); /* offset 32 */ \ + fprintf (FILE, "\tld %s,0(%s)\n", r0, sc); /* offset 36 */ \ + fprintf (FILE, "\tld %s,8(%s)\n", sc, sc); /* offset 40 */ \ + fprintf (FILE, "\tmtctr %s\n", r0); /* offset 44 */ \ + fprintf (FILE, "\tbctr\n"); /* offset 48 */ \ + } \ + else \ + { \ + fprintf (FILE, "\tmflr %s\n", r0); /* offset 0 */ \ + fprintf (FILE, "\tbl .LTRAMP1\n"); /* offset 4 */ \ + fprintf (FILE, "\t.long 0,0\n"); /* offset 8 */ \ + fprintf (FILE, ".LTRAMP1:\n"); \ + fprintf (FILE, "\tmflr %s\n", sc); /* offset 20 */ \ + fprintf (FILE, "\tmtlr %s\n", r0); /* offset 24 */ \ + fprintf (FILE, "\tlwz %s,0(%s)\n", r0, sc); /* offset 28 */ \ + fprintf (FILE, "\tlwz %s,4(%s)\n", sc, sc); /* offset 32 */ \ + fprintf (FILE, "\tmtctr %s\n", r0); /* offset 36 */ \ + fprintf (FILE, "\tbctr\n"); /* offset 40 */ \ + } \ + } while (0) + + /* Length in units of the trampoline for entering a nested function. */ + + #undef TRAMPOLINE_SIZE + #define TRAMPOLINE_SIZE (TARGET_64BIT ? 48 : 40) + + /* Emit RTL insns to initialize the variable parts of a trampoline. + FNADDR is an RTX for the address of the function's pure code. + CXT is an RTX for the static chain value for the function. */ + + #undef INITIALIZE_TRAMPOLINE + #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \ + { \ + rtx reg = gen_reg_rtx (Pmode); \ + \ + emit_move_insn (reg, FNADDR); \ + emit_move_insn (gen_rtx (MEM, Pmode, \ + plus_constant (ADDR, 8)), \ + reg); \ + emit_move_insn (gen_rtx (MEM, Pmode, \ + plus_constant (ADDR, (TARGET_64BIT ? 16 : 12))), \ + CXT); \ + emit_insn (gen_sync_isync (gen_rtx (MEM, BLKmode, ADDR))); \ + } + #undef CPP_PREDEFINES #define CPP_PREDEFINES \ *************** *** 384,387 **** --- 483,488 ---- %{posix: -D_POSIX_SOURCE} \ %{mrelocatable: -D_RELOCATABLE} \ + %{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}} \ + %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \ %{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \ %{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \ *************** *** 402,414 **** %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=403: -D_ARCH_PPC} \ - %{mcpu=mpc403: -D_ARCH_PPC} \ - %{mcpu=ppc403: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=mpc601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=ppc601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=603: -D_ARCH_PPC} \ ! %{mcpu=mpc603: -D_ARCH_PPC} \ ! %{mcpu=ppc603: -D_ARCH_PPC} \ ! %{mcpu=604: -D_ARCH_PPC} \ ! %{mcpu=mpc604: -D_ARCH_PPC} \ ! %{mcpu=ppc604: -D_ARCH_PPC}" --- 503,507 ---- %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=403: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=603: -D_ARCH_PPC} \ ! %{mcpu=604: -D_ARCH_PPC}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/sysv4le.h gcc-2.7.1/config/rs6000/sysv4le.h *** gcc-2.7.0/config/rs6000/sysv4le.h Thu Jun 15 16:29:02 1995 --- gcc-2.7.1/config/rs6000/sysv4le.h Fri Jul 21 14:19:30 1995 *************** *** 30,33 **** --- 30,35 ---- %{posix: -D_POSIX_SOURCE} \ %{mrelocatable: -D_RELOCATABLE} \ + %{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}} \ + %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \ %{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \ %{mbig-endian: -D_BIG_ENDIAN -Amachine(bigendian)} \ *************** *** 48,60 **** %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=403: -D_ARCH_PPC} \ - %{mcpu=mpc403: -D_ARCH_PPC} \ - %{mcpu=ppc403: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=mpc601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=ppc601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=603: -D_ARCH_PPC} \ ! %{mcpu=mpc603: -D_ARCH_PPC} \ ! %{mcpu=ppc603: -D_ARCH_PPC} \ ! %{mcpu=604: -D_ARCH_PPC} \ ! %{mcpu=mpc604: -D_ARCH_PPC} \ ! %{mcpu=ppc604: -D_ARCH_PPC}" --- 50,54 ---- %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=403: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=603: -D_ARCH_PPC} \ ! %{mcpu=604: -D_ARCH_PPC}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/t-eabiaix gcc-2.7.1/config/rs6000/t-eabiaix *** gcc-2.7.0/config/rs6000/t-eabiaix --- gcc-2.7.1/config/rs6000/t-eabiaix Fri Jul 21 14:19:31 1995 *************** *** 0 **** --- 1,40 ---- + # Do not build libgcc1. + LIBGCC1 = + CROSS_LIBGCC1 = + + # These are really part of libgcc1, but this will cause them to be + # built correctly, so... [taken from t-sparclite] + LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c eabi.asm eabi-ctors.c + + dp-bit.c: $(srcdir)/config/fp-bit.c + cat $(srcdir)/config/fp-bit.c > dp-bit.c + + fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + + eabi.asm: $(srcdir)/config/rs6000/eabi.asm + cat $(srcdir)/config/rs6000/eabi.asm > eabi.asm + + eabi-ctors.c: $(srcdir)/config/rs6000/eabi-ctors.c + cat $(srcdir)/config/rs6000/eabi-ctors.c > eabi-ctors.c + + # Build libgcc.a with different options. + + MULTILIB_OPTIONS = msoft-float \ + mrelocatable \ + mlittle \ + mcall-sysv + + MULTILIB_DIRNAMES = soft-float \ + relocatable \ + little-endian \ + call-sysv + + MULTILIB_MATCHES = mlittle=mlittle-endian \ + msoft-float=mcpu?403 \ + msoft-float=mcpu?mpc403 \ + msoft-float=mcpu?ppc403 + + LIBGCC = stmp-multilib + INSTALL_LIBGCC = install-multilib diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/t-eabigas gcc-2.7.1/config/rs6000/t-eabigas *** gcc-2.7.0/config/rs6000/t-eabigas Mon May 22 14:58:43 1995 --- gcc-2.7.1/config/rs6000/t-eabigas Fri Jul 21 14:19:32 1995 *************** *** 23,35 **** MULTILIB_OPTIONS = msoft-float \ ! mrelocatable/mno-toc \ ! mlittle/mbig MULTILIB_DIRNAMES = soft-float \ ! relocatable no-toc \ ! little-endian big-endian MULTILIB_MATCHES = mlittle=mlittle-endian \ - mbig=mbig-endian \ msoft-float=mcpu?403 \ msoft-float=mcpu?mpc403 \ --- 23,36 ---- MULTILIB_OPTIONS = msoft-float \ ! mrelocatable \ ! mlittle \ ! mcall-aix MULTILIB_DIRNAMES = soft-float \ ! relocatable \ ! little-endian \ ! call-aix MULTILIB_MATCHES = mlittle=mlittle-endian \ msoft-float=mcpu?403 \ msoft-float=mcpu?mpc403 \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/t-eabilegas gcc-2.7.1/config/rs6000/t-eabilegas *** gcc-2.7.0/config/rs6000/t-eabilegas --- gcc-2.7.1/config/rs6000/t-eabilegas Fri Jul 21 14:19:32 1995 *************** *** 0 **** --- 1,40 ---- + # Do not build libgcc1. + LIBGCC1 = + CROSS_LIBGCC1 = + + # These are really part of libgcc1, but this will cause them to be + # built correctly, so... [taken from t-sparclite] + LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c eabi.asm eabi-ctors.c + + dp-bit.c: $(srcdir)/config/fp-bit.c + cat $(srcdir)/config/fp-bit.c > dp-bit.c + + fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + + eabi.asm: $(srcdir)/config/rs6000/eabi.asm + cat $(srcdir)/config/rs6000/eabi.asm > eabi.asm + + eabi-ctors.c: $(srcdir)/config/rs6000/eabi-ctors.c + cat $(srcdir)/config/rs6000/eabi-ctors.c > eabi-ctors.c + + # Build libgcc.a with different options. + + MULTILIB_OPTIONS = msoft-float \ + mrelocatable \ + mbig \ + mcall-aix + + MULTILIB_DIRNAMES = soft-float \ + relocatable \ + big-endian \ + call-aix + + MULTILIB_MATCHES = mbig=mbig-endian \ + msoft-float=mcpu?403 \ + msoft-float=mcpu?mpc403 \ + msoft-float=mcpu?ppc403 + + LIBGCC = stmp-multilib + INSTALL_LIBGCC = install-multilib diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/t-eabisim gcc-2.7.1/config/rs6000/t-eabisim *** gcc-2.7.0/config/rs6000/t-eabisim --- gcc-2.7.1/config/rs6000/t-eabisim Fri Aug 25 19:18:07 1995 *************** *** 0 **** --- 1,34 ---- + # Do not build libgcc1. + LIBGCC1 = + CROSS_LIBGCC1 = + + # These are really part of libgcc1, but this will cause them to be + # built correctly, so... [taken from t-sparclite] + LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c eabi.asm eabi-ctors.c + + dp-bit.c: $(srcdir)/config/fp-bit.c + cat $(srcdir)/config/fp-bit.c > dp-bit.c + + fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + + eabi.asm: $(srcdir)/config/rs6000/eabi.asm + cat $(srcdir)/config/rs6000/eabi.asm > eabi.asm + + eabi-ctors.c: $(srcdir)/config/rs6000/eabi-ctors.c + cat $(srcdir)/config/rs6000/eabi-ctors.c > eabi-ctors.c + + # Build libgcc.a with different options. + + MULTILIB_OPTIONS = mlittle/mbig \ + mrelocatable + + MULTILIB_DIRNAMES = little-endian big-endian \ + mrelocatable + + MULTILIB_MATCHES = mlittle=mlittle-endian \ + mbig=mbig-endian + + LIBGCC = stmp-multilib + INSTALL_LIBGCC = install-multilib diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/t-newas gcc-2.7.1/config/rs6000/t-newas *** gcc-2.7.0/config/rs6000/t-newas --- gcc-2.7.1/config/rs6000/t-newas Thu Oct 26 18:03:12 1995 *************** *** 0 **** --- 1,28 ---- + # Do not build libgcc1. + LIBGCC1 = + CROSS_LIBGCC1 = + + # These are really part of libgcc1, but this will cause them to be + # built correctly, so... [taken from t-sparclite] + LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c + + dp-bit.c: $(srcdir)/config/fp-bit.c + cat $(srcdir)/config/fp-bit.c > dp-bit.c + + fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + + # Build the libraries for both hard and soft floating point + + MULTILIB_OPTIONS = msoft-float mcpu=common + MULTILIB_DIRNAMES = soft-float common + + LIBGCC = stmp-multilib + INSTALL_LIBGCC = install-multilib + + # Aix 3.2.x needs milli.exp for -mcpu=common + EXTRA_PARTS = milli.exp + milli.exp: $(srcdir)/config/rs6000/milli.exp + rm -f milli.exp + cp $(srcdir)/config/rs6000/milli.exp ./milli.exp diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/t-ppcgas gcc-2.7.1/config/rs6000/t-ppcgas *** gcc-2.7.0/config/rs6000/t-ppcgas Mon May 22 14:58:44 1995 --- gcc-2.7.1/config/rs6000/t-ppcgas Fri Jul 21 14:19:34 1995 *************** *** 17,29 **** MULTILIB_OPTIONS = msoft-float \ ! mno-toc \ ! mlittle/mbig MULTILIB_DIRNAMES = soft-float \ ! no-toc \ ! little-endian big-endian MULTILIB_MATCHES = mlittle=mlittle-endian \ - mbig=mbig-endian \ msoft-float=mcpu?403 \ msoft-float=mcpu?mpc403 \ --- 17,26 ---- MULTILIB_OPTIONS = msoft-float \ ! mlittle MULTILIB_DIRNAMES = soft-float \ ! little-endian MULTILIB_MATCHES = mlittle=mlittle-endian \ msoft-float=mcpu?403 \ msoft-float=mcpu?mpc403 \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/t-ppclegas gcc-2.7.1/config/rs6000/t-ppclegas *** gcc-2.7.0/config/rs6000/t-ppclegas --- gcc-2.7.1/config/rs6000/t-ppclegas Fri Jul 21 14:19:34 1995 *************** *** 0 **** --- 1,30 ---- + # Do not build libgcc1. + LIBGCC1 = + CROSS_LIBGCC1 = + + # These are really part of libgcc1, but this will cause them to be + # built correctly, so... [taken from t-sparclite] + LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c + + dp-bit.c: $(srcdir)/config/fp-bit.c + cat $(srcdir)/config/fp-bit.c > dp-bit.c + + fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + + # Build libgcc.a with different options. + + MULTILIB_OPTIONS = msoft-float \ + mlittle + + MULTILIB_DIRNAMES = soft-float \ + little-endian + + MULTILIB_MATCHES = mlittle=mlittle-endian \ + msoft-float=mcpu?403 \ + msoft-float=mcpu?mpc403 \ + msoft-float=mcpu?ppc403 + + LIBGCC = stmp-multilib + INSTALL_LIBGCC = install-multilib diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/rs6000/xm-rs6000.h gcc-2.7.1/config/rs6000/xm-rs6000.h *** gcc-2.7.0/config/rs6000/xm-rs6000.h Thu Jun 15 16:29:42 1995 --- gcc-2.7.1/config/rs6000/xm-rs6000.h Fri Jul 21 14:19:39 1995 *************** *** 45,48 **** --- 45,49 ---- #ifndef __GNUC__ #define USE_C_ALLOCA + extern char *alloca (); #define ONLY_INT_FIELDS #endif diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sh/lib1funcs.asm gcc-2.7.1/config/sh/lib1funcs.asm *** gcc-2.7.0/config/sh/lib1funcs.asm Thu Jun 15 16:30:08 1995 --- gcc-2.7.1/config/sh/lib1funcs.asm Mon Aug 28 06:40:50 1995 *************** *** 1,3 **** ! /* Copyright (C) 1994 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it --- 1,3 ---- ! /* Copyright (C) 1994, 1995 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it *************** *** 780,784 **** tst r3,r3 ! msws zero ? bf hiset ! rts ! yes - then weve got the answer sts macl,r0 --- 780,784 ---- tst r3,r3 ! msws zero ? bf hiset ! rts ! yes - then we have the answer sts macl,r0 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sh/sh.c gcc-2.7.1/config/sh/sh.c *** gcc-2.7.0/config/sh/sh.c Thu Jun 15 16:30:52 1995 --- gcc-2.7.1/config/sh/sh.c Sat Oct 21 18:30:33 1995 *************** *** 321,324 **** --- 321,325 ---- rtx t_reg = gen_rtx (REG, SImode, T_REG); enum rtx_code oldcode = code; + enum machine_mode mode; /* First need a compare insn. */ *************** *** 348,356 **** } ! sh_compare_op0 = force_reg (SImode, sh_compare_op0); if (code != EQ && code != NE && (sh_compare_op1 != const0_rtx || code == GTU || code == GEU || code == LTU || code == LEU)) ! sh_compare_op1 = force_reg (SImode, sh_compare_op1); emit_insn (gen_rtx (SET, VOIDmode, t_reg, --- 349,361 ---- } ! mode = GET_MODE (sh_compare_op0); ! if (mode == VOIDmode) ! mode = GET_MODE (sh_compare_op1); ! ! sh_compare_op0 = force_reg (mode, sh_compare_op0); if (code != EQ && code != NE && (sh_compare_op1 != const0_rtx || code == GTU || code == GEU || code == LTU || code == LEU)) ! sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_insn (gen_rtx (SET, VOIDmode, t_reg, *************** *** 1214,1218 **** while (from && count_si < 1020 && count_hi < 512) { ! int inc; if (GET_CODE (from) == BARRIER) --- 1219,1223 ---- while (from && count_si < 1020 && count_hi < 512) { ! int inc = get_attr_length (from); if (GET_CODE (from) == BARRIER) *************** *** 1219,1225 **** found_barrier = from; - /* Count the length of this insn - we assume that all moves will - be 2 bytes long, except the DImode/DFmode movess. */ - if (broken_move (from)) { --- 1224,1227 ---- *************** *** 1227,1237 **** if (hi_const (src)) ! found_hi = 1; else found_si = 1; - inc = (GET_MODE_SIZE (GET_MODE (src)) > 4) ? 4 : 2; } - else - inc = get_attr_length (from); if (GET_CODE (from) == INSN --- 1229,1244 ---- if (hi_const (src)) ! { ! found_hi = 1; ! /* We put the short constants before the long constants, so ! we must count the length of short constants in the range ! for the long constants. */ ! /* ??? This isn't optimal, but is easy to do. */ ! if (found_si) ! count_si += 2; ! } else found_si = 1; } if (GET_CODE (from) == INSN *************** *** 1263,1268 **** rtx label = gen_label_rtx (); ! /* We went one instruction too far above. */ ! from = PREV_INSN (from); /* Walk back to be just before any jump or label. Putting it before a label reduces the number of times the branch --- 1270,1281 ---- rtx label = gen_label_rtx (); ! /* If we exceeded the range, then we must back up over the last ! instruction we looked at. Otherwise, we just need to undo the ! NEXT_INSN at the end of the loop. */ ! if (count_hi > 512 || count_si > 1020) ! from = PREV_INSN (PREV_INSN (from)); ! else ! from = PREV_INSN (from); ! /* Walk back to be just before any jump or label. Putting it before a label reduces the number of times the branch *************** *** 1276,1279 **** --- 1289,1293 ---- from = emit_jump_insn_after (gen_jump (label), from); JUMP_LABEL (from) = label; + LABEL_NUSES (label) = 1; found_barrier = emit_barrier_after (from); emit_label_after (label, found_barrier); *************** *** 1418,1423 **** static void ! output_stack_adjust (size) int size; { if (size) --- 1432,1438 ---- static void ! output_stack_adjust (size, reg) int size; + rtx reg; { if (size) *************** *** 1433,1437 **** } ! insn = gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, val); emit_insn (insn); } --- 1448,1452 ---- } ! insn = gen_addsi3 (reg, reg, val); emit_insn (insn); } *************** *** 1531,1535 **** /* We have pretend args if we had an object sent partially in registers and partially on the stack, e.g. a large structure. */ ! output_stack_adjust (-current_function_pretend_args_size); extra_push = 0; --- 1546,1550 ---- /* We have pretend args if we had an object sent partially in registers and partially on the stack, e.g. a large structure. */ ! output_stack_adjust (-current_function_pretend_args_size, stack_pointer_rtx); extra_push = 0; *************** *** 1553,1557 **** } push_regs (live_regs_mask); ! output_stack_adjust (-get_frame_size ()); if (frame_pointer_needed) --- 1568,1572 ---- } push_regs (live_regs_mask); ! output_stack_adjust (-get_frame_size (), stack_pointer_rtx); if (frame_pointer_needed) *************** *** 1568,1574 **** if (frame_pointer_needed) ! emit_insn (gen_movsi (stack_pointer_rtx, frame_pointer_rtx)); ! ! output_stack_adjust (get_frame_size ()); /* Pop all the registers. */ --- 1583,1596 ---- if (frame_pointer_needed) ! { ! /* We deliberately make the add dependent on the frame_pointer, ! to ensure that instruction scheduling won't move the stack pointer ! adjust before instructions reading from the frame. This can fail ! if there is an interrupt which then writes to the stack. */ ! output_stack_adjust (get_frame_size (), frame_pointer_rtx); ! emit_insn (gen_movsi (stack_pointer_rtx, frame_pointer_rtx)); ! } ! else ! output_stack_adjust (get_frame_size (), stack_pointer_rtx); /* Pop all the registers. */ *************** *** 1581,1585 **** } ! output_stack_adjust (extra_push + current_function_pretend_args_size); } --- 1603,1608 ---- } ! output_stack_adjust (extra_push + current_function_pretend_args_size, ! stack_pointer_rtx); } *************** *** 1850,1852 **** --- 1873,1959 ---- } return 0; + } + + /* Return non-zero if REG is not used after INSN. + We assume REG is a reload reg, and therefore does + not live past labels or calls or jumps. */ + int + reg_unused_after (reg, insn) + rtx reg; + rtx insn; + { + enum rtx_code code; + rtx set; + + /* If the reg is set by this instruction, then it is safe for our + case. Disregard the case where this is a store to memory, since + we are checking a register used in the store address. */ + set = single_set (insn); + if (set && GET_CODE (SET_DEST (set)) != MEM + && reg_overlap_mentioned_p (reg, SET_DEST (set))) + return 1; + + while (insn = NEXT_INSN (insn)) + { + code = GET_CODE (insn); + + #if 0 + /* If this is a label that existed before reload, then the register + if dead here. However, if this is a label added by reorg, then + the register may still be live here. We can't tell the difference, + so we just ignore labels completely. */ + if (code == CODE_LABEL) + return 1; + /* else */ + #endif + + /* If this is a sequence, we must handle them all at once. + We could have for instance a call that sets the target register, + and a insn in a delay slot that uses the register. In this case, + we must return 0. */ + if (code == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE) + { + int i; + int retval = 0; + + for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++) + { + rtx this_insn = XVECEXP (PATTERN (insn), 0, i); + rtx set = single_set (this_insn); + + if (GET_CODE (this_insn) == CALL_INSN) + code = CALL_INSN; + + if (set && reg_overlap_mentioned_p (reg, SET_SRC (set))) + return 0; + if (set && reg_overlap_mentioned_p (reg, SET_DEST (set))) + { + if (GET_CODE (SET_DEST (set)) != MEM) + retval = 1; + else + return 0; + } + if (set == 0 + && reg_overlap_mentioned_p (reg, PATTERN (this_insn))) + return 0; + } + if (retval == 1) + return 1; + } + else if (GET_RTX_CLASS (code) == 'i') + { + rtx set = single_set (insn); + + if (set && reg_overlap_mentioned_p (reg, SET_SRC (set))) + return 0; + if (set && reg_overlap_mentioned_p (reg, SET_DEST (set))) + return GET_CODE (SET_DEST (set)) != MEM; + if (set == 0 && reg_overlap_mentioned_p (reg, PATTERN (insn))) + return 0; + } + + if (code == CALL_INSN && call_used_regs[REGNO (reg)]) + return 1; + } + return 1; } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sh/sh.h gcc-2.7.1/config/sh/sh.h *** gcc-2.7.0/config/sh/sh.h Thu Jun 15 16:31:06 1995 --- gcc-2.7.1/config/sh/sh.h Sun Oct 22 19:35:00 1995 *************** *** 47,52 **** #define LINK_SPEC "%{ml:-m shl}" ! /* Show we can debug even without a frame pointer. */ ! #define CAN_DEBUG_WITHOUT_FP #define CONDITIONAL_REGISTER_USAGE \ --- 47,52 ---- #define LINK_SPEC "%{ml:-m shl}" ! /* We can not debug without a frame pointer. */ ! /* #define CAN_DEBUG_WITHOUT_FP */ #define CONDITIONAL_REGISTER_USAGE \ *************** *** 799,803 **** or if it is a pseudo reg. */ #define REG_OK_FOR_BASE_P(X) \ ! (REGNO (X) <= 16 || REGNO(X) >= FIRST_PSEUDO_REGISTER) /* Nonzero if X is a hard reg that can be used as an index --- 799,803 ---- or if it is a pseudo reg. */ #define REG_OK_FOR_BASE_P(X) \ ! (REGNO (X) <= 16 || REGNO (X) >= FIRST_PSEUDO_REGISTER) /* Nonzero if X is a hard reg that can be used as an index *************** *** 804,809 **** or if it is a pseudo reg. */ #define REG_OK_FOR_INDEX_P(X) \ ! (REGNO (X) == 0 || REGNO(X) >= FIRST_PSEUDO_REGISTER) #else --- 804,814 ---- or if it is a pseudo reg. */ #define REG_OK_FOR_INDEX_P(X) \ ! (REGNO (X) == 0 || REGNO (X) >= FIRST_PSEUDO_REGISTER) + /* Nonzero if X/OFFSET is a hard reg that can be used as an index + or if X is a pseudo reg. */ + #define SUBREG_OK_FOR_INDEX_P(X, OFFSET) \ + ((REGNO (X) == 0 && OFFSET == 0) || REGNO (X) >= FIRST_PSEUDO_REGISTER) + #else *************** *** 810,818 **** /* Nonzero if X is a hard reg that can be used as a base reg. */ #define REG_OK_FOR_BASE_P(X) \ ! REGNO_OK_FOR_BASE_P (REGNO (X)) /* Nonzero if X is a hard reg that can be used as an index. */ #define REG_OK_FOR_INDEX_P(X) \ ! REGNO_OK_FOR_INDEX_P (REGNO (X)) #endif --- 815,827 ---- /* Nonzero if X is a hard reg that can be used as a base reg. */ #define REG_OK_FOR_BASE_P(X) \ ! REGNO_OK_FOR_BASE_P (REGNO (X)) /* Nonzero if X is a hard reg that can be used as an index. */ #define REG_OK_FOR_INDEX_P(X) \ ! REGNO_OK_FOR_INDEX_P (REGNO (X)) ! ! /* Nonzero if X/OFFSET is a hard reg that can be used as an index. */ ! #define SUBREG_OK_FOR_INDEX_P(X, OFFSET) \ ! (REGNO_OK_FOR_INDEX_P (REGNO (X)) && OFFSET == 0) #endif *************** *** 844,847 **** --- 853,859 ---- && REG_OK_FOR_BASE_P (SUBREG_REG (X)))) + /* Since this must be r0, which is a single register class, we must check + SUBREGs more carefully, to be sure that we don't accept one that extends + outside the class. */ #define INDEX_REGISTER_RTX_P(X) \ ((GET_CODE (X) == REG && REG_OK_FOR_INDEX_P (X)) \ *************** *** 848,852 **** || (GET_CODE (X) == SUBREG \ && GET_CODE (SUBREG_REG (X)) == REG \ ! && REG_OK_FOR_INDEX_P (SUBREG_REG (X)))) /* Jump to LABEL if X is a valid address RTX. This must also take --- 860,864 ---- || (GET_CODE (X) == SUBREG \ && GET_CODE (SUBREG_REG (X)) == REG \ ! && SUBREG_OK_FOR_INDEX_P (SUBREG_REG (X), SUBREG_WORD (X)))) /* Jump to LABEL if X is a valid address RTX. This must also take *************** *** 1106,1110 **** #define CTORS_SECTION_ASM_OP "\t.section\t.ctors\n" #define DTORS_SECTION_ASM_OP "\t.section\t.dtors\n" - #define INIT_SECTION_ASM_OP "\t.section\t.init\n" #define EXTRA_SECTIONS in_ctors, in_dtors #define EXTRA_SECTION_FUNCTIONS \ --- 1118,1121 ---- *************** *** 1419,1427 **** MODE = SImode; ! /* PROMOTE_FUNCTION_ARGS and PROMOTE_FUNCTION_RETURN appear to have no ! effect, because all unprototyped char/shorts are already promoted to ! int, and because PROMOTE_PROTOTYPES causes all prototypes char/shorts ! to be promoted to it. */ /* ??? Define ACCUMULATE_OUTGOING_ARGS? This is more efficient than pushing and poping arguments. However, we do have push/pop instructions, and --- 1430,1440 ---- MODE = SImode; ! /* Defining PROMOTE_FUNCTION_ARGS eliminates some unnecessary zero/sign ! extensions applied to char/short functions arguments. Defining ! PROMOTE_FUNCTION_RETURN does the same for function returns. */ + #define PROMOTE_FUNCTION_ARGS + #define PROMOTE_FUNCTION_RETURN + /* ??? Define ACCUMULATE_OUTGOING_ARGS? This is more efficient than pushing and poping arguments. However, we do have push/pop instructions, and *************** *** 1431,1432 **** --- 1444,1448 ---- /* ??? Define ADJUST_COSTS? */ + + /* For the sake of libgcc2.c, indicate target supports atexit. */ + #define HAVE_ATEXIT diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sh/sh.md gcc-2.7.1/config/sh/sh.md *** gcc-2.7.0/config/sh/sh.md Thu Jun 15 16:57:16 1995 --- gcc-2.7.1/config/sh/sh.md Sun Nov 5 11:13:50 1995 *************** *** 22,25 **** --- 22,28 ---- + ;; ??? Should prepend a * to all pattern names which are not used. + ;; This will make the compiler smaller, and rebuilds after changes faster. + ;; ??? Should be enhanced to include support for many more GNU superoptimizer ;; sequences. Especially the sequences for arithmetic right shifts. *************** *** 196,200 **** (and (eq_attr "type" "cbranch") (eq_attr "cpu" "sh2,sh3")) ! [(eq_attr "in_delay_slot" "yes") (const_int 1) (nil)]) ;; ------------------------------------------------------------------------- --- 199,203 ---- (and (eq_attr "type" "cbranch") (eq_attr "cpu" "sh2,sh3")) ! [(eq_attr "in_delay_slot" "yes") (eq_attr "in_delay_slot" "yes") (nil)]) ;; ------------------------------------------------------------------------- *************** *** 504,509 **** }") - ;; ??? Why is this disabled? - (define_insn "" [(set (reg:DI 20) --- 507,510 ---- *************** *** 510,519 **** (mult:DI (sign_extend:DI (match_operand:SI 1 "arith_reg_operand" "r")) (sign_extend:DI (match_operand:SI 2 "arith_reg_operand" "r"))))] ! "(TARGET_SH2) && 0" "dmuls.l %2,%1" [(set_attr "type" "dmpy")]) - ;; ??? Why is this disabled? - (define_expand "mulsidi3" [(set (reg:DI 20) --- 511,518 ---- (mult:DI (sign_extend:DI (match_operand:SI 1 "arith_reg_operand" "r")) (sign_extend:DI (match_operand:SI 2 "arith_reg_operand" "r"))))] ! "TARGET_SH2" "dmuls.l %2,%1" [(set_attr "type" "dmpy")]) (define_expand "mulsidi3" [(set (reg:DI 20) *************** *** 522,530 **** (set (match_operand:DI 0 "arith_reg_operand" "") (reg:DI 20))] ! "(TARGET_SH2) && 0" "") - ;; ??? Why is this disabled? - (define_insn "" [(set (reg:DI 20) --- 521,527 ---- (set (match_operand:DI 0 "arith_reg_operand" "") (reg:DI 20))] ! "TARGET_SH2" "") (define_insn "" [(set (reg:DI 20) *************** *** 531,540 **** (mult:DI (zero_extend:DI (match_operand:SI 1 "arith_reg_operand" "r")) (zero_extend:DI (match_operand:SI 2 "arith_reg_operand" "r"))))] ! "(TARGET_SH2) && 0" "dmulu.l %2,%1" [(set_attr "type" "dmpy")]) - ;; ??? Why is this disabled? - (define_expand "umulsidi3" [(set (reg:DI 20) --- 528,535 ---- (mult:DI (zero_extend:DI (match_operand:SI 1 "arith_reg_operand" "r")) (zero_extend:DI (match_operand:SI 2 "arith_reg_operand" "r"))))] ! "TARGET_SH2" "dmulu.l %2,%1" [(set_attr "type" "dmpy")]) (define_expand "umulsidi3" [(set (reg:DI 20) *************** *** 543,547 **** (set (match_operand:DI 0 "arith_reg_operand" "") (reg:DI 20))] ! "(TARGET_SH2) && 0" "") --- 538,588 ---- (set (match_operand:DI 0 "arith_reg_operand" "") (reg:DI 20))] ! "TARGET_SH2" ! "") ! ! (define_insn "" ! [(set (reg:SI 20) ! (truncate:SI ! (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "arith_reg_operand" "r")) ! (sign_extend:DI (match_operand:SI 2 "arith_reg_operand" "r"))) ! (const_int 32)))) ! (clobber (reg:SI 21))] ! "TARGET_SH2" ! "dmuls.l %2,%1" ! [(set_attr "type" "dmpy")]) ! ! (define_expand "smulsi3_highpart" ! [(parallel [(set (reg:SI 20) ! (truncate:SI ! (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "arith_reg_operand" "")) ! (sign_extend:DI (match_operand:SI 2 "arith_reg_operand" ""))) ! (const_int 32)))) ! (clobber (reg:SI 21))]) ! (set (match_operand:SI 0 "arith_reg_operand" "") ! (reg:SI 20))] ! "TARGET_SH2" ! "") ! ! (define_insn "" ! [(set (reg:SI 20) ! (truncate:SI ! (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "arith_reg_operand" "r")) ! (zero_extend:DI (match_operand:SI 2 "arith_reg_operand" "r"))) ! (const_int 32)))) ! (clobber (reg:SI 21))] ! "TARGET_SH2" ! "dmulu.l %2,%1" ! [(set_attr "type" "dmpy")]) ! ! (define_expand "umulsi3_highpart" ! [(parallel [(set (reg:SI 20) ! (truncate:SI ! (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "arith_reg_operand" "")) ! (zero_extend:DI (match_operand:SI 2 "arith_reg_operand" ""))) ! (const_int 32)))) ! (clobber (reg:SI 21))]) ! (set (match_operand:SI 0 "arith_reg_operand" "") ! (reg:SI 20))] ! "TARGET_SH2" "") *************** *** 947,955 **** " { ! rtx low_src = operand_subword (operands[1], 1, 0, DImode); ! rtx high_src = operand_subword (operands[1], 0, 0, DImode); ! rtx low_dst = operand_subword (operands[0], 1, 1, DImode); ! rtx high_dst = operand_subword (operands[0], 0, 1, DImode); emit_insn (gen_clrt ()); --- 988,999 ---- " { ! int low_word = (TARGET_LITTLE_ENDIAN ? 0 : 1); ! int high_word = (TARGET_LITTLE_ENDIAN ? 1 : 0); ! ! rtx low_src = operand_subword (operands[1], low_word, 0, DImode); ! rtx high_src = operand_subword (operands[1], high_word, 0, DImode); ! rtx low_dst = operand_subword (operands[0], low_word, 1, DImode); ! rtx high_dst = operand_subword (operands[0], high_word, 1, DImode); emit_insn (gen_clrt ()); *************** *** 1155,1160 **** (define_insn "" ! [(set (match_operand:DI 0 "general_movdst_operand" "=r,r,r,m,r") ! (match_operand:DI 1 "general_movsrc_operand" "Q,r,m,r,i"))] "arith_reg_operand (operands[0], DImode) || arith_reg_operand (operands[1], DImode)" --- 1199,1204 ---- (define_insn "" ! [(set (match_operand:DI 0 "general_movdst_operand" "=r,r,r,m,r,r") ! (match_operand:DI 1 "general_movsrc_operand" "Q,r,m,r,i,x"))] "arith_reg_operand (operands[0], DImode) || arith_reg_operand (operands[1], DImode)" *************** *** 1161,1171 **** "* return output_movedouble (insn, operands, DImode);" [(set_attr "length" "4") ! (set_attr "type" "pcload,move,load,store,move")]) ! ! ;; If the output is a register and the input is memory, we have to be careful ! ;; and see which word needs to be loaded first. ! ;; ??? Why are Q constraint addresses rejected here but not in the DFmode ! ;; split pattern? (define_split --- 1205,1212 ---- "* return output_movedouble (insn, operands, DImode);" [(set_attr "length" "4") ! (set_attr "type" "pcload,move,load,store,move,move")]) ! ;; If the output is a register and the input is memory or a register, we have ! ;; to be careful and see which word needs to be loaded first. (define_split *************** *** 1172,1193 **** [(set (match_operand:DI 0 "general_movdst_operand" "") (match_operand:DI 1 "general_movsrc_operand" ""))] ! "! (GET_CODE (operands[0]) == REG ! && REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER) ! && ! (GET_CODE (operands[1]) == REG ! && REGNO (operands[1]) >= FIRST_PSEUDO_REGISTER) ! && ! (GET_CODE (operands[0]) == REG && GET_CODE (operands[1]) == REG ! && ! reload_completed ! && reg_overlap_mentioned_p (operands[0], operands[1])) ! && ! (GET_CODE (operands[0]) == MEM ! && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) ! && ! (GET_CODE (operands[1]) == MEM ! && GET_CODE (XEXP (operands[1], 0)) == POST_INC) ! && ! EXTRA_CONSTRAINT_Q (operands[1])" [(set (match_dup 2) (match_dup 3)) (set (match_dup 4) (match_dup 5))] " ! { if (GET_CODE (operands[0]) != REG ! || ! refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1, ! operands[1], 0)) { operands[2] = operand_subword (operands[0], 0, 0, DImode); --- 1213,1238 ---- [(set (match_operand:DI 0 "general_movdst_operand" "") (match_operand:DI 1 "general_movsrc_operand" ""))] ! "reload_completed" [(set (match_dup 2) (match_dup 3)) (set (match_dup 4) (match_dup 5))] " ! { ! int regno; ! ! if ((GET_CODE (operands[0]) == MEM ! && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) ! || (GET_CODE (operands[1]) == MEM ! && GET_CODE (XEXP (operands[1], 0)) == POST_INC)) ! FAIL; ! ! if (GET_CODE (operands[0]) == REG) ! regno = REGNO (operands[0]); ! else if (GET_CODE (operands[0]) == SUBREG) ! regno = REGNO (SUBREG_REG (operands[0])) + SUBREG_WORD (operands[0]); ! else if (GET_CODE (operands[0]) == MEM) ! regno = -1; ! ! if (regno == -1 ! || ! refers_to_regno_p (regno, regno + 1, operands[1], 0)) { operands[2] = operand_subword (operands[0], 0, 0, DImode); *************** *** 1226,1231 **** (set_attr "type" "move,load,store")]) ! ;; If the output is a register and the input is memory, we have to be careful ! ;; and see which word needs to be loaded first. (define_split --- 1271,1276 ---- (set_attr "type" "move,load,store")]) ! ;; If the output is a register and the input is memory or a register, we have ! ;; to be careful and see which word needs to be loaded first. (define_split *************** *** 1232,1252 **** [(set (match_operand:DF 0 "general_movdst_operand" "") (match_operand:DF 1 "general_movsrc_operand" ""))] ! "! (GET_CODE (operands[0]) == REG ! && REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER) ! && ! (GET_CODE (operands[1]) == REG ! && REGNO (operands[1]) >= FIRST_PSEUDO_REGISTER) ! && ! (GET_CODE (operands[0]) == REG && GET_CODE (operands[1]) == REG ! && ! reload_completed ! && reg_overlap_mentioned_p (operands[0], operands[1])) ! && ! (GET_CODE (operands[0]) == MEM ! && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) ! && ! (GET_CODE (operands[1]) == MEM ! && GET_CODE (XEXP (operands[1], 0)) == POST_INC)" [(set (match_dup 2) (match_dup 3)) (set (match_dup 4) (match_dup 5))] " ! { if (GET_CODE (operands[0]) != REG ! || ! refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1, ! operands[1], 0)) { operands[2] = operand_subword (operands[0], 0, 0, DFmode); --- 1277,1302 ---- [(set (match_operand:DF 0 "general_movdst_operand" "") (match_operand:DF 1 "general_movsrc_operand" ""))] ! "reload_completed" [(set (match_dup 2) (match_dup 3)) (set (match_dup 4) (match_dup 5))] " ! { ! int regno; ! ! if ((GET_CODE (operands[0]) == MEM ! && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) ! || (GET_CODE (operands[1]) == MEM ! && GET_CODE (XEXP (operands[1], 0)) == POST_INC)) ! FAIL; ! ! if (GET_CODE (operands[0]) == REG) ! regno = REGNO (operands[0]); ! else if (GET_CODE (operands[0]) == SUBREG) ! regno = REGNO (SUBREG_REG (operands[0])) + SUBREG_WORD (operands[0]); ! else if (GET_CODE (operands[0]) == MEM) ! regno = -1; ! ! if (regno == -1 ! || ! refers_to_regno_p (regno, regno + 1, operands[1], 0)) { operands[2] = operand_subword (operands[0], 0, 0, DFmode); *************** *** 1561,1565 **** (plus:SI (reg:SI 0) (mem:HI (plus:SI (reg:SI 0) ! (match_operand:SI 0 "arith_reg_operand" "=r"))))) (set (match_dup 0) (mem:HI (plus:SI (reg:SI 0) (match_dup 0))))] --- 1611,1615 ---- (plus:SI (reg:SI 0) (mem:HI (plus:SI (reg:SI 0) ! (match_operand:SI 0 "arith_reg_operand" "+r"))))) (set (match_dup 0) (mem:HI (plus:SI (reg:SI 0) (match_dup 0))))] *************** *** 1811,1812 **** --- 1861,1943 ---- "TARGET_SH2" "dt %0") + + ;; These convert sequences such as `mov #k,r0; add r15,r0; mov.l @r0,rn' + ;; to `mov #k,r0; mov.l @(r0,r15),rn'. These sequences are generated by + ;; reload when the constant is too large for a reg+offset address. + + ;; ??? We would get much better code if this was done in reload. This would + ;; require modifying find_reloads_address to recognize that if the constant + ;; is out-of-range for an immediate add, then we get better code by reloading + ;; the constant into a register than by reloading the sum into a register, + ;; since the former is one instruction shorter if the address does not need + ;; to be offsettable. Unfortunately this does not work, because there is + ;; only one register, r0, that can be used as an index register. This register + ;; is also the function return value register. So, if we try to force reload + ;; to use double-reg addresses, then we end up with some instructions that + ;; need to use r0 twice. The only way to fix this is to change the calling + ;; convention so that r0 is not used to return values. + + (define_peephole + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_dup 0) (match_operand:SI 1 "register_operand" "r"))) + (set (mem:SI (match_dup 0)) + (match_operand:SI 2 "general_movsrc_operand" ""))] + "REGNO (operands[0]) == 0 && reg_unused_after (operands[0], insn)" + "mov.l %2,@(%0,%1)") + + (define_peephole + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_dup 0) (match_operand:SI 1 "register_operand" "r"))) + (set (match_operand:SI 2 "general_movdst_operand" "") + (mem:SI (match_dup 0)))] + "REGNO (operands[0]) == 0 && reg_unused_after (operands[0], insn)" + "mov.l @(%0,%1),%2") + + (define_peephole + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_dup 0) (match_operand:SI 1 "register_operand" "r"))) + (set (mem:HI (match_dup 0)) + (match_operand:HI 2 "general_movsrc_operand" ""))] + "REGNO (operands[0]) == 0 && reg_unused_after (operands[0], insn)" + "mov.w %2,@(%0,%1)") + + (define_peephole + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_dup 0) (match_operand:SI 1 "register_operand" "r"))) + (set (match_operand:HI 2 "general_movdst_operand" "") + (mem:HI (match_dup 0)))] + "REGNO (operands[0]) == 0 && reg_unused_after (operands[0], insn)" + "mov.w @(%0,%1),%2") + + (define_peephole + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_dup 0) (match_operand:SI 1 "register_operand" "r"))) + (set (mem:QI (match_dup 0)) + (match_operand:QI 2 "general_movsrc_operand" ""))] + "REGNO (operands[0]) == 0 && reg_unused_after (operands[0], insn)" + "mov.b %2,@(%0,%1)") + + (define_peephole + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_dup 0) (match_operand:SI 1 "register_operand" "r"))) + (set (match_operand:QI 2 "general_movdst_operand" "") + (mem:QI (match_dup 0)))] + "REGNO (operands[0]) == 0 && reg_unused_after (operands[0], insn)" + "mov.b @(%0,%1),%2") + + (define_peephole + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_dup 0) (match_operand:SI 1 "register_operand" "r"))) + (set (mem:SF (match_dup 0)) + (match_operand:SF 2 "general_movsrc_operand" ""))] + "REGNO (operands[0]) == 0 && reg_unused_after (operands[0], insn)" + "mov.l %2,@(%0,%1)") + + (define_peephole + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_dup 0) (match_operand:SI 1 "register_operand" "r"))) + (set (match_operand:SF 2 "general_movdst_operand" "") + + (mem:SF (match_dup 0)))] + "REGNO (operands[0]) == 0 && reg_unused_after (operands[0], insn)" + "mov.l @(%0,%1),%2") diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sh/t-sh gcc-2.7.1/config/sh/t-sh *** gcc-2.7.0/config/sh/t-sh Thu Apr 27 21:02:52 1995 --- gcc-2.7.1/config/sh/t-sh Sun Nov 5 11:13:53 1995 *************** *** 22,27 **** cat $(srcdir)/config/fp-bit.c >> fp-bit.c ! MULTILIB_OPTIONS=ml ! MULTILIB_DIRNAMES=ml LIBGCC = stmp-multilib --- 22,28 ---- cat $(srcdir)/config/fp-bit.c >> fp-bit.c ! MULTILIB_OPTIONS = ml m2 ! MULTILIB_DIRNAMES = ml m2 ! MULTILIB_MATCHES = m2=m3 LIBGCC = stmp-multilib diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sparc/gmon-sol2.c gcc-2.7.1/config/sparc/gmon-sol2.c *** gcc-2.7.0/config/sparc/gmon-sol2.c Wed Jan 6 01:03:27 1993 --- gcc-2.7.1/config/sparc/gmon-sol2.c Sat Aug 19 17:36:42 1995 *************** *** 250,253 **** --- 250,256 ---- /* i7 == last ret, -> frompcindex */ /* o7 == current ret, -> selfpc */ + /* Solaris 2 libraries use _mcount. */ + asm(".global _mcount; _mcount: mov %i7,%o1; mov %o7,%o0;b,a internal_mcount"); + /* This is for compatibility with old versions of gcc which used mcount. */ asm(".global mcount; mcount: mov %i7,%o1; mov %o7,%o0;b,a internal_mcount"); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sparc/netbsd.h gcc-2.7.1/config/sparc/netbsd.h *** gcc-2.7.0/config/sparc/netbsd.h Tue May 9 18:23:43 1995 --- gcc-2.7.1/config/sparc/netbsd.h Thu Sep 28 14:00:59 1995 *************** *** 19,27 **** #undef WCHAR_TYPE ! #define WCHAR_TYPE "short unsigned int" ! #define WCHAR_UNSIGNED 1 #undef WCHAR_TYPE_SIZE ! #define WCHAR_TYPE_SIZE 16 /* This is BSD, so it wants DBX format. */ --- 19,29 ---- #undef WCHAR_TYPE ! #define WCHAR_TYPE "int" + #undef WCHAR_UNSIGNED + #define WCHAR_UNSIGNED 0 + #undef WCHAR_TYPE_SIZE ! #define WCHAR_TYPE_SIZE 32 /* This is BSD, so it wants DBX format. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sparc/sol2.h gcc-2.7.1/config/sparc/sol2.h *** gcc-2.7.0/config/sparc/sol2.h Thu Jun 15 16:33:27 1995 --- gcc-2.7.1/config/sparc/sol2.h Sat Aug 19 17:36:45 1995 *************** *** 1,4 **** /* Definitions of target machine for GNU compiler, for SPARC running Solaris 2 ! Copyright 1992 Free Software Foundation, Inc. Written by Ron Guilmette (rfg@netcom.com). --- 1,4 ---- /* Definitions of target machine for GNU compiler, for SPARC running Solaris 2 ! Copyright 1992, 1995 Free Software Foundation, Inc. Written by Ron Guilmette (rfg@netcom.com). *************** *** 103,109 **** #define STARTFILE_SPEC "%{!shared: \ %{!symbolic: \ ! %{pg:crt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} \ ! %{pg:gmon.o%s}}} \ ! %{pg:crti.o%s}%{!pg:crti.o%s} \ %{ansi:values-Xc.o%s} \ %{!ansi: \ --- 103,108 ---- #define STARTFILE_SPEC "%{!shared: \ %{!symbolic: \ ! %{p:mcrt1.o%s}%{!p:crt1.o%s} %{pg:gmon.o%s}}} \ ! crti.o%s \ %{ansi:values-Xc.o%s} \ %{!ansi: \ *************** *** 121,125 **** #undef ENDFILE_SPEC ! #define ENDFILE_SPEC "crtend.o%s %{pg:crtn.o%s}%{!pg:crtn.o%s}" /* This should be the same as in svr4.h, except with -R added. */ --- 120,124 ---- #undef ENDFILE_SPEC ! #define ENDFILE_SPEC "crtend.o%s crtn.o%s" /* This should be the same as in svr4.h, except with -R added. */ *************** *** 133,144 **** %{G:-G} \ %{YP,*} \ ! %{R*} %{!static:%{!R*:%{L*:-R %*}}} \ %{compat-bsd: \ %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ ! %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \ -R /usr/ucblib} \ %{!compat-bsd: \ %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ ! %{!p:-Y P,/usr/ccs/lib:/usr/lib}}} \ %{Qy:} %{!Qn:-Qy}" --- 132,145 ---- %{G:-G} \ %{YP,*} \ ! %{R*} \ %{compat-bsd: \ %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ ! %{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ ! %{!p:%{!pg:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \ -R /usr/ucblib} \ %{!compat-bsd: \ %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ ! %{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ ! %{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}} \ %{Qy:} %{!Qn:-Qy}" diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sparc/sparc.c gcc-2.7.1/config/sparc/sparc.c *** gcc-2.7.0/config/sparc/sparc.c Thu Jun 15 16:34:24 1995 --- gcc-2.7.1/config/sparc/sparc.c Tue Sep 12 18:32:24 1995 *************** *** 3960,3964 **** register unsigned shift = 6; ! /* Only the first 30 bits of the qualifer are valid. We must refrain from setting more, since some assemblers will give an error for this. Also, we must be careful to avoid shifts of 32 bits or more to avoid getting --- 3960,3964 ---- register unsigned shift = 6; ! /* Only the first 30 bits of the qualifier are valid. We must refrain from setting more, since some assemblers will give an error for this. Also, we must be careful to avoid shifts of 32 bits or more to avoid getting *************** *** 4081,4088 **** mechanism would be better here. ! Emit 3 FLUSH instructions to synchronize the data and instruction caches. - ??? v9: We assume the top 32 bits of function addresses are 0. */ - void sparc_initialize_trampoline (tramp, fnaddr, cxt) --- 4081,4086 ---- mechanism would be better here. ! Emit enough FLUSH insns to synchronize the data and instruction caches. */ void sparc_initialize_trampoline (tramp, fnaddr, cxt) *************** *** 4123,4126 **** --- 4121,4128 ---- } + /* The 64 bit version is simpler because it makes more sense to load the + values as "immediate" data out of the trampoline. It's also easier since + we can read the PC without clobbering a register. */ + void sparc64_initialize_trampoline (tramp, fnaddr, cxt) *************** *** 4127,4163 **** rtx tramp, fnaddr, cxt; { ! rtx fnaddrdi = gen_reg_rtx (Pmode); ! rtx fnaddrsi = (emit_move_insn (fnaddrdi, fnaddr), ! gen_rtx (SUBREG, SImode, fnaddrdi, 0)); ! rtx cxtdi = gen_reg_rtx (Pmode); ! rtx cxtsi = (emit_move_insn (cxtdi, cxt), ! gen_rtx (SUBREG, SImode, cxtdi, 0)); ! rtx high_cxt = expand_shift (RSHIFT_EXPR, SImode, cxtsi, ! size_int (10), 0, 1); ! rtx high_fn = expand_shift (RSHIFT_EXPR, SImode, fnaddrsi, ! size_int (10), 0, 1); ! rtx low_cxt = expand_and (cxtsi, gen_rtx (CONST_INT, VOIDmode, 0x3ff), 0); ! rtx low_fn = expand_and (fnaddrsi, gen_rtx (CONST_INT, VOIDmode, 0x3ff), 0); ! rtx g1_sethi = gen_rtx (HIGH, SImode, ! gen_rtx (CONST_INT, VOIDmode, 0x03000000)); ! rtx g2_sethi = gen_rtx (HIGH, SImode, ! gen_rtx (CONST_INT, VOIDmode, 0x05000000)); ! rtx g1_ori = gen_rtx (HIGH, SImode, ! gen_rtx (CONST_INT, VOIDmode, 0x82106000)); ! rtx g2_ori = gen_rtx (HIGH, SImode, ! gen_rtx (CONST_INT, VOIDmode, 0x8410A000)); ! rtx tem = gen_reg_rtx (SImode); ! emit_move_insn (tem, g2_sethi); ! emit_insn (gen_iorsi3 (high_fn, high_fn, tem)); ! emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 0)), high_fn); ! emit_move_insn (tem, g2_ori); ! emit_insn (gen_iorsi3 (low_fn, low_fn, tem)); ! emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 4)), low_fn); ! emit_move_insn (tem, g1_sethi); ! emit_insn (gen_iorsi3 (high_cxt, high_cxt, tem)); ! emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 8)), high_cxt); ! emit_move_insn (tem, g1_ori); ! emit_insn (gen_iorsi3 (low_cxt, low_cxt, tem)); ! emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 16)), low_cxt); emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode, tramp)))); emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode, --- 4129,4134 ---- rtx tramp, fnaddr, cxt; { ! emit_move_insn (gen_rtx (MEM, DImode, plus_constant (tramp, 24)), cxt); ! emit_move_insn (gen_rtx (MEM, DImode, plus_constant (tramp, 32)), fnaddr); emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode, tramp)))); emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode, *************** *** 4165,4168 **** --- 4136,4143 ---- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode, plus_constant (tramp, 16))))); + emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode, + plus_constant (tramp, 24))))); + emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode, + plus_constant (tramp, 32))))); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sparc/sparc.h gcc-2.7.1/config/sparc/sparc.h *** gcc-2.7.0/config/sparc/sparc.h Thu Jun 15 16:34:48 1995 --- gcc-2.7.1/config/sparc/sparc.h Sun Nov 5 11:10:26 1995 *************** *** 478,482 **** data_section (); \ } \ ! else if (*tree_code_type[(int) TREE_CODE (T)] == 'c') \ { \ if ((TREE_CODE (T) == STRING_CST && flag_writable_strings) \ --- 478,482 ---- data_section (); \ } \ ! else if (TREE_CODE_CLASS (TREE_CODE (T)) == 'c') \ { \ if ((TREE_CODE (T) == STRING_CST && flag_writable_strings) \ *************** *** 748,754 **** /* Register in which static-chain is passed to a function. This must ! not be a register used by the prologue. ! ??? v9: Since %g2 is reserved but %g5 is available, perhaps use %g5. */ ! #define STATIC_CHAIN_REGNUM 2 /* Register which holds offset table for position-independent --- 748,753 ---- /* Register in which static-chain is passed to a function. This must ! not be a register used by the prologue. */ ! #define STATIC_CHAIN_REGNUM (TARGET_V9 ? 5 : 2) /* Register which holds offset table for position-independent *************** *** 1618,1622 **** of a trampoline, leaving space for the variable parts. */ ! /* On the sparc, the trampoline contains five instructions: sethi #TOP_OF_FUNCTION,%g1 or #BOTTOM_OF_FUNCTION,%g1,%g1 --- 1617,1621 ---- of a trampoline, leaving space for the variable parts. */ ! /* On 32 bit sparcs, the trampoline contains five instructions: sethi #TOP_OF_FUNCTION,%g1 or #BOTTOM_OF_FUNCTION,%g1,%g1 *************** *** 1623,1639 **** sethi #TOP_OF_STATIC,%g2 jmp g1 ! or #BOTTOM_OF_STATIC,%g2,%g2 */ ! #define TRAMPOLINE_TEMPLATE(FILE) \ ! { \ ! ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \ ! ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \ ! ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \ ! ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x81C04000)); \ ! ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \ ! } /* Length in units of the trampoline for entering a nested function. */ ! #define TRAMPOLINE_SIZE 20 /* Emit RTL insns to initialize the variable parts of a trampoline. --- 1622,1664 ---- sethi #TOP_OF_STATIC,%g2 jmp g1 ! or #BOTTOM_OF_STATIC,%g2,%g2 ! ! On 64 bit sparcs, the trampoline contains 4 insns and two pseudo-immediate ! constants (plus some padding): ! rd %pc,%g1 ! ldx[%g1+20],%g5 ! ldx[%g1+28],%g1 ! jmp %g1 ! nop ! nop ! .xword context ! .xword function */ ! ! #define TRAMPOLINE_TEMPLATE(FILE) \ ! do { \ ! if (TARGET_V9) \ ! { \ ! fprintf (FILE, "\trd %%pc,%%g1\n"); \ ! fprintf (FILE, "\tldx [%%g1+24],%%g5\n"); \ ! fprintf (FILE, "\tldx [%%g1+32],%%g1\n"); \ ! fprintf (FILE, "\tjmp %%g1\n"); \ ! fprintf (FILE, "\tnop\n"); \ ! fprintf (FILE, "\tnop\n"); \ ! /* -mmedlow shouldn't generate .xwords, so don't use them at all */ \ ! fprintf (FILE, "\t.word 0,0,0,0\n"); \ ! } \ ! else \ ! { \ ! ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \ ! ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \ ! ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \ ! ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x81C04000)); \ ! ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \ ! } \ ! } while (0) /* Length in units of the trampoline for entering a nested function. */ ! #define TRAMPOLINE_SIZE (TARGET_V9 ? 40 : 20) /* Emit RTL insns to initialize the variable parts of a trampoline. *************** *** 1674,1677 **** --- 1699,1706 ---- #define RETURN_ADDR_IN_PREVIOUS_FRAME + /* This is the offset of the return address to the true next instruction to be + executed for normal void functions. */ + #define NORMAL_RETURN_ADDR_OFFSET (8) + /* The current return address is in %i7. The return address of anything farther back is in the register window save area at [%fp+60]. */ *************** *** 1681,1686 **** ((count == -1) \ ? gen_rtx (REG, Pmode, 31) \ ! : copy_to_reg (gen_rtx (MEM, Pmode, \ ! memory_address (Pmode, plus_constant (frame, 15 * UNITS_PER_WORD))))) /* Addressing modes, and classification of registers for them. */ --- 1710,1715 ---- ((count == -1) \ ? gen_rtx (REG, Pmode, 31) \ ! : gen_rtx (MEM, Pmode, \ ! memory_address (Pmode, plus_constant (frame, 15 * UNITS_PER_WORD)))) /* Addressing modes, and classification of registers for them. */ *************** *** 2194,2198 **** #define RTX_COSTS(X,CODE,OUTER_CODE) \ case MULT: \ ! return (TARGET_V8 || TARGET_V9) ? COSTS_N_INSNS (5) : COSTS_N_INSNS (25); \ case DIV: \ case UDIV: \ --- 2223,2227 ---- #define RTX_COSTS(X,CODE,OUTER_CODE) \ case MULT: \ ! return (TARGET_V8 || TARGET_SPARCLITE || TARGET_V9) ? COSTS_N_INSNS (5) : COSTS_N_INSNS (25); \ case DIV: \ case UDIV: \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sparc/sparc.md gcc-2.7.1/config/sparc/sparc.md *** gcc-2.7.0/config/sparc/sparc.md Thu Jun 15 16:57:52 1995 --- gcc-2.7.1/config/sparc/sparc.md Tue Sep 12 18:57:35 1995 *************** *** 1579,1582 **** --- 1579,1584 ---- output_asm_insn (\"sethi %%hi(%a1),%%g1; or %0,%%g1,%0\", operands); } + + return \"\"; }" [(set_attr "type" "move") *************** *** 4871,4878 **** ;;- Do not use operand 1 for most machines. "! TARGET_PTR64" ! "* ! { ! return \"call %a0,%1%#\"; ! }" [(set_attr "type" "call")]) --- 4873,4877 ---- ;;- Do not use operand 1 for most machines. "! TARGET_PTR64" ! "call %a0,%1%#" [(set_attr "type" "call")]) *************** *** 4883,4890 **** ;;- Do not use operand 1 for most machines. "! TARGET_PTR64" ! "* ! { ! return \"call %a0,%1%#\"; ! }" [(set_attr "type" "call")]) --- 4882,4886 ---- ;;- Do not use operand 1 for most machines. "! TARGET_PTR64" ! "call %a0,%1%#" [(set_attr "type" "call")]) *************** *** 4895,4902 **** ;;- Do not use operand 1 for most machines. "TARGET_PTR64" ! "* ! { ! return \"call %a0,%1%#\"; ! }" [(set_attr "type" "call")]) --- 4891,4895 ---- ;;- Do not use operand 1 for most machines. "TARGET_PTR64" ! "call %a0,%1%#" [(set_attr "type" "call")]) *************** *** 4907,4914 **** ;;- Do not use operand 1 for most machines. "TARGET_PTR64" ! "* ! { ! return \"call %a0,%1%#\"; ! }" [(set_attr "type" "call")]) --- 4900,4904 ---- ;;- Do not use operand 1 for most machines. "TARGET_PTR64" ! "call %a0,%1%#" [(set_attr "type" "call")]) *************** *** 4922,4929 **** ;;- Do not use operand 1 for most machines. "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0" ! "* ! { ! return \"call %a0,%1\;nop\;unimp %2\"; ! }" [(set_attr "type" "call_no_delay_slot")]) --- 4912,4916 ---- ;;- Do not use operand 1 for most machines. "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0" ! "call %a0,%1\;nop\;unimp %2" [(set_attr "type" "call_no_delay_slot")]) *************** *** 4937,4944 **** ;;- Do not use operand 1 for most machines. "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0" ! "* ! { ! return \"call %a0,%1\;nop\;unimp %2\"; ! }" [(set_attr "type" "call_no_delay_slot")]) --- 4924,4928 ---- ;;- Do not use operand 1 for most machines. "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0" ! "call %a0,%1\;nop\;unimp %2" [(set_attr "type" "call_no_delay_slot")]) *************** *** 4952,4959 **** ;;- Do not use operand 1 for most machines. "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0" ! "* ! { ! return \"call %a0,%1\;nop\;nop\"; ! }" [(set_attr "type" "call_no_delay_slot")]) --- 4936,4940 ---- ;;- Do not use operand 1 for most machines. "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0" ! "call %a0,%1\;nop\;nop" [(set_attr "type" "call_no_delay_slot")]) *************** *** 4966,4973 **** ;;- Do not use operand 1 for most machines. "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0" ! "* ! { ! return \"call %a0,%1\;nop\;nop\"; ! }" [(set_attr "type" "call_no_delay_slot")]) --- 4947,4951 ---- ;;- Do not use operand 1 for most machines. "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0" ! "call %a0,%1\;nop\;nop" [(set_attr "type" "call_no_delay_slot")]) *************** *** 5017,5024 **** ;;- Do not use operand 2 for most machines. "! TARGET_PTR64" ! "* ! { ! return \"call %a1,%2%#\"; ! }" [(set_attr "type" "call")]) --- 4995,4999 ---- ;;- Do not use operand 2 for most machines. "! TARGET_PTR64" ! "call %a1,%2%#" [(set_attr "type" "call")]) *************** *** 5030,5037 **** ;;- Do not use operand 2 for most machines. "! TARGET_PTR64" ! "* ! { ! return \"call %a1,%2%#\"; ! }" [(set_attr "type" "call")]) --- 5005,5009 ---- ;;- Do not use operand 2 for most machines. "! TARGET_PTR64" ! "call %a1,%2%#" [(set_attr "type" "call")]) *************** *** 5043,5050 **** ;;- Do not use operand 2 for most machines. "TARGET_PTR64" ! "* ! { ! return \"call %a1,%2%#\"; ! }" [(set_attr "type" "call")]) --- 5015,5019 ---- ;;- Do not use operand 2 for most machines. "TARGET_PTR64" ! "call %a1,%2%#" [(set_attr "type" "call")]) *************** *** 5056,5063 **** ;;- Do not use operand 2 for most machines. "TARGET_PTR64" ! "* ! { ! return \"call %a1,%2%#\"; ! }" [(set_attr "type" "call")]) --- 5025,5029 ---- ;;- Do not use operand 2 for most machines. "TARGET_PTR64" ! "call %a1,%2%#" [(set_attr "type" "call")]) *************** *** 5792,5799 **** (set (pc) (label_ref (match_operand 3 "" "")))] "short_branch (INSN_UID (insn), INSN_UID (operands[3]))" ! "* ! { ! return \"call %a1,%2\;add %%o7,(%l3-.-4),%%o7\"; ! }") (define_peephole --- 5758,5762 ---- (set (pc) (label_ref (match_operand 3 "" "")))] "short_branch (INSN_UID (insn), INSN_UID (operands[3]))" ! "call %a1,%2\;add %%o7,(%l3-.-4),%%o7") (define_peephole *************** *** 5815,5822 **** (set (pc) (label_ref (match_operand 3 "" "")))] "TARGET_V9 && short_branch (INSN_UID (insn), INSN_UID (operands[3]))" ! "* ! { ! return \"call %a1,%2\;add %%o7,(%l3-.-4),%%o7\"; ! }") (define_peephole --- 5778,5782 ---- (set (pc) (label_ref (match_operand 3 "" "")))] "TARGET_V9 && short_branch (INSN_UID (insn), INSN_UID (operands[3]))" ! "call %a1,%2\;add %%o7,(%l3-.-4),%%o7") (define_peephole *************** *** 5826,5833 **** (set (pc) (label_ref (match_operand 2 "" "")))] "TARGET_V9 && short_branch (INSN_UID (insn), INSN_UID (operands[2]))" ! "* ! { ! return \"call %a0,%1\;add %%o7,(%l2-.-4),%%o7\"; ! }") ;; Other miscellaneous peepholes. --- 5786,5790 ---- (set (pc) (label_ref (match_operand 2 "" "")))] "TARGET_V9 && short_branch (INSN_UID (insn), INSN_UID (operands[2]))" ! "call %a0,%1\;add %%o7,(%l2-.-4),%%o7") ;; Other miscellaneous peepholes. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sparc/t-sparclite gcc-2.7.1/config/sparc/t-sparclite *** gcc-2.7.0/config/sparc/t-sparclite Thu Jan 12 13:35:47 1995 --- gcc-2.7.1/config/sparc/t-sparclite Mon Aug 21 13:21:15 1995 *************** *** 16,17 **** --- 16,24 ---- echo '#define US_SOFTWARE_GOFAST' >> fp-bit.c cat $(srcdir)/config/fp-bit.c >> fp-bit.c + + MULTILIB_OPTIONS=mfpu/msoft-float mflat/mno-flat + MULTILIB_DIRNAMES= + MULTILIB_MATCHES= mfpu=mhard-float mno-fpu=msoft-float + + LIBGCC = stmp-multilib + INSTALL_LIBGCC = install-multilib diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/sparc/t-vxsparc gcc-2.7.1/config/sparc/t-vxsparc *** gcc-2.7.0/config/sparc/t-vxsparc Thu Jan 12 13:26:24 1995 --- gcc-2.7.1/config/sparc/t-vxsparc Thu Oct 26 17:53:46 1995 *************** *** 2,5 **** --- 2,9 ---- CROSS_LIBGCC1 = + # We don't want to build .umul, etc., because VxWorks provides them, + # which means that libgcc1-test will fail. + LIBGCC1_TEST = + # We don't want to put exit in libgcc.a for VxWorks, because VxWorks # does not have _exit. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/svr3.h gcc-2.7.1/config/svr3.h *** gcc-2.7.0/config/svr3.h Thu Jun 15 08:52:42 1995 --- gcc-2.7.1/config/svr3.h Thu Jun 22 18:08:05 1995 *************** *** 152,156 **** /* Assembler pseudos to introduce constants of various size. These ! definitions hsould work for most svr3 systems. */ #undef ASM_BYTE_OP --- 152,156 ---- /* Assembler pseudos to introduce constants of various size. These ! definitions should work for most svr3 systems. */ #undef ASM_BYTE_OP diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/svr4.h gcc-2.7.1/config/svr4.h *** gcc-2.7.0/config/svr4.h Thu Jun 15 08:53:07 1995 --- gcc-2.7.1/config/svr4.h Sat Nov 4 10:35:33 1995 *************** *** 274,281 **** /* When using stabs, gcc2_compiled must be a stabs entry, not an ! ordinary symbol, or gdb won't see it. Furthermore, since gdb reads ! the input piecemeal, starting with each N_SO, it's a lot easier if ! the gcc2 flag symbol is *after* the N_SO rather than before it. So ! we emit an N_OPT stab there. */ #define ASM_IDENTIFY_GCC(FILE) \ --- 274,279 ---- /* When using stabs, gcc2_compiled must be a stabs entry, not an ! ordinary symbol, or gdb won't see it. The stabs entry must be ! before the N_SO in order for gdb to find it. */ #define ASM_IDENTIFY_GCC(FILE) \ *************** *** 284,294 **** if (write_symbols != DBX_DEBUG) \ fputs ("gcc2_compiled.:\n", FILE); \ ! } \ ! while (0) ! ! #define ASM_IDENTIFY_GCC_AFTER_SOURCE(FILE) \ ! do \ ! { \ ! if (write_symbols == DBX_DEBUG) \ fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE); \ } \ --- 282,286 ---- if (write_symbols != DBX_DEBUG) \ fputs ("gcc2_compiled.:\n", FILE); \ ! else \ fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE); \ } \ *************** *** 580,585 **** #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \ ! TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \ ! TREE_READONLY (DECL) ? "a" : "aw") --- 572,577 ---- #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \ ! (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \ ! (DECL) && TREE_READONLY (DECL) ? "a" : "aw") diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/vax/netbsd.h gcc-2.7.1/config/vax/netbsd.h *** gcc-2.7.0/config/vax/netbsd.h Tue May 9 18:25:04 1995 --- gcc-2.7.1/config/vax/netbsd.h Thu Sep 28 14:01:02 1995 *************** *** 4,5 **** --- 4,22 ---- #undef CPP_PREDEFINES #define CPP_PREDEFINES "-Dunix -Dvax -D__NetBSD__ -Asystem(unix) -Asystem(NetBSD) -Acpu(vax) -Amachine(vax)" + + /* Make gcc agree with */ + + #undef SIZE_TYPE + #define SIZE_TYPE "unsigned int" + + #undef PTRDIFF_TYPE + #define PTRDIFF_TYPE "int" + + #undef WCHAR_TYPE + #define WCHAR_TYPE "int" + + #undef WCHAR_UNSIGNED + #define WCHAR_UNSIGNED 0 + + #undef WCHAR_TYPE_SIZE + #define WCHAR_TYPE_SIZE 32 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/vax/vax.c gcc-2.7.1/config/vax/vax.c *** gcc-2.7.0/config/vax/vax.c Thu Jun 15 16:39:24 1995 --- gcc-2.7.1/config/vax/vax.c Mon Aug 14 09:08:39 1995 *************** *** 1,4 **** /* Subroutines for insn-output.c for Vax. ! Copyright (C) 1987, 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Subroutines for insn-output.c for Vax. ! Copyright (C) 1987, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 686,692 **** return; ! /* Was pending, but may now be defined; move it to other list. */ if (p == pending_head) ! pending_head = 0; else p0->next = p->next; --- 686,692 ---- return; ! /* Was pending, but has now been defined; move it to other list. */ if (p == pending_head) ! pending_head = p->next; else p0->next = p->next; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/vax/vax.h gcc-2.7.1/config/vax/vax.h *** gcc-2.7.0/config/vax/vax.h Thu Jun 15 16:39:37 1995 --- gcc-2.7.1/config/vax/vax.h Sun Oct 29 07:42:25 1995 *************** *** 552,555 **** --- 552,569 ---- plus_constant (FNADDR, 2)); \ } + + /* Byte offset of return address in a stack frame. The "saved PC" field + is in element [4] when treating the frame as an array of longwords. */ + + #define RETURN_ADDRESS_OFFSET (4 * UNITS_PER_WORD) /* 16 */ + + /* A C expression whose value is RTL representing the value of the return + address for the frame COUNT steps up from the current frame. + FRAMEADDR is already the frame pointer of the COUNT frame, so we + can ignore COUNT. */ + + #define RETURN_ADDR_RTX(COUNT, FRAME) \ + gen_rtx (MEM, Pmode, plus_constant (FRAME, RETURN_ADDRESS_OFFSET)) + /* Addressing modes, and classification of registers for them. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/vax/vms.h gcc-2.7.1/config/vax/vms.h *** gcc-2.7.0/config/vax/vms.h Thu Jun 15 16:40:04 1995 --- gcc-2.7.1/config/vax/vms.h Mon Jul 17 14:37:01 1995 *************** *** 1,4 **** /* Output variables, constants and external declarations, for GNU compiler. ! Copyright (C) 1988, 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Output variables, constants and external declarations, for GNU compiler. ! Copyright (C) 1988, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 318,321 **** --- 318,324 ---- } + /* True for VMS V4.6 and later. */ + #define HAVE_ATEXIT + /* The following definitions are used in libgcc2.c with the __main function. The _SHR symbol is used when the sharable image library *************** *** 336,350 **** do { \ func_ptr *p; \ ! extern func_ptr __CTOR_LIST__[1]; \ ! extern func_ptr __CTOR_LIST_END__[1]; \ ! extern func_ptr __CTOR_LIST_SHR__[1]; \ ! extern func_ptr __CTOR_LIST_SHR_END__[1]; \ ! if( &__CTOR_LIST_SHR__[0] != &__CTOR_LIST__[1]) \ ! for (p = __CTOR_LIST_SHR__ + 1; p < __CTOR_LIST_SHR_END__ ; p++ ) \ ! if (*p) (*p) (); \ for (p = __CTOR_LIST__ + 1; p < __CTOR_LIST_END__ ; p++ ) \ if (*p) (*p) (); \ ! atexit (__do_global_dtors); \ ! { \ __label__ foo; \ int *callers_caller_fp = (int *) __builtin_frame_address (3); \ --- 339,350 ---- do { \ func_ptr *p; \ ! extern func_ptr __CTOR_LIST__[1], __CTOR_LIST_END__[1]; \ ! extern func_ptr __CTOR_LIST_SHR__[1], __CTOR_LIST_SHR_END__[1]; \ ! if (&__CTOR_LIST_SHR__[0] != &__CTOR_LIST__[1]) \ ! for (p = __CTOR_LIST_SHR__ + 1; p < __CTOR_LIST_SHR_END__ ; p++ ) \ ! if (*p) (*p) (); \ for (p = __CTOR_LIST__ + 1; p < __CTOR_LIST_END__ ; p++ ) \ if (*p) (*p) (); \ ! do { /* arrange for `return' from main() to pass through exit() */ \ __label__ foo; \ int *callers_caller_fp = (int *) __builtin_frame_address (3); \ *************** *** 351,358 **** register int retval asm ("r0"); \ callers_caller_fp[4] = (int) && foo; \ ! return; \ foo: \ exit (retval); \ ! } \ } while (0) --- 351,358 ---- register int retval asm ("r0"); \ callers_caller_fp[4] = (int) && foo; \ ! break; /* out of do-while block */ \ foo: \ exit (retval); \ ! } while (0); \ } while (0) *************** *** 366,378 **** do { \ func_ptr *p; \ ! extern func_ptr __DTOR_LIST__[1]; \ ! extern func_ptr __DTOR_LIST_END__[1]; \ ! extern func_ptr __DTOR_LIST_SHR__[1]; \ ! extern func_ptr __DTOR_LIST_SHR_END__[1]; \ for (p = __DTOR_LIST__ + 1; p < __DTOR_LIST_END__ ; p++ ) \ if (*p) (*p) (); \ ! if( &__DTOR_LIST_SHR__[0] != &__DTOR_LIST__[1]) \ ! for (p = __DTOR_LIST_SHR__ + 1; p < __DTOR_LIST_SHR_END__ ; p++ ) \ ! if (*p) (*p) (); \ } while (0) --- 366,376 ---- do { \ func_ptr *p; \ ! extern func_ptr __DTOR_LIST__[1], __DTOR_LIST_END__[1]; \ ! extern func_ptr __DTOR_LIST_SHR__[1], __DTOR_LIST_SHR_END__[1]; \ for (p = __DTOR_LIST__ + 1; p < __DTOR_LIST_END__ ; p++ ) \ if (*p) (*p) (); \ ! if (&__DTOR_LIST_SHR__[0] != &__DTOR_LIST__[1]) \ ! for (p = __DTOR_LIST_SHR__ + 1; p < __DTOR_LIST_SHR_END__ ; p++ ) \ ! if (*p) (*p) (); \ } while (0) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/vax/xm-vms.h gcc-2.7.1/config/vax/xm-vms.h *** gcc-2.7.0/config/vax/xm-vms.h Thu Jun 15 16:40:24 1995 --- gcc-2.7.1/config/vax/xm-vms.h Mon Jul 17 14:36:44 1995 *************** *** 124,127 **** --- 124,131 ---- #define FILE_NAME_JOINER "" + + /* vprintf() has been available since VMS V4.6. */ + + #define HAVE_VPRINTF #ifdef VAXC diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/winnt/config-nt.bat gcc-2.7.1/config/winnt/config-nt.bat *** gcc-2.7.0/config/winnt/config-nt.bat --- gcc-2.7.1/config/winnt/config-nt.bat Tue Sep 19 19:20:53 1995 *************** *** 0 **** --- 1,51 ---- + echo Configuring GCC for Windows NT on %2 + rem This batch file assumes a unix-type "sed" program + + echo #include "%2/xm-winnt.h" >config.h + echo #include "%2/xm-winnt.h" >hconfig.h + echo #include "%2/xm-winnt.h" >tconfig.h + echo #include "%2/win-nt.h" >tm.h + + rem This batch file assumes a unix-type "sed" program + + echo # Makefile generated by "config-nt.bat"> Makefile + echo all.nt: cpp.exe cc1.exe cc1obj.exe xgcc.exe ld.exe stmp-headers libgcc.lib stmp-float_h specs stamp-objlist>> Makefile + sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed Makefile.in >> Makefile + + set LANG= + + echo # >specs.h + echo # >options.h + + if not exist cp\make-lang.in goto no_cp + if exist cp\lang-specs.h echo #include "cp/lang-specs.h">>specs.h + if exist cp\lang-options.h echo #include "cp/lang-options.h">>options.h + sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed cp\make-lang.in >> Makefile + sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed cp\makefile.in > cp\Makefile + set LANG=%LANG% c++.# + :no_cp + + if not exist ada\make-lang.in goto no_ada + if exist ada\lang-specs.h echo #include "ada/lang-specs.h">>specs.h + if exist ada\lang-options.h echo #include "ada/lang-options.h">>options.h + sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed ada\make-lang.in >> Makefile + sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed ada\makefile.in > ada\Makefile + set LANG=%LANG% ada.# + :no_ada + + if not exist f\make-lang.in goto no_f + if exist f\lang-specs.h echo #include "f/lang-specs.h">>specs.h + if exist f\lang-options.h echo #include "f/lang-options.h">>options.h + sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed f\make-lang.in >> Makefile + sed -f config/%2/config-nt.sed -f config/winnt/config-nt.sed f\makefile.in > f\Makefile + set LANG=%LANG% f.# + :no_f + + echo lang.mostlyclean: %LANG% | sed "s/#/mostlyclean/g" >> Makefile + echo lang.clean: %LANG% | sed "s/#/clean/g" >> Makefile + echo lang.distclean: %LANG% | sed "s/#/distclean/g" >> Makefile + echo lang.realclean: %LANG% | sed "s/#/realclean/g" >> Makefile + + echo #define MULTILIB_SELECT ". ;" > multilib.h1 + copy multilib.h1 multilib.h + del multilib.h1 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/winnt/config-nt.sed gcc-2.7.1/config/winnt/config-nt.sed *** gcc-2.7.0/config/winnt/config-nt.sed --- gcc-2.7.1/config/winnt/config-nt.sed Tue Sep 12 17:15:17 1995 *************** *** 0 **** --- 1,130 ---- + /^Makefile/,/^ rm -f config.run/d + s/rm -f/del/ + s/|| cp/|| copy/ + /^config.status/,/ fi/d + s/config.status//g + s/\/dev\/null/NUL/g + s/$(srcdir)\/c-parse/c-parse/g + s/$(srcdir)\/objc-parse.y/objc-parse.y/g + s/$(srcdir)\/c-gperf/c-gperf/g + /^multilib.h/ s/multilib/not-multilib/ + /^xmake_file=/ d + /^tmake_file=/ d + /^lang_specs_files=/ d + /^lang_options_files=/ d + /^version=/ c\ + version=2.7.0 + s/CC = cc/CC = cl/ + s/^SHELL =.*/SHELL =/ + s/CFLAGS = -g/CFLAGS =/ + s/:\$/: \$/g + s/<\ *\$(srcdir)\//< $(srcdir)\\/g + s/^ \$(srcdir)\/move-if-change/ copy/ + s/^USE_/# USE_/ + s/`echo \$(srcdir)\///g + s/ | sed 's,\^\\\.\/,,'`//g + s/^ cd \$(srcdir)[ ]*;/ / + /^stamp-attrtab/,/copy/ { + /\\$/d + / fi/d + /copy/ i\ + \ genattrtab $(md_file) > tmp-attrtab.c + } + /^enquire[ ]*:/ s/\$(GCC_PARTS)//g + /^enquire.o[ ]*:/ s/\$(GCC_PASSES)//g + /^GCC_FOR_TARGET =/ c\ + GCC_FOR_TARGET = xgcc + /^ENQUIRE_LDFLAGS =/ c\ + ENQUIRE_LDFLAGS = + s/; *@true// + /> *stamp-objlist/ c\ + echo.exe $(OBJS) $(BC_OBJS) | sed -e "s, \([a-z]\), ../\1,g" >stamp-objlist + /^OBJS.*stamp-objlist/ s?`cat ../stamp-objlist`?@../stamp-objlist? + s/^\(SUBDIR_OBSTACK *=\).*$/\1 ..\/obstack.o/ + s/^\(SUBDIR_USE_ALLOCA *=\).*$/\1/ + s/^\(SUBDIR_MALLOC *=\).*$/\1/ + /####target/ i\ + STMP_FIXPROTO = \ + OTHER_FIXINCLUDES_DIRS=. \ + RANLIB = : \ + RANLIB_TEST = false \ + OLDCC = cl \ + MAKE = nmake \ + SYMLINK = copy \ + INSTALL = $(srcdir)/install.sh -c \ + exeext = .exe \ + objext = .obj \ + oldobjext = .obj \ + \ + EXTRA_PROGRAMS=ld.exe \ + \ + ld.obj: $(srcdir)/config/winnt/ld.c \ + \ $(CC) $(CFLAGS) \\\ + \ -I. -I$(srcdir) -I$(srcdir)/config -c $(srcdir)/config/winnt/ld.c \ + \ + ld.exe: ld.obj \ + link -out:ld.exe ld.obj $(LDFLAGS) $(CLIB) \ + \ + EXTRA_GCC_OBJS=spawnv.obj oldnames.obj \ + spawnv.obj: $(srcdir)/config/winnt/spawnv.c \ + \ $(CC) $(CFLAGS) \\\ + \ -I. -I$(srcdir) -I$(srcdir)/config -c $(srcdir)/config/winnt/spawnv.c \ + \ + oldnames.obj: $(srcdir)/config/winnt/oldnames.c \ + \ $(CC) $(CFLAGS) \\\ + \ -I. -I$(srcdir) -I$(srcdir)/config -c $(srcdir)/config/winnt/oldnames.c + s/^C c:/Cc:/ + s/\${OBJS}/\$(OBJS)/g + s/\${SYSTEM_HEADER_DIR}/\$(SYSTEM_HEADER_DIR)/g + s/\${HOST_CC}/\$(HOST_CC)/g + s/ \${srcdir}\// /g + s/\${mainversion}/\$(mainversion)/g + s/\ $(srcdir)\/move-if-change$// + s/\$(srcdir)\/move-if-change/copy/g + /^# USE_HOST_OBSTACK/ i\ + USE_HOST_OBSTACK=obstack.obj + /^# USE_ALLOCA/ i\ + USE_ALLOCA=alloca.obj + /^# USE_HOST_ALLOCA/ i\ + USE_HOST_ALLOCA=alloca.obj + s/^ALLOCA =/ALLOCA = alloca.obj/ + s/^ALLOCA_FINISH = true/ALLOCA_FINISH =/ + s/ \.\// / + s/^bi-\([a-z]*\) *:/bi-\1.exe :/ + s/ bi-\([a-z]*\)$/ bi-\1.exe/ + s/ bi-\([a-z]*\) / bi-\1.exe /g + s/^gen\([a-z]*\) *:/gen\1.exe :/ + s/ gen\([a-z]*\)$/ gen\1.exe/ + s/ gen\([a-z]*\) / gen\1.exe /g + s/genmultilib.exe/genmultilib/g + s/^cccp *:/cccp.exe :/ + s/cccp$/cccp.exe/ + s/cccp /cccp.exe / + s/CCCP=cccp.exe/CCCP=cccp/ + s/(CCCP)$/(CCCP)$(exeext)/ + s/^cpp *:/cpp.exe :/ + s/cpp$/cpp.exe/ + s/cpp /cpp.exe / + s/^cc1 *:/cc1.exe :/ + s/cc1$/cc1.exe/ + s/cc1 /cc1.exe / + s/^cc1obj *:/cc1obj.exe :/ + s/cc1obj$/cc1obj.exe/ + s/cc1obj /cc1obj.exe / + s/^xgcc *:/xgcc.exe :/ + s/xgcc$/xgcc.exe/ + s/xgcc /xgcc.exe / + s/^enquire *:/enquire.exe :/ + s/enquire$/enquire.exe/ + s/enquire /enquire.exe / + s/\.o *:/.obj :/ + s/\.o$/.obj/ + s/\.o /.obj /g + s/-rm -f cpp.exe/del cpp.exe/ + s/\$(CC) \$(ALL_CFLAGS) \$(LDFLAGS) -o /link $(LDFLAGS) -out:/ + s/\$(HOST_CC) \$(HOST_CFLAGS) \$(HOST_LDFLAGS) -o /link $(HOST_LDFLAGS) -out:/ + /^# Build libgcc.a/ r config/winnt/libgcc.mak + /^# Build libgcc.a/,/ / d + /^# Build the include directory\./ r config/winnt/headers.mak + /^# Build the include directory\./,/touch objc-headers/ d + s/^\ // diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/winnt/dirent.c gcc-2.7.1/config/winnt/dirent.c *** gcc-2.7.0/config/winnt/dirent.c --- gcc-2.7.1/config/winnt/dirent.c Tue Sep 12 17:15:18 1995 *************** *** 0 **** --- 1,360 ---- + /* + * @(#)msd_dir.c 1.4 87/11/06 Public Domain. + * + * A public domain implementation of BSD directory routines for + * MS-DOS. Written by Michael Rendell ({uunet,utai}michael@garfield), + * August 1897 + * + * Modified by Ian Stewartson, Data Logic (istewart@datlog.co.uk). + * + * Updates: 1. To support OS/2 1.x + * 2. To support HPFS long filenames + * 3. To support OS/2 2.x + * 4. To support TurboC + * 5. To support Windows NT + */ + + #include + #include + #include + #include + + #include + + #include + #include + #include + #include + #include + + + #define WIN32_LEAN_AND_MEAN + #include + + #define FILE_NAME_E cFileName + #define OS_CloseFH(a) FindClose (a) + #define FIND_BUFFER WIN32_FIND_DATA + #define DISABLE_HARD_ERRORS SetErrorMode (0) + #define ENABLE_HARD_ERRORS SetErrorMode (SEM_FAILCRITICALERRORS | \ + SEM_NOOPENFILEERRORBOX); + + # define ERROR_EMPTY_DIR ERROR_FILE_NOT_FOUND + + # define ATTRIBUTES (_A_SUBDIR | _A_HIDDEN | _A_SYSTEM | \ + _A_NORMAL | _A_RDONLY | _A_ARCH) + + /* + * missing ?? + */ + + #ifndef ENOTDIR + # define ENOTDIR 120 /* Not a directory */ + #endif + + #ifndef S_IFMT + # define S_IFMT 0xf000 /* type of file */ + #endif + + #ifndef S_ISDIR + # define S_ISDIR(m) ((((m) & S_IFMT) == S_IFDIR)) + #endif + + /* + * Internals + */ + + typedef struct _dircontents DIRCONT; + static void free_dircontents (DIRCONT *); + + /* + * Open the directory stream + */ + + DIR * + opendir (name) + const char *name; + { + struct stat statb; + DIR *dirp; + char *last; + DIRCONT *dp; + char *nbuf; + int len = strlen (name); + unsigned long rc; + FIND_BUFFER dtabuf; + HANDLE d_handle; + bool HPFS = FALSE; + + if (!len) + { + errno = ENOTDIR; + return (DIR *)NULL; + } + + if ((nbuf = malloc (len + 5)) == (char *)NULL) + return (DIR *) NULL; + + strcpy (nbuf, name); + last = &nbuf[len - 1]; + + /* Ok, DOS is very picky about its directory names. The following are + * valid. + * + * c:/ + * c:. + * c:name/name1 + * + * c:name/ is not valid + */ + + if (((*last == '\\') || (*last == '/')) && (len > 1) && + (!((len == 3) && (name[1] == ':')))) + *(last--) = 0; + + /* Check its a directory */ + + DISABLE_HARD_ERRORS; + rc = stat (nbuf, &statb); + ENABLE_HARD_ERRORS; + + if (rc) + { + free (nbuf); + return (DIR *) NULL; + } + + if (!S_ISDIR (statb.st_mode)) + { + free (nbuf); + errno = ENOTDIR; + return (DIR *)NULL; + } + + if ((dirp = (DIR *) malloc (sizeof (DIR))) == (DIR *) NULL) + { + free (nbuf); + return (DIR *) NULL; + } + + /* Set up to find everything */ + + if ((*last != '\\') && (*last != '/')) + strcat (last, "/"); + + strcat (last, "*.*"); + + /* Find the file system type */ + + HPFS = IsHPFSFileSystem (nbuf); + + dirp->dd_loc = 0; + dirp->dd_cp = (DIRCONT *) NULL; + dirp->dd_contents = (DIRCONT *) NULL; + + DISABLE_HARD_ERRORS; + + d_handle = FindFirstFile (nbuf, &dtabuf); + rc = (d_handle == INVALID_HANDLE_VALUE) ? GetLastError () : 0; + + ENABLE_HARD_ERRORS; + + /* Check for errors */ + + if (rc) + { + free (nbuf); + + /* Empty directory */ + + #if defined (ERROR_EMPTY_DIR) + if (rc == ERROR_EMPTY_DIR) + return dirp; + #endif + + free (dirp); + return (DIR *) NULL; + } + + /* Process the directory */ + + do + { + if (((dp = (DIRCONT *) malloc (sizeof (DIRCONT))) == (DIRCONT *)NULL) || + ((dp->_d_entry = strdup (dtabuf.FILE_NAME_E)) == (char *) NULL)) + { + if (dp->_d_entry != (char *)NULL) + free ((char *)dp); + + free (nbuf); + free_dircontents (dirp->dd_contents); + + OS_CloseFH (d_handle); + return (DIR *) NULL; + } + + if (!HPFS) + strlwr (dp->_d_entry); + + if (dirp->dd_contents != (DIRCONT *) NULL) + dirp->dd_cp = dirp->dd_cp->_d_next = dp; + + else + dirp->dd_contents = dirp->dd_cp = dp; + + dp->_d_next = (DIRCONT *) NULL; + + } while (FindNextFile (d_handle, &dtabuf)); + + dirp->dd_cp = dirp->dd_contents; + free (nbuf); + + OS_CloseFH (d_handle); + return dirp; + } + + + /* + * Close the directory stream + */ + + int + closedir (dirp) + DIR *dirp; + { + if (dirp != (DIR *)NULL) + { + free_dircontents (dirp->dd_contents); + free ((char *)dirp); + } + + return 0; + } + + /* + * Read the next record from the stream + */ + + struct dirent * + readdir (dirp) + DIR *dirp; + { + static struct dirent dp; + + if ((dirp == (DIR *)NULL) || (dirp->dd_cp == (DIRCONT *) NULL)) + return (struct dirent *) NULL; + + dp.d_reclen = strlen (strcpy (dp.d_name, dirp->dd_cp->_d_entry)); + dp.d_off = dirp->dd_loc * 32; + dp.d_ino = (ino_t)++dirp->dd_loc; + dirp->dd_cp = dirp->dd_cp->_d_next; + + return &dp; + } + + /* + * Restart the directory stream + */ + + void + rewinddir (dirp) + DIR *dirp; + { + seekdir (dirp, (off_t)0); + } + + /* + * Move to a know position in the stream + */ + + void + seekdir (dirp, off) + DIR *dirp; + off_t off; + { + long i = off; + DIRCONT *dp; + + if ((dirp == (DIR *)NULL) || (off < 0L)) + return; + + for (dp = dirp->dd_contents; (--i >= 0) && (dp != (DIRCONT *)NULL); + dp = dp->_d_next) + ; + + dirp->dd_loc = off - (i + 1); + dirp->dd_cp = dp; + } + + /* + * Get the current position + */ + + off_t + telldir(dirp) + DIR *dirp; + { + return (dirp == (DIR *)NULL) ? (off_t) -1 : dirp->dd_loc; + } + + /* + * Release the internal structure + */ + + static void + free_dircontents (dp) + DIRCONT *dp; + { + DIRCONT *odp; + + while ((odp = dp) != (DIRCONT *)NULL) + { + if (dp->_d_entry != (char *)NULL) + free (dp->_d_entry); + + dp = dp->_d_next; + free ((char *)odp); + } + } + + + /* + * Windows NT version + */ + + bool + IsHPFSFileSystem (directory) + char *directory; + { + char bName[4]; + DWORD flags; + DWORD maxname; + BOOL rc; + unsigned int nDrive; + char szCurDir [MAX_PATH]; + + if (isalpha (directory[0]) && (directory[1] == ':')) + nDrive = toupper (directory[0]) - '@'; + + else + { + GetCurrentDirectory (MAX_PATH, szCurDir); + nDrive = szCurDir[0] - 'A' + 1; + } + + /* Set up the drive name */ + + strcpy (bName, "x:\\"); + bName[0] = (char) (nDrive + '@'); + + /* Read the volume info, if we fail - assume non-HPFS */ + + DISABLE_HARD_ERRORS; + + rc = GetVolumeInformation (bName, (LPTSTR)NULL, 0, (LPDWORD)NULL, + &maxname, &flags, (LPTSTR)NULL, 0); + ENABLE_HARD_ERRORS; + + return ((rc) && (flags & (FS_CASE_SENSITIVE | FS_CASE_IS_PRESERVED))) + ? TRUE : FALSE; + } + diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/winnt/dirent.h gcc-2.7.1/config/winnt/dirent.h *** gcc-2.7.0/config/winnt/dirent.h --- gcc-2.7.1/config/winnt/dirent.h Tue Sep 12 17:15:24 1995 *************** *** 0 **** --- 1,96 ---- + /* + * dirent.h + */ + + #ifndef _DIRENT_H + # define _DIRENT_H + + # include + # include + + #define MAXNAMLEN 255 /* maximum filename length */ + + #ifndef NAME_MAX + #define NAME_MAX (MAXNAMLEN - 1) + #endif + + struct dirent /* data from getdents()/readdir() */ + { + ino_t d_ino; /* inode number of entry */ + off_t d_off; /* offset of disk directory entry */ + wchar_t d_reclen; /* length of this record */ + char d_name[MAXNAMLEN + 1]; + }; + + + /* The following nonportable ugliness could have been avoided by defining + * DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments. + * There shouldn't be any problem if you avoid using the DIRENTSIZ() macro. + */ + + #define DIRENTBASESIZ (((struct dirent *)0)->d_name \ + - (char *)&((struct dirent *)0)->d_ino) + + #define DIRENTSIZ(namlen) ((DIRENTBASESIZ + sizeof(long) + (namlen)) \ + / sizeof(long) * sizeof(long)) + + + + # ifndef _BOOL_T_DEFINED + typedef unsigned char bool; + # define _BOOL_T_DEFINED + # endif + + # define DIRBUF 8192 /* buffer size for fs-indep. dirs */ + /* must in general be larger than the */ + /* filesystem buffer size */ + + struct _dircontents { + char *_d_entry; + struct _dircontents *_d_next; + }; + + typedef struct _dirdesc { + int dd_id; /* uniquely identify each open directory */ + long dd_loc; /* where we are in directory entry is this */ + struct _dircontents *dd_contents; /* pointer to contents of dir */ + struct _dircontents *dd_cp; /* pointer to current position */ + } DIR; + + + #if defined (__STDC__) + # define _PROTO(p) p + #else + # define _PROTO(p) () + # undef const + # undef volatile + #endif + + /* Functions */ + + extern DIR * opendir _PROTO ((const char *)); + extern struct dirent * readdir _PROTO ((DIR *)); + extern void rewinddir _PROTO ((DIR *)); + + extern int closedir _PROTO ((DIR *)); + extern void seekdir _PROTO ((DIR *, off_t)); + extern off_t telldir _PROTO ((DIR *)); + + extern int chdir _PROTO ((const char *)); + extern char * getcwd _PROTO ((char *, size_t)); + + extern int mkdir _PROTO ((const char *)); + + extern int rmdir _PROTO ((const char *)); + extern int scandir _PROTO ((char *, + struct dirent ***, + int (*)(const void *, const void *), + int (*)(const void *, const void *))); + + extern int _chdrive _PROTO ((int)); + extern int _getdrive _PROTO ((void)); + extern char * _getdcwd _PROTO ((int, char *, int)); + + extern bool IsHPFSFileSystem _PROTO ((char *)); + + #endif diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/winnt/fixinc-nt.c gcc-2.7.1/config/winnt/fixinc-nt.c *** gcc-2.7.0/config/winnt/fixinc-nt.c --- gcc-2.7.1/config/winnt/fixinc-nt.c Tue Sep 12 17:15:19 1995 *************** *** 0 **** --- 1,260 ---- + #include + #include + #include + #include + #include + #include + #include + #include + + static char *concat(); + static char *concat3(); + static char *concat4(); + static int onlyonedir; + static int atleastone; + static char *fixeddirs, *origdirs; + + /* Convert all /'s to \'s */ + + char * + slash2slash (dirname) + char *dirname; + { + int i; + for (i=0; dirname[i]; i++) + if (dirname [i] == '/') + dirname [i] = '\\'; + + return dirname; + } + + /* Examine each directory component of a path and create the directory */ + + int + mkdirpath (dirpath) + char *dirpath; + { + char *ndirpath = strdup (dirpath); + char *bp, *fp; + + fp = bp = ndirpath; + + while (bp) + { + bp = strchr (fp, '\\'); + if (bp) + { + *bp = 0; + _mkdir (ndirpath); + *bp = '\\'; + fp = ++bp; + } + else + _mkdir (ndirpath); + } + } + + /* Construct a relative directory path from a given path by removing the + leading slash, if it exists and changing a drive letter from X: to X-. */ + + char * + newname (olddirname) + char *olddirname; + { + char *newname = strdup (olddirname); + + if ((strlen (newname) >= 2) + && (isalpha (newname[0]) && newname[1] == ':')) + newname [1] = '-'; + else if ((strlen (newname) >= 1) + && (newname [0] == '/' || newname [0] == '\\')) + newname = &newname[1]; + + return newname; + + } + + /* Run the sed script on one header file. If no modifications were made, then + delete the newly created file. */ + + int + doheader (oneheader, outheader, oldsize) + char *oneheader, *outheader; + int oldsize; + { + char *newbuff, *oldbuff; + char *newheader = concat3 ("include", "\\", newname (outheader)); + struct _stat newstatbuf; + int newdesc, olddesc; + int i; + + system (concat4 ("sed -f fixinc-nt.sed ", oneheader, " > ", newheader)); + _stat (newheader, &newstatbuf); + if (oldsize != newstatbuf.st_size) + { + atleastone = 1; + printf ("Fixing: %s\n", oneheader); + return 0; + } + oldbuff = malloc (oldsize); + newbuff = malloc (newstatbuf.st_size); + olddesc = open (oneheader, _O_RDONLY | _O_BINARY); + newdesc = open (newheader, _O_RDONLY | _O_BINARY); + read (olddesc, oldbuff, oldsize); + read (newdesc, newbuff, newstatbuf.st_size); + close (olddesc); + close (newdesc); + for (i=0; id_name[0] == '.') + continue; + + intempbuf = slash2slash (concat3 (indir, "\\", dire->d_name)); + outtempbuf = slash2slash (concat3 (outdir, "\\", dire->d_name)); + _stat (intempbuf, &statbuf); + + /* If directory ... */ + if (statbuf.st_mode & _S_IFDIR) + dodir (intempbuf, outtempbuf); + + /* If regular file ... */ + if (statbuf.st_mode & _S_IFREG) + doheader (intempbuf, outtempbuf, statbuf.st_size); + } + closedir (dir); + return 0; + } + + /* Retrieve the value of the Include environment variable, copy it into a + temporary and append a semi-colon for book-keeping purposes. Then call + dodir () for each complete directory that is named therein. If there is + only one directory, then direct the output to use include\. as the + root instead of include/, where is a path + constructed from the path named in the Include environment variable. + I.e. if Include=C:\MSTOOLS\Include;D:\MSVC20\Include then the modified + header files will be in include\C-\MSTOOLS\Include and + include\D-\MSVC20\Include. However if Include=C:\MSTOOLS\Include then the + modified files will be in include\. */ + + int + main () + { + char *fp, *bp, *foobar; + char *incvar = getenv ("Include"); + int varlen = 0; + struct _stat statbuf; + + if (incvar == NULL) return 0; + + varlen = strlen (incvar); + foobar = (char *) malloc (varlen + 2); + + strcpy (foobar, incvar); + foobar = slash2slash (foobar); + if (foobar [varlen-1] != ';') strcat (foobar, ";"); + fp = bp = foobar; + + if (strchr (fp, ';') == strrchr (fp, ';')) + onlyonedir = 1; + else + onlyonedir = 0; + + fixeddirs = strdup(".\\include"); + origdirs = strdup(""); + + while (bp) + { + bp = strchr (fp, ';'); + if (bp) + { + *bp = 0; + _stat (fp, &statbuf); + if (statbuf.st_mode & _S_IFDIR) + { + atleastone = 0; + if (onlyonedir) + dodir (fp, "."); + else + dodir (fp, fp); + if (atleastone && !onlyonedir) + { + origdirs = concat3 (origdirs, ";", fp); + fixeddirs = concat3 (fixeddirs, ";", + concat3 (".\\include", "\\", newname(fp))); + } + } + fp = ++bp; + } + } + printf ("set C_Include_Path=%s%s\n", fixeddirs, origdirs); + return 0; + } + + /* Utility function that mallocs space and concatenates two strings. */ + + static char * + concat (s1, s2) + char *s1, *s2; + { + int len1 = strlen (s1); + int len2 = strlen (s2); + char *result = malloc (len1 + len2 + 1); + + strcpy (result, s1); + strcpy (result + len1, s2); + *(result + len1 + len2) = 0; + + return result; + } + + /* Utility function that concatenates three strings. */ + + static char * + concat3 (s1, s2, s3) + char *s1, *s2, *s3; + { + return concat (concat (s1, s2), s3); + } + + /* Utility function that concatenates four strings. */ + + static char * + concat4 (s1, s2, s3, s4) + char *s1, *s2, *s3, *s4; + { + return concat (concat (s1, s2), concat (s3, s4)); + } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/winnt/headers.mak gcc-2.7.1/config/winnt/headers.mak *** gcc-2.7.0/config/winnt/headers.mak --- gcc-2.7.1/config/winnt/headers.mak Tue Sep 19 19:18:19 1995 *************** *** 0 **** --- 1,51 ---- + # Build the include directory. The stamp files are stmp-* rather than + # stamp-* so that mostlyclean does not force the include directory to + # be rebuilt. + + + # Copy in the headers provided with gcc. + USER_H = $(srcdir)\ginclude\stdarg.h $(srcdir)\ginclude\stddef.h \ + $(srcdir)\ginclude\varargs.h $(srcdir)\ginclude\va-alpha.h \ + $(srcdir)\ginclude\va-h8300.h $(srcdir)\ginclude\va-i860.h \ + $(srcdir)\ginclude\va-i960.h $(srcdir)\ginclude\va-mips.h \ + $(srcdir)\ginclude\va-m88k.h $(srcdir)\ginclude\va-pa.h \ + $(srcdir)\ginclude\va-pyr.h $(srcdir)\ginclude\va-sparc.h \ + $(srcdir)\ginclude\va-clipper.h $(srcdir)\ginclude\va-spur.h \ + $(srcdir)\ginclude\iso646.h \ + $(srcdir)\ginclude\proto.h + + # Build the include directory except for float.h (which depends upon + # enquire). + + stmp-int-hdrs: $(USER_H) + type $(srcdir)\limitx.h >xlimits.h + type $(srcdir)\glimits.h >>xlimits.h + type $(srcdir)\limity.h >>xlimits.h + + -mkdir include + for %%f in ($(USER_H)) do copy %%f include + del include\limits.h + copy xlimits.h include\limits.h + del include\syslimits.h + copy $(srcdir)\gsyslimits.h include\syslimits.h + copy include\limits.h include\syslimits.h + del include\README + copy $(srcdir)\README-fixinc include\README + touch stmp-int-hdrs + + stmp-headers: stmp-int-hdrs fixinc-nt.exe + fixinc-nt + touch stmp-headers + + # Build float.h. + stmp-float_h: libgcc.lib enquire.exe + -.\enquire -f > tmp-float.h + del include\float.h + copy tmp-float.h include\float.h + touch stmp-float_h + + fixinc-nt.obj: $(srcdir)/config/winnt/fixinc-nt.c + cl -c -I. -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/config/winnt $(srcdir)/config/winnt/fixinc-nt.c + + fixinc-nt.exe: fixinc-nt.obj dirent.obj + cl fixinc-nt.obj dirent.obj libc.lib kernel32.lib diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/winnt/ld.c gcc-2.7.1/config/winnt/ld.c *** gcc-2.7.0/config/winnt/ld.c Thu Jun 15 16:41:21 1995 --- gcc-2.7.1/config/winnt/ld.c Tue Sep 12 17:15:42 1995 *************** *** 28,31 **** --- 28,34 ---- #include + static char *concat (); + static char *concat3 (); + /* These can be set by command line arguments */ char *linker_path = 0; *************** *** 120,125 **** } ! /* Given a library name in NAME, i.e. foo. Look first for libfoo.a and then ! foo.lib in the set of directories we are allowed to search in */ static char * --- 123,128 ---- } ! /* Given a library name in NAME, i.e. foo. Look first for libfoo.lib and then ! libfoo.a in the set of directories we are allowed to search in */ static char * *************** *** 129,146 **** char *lib, *lib_path; ! lib = malloc (strlen (name) + 6); strcpy (lib, "lib"); strcat (lib, name); ! strcat (lib, ".a"); lib_path = locate_file (lib, search_dirs); if (!lib_path) { ! strcpy (lib, name); ! strcat (lib, ".lib"); lib_path = locate_file (lib, search_dirs); if (!lib_path) { ! fprintf (stderr, ! "Couldn't locate library: lib%s.a or %s.lib\n", name, name); exit (1); } --- 132,151 ---- char *lib, *lib_path; ! lib = malloc (strlen (name) + 8); strcpy (lib, "lib"); strcat (lib, name); ! strcat (lib, ".lib"); lib_path = locate_file (lib, search_dirs); if (!lib_path) { ! strcpy (lib, "lib"); ! strcat (lib, name); ! strcat (lib, ".a"); lib_path = locate_file (lib, search_dirs); if (!lib_path) { ! fprintf ! (stderr, ! "Couldn't locate library: lib%s.a or lib%s.lib\n", name, name); exit (1); } *************** *** 179,186 **** if (! strcmp (argv [i], "-v")) verbose = 1; else if (! strncmp (argv [i], "-subsystem", 10)) subsystem = 1; ! else if (! strncmp (argv [i], "-entry", 6)) entry = 1; } } --- 184,208 ---- if (! strcmp (argv [i], "-v")) verbose = 1; + else if (! strncmp (argv [i], "-g", 2)) + { + addarg ("-debugtype:coff -debug:full"); + } + else if (! strncmp (argv [i], "-stack", 6)) + { + i++; + addarg (concat ("-stack:",argv[i])); + } else if (! strncmp (argv [i], "-subsystem", 10)) + { subsystem = 1; ! i++; ! addarg (concat ("-subsystem:",argv[i])); ! } ! else if (! strncmp (argv [i], "-e", 2)) ! { entry = 1; + i++; + addarg (concat ("-entry:",&argv[i][1])); + } } } *************** *** 203,208 **** pathval = strcat (tmppathval, pathval); - process_args (&argc , argv); - linker_path = locate_file ("link32.exe", pathval); if (!linker_path) --- 225,228 ---- *************** *** 217,220 **** --- 237,242 ---- addarg (linker_path); + + process_args (&argc , argv); if (! subsystem) addarg ("-subsystem:console"); if (! entry) addarg ("-entry:mainCRTStartup"); *************** *** 263,271 **** else if (arg_len > 2 && !strncmp (argv [i], "-l", 2)) ! addarg (expand_lib (&argv[i][2])); ! else if (!strcmp (argv [i], "-v")) ! ; ! else ! addarg (argv [i]); } --- 285,306 ---- else if (arg_len > 2 && !strncmp (argv [i], "-l", 2)) ! { ! addarg (expand_lib (&argv[i][2])); ! } ! else if (!strcmp (argv [i], "-v") ! || !strcmp (argv [i], "-noinhibit-exec")) ! { ! ; ! } ! else if (!strcmp (argv [i], "-stack") ! || !strcmp (argv [i], "-subsystem") ! || !strcmp (argv [i], "-e")) ! { ! i++; ! } ! else ! { ! addarg (argv [i]); ! } } *************** *** 288,290 **** --- 323,347 ---- exit (0); + } + + static char * + concat (s1, s2) + char *s1, *s2; + { + int len1 = strlen (s1); + int len2 = strlen (s2); + char *result = malloc (len1 + len2 + 1); + + strcpy (result, s1); + strcpy (result + len1, s2); + *(result + len1 + len2) = 0; + + return result; + } + + static char * + concat3 (s1, s2, s3) + char *s1, *s2, *s3; + { + return concat (concat (s1, s2), s3); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/winnt/libgcc.mak gcc-2.7.1/config/winnt/libgcc.mak *** gcc-2.7.0/config/winnt/libgcc.mak --- gcc-2.7.1/config/winnt/libgcc.mak Tue Sep 12 17:15:21 1995 *************** *** 0 **** --- 1,19 ---- + # Build libgcc.a + + libgcc.lib : libgcc1.c libgcc2.c mklibgcc.exe + mklibgcc -c + mklibgcc "cl -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES)" libgcc1.c $(LIB1FUNCS) + mklibgcc "xgcc -B./ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES)" libgcc2.c $(LIB2FUNCS) + mklibnow.bat + -del libgcc.lib + lib -verbose -out:libgcc.lib lgcctmp/*.obj + + mklibgcc.obj : $(srcdir)/config/winnt/mklibgcc.c + cl -I. -I$(srcdir) -I$(srcdir)/config/winnt -c $(srcdir)/config/winnt/mklibgcc.c + + dirent.obj : $(srcdir)/config/winnt/dirent.c stmp-int-hdrs + cl -I. -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/config/winnt -c $(srcdir)/config/winnt/dirent.c + + mklibgcc.exe : mklibgcc.obj dirent.obj + cl mklibgcc.obj dirent.obj libc.lib kernel32.lib + diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/config/winnt/mklibgcc.c gcc-2.7.1/config/winnt/mklibgcc.c *** gcc-2.7.0/config/winnt/mklibgcc.c --- gcc-2.7.1/config/winnt/mklibgcc.c Tue Sep 12 17:15:21 1995 *************** *** 0 **** --- 1,97 ---- + #include + #include + #include + + char *skips[] = { + 0 + }; + + int + do_clean() + { + DIR *dir; + struct dirent *de; + remove("mklibnow.bat"); + + dir = opendir("lgcctmp"); + if (!dir) + return 0; + while ((de=readdir(dir))) + { + char buf[30]; + if (de->d_name[0] == '.') + continue; + sprintf(buf, "lgcctmp/%s", de->d_name); + unlink(buf); + } + closedir(dir); + return 0; + } + + int + main(int argc, char **argv) + { + char *cc = argv[1]; + char *csrc=argv[2]; + int i; + FILE *batfile; + FILE *cfile; + + if (argc > 1 && strcmp(argv[1], "-c")==0) + return do_clean(); + + _mkdir("lgcctmp", 0755); + + batfile = fopen("mklibnow.bat", "a"); + if (!batfile) + { + perror("mklibnow.bat"); + return 1; + } + /* fprintf(batfile, "@echo off\n"); */ + + for (i=3; i/dev/null 2>&1; then ! IBM_REV=4.1 ! elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then ! IBM_REV=4.1.1 else IBM_REV=4.${UNAME_RELEASE} --- 188,193 ---- IBM_ARCH=powerpc fi ! if [ -x /usr/bin/oslevel ] ; then ! IBM_REV=`/usr/bin/oslevel` else IBM_REV=4.${UNAME_RELEASE} *************** *** 219,223 **** 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; ! 9000/7?? | 9000/8?7 ) HP_ARCH=hppa1.1 ;; 9000/8?? ) HP_ARCH=hppa1.0 ;; esac --- 220,224 ---- 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; ! 9000/7?? | 9000/8?[79] ) HP_ARCH=hppa1.1 ;; 9000/8?? ) HP_ARCH=hppa1.0 ;; esac *************** *** 255,259 **** echo unknown-hitachi-hiuxwe2 exit 0 ;; ! 9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; --- 256,260 ---- echo unknown-hitachi-hiuxwe2 exit 0 ;; ! 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; *************** *** 261,265 **** echo hppa1.0-hp-bsd exit 0 ;; ! hp7??:OSF1:*:* | hp8?7:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; --- 262,266 ---- echo hppa1.0-hp-bsd exit 0 ;; ! hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; *************** *** 316,328 **** exit 0 ;; *:Linux:*:*) ! # Systems without a BFD linker ! if test -d /usr/lib/ldscripts/. ; then ! : else ! echo "${UNAME_MACHINE}-unknown-linuxoldld" ! exit 0 ! fi ! # Determine whether the default compiler is a.out or elf ! cat >dummy.c <&1` ! if echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then ! echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 ! elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then ! echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0 ! elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then ! echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0 ! elif test "${UNAME_MACHINE}" = "alpha" ; then ! echo alpha-unknown-linux ; exit 0 else ! # Either a pre-BFD a.out linker (linuxoldld) or one that does not give us ! # useful --help. Gcc wants to distinguish between linuxoldld and linuxaout. ! test ! -d /usr/lib/ldscripts/. \ ! && echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0 ! # Determine whether the default compiler is a.out or elf ! cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 ! rm -f dummy.c dummy;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. --- 347,353 ---- } EOF ! ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 ! rm -f dummy.c dummy ! fi ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. *************** *** 388,392 **** uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; ! m680[234]0:LynxOS:2.2*:*) echo m68k-lynx-lynxos${UNAME_RELEASE} exit 0 ;; --- 399,403 ---- uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; ! m680[234]0:LynxOS:2.[23]*:*) echo m68k-lynx-lynxos${UNAME_RELEASE} exit 0 ;; *************** *** 394,404 **** echo m68k-atari-sysv4 exit 0 ;; ! i[34]86:LynxOS:2.2*:*) echo i386-lynx-lynxos${UNAME_RELEASE} exit 0 ;; ! TSUNAMI:LynxOS:2.2*:*) echo sparc-lynx-lynxos${UNAME_RELEASE} exit 0 ;; ! rs6000:LynxOS:2.2*:*) echo rs6000-lynx-lynxos${UNAME_RELEASE} exit 0 ;; --- 405,415 ---- echo m68k-atari-sysv4 exit 0 ;; ! i[34]86:LynxOS:2.[23]*:*) echo i386-lynx-lynxos${UNAME_RELEASE} exit 0 ;; ! TSUNAMI:LynxOS:2.[23]*:*) echo sparc-lynx-lynxos${UNAME_RELEASE} exit 0 ;; ! rs6000:LynxOS:2.[23]*:*) echo rs6000-lynx-lynxos${UNAME_RELEASE} exit 0 ;; *************** *** 420,423 **** --- 431,438 ---- cat >dummy.c < + # include + #endif main () { *************** *** 483,487 **** #if defined (_SEQUENT_) ! printf ("i386-sequent-ptx\n"); exit (0); #endif --- 498,513 ---- #if defined (_SEQUENT_) ! struct utsname un; ! ! uname(&un); ! ! if (strncmp(un.version, "V2", 2) == 0) { ! printf ("i386-sequent-ptx2\n"); exit (0); ! } ! if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ ! printf ("i386-sequent-ptx1\n"); exit (0); ! } ! printf ("i386-sequent-ptx\n"); exit (0); ! #endif diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/configure gcc-2.7.1/configure *** gcc-2.7.0/configure Thu Jun 15 17:54:14 1995 --- gcc-2.7.1/configure Thu Oct 26 18:03:09 1995 *************** *** 492,495 **** --- 492,496 ---- extra_programs= extra_objs= + extra_gcc_objs= # Set this to force installation and use of collect2. use_collect2= *************** *** 542,545 **** --- 543,547 ---- tmake_file=a29k/t-vx29k tm_file=a29k/vx29k.h + extra_parts="crtbegin.o crtend.o" ;; a29k-*-*) # Default a29k environment. *************** *** 585,596 **** ;; alpha-*-winnt3*) ! tm_file=alpha/winnt.h xm_file=alpha/xm-winnt.h tmake_file=t-libc-ok ! xmake_file=alpha/x-winnt fixincludes=fixinc.winnt if [ x$gnu_ld != xyes ] then ! extra_programs=ld fi ;; --- 587,599 ---- ;; alpha-*-winnt3*) ! tm_file=alpha/win-nt.h xm_file=alpha/xm-winnt.h tmake_file=t-libc-ok ! xmake_file=winnt/x-winnt ! extra_gcc_objs="spawnv.o oldnames.o" fixincludes=fixinc.winnt if [ x$gnu_ld != xyes ] then ! extra_programs=ld.exe fi ;; *************** *** 737,741 **** use_collect2=yes ;; ! hppa1.1-*-hpux9*) cpu_type=pa xm_file=pa/xm-pahpux.h --- 740,745 ---- use_collect2=yes ;; ! hppa1.1-*-hpux9* | \ ! hppa1.1-*-hpux10*) cpu_type=pa xm_file=pa/xm-pahpux.h *************** *** 752,756 **** use_collect2=yes ;; ! hppa1.0-*-hpux9*) cpu_type=pa xm_file=pa/xm-pahpux.h --- 756,761 ---- use_collect2=yes ;; ! hppa1.0-*-hpux9* | \ ! hppa1.0-*-hpux10*) cpu_type=pa xm_file=pa/xm-pahpux.h *************** *** 967,971 **** tm_file=i386/iscdbx.h tmake_file=i386/t-svr3dbx ! extra_parts="crtbegin.o crtend.o svr3.ifile svr3z.rfile" else tm_file=i386/isccoff.h --- 972,976 ---- tm_file=i386/iscdbx.h tmake_file=i386/t-svr3dbx ! extra_parts="crtbegin.o crtend.o svr3.ifile svr3z.ifile" else tm_file=i386/isccoff.h *************** *** 1131,1144 **** i[345]86-*-winnt3*) cpu_type=i386 ! tm_file=i386/winnt.h out_file=i386/i386.c xm_file=i386/xm-winnt.h ! xmake_file=i386/x-winnt tmake_file=i386/t-winnt extra_objs=winnt.o fixincludes=fixinc.winnt if [ x$gnu_ld != xyes ] then ! extra_programs=ld fi ;; --- 1136,1150 ---- i[345]86-*-winnt3*) cpu_type=i386 ! tm_file=i386/win-nt.h out_file=i386/i386.c xm_file=i386/xm-winnt.h ! xmake_file=winnt/x-winnt tmake_file=i386/t-winnt extra_objs=winnt.o + extra_gcc_objs="spawnv.o oldnames.o" fixincludes=fixinc.winnt if [ x$gnu_ld != xyes ] then ! extra_programs=ld.exe fi ;; *************** *** 1517,1520 **** --- 1523,1547 ---- extra_headers=math-68881.h ;; + m68k-*-linux*aout*) # Motorola m68k's running Linux + xm_file=m68k/xm-linux.h # with a.out format + xmake_file=x-linux + tm_file=m68k/linux-aout.h + tmake_file=m68k/t-linux + fixincludes=Makefile.in #On Linux, the headers are ok already. + extra_headers=math-68881.h + gnu_ld=yes + ;; + m68k-*-linux*) # Motorola m68k's running Linux + xm_file=m68k/xm-linux.h # with ELF format + xmake_file=x-linux + tm_file=m68k/linux.h + tmake_file=m68k/t-linux + fixincludes=Makefile.in #On Linux, the headers are ok already. + extra_headers=math-68881.h + gnu_ld=yes + # Don't use it. Linux uses a slightly different one. + # The real one comes with the Linux C library. + #extra_parts="crtbegin.o crtend.o" + ;; m88k-dg-dgux*) case $machine in *************** *** 1600,1603 **** --- 1627,1632 ---- xmake_file=mips/x-iris6 tmake_file=mips/t-iris6 + # See comment in mips/iris[56].h files. + use_collect2=yes ;; mips-sgi-irix5cross64) # Irix5 host, Irix 6 target, cross64 *************** *** 1608,1611 **** --- 1637,1642 ---- xmake_file=mips/x-iris tmake_file=mips/t-cross64 + # See comment in mips/iris[56].h files. + use_collect2=yes ;; mips-sgi-irix5*) # SGI System V.4., IRIX 5 *************** *** 2090,2094 **** cpu_type=rs6000 tm_file=rs6000/aix41ppc.h ! tmake_file=rs6000/t-rs6000 use_collect2=yes ;; --- 2121,2125 ---- cpu_type=rs6000 tm_file=rs6000/aix41ppc.h ! tmake_file=rs6000/t-newas use_collect2=yes ;; *************** *** 2111,2114 **** --- 2142,2157 ---- xmake_file=rs6000/x-sysv4 ;; + powerpc-*-eabiaix*) + cpu_type=rs6000 + tm_file=rs6000/eabiaix.h + tmake_file=rs6000/t-eabiaix + fixincludes=Makefile.in + ;; + powerpc-*-eabisim*) + cpu_type=rs6000 + tm_file=rs6000/eabisim.h + tmake_file=rs6000/t-eabisim + fixincludes=Makefile.in + ;; powerpc-*-eabi*) cpu_type=rs6000 *************** *** 2128,2132 **** if [ x$gas = xyes ] then ! tmake_file=rs6000/t-ppcgas else tmake_file=rs6000/t-ppc --- 2171,2175 ---- if [ x$gas = xyes ] then ! tmake_file=rs6000/t-ppclegas else tmake_file=rs6000/t-ppc *************** *** 2134,2137 **** --- 2177,2186 ---- xmake_file=rs6000/x-sysv4 ;; + powerpcle-*-eabisim*) + cpu_type=rs6000 + tm_file=rs6000/eabilesim.h + tmake_file=rs6000/t-eabisim + fixincludes=Makefile.in + ;; powerpcle-*-eabi*) cpu_type=rs6000 *************** *** 2139,2143 **** if [ x$gas = xyes ] then ! tmake_file=rs6000/t-eabigas else tmake_file=rs6000/t-eabi --- 2188,2192 ---- if [ x$gas = xyes ] then ! tmake_file=rs6000/t-eabilegas else tmake_file=rs6000/t-eabi *************** *** 2153,2157 **** rs6000-ibm-aix3.2.[456789]*) tm_file=rs6000/aix3newas.h ! tmake_file=rs6000/t-rs6000 use_collect2=yes ;; --- 2202,2206 ---- rs6000-ibm-aix3.2.[456789]*) tm_file=rs6000/aix3newas.h ! tmake_file=rs6000/t-newas use_collect2=yes ;; *************** *** 2158,2162 **** rs6000-ibm-aix[456789].*) tm_file=rs6000/aix41.h ! tmake_file=rs6000/t-rs6000 xmake_file=rs6000/x-aix31 use_collect2=yes --- 2207,2211 ---- rs6000-ibm-aix[456789].*) tm_file=rs6000/aix41.h ! tmake_file=rs6000/t-newas xmake_file=rs6000/x-aix31 use_collect2=yes *************** *** 2309,2315 **** --- 2358,2370 ---- tm_file=vax/vms.h ;; + pdp11-*-bsd) + xm_file=pdp11/xm-pdp11.h + tm_file=pdp11/2bsd.h + tmake_file=pdp11/t-pdp11 + ;; pdp11-*-*) xm_file=pdp11/xm-pdp11.h tm_file=pdp11/pdp11.h + tmake_file=pdp11/t-pdp11 ;; we32k-att-sysv*) *************** *** 2330,2340 **** xm_file=${cpu_type}/xm-gnu.h tm_file=${cpu_type}/gnu.h ! extra_parts="crtbegin.o crtend.o" # GNU always uses ELF. elf=yes - # Don't build libgcc1.c, because there is no non-GNU - # compiler to build it with. The GNU system C library will - # include assembly versions of any needed functions. - tmake_file=t-libc-ok # GNU tools are the only tools. gnu_ld=yes --- 2385,2391 ---- xm_file=${cpu_type}/xm-gnu.h tm_file=${cpu_type}/gnu.h ! extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" # GNU always uses ELF. elf=yes # GNU tools are the only tools. gnu_ld=yes *************** *** 2342,2345 **** --- 2393,2400 ---- # On GNU, the headers are already okay. fixincludes=Makefile.in + # Don't build libgcc1.c, because there is no non-GNU + # compiler to build it with. The GNU system C library will + # include assembly versions of any needed functions. + tmake_file=t-libc-ok ;; *-*-sysv4*) *************** *** 2504,2512 **** if [ -f $srcdir/$subdir/lang-specs.h ]; then echo "#include \"$subdir/lang-specs.h\"" >>specs.h ! lang_specs_files="$lang_specs_files $subdir/lang-specs.h" fi if [ -f $srcdir/$subdir/lang-options.h ]; then echo "#include \"$subdir/lang-options.h\"" >>options.h ! lang_options_files="$lang_options_files $subdir/lang-options.h" fi done --- 2559,2567 ---- if [ -f $srcdir/$subdir/lang-specs.h ]; then echo "#include \"$subdir/lang-specs.h\"" >>specs.h ! lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h" fi if [ -f $srcdir/$subdir/lang-options.h ]; then echo "#include \"$subdir/lang-options.h\"" >>options.h ! lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h" fi done *************** *** 2685,2688 **** --- 2740,2754 ---- fi + # Set EXTRA_GCC_OBJS according to extra_gcc_objs. + # This substitutes for lots of t-* files. + if [ "x$extra_gcc_objs" = x ] + then true + else + rm -f Makefile.xx + sed "s|^EXTRA_GCC_OBJS =|EXTRA_GCC_OBJS = $extra_gcc_objs|" Makefile.tem > Makefile.xx + rm -f Makefile.tem + mv Makefile.xx Makefile.tem + fi + # Add a definition of USE_COLLECT2 if system wants one. # Also tell toplev.c what to do. *************** *** 2899,2903 **** rm -f Makefile.xx rm -f aux-output.c aux-output.o md ! echo 's| ||' > Makefile.sed echo "s|^target=.*$|target=${target}|" >> Makefile.sed echo "s|^xmake_file=.*$|xmake_file=${dep_host_xmake_file}|" >> Makefile.sed --- 2965,2971 ---- rm -f Makefile.xx rm -f aux-output.c aux-output.o md ! # Create an empty Makefile.sed first, to work around a Nextstep 3.3 bug. ! cat /dev/null > Makefile.sed ! echo 's| ||' >> Makefile.sed echo "s|^target=.*$|target=${target}|" >> Makefile.sed echo "s|^xmake_file=.*$|xmake_file=${dep_host_xmake_file}|" >> Makefile.sed diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/configure.bat gcc-2.7.1/configure.bat *** gcc-2.7.0/configure.bat Tue May 16 18:34:25 1995 --- gcc-2.7.1/configure.bat Tue Sep 12 17:35:06 1995 *************** *** 15,19 **** goto END :really_call_winnt ! call config\%2\config-nt %1 %2 %3 %4 goto END --- 15,19 ---- goto END :really_call_winnt ! call config\winnt\config-nt %1 %2 %3 %4 goto END diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/convert.c gcc-2.7.1/convert.c *** gcc-2.7.0/convert.c Thu Jun 15 07:20:12 1995 --- gcc-2.7.1/convert.c Mon Jul 17 12:54:28 1995 *************** *** 1,4 **** /* Utility routines for data type conversion for GNU C. ! Copyright (C) 1987, 1988, 1991, 1992, 1994 Free Software Foundation, Inc. This file is part of GNU C. --- 1,4 ---- /* Utility routines for data type conversion for GNU C. ! Copyright (C) 1987, 88, 91, 92, 94, 1995 Free Software Foundation, Inc. This file is part of GNU C. *************** *** 171,174 **** --- 171,185 ---- else if (outprec >= inprec) return build1 (NOP_EXPR, type, expr); + + /* If TYPE is an enumeral type or a type with a precision less + than the number of bits in its mode, do the conversion to the + type corresponding to its mode, then do a nop conversion + to TYPE. */ + else if (TREE_CODE (type) == ENUMERAL_TYPE + || outprec != GET_MODE_BITSIZE (TYPE_MODE (type))) + return build1 (NOP_EXPR, type, + convert (type_for_mode (TYPE_MODE (type), + TREE_UNSIGNED (type)), + expr)); /* Here detect when we can distribute the truncation down past some diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/ChangeLog gcc-2.7.1/cp/ChangeLog *** gcc-2.7.0/cp/ChangeLog Fri Jun 16 15:09:57 1995 --- gcc-2.7.1/cp/ChangeLog Fri Nov 3 18:00:30 1995 *************** *** 1,2 **** --- 1,976 ---- + Fri Nov 3 17:58:52 1995 Mike Stump + + * Version 2.7.1 released. + + Thu Nov 2 17:02:47 1995 Jason Merrill + + * call.c (convert_harshness): Handle references to arrays. + + Fri Oct 27 14:20:21 1995 Jason Merrill + + * typeck.c (comp_target_types): Check multi-level pointer + conversions in both directions. + + Tue Oct 17 21:39:05 1995 Jason Merrill + + * parse.y (explicit_instantiation): Fix 'extern template' with no + return type. + + Mon Oct 16 14:35:20 1995 Jason Merrill + + * parse.y (explicit_instantiation): Support automatic instantiation + of constructors. + (named_class_head_*): Support out-of-class definition of nested + types. + + Wed Oct 11 12:20:56 1995 Mike Stump + + * search.c (envelope_add_decl): New routine. Fix so that + methods are hidden in the same way that other members are. + (dfs_pushdecls): Cleanup and move functionality out of line, + into envelope_add_decl. + + Tue Oct 10 15:46:01 1995 Mike Stump + + * typeck.c (mark_addressable): Only call assemble_external if we + have started the output file. + + Tue Oct 10 11:27:18 1995 Jason Merrill + + * decl.c (start_function): Fix earlier cv-quals change. + + Mon Oct 9 23:53:05 1995 Mike Stump + + * parse.y (complex_direct_notype_declarator): Only push the class if + we are not already in the class. + + Mon Oct 9 11:22:03 1995 Doug Evans + + * decl.c (duplicate_decls): Call merge_machine_decl_attributes. + Update olddecl's attributes too. + (grokdeclarator): #if 0 out call to build_decl_attribute_variant. + * typeck.c (common_type): Call merge_machine_type_attributes. + + Fri Oct 6 14:44:27 1995 Mike Stump + + * typeck.c (mark_addressable): Add missing call to + assemble_external. + + Wed Oct 4 22:05:23 1995 Jeff Law (law@hurl.cygnus.com + + * cp/decl.c (deplicate_decls): Merge in deferred output + status for variables. + * cp/tree.c (tree_copy_lang_decl_for_deferred_output): New + function to copy the g++ specific parts of a DECL node. + (tree_copy_lang_type_for_deferred_output): Similarly for + TYPE nodes. + + Wed Oct 4 15:06:39 1995 Mike Stump + + * decl.c (store_parm_decls): Make sure the unwinder start comes + before the exception specification start. + * except.c (expand_exception_blocks): Make sure the unwinder end + comes after the terminate protected catch clause region and after + the end of the exception specification region. + + Wed Oct 4 12:47:02 1995 Jason Merrill + + * lex.c (real_yylex): Fix identifier case for linemode. + (handle_sysv_pragma): Don't abort when we see a pragma we don't + recognize. + + Tue Oct 3 14:09:46 1995 Mike Stump + + * decl.c (store_parm_decls): Add a call to start_eh_unwinder. + * except.c (init_exception_processing): __throw doesn't take any + arguments. + (expand_builtin_throw): Ditto. Always use Pmode, instead of SImode + for all pointers. Use expand_builtin_return_addr to unwind the + first level off the stack. + (do_unwind): Always use Pmode, instead of SImode for all pointers. + (expand_exception_blocks): Add a call to end_eh_unwinder. + (start_eh_unwinder, end_eh_unwinder): New routines to build machine + independent stack unwinders for function/method calls. + + Mon Oct 2 17:20:42 1995 Mike Stump + + * tree.c (unsave_expr_now): Make sure we process the argument list + of any called functions. Fixes incorrect code generation for + cleanups. + + Mon Oct 2 13:04:16 1995 Mike Stump + + * typeck.c (get_member_function_from_ptrfunc): Save function if it + needs it. Cures core dump on things like (this->*(f()))(). + + Sat Sep 23 22:51:25 1995 Jason Merrill + + * decl.c (start_function): Conform to gcc cv-quals convention (no + expression has a cv-qualified type) in RESULT_DECLs. + * method.c (make_thunk): Ditto. + + Fri Sep 22 10:21:13 1995 Mike Stump + + * decl.c (pushtag): Add in the namespace name for the tag. + + Thu Sep 21 13:11:13 1995 Mike Stump + + * parse.y (maybe_base_class_list, base_class_list, base_class, + base_class_access_list): Make sure we see the typenames for base + classes. + * lex.c (see_typename): Instead of failing to see a typename when + there is no next token, perfer a typename, and get the next token. + + Wed Sep 20 12:35:27 1995 Michael Meissner + + * decl.c (init_decl_processing): Add __builtin_expect. + + Tue Sep 19 16:48:11 1995 Mike Stump + + * cvt.c (cp_convert_to_pointer): Don't allow leftover conversions to + or from pointer to member functions, they must all be handled before + this point. + + Fri Sep 15 17:14:47 1995 Brendan Kehoe + + * init.c (resolve_offset_ref): Fix wording of non-static member + being referenced as a static. + + Fri Sep 15 12:39:11 1995 Jason Merrill + + * typeck.c (build_indirect_ref): Only bash pointer if we actually + call build_expr_type_conversion. + + Thu Sep 14 18:24:56 1995 Jason Merrill + + * cvt.c (build_expr_type_conversion): Handle conversion from + reference. + * typeck.c (build_indirect_ref): Avoid infinite recursion. + + Thu Sep 14 17:23:28 1995 Mike Stump + + * decl.c (expand_start_early_try_stmts): New routine to start a try + block at the start of the function, for function-try-blocks. + * cp-tree.h (expand_start_early_try_stmts): Declare it. + * parse.y (function_try_block): Use it, instead of doing it here, as + we don't want to include rtl.h here, as that conflicts with RETURN + in the parser. + + Wed Sep 13 18:32:24 1995 Mike Stump + + * lex.c (reinit_parse_for_block): Support saving inline + function-try-blocks, uses peekyylex. + * parse.y (eat_saved_input): New rule, permit the parser to see that + END_OF_SAVED_INPUT is ok, as it can see this when parsing the + handlers of a function-try-block. + (fndef): Use it. + (component_decl): Make sure TRY and RETURN can come after fn.def2. + * spew.c (peekyylex): New routine to peek at what will come next. + + Wed Sep 13 16:52:06 1995 Jason Merrill + + * typeck.c (comptypes): Tighten up comparisons of template type + parms. + + * decl.c (duplicate_decls): Turn off whining about virtual functions + redeclared inline for now. + + Wed Sep 13 11:13:40 1995 Mike Stump + + * decl.c (store_in_parms): New routine to put things before we + put base inits. + * cp-tree.h (store_in_parms): Declare it. + * decl.c (store_parm_decls): Use it to makr sure the starting of the + eh spec comes before base inits. + (finish_function): Use sequences instead of the obsolete + reorder_insns. + * parse.y (fndef): Enhance readability and maintainability. Update + to include function_try_block syntax. + (function_try_block): Add. + + Tue Sep 12 17:43:07 1995 Brendan Kehoe + + * call.c (convert_harshness): Use comptypes, not ==, to check if + TYPE and PARMTYPE are equivalent on a function type. + + Tue Sep 12 17:31:33 1995 Douglas Rupp (drupp@cs.washington.edu) + + * Make-lang.in (cc1plus) : Removed unnecessary $(exeext). + + Mon Sep 11 23:24:07 1995 Mike Stump + + * except.c (expand_throw): Never allocate storage for thrown pointer + to objects. + + Mon Sep 11 19:36:45 1995 Mike Stump + + * except.c (expand_start_catch_block): Pointers to objects come + back from catch matching already dereferenced, don't dereference + again. + + Mon Sep 11 15:46:28 1995 Mike Stump + + * except.c (expand_throw): Only decay the throw expression, don't do + any default conversions. This is so that one can throw and catch + characters, and not have them match integers. + + Mon Sep 11 13:46:45 1995 Mike Stump + + * error.c (dump_aggr_type): Deal with anonymous unions that don't + have a TYPE_NAME. + + Fri Sep 8 20:40:27 1995 Brendan Kehoe + + * lex.c (handle_sysv_pragma): Deal with getting a comma from yylex. + + Fri Sep 8 15:51:41 1995 Mike Stump + + * except.c (expand_end_eh_spec): Handle empty EH specifications. + + Fri Sep 8 15:27:22 1995 Mike Stump + + * cp-tree.h (expand_start_eh_spec): Declare new routine. + (expand_end_eh_spec): Ditto. + * decl.c (store_parm_decls): Call expand_start_eh_spec to process + exception specifications. + * except.c (expand_leftover_cleanups): Remove unused parameter. + (expand_end_catch_block): Ditto. + (expand_exception_blocks): Ditto. + (expand_start_eh_spec): New routine to mark the start of an + exception specification region. + (expand_end_eh_spec): New routine to mark the end of an exception + specification region. + (expand_exception_blocks): Call expand_end_eh_spec to process + exception specifications. + + Fri Sep 8 14:40:48 1995 Per Bothner + + * lex.c (do_identifier): Use global binding in preference of + dead for local variable. + + Wed Sep 6 19:32:59 1995 Mike Stump + + * cp-tree.h (build_exception_variant): Remove used first argument. + * decl.c (duplicate_decls): Ditto. + (grokfndecl): Ditto. + (revert_static_member_fn): Ditto. + * decl2.c (grok_method_quals): Ditto. + * tree.c (build_exception_variant): Ditto. + * typeck.c (common_type): Ditto. + * decl2.c (grokclassfn): After changing the type, call + build_exception_variant, if necessary. + + Tue Sep 5 15:56:27 1995 Mike Stump + + * except.c (expand_throw): Run cleanups for the throw expression. + + Wed Aug 30 15:24:38 1995 Stephen L. Favor (sfavor@tigger.intecom.com) + + * except.c (expand_builtin_throw): Moved gen_label_rtx calls beyond + the store_parm_decls call which does initialization in the emit_* + code concerning label numbering. + + Thu Aug 31 09:01:07 1995 Mike Stump + + * except.c (expand_internal_throw): Let the frontend be responsible + for managing all frontend EH parameters, the backend routine only + needs to deal with backend values. type and value are no longer + passed to __throw. + (init_exception_processing): Ditto. + (expand_start_all_catch): Ditto. + (expand_end_all_catch): Ditto. + (expand_leftover_cleanups): Ditto. + (expand_end_catch_block): Ditto. + (expand_builtin_throw): Ditto. + (expand_throw): Ditto. + + Tue Aug 29 15:04:36 1995 Jason Merrill + + * cp-tree.h (DECL_REAL_CONTEXT): Give the real declaration context + for a decl. + * decl.c (cp_finish_decl): Use it. + + Tue Aug 29 10:30:27 1995 Mike Stump + + * except.c (expand_internal_throw): Oops, almost forgot type and + value are now trees. + + Mon Aug 28 17:57:45 1995 Brendan Kehoe + + Fix the attribute handling to make sure they get noted before we + create the function's RTL, in case they can affect that. + * decl.c (grokfndecl): New arg ATTRLIST. Run + cplus_decl_attributes before creating the decl's rtl. + (grokdeclarator): New arg ATTRLIST, passed down into grokfndecl. + (shadow_tag, groktypename, start_decl, start_method): Pass a + NULL_TREE to grokdeclarator's new last arg. + * decl2.c (grokfield): New arg ATTRLIST, passed into grokdeclarator. + (grokbitfield, grokoptypename): Pass a NULL_TREE to + grokdeclarator's new last arg. + * except.c (expand_start_catch_block): Likewise. + * pt.c (process_template_parm, end_template_decl, + do_function_instantiation): Likewise. + * cp-tree.h (grokfield): Add arg. + (grokdeclarator): Move the prototype from here... + * decl.h: ...to here. + * lex.c (cons_up_default_function): Pass NULL_TREE to grokfield + ATTRLIST argument. + * parse.y: Create a list for the grokfield arg where appropriate, + and pass it down instead of calling cplus_decl_attributes. + + Mon Aug 28 15:07:24 1995 Mike Stump + + * except.c: Always allow turning on exception handling. Allow cross + compilations to use EH. + + Thu Aug 24 17:39:24 1995 Mike Stump + + * except.c (saved_pc, saved_throw_type, saved_throw_value): Use + trees, instead of rtxs, and don't depend on using special machine + dependent registers. + (expand_internal_throw): Ditto. + (init_exception_processing): Ditto. + (expand_start_all_catch): Ditto. + (expand_end_all_catch): Ditto. + (expand_start_catch_block): Ditto. + (expand_leftover_cleanups): Ditto. + (expand_end_catch_block): Ditto. + (expand_builtin_throw): Ditto. + (expand_throw): Ditto. + + Wed Aug 23 17:25:51 1995 Jason Merrill + + * cvt.c (build_expr_type_conversion): Handle conversions to + reference types. + + Wed Aug 23 15:33:59 1995 Mike Stump + + * except.c (do_unwind): Work around backend bug with -fpic. + + Tue Aug 22 17:20:07 1995 Per Bothner + + * decl2.c (flag_new_for_scope): Add a new mode that follows ANSI + for-scoping, but supports (and warns about) old programs. + Make the new mode (with value 1) the default. + (lang_f_options): The on-value for flag_new_for_scope is now 2. + * cp-tree.h (DECL_DEAD_FOR_LOCAL, DECL_ERROR_REPORTED): New macros + (DECL_SHADOWED_FOR_VAR): Likewise. + * decl.c (struct binding_level): New fields dead_vars_from_for + and is_for_scope. + (note_level_for_for): New function. + (poplevel): Special processing if is_for_scope. + (pushdecl): Warn if for-scope variable shadows local. + * lex.c (do_identifier): Handle old (non-ANSI) for scoping, + and warn if conflicts. + * parse.y (FOR): Call note_level_for_for. + + Mon Aug 21 10:28:31 1995 Jason Merrill + + * decl2.c (import_export_inline): Class interface hackery does not + apply to synthesized methods. + + Sun Aug 20 16:29:00 1995 Mike Stump + + * search.c (virtual_context): Find the right context more often. + Solves a `recoverable compiler error, fixups for virtual function' + problem. + + Sun Aug 20 13:53:24 1995 Mike Stump + + * except.c (expand_start_all_catch): Ensure that we always transfer + control to the right EH handler, by rethrowing the end label on the + region, instead of hoping we are nested and falling through. + (expand_leftover_cleanups): Ditto. + (end_protect): Since we now rethrow the end label, put a + nop after it, so that outer regions are recognized. + * init.c (build_vec_delete_1): New routine to handle most of vector + deleting, all code moved here from build_vec_delete. + (build_array_eh_cleanup): Use build_vec_delete_1 to do all the real + work. + (expand_vec_init): If the array needs partial destructing, setup an + EH region to handle it. + (build_vec_delete): Move lots of code to build_vec_delete_1, use + build_vec_delete_1 to do the grunt work. + + Sat Aug 19 14:25:33 1995 Brendan Kehoe + + Handle decl attributes properly for function definitions without + previous attribute-loaded declarations. + * decl.c (start_function): New arg ATTRS. Add a call to + cplus_decl_attributes with it before we create the RTL. + * cp-tree.h (start_function): Update prototype. + * parse.y (fn.def1): Pass ATTRS into start_function instead of + trying to call cplus_decl_attributes too late. Pass a NULL_TREE + for other use. + * decl2.c (finish_file): Pass NULL_TREE as fourth arg to + start_function. + * method.c (synthesize_method): Likewise. + * except.c (expand_builtin_throw): Likewise for start on __throw. + + Sat Aug 19 13:36:08 1995 Mike Stump + + * class.c (set_rtti_entry): Turn on -fvtable-thunk -frtti support. + This changes -fvtable-thunks vtable layout, so a recompile will be + necessary, if you use -fvtable-thunks. + (get_vtable_entry): Use n, instead of i to be consistent with the + rest of the compiler. + (get_vtable_entry_n): Ditto. + (add_virtual_function): Add a slot for the tdesc, if -fvtable-thunks + are being used. + (finish_struct_1): Ditto. + (skip_rtti_stuff): New routine to collapse similar code from many + different parts of the compiler. I think I got them all. + (modify_one_vtable): Use it. + (fixup_vtable_deltas1): Ditto. + (override_one_vtable): Ditto. + * decl2.c (mark_vtable_entries): Ditto. + * tree.c (debug_binfo): Ditto. + * search.c (expand_upcast_fixups): Ditto. + (get_abstract_virtuals_1): Ditto. Use virtuals, instead of tmp to + consistent with the rest of the compiler. + (get_abstract_virtuals): Ditto. + * cp-tree.h (skip_rtti_stuff): New routine, declare it. + * gc.c (build_headof): Support -fvtable-thunk and -frtti together. + (build_typeid): Ditto. + (build_classof): Remove old style way of doing rtti. Remove support + for `classof' and `headof'. + * gxx.gperf: Ditto. + * hash.h: Ditto. + * parse.y: Ditto. + + Fri Aug 18 17:31:58 1995 Jason Merrill + + * decl.c (start_function): Clear ctor_label and dtor_label. + + * class.c (finish_struct_1): Fix handling of access decls. + + Tue Aug 15 19:21:54 1995 Jason Merrill + + * class.c (finish_struct): Only do minimal processing here, so it + can be used for class template definitions, as well. + (finish_struct_1): New function with the rest of the code. + + Tue Aug 15 09:46:16 1995 Mike Stump + + * class.c (prepare_fresh_vtable): On second though, always build the + offset (see Aug 10 change), unless -fvtable-thunks is given. It + does this by calling the new routine set_rtti_entry. + (finish_struct): Ditto. + (set_rtti_entry): New routine to update the rtti information at the + start of the vtable. + + Mon Aug 14 12:21:22 1995 Brendan Kehoe + + * error.c (dump_decl, case IDENTIFIER_NODE): Only work on a dtor + if it's declared in the C++ language spec. + (dump_function_decl): Likewise. + (dump_function_name): Likewise. + (ident_fndecl): Make sure we got something back from lookup_name. + * decl.c (start_function): Likewise. + + Fri Aug 11 16:52:15 1995 Jason Merrill + + * call.c (build_method_call): Don't call build_new when calling a + constructor without an instance. + + Thu Aug 10 20:00:17 1995 Mike Stump + + * class.c (prepare_fresh_vtable): Always build the offset to the + complete object, as it doesn't cost much. This allows dynamic_cast + to void * to work when -frtti isn't given. + (finish_struct): Ditto. + + Thu Aug 10 16:31:28 1995 Mike Stump + + * except.c (build_eh_type): Split out some functionality to new + routine named build_eh_type_type. + (build_eh_type_type): New routine. + (expand_start_catch_block): Use build_eh_type_type, as we never want + the dynamic type of the catch parameter, just the static type. + Fixes core dumps when -frtti is used and one catchs pointers to + classes. + + Thu Aug 10 14:55:29 1995 Mike Stump + + * except.c (expand_builtin_throw): Since we now use normal calling + conventions for __throw, we have to remove the first layer off the + stack, so that the next context we search for handlers is the outer + context instead of the context that had the call to __throw, if we + don't immediately find the desired context. + + Tue Aug 8 17:44:23 1995 Jason Merrill + + * tree.c (cp_expand_decl_cleanup): Returns int, not tree. + * cp-tree.h: Update. + + * parse.y (template_type_parm): Add support for `typename'. + + Tue Aug 8 12:06:31 1995 Mike Stump + + * except.c (expand_internal_throw): New internal routine to throw a + value. + (expand_end_all_catch, expand_leftover_cleanups): All throwers + changed to use `expand_internal_throw' instead of jumping to throw + label. + (expand_end_catch_block, expand_throw): Ditto. + (throw_label): Removed. + (expand_builtin_throw): Changed so that EH parameters are passed by + normal function call conventions. Completes Aug 4th work. + + Fri Aug 4 17:17:08 1995 Mike Stump + + * cp-tree.h (expand_builtin_throw): Declare it. + * decl2.c (finish_file): Call expand_builtin_throw. + * except.c (make_first_label): Remove. + (init_exception_processing): Don't use a LABEL_REF for throw_label, + instead use a SYMBOL_REF, this is so that we don't use LABEL_REFs in + other functions that don't really appear in those functions. This + solves a problem where cc1plus consumed exponential amounts of + memory when -Wall was used. + (expand_end_all_catch, expand_leftover_cleanups, + expand_end_catch_block, expand_throw): Change all uses of + throw_label to match new style. + (do_unwind): Rename parameter to inner_throw_label, as it is now + different from throw_label. Also, assume that our caller will wrap + the passed label with a LABEL_REF, if needed. + (expand_builtin_throw): Make external, change so that the generated + throw is now a real function. + (expand_exception_blocks): Never generate throw code inside another + function. + + Fri Aug 4 12:20:02 1995 Mike Stump + + * decl.c (grokdeclarator): Move checking of mutable const objects + and mutable static objects down, as we might decide during parsing + to unset staticp or constp (for example, when const is part of the + object being pointed to). + + Thu Aug 3 17:13:43 1995 Mike Stump + + * except.c (output_exception_table_entry): Enhance portability to + weird machines. + (emit_exception_table): Ditto. + + Thu Aug 3 16:41:38 1995 Mike Stump + + * typeck.c (build_ptrmemfunc): Handle casting of pointer to + non-virtual member functions. + + Wed Aug 2 11:58:25 1995 Mike Stump + + * gc.c (build_typeid): Strip cv qualifiers so that const T&, T&, T + and const T all match. + + Wed Aug 2 11:25:33 1995 Mike Stump + + * except.c (build_eh_type): Strip cv qualifiers so that const T&, + T&, T and const T all match. + + Tue Aug 1 14:20:16 1995 Mike Stump + + * except.c: Fix up comments, cleanup code and eliminate exceptNode, + exceptStack, exceptstack, push_except_stmts, pop_except_stmts, + new_except_stack, push_last_insn, pop_last_insn, insn_save_node and + InsnSave. Also, numerous speed improvements, and correctness + improvements. Double faulting in all situations should now be + handled correctly. + (expand_start_all_catch): Instead of having many terminate protected + regions, just have one. + (expand_start_catch_block): No longer have to protect + false_label_rtx, as it isn't used for EH region marking. + (expand_end_catch_block): Expand out EH cleanups here by using + expand_leftover_cleanups. + (expand_end_all_catch): Use sequences instead of playing with insn + links directly. + (expand_exception_blocks): Ditto. Also protect all catch clauses + with one terminate region. + + Mon Jul 31 13:24:30 1995 Jason Merrill + + * method.c (report_type_mismatch): Don't talk about an object + parameter for non-methods. + + Sun Jul 30 13:13:02 1995 Jason Merrill + + * class.c (finish_struct): Catch private and protected members of + anonymous unions here. + * decl2.c (finish_anon_union): And here. + * parse.y: Instead of here. + + * errfn.c (ARGSLIST): Support passing four args. + * error.c (cv_as_string): New function. + (cp_printers): Add it. + * call.c (build_method_call): Report 'const' at end of pseudo-decl. + + * method.c (report_type_mismatch): Deal with a bad_arg of 0. + + * init.c (expand_aggr_init): Handle volatile objects, too. + + Sat Jul 29 13:42:03 1995 Jason Merrill + + * decl.c (struct binding_level): Keep list of incomplete decls. + (print_binding_level): Use list_length to count them. + (pushdecl): Build up the list. + (hack_incomplete_structures): Walk it and prune completed decls. + + Fri Jul 28 15:26:44 1995 Jason Merrill + + * typeck.c (comp_target_types): Don't check const and volatile for + function types. + (comp_ptr_ttypes_real): Ditto. + + Thu Jul 27 15:40:48 1995 Jason Merrill + + * typeck.c (comp_target_types): Fix. + + Thu Jul 27 15:10:48 1995 Mike Stump + + * cp-tree.h (unsave_expr_now, build_unsave_expr, + cp_expand_decl_cleanup): Declare new routines. + * decl.c (cp_finish_decl, store_parm_decls, + hack_incomplete_structures): Change all cals from + expand_decl_cleanup to cp_expand_decl_cleanup. + * gc.c (protect_value_from_gc): Ditto. + * expr.c (cplus_expand_expr): Handle UNSAVE_EXPRs. + * tree.c (unsave_expr): New routine to build an UNSAVE_EXPR. + (unsave_expr_now): Backend routine used by tree expander. + (cp_expand_decl_cleanup): Wrap second argument in an UNSAVE_EXPR to + work around a limitation in the backend. The backend uses the + cleanups multiple times, on disjoint control flows, so we cannot + pass unsaved SAVE_EXPRs to the backend. + * tree.def (UNSAVE_EXPR): New tree code. + * typeck.c (c_expand_return): Move goto/return code up inside + conditional, as we don't always want to do this, we only want to do + this when we don't otherwise finish with this control flow. + + Thu Jul 27 10:38:43 1995 Brendan Kehoe + + * parse.y (typespec): Only complain about typeof if we're not + getting it from a system header. + + Thu Jul 27 10:26:23 1995 Doug Evans + + Clean up prefix attribute handling. + * parse.y (reserved_declspecs): Link prefix attributes with declspecs. + (declmods): Likewise. + (all rules that reference typed_declspecs and declmods): Call + split_specs_attrs or strip_attrs to separate declspecs and attrs. + (lang_extdef): Delete resetting of prefix_attributes. + (template_def, notype_declarator rule): Use NULL_TREE for + prefix_attributes. + (condition): Use NULL_TREE for prefix_attributes. + (setattrs): Deleted. + (nomods_initdcl0): Set prefix_attributes to NULL_TREE. + (component_decl): Delete resetting of prefix_attributes. + (component_decl_1, notype_components rule): Use NULL_TREE for + prefix_attributes. + (simple_stmt): Delete resetting of prefix_attributes. + + Mon Jul 24 13:37:53 1995 Jason Merrill + + * call.c (convert_harshness): Deal with reference conversions before + others. Actually do array->pointer decay. Call comp_target_types + with pointer types rather than their targets. + + * typeck.c (comp_target_types): Avoid assigning D const * to B *. + + Mon Jul 24 08:54:46 1995 Brendan Kehoe + + * pt.c (to_be_restored): Move decl to global scope. + + Sat Jul 22 12:22:11 1995 Jason Merrill + + * decl.c (start_decl): Put back clearing of DECL_IN_AGGR_P. + + Fri Jul 21 17:09:02 1995 Jason Merrill + + * decl.c (grokdeclarator): Downgrade error about 'extern int A::i' + to pedwarn. + + * pt.c (instantiate_template): Also avoid instantiation if the + function has already been declared to be a specialization. + + * decl2.c (check_classfn): Ignore cname argument, and return the + matching function. + + * decl.c (start_decl): Handle declarations of member functions + outside of the class (i.e. specialization declarations). + + Thu Jul 20 10:34:48 1995 Jason Merrill + + * class.c (finish_struct): Don't mess with the type of bitfields. + + * various.c: s/TYPE_POINTER_TO/build_pointer_type/. + + Thu Jul 20 01:43:10 1995 Mike Stump + + * init.c (expand_aggr_init): Assume LOOKUP_ONLYCONVERTING if init + is not a parameter list (TREE_LIST). + (expand_default_init): If LOOKUP_ONLYCONVERTING is set, then set + LOOKUP_NO_CONVERSION so that we don't allow two-level conversions, + but don't set it otherwise. + + Wed Jul 19 20:32:01 1995 Mike Stump + + * init.c (expand_default_init): Don't allow two-level conversions + during construction. + + Wed Jul 19 18:06:37 1995 Mike Stump + + * gc.c (build_headof): The type of dyncasting to a pointer to cv + void, should be pointer to cv void. + + Wed Jul 19 17:25:43 1995 Mike Stump + + * gc.c (build_dynamic_cast): Allow casting in const. + + Wed Jul 19 16:34:27 1995 Mike Stump + + * typeck.c (build_const_cast): If we are passed error_mark_node, + return it. + + Wed Jul 19 15:24:48 1995 Brendan Kehoe + + * class.c (push_nested_class): Make sure TYPE is non-nil. + + * cvt.c (type_promotes_to): Watch for error_mark_node on the + incoming TYPE. + + Wed Jul 19 13:23:12 1995 Gerald Baumgartner + + * cp-tree.h (SIGTABLE_VT_OFF_NAME): Renamed from SIGTABLE_OFFSET_NAME. + (SIGTABLE_VB_OFF_NAME): New macro. + (vt_off_identifier): Renamed from offset_identifier. + (vb_off_identifier): Added extern declaration. + + * decl.c (vt_off_identifier): Renamed from offset identifier. + (vb_off_identifier): New variable to hold the identifier for the + sigtable field vb_off. + (init_decl_processing): Initialize vb_off_identifier. + Renamed vt_off_identifier from offset_identifier. + * sig.c (build_signature_method_call): Renamed offset_identifier and + local variable offset to vt_off_identifer and vt_off, respecitively. + * sig.c (build_signature_table_constructor): Renamed offset to vt_off. + + * decl.c (init_decl_processing): Add vb_off field to + sigtable_entry_type. Reorder fields so that pfn gets properly + aligned at a 64 bit boundary on the Alpha. + * sig.c (build_signature_table_constructor): Build the constructor + according to the new layout. Set the vb_off field to -1 for now. + + * decl.c (init_decl_processing): Align sigtable_entry_type on word + boundaries instead of double word boundaries to save space. + + Tue Jul 18 16:58:37 1995 Mike Stump + + * cvt.c (cp_convert): Always call build_cplus_new for a ctor. + + Tue Jul 18 14:24:53 1995 Brendan Kehoe + + * parse.y (opt.component_decl_list): Only forbid private/protected + in anonymous unions. We need to make this know when the type is + defined for an object, to not give the error. + + Mon Jul 17 14:22:44 1995 Brendan Kehoe + + * parse.y (opt.component_decl_list): Don't allow access control + as private or protected for union members. + + Sun Jul 16 14:01:00 1995 Jim Wilson + + * lex.c (check_newline): For 'p' case, move goto skipline line to + before end brace for 'pragma'. + + Fri Jul 7 13:55:58 1995 Mike Stump + + * g++.1: Tiny updates. + + Fri Jul 7 13:05:20 1995 Mike Stump + + * decl.c (cp_finish_decl): Only destruct local static variables if + they are constructed, and only construct the first time control + passes completely through its declaration (if not initialized with a + constant-expression). + (expand_static_init): Ditto. + + Wed Jul 5 14:05:04 1995 Brendan Kehoe + + * typeck.c (comptypes, case OFFSET_REF): If either offset basetype + is a TEMPLATE_TYPE_PARM, give a match. + + Mon Jul 3 15:17:20 1995 Steve Chamberlain + + * g++.c (sys/file.h): Remove change of Jun 28. + + Fri Jun 30 15:42:57 1995 Mike Stump + + * method.c (build_overload_value): Handle encoding of null pointer + constants (or any pointer with a constant numeric value) for + templates. + + Fri Jun 30 13:45:51 1995 Brendan Kehoe + + * call.c (convert_harshness): Add QUAL_CODE when we're faced with + const vs non-const for void conversions. + + Fri Jun 30 10:19:52 1995 Mike Stump + + * except.c (expand_start_all_catch): Fix problem with finding an + outer nested try block when there is no code to separate it from an + inner try block. + + Fri Jun 30 02:22:26 1995 Mike Stump + + * search.c (dfs_pushdecls): Consume 2 or 3 orders of magnitude less + memory please when virtual bases are used. + + Thu Jun 29 19:03:47 1995 Mike Stump + + * class.c (build_vbase_path): Avoid testing things that cannot be + null to see if they are null. + * cvt.c (convert_pointer_to_vbase): Remove code that doesn't work. + * decl.c (finish_function): Pass a type into the new + convert_pointer_to_vbase instead of a binfo. + * search.c (convert_pointer_to_vbase): Rewritten to use get_vbase + and convert_pointer_to_real. + (expand_indirect_vtbls_init): Use convert_pointer_to_vbase instead + of the more cryptic call to get_vbase. + + Thu Jun 29 09:35:05 1995 Mike Stump + + * decl.c (BOOL_TYPE_SIZE): Fix broken SLOW_BYTE_ACCESS check. + + Thu Jun 29 03:43:55 1995 Jason Merrill + + * pt.c (instantiate_template): Don't strip 'this' twice. + + * pt.c (coerce_template_parms): Allow null pointer constants. + + * decl.c (revert_static_member_fn): But only if DECL_ARGUMENTS is + set. + + Wed Jun 28 23:34:58 1995 Steve Chamberlain + + * g++.c (pfatal_with_name): Use my_strerror to get error + string. + (sys/file.h): Include if HAVE_FILE_H defined. + + Wed Jun 28 18:39:03 1995 Jason Merrill + + * decl.c (revert_static_member_fn): Also remove 'this' from + DECL_ARGUMENTS. + * decl2.c (check_classfn): Don't revert this function until we get a + match. + + Wed Jun 28 14:07:27 1995 Brendan Kehoe + + * parse.y (component_decl): Clear PREFIX_ATTRIBUTES here. + + Wed Jun 28 11:05:13 1995 Mike Stump + + * decl2.c (finish_file): Handle global vector news. + * init.c (build_new): Encode vector news so that later we will know + how many elements there are. + + Mon Jun 26 13:38:06 1995 Jason Merrill + + * expr.c (cplus_expand_expr): Don't mess with temp slots. + + * decl2.c (warn_if_unknown_interface): Don't crash if tinst_for_decl + returns null. + + * decl2.c (check_classfn): Use revert_static_member_fn. + * decl.c (revert_static_member_fn): Diagnose static member functions + declared const or volatile. + + * decl2.c (grokfield): Check for missing default args here, too. + (check_default_args): Function to do the checking. + * decl.c (pushdecl): Use it. + + * decl.c (pushdecl): Don't warn about shadowing a member of `this' + if there is no `this'. + + Sun Jun 25 11:34:25 1995 Jason Merrill + + * call.c (build_method_call): Downgrade 'called before definition' + to a warning, as it ought to go away after Monterey. + + Sat Jun 24 14:18:42 1995 Jason Merrill + + * pt.c (coerce_template_parms): Don't do extra checking on pointer + to member arguments. + + * class.c (finish_struct): const and reference members don't prevent + a class from being an aggregate. + + * class.c (finish_struct): Signatures are always aggregates. + + Fri Jun 23 17:20:29 1995 Jason Merrill + + * decl2.c (check_classfn): Improve error message. + + * pt.c (tsubst): Handle PROMOTE_PROTOTYPES. + + Thu Jun 22 01:50:42 1995 Jason Merrill + + * typeck.c (comptypes): Don't ignore method quals. + + * class.c (finish_struct): Non-abstract virtuals are always USED. + + * decl.c (build_ptrmemfunc_type): The underlying union type isn't + IS_AGGR_TYPE, either. + * class.c (finish_struct): Use CLASSTYPE_NON_AGGREGATE instead. + * cp-tree.h: Ditto. + + * cp-tree.h (lang_type): Add aggregate. + (CLASSTYPE_AGGREGATE): New macro. + (TYPE_NON_AGGREGATE_CLASS): Ditto. + * class.c (finish_struct): Determine whether a class is an + aggregate. + * decl.c (cp_finish_decl): Check TYPE_NON_AGGREGATE_CLASS instead of + TYPE_NEEDS_CONSTRUCTING. + * typeck2.c (digest_init): Check TYPE_NON_AGGREGATE_CLASS for + subobjects, too. + + * pt.c (tsubst, PARM_TYPE): Propagate DECL_ARTIFICIAL. + + * decl.c (start_function): For pre-parsed functions, layout all of + the parm decls again. + (grokvardecl): TREE_PUBLIC depends on DECL_THIS_EXTERN, not + DECL_EXTERNAL. + + * pt.c (coerce_template_parms): Improve checking for invalid + template parms. + + Wed Jun 21 12:01:16 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Forbid declaration of a static member + with the same name as its enclosing class. + + Mon Jun 19 10:28:14 1995 Jason Merrill + + * decl.c (finish_function): Clear current_class_decl. + + * typeck.c (build_conditional_expr): Use convert (boolean_type_node + instead of truthvalue_conversion. + + * class.c (finish_struct): A data member with the same name as the + class doesn't suppress constructors. + + Fri Jun 16 18:11:39 1995 Gerald Baumgartner (gb@alexander.cs.purdue.edu) + + * decl.c (start_function): If current_class_decl is a signature + pointer, don't dereference it but set C_C_D to current_class_decl. + + Fri Jun 16 17:06:28 1995 Jason Merrill + + * decl.c (duplicate_decls): Complain about virtual functions + redeclared to be inline. + + Fri Jun 16 13:20:38 1995 Mike Stump + + * decl.c (get_unique_name): New routine to name unnamed namespaces. + (push_namespace): Use get_unique_name for naming unnamed namespaces. + Fri Jun 16 15:07:29 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) *************** *** 7,10 **** --- 981,1028 ---- * decl.c (define_function): Don't set DECL_INTERFACE_KNOWN. + * parse.y: Call cplus_decl_attributes with prefix_attributes where + appropriate. + + Wed Jun 14 19:24:49 1995 Mike Stump + + * search.c (get_vbase): New routine to switch hierarchies from the + CLASSTYPE_VBASECLASSES to the normal one. + (expand_indirect_vtbls_init): Use get_vbase to figure out how we + want to convert to a vbase pointer. + + Mon Jun 12 17:50:30 1995 Jason Merrill + + * pt.c (instantiate_class_template): Add the new instantiation to + template_classes. + (do_pending_expansions): Call instantiate_member_templates on all of + the classes in template_classes. + + Mon Jun 12 12:36:59 1995 Mike Stump + + * decl.c (complete_array_type): Fill in the TYPE_DOMAIN of our + TYPE_MAIN_VARIANT if it is not filled in. + * init.c (build_delete): If the TYPE_DOMAIN is not set, give an + error instead of core dumping. + + Mon Jun 12 10:41:40 1995 Jason Merrill + + * call.c (can_convert): Also check for distance > 0. + (can_convert_arg): Ditto. + (user_harshness): Ditto. + + Fri Jun 9 19:17:21 1995 Jason Merrill + + * g++.c (MATH_LIBRARY): Provide default. + (main): Always link with the math library if we link with libstdc++. + + * decl.c (start_function): Complain about redefinition of a function + even when the pending_inline version is compiled after the other + version. + + Thu Jun 8 15:44:38 1995 Jason Merrill + + * gc.c (build_dynamic_cast): Build up a reference to a parameter of + aggregate type. + Wed Jun 7 20:00:31 1995 Mike Stump *************** *** 24,31 **** (pop_cp_function_context): Restore C_C_D. Fri Jun 2 11:05:58 1995 Jason Merrill ! * decl.c (set_C_C_D): New function. ! (pop_from_top_level, start_function, pop_cp_function_context): Call it. * class.c, cp-tree.h, decl.c, decl2.c, parse.y: Lose all references --- 1042,1153 ---- (pop_cp_function_context): Restore C_C_D. + Wed Jun 7 15:31:57 1995 Brendan Kehoe (brendan@lisa.cygnus.com) + + * init.c (build_vec_delete): Resolve an offset ref before we try to + use it. + + Wed Jun 7 14:19:32 1995 Jason Merrill + + * typeck.c (build_modify_expr): If the class lacks a constructor or + assignment operator, return error_mark_node. + (common_type): Use build_cplus_array_type. + + Tue Jun 6 09:41:27 1995 Mike Stump + + * class.c (dont_allow_type_definitions): New variable set when types + cannot be defined. + (finish_struct): Use it. + * cp-tree.h (dont_allow_type_definitions): Define it. + * parse.y (primary, handler_seq): Set it. + + Mon Jun 5 18:49:38 1995 Mike Stump + + * method.c (build_opfncall): Use DECL_CHAIN, not TREE_CHAIN for + results from lookup_fnfields. Always give warning/error on bad + code. + + Mon Jun 5 11:39:37 1995 Brendan Kehoe (brendan@lisa.cygnus.com) + + * init.c (member_init_ok_or_else): Don't allow initialization of + an ancestor's member from within a constructor. + + Mon Jun 5 11:20:34 1995 Gerald Baumgartner (gb@alexander.cs.purdue.edu) + + * sig.c (build_signature_table_constructor): Use DECL_CONTEXT + instead of DECL_CLASS_CONTEXT for calculating the vfield offset so + abstract virtual functions are handled correctly. + + * sig.c (build_signature_table_constructor): Store the correct + delta in signature table entries. It does not yet work for + classes with virtual base classes as implementations of signatures. + (build_signature_method_call): Add the delta to the object_ptr + before generating the function call. + + * call.c (build_method_call): Make instance_ptr the signature + pointer itself instead of dereferencing the optr. + * sig.c (build_signature_method_call): Dereference the optr for the + direct and virtual calls. + + * sig.c (build_signature_table_constructor): Make the tag for + default implementations -1 instead of 2. + (build_signature_method_call): Change the generated conditional + expression correspondingly. + + * sig.c (build_signature_pointer_constructor): Deleted the sorry + message that said we can't handle multiple inheritance for + implementations of signatures + (build_signature_method_call): Use the offset from the sigtable + entry instead of the vptr field from the signature pointer for + building a virtual function call. + + * class.c (build_vfn_ref): Deleted signature specific code, we don't + call this function anymore from build_signature_method_call. + + * cp-tree.h (SIGNATURE_VPTR_NAME): Deleted. We use the right vptr + field in the object now instead of in the signature pointer/ref. + (build_vptr_ref): Deleted extern declaration. + * sig.c (build_vptr_ref): Deleted. + (build_signature_pointer_or_reference_type): Deleted construction of + the vptr field. + (build_signature_pointer_constructor): Deleted initialization of/ + assignment to the vptr field. + + * sig.c (build_signature_table_constructor): Convert the signature + table entry fields to their correct types. + + * sig.c (build_signature_table_constructor): Don't call digest_init + for the fields of a sigtable entry, it's wasted time. + + * sig.c (build_signature_table_constructor): Correctly set the + offset and index fields of a sigtable entry. Build the constructor + the way digest_init does, digest_init can't handle initializing an + anonymous union inside a struct. + (build_signature_method_call): Use the index field instead of the + delta field to get the vtable index. + + * decl.c (init_decl_processing): Fix number of fields for building + sigtable_entry_type. + + * cp-tree.h (tag_identifier, offset_identifier): Added extern decls. + (SIGTABLE_CODE_NAME): Renamed to SIGTABLE_TAG_NAME. + (SIGTABLE_PFN_NAME): Deleted, we'll use VTABLE_PFN_NAME instead. + * decl.c (tag_identifier, offset_identifier): New variables to + hold the identifiers for the sigtable fields tag and offset. + (init_decl_processing): Initialize these variables. + (init_decl_processing): Use these variables to build the + sigtable_entry_type structure. Rename the code and offset fields + to tag and delta, respectively; add offset and index fields. Changed + types of fields from short_integer_type_node to delta_type_node. + * sig.c (build_signature_table_constructor): Rename code and offset + to tag and delta, respectively. + (build_signature_method_call): Ditto. Use above variables. + Fri Jun 2 11:05:58 1995 Jason Merrill ! * decl.c (set_C_C_D): New function. suspend_momentary before ! building C_C_D. ! (pop_from_top_level): Call it. ! (start_function): Ditto. ! (pop_cp_function_context): Ditto. * class.c, cp-tree.h, decl.c, decl2.c, parse.y: Lose all references *************** *** 40,47 **** current_vtable_decl, or C_C_D. ! on May 29 12:45:10 1995 Paul Eggert * Make-lang.in (c++.mostlyclean): Remove $(DEMANGLER_PROG). Wed May 24 15:55:18 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) --- 1162,1200 ---- current_vtable_decl, or C_C_D. ! Mon May 29 12:45:10 1995 Paul Eggert * Make-lang.in (c++.mostlyclean): Remove $(DEMANGLER_PROG). + Thu Jun 1 17:03:51 1995 Jason Merrill + + * decl.c (lookup_name_real): Don't try to look anything up in an + erroneous object. + + Fri Jun 2 10:30:14 1995 Mike Stump + + * method.c (build_overload_int): New routine. Break out + functionality from build_overload_value so we can reuse it. + (build_overload_value): Handle pointer to member functions as value + parameters for templates. + (build_overload_identifier): Since template parameters are shared + among all instantiations, we have to substitute in the real types + in TREE_TYPE (parm). + pt.c (coerce_template_parms): Ditto. + (push_template_decls): Ditto. + (grok_template_type): Deleted as template parameters are shared + among all instantiations. + + Wed May 31 19:10:32 1995 Mike Stump + + * decl.c (grokdeclarator): Always give errors on constant overflow + for array indices. + + Wed May 31 11:39:43 1995 Jason Merrill + + * typeck.c (commonparms): Don't abort if simple_cst_equal returns < 0. + (build_c_cast): Don't tack on a NON_LVALUE_EXPR when casting to + reference type. + (build_indirect_ref): Fix check for *&. + Wed May 24 15:55:18 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) *************** *** 106,117 **** * cvt.c (convert_to_reference): Only complain, if complaints are wanted. ! typeck.c (build_function_call_real): Ditto. If LOOKUP_SPECULATIVELY is set and something won't work, return NULL_TREE. ! cvt.c (cp_convert): Ditto. Pass flags down to build_method_call. (convert): Pass LOOKUP_NORMAL to cp_convert. ! typeck.c (convert_for_assignment): Ditto. (convert_force): Pass LOOKUP_COMPLAIN to cp_convert. ! typeck.c (convert_arguments): Get out early if we get an ! error_mark_node. (convert_for_initialization): Use cp_convert instead of convert so that we can pass flags down. --- 1259,1269 ---- * cvt.c (convert_to_reference): Only complain, if complaints are wanted. ! * typeck.c (build_function_call_real): Ditto. If LOOKUP_SPECULATIVELY is set and something won't work, return NULL_TREE. ! * cvt.c (cp_convert): Ditto. Pass flags down to build_method_call. (convert): Pass LOOKUP_NORMAL to cp_convert. ! * typeck.c (convert_for_assignment): Ditto. (convert_force): Pass LOOKUP_COMPLAIN to cp_convert. ! (convert_arguments): Get out early if we get an error_mark_node. (convert_for_initialization): Use cp_convert instead of convert so that we can pass flags down. *************** *** 201,205 **** * init.c (emit_base_init): Build up an RTL_EXPR and add it to ! rtl_expr_chain. * decl.c, decl2.c: s/base_init_insns/base_init_expr/. --- 1353,1357 ---- * init.c (emit_base_init): Build up an RTL_EXPR and add it to ! rtl_expr_chain. * decl.c, decl2.c: s/base_init_insns/base_init_expr/. *************** *** 307,311 **** * decl.c (grokdeclarator): Prohibit pointers to void or reference ! members. Thu Apr 27 09:49:07 1995 Mike Stump --- 1459,1463 ---- * decl.c (grokdeclarator): Prohibit pointers to void or reference ! members. Thu Apr 27 09:49:07 1995 Mike Stump *************** *** 803,807 **** * decl.c (start_function): Handle extern inlines more like C++ says ! we should. * init.c (build_member_call): Hand constructor calls off to --- 1955,1959 ---- * decl.c (start_function): Handle extern inlines more like C++ says ! we should. * init.c (build_member_call): Hand constructor calls off to *************** *** 1041,1045 **** * class.c (finish_struct): Set the vtable's size to NULL_TREE before ! calling layout_decl, so that it gets updated properly. Finally re-enable dynamic synthesis. This time it works. --- 2193,2197 ---- * class.c (finish_struct): Set the vtable's size to NULL_TREE before ! calling layout_decl, so that it gets updated properly. Finally re-enable dynamic synthesis. This time it works. *************** *** 1489,1493 **** * class.c (grow_method): Update method_vec after growing the class ! obstack. Wed Feb 15 13:42:59 1995 Mike Stump --- 2641,2645 ---- * class.c (grow_method): Update method_vec after growing the class ! obstack. Wed Feb 15 13:42:59 1995 Mike Stump *************** *** 1568,1572 **** * typeck.c (build_c_cast): Use non_lvalue to tack something on ! where necessary. * decl.c (auto_function): Now a function. --- 2720,2724 ---- * typeck.c (build_c_cast): Use non_lvalue to tack something on ! where necessary. * decl.c (auto_function): Now a function. *************** *** 1604,1608 **** considered lvalues. * cvt.c (convert_to_reference): Use real_lvalue_p instead of ! lvalue_p. * cvt.c (build_type_conversion_1): Don't call convert on aggregate --- 2756,2760 ---- considered lvalues. * cvt.c (convert_to_reference): Use real_lvalue_p instead of ! lvalue_p. * cvt.c (build_type_conversion_1): Don't call convert on aggregate *************** *** 1750,1754 **** * decl.c (grok_reference_init): Convert initializer from ! reference. * typeck.c (convert_for_initialization): Ditto. --- 2902,2906 ---- * decl.c (grok_reference_init): Convert initializer from ! reference. * typeck.c (convert_for_initialization): Ditto. *************** *** 1938,1942 **** * call.c (build_method_call): Don't mess with 'this' before calling ! compute_conversion_costs. Wed Jan 18 15:40:55 1995 Jason Merrill --- 3090,3094 ---- * call.c (build_method_call): Don't mess with 'this' before calling ! compute_conversion_costs. Wed Jan 18 15:40:55 1995 Jason Merrill *************** *** 1943,1947 **** * search.c (get_matching_virtual): Give line number for previous ! declaration. * call.c (convert_harshness): Handle conversions to references --- 3095,3099 ---- * search.c (get_matching_virtual): Give line number for previous ! declaration. * call.c (convert_harshness): Handle conversions to references *************** *** 1972,1977 **** Wed Jan 17 18:20:57 1994 Fergus Henderson ! * cp-tree.h : Make if (x=0) warn with wall ! * parse.y : Make if (x=0) warn with wall Tue Jan 17 14:12:00 1995 Jason Merrill --- 3124,3129 ---- Wed Jan 17 18:20:57 1994 Fergus Henderson ! * cp-tree.h : Make if (x=0) warn with wall ! * parse.y : Make if (x=0) warn with wall Tue Jan 17 14:12:00 1995 Jason Merrill *************** *** 1984,1988 **** * cvt.c (cp_convert): Just call truthvalue_conversion to convert to ! bool. Mon Jan 16 13:28:48 1995 Jason Merrill --- 3136,3140 ---- * cvt.c (cp_convert): Just call truthvalue_conversion to convert to ! bool. Mon Jan 16 13:28:48 1995 Jason Merrill *************** *** 2147,2151 **** * parse.y (primary): Unset got_object after all rules that use the ! 'object' nonterminal. (object): Set got_object. --- 3299,3303 ---- * parse.y (primary): Unset got_object after all rules that use the ! 'object' nonterminal. (object): Set got_object. *************** *** 2219,2223 **** * decl.c (pushdecl): Don't install an artificial TYPE_DECL in ! IDENTIFIER_LOCAL_VALUE if we already have a decl with that name. * typeck.c (convert_for_assignment): Converting pointers to bool --- 3371,3375 ---- * decl.c (pushdecl): Don't install an artificial TYPE_DECL in ! IDENTIFIER_LOCAL_VALUE if we already have a decl with that name. * typeck.c (convert_for_assignment): Converting pointers to bool *************** *** 2249,2253 **** * class.c (finish_struct_methods): Still set ! TYPE_HAS_{INT,REAL}_CONVERSION. * call.c (can_convert): Don't use aggregate initialization. --- 3401,3405 ---- * class.c (finish_struct_methods): Still set ! TYPE_HAS_{INT,REAL}_CONVERSION. * call.c (can_convert): Don't use aggregate initialization. *************** *** 2284,2288 **** (finish_struct_methods): Use it. Put all type conversion operators right after the constructors. Perhaps we should sort the methods ! alphabetically? Mon Jan 2 14:42:58 1995 Jason Merrill --- 3436,3440 ---- (finish_struct_methods): Use it. Put all type conversion operators right after the constructors. Perhaps we should sort the methods ! alphabetically? Mon Jan 2 14:42:58 1995 Jason Merrill *************** *** 2554,2558 **** * gc.c (build_dynamic_cast): Change interface to libg++, ensure that ! the return type is the right type, and make references work. Fri Dec 2 16:36:43 1994 Jason Merrill --- 3706,3710 ---- * gc.c (build_dynamic_cast): Change interface to libg++, ensure that ! the return type is the right type, and make references work. Fri Dec 2 16:36:43 1994 Jason Merrill diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/Make-lang.in gcc-2.7.1/cp/Make-lang.in *** gcc-2.7.0/cp/Make-lang.in Fri Jun 16 15:09:57 1995 --- gcc-2.7.1/cp/Make-lang.in Tue Sep 12 17:15:52 1995 *************** *** 95,99 **** cc1plus: $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o c-pragma.o ! cd cp; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) ../cc1plus$(exeext) # Build hooks: --- 95,99 ---- cc1plus: $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o c-pragma.o ! cd cp; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) ../cc1plus # Build hooks: diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/Makefile.in gcc-2.7.1/cp/Makefile.in *** gcc-2.7.0/cp/Makefile.in Thu Jun 15 17:05:59 1995 --- gcc-2.7.1/cp/Makefile.in Mon Aug 28 06:28:34 1995 *************** *** 197,201 **** `echo $(PARSE_C) | sed 's,^\./,,'` ! CONFLICTS = expect 5 shift/reduce confict and 38 reduce/reduce conflicts. $(PARSE_H) : $(PARSE_C) $(PARSE_C) : $(srcdir)/parse.y --- 197,201 ---- `echo $(PARSE_C) | sed 's,^\./,,'` ! CONFLICTS = expect 5 shift/reduce conflicts and 38 reduce/reduce conflicts. $(PARSE_H) : $(PARSE_C) $(PARSE_C) : $(srcdir)/parse.y diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/call.c gcc-2.7.1/cp/call.c *** gcc-2.7.0/cp/call.c Thu Jun 15 08:15:36 1995 --- gcc-2.7.1/cp/call.c Fri Nov 3 17:56:39 1995 *************** *** 1,4 **** /* Functions related to invoking methods and overloaded functions. ! Copyright (C) 1987, 1992, 1993 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) and hacked by Brendan Kehoe (brendan@cygnus.com). --- 1,4 ---- /* Functions related to invoking methods and overloaded functions. ! Copyright (C) 1987, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) and hacked by Brendan Kehoe (brendan@cygnus.com). *************** *** 157,160 **** --- 157,214 ---- return EVIL_RETURN (h); + if (codel == REFERENCE_TYPE) + { + tree ttl, ttr; + int constp = parm ? TREE_READONLY (parm) : TYPE_READONLY (parmtype); + int volatilep = (parm ? TREE_THIS_VOLATILE (parm) + : TYPE_VOLATILE (parmtype)); + register tree intype = TYPE_MAIN_VARIANT (parmtype); + register enum tree_code form = TREE_CODE (intype); + int penalty = 0; + + ttl = TREE_TYPE (type); + + /* Only allow const reference binding if we were given a parm to deal + with, since it isn't really a conversion. This is a hack to + prevent build_type_conversion from finding this conversion, but + still allow overloading to find it. */ + if (! lvalue && ! (parm && TYPE_READONLY (ttl))) + return EVIL_RETURN (h); + + if (TYPE_READONLY (ttl) < constp + || TYPE_VOLATILE (ttl) < volatilep) + return EVIL_RETURN (h); + + /* When passing a non-const argument into a const reference, dig it a + little, so a non-const reference is preferred over this one. */ + penalty = ((TYPE_READONLY (ttl) > constp) + + (TYPE_VOLATILE (ttl) > volatilep)); + + ttl = TYPE_MAIN_VARIANT (ttl); + + if (form == OFFSET_TYPE) + { + intype = TREE_TYPE (intype); + form = TREE_CODE (intype); + } + + ttr = intype; + + if (TREE_CODE (ttl) == ARRAY_TYPE && TREE_CODE (ttr) == ARRAY_TYPE) + { + if (comptypes (ttl, ttr, 1)) + return ZERO_RETURN (h); + return EVIL_RETURN (h); + } + + h = convert_harshness (ttl, ttr, NULL_TREE); + if (penalty && h.code == 0) + { + h.code = QUAL_CODE; + h.int_penalty = penalty; + } + return h; + } + if (codel == POINTER_TYPE && fntype_p (parmtype)) { *************** *** 199,203 **** /* We allow the default conversion between function type and pointer-to-function type for free. */ ! if (type == parmtype) return h; --- 253,257 ---- /* We allow the default conversion between function type and pointer-to-function type for free. */ ! if (comptypes (type, parmtype, 1)) return h; *************** *** 422,429 **** /* Convert arrays which have not previously been converted. */ if (codel == ARRAY_TYPE) codel = POINTER_TYPE; if (coder == ARRAY_TYPE) ! coder = POINTER_TYPE; /* Conversions among pointers */ --- 476,494 ---- /* Convert arrays which have not previously been converted. */ + #if 0 if (codel == ARRAY_TYPE) codel = POINTER_TYPE; + #endif if (coder == ARRAY_TYPE) ! { ! coder = POINTER_TYPE; ! if (parm) ! { ! parm = decay_conversion (parm); ! parmtype = TREE_TYPE (parm); ! } ! else ! parmtype = build_pointer_type (TREE_TYPE (parmtype)); ! } /* Conversions among pointers */ *************** *** 463,467 **** penalty = 10; } ! if (comp_target_types (ttl, ttr, 0) <= 0) return EVIL_RETURN (h); } --- 528,532 ---- penalty = 10; } ! if (comp_target_types (type, parmtype, 1) <= 0) return EVIL_RETURN (h); } *************** *** 524,528 **** --- 589,603 ---- return h; } + h.code = penalty ? STD_CODE : PROMO_CODE; + /* Catch things like `const char *' -> `const void *' + vs `const char *' -> `void *'. */ + if (ttl != ttr) + { + tree tmp1 = TREE_TYPE (type), tmp2 = TREE_TYPE (parmtype); + if ((TYPE_READONLY (tmp1) != TREE_READONLY (tmp2)) + || (TYPE_VOLATILE (tmp1) != TYPE_VOLATILE (tmp2))) + h.code |= QUAL_CODE; + } return h; } *************** *** 550,601 **** return ZERO_RETURN (h); - if (codel == REFERENCE_TYPE) - { - tree ttl, ttr; - int constp = parm ? TREE_READONLY (parm) : TYPE_READONLY (parmtype); - int volatilep = (parm ? TREE_THIS_VOLATILE (parm) - : TYPE_VOLATILE (parmtype)); - register tree intype = TYPE_MAIN_VARIANT (parmtype); - register enum tree_code form = TREE_CODE (intype); - int penalty = 0; - - ttl = TREE_TYPE (type); - - /* Only allow const reference binding if we were given a parm to deal - with, since it isn't really a conversion. This is a hack to - prevent build_type_conversion from finding this conversion, but - still allow overloading to find it. */ - if (! lvalue && ! (parm && TYPE_READONLY (ttl))) - return EVIL_RETURN (h); - - if (TYPE_READONLY (ttl) < constp - || TYPE_VOLATILE (ttl) < volatilep) - return EVIL_RETURN (h); - - /* When passing a non-const argument into a const reference, dig it a - little, so a non-const reference is preferred over this one. */ - penalty = ((TYPE_READONLY (ttl) > constp) - + (TYPE_VOLATILE (ttl) > volatilep)); - - ttl = TYPE_MAIN_VARIANT (ttl); - - if (form == OFFSET_TYPE) - { - intype = TREE_TYPE (intype); - form = TREE_CODE (intype); - } - - ttr = intype; - - /* Maybe handle conversion to base here? */ - - h = convert_harshness (ttl, ttr, NULL_TREE); - if (penalty && h.code == 0) - { - h.code = QUAL_CODE; - h.int_penalty = penalty; - } - return h; - } if (codel == RECORD_TYPE && coder == RECORD_TYPE) { --- 625,628 ---- *************** *** 616,619 **** --- 643,649 ---- } + /* A clone of build_type_conversion for checking user-defined conversions in + overload resolution. */ + int user_harshness (type, parmtype, parm) *************** *** 639,643 **** if (tmp = convert_harshness (type, TREE_VALUE (conv), NULL_TREE), ! tmp.code < USER_CODE) { if (winner) --- 669,673 ---- if (tmp = convert_harshness (type, TREE_VALUE (conv), NULL_TREE), ! tmp.code < USER_CODE && tmp.distance >= 0) { if (winner) *************** *** 663,667 **** struct harshness_code h; h = convert_harshness (to, from, NULL_TREE); ! return h.code < USER_CODE; } --- 693,697 ---- struct harshness_code h; h = convert_harshness (to, from, NULL_TREE); ! return h.code < USER_CODE && h.distance >= 0; } *************** *** 672,676 **** struct harshness_code h; h = convert_harshness (to, from, arg); ! return h.code < USER_CODE; } --- 702,706 ---- struct harshness_code h; h = convert_harshness (to, from, arg); ! return h.code < USER_CODE && h.distance >= 0; } *************** *** 1757,1761 **** basetype = SIGNATURE_TYPE (basetype); instance_ptr = build_optr_ref (instance); ! instance_ptr = convert (TYPE_POINTER_TO (basetype), instance_ptr); basetype_path = TYPE_BINFO (basetype); } --- 1787,1791 ---- basetype = SIGNATURE_TYPE (basetype); instance_ptr = build_optr_ref (instance); ! instance_ptr = convert (build_pointer_type (basetype), instance_ptr); basetype_path = TYPE_BINFO (basetype); } *************** *** 1779,1783 **** if (!(flags & LOOKUP_NONVIRTUAL) && TYPE_VIRTUAL_P (basetype)) need_vtbl = maybe_needed; ! instance_ptr = build1 (ADDR_EXPR, TYPE_POINTER_TO (basetype), instance); } else --- 1809,1813 ---- if (!(flags & LOOKUP_NONVIRTUAL) && TYPE_VIRTUAL_P (basetype)) need_vtbl = maybe_needed; ! instance_ptr = build1 (ADDR_EXPR, build_pointer_type (basetype), instance); } else *************** *** 1825,1829 **** if ((IS_SIGNATURE (basetype) ! && (instance_ptr = build_optr_ref (instance))) || (lvalue_p (instance) && (instance_ptr = build_unary_op (ADDR_EXPR, instance, 0))) --- 1855,1859 ---- if ((IS_SIGNATURE (basetype) ! && (instance_ptr = instance)) || (lvalue_p (instance) && (instance_ptr = build_unary_op (ADDR_EXPR, instance, 0))) *************** *** 1866,1870 **** } /* @@ Should we call comp_target_types here? */ ! inst_ptr_basetype = TREE_TYPE (TREE_TYPE (instance_ptr)); if (TYPE_MAIN_VARIANT (basetype) == TYPE_MAIN_VARIANT (inst_ptr_basetype)) basetype = inst_ptr_basetype; --- 1896,1903 ---- } /* @@ Should we call comp_target_types here? */ ! if (IS_SIGNATURE (basetype)) ! inst_ptr_basetype = basetype; ! else ! inst_ptr_basetype = TREE_TYPE (TREE_TYPE (instance_ptr)); if (TYPE_MAIN_VARIANT (basetype) == TYPE_MAIN_VARIANT (inst_ptr_basetype)) basetype = inst_ptr_basetype; *************** *** 1871,1875 **** else { ! instance_ptr = convert (TYPE_POINTER_TO (basetype), instance_ptr); if (instance_ptr == error_mark_node) return error_mark_node; --- 1904,1908 ---- else { ! instance_ptr = convert (build_pointer_type (basetype), instance_ptr); if (instance_ptr == error_mark_node) return error_mark_node; *************** *** 1961,1966 **** } ! if (instance) { /* TREE_READONLY (instance) fails for references. */ constp = TYPE_READONLY (TREE_TYPE (TREE_TYPE (instance_ptr))); --- 1994,2007 ---- } ! if (instance && IS_SIGNATURE (basetype)) { + /* @@ Should this be the constp/volatilep flags for the optr field + of the signature pointer? */ + constp = TYPE_READONLY (basetype); + volatilep = TYPE_VOLATILE (basetype); + parms = tree_cons (NULL_TREE, instance_ptr, parms); + } + else if (instance) + { /* TREE_READONLY (instance) fails for references. */ constp = TYPE_READONLY (TREE_TYPE (TREE_TYPE (instance_ptr))); *************** *** 1979,2016 **** } ! if (flag_this_is_variable > 0) ! { ! constp = 0; ! volatilep = 0; ! instance_ptr = build_int_2 (0, 0); ! TREE_TYPE (instance_ptr) = TYPE_POINTER_TO (basetype); ! parms = tree_cons (NULL_TREE, instance_ptr, parms); ! } ! else ! { ! constp = 0; ! volatilep = 0; ! instance_ptr = build_new (NULL_TREE, basetype, void_type_node, 0); ! if (instance_ptr == error_mark_node) ! return error_mark_node; ! instance_ptr = save_expr (instance_ptr); ! TREE_CALLS_NEW (instance_ptr) = 1; ! instance = build_indirect_ref (instance_ptr, NULL_PTR); ! ! #if 0 ! /* This breaks initialization of a reference from a new ! expression of a different type. And it doesn't appear to ! serve its original purpose any more, either. jason 10/12/94 */ ! /* If it's a default argument initialized from a ctor, what we get ! from instance_ptr will match the arglist for the FUNCTION_DECL ! of the constructor. */ ! if (parms && TREE_CODE (TREE_VALUE (parms)) == CALL_EXPR ! && TREE_OPERAND (TREE_VALUE (parms), 1) ! && TREE_CALLS_NEW (TREE_VALUE (TREE_OPERAND (TREE_VALUE (parms), 1)))) ! parms = build_tree_list (NULL_TREE, instance_ptr); ! else ! #endif ! parms = tree_cons (NULL_TREE, instance_ptr, parms); ! } } --- 2020,2028 ---- } ! constp = 0; ! volatilep = 0; ! instance_ptr = build_int_2 (0, 0); ! TREE_TYPE (instance_ptr) = build_pointer_type (basetype); ! parms = tree_cons (NULL_TREE, instance_ptr, parms); } *************** *** 2365,2371 **** { TREE_CHAIN (last) = void_list_node; ! cp_error ("no matching function for call to `%T::%D (%A)'", ! TREE_TYPE (TREE_TYPE (instance_ptr)), ! name, TREE_CHAIN (parmtypes)); TREE_CHAIN (last) = NULL_TREE; print_candidates (found_fns); --- 2377,2384 ---- { TREE_CHAIN (last) = void_list_node; ! cp_error ("no matching function for call to `%T::%D (%A)%V'", ! TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (instance_ptr))), ! name, TREE_CHAIN (parmtypes), ! TREE_TYPE (TREE_TYPE (instance_ptr))); TREE_CHAIN (last) = NULL_TREE; print_candidates (found_fns); *************** *** 2466,2470 **** if (pedantic && DECL_THIS_INLINE (function) && ! DECL_ARTIFICIAL (function) && ! DECL_INITIAL (function) && ! DECL_PENDING_INLINE_INFO (function)) ! cp_pedwarn ("inline function `%#D' called before definition", function); fntype = TREE_TYPE (function); --- 2479,2483 ---- if (pedantic && DECL_THIS_INLINE (function) && ! DECL_ARTIFICIAL (function) && ! DECL_INITIAL (function) && ! DECL_PENDING_INLINE_INFO (function)) ! cp_warning ("inline function `%#D' called before definition", function); fntype = TREE_TYPE (function); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/class.c gcc-2.7.1/cp/class.c *** gcc-2.7.0/cp/class.c Thu Jun 15 08:16:07 1995 --- gcc-2.7.1/cp/class.c Wed Oct 11 22:27:46 1995 *************** *** 92,95 **** --- 92,97 ---- tree current_lang_name; + char *dont_allow_type_definitions; + /* When layout out an aggregate type, the size of the basetypes (virtual and non-virtual) is passed to layout_record *************** *** 187,190 **** --- 189,195 ---- tree offset = integer_zero_node; + if (nonnull == 0 && (alias_this && flag_this_is_variable <= 0)) + nonnull = 1; + /* We need additional logic to convert back to the unconverted type (the static type of the complete object), and then convert back *************** *** 243,248 **** && null_expr == NULL_TREE) { ! null_expr = build1 (NOP_EXPR, TYPE_POINTER_TO (last_virtual), integer_zero_node); ! expr = build (COND_EXPR, TYPE_POINTER_TO (last_virtual), build (EQ_EXPR, boolean_type_node, expr, integer_zero_node), --- 248,253 ---- && null_expr == NULL_TREE) { ! null_expr = build1 (NOP_EXPR, build_pointer_type (last_virtual), integer_zero_node); ! expr = build (COND_EXPR, build_pointer_type (last_virtual), build (EQ_EXPR, boolean_type_node, expr, integer_zero_node), *************** *** 285,294 **** { tree intype = TREE_TYPE (TREE_TYPE (expr)); ! if (TYPE_MAIN_VARIANT (intype) == BINFO_TYPE (last)) ! basetype = intype; ! else { tree binfo = get_binfo (last, TYPE_MAIN_VARIANT (intype), 0); - basetype = last; offset = BINFO_OFFSET (binfo); } --- 290,296 ---- { tree intype = TREE_TYPE (TREE_TYPE (expr)); ! if (TYPE_MAIN_VARIANT (intype) != BINFO_TYPE (last)) { tree binfo = get_binfo (last, TYPE_MAIN_VARIANT (intype), 0); offset = BINFO_OFFSET (binfo); } *************** *** 318,322 **** it will be zero, or initialized to some valid value to which we may add. */ ! if (nonnull == 0 && (alias_this == 0 || flag_this_is_variable > 0)) { if (null_expr) --- 320,324 ---- it will be zero, or initialized to some valid value to which we may add. */ ! if (nonnull == 0) { if (null_expr) *************** *** 467,472 **** if (IS_AGGR_TYPE (TREE_TYPE (instance)) - && !IS_SIGNATURE_POINTER (TREE_TYPE (instance)) - && !IS_SIGNATURE_REFERENCE (TREE_TYPE (instance)) && (TREE_CODE (instance) == RESULT_DECL || TREE_CODE (instance) == PARM_DECL --- 469,472 ---- *************** *** 642,645 **** --- 642,675 ---- } + /* Update the rtti info for this class. */ + static void + set_rtti_entry (virtuals, offset, type) + tree virtuals, offset, type; + { + if (! flag_vtable_thunks) + TREE_VALUE (virtuals) + = build_vtable_entry (offset, + (flag_rtti + ? build_t_desc (type, 0) + : integer_zero_node)); + else + { + tree vfn = build1 (NOP_EXPR, vfunc_ptr_type_node, offset); + TREE_CONSTANT (vfn) = 1; + + TREE_VALUE (virtuals) + = build_vtable_entry (integer_zero_node, vfn); + /* The second slot is for the tdesc pointer when thunks are used. */ + vfn = flag_rtti + ? build_t_desc (type, 0) + : integer_zero_node; + vfn = build1 (NOP_EXPR, vfunc_ptr_type_node, vfn); + TREE_CONSTANT (vfn) = 1; + + TREE_VALUE (TREE_CHAIN (virtuals)) + = build_vtable_entry (integer_zero_node, vfn); + } + } + /* Give TYPE a new virtual function table which is initialized with a skeleton-copy of its original initialization. The only *************** *** 685,693 **** offset = BINFO_OFFSET (binfo); ! /* Install the value for `headof' if that's what we're doing. */ ! if (flag_rtti) ! TREE_VALUE (BINFO_VIRTUALS (binfo)) ! = build_vtable_entry (size_binop (MINUS_EXPR, integer_zero_node, offset), ! build_t_desc (for_type, 0)); #ifdef GATHER_STATISTICS --- 715,721 ---- offset = BINFO_OFFSET (binfo); ! set_rtti_entry (BINFO_VIRTUALS (binfo), ! size_binop (MINUS_EXPR, integer_zero_node, offset), ! for_type); #ifdef GATHER_STATISTICS *************** *** 714,718 **** tree virtuals, base_fndecl; { ! unsigned HOST_WIDE_INT i = (HOST_BITS_PER_WIDE_INT >= BITS_PER_WORD ? (TREE_INT_CST_LOW (DECL_VINDEX (base_fndecl)) & (((unsigned HOST_WIDE_INT)1<<(BITS_PER_WORD-1))-1)) --- 742,746 ---- tree virtuals, base_fndecl; { ! unsigned HOST_WIDE_INT n = (HOST_BITS_PER_WIDE_INT >= BITS_PER_WORD ? (TREE_INT_CST_LOW (DECL_VINDEX (base_fndecl)) & (((unsigned HOST_WIDE_INT)1<<(BITS_PER_WORD-1))-1)) *************** *** 720,730 **** #ifdef GATHER_STATISTICS ! n_vtable_searches += i; #endif ! while (i > 0 && virtuals) { virtuals = TREE_CHAIN (virtuals); - i -= 1; } return virtuals; --- 748,758 ---- #ifdef GATHER_STATISTICS ! n_vtable_searches += n; #endif ! while (n > 0 && virtuals) { + --n; virtuals = TREE_CHAIN (virtuals); } return virtuals; *************** *** 760,771 **** function table's initializer. */ static tree ! get_vtable_entry_n (virtuals, i) tree virtuals; ! unsigned HOST_WIDE_INT i; { ! while (i > 0) { virtuals = TREE_CHAIN (virtuals); - i -= 1; } return virtuals; --- 788,799 ---- function table's initializer. */ static tree ! get_vtable_entry_n (virtuals, n) tree virtuals; ! unsigned HOST_WIDE_INT n; { ! while (n > 0) { + --n; virtuals = TREE_CHAIN (virtuals); } return virtuals; *************** *** 812,820 **** /* CLASSTYPE_RTTI is only used as a Boolean (NULL or not). */ CLASSTYPE_RTTI (t) = integer_one_node; - #if 0 - *has_virtual = 1; - #endif } /* Build a new INT_CST for this DECL_VINDEX. */ { --- 840,852 ---- /* CLASSTYPE_RTTI is only used as a Boolean (NULL or not). */ CLASSTYPE_RTTI (t) = integer_one_node; } + /* If we are using thunks, use two slots at the front, one + for the offset pointer, one for the tdesc pointer. */ + if (*has_virtual == 0 && flag_vtable_thunks) + { + *has_virtual = 1; + } + /* Build a new INT_CST for this DECL_VINDEX. */ { *************** *** 821,824 **** --- 853,857 ---- static tree index_table[256]; tree index; + /* We skip a slot for the offset/tdesc entry. */ int i = ++(*has_virtual); *************** *** 2226,2229 **** --- 2259,2286 ---- } + /* Skip RTTI information at the front of the virtual list. */ + unsigned HOST_WIDE_INT + skip_rtti_stuff (virtuals) + tree *virtuals; + { + int n; + + n = 0; + if (*virtuals) + { + /* We always reserve a slot for the offset/tdesc entry. */ + ++n; + *virtuals = TREE_CHAIN (*virtuals); + } + if (flag_vtable_thunks && *virtuals) + { + /* The second slot is reserved for the tdesc pointer when thunks + are used. */ + ++n; + *virtuals = TREE_CHAIN (*virtuals); + } + return n; + } + static void modify_one_vtable (binfo, t, fndecl, pfn) *************** *** 2248,2257 **** } } ! if (fndecl == NULL_TREE) return; - /* Skip RTTI fake object. */ - n = 1; - if (virtuals) - virtuals = TREE_CHAIN (virtuals); while (virtuals) { --- 2305,2313 ---- } } ! if (fndecl == NULL_TREE) ! return; ! ! n = skip_rtti_stuff (&virtuals); while (virtuals) { *************** *** 2347,2354 **** unsigned HOST_WIDE_INT n; ! /* Skip RTTI fake object. */ ! n = 1; ! if (virtuals) ! virtuals = TREE_CHAIN (virtuals); while (virtuals) { --- 2403,2408 ---- unsigned HOST_WIDE_INT n; ! n = skip_rtti_stuff (&virtuals); ! while (virtuals) { *************** *** 2518,2524 **** choose = NEITHER; ! /* Skip RTTI fake object. */ ! virtuals = TREE_CHAIN (virtuals); ! old_virtuals = TREE_CHAIN (old_virtuals); while (virtuals) --- 2572,2577 ---- choose = NEITHER; ! skip_rtti_stuff (&virtuals); ! skip_rtti_stuff (&old_virtuals); while (virtuals) *************** *** 2641,2644 **** --- 2694,2699 ---- } + extern int interface_only, interface_unknown; + /* Create a RECORD_TYPE or UNION_TYPE node for a C struct or union declaration (or C++ class declaration). *************** *** 2701,2720 **** tree ! finish_struct (t, list_of_fieldlists, warn_anon) tree t; - tree list_of_fieldlists; int warn_anon; { - extern int interface_only, interface_unknown; - int old; int round_up_size = 1; enum tree_code code = TREE_CODE (t); ! register tree x, last_x, method_vec; int needs_virtual_dtor; - tree name = TYPE_NAME (t), fields, fn_fields, *tail; - tree *tail_user_methods = &CLASSTYPE_METHODS (t); - enum access_type access; int all_virtual; int has_virtual; --- 2756,2772 ---- tree ! finish_struct_1 (t, warn_anon) tree t; int warn_anon; { int old; int round_up_size = 1; + tree name = TYPE_IDENTIFIER (t); enum tree_code code = TREE_CODE (t); ! tree fields = TYPE_FIELDS (t); ! tree fn_fields = CLASSTYPE_METHODS (t); ! tree x, last_x, method_vec; int needs_virtual_dtor; int all_virtual; int has_virtual; *************** *** 2741,2775 **** tree t_binfo = TYPE_BINFO (t); tree access_decls = NULL_TREE; ! ! 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; ! CLASSTYPE_SOURCE_LINE (t) = lineno; ! } ! name = DECL_NAME (name); ! } ! if (warn_anon && code != UNION_TYPE && ANON_AGGRNAME_P (name)) pedwarn ("anonymous class type not used to declare any objects"); --- 2793,2799 ---- tree t_binfo = TYPE_BINFO (t); tree access_decls = NULL_TREE; ! int aggregate = 1; ! if (warn_anon && code != UNION_TYPE && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))) pedwarn ("anonymous class type not used to declare any objects"); *************** *** 2784,2790 **** } ! /* Append the fields we need for constructing signature tables. */ ! if (IS_SIGNATURE (t)) ! append_signature_fields (list_of_fieldlists); GNU_xref_decl (current_function_decl, t); --- 2808,2816 ---- } ! if (dont_allow_type_definitions) ! { ! pedwarn ("types cannot be defined %s", ! dont_allow_type_definitions); ! } GNU_xref_decl (current_function_decl, t); *************** *** 2833,2838 **** /* If using multiple inheritance, this may cause variants of our basetypes to be used (instead of their canonical forms). */ ! fields = layout_basetypes (t, BINFO_BASETYPES (t_binfo)); ! last_x = tree_last (fields); first_vfn_base_index = finish_base_struct (t, &base_info, t_binfo); --- 2859,2865 ---- /* If using multiple inheritance, this may cause variants of our basetypes to be used (instead of their canonical forms). */ ! tree vf = layout_basetypes (t, BINFO_BASETYPES (t_binfo)); ! last_x = tree_last (vf); ! fields = chainon (vf, fields); first_vfn_base_index = finish_base_struct (t, &base_info, t_binfo); *************** *** 2851,2854 **** --- 2878,2882 ---- needs_virtual_dtor = base_info.needs_virtual_dtor; n_baseclasses = TREE_VEC_LENGTH (BINFO_BASETYPES (t_binfo)); + aggregate = 0; } else *************** *** 2859,2863 **** vfield = NULL_TREE; vfields = NULL_TREE; - fields = NULL_TREE; last_x = NULL_TREE; cant_have_default_ctor = 0; --- 2887,2890 ---- *************** *** 2887,2894 **** CLASSTYPE_VFIELD (t) = vfield; - tail = &fn_fields; - if (last_x && list_of_fieldlists) - TREE_CHAIN (last_x) = TREE_VALUE (list_of_fieldlists); - if (IS_SIGNATURE (t)) all_virtual = 0; --- 2914,2917 ---- *************** *** 2898,3319 **** all_virtual = 0; ! /* For signatures, we made all methods `public' in the parser and ! reported an error if a access specifier was used. */ ! if (CLASSTYPE_DECLARED_CLASS (t) == 0) { ! nonprivate_method = 1; ! if (list_of_fieldlists ! && TREE_PURPOSE (list_of_fieldlists) == (tree)access_default) ! TREE_PURPOSE (list_of_fieldlists) = (tree)access_public; ! } ! else if (list_of_fieldlists ! && TREE_PURPOSE (list_of_fieldlists) == (tree)access_default) ! TREE_PURPOSE (list_of_fieldlists) = (tree)access_private; ! while (list_of_fieldlists) ! { ! access = (enum access_type)TREE_PURPOSE (list_of_fieldlists); ! for (x = TREE_VALUE (list_of_fieldlists); x; x = TREE_CHAIN (x)) ! { ! TREE_PRIVATE (x) = access == access_private; ! TREE_PROTECTED (x) = access == access_protected; ! GNU_xref_member (current_class_name, x); ! if (TREE_CODE (x) == TYPE_DECL) ! { ! /* Make sure we set this up. In find_scoped_type, it explicitly ! looks for a TYPE_DECL in the TYPE_FIELDS list. If we don't ! do this here, we'll miss including this TYPE_DECL in the ! list. */ ! if (! fields) ! fields = x; ! last_x = x; ! continue; ! } ! /* Check for inconsistent use of this name in the class body. ! Enums, types and static vars have already been checked. */ ! if (TREE_CODE (x) != CONST_DECL && TREE_CODE (x) != VAR_DECL) ! { ! tree name = DECL_NAME (x); ! tree icv; ! /* Don't get confused by access decls. */ ! if (name && TREE_CODE (name) == IDENTIFIER_NODE) ! icv = IDENTIFIER_CLASS_VALUE (name); ! else ! icv = NULL_TREE; ! if (icv ! /* Don't complain about constructors. */ ! && name != constructor_name (current_class_type) ! /* Or inherited names. */ ! && id_in_current_class (name) ! /* Or shadowed tags. */ ! && !(TREE_CODE (icv) == TYPE_DECL ! && DECL_CONTEXT (icv) == t)) ! { ! cp_error_at ("declaration of identifier `%D' as `%+#D'", ! name, x); ! cp_error_at ("conflicts with other use in class as `%#D'", ! icv); ! } ! } ! if (TREE_CODE (x) == FUNCTION_DECL) ! { ! nonprivate_method |= ! TREE_PRIVATE (x); ! /* If this was an evil function, don't keep it in class. */ ! if (IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (x))) ! continue; ! if (last_x) ! TREE_CHAIN (last_x) = TREE_CHAIN (x); ! /* Link x onto end of fn_fields and CLASSTYPE_METHODS. */ ! *tail = x; ! tail = &TREE_CHAIN (x); ! *tail_user_methods = x; ! tail_user_methods = &DECL_NEXT_METHOD (x); ! DECL_CLASS_CONTEXT (x) = t; ! /* Do both of these, even though they're in the same union; ! if the insn `r' member and the size `i' member are ! different sizes, as on the alpha, the larger of the two ! will end up with garbage in it. */ ! DECL_SAVED_INSNS (x) = NULL_RTX; ! DECL_FIELD_SIZE (x) = 0; ! ! /* The name of the field is the original field name ! Save this in auxiliary field for later overloading. */ ! if (DECL_VINDEX (x) ! || (all_virtual == 1 && ! DECL_CONSTRUCTOR_P (x))) ! { ! pending_virtuals = add_virtual_function (pending_virtuals, ! &has_virtual, x, t); ! if (DECL_ABSTRACT_VIRTUAL_P (x)) ! abstract_virtuals = tree_cons (NULL_TREE, x, abstract_virtuals); ! } ! continue; ! } ! /* Handle access declarations. */ ! if (DECL_NAME (x) && TREE_CODE (DECL_NAME (x)) == SCOPE_REF) ! { ! tree fdecl = TREE_OPERAND (DECL_NAME (x), 1); ! if (last_x) ! TREE_CHAIN (last_x) = TREE_CHAIN (x); ! access_decls = tree_cons ((tree) access, fdecl, access_decls); ! continue; ! } ! /* If we've gotten this far, it's a data member, possibly static, ! or an enumerator. */ ! DECL_FIELD_CONTEXT (x) = t; ! /* ``A local class cannot have static data members.'' ARM 9.4 */ ! if (current_function_decl && TREE_STATIC (x)) ! cp_error_at ("field `%D' in local class cannot be static", x); ! /* Perform error checking that did not get done in ! grokdeclarator. */ ! if (TREE_CODE (TREE_TYPE (x)) == FUNCTION_TYPE) ! { ! cp_error_at ("field `%D' invalidly declared function type", ! x); ! TREE_TYPE (x) = build_pointer_type (TREE_TYPE (x)); ! } ! else if (TREE_CODE (TREE_TYPE (x)) == METHOD_TYPE) ! { ! cp_error_at ("field `%D' invalidly declared method type", x); ! TREE_TYPE (x) = build_pointer_type (TREE_TYPE (x)); ! } ! else if (TREE_CODE (TREE_TYPE (x)) == OFFSET_TYPE) ! { ! cp_error_at ("field `%D' invalidly declared offset type", x); ! TREE_TYPE (x) = build_pointer_type (TREE_TYPE (x)); ! } ! if (DECL_NAME (x) == constructor_name (t)) ! cant_have_default_ctor = cant_synth_copy_ctor = 1; ! if (TREE_TYPE (x) == error_mark_node) ! continue; ! ! if (! fields) ! fields = x; ! last_x = x; ! DECL_SAVED_INSNS (x) = NULL_RTX; ! DECL_FIELD_SIZE (x) = 0; ! /* When this goes into scope, it will be a non-local reference. */ ! DECL_NONLOCAL (x) = 1; ! if (TREE_CODE (x) == CONST_DECL) ! continue; ! if (TREE_CODE (x) == VAR_DECL) { ! if (TREE_CODE (t) == UNION_TYPE) ! /* Unions cannot have static members. */ ! cp_error_at ("field `%D' declared static in union", x); ! ! continue; } ! /* Now it can only be a FIELD_DECL. */ ! /* If this is of reference type, check if it needs an init. ! Also do a little ANSI jig if necessary. */ ! if (TREE_CODE (TREE_TYPE (x)) == REFERENCE_TYPE) ! { ! if (DECL_INITIAL (x) == NULL_TREE) ! ref_sans_init = 1; ! ! /* ARM $12.6.2: [A member initializer list] (or, for an ! aggregate, initialization by a brace-enclosed list) is the ! only way to initialize nonstatic const and reference ! members. */ ! cant_synth_asn_ref = 1; ! cant_have_default_ctor = 1; ! if (! TYPE_HAS_CONSTRUCTOR (t) && extra_warnings) ! { ! if (DECL_NAME (x)) ! cp_warning_at ("non-static reference `%#D' in class without a constructor", x); ! else ! cp_warning_at ("non-static reference in class without a constructor", x); ! } } ! /* If any field is const, the structure type is pseudo-const. */ ! if (TREE_READONLY (x)) { ! C_TYPE_FIELDS_READONLY (t) = 1; ! if (DECL_INITIAL (x) == NULL_TREE) ! const_sans_init = 1; ! /* ARM $12.6.2: [A member initializer list] (or, for an ! aggregate, initialization by a brace-enclosed list) is the ! only way to initialize nonstatic const and reference ! members. */ ! cant_synth_asn_ref = 1; ! cant_have_default_ctor = 1; ! if (! TYPE_HAS_CONSTRUCTOR (t) && !IS_SIGNATURE (t) ! && extra_warnings) { ! if (DECL_NAME (x)) ! cp_warning_at ("non-static const member `%#D' in class without a constructor", x); ! else ! cp_warning_at ("non-static const member in class without a constructor", x); } ! } ! else ! { ! /* A field that is pseudo-const makes the structure ! likewise. */ ! tree t1 = TREE_TYPE (x); ! while (TREE_CODE (t1) == ARRAY_TYPE) ! t1 = TREE_TYPE (t1); ! if (IS_AGGR_TYPE (t1)) { ! if (C_TYPE_FIELDS_READONLY (t1)) ! C_TYPE_FIELDS_READONLY (t) = 1; ! if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (t1)) ! const_sans_init = 1; } ! } ! ! /* We set DECL_BIT_FIELD tentatively in grokbitfield. ! If the type and width are valid, we'll keep it set. ! Otherwise, the flag is cleared. */ ! if (DECL_BIT_FIELD (x)) ! { ! DECL_BIT_FIELD (x) = 0; ! /* Invalid bit-field size done by grokfield. */ ! /* Detect invalid bit-field type. */ ! if (DECL_INITIAL (x) ! && ! INTEGRAL_TYPE_P (TREE_TYPE (x))) { ! cp_error_at ("bit-field `%#D' with non-integral type", x); DECL_INITIAL (x) = NULL; } ! ! /* Detect and ignore out of range field width. */ ! if (DECL_INITIAL (x)) { ! register int width = TREE_INT_CST_LOW (DECL_INITIAL (x)); ! ! if (width < 0) ! { ! DECL_INITIAL (x) = NULL; ! cp_error_at ("negative width in bit-field `%D'", x); ! } ! else if (width == 0 && DECL_NAME (x) != 0) ! { ! DECL_INITIAL (x) = NULL; ! cp_error_at ("zero width for bit-field `%D'", x); ! } ! else if (width ! > TYPE_PRECISION (long_long_unsigned_type_node)) ! { ! /* The backend will dump if you try to use something ! too big; avoid that. */ ! DECL_INITIAL (x) = NULL; ! sorry ("bit-fields larger than %d bits", ! TYPE_PRECISION (long_long_unsigned_type_node)); ! cp_error_at (" in declaration of `%D'", x); ! } ! else if (width > TYPE_PRECISION (TREE_TYPE (x)) ! && TREE_CODE (TREE_TYPE (x)) != ENUMERAL_TYPE) ! { ! cp_warning_at ("width of `%D' exceeds its type", x); ! } ! else if (TREE_CODE (TREE_TYPE (x)) == ENUMERAL_TYPE ! && ((min_precision (TYPE_MIN_VALUE (TREE_TYPE (x)), ! TREE_UNSIGNED (TREE_TYPE (x))) > width) ! || (min_precision (TYPE_MAX_VALUE (TREE_TYPE (x)), ! TREE_UNSIGNED (TREE_TYPE (x))) > width))) ! { ! cp_warning_at ("`%D' is too small to hold all values of `%#T'", ! x, TREE_TYPE (x)); ! } } ! ! /* Process valid field width. */ ! if (DECL_INITIAL (x)) { ! register int width = TREE_INT_CST_LOW (DECL_INITIAL (x)); ! if (width == 0) ! { #ifdef EMPTY_FIELD_BOUNDARY ! /* field size 0 => mark following field as "aligned" */ ! if (TREE_CHAIN (x)) ! DECL_ALIGN (TREE_CHAIN (x)) ! = MAX (DECL_ALIGN (TREE_CHAIN (x)), EMPTY_FIELD_BOUNDARY); ! /* field of size 0 at the end => round up the size. */ ! else ! round_up_size = EMPTY_FIELD_BOUNDARY; #endif #ifdef PCC_BITFIELD_TYPE_MATTERS ! DECL_ALIGN (x) = MAX (DECL_ALIGN (x), ! TYPE_ALIGN (TREE_TYPE (x))); #endif - } - else - { - DECL_INITIAL (x) = NULL_TREE; - DECL_FIELD_SIZE (x) = width; - DECL_BIT_FIELD (x) = 1; - /* Traditionally a bit field is unsigned - even if declared signed. */ - if (flag_traditional - && TREE_CODE (TREE_TYPE (x)) == INTEGER_TYPE) - TREE_TYPE (x) = unsigned_type_node; - } } else ! /* Non-bit-fields are aligned for their type. */ ! DECL_ALIGN (x) = MAX (DECL_ALIGN (x), TYPE_ALIGN (TREE_TYPE (x))); } else ! { ! tree type = TREE_TYPE (x); ! if (TREE_CODE (type) == ARRAY_TYPE) ! type = TREE_TYPE (type); ! if (TYPE_LANG_SPECIFIC (type) && ! ANON_UNION_P (x) ! && ! TYPE_PTRMEMFUNC_P (type)) ! { ! /* Never let anything with uninheritable virtuals ! make it through without complaint. */ ! if (CLASSTYPE_ABSTRACT_VIRTUALS (type)) ! abstract_virtuals_error (x, type); ! /* Don't let signatures make it through either. */ ! if (IS_SIGNATURE (type)) ! signature_error (x, type); ! if (code == UNION_TYPE) ! { ! char *fie = NULL; ! if (TYPE_NEEDS_CONSTRUCTING (type)) ! fie = "constructor"; ! else if (TYPE_NEEDS_DESTRUCTOR (type)) ! fie = "destructor"; ! else if (TYPE_HAS_REAL_ASSIGNMENT (type)) ! fie = "assignment operator"; ! if (fie) ! cp_error_at ("member `%#D' with %s not allowed in union", x, ! fie); ! } ! else ! { ! TYPE_NEEDS_CONSTRUCTING (t) |= TYPE_NEEDS_CONSTRUCTING (type); ! TYPE_NEEDS_DESTRUCTOR (t) |= TYPE_NEEDS_DESTRUCTOR (type); ! TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_COMPLEX_ASSIGN_REF (type); ! TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_HAS_COMPLEX_INIT_REF (type); ! } ! if (! TYPE_HAS_INIT_REF (type) ! || (TYPE_HAS_NONPUBLIC_CTOR (type) ! && ! is_friend (t, type))) ! cant_synth_copy_ctor = 1; ! else if (!TYPE_HAS_CONST_INIT_REF (type)) ! cant_have_const_ctor = 1; ! ! if (! TYPE_HAS_ASSIGN_REF (type) ! || (TYPE_HAS_NONPUBLIC_ASSIGN_REF (type) ! && ! is_friend (t, type))) ! cant_synth_asn_ref = 1; ! else if (!TYPE_HAS_CONST_ASSIGN_REF (type)) ! no_const_asn_ref = 1; ! if (TYPE_HAS_CONSTRUCTOR (type) ! && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type)) ! { ! cant_have_default_ctor = 1; #if 0 ! /* This is wrong for aggregates. */ ! if (! TYPE_HAS_CONSTRUCTOR (t)) ! { ! if (DECL_NAME (x)) ! cp_pedwarn_at ("member `%#D' with only non-default constructor", x); ! else ! cp_pedwarn_at ("member with only non-default constructor", x); ! cp_pedwarn_at ("in class without a constructor", ! x); ! } ! #endif } ! } ! if (DECL_INITIAL (x) != NULL_TREE) ! { ! /* `build_class_init_list' does not recognize ! non-FIELD_DECLs. */ ! if (code == UNION_TYPE && any_default_members != 0) ! cp_error_at ("multiple fields in union `%T' initialized"); ! any_default_members = 1; } } ! } ! list_of_fieldlists = TREE_CHAIN (list_of_fieldlists); ! /* link the tail while we have it! */ ! if (last_x) ! { ! TREE_CHAIN (last_x) = NULL_TREE; ! ! if (list_of_fieldlists ! && TREE_VALUE (list_of_fieldlists) ! && TREE_CODE (TREE_VALUE (list_of_fieldlists)) != FUNCTION_DECL) ! TREE_CHAIN (last_x) = TREE_VALUE (list_of_fieldlists); } } --- 2921,3277 ---- all_virtual = 0; ! for (x = CLASSTYPE_METHODS (t); x; x = TREE_CHAIN (x)) { ! GNU_xref_member (current_class_name, x); ! nonprivate_method |= ! TREE_PRIVATE (x); ! /* If this was an evil function, don't keep it in class. */ ! if (IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (x))) ! continue; ! DECL_CLASS_CONTEXT (x) = t; ! /* Do both of these, even though they're in the same union; ! if the insn `r' member and the size `i' member are ! different sizes, as on the alpha, the larger of the two ! will end up with garbage in it. */ ! DECL_SAVED_INSNS (x) = NULL_RTX; ! DECL_FIELD_SIZE (x) = 0; ! ! /* The name of the field is the original field name ! Save this in auxiliary field for later overloading. */ ! if (DECL_VINDEX (x) ! || (all_virtual == 1 && ! DECL_CONSTRUCTOR_P (x))) ! { ! pending_virtuals = add_virtual_function (pending_virtuals, ! &has_virtual, x, t); ! if (DECL_ABSTRACT_VIRTUAL_P (x)) ! abstract_virtuals = tree_cons (NULL_TREE, x, abstract_virtuals); ! else ! TREE_USED (x) = 1; ! } ! } ! for (x = TYPE_FIELDS (t); x; x = TREE_CHAIN (x)) ! { ! GNU_xref_member (current_class_name, x); ! /* Handle access declarations. */ ! if (DECL_NAME (x) && TREE_CODE (DECL_NAME (x)) == SCOPE_REF) ! { ! tree fdecl = TREE_OPERAND (DECL_NAME (x), 1); ! enum access_type access ! = TREE_PRIVATE (x) ? access_private : ! TREE_PROTECTED (x) ? access_protected : access_public; ! if (last_x) ! TREE_CHAIN (last_x) = TREE_CHAIN (x); ! else ! fields = TREE_CHAIN (x); ! access_decls = tree_cons ((tree) access, fdecl, access_decls); ! continue; ! } ! last_x = x; ! if (TREE_CODE (x) == TYPE_DECL) ! continue; ! /* If we've gotten this far, it's a data member, possibly static, ! or an enumerator. */ ! DECL_FIELD_CONTEXT (x) = t; ! /* ``A local class cannot have static data members.'' ARM 9.4 */ ! if (current_function_decl && TREE_STATIC (x)) ! cp_error_at ("field `%D' in local class cannot be static", x); ! /* Perform error checking that did not get done in ! grokdeclarator. */ ! if (TREE_CODE (TREE_TYPE (x)) == FUNCTION_TYPE) ! { ! cp_error_at ("field `%D' invalidly declared function type", ! x); ! TREE_TYPE (x) = build_pointer_type (TREE_TYPE (x)); ! } ! else if (TREE_CODE (TREE_TYPE (x)) == METHOD_TYPE) ! { ! cp_error_at ("field `%D' invalidly declared method type", x); ! TREE_TYPE (x) = build_pointer_type (TREE_TYPE (x)); ! } ! else if (TREE_CODE (TREE_TYPE (x)) == OFFSET_TYPE) ! { ! cp_error_at ("field `%D' invalidly declared offset type", x); ! TREE_TYPE (x) = build_pointer_type (TREE_TYPE (x)); ! } ! #if 0 ! if (DECL_NAME (x) == constructor_name (t)) ! cant_have_default_ctor = cant_synth_copy_ctor = 1; ! #endif ! if (TREE_TYPE (x) == error_mark_node) ! continue; ! ! DECL_SAVED_INSNS (x) = NULL_RTX; ! DECL_FIELD_SIZE (x) = 0; ! /* When this goes into scope, it will be a non-local reference. */ ! DECL_NONLOCAL (x) = 1; ! if (TREE_CODE (x) == CONST_DECL) ! continue; ! if (TREE_CODE (x) == VAR_DECL) ! { ! if (TREE_CODE (t) == UNION_TYPE) ! /* Unions cannot have static members. */ ! cp_error_at ("field `%D' declared static in union", x); ! ! continue; ! } ! /* Now it can only be a FIELD_DECL. */ ! if (TREE_PRIVATE (x) || TREE_PROTECTED (x)) ! aggregate = 0; ! /* If this is of reference type, check if it needs an init. ! Also do a little ANSI jig if necessary. */ ! if (TREE_CODE (TREE_TYPE (x)) == REFERENCE_TYPE) ! { ! if (DECL_INITIAL (x) == NULL_TREE) ! ref_sans_init = 1; ! /* ARM $12.6.2: [A member initializer list] (or, for an ! aggregate, initialization by a brace-enclosed list) is the ! only way to initialize nonstatic const and reference ! members. */ ! cant_synth_asn_ref = 1; ! cant_have_default_ctor = 1; ! ! if (! TYPE_HAS_CONSTRUCTOR (t) && extra_warnings) { ! if (DECL_NAME (x)) ! cp_warning_at ("non-static reference `%#D' in class without a constructor", x); ! else ! cp_warning_at ("non-static reference in class without a constructor", x); } + } ! /* If any field is const, the structure type is pseudo-const. */ ! if (TREE_READONLY (x)) ! { ! C_TYPE_FIELDS_READONLY (t) = 1; ! if (DECL_INITIAL (x) == NULL_TREE) ! const_sans_init = 1; ! /* ARM $12.6.2: [A member initializer list] (or, for an ! aggregate, initialization by a brace-enclosed list) is the ! only way to initialize nonstatic const and reference ! members. */ ! cant_synth_asn_ref = 1; ! cant_have_default_ctor = 1; ! if (! TYPE_HAS_CONSTRUCTOR (t) && !IS_SIGNATURE (t) ! && extra_warnings) ! { ! if (DECL_NAME (x)) ! cp_warning_at ("non-static const member `%#D' in class without a constructor", x); ! else ! cp_warning_at ("non-static const member in class without a constructor", x); ! } ! } ! else ! { ! /* A field that is pseudo-const makes the structure ! likewise. */ ! tree t1 = TREE_TYPE (x); ! while (TREE_CODE (t1) == ARRAY_TYPE) ! t1 = TREE_TYPE (t1); ! if (IS_AGGR_TYPE (t1)) ! { ! if (C_TYPE_FIELDS_READONLY (t1)) ! C_TYPE_FIELDS_READONLY (t) = 1; ! if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (t1)) ! const_sans_init = 1; } + } ! /* We set DECL_BIT_FIELD tentatively in grokbitfield. ! If the type and width are valid, we'll keep it set. ! Otherwise, the flag is cleared. */ ! if (DECL_BIT_FIELD (x)) ! { ! DECL_BIT_FIELD (x) = 0; ! /* Invalid bit-field size done by grokfield. */ ! /* Detect invalid bit-field type. */ ! if (DECL_INITIAL (x) ! && ! INTEGRAL_TYPE_P (TREE_TYPE (x))) { ! cp_error_at ("bit-field `%#D' with non-integral type", x); ! DECL_INITIAL (x) = NULL; ! } ! /* Detect and ignore out of range field width. */ ! if (DECL_INITIAL (x)) ! { ! register int width = TREE_INT_CST_LOW (DECL_INITIAL (x)); ! if (width < 0) { ! DECL_INITIAL (x) = NULL; ! cp_error_at ("negative width in bit-field `%D'", x); } ! else if (width == 0 && DECL_NAME (x) != 0) { ! DECL_INITIAL (x) = NULL; ! cp_error_at ("zero width for bit-field `%D'", x); } ! else if (width ! > TYPE_PRECISION (long_long_unsigned_type_node)) { ! /* The backend will dump if you try to use something ! too big; avoid that. */ DECL_INITIAL (x) = NULL; + sorry ("bit-fields larger than %d bits", + TYPE_PRECISION (long_long_unsigned_type_node)); + cp_error_at (" in declaration of `%D'", x); } ! else if (width > TYPE_PRECISION (TREE_TYPE (x)) ! && TREE_CODE (TREE_TYPE (x)) != ENUMERAL_TYPE) { ! cp_warning_at ("width of `%D' exceeds its type", x); } ! else if (TREE_CODE (TREE_TYPE (x)) == ENUMERAL_TYPE ! && ((min_precision (TYPE_MIN_VALUE (TREE_TYPE (x)), ! TREE_UNSIGNED (TREE_TYPE (x))) > width) ! || (min_precision (TYPE_MAX_VALUE (TREE_TYPE (x)), ! TREE_UNSIGNED (TREE_TYPE (x))) > width))) { ! cp_warning_at ("`%D' is too small to hold all values of `%#T'", ! x, TREE_TYPE (x)); ! } ! } ! /* Process valid field width. */ ! if (DECL_INITIAL (x)) ! { ! register int width = TREE_INT_CST_LOW (DECL_INITIAL (x)); ! ! if (width == 0) ! { #ifdef EMPTY_FIELD_BOUNDARY ! /* field size 0 => mark following field as "aligned" */ ! if (TREE_CHAIN (x)) ! DECL_ALIGN (TREE_CHAIN (x)) ! = MAX (DECL_ALIGN (TREE_CHAIN (x)), EMPTY_FIELD_BOUNDARY); ! /* field of size 0 at the end => round up the size. */ ! else ! round_up_size = EMPTY_FIELD_BOUNDARY; #endif #ifdef PCC_BITFIELD_TYPE_MATTERS ! DECL_ALIGN (x) = MAX (DECL_ALIGN (x), ! TYPE_ALIGN (TREE_TYPE (x))); #endif } else ! { ! DECL_INITIAL (x) = NULL_TREE; ! DECL_FIELD_SIZE (x) = width; ! DECL_BIT_FIELD (x) = 1; ! /* Traditionally a bit field is unsigned ! even if declared signed. */ ! if (flag_traditional ! && TREE_CODE (TREE_TYPE (x)) == INTEGER_TYPE) ! TREE_TYPE (x) = unsigned_type_node; ! } } else ! /* Non-bit-fields are aligned for their type. */ ! DECL_ALIGN (x) = MAX (DECL_ALIGN (x), TYPE_ALIGN (TREE_TYPE (x))); ! } ! else ! { ! tree type = TREE_TYPE (x); ! if (TREE_CODE (type) == ARRAY_TYPE) ! type = TREE_TYPE (type); ! if (TYPE_LANG_SPECIFIC (type) && ! ANON_UNION_P (x) ! && ! TYPE_PTRMEMFUNC_P (type)) ! { ! /* Never let anything with uninheritable virtuals ! make it through without complaint. */ ! if (CLASSTYPE_ABSTRACT_VIRTUALS (type)) ! abstract_virtuals_error (x, type); ! /* Don't let signatures make it through either. */ ! if (IS_SIGNATURE (type)) ! signature_error (x, type); ! if (code == UNION_TYPE) ! { ! char *fie = NULL; ! if (TYPE_NEEDS_CONSTRUCTING (type)) ! fie = "constructor"; ! else if (TYPE_NEEDS_DESTRUCTOR (type)) ! fie = "destructor"; ! else if (TYPE_HAS_REAL_ASSIGNMENT (type)) ! fie = "assignment operator"; ! if (fie) ! cp_error_at ("member `%#D' with %s not allowed in union", x, ! fie); ! } ! else ! { ! TYPE_NEEDS_CONSTRUCTING (t) |= TYPE_NEEDS_CONSTRUCTING (type); ! TYPE_NEEDS_DESTRUCTOR (t) |= TYPE_NEEDS_DESTRUCTOR (type); ! TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_COMPLEX_ASSIGN_REF (type); ! TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_HAS_COMPLEX_INIT_REF (type); ! } ! if (! TYPE_HAS_INIT_REF (type) ! || (TYPE_HAS_NONPUBLIC_CTOR (type) ! && ! is_friend (t, type))) ! cant_synth_copy_ctor = 1; ! else if (!TYPE_HAS_CONST_INIT_REF (type)) ! cant_have_const_ctor = 1; ! ! if (! TYPE_HAS_ASSIGN_REF (type) ! || (TYPE_HAS_NONPUBLIC_ASSIGN_REF (type) ! && ! is_friend (t, type))) ! cant_synth_asn_ref = 1; ! else if (!TYPE_HAS_CONST_ASSIGN_REF (type)) ! no_const_asn_ref = 1; ! if (TYPE_HAS_CONSTRUCTOR (type) ! && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type)) ! { ! cant_have_default_ctor = 1; #if 0 ! /* This is wrong for aggregates. */ ! if (! TYPE_HAS_CONSTRUCTOR (t)) ! { ! if (DECL_NAME (x)) ! cp_pedwarn_at ("member `%#D' with only non-default constructor", x); ! else ! cp_pedwarn_at ("member with only non-default constructor", x); ! cp_pedwarn_at ("in class without a constructor", ! x); } ! #endif } } ! if (DECL_INITIAL (x) != NULL_TREE) ! { ! /* `build_class_init_list' does not recognize ! non-FIELD_DECLs. */ ! if (code == UNION_TYPE && any_default_members != 0) ! cp_error_at ("multiple fields in union `%T' initialized"); ! any_default_members = 1; ! } } } *************** *** 3330,3333 **** --- 3288,3294 ---- for anonymous unions; grok_x_components undoes that. */ + if (! fn_fields) + nonprivate_method = 1; + if (TYPE_NEEDS_DESTRUCTOR (t) && !TYPE_HAS_DESTRUCTOR (t) && !IS_SIGNATURE (t)) *************** *** 3342,3347 **** { /* Link dtor onto end of fn_fields. */ ! *tail = dtor; ! tail = &TREE_CHAIN (dtor); if (DECL_VINDEX (dtor) == NULL_TREE --- 3303,3309 ---- { /* Link dtor onto end of fn_fields. */ ! ! TREE_CHAIN (dtor) = fn_fields; ! fn_fields = dtor; if (DECL_VINDEX (dtor) == NULL_TREE *************** *** 3357,3363 **** } - *tail = NULL_TREE; - *tail_user_methods = NULL_TREE; - TYPE_NEEDS_DESTRUCTOR (t) |= TYPE_HAS_DESTRUCTOR (t); if (flag_rtti && (max_has_virtual > 0 || needs_virtual_dtor) && --- 3319,3322 ---- *************** *** 3365,3371 **** has_virtual = 1; - if (! fn_fields) - nonprivate_method = 1; - TYPE_HAS_COMPLEX_INIT_REF (t) |= (TYPE_HAS_INIT_REF (t) || TYPE_USES_VIRTUAL_BASECLASSES (t) --- 3324,3327 ---- *************** *** 3374,3377 **** --- 3330,3336 ---- |= (TYPE_HAS_CONSTRUCTOR (t) || TYPE_USES_VIRTUAL_BASECLASSES (t) || has_virtual || any_default_members || first_vfn_base_index >= 0); + if (! IS_SIGNATURE (t)) + CLASSTYPE_NON_AGGREGATE (t) + = ! aggregate || has_virtual || TYPE_HAS_CONSTRUCTOR (t); /* ARM $12.1: A default constructor will be generated for a class X *************** *** 3646,3649 **** --- 3605,3615 ---- continue; + if (TREE_PRIVATE (uelt)) + cp_pedwarn_at ("private member `%#D' in anonymous union", + uelt); + else if (TREE_PROTECTED (uelt)) + cp_pedwarn_at ("protected member `%#D' in anonymous union", + uelt); + DECL_FIELD_CONTEXT (uelt) = DECL_FIELD_CONTEXT (field); DECL_FIELD_BITPOS (uelt) = DECL_FIELD_BITPOS (field); *************** *** 3781,3799 **** if (first_vfn_base_index < 0) { ! if (flag_rtti) ! pending_virtuals = tree_cons (NULL_TREE, ! build_vtable_entry (integer_zero_node, build_t_desc (t, 0)), ! pending_virtuals); ! else ! pending_virtuals = tree_cons (NULL_TREE, ! build_vtable_entry (integer_zero_node, integer_zero_node), ! pending_virtuals); ! #if 0 ! /* The size is no longer used. */ ! /* now we put the size of the vtable as first entry */ ! pending_virtuals = tree_cons (NULL_TREE, the_null_vtable_entry, ! pending_virtuals); ! #endif build_vtable (NULL_TREE, t); } --- 3747,3758 ---- if (first_vfn_base_index < 0) { ! /* The first slot is for the rtti offset. */ ! pending_virtuals = tree_cons (NULL_TREE, NULL_TREE, pending_virtuals); ! /* The second slot is for the tdesc pointer when thunks are used. */ ! if (flag_vtable_thunks) ! pending_virtuals = tree_cons (NULL_TREE, NULL_TREE, pending_virtuals); ! ! set_rtti_entry (pending_virtuals, integer_zero_node, t); build_vtable (NULL_TREE, t); } *************** *** 3800,3803 **** --- 3759,3763 ---- else { + tree offset; /* Here we know enough to change the type of our virtual function table, but we will wait until later this function. */ *************** *** 3806,3817 **** build_vtable (TREE_VEC_ELT (TYPE_BINFO_BASETYPES (t), first_vfn_base_index), t); ! /* Update the rtti pointer for this class. */ ! if (flag_rtti) ! { ! tree offset = get_derived_offset (TYPE_BINFO (t), NULL_TREE); ! offset = size_binop (MINUS_EXPR, integer_zero_node, offset); ! TREE_VALUE (TYPE_BINFO_VIRTUALS (t)) ! = build_vtable_entry (offset, build_t_desc (t, 0)); ! } } --- 3766,3772 ---- build_vtable (TREE_VEC_ELT (TYPE_BINFO_BASETYPES (t), first_vfn_base_index), t); ! offset = get_derived_offset (TYPE_BINFO (t), NULL_TREE); ! offset = size_binop (MINUS_EXPR, integer_zero_node, offset); ! set_rtti_entry (TYPE_BINFO_VIRTUALS (t), offset, t); } *************** *** 3911,3937 **** finish_struct_bits (t, max_has_virtual); ! /* Promote each bit-field's type to int if it is narrower than that. ! There's more: complete the rtl for any static member objects which ! is of the same type we're working on. */ for (x = fields; x; x = TREE_CHAIN (x)) { - if (DECL_BIT_FIELD (x) - && (C_PROMOTING_INTEGER_TYPE_P (TREE_TYPE (x)) - || DECL_FIELD_SIZE (x) < TYPE_PRECISION (integer_type_node))) - { - tree type = TREE_TYPE (x); - - /* Preserve unsignedness if traditional or if not really getting - any wider. */ - if (TREE_UNSIGNED (type) - && (flag_traditional - || - (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node) - && DECL_FIELD_SIZE (x) == TYPE_PRECISION (integer_type_node)))) - TREE_TYPE (x) = unsigned_type_node; - else - TREE_TYPE (x) = integer_type_node; - } - if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x) && TREE_TYPE (x) == t) --- 3866,3873 ---- finish_struct_bits (t, max_has_virtual); ! /* Complete the rtl for any static member objects of the type we're ! working on. */ for (x = fields; x; x = TREE_CHAIN (x)) { if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x) && TREE_TYPE (x) == t) *************** *** 4103,4106 **** --- 4039,4182 ---- return t; } + + tree + finish_struct (t, list_of_fieldlists, warn_anon) + tree t; + tree list_of_fieldlists; + int warn_anon; + { + tree fields = NULL_TREE, fn_fields, *tail; + tree *tail_user_methods = &CLASSTYPE_METHODS (t); + tree name = TYPE_NAME (t); + tree x, last_x = NULL_TREE; + enum access_type access; + + 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; + CLASSTYPE_SOURCE_LINE (t) = lineno; + name = DECL_NAME (name); + } + + /* Append the fields we need for constructing signature tables. */ + if (IS_SIGNATURE (t)) + append_signature_fields (list_of_fieldlists); + + tail = &fn_fields; + if (last_x && list_of_fieldlists) + TREE_CHAIN (last_x) = TREE_VALUE (list_of_fieldlists); + + /* For signatures, we made all methods `public' in the parser and + reported an error if a access specifier was used. */ + if (CLASSTYPE_DECLARED_CLASS (t) == 0) + { + if (list_of_fieldlists + && TREE_PURPOSE (list_of_fieldlists) == (tree)access_default) + TREE_PURPOSE (list_of_fieldlists) = (tree)access_public; + } + else if (list_of_fieldlists + && TREE_PURPOSE (list_of_fieldlists) == (tree)access_default) + TREE_PURPOSE (list_of_fieldlists) = (tree)access_private; + + while (list_of_fieldlists) + { + access = (enum access_type)TREE_PURPOSE (list_of_fieldlists); + + for (x = TREE_VALUE (list_of_fieldlists); x; x = TREE_CHAIN (x)) + { + TREE_PRIVATE (x) = access == access_private; + TREE_PROTECTED (x) = access == access_protected; + + /* Check for inconsistent use of this name in the class body. + Enums, types and static vars have already been checked. */ + if (TREE_CODE (x) != TYPE_DECL + && TREE_CODE (x) != CONST_DECL && TREE_CODE (x) != VAR_DECL) + { + tree name = DECL_NAME (x); + tree icv; + + /* Don't get confused by access decls. */ + if (name && TREE_CODE (name) == IDENTIFIER_NODE) + icv = IDENTIFIER_CLASS_VALUE (name); + else + icv = NULL_TREE; + + if (icv + /* Don't complain about constructors. */ + && name != constructor_name (current_class_type) + /* Or inherited names. */ + && id_in_current_class (name) + /* Or shadowed tags. */ + && !(TREE_CODE (icv) == TYPE_DECL + && DECL_CONTEXT (icv) == t)) + { + cp_error_at ("declaration of identifier `%D' as `%+#D'", + name, x); + cp_error_at ("conflicts with other use in class as `%#D'", + icv); + } + } + + if (TREE_CODE (x) == FUNCTION_DECL) + { + if (last_x) + TREE_CHAIN (last_x) = TREE_CHAIN (x); + /* Link x onto end of fn_fields and CLASSTYPE_METHODS. */ + *tail = x; + tail = &TREE_CHAIN (x); + *tail_user_methods = x; + tail_user_methods = &DECL_NEXT_METHOD (x); + continue; + } + + #if 0 + /* Handle access declarations. */ + if (DECL_NAME (x) && TREE_CODE (DECL_NAME (x)) == SCOPE_REF) + { + tree n = DECL_NAME (x); + x = build_decl + (USING_DECL, DECL_NAME (TREE_OPERAND (n, 1)), TREE_TYPE (x)); + DECL_RESULT (x) = n; + } + #endif + + if (! fields) + fields = x; + last_x = x; + } + list_of_fieldlists = TREE_CHAIN (list_of_fieldlists); + /* link the tail while we have it! */ + if (last_x) + { + TREE_CHAIN (last_x) = NULL_TREE; + + if (list_of_fieldlists + && TREE_VALUE (list_of_fieldlists) + && TREE_CODE (TREE_VALUE (list_of_fieldlists)) != FUNCTION_DECL) + TREE_CHAIN (last_x) = TREE_VALUE (list_of_fieldlists); + } + } + + *tail = NULL_TREE; + *tail_user_methods = NULL_TREE; + TYPE_FIELDS (t) = fields; + + if (0 && processing_template_defn) + { + CLASSTYPE_METHOD_VEC (t) = finish_struct_methods (t, fn_fields, 1); + return t; + } + else + return finish_struct_1 (t, warn_anon); + } /* Return non-zero if the effective type of INSTANCE is static. *************** *** 4445,4449 **** tree context; ! if (type == error_mark_node || ! IS_AGGR_TYPE (type)) return; --- 4521,4525 ---- tree context; ! if (type == NULL_TREE || type == error_mark_node || ! IS_AGGR_TYPE (type)) return; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/cp-tree.h gcc-2.7.1/cp/cp-tree.h *** gcc-2.7.0/cp/cp-tree.h Thu Jun 15 08:17:16 1995 --- gcc-2.7.1/cp/cp-tree.h Wed Oct 11 22:27:59 1995 *************** *** 451,454 **** --- 451,455 ---- unsigned has_complex_assign_ref : 1; unsigned has_abstract_assign_ref : 1; + unsigned non_aggregate : 1; /* The MIPS compiler gets it wrong if this struct also *************** *** 455,459 **** does not fill out to a multiple of 4 bytes. Add a member `dummy' with new bits if you go over the edge. */ ! unsigned dummy : 20; unsigned n_vancestors : 16; --- 456,460 ---- does not fill out to a multiple of 4 bytes. Add a member `dummy' with new bits if you go over the edge. */ ! unsigned dummy : 19; unsigned n_vancestors : 16; *************** *** 1055,1058 **** --- 1056,1062 ---- lexical scope of a friend function defined in a class body. */ #define DECL_CLASS_CONTEXT(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.context) + #define DECL_REAL_CONTEXT(NODE) \ + ((TREE_CODE (NODE) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (NODE)) \ + ? DECL_CLASS_CONTEXT (NODE) : DECL_CONTEXT (NODE)) /* For a FUNCTION_DECL: the chain through which the next method *************** *** 1068,1071 **** --- 1072,1079 ---- #define DECL_NEXT_METHOD(NODE) (DECL_LANG_SPECIFIC(NODE)->next_method) + /* In a VAR_DECL for a variable declared in a for statement, + this is the shadowed variable. */ + #define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT(NODE) + /* Points back to the decl which caused this lang_decl to be allocated. */ #define DECL_MAIN_VARIANT(NODE) (DECL_LANG_SPECIFIC(NODE)->main_decl_variant) *************** *** 1137,1140 **** --- 1145,1158 ---- #endif + extern int flag_new_for_scope; + + /* This flag is true of a local VAR_DECL if it was declared in a for + statement, but we are no longer in the scope of the for. */ + #define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (NODE) + + /* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL + if we already emitted a warning about using it. */ + #define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (NODE) + /* This _DECL represents a compiler-generated entity. */ #define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1) *************** *** 1205,1208 **** --- 1223,1233 ---- #endif + /* Nonzero means that an object of this type can not be initialized using + an initializer list. */ + #define CLASSTYPE_NON_AGGREGATE(NODE) \ + (TYPE_LANG_SPECIFIC (NODE)->type_flags.non_aggregate) + #define TYPE_NON_AGGREGATE_CLASS(NODE) \ + (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE)) + /* Nonzero if there is a user-defined X::op=(x&) for this class. */ #define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_real_assign_ref) *************** *** 1451,1454 **** --- 1476,1482 ---- extern tree delta2_identifier; extern tree pfn_or_delta2_identifier; + extern tree tag_identifier; + extern tree vb_off_identifier; + extern tree vt_off_identifier; /* A node that is a list (length 1) of error_mark_nodes. */ *************** *** 1657,1661 **** #define SIGNATURE_OPTR_NAME "__optr" #define SIGNATURE_SPTR_NAME "__sptr" - #define SIGNATURE_VPTR_NAME "__vptr" #define SIGNATURE_POINTER_NAME "__sp_" #define SIGNATURE_POINTER_NAME_FORMAT "__%s%ssp_%s" --- 1685,1688 ---- *************** *** 1666,1672 **** #define SIGTABLE_NAME_FORMAT "__st_%s_%s" #define SIGTABLE_NAME_FORMAT_LONG "__st_%s_%s_%d" ! #define SIGTABLE_CODE_NAME "__code" ! #define SIGTABLE_OFFSET_NAME "__offset" ! #define SIGTABLE_PFN_NAME "__pfn" #define EXCEPTION_CLEANUP_NAME "exception cleanup" --- 1693,1699 ---- #define SIGTABLE_NAME_FORMAT "__st_%s_%s" #define SIGTABLE_NAME_FORMAT_LONG "__st_%s_%s_%d" ! #define SIGTABLE_TAG_NAME "__tag" ! #define SIGTABLE_VB_OFF_NAME "__vb_off" ! #define SIGTABLE_VT_OFF_NAME "__vt_off" #define EXCEPTION_CLEANUP_NAME "exception cleanup" *************** *** 1917,1920 **** --- 1944,1948 ---- /* in class.c */ + extern char *dont_allow_type_definitions; extern tree build_vbase_pointer PROTO((tree, tree)); extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int)); *************** *** 1937,1940 **** --- 1965,1969 ---- extern void print_class_statistics PROTO((void)); extern void maybe_push_cache_obstack PROTO((void)); + extern unsigned HOST_WIDE_INT skip_rtti_stuff PROTO((tree *)); /* in cvt.c */ *************** *** 2014,2018 **** extern int complete_array_type PROTO((tree, tree, int)); extern tree build_ptrmemfunc_type PROTO((tree)); ! extern tree grokdeclarator (); /* PROTO((tree, tree, enum decl_context, int, tree)); */ extern int parmlist_is_exprlist PROTO((tree)); extern tree xref_tag PROTO((tree, tree, tree, int)); --- 2043,2047 ---- extern int complete_array_type PROTO((tree, tree, int)); extern tree build_ptrmemfunc_type PROTO((tree)); ! /* the grokdeclarator prototype is in decl.h */ extern int parmlist_is_exprlist PROTO((tree)); extern tree xref_tag PROTO((tree, tree, tree, int)); *************** *** 2022,2027 **** extern tree build_enumerator PROTO((tree, tree)); extern tree grok_enum_decls PROTO((tree, tree)); ! extern int start_function PROTO((tree, tree, tree, int)); extern void store_parm_decls PROTO((void)); extern void store_return_init PROTO((tree, tree)); extern void finish_function PROTO((int, int, int)); --- 2051,2058 ---- extern tree build_enumerator PROTO((tree, tree)); extern tree grok_enum_decls PROTO((tree, tree)); ! extern int start_function PROTO((tree, tree, tree, tree, int)); extern void store_parm_decls PROTO((void)); + extern void expand_start_early_try_stmts PROTO((void)); + extern void store_in_parms PROTO((struct rtx_def *)); extern void store_return_init PROTO((tree, tree)); extern void finish_function PROTO((int, int, int)); *************** *** 2043,2048 **** extern tree grok_array_decl PROTO((tree, tree)); extern tree delete_sanity PROTO((tree, tree, int, int)); ! extern void check_classfn PROTO((tree, tree, tree)); ! extern tree grokfield PROTO((tree, tree, tree, tree, tree)); extern tree grokbitfield PROTO((tree, tree, tree)); extern tree groktypefield PROTO((tree, tree)); --- 2074,2079 ---- extern tree grok_array_decl PROTO((tree, tree)); extern tree delete_sanity PROTO((tree, tree, int, int)); ! extern tree check_classfn PROTO((tree, tree, tree)); ! extern tree grokfield PROTO((tree, tree, tree, tree, tree, tree)); extern tree grokbitfield PROTO((tree, tree, tree)); extern tree groktypefield PROTO((tree, tree)); *************** *** 2077,2080 **** --- 2108,2112 ---- extern tree current_namespace_id PROTO((tree)); extern tree get_namespace_id PROTO((void)); + extern void check_default_args PROTO((tree)); /* in edsel.c */ *************** *** 2097,2100 **** --- 2129,2135 ---- extern tree build_throw PROTO((tree)); extern void init_exception_processing PROTO((void)); + extern void expand_builtin_throw PROTO((void)); + extern void expand_start_eh_spec PROTO((void)); + extern void expand_end_eh_spec PROTO((tree)); /* in expr.c */ *************** *** 2103,2106 **** --- 2138,2142 ---- extern void fixup_result_decl PROTO((tree, struct rtx_def *)); extern int decl_in_memory_p PROTO((tree)); + extern tree unsave_expr_now PROTO((tree)); /* in gc.c */ *************** *** 2216,2219 **** --- 2252,2256 ---- extern char *parm_as_string PROTO((int, int)); extern char *op_as_string PROTO((enum tree_code, int)); + extern char *cv_as_string PROTO((tree, int)); /* in method.c */ *************** *** 2238,2241 **** --- 2275,2279 ---- /* in pt.c */ + extern tree tsubst PROTO ((tree, tree*, int, tree)); extern void begin_template_parm_list PROTO((void)); extern tree process_template_parm PROTO((tree, tree)); *************** *** 2306,2310 **** extern tree build_optr_ref PROTO((tree)); extern tree build_sptr_ref PROTO((tree)); - extern tree build_vptr_ref PROTO((tree)); /* in spew.c */ --- 2344,2347 ---- *************** *** 2351,2355 **** extern void message_2_types PROTO((void (*)(), char *, tree, tree)); extern char *lang_printable_name PROTO((tree)); ! extern tree build_exception_variant PROTO((tree, tree, tree)); extern tree copy_to_permanent PROTO((tree)); extern void print_lang_statistics PROTO((void)); --- 2388,2392 ---- extern void message_2_types PROTO((void (*)(), char *, tree, tree)); extern char *lang_printable_name PROTO((tree)); ! extern tree build_exception_variant PROTO((tree, tree)); extern tree copy_to_permanent PROTO((tree)); extern void print_lang_statistics PROTO((void)); *************** *** 2358,2361 **** --- 2395,2400 ---- extern tree array_type_nelts_top PROTO((tree)); extern tree break_out_target_exprs PROTO((tree)); + extern tree build_unsave_expr PROTO((tree)); + extern int cp_expand_decl_cleanup PROTO((tree, tree)); /* in typeck.c */ *************** *** 2381,2384 **** --- 2420,2424 ---- extern tree c_sizeof_nowarn PROTO((tree)); extern tree c_alignof PROTO((tree)); + extern tree decay_conversion PROTO((tree)); extern tree default_conversion PROTO((tree)); extern tree build_object_ref PROTO((tree, tree, tree)); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/cvt.c gcc-2.7.1/cp/cvt.c *** gcc-2.7.0/cp/cvt.c Thu Jun 15 08:18:06 1995 --- gcc-2.7.1/cp/cvt.c Wed Oct 11 22:28:06 1995 *************** *** 1,4 **** /* Language-level data type conversion for GNU C++. ! Copyright (C) 1987, 1988, 1992, 1993, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,4 ---- /* Language-level data type conversion for GNU C++. ! Copyright (C) 1987, 88, 92, 93, 94, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) *************** *** 181,184 **** --- 181,193 ---- } + if (TREE_CODE (TREE_TYPE (intype)) == METHOD_TYPE + || (TREE_CODE (type) == POINTER_TYPE + && TREE_CODE (TREE_TYPE (type)) == METHOD_TYPE)) + { + cp_error ("cannot convert `%E' from type `%T' to type `%T'", + expr, intype, type); + return error_mark_node; + } + return build1 (NOP_EXPR, type, expr); } *************** *** 905,909 **** /* The type of the first argument will be filled in inside the loop. */ parmlist = tree_cons (NULL_TREE, integer_zero_node, parmlist); ! parmtypes = tree_cons (NULL_TREE, TYPE_POINTER_TO (basetype), parmtypes); #if 0 --- 914,918 ---- /* The type of the first argument will be filled in inside the loop. */ parmlist = tree_cons (NULL_TREE, integer_zero_node, parmlist); ! parmtypes = tree_cons (NULL_TREE, build_pointer_type (basetype), parmtypes); #if 0 *************** *** 1165,1194 **** return convert_pointer_to_real (type, expr); } - - /* Same as above, but don't abort if we get an "ambiguous" baseclass. - There's only one virtual baseclass we are looking for, and once - we find one such virtual baseclass, we have found them all. */ - - tree - convert_pointer_to_vbase (binfo, expr) - tree binfo; - tree expr; - { - tree intype = TREE_TYPE (TREE_TYPE (expr)); - tree binfos = TYPE_BINFO_BASETYPES (intype); - int i; - - for (i = TREE_VEC_LENGTH (binfos)-1; i >= 0; i--) - { - tree basetype = BINFO_TYPE (TREE_VEC_ELT (binfos, i)); - if (BINFO_TYPE (binfo) == basetype) - return convert_pointer_to (binfo, expr); - if (binfo_member (BINFO_TYPE (binfo), CLASSTYPE_VBASECLASSES (basetype))) - return convert_pointer_to_vbase (binfo, convert_pointer_to (basetype, expr)); - } - my_friendly_abort (6); - /* NOTREACHED */ - return NULL_TREE; - } /* Conversion... --- 1174,1177 ---- *************** *** 1375,1416 **** else if (ctor) { ! if (current_function_decl) ! /* We can't pass 1 to the with_cleanup_p arg here, because that ! screws up passing classes by value. */ ! ctor = build_cplus_new (type, ctor, 0); ! else ! { ! register tree parm = TREE_OPERAND (ctor, 1); ! ! /* Initializers for static variables and parameters ! have to handle doing the initialization and ! cleanup themselves. */ ! my_friendly_assert (TREE_CODE (ctor) == CALL_EXPR, 322); ! #if 0 ! /* The following assertion fails in cases where we ! are initializing a static member variable of a ! particular instance of a template class with a ! call to a constructor of the given instance, as ! in: ! ! TMPL object = TMPL(); ! ! Curiously, the assertion does not fail if we do ! the same thing for a static member of a ! non-template class, as in: ! ! T object = T(); ! ! I can't see why we should care here whether or not ! the initializer expression involves a call to ! `new', so for the time being, it seems best to ! just avoid doing this assertion. */ ! my_friendly_assert (TREE_CALLS_NEW (TREE_VALUE (parm)), ! 323); ! #endif ! TREE_VALUE (parm) = NULL_TREE; ! ctor = build_indirect_ref (ctor, NULL_PTR); ! TREE_HAS_CONSTRUCTOR (ctor) = 1; ! } return ctor; } --- 1358,1362 ---- else if (ctor) { ! ctor = build_cplus_new (type, ctor, 0); return ctor; } *************** *** 1525,1530 **** If (FOR_SURE & 1) is non-zero, then we allow this type conversion to take place immediately. Otherwise, we build a SAVE_EXPR ! which can be evaluated if the results are ever needed. */ tree build_type_conversion (code, xtype, expr, for_sure) --- 1471,1483 ---- If (FOR_SURE & 1) is non-zero, then we allow this type conversion to take place immediately. Otherwise, we build a SAVE_EXPR ! which can be evaluated if the results are ever needed. ! ! Changes to this functions should be mirrored in user_harshness. + FIXME: Ambiguity checking is wrong. Should choose one by the implicit + object parameter, or by the second standard conversion sequence if + that doesn't do it. This will probably wait for an overloading rewrite. + (jason 8/9/95) */ + tree build_type_conversion (code, xtype, expr, for_sure) *************** *** 1605,1612 **** if (TREE_CODE (basetype) == OFFSET_TYPE) ! { ! expr = resolve_offset_ref (expr); ! basetype = TREE_TYPE (expr); ! } if (! IS_AGGR_TYPE (basetype)) --- 1558,1564 ---- if (TREE_CODE (basetype) == OFFSET_TYPE) ! expr = resolve_offset_ref (expr); ! expr = convert_from_reference (expr); ! basetype = TREE_TYPE (expr); if (! IS_AGGR_TYPE (basetype)) *************** *** 1642,1645 **** --- 1594,1598 ---- { int win = 0; + tree candidate; if (winner && TREE_PURPOSE (winner) == TREE_PURPOSE (conv)) *************** *** 1646,1650 **** continue; ! switch (TREE_CODE (TREE_VALUE (conv))) { case BOOLEAN_TYPE: --- 1599,1607 ---- continue; ! candidate = TREE_VALUE (conv); ! if (TREE_CODE (candidate) == REFERENCE_TYPE) ! candidate = TREE_TYPE (candidate); ! ! switch (TREE_CODE (candidate)) { case BOOLEAN_TYPE: *************** *** 1818,1823 **** tree type; { ! int constp = TYPE_READONLY (type); ! int volatilep = TYPE_VOLATILE (type); type = TYPE_MAIN_VARIANT (type); --- 1775,1785 ---- tree type; { ! int constp, volatilep; ! ! if (type == error_mark_node) ! return error_mark_node; ! ! constp = TYPE_READONLY (type); ! volatilep = TYPE_VOLATILE (type); type = TYPE_MAIN_VARIANT (type); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/decl.c gcc-2.7.1/cp/decl.c *** gcc-2.7.0/cp/decl.c Thu Jun 15 19:10:00 1995 --- gcc-2.7.1/cp/decl.c Mon Oct 23 18:25:44 1995 *************** *** 99,103 **** #ifndef BOOL_TYPE_SIZE #ifdef SLOW_BYTE_ACCESS ! #define BOOL_TYPE_SIZE BITS_PER_WORD #else #define BOOL_TYPE_SIZE BITS_PER_UNIT --- 99,103 ---- #ifndef BOOL_TYPE_SIZE #ifdef SLOW_BYTE_ACCESS ! #define BOOL_TYPE_SIZE ((SLOW_BYTE_ACCESS) ? (BITS_PER_WORD) : (BITS_PER_UNIT)) #else #define BOOL_TYPE_SIZE BITS_PER_UNIT *************** *** 294,300 **** parameter for destructors. */ tree this_identifier, in_charge_identifier; ! /* Used in pointer to member functions, and in vtables. */ tree pfn_identifier, index_identifier, delta_identifier, delta2_identifier; ! tree pfn_or_delta2_identifier; /* A list (chain of TREE_LIST nodes) of named label uses. --- 294,301 ---- parameter for destructors. */ tree this_identifier, in_charge_identifier; ! /* Used in pointer to member functions, in vtables, and in sigtables. */ tree pfn_identifier, index_identifier, delta_identifier, delta2_identifier; ! tree pfn_or_delta2_identifier, tag_identifier; ! tree vb_off_identifier, vt_off_identifier; /* A list (chain of TREE_LIST nodes) of named label uses. *************** *** 548,555 **** struct binding_level *level_chain; ! /* Number of decls in `names' that have incomplete structure or union types. */ ! unsigned int n_incomplete; /* 1 for the level that holds the parameters of a function. 2 for the level that holds a class declaration. --- 549,561 ---- struct binding_level *level_chain; ! /* List of decls in `names' that have incomplete structure or union types. */ ! tree incomplete; + /* List of VAR_DECLS saved from a previous for statement. + These would be dead in ANSI-conforming code, but might + be referenced in traditional code. */ + tree dead_vars_from_for; + /* 1 for the level that holds the parameters of a function. 2 for the level that holds a class declaration. *************** *** 583,586 **** --- 589,595 ---- unsigned namespace_p : 1; + /* True if this level is that of a for-statement. */ + unsigned is_for_scope : 1; + /* One bit left for this word. */ *************** *** 939,942 **** --- 948,957 ---- } + int + note_level_for_for () + { + current_binding_level->is_for_scope = 1; + } + void pushlevel_temporary (tag_transparent) *************** *** 1097,1114 **** /* Clear out the meanings of the local variables of this level. */ ! for (link = decls; link; link = TREE_CHAIN (link)) { ! if (DECL_NAME (link) != NULL_TREE) { ! /* If the ident. was used or addressed via a local extern decl, ! don't forget that fact. */ ! if (DECL_EXTERNAL (link)) { ! if (TREE_USED (link)) ! TREE_USED (DECL_ASSEMBLER_NAME (link)) = 1; ! if (TREE_ADDRESSABLE (link)) ! TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (link)) = 1; } - IDENTIFIER_LOCAL_VALUE (DECL_NAME (link)) = NULL_TREE; } } --- 1112,1151 ---- /* Clear out the meanings of the local variables of this level. */ ! for (link = current_binding_level->dead_vars_from_for; ! link != NULL_TREE; link = TREE_CHAIN (link)) { ! if (DECL_DEAD_FOR_LOCAL (link)) { ! tree id = DECL_NAME (link); ! if (IDENTIFIER_LOCAL_VALUE (id) == link) ! IDENTIFIER_LOCAL_VALUE (id) = DECL_SHADOWED_FOR_VAR (link); ! } ! } ! ! if (current_binding_level->is_for_scope && flag_new_for_scope == 1) ! { ! for (link = decls; link; link = TREE_CHAIN (link)) ! { ! if (TREE_CODE (link) == VAR_DECL) ! DECL_DEAD_FOR_LOCAL (link) = 1; ! } ! } ! else ! { ! for (link = decls; link; link = TREE_CHAIN (link)) ! { ! if (DECL_NAME (link) != NULL_TREE) { ! /* If the ident. was used or addressed via a local extern decl, ! don't forget that fact. */ ! if (DECL_EXTERNAL (link)) ! { ! if (TREE_USED (link)) ! TREE_USED (DECL_ASSEMBLER_NAME (link)) = 1; ! if (TREE_ADDRESSABLE (link)) ! TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (link)) = 1; ! } ! IDENTIFIER_LOCAL_VALUE (DECL_NAME (link)) = NULL_TREE; } } } *************** *** 1117,1122 **** that were shadowed by this level. */ ! for (link = current_binding_level->shadowed; link; link = TREE_CHAIN (link)) ! IDENTIFIER_LOCAL_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link); for (link = current_binding_level->class_shadowed; link; link = TREE_CHAIN (link)) --- 1154,1190 ---- that were shadowed by this level. */ ! if (current_binding_level->is_for_scope && flag_new_for_scope == 1) ! { ! struct binding_level *outer = current_binding_level->level_chain; ! for (link = current_binding_level->shadowed; link; link = TREE_CHAIN (link)) ! { ! tree id = TREE_PURPOSE (link); ! tree decl = IDENTIFIER_LOCAL_VALUE (id); ! if (DECL_DEAD_FOR_LOCAL (decl)) ! DECL_SHADOWED_FOR_VAR (decl) = TREE_VALUE (link); ! else ! IDENTIFIER_LOCAL_VALUE (id) = TREE_VALUE (link); ! } ! ! /* Save declarations made in a 'for' statement so we can support pre-ANSI ! 'for' scoping semantics. */ ! ! /* We append the current names of for-variables to those from previous ! declarations, so that when we get around to do an poplevel ! on the OUTER level, we restore the any shadowed readl bindings. ! Note that the new names are put first on the combined list, ! so they get to be restored first. This is important if there are ! two for-loops using the same for-variable in the same block. ! The binding we really want restored is whatever binding was shadowed ! by the *first* for-variable, not the binding shadowed by the ! second for-variable (which would be the first for-variable). */ ! outer->dead_vars_from_for ! = chainon (current_binding_level->names, outer->dead_vars_from_for); ! } ! else ! { ! for (link = current_binding_level->shadowed; link; link = TREE_CHAIN (link)) ! IDENTIFIER_LOCAL_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link); ! } for (link = current_binding_level->class_shadowed; link; link = TREE_CHAIN (link)) *************** *** 1421,1425 **** fprintf (stderr, HOST_PTR_PRINTF, lvl->blocks); fprintf (stderr, " n_incomplete=%d parm_flag=%d keep=%d", ! lvl->n_incomplete, lvl->parm_flag, lvl->keep); if (lvl->tag_transparent) fprintf (stderr, " tag-transparent"); --- 1489,1493 ---- fprintf (stderr, HOST_PTR_PRINTF, lvl->blocks); fprintf (stderr, " n_incomplete=%d parm_flag=%d keep=%d", ! list_length (lvl->incomplete), lvl->parm_flag, lvl->keep); if (lvl->tag_transparent) fprintf (stderr, " tag-transparent"); *************** *** 1576,1580 **** } ! /* Push into the scope of the NAME namespace. */ void push_namespace (name) --- 1644,1697 ---- } ! extern char * first_global_object_name; ! ! /* Get a unique name for each call to this routine for unnamed namespaces. ! Mostly copied from get_file_function_name. */ ! static tree ! get_unique_name () ! { ! static int temp_name_counter = 0; ! char *buf; ! register char *p; ! ! if (first_global_object_name) ! p = first_global_object_name; ! else if (main_input_filename) ! p = main_input_filename; ! else ! p = input_filename; ! ! #define UNNAMED_NAMESPACE_FORMAT "__%s_%d" ! ! buf = (char *) alloca (sizeof (UNNAMED_NAMESPACE_FORMAT) + strlen (p)); ! ! sprintf (buf, UNNAMED_NAMESPACE_FORMAT, p, temp_name_counter++); ! ! /* Don't need to pull weird characters out of global names. */ ! if (p != first_global_object_name) ! { ! for (p = buf+11; *p; p++) ! if (! ((*p >= '0' && *p <= '9') ! #if 0 /* we always want labels, which are valid C++ identifiers (+ `$') */ ! #ifndef ASM_IDENTIFY_GCC /* this is required if `.' is invalid -- k. raeburn */ ! || *p == '.' ! #endif ! #endif ! #ifndef NO_DOLLAR_IN_LABEL /* this for `$'; unlikely, but... -- kr */ ! || *p == '$' ! #endif ! #ifndef NO_DOT_IN_LABEL /* this for `.'; unlikely, but... */ ! || *p == '.' ! #endif ! || (*p >= 'A' && *p <= 'Z') ! || (*p >= 'a' && *p <= 'z'))) ! *p = '_'; ! } ! ! return get_identifier (buf); ! } ! ! /* Push into the scope of the NAME namespace. If NAME is NULL_TREE, then we ! select a name that is unique to this compilation unit. */ void push_namespace (name) *************** *** 1586,1589 **** --- 1703,1712 ---- tree d = make_node (NAMESPACE_DECL); + if (! name) + { + /* Create a truly ugly name! */ + name = get_unique_name (); + } + DECL_NAME (d) = name; DECL_ASSEMBLER_NAME (d) = name; *************** *** 2016,2019 **** --- 2139,2143 ---- #else d = build_decl (TYPE_DECL, name, type); + DECL_ASSEMBLER_NAME (d) = current_namespace_id (DECL_ASSEMBLER_NAME (d)); #endif SET_DECL_ARTIFICIAL (d); *************** *** 2548,2555 **** } ! if (DECL_THIS_INLINE (newdecl) && ! DECL_THIS_INLINE (olddecl) ! && TREE_ADDRESSABLE (olddecl)) ! cp_pedwarn ("`%#D' was used before it was declared inline", ! newdecl); } /* These bits are logically part of the type for non-functions. */ --- 2672,2697 ---- } ! if (DECL_THIS_INLINE (newdecl) && ! DECL_THIS_INLINE (olddecl)) ! { ! #if 0 /* I think this will be correct, but it's really annoying. We should ! fix the compiler to find vtables by indirection so it isn't ! necessary. (jason 8/25/95) */ ! if (DECL_VINDEX (olddecl) && ! DECL_ABSTRACT_VIRTUAL_P (olddecl)) ! { ! cp_pedwarn ("virtual function `%#D' redeclared inline", ! newdecl); ! cp_pedwarn_at ("previous non-inline declaration here", ! olddecl); ! } ! else ! #endif ! if (TREE_ADDRESSABLE (olddecl)) ! { ! cp_pedwarn ("`%#D' was used before it was declared inline", ! newdecl); ! cp_pedwarn_at ("previous non-inline declaration here", ! olddecl); ! } ! } } /* These bits are logically part of the type for non-functions. */ *************** *** 2666,2672 **** tree ctype = NULL_TREE; ctype = DECL_CLASS_CONTEXT (newdecl); ! TREE_TYPE (newdecl) = build_exception_variant (ctype, newtype, TYPE_RAISES_EXCEPTIONS (TREE_TYPE (newdecl))); ! TREE_TYPE (olddecl) = build_exception_variant (ctype, newtype, TYPE_RAISES_EXCEPTIONS (oldtype)); --- 2808,2814 ---- tree ctype = NULL_TREE; ctype = DECL_CLASS_CONTEXT (newdecl); ! TREE_TYPE (newdecl) = build_exception_variant (newtype, TYPE_RAISES_EXCEPTIONS (TREE_TYPE (newdecl))); ! TREE_TYPE (olddecl) = build_exception_variant (newtype, TYPE_RAISES_EXCEPTIONS (oldtype)); *************** *** 2961,2965 **** else if (t != NULL_TREE) { ! if (TREE_CODE (t) == PARM_DECL) { if (DECL_CONTEXT (t) == NULL_TREE) --- 3103,3111 ---- else if (t != NULL_TREE) { ! file = DECL_SOURCE_FILE (t); ! line = DECL_SOURCE_LINE (t); ! if (TREE_CODE (x) == VAR_DECL && DECL_DEAD_FOR_LOCAL (x)) ! ; /* This is OK. */ ! else if (TREE_CODE (t) == PARM_DECL) { if (DECL_CONTEXT (t) == NULL_TREE) *************** *** 2966,2973 **** fatal ("parse errors have confused me too much"); } ! file = DECL_SOURCE_FILE (t); ! line = DECL_SOURCE_LINE (t); ! ! if (((TREE_CODE (x) == FUNCTION_DECL && DECL_LANGUAGE (x) == lang_c) || (TREE_CODE (x) == TEMPLATE_DECL && ! DECL_TEMPLATE_IS_CLASS (x))) --- 3112,3116 ---- fatal ("parse errors have confused me too much"); } ! else if (((TREE_CODE (x) == FUNCTION_DECL && DECL_LANGUAGE (x) == lang_c) || (TREE_CODE (x) == TEMPLATE_DECL && ! DECL_TEMPLATE_IS_CLASS (x))) *************** *** 3031,3034 **** --- 3174,3179 ---- if (TREE_CODE (t) == TYPE_DECL) SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (t)); + else if (TREE_CODE (t) == FUNCTION_DECL) + check_default_args (t); return t; *************** *** 3235,3238 **** --- 3380,3390 ---- cp_error ("declaration of `%#D' shadows a parameter", name); } + else if (oldlocal != NULL_TREE && b->is_for_scope + && !DECL_DEAD_FOR_LOCAL (oldlocal)) + { + warning ("variable `%s' shadows local", + IDENTIFIER_POINTER (name)); + cp_warning_at (" this is the shadowed declaration", oldlocal); + } /* Maybe warn if shadowing something else. */ else if (warn_shadow && !DECL_EXTERNAL (x) *************** *** 3247,3250 **** --- 3399,3403 ---- warnstring = "declaration of `%s' shadows a parameter"; else if (IDENTIFIER_CLASS_VALUE (name) != NULL_TREE + && current_class_decl && !TREE_STATIC (name)) warnstring = "declaration of `%s' shadows a member of `this'"; *************** *** 3260,3300 **** if (TREE_CODE (x) == FUNCTION_DECL) ! { ! /* This is probably the wrong place to check this, but it has to ! come after the call to duplicate_decls. */ ! tree arg = TYPE_ARG_TYPES (TREE_TYPE (x)); ! int saw_def = 0, i = 1; ! for (; arg && arg != void_list_node; arg = TREE_CHAIN (arg), ++i) ! { ! if (TREE_PURPOSE (arg)) ! saw_def = 1; ! else if (saw_def) ! { ! cp_error ("default argument missing for parameter %d of `%#D'", ! i, x); ! break; ! } ! } ! } ! ! /* Keep count of variables in this level with incomplete type. */ ! if (TREE_CODE (x) != TEMPLATE_DECL ! && TYPE_SIZE (TREE_TYPE (x)) == NULL_TREE ! && PROMOTES_TO_AGGR_TYPE (TREE_TYPE (x), ARRAY_TYPE)) ! { ! if (++b->n_incomplete == 0) ! error ("too many incomplete variables at this point"); ! } /* Keep count of variables in this level with incomplete type. */ - /* RTTI TD entries are created while defining the type_info. */ if (TREE_CODE (x) == VAR_DECL && TREE_TYPE (x) != error_mark_node ! && TYPE_LANG_SPECIFIC (TREE_TYPE (x)) ! && TYPE_BEING_DEFINED (TREE_TYPE (x))) ! { ! if (++b->n_incomplete == 0) ! error ("too many incomplete variables at this point"); ! } } --- 3413,3427 ---- if (TREE_CODE (x) == FUNCTION_DECL) ! check_default_args (x); /* Keep count of variables in this level with incomplete type. */ if (TREE_CODE (x) == VAR_DECL && TREE_TYPE (x) != error_mark_node ! && ((TYPE_SIZE (TREE_TYPE (x)) == NULL_TREE ! && PROMOTES_TO_AGGR_TYPE (TREE_TYPE (x), ARRAY_TYPE)) ! /* RTTI TD entries are created while defining the type_info. */ ! || (TYPE_LANG_SPECIFIC (TREE_TYPE (x)) ! && TYPE_BEING_DEFINED (TREE_TYPE (x))))) ! b->incomplete = tree_cons (NULL_TREE, x, b->incomplete); } *************** *** 4262,4266 **** if (got_scope) type = got_scope; ! else type = got_object; --- 4389,4393 ---- if (got_scope) type = got_scope; ! else if (got_object != error_mark_node) type = got_object; *************** *** 4672,4675 **** --- 4799,4808 ---- delta2_identifier = get_identifier (VTABLE_DELTA2_NAME); pfn_or_delta2_identifier = get_identifier ("__pfn_or_delta2"); + if (flag_handle_signatures) + { + tag_identifier = get_identifier (SIGTABLE_TAG_NAME); + vb_off_identifier = get_identifier (SIGTABLE_VB_OFF_NAME); + vt_off_identifier = get_identifier (SIGTABLE_VT_OFF_NAME); + } /* Define `int' and `char' first so that dbx will output them first. */ *************** *** 5218,5232 **** { sigtable_entry_type = make_lang_type (RECORD_TYPE); ! fields[0] = build_lang_field_decl (FIELD_DECL, ! get_identifier (SIGTABLE_CODE_NAME), ! short_integer_type_node); ! fields[1] = build_lang_field_decl (FIELD_DECL, ! get_identifier (SIGTABLE_OFFSET_NAME), ! short_integer_type_node); ! fields[2] = build_lang_field_decl (FIELD_DECL, ! get_identifier (SIGTABLE_PFN_NAME), ptr_type_node); ! finish_builtin_type (sigtable_entry_type, SIGTABLE_PTR_TYPE, fields, 2, ! double_type_node); sigtable_entry_type = build_type_variant (sigtable_entry_type, 1, 0); record_builtin_type (RID_MAX, SIGTABLE_PTR_TYPE, sigtable_entry_type); --- 5351,5381 ---- { sigtable_entry_type = make_lang_type (RECORD_TYPE); ! fields[0] = build_lang_field_decl (FIELD_DECL, tag_identifier, ! delta_type_node); ! fields[1] = build_lang_field_decl (FIELD_DECL, vb_off_identifier, ! delta_type_node); ! fields[2] = build_lang_field_decl (FIELD_DECL, delta_identifier, ! delta_type_node); ! fields[3] = build_lang_field_decl (FIELD_DECL, index_identifier, ! delta_type_node); ! fields[4] = build_lang_field_decl (FIELD_DECL, pfn_identifier, ptr_type_node); ! ! /* Set the alignment to the max of the alignment of ptr_type_node and ! delta_type_node. Double alignment wastes a word on the Sparc. */ ! finish_builtin_type (sigtable_entry_type, SIGTABLE_PTR_TYPE, fields, 4, ! (TYPE_ALIGN (ptr_type_node) > TYPE_ALIGN (delta_type_node)) ! ? ptr_type_node ! : delta_type_node); ! ! /* Make this part of an invisible union. */ ! fields[5] = copy_node (fields[4]); ! TREE_TYPE (fields[5]) = delta_type_node; ! DECL_NAME (fields[5]) = vt_off_identifier; ! DECL_MODE (fields[5]) = TYPE_MODE (delta_type_node); ! DECL_SIZE (fields[5]) = TYPE_SIZE (delta_type_node); ! TREE_UNSIGNED (fields[5]) = 0; ! TREE_CHAIN (fields[4]) = fields[5]; ! sigtable_entry_type = build_type_variant (sigtable_entry_type, 1, 0); record_builtin_type (RID_MAX, SIGTABLE_PTR_TYPE, sigtable_entry_type); *************** *** 5258,5266 **** __m_desc_type_node = make_lang_type (RECORD_TYPE); __t_desc_array_type = ! build_array_type (TYPE_POINTER_TO (__t_desc_type_node), NULL_TREE); __i_desc_array_type = ! build_array_type (TYPE_POINTER_TO (__i_desc_type_node), NULL_TREE); __m_desc_array_type = ! build_array_type (TYPE_POINTER_TO (__m_desc_type_node), NULL_TREE); fields[0] = build_lang_field_decl (FIELD_DECL, get_identifier ("name"), --- 5407,5415 ---- __m_desc_type_node = make_lang_type (RECORD_TYPE); __t_desc_array_type = ! build_array_type (build_pointer_type (__t_desc_type_node), NULL_TREE); __i_desc_array_type = ! build_array_type (build_pointer_type (__i_desc_type_node), NULL_TREE); __m_desc_array_type = ! build_array_type (build_pointer_type (__m_desc_type_node), NULL_TREE); fields[0] = build_lang_field_decl (FIELD_DECL, get_identifier ("name"), *************** *** 5272,5276 **** fields[3] = build_lang_field_decl (FIELD_DECL, get_identifier ("points_to"), ! TYPE_POINTER_TO (__t_desc_type_node)); fields[4] = build_lang_field_decl (FIELD_DECL, get_identifier ("ivars_count"), --- 5421,5425 ---- fields[3] = build_lang_field_decl (FIELD_DECL, get_identifier ("points_to"), ! build_pointer_type (__t_desc_type_node)); fields[4] = build_lang_field_decl (FIELD_DECL, get_identifier ("ivars_count"), *************** *** 5306,5310 **** integer_type_node); fields[2] = build_lang_field_decl (FIELD_DECL, get_identifier ("type"), ! TYPE_POINTER_TO (__t_desc_type_node)); finish_builtin_type (__i_desc_type_node, "__i_desc", fields, 2, integer_type_node); --- 5455,5459 ---- integer_type_node); fields[2] = build_lang_field_decl (FIELD_DECL, get_identifier ("type"), ! build_pointer_type (__t_desc_type_node)); finish_builtin_type (__i_desc_type_node, "__i_desc", fields, 2, integer_type_node); *************** *** 5330,5336 **** integer_type_node); fields[2] = build_lang_field_decl (FIELD_DECL, get_identifier ("vcontext"), ! TYPE_POINTER_TO (__t_desc_type_node)); fields[3] = build_lang_field_decl (FIELD_DECL, get_identifier ("return_type"), ! TYPE_POINTER_TO (__t_desc_type_node)); fields[4] = build_lang_field_decl (FIELD_DECL, get_identifier ("address"), build_pointer_type (default_function_type)); --- 5479,5485 ---- integer_type_node); fields[2] = build_lang_field_decl (FIELD_DECL, get_identifier ("vcontext"), ! build_pointer_type (__t_desc_type_node)); fields[3] = build_lang_field_decl (FIELD_DECL, get_identifier ("return_type"), ! build_pointer_type (__t_desc_type_node)); fields[4] = build_lang_field_decl (FIELD_DECL, get_identifier ("address"), build_pointer_type (default_function_type)); *************** *** 5340,5344 **** short_integer_type_node); fields[7] = build_lang_field_decl (FIELD_DECL, get_identifier ("parm_types"), ! build_pointer_type (build_array_type (TYPE_POINTER_TO (__t_desc_type_node), NULL_TREE))); finish_builtin_type (__m_desc_type_node, "__m_desc", fields, 7, integer_type_node); --- 5489,5493 ---- short_integer_type_node); fields[7] = build_lang_field_decl (FIELD_DECL, get_identifier ("parm_types"), ! build_pointer_type (build_array_type (build_pointer_type (__t_desc_type_node), NULL_TREE))); finish_builtin_type (__m_desc_type_node, "__m_desc", fields, 7, integer_type_node); *************** *** 5581,5585 **** { tree decl = grokdeclarator (NULL_TREE, declspecs, NORMAL, 0, ! NULL_TREE); finish_anon_union (decl); } --- 5730,5734 ---- { tree decl = grokdeclarator (NULL_TREE, declspecs, NORMAL, 0, ! NULL_TREE, NULL_TREE); finish_anon_union (decl); } *************** *** 5622,5626 **** return grokdeclarator (TREE_VALUE (typename), TREE_PURPOSE (typename), ! TYPENAME, 0, NULL_TREE); } --- 5771,5775 ---- return grokdeclarator (TREE_VALUE (typename), TREE_PURPOSE (typename), ! TYPENAME, 0, NULL_TREE, NULL_TREE); } *************** *** 5666,5670 **** } ! decl = grokdeclarator (declarator, declspecs, NORMAL, initialized, raises); if (decl == NULL_TREE || decl == void_type_node) return NULL_TREE; --- 5815,5820 ---- } ! decl = grokdeclarator (declarator, declspecs, NORMAL, initialized, raises, ! NULL_TREE); if (decl == NULL_TREE || decl == void_type_node) return NULL_TREE; *************** *** 5841,5851 **** decl = field; } ! ! /* If it was not explicitly declared `extern', ! revoke any previous claims of DECL_EXTERNAL. */ ! if (DECL_THIS_EXTERN (decl) == 0) ! DECL_EXTERNAL (decl) = 0; if (DECL_LANG_SPECIFIC (decl)) DECL_IN_AGGR_P (decl) = 0; pushclass (context, 2); } --- 5991,6013 ---- decl = field; } ! else ! { ! tree field = check_classfn (context, NULL_TREE, decl); ! if (field && duplicate_decls (decl, field)) ! decl = field; ! } ! ! /* cp_finish_decl sets DECL_EXTERNAL if DECL_IN_AGGR_P is set. */ if (DECL_LANG_SPECIFIC (decl)) DECL_IN_AGGR_P (decl) = 0; + if (DECL_USE_TEMPLATE (decl) || CLASSTYPE_USE_TEMPLATE (context)) + SET_DECL_TEMPLATE_SPECIALIZATION (decl); + + /* Stupid stupid stupid stupid (jason 7/21/95) */ + if (pedantic && DECL_EXTERNAL (decl) + && ! DECL_TEMPLATE_SPECIALIZATION (decl)) + cp_pedwarn ("declaration of `%#D' outside of class is not definition", + decl); + pushclass (context, 2); } *************** *** 5994,5998 **** TREE_TYPE (tmp_addr) = build_pointer_type (target_type); ! DECL_INITIAL (decl) = convert (TYPE_POINTER_TO (target_type), tmp_addr); TREE_TYPE (DECL_INITIAL (decl)) = type; if (TYPE_NEEDS_CONSTRUCTING (target_type)) --- 6156,6160 ---- TREE_TYPE (tmp_addr) = build_pointer_type (target_type); ! DECL_INITIAL (decl) = convert (build_pointer_type (target_type), tmp_addr); TREE_TYPE (DECL_INITIAL (decl)) = type; if (TYPE_NEEDS_CONSTRUCTING (target_type)) *************** *** 6102,6106 **** { *cleanupp = build_delete ! (TYPE_POINTER_TO (subtype), build_unary_op (ADDR_EXPR, TREE_OPERAND (tmp, 0), 0), integer_two_node, LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 0); --- 6264,6268 ---- { *cleanupp = build_delete ! (build_pointer_type (subtype), build_unary_op (ADDR_EXPR, TREE_OPERAND (tmp, 0), 0), integer_two_node, LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 0); *************** *** 6345,6349 **** else if (TREE_CODE (init) == CONSTRUCTOR) { ! if (TYPE_NEEDS_CONSTRUCTING (type)) { cp_error ("`%D' must be initialized by constructor, not by `{...}'", --- 6507,6511 ---- else if (TREE_CODE (init) == CONSTRUCTOR) { ! if (TYPE_NON_AGGREGATE_CLASS (type)) { cp_error ("`%D' must be initialized by constructor, not by `{...}'", *************** *** 6354,6398 **** goto dont_use_constructor; } - #if 0 - /* fix this in `build_functional_cast' instead. - Here's the trigger code: - - struct ostream - { - ostream (); - ostream (int, char *); - ostream (char *); - operator char *(); - ostream (void *); - operator void *(); - operator << (int); - }; - int buf_size = 1024; - static char buf[buf_size]; - const char *debug(int i) { - char *b = &buf[0]; - ostream o = ostream(buf_size, b); - o << i; - return buf; - } - */ - - else if (TREE_CODE (init) == TARGET_EXPR - && TREE_CODE (TREE_OPERAND (init, 1) == NEW_EXPR)) - { - /* User wrote something like `foo x = foo (args)' */ - my_friendly_assert (TREE_CODE (TREE_OPERAND (init, 0)) == VAR_DECL, 150); - my_friendly_assert (DECL_NAME (TREE_OPERAND (init, 0)) == NULL_TREE, 151); - - /* User wrote exactly `foo x = foo (args)' */ - if (TYPE_MAIN_VARIANT (type) == TREE_TYPE (init)) - { - init = build (CALL_EXPR, TREE_TYPE (init), - TREE_OPERAND (TREE_OPERAND (init, 1), 0), - TREE_OPERAND (TREE_OPERAND (init, 1), 1), 0); - TREE_SIDE_EFFECTS (init) = 1; - } - } - #endif } else --- 6516,6519 ---- *************** *** 6689,6697 **** { /* Cleanups for static variables are handled by `finish_file'. */ ! if (TYPE_NEEDS_CONSTRUCTING (type) || init != NULL_TREE) expand_static_init (decl, init); - else if (TYPE_NEEDS_DESTRUCTOR (type)) - static_aggregates = perm_tree_cons (NULL_TREE, decl, - static_aggregates); /* Make entry in appropriate vector. */ --- 6810,6816 ---- { /* Cleanups for static variables are handled by `finish_file'. */ ! if (TYPE_NEEDS_CONSTRUCTING (type) || init != NULL_TREE ! || TYPE_NEEDS_DESTRUCTOR (type)) expand_static_init (decl, init); /* Make entry in appropriate vector. */ *************** *** 6728,6732 **** /* XXX: Why don't we use decl here? */ /* Ans: Because it was already expanded? */ ! if (! expand_decl_cleanup (NULL_TREE, cleanup)) cp_error ("parser lost in parsing declaration of `%D'", decl); --- 6847,6851 ---- /* XXX: Why don't we use decl here? */ /* Ans: Because it was already expanded? */ ! if (! cp_expand_decl_cleanup (NULL_TREE, cleanup)) cp_error ("parser lost in parsing declaration of `%D'", decl); *************** *** 6758,6762 **** if (cleanup) { ! if (! expand_decl_cleanup (decl, cleanup)) cp_error ("parser lost in parsing declaration of `%D'", decl); --- 6877,6881 ---- if (cleanup) { ! if (! cp_expand_decl_cleanup (decl, cleanup)) cp_error ("parser lost in parsing declaration of `%D'", decl); *************** *** 6772,6776 **** I.e., Foo::x = 10; */ { ! tree context = DECL_CONTEXT (decl); if (context && TREE_CODE_CLASS (TREE_CODE (context)) == 't' --- 6891,6895 ---- I.e., Foo::x = 10; */ { ! tree context = DECL_REAL_CONTEXT (decl); if (context && TREE_CODE_CLASS (TREE_CODE (context)) == 't' *************** *** 6866,6870 **** expand_assignment (temp, integer_one_node, 0, 0); if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)) ! || TREE_CODE (init) == TREE_LIST) { expand_aggr_init (decl, init, 0, 0); --- 6985,6989 ---- expand_assignment (temp, integer_one_node, 0, 0); if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)) ! || (init && TREE_CODE (init) == TREE_LIST)) { expand_aggr_init (decl, init, 0, 0); *************** *** 6871,6876 **** do_pending_stack_adjust (); } ! else expand_assignment (decl, init, 0, 0); /* Cleanup any temporaries needed for the initial value. */ expand_cleanups_to (old_cleanups); --- 6990,6996 ---- do_pending_stack_adjust (); } ! else if (init) expand_assignment (decl, init, 0, 0); + /* Cleanup any temporaries needed for the initial value. */ expand_cleanups_to (old_cleanups); *************** *** 6956,6960 **** TYPE_DOMAIN (type) = build_index_type (maxindex); ! if (!TREE_TYPE (maxindex)) TREE_TYPE (maxindex) = TYPE_DOMAIN (type); if (initial_value) --- 7076,7080 ---- TYPE_DOMAIN (type) = build_index_type (maxindex); ! if (! TREE_TYPE (maxindex)) TREE_TYPE (maxindex) = TYPE_DOMAIN (type); if (initial_value) *************** *** 6964,6967 **** --- 7084,7092 ---- if (itype && !TYPE_DOMAIN (itype)) TYPE_DOMAIN (itype) = TYPE_DOMAIN (type); + /* The type of the main variant should never be used for arrays + of different sizes. It should only ever be completed with the + size of the array. */ + if (! TYPE_DOMAIN (TYPE_MAIN_VARIANT (type))) + TYPE_DOMAIN (TYPE_MAIN_VARIANT (type)) = TYPE_DOMAIN (type); } *************** *** 7025,7029 **** static tree grokfndecl (ctype, type, declarator, virtualp, flags, quals, ! raises, check, publicp, inlinep) tree ctype, type; tree declarator; --- 7150,7154 ---- static tree grokfndecl (ctype, type, declarator, virtualp, flags, quals, ! raises, attrlist, check, publicp, inlinep) tree ctype, type; tree declarator; *************** *** 7030,7034 **** int virtualp; enum overload_flags flags; ! tree quals, raises; int check, publicp, inlinep; { --- 7155,7159 ---- int virtualp; enum overload_flags flags; ! tree quals, raises, attrlist; int check, publicp, inlinep; { *************** *** 7044,7048 **** if (raises) { ! type = build_exception_variant (ctype, type, raises); raises = TYPE_RAISES_EXCEPTIONS (type); } --- 7169,7173 ---- if (raises) { ! type = build_exception_variant (type, raises); raises = TYPE_RAISES_EXCEPTIONS (type); } *************** *** 7165,7168 **** --- 7290,7297 ---- DECL_CHAIN (decl) = NULL_TREE; } + + if (attrlist) + cplus_decl_attributes (decl, TREE_PURPOSE (attrlist), + TREE_VALUE (attrlist)); make_decl_rtl (decl, NULL_PTR, 1); } *************** *** 7215,7219 **** if (raises) { ! type = build_exception_variant (ctype, type, raises); raises = TYPE_RAISES_EXCEPTIONS (type); } --- 7344,7348 ---- if (raises) { ! type = build_exception_variant (type, raises); raises = TYPE_RAISES_EXCEPTIONS (type); } *************** *** 7293,7297 **** { TREE_PUBLIC (decl) = (RIDBIT_NOTSETP (RID_STATIC, specbits) ! && (DECL_EXTERNAL (decl) || ! constp)); TREE_STATIC (decl) = ! DECL_EXTERNAL (decl); } --- 7422,7426 ---- { TREE_PUBLIC (decl) = (RIDBIT_NOTSETP (RID_STATIC, specbits) ! && (DECL_THIS_EXTERN (decl) || ! constp)); TREE_STATIC (decl) = ! DECL_EXTERNAL (decl); } *************** *** 7325,7328 **** --- 7454,7458 ---- u = make_lang_type (UNION_TYPE); + IS_AGGR_TYPE (u) = 0; fields[0] = build_lang_field_decl (FIELD_DECL, pfn_identifier, type); fields[1] = build_lang_field_decl (FIELD_DECL, delta2_identifier, *************** *** 7417,7421 **** tree ! grokdeclarator (declarator, declspecs, decl_context, initialized, raises) tree declspecs; tree declarator; --- 7547,7551 ---- tree ! grokdeclarator (declarator, declspecs, decl_context, initialized, raises, attrlist) tree declspecs; tree declarator; *************** *** 7422,7426 **** enum decl_context decl_context; int initialized; ! tree raises; { RID_BIT_TYPE specbits; --- 7552,7556 ---- enum decl_context decl_context; int initialized; ! tree raises, attrlist; { RID_BIT_TYPE specbits; *************** *** 7859,7863 **** type = void_type_node; else if (return_type == return_ctor) ! type = TYPE_POINTER_TO (ctor_return_type); else if (return_type == return_conversion) type = ctor_return_type; --- 7989,7993 ---- type = void_type_node; else if (return_type == return_ctor) ! type = build_pointer_type (ctor_return_type); else if (return_type == return_conversion) type = ctor_return_type; *************** *** 7902,7906 **** { error ("return type specification for constructor invalid"); ! type = TYPE_POINTER_TO (ctor_return_type); } else if (return_type == return_conversion) --- 8032,8036 ---- { error ("return type specification for constructor invalid"); ! type = build_pointer_type (ctor_return_type); } else if (return_type == return_conversion) *************** *** 8069,8082 **** RIDBIT_RESET (RID_MUTABLE, specbits); } - else if (constp) - { - error ("const `%s' cannot be declared `mutable'", name); - RIDBIT_RESET (RID_MUTABLE, specbits); - } - else if (staticp) - { - error ("static `%s' cannot be declared `mutable'", name); - RIDBIT_RESET (RID_MUTABLE, specbits); - } #if 0 if (RIDBIT_SETP (RID_TYPEDEF, specbits)) --- 8199,8202 ---- *************** *** 8225,8229 **** loc_typedecl = ! grokdeclarator (declarator, declspecs, FIELD, 0, NULL_TREE); if (previous_declspec) --- 8345,8349 ---- loc_typedecl = ! grokdeclarator (declarator, declspecs, FIELD, 0, NULL_TREE, NULL_TREE); if (previous_declspec) *************** *** 8478,8482 **** --- 8598,8608 ---- if (TREE_CONSTANT (size)) { + int old_flag_pedantic_errors = flag_pedantic_errors; + int old_pedantic = pedantic; + pedantic = flag_pedantic_errors = 1; + /* Always give overflow errors on array subscripts. */ constant_expression_warning (size); + pedantic = old_pedantic; + flag_pedantic_errors = old_flag_pedantic_errors; if (INT_CST_LT (size, integer_zero_node)) { *************** *** 8638,8642 **** error ("return value type specifier for constructor ignored"); } ! type = TYPE_POINTER_TO (ctype); if (decl_context == FIELD && IS_SIGNATURE (current_class_type)) --- 8764,8768 ---- error ("return value type specifier for constructor ignored"); } ! type = build_pointer_type (ctype); if (decl_context == FIELD && IS_SIGNATURE (current_class_type)) *************** *** 9053,9056 **** --- 9179,9196 ---- /* If this is declaring a typedef name, return a TYPE_DECL. */ + if (RIDBIT_SETP (RID_MUTABLE, specbits)) + { + if (constp) + { + error ("const `%s' cannot be declared `mutable'", name); + RIDBIT_RESET (RID_MUTABLE, specbits); + } + else if (staticp) + { + error ("static `%s' cannot be declared `mutable'", name); + RIDBIT_RESET (RID_MUTABLE, specbits); + } + } + if (RIDBIT_SETP (RID_TYPEDEF, specbits)) { *************** *** 9343,9348 **** || ! (funcdef_flag < 0 || inlinep)); decl = grokfndecl (ctype, type, declarator, ! virtualp, flags, quals, ! raises, friendp ? -1 : 0, publicp, inlinep); if (decl == NULL_TREE) return NULL_TREE; --- 9483,9488 ---- || ! (funcdef_flag < 0 || inlinep)); decl = grokfndecl (ctype, type, declarator, ! virtualp, flags, quals, raises, attrlist, ! friendp ? -1 : 0, publicp, inlinep); if (decl == NULL_TREE) return NULL_TREE; *************** *** 9359,9364 **** TREE_PUBLIC, also. */ decl = grokfndecl (ctype, type, declarator, ! virtualp, flags, quals, ! raises, friendp ? -1 : 0, 1, 0); if (decl == NULL_TREE) return NULL_TREE; --- 9499,9504 ---- TREE_PUBLIC, also. */ decl = grokfndecl (ctype, type, declarator, ! virtualp, flags, quals, raises, attrlist, ! friendp ? -1 : 0, 1, 0); if (decl == NULL_TREE) return NULL_TREE; *************** *** 9453,9456 **** --- 9593,9601 ---- if (staticp || (constp && initialized)) { + /* ANSI C++ Apr '95 wp 9.2 */ + if (staticp && declarator == current_class_name) + cp_pedwarn ("ANSI C++ forbids static member `%D' with same name as enclosing class", + declarator); + /* C++ allows static class members. All other work for this is done by grokfield. *************** *** 9534,9539 **** decl = grokfndecl (ctype, type, original_name, ! virtualp, flags, quals, ! raises, processing_template_decl ? 0 : friendp ? 2 : 1, publicp, inlinep); --- 9679,9683 ---- decl = grokfndecl (ctype, type, original_name, ! virtualp, flags, quals, raises, attrlist, processing_template_decl ? 0 : friendp ? 2 : 1, publicp, inlinep); *************** *** 9608,9613 **** if (staticp == 1) { ! cp_error ("static member `%D' re-declared as static", ! decl); staticp = 0; RIDBIT_RESET (RID_STATIC, specbits); --- 9752,9756 ---- if (staticp == 1) { ! cp_pedwarn ("static member `%D' re-declared as static", decl); staticp = 0; RIDBIT_RESET (RID_STATIC, specbits); *************** *** 9618,9625 **** RIDBIT_RESET (RID_REGISTER, specbits); } ! if (RIDBIT_SETP (RID_EXTERN, specbits)) { ! cp_error ("cannot explicitly declare member `%#D' to have extern linkage", ! decl); RIDBIT_RESET (RID_EXTERN, specbits); } --- 9761,9768 ---- RIDBIT_RESET (RID_REGISTER, specbits); } ! if (RIDBIT_SETP (RID_EXTERN, specbits) && pedantic) { ! cp_pedwarn ("cannot explicitly declare member `%#D' to have extern linkage", ! decl); RIDBIT_RESET (RID_EXTERN, specbits); } *************** *** 9824,9828 **** decl = grokdeclarator (TREE_VALUE (decl), TREE_PURPOSE (decl), ! PARM, init != NULL_TREE, NULL_TREE); if (! decl) continue; --- 9967,9972 ---- decl = grokdeclarator (TREE_VALUE (decl), TREE_PURPOSE (decl), ! PARM, init != NULL_TREE, ! NULL_TREE, NULL_TREE); if (! decl) continue; *************** *** 10949,10954 **** int ! start_function (declspecs, declarator, raises, pre_parsed_p) ! tree declarator, declspecs, raises; int pre_parsed_p; { --- 11093,11098 ---- int ! start_function (declspecs, declarator, raises, attrs, pre_parsed_p) ! tree declspecs, declarator, raises, attrs; int pre_parsed_p; { *************** *** 10981,10984 **** --- 11125,11129 ---- current_base_init_list = NULL_TREE; current_member_init_list = NULL_TREE; + ctor_label = dtor_label = NULL_TREE; clear_temp_name (); *************** *** 11008,11011 **** --- 11153,11166 ---- } + /* This can happen if a template class is instantiated as part of the + specialization of a member function which is defined in the class + template. We should just use the specialization, but for now give an + error. */ + if (DECL_INITIAL (decl1) != NULL_TREE) + { + cp_error_at ("specialization of `%#D' not supported", decl1); + cp_error ("when defined in the class template body", decl1); + } + last_function_parms = DECL_ARGUMENTS (decl1); last_function_parm_tags = NULL_TREE; *************** *** 11034,11041 **** /* In a fcn definition, arg types must be complete. */ require_complete_types_for_parms (last_function_parms); } else { ! decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, raises); /* If the declarator is not suitable for a function definition, cause a syntax error. */ --- 11189,11205 ---- /* In a fcn definition, arg types must be complete. */ require_complete_types_for_parms (last_function_parms); + + /* In case some arg types were completed since the declaration was + parsed, fix up the decls. */ + { + tree t = last_function_parms; + for (; t; t = TREE_CHAIN (t)) + layout_decl (t, 0); + } } else { ! decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, raises, ! NULL_TREE); /* If the declarator is not suitable for a function definition, cause a syntax error. */ *************** *** 11112,11116 **** = build_function_type (void_type_node, TYPE_ARG_TYPES (TREE_TYPE (decl1))); ! DECL_RESULT (decl1) = build_decl (RESULT_DECL, 0, TREE_TYPE (fntype)); } --- 11276,11283 ---- = build_function_type (void_type_node, TYPE_ARG_TYPES (TREE_TYPE (decl1))); ! DECL_RESULT (decl1) ! = build_decl (RESULT_DECL, 0, TYPE_MAIN_VARIANT (TREE_TYPE (fntype))); ! TREE_READONLY (DECL_RESULT (decl1)) = TYPE_READONLY (TREE_TYPE (fntype)); ! TREE_THIS_VOLATILE (DECL_RESULT (decl1)) = TYPE_VOLATILE (TREE_TYPE (fntype)); } *************** *** 11207,11211 **** and `current_class_decl'. */ tree t = last_function_parms; - int i = suspend_momentary (); my_friendly_assert (t != NULL_TREE --- 11374,11377 ---- *************** *** 11212,11220 **** && TREE_CODE (t) == PARM_DECL, 162); ! /* Fool build_indirect_ref. */ ! current_class_decl = NULL_TREE; ! C_C_D = build_indirect_ref (t, NULL_PTR); ! current_class_decl = t; ! resume_momentary (i); } } --- 11378,11395 ---- && TREE_CODE (t) == PARM_DECL, 162); ! if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE) ! { ! int i = suspend_momentary (); ! ! /* Fool build_indirect_ref. */ ! current_class_decl = NULL_TREE; ! C_C_D = build_indirect_ref (t, NULL_PTR); ! current_class_decl = t; ! resume_momentary (i); ! } ! else ! /* We're having a signature pointer here. */ ! C_C_D = current_class_decl = t; ! } } *************** *** 11238,11241 **** --- 11413,11418 ---- GNU_xref_function (decl1, current_function_parms); + if (attrs) + cplus_decl_attributes (decl1, NULL_TREE, attrs); make_function_rtl (decl1); *************** *** 11258,11264 **** } if (DECL_RESULT (decl1) == NULL_TREE) ! DECL_RESULT (decl1) = build_decl (RESULT_DECL, 0, restype); ! if (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (decl1))) { dtor_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); --- 11435,11447 ---- } if (DECL_RESULT (decl1) == NULL_TREE) ! { ! DECL_RESULT (decl1) ! = build_decl (RESULT_DECL, 0, TYPE_MAIN_VARIANT (restype)); ! TREE_READONLY (DECL_RESULT (decl1)) = TYPE_READONLY (restype); ! TREE_THIS_VOLATILE (DECL_RESULT (decl1)) = TYPE_VOLATILE (restype); ! } ! if (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (decl1)) ! && DECL_LANGUAGE (decl1) == lang_cplusplus) { dtor_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); *************** *** 11280,11283 **** --- 11463,11490 ---- } + void + expand_start_early_try_stmts () + { + rtx insns; + start_sequence (); + expand_start_try_stmts (); + insns = get_insns (); + end_sequence (); + store_in_parms (insns); + } + + void + store_in_parms (insns) + rtx insns; + { + rtx last_parm_insn; + + last_parm_insn = get_first_nonparm_insn (); + if (last_parm_insn == NULL_RTX) + emit_insns (insns); + else + emit_insns_before (insns, previous_insn (last_parm_insn)); + } + /* Store the parameter declarations into the current function declaration. This is called after parsing the parameter declarations, before *************** *** 11369,11373 **** { expand_decl (parm); ! if (! expand_decl_cleanup (parm, cleanup)) cp_error ("parser lost in parsing declaration of `%D'", parm); --- 11576,11580 ---- { expand_decl (parm); ! if (! cp_expand_decl_cleanup (parm, cleanup)) cp_error ("parser lost in parsing declaration of `%D'", parm); *************** *** 11419,11423 **** { maybe_gc_cleanup = build_tree_list (NULL_TREE, error_mark_node); ! if (! expand_decl_cleanup (NULL_TREE, maybe_gc_cleanup)) cp_error ("parser lost in parsing declaration of `%D'", fndecl); } --- 11626,11630 ---- { maybe_gc_cleanup = build_tree_list (NULL_TREE, error_mark_node); ! if (! cp_expand_decl_cleanup (NULL_TREE, maybe_gc_cleanup)) cp_error ("parser lost in parsing declaration of `%D'", fndecl); } *************** *** 11441,11444 **** --- 11648,11671 ---- #endif } + + /* Take care of exception handling things. */ + if (flag_handle_exceptions) + { + rtx insns; + start_sequence (); + + /* Mark the start of a stack unwinder if we need one. */ + start_eh_unwinder (); + + /* Do the starting of the exception specifications, if we have any. */ + if (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl))) + expand_start_eh_spec (); + + insns = get_insns (); + end_sequence (); + + if (insns) + store_in_parms (insns); + } } *************** *** 11515,11519 **** register tree fndecl = current_function_decl; tree fntype, ctype = NULL_TREE; ! rtx head, last_parm_insn, mark; /* Label to use if this function is supposed to return a value. */ tree no_return_label = NULL_TREE; --- 11742,11746 ---- register tree fndecl = current_function_decl; tree fntype, ctype = NULL_TREE; ! rtx last_parm_insn, insns; /* Label to use if this function is supposed to return a value. */ tree no_return_label = NULL_TREE; *************** *** 11577,11586 **** /* If this destructor is empty, then we don't need to check whether `this' is NULL in some cases. */ - mark = get_last_insn (); - last_parm_insn = get_first_nonparm_insn (); - if ((flag_this_is_variable & 1) == 0) ok_to_optimize_dtor = 1; ! else if (mark == last_parm_insn) ok_to_optimize_dtor = (n_baseclasses == 0 --- 11804,11810 ---- /* If this destructor is empty, then we don't need to check whether `this' is NULL in some cases. */ if ((flag_this_is_variable & 1) == 0) ok_to_optimize_dtor = 1; ! else if (get_last_insn () == get_first_nonparm_insn ()) ok_to_optimize_dtor = (n_baseclasses == 0 *************** *** 11647,11652 **** if (TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (vbases))) { ! tree ptr = convert_pointer_to_vbase (vbases, current_class_decl); ! expand_expr_stmt (build_delete (TYPE_POINTER_TO (BINFO_TYPE (vbases)), ptr, integer_zero_node, LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_HAS_IN_CHARGE, 0)); --- 11871,11876 ---- if (TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (vbases))) { ! tree ptr = convert_pointer_to_vbase (BINFO_TYPE (vbases), current_class_decl); ! expand_expr_stmt (build_delete (build_pointer_type (BINFO_TYPE (vbases)), ptr, integer_zero_node, LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_HAS_IN_CHARGE, 0)); *************** *** 11672,11676 **** build_method_call (build_indirect_ref ! (build1 (NOP_EXPR, TYPE_POINTER_TO (current_class_type), error_mark_node), NULL_PTR), --- 11896,11900 ---- build_method_call (build_indirect_ref ! (build1 (NOP_EXPR, build_pointer_type (current_class_type), error_mark_node), NULL_PTR), *************** *** 11700,11709 **** /* Back to the top of destructor. */ /* Dont execute destructor code if `this' is NULL. */ ! mark = get_last_insn (); ! last_parm_insn = get_first_nonparm_insn (); ! if (last_parm_insn == NULL_RTX) ! last_parm_insn = mark; ! else ! last_parm_insn = previous_insn (last_parm_insn); /* Make all virtual function table pointers in non-virtual base --- 11924,11929 ---- /* Back to the top of destructor. */ /* Dont execute destructor code if `this' is NULL. */ ! ! start_sequence (); /* Make all virtual function table pointers in non-virtual base *************** *** 11719,11724 **** expand_start_cond (cond, 0); } ! if (mark != get_last_insn ()) ! reorder_insns (next_insn (mark), get_last_insn (), last_parm_insn); if (! ok_to_optimize_dtor) expand_end_cond (); --- 11939,11954 ---- expand_start_cond (cond, 0); } ! ! insns = get_insns (); ! end_sequence (); ! ! last_parm_insn = get_first_nonparm_insn (); ! if (last_parm_insn == NULL_RTX) ! last_parm_insn = get_last_insn (); ! else ! last_parm_insn = previous_insn (last_parm_insn); ! ! emit_insns_after (insns, last_parm_insn); ! if (! ok_to_optimize_dtor) expand_end_cond (); *************** *** 11774,11782 **** CLASSTYPE_ABSTRACT_VIRTUALS (current_class_type) = abstract_virtuals; ! /* must keep the first insn safe. */ ! head = get_insns (); ! ! /* this note will come up to the top with us. */ ! mark = get_last_insn (); if (flag_this_is_variable > 0) --- 12004,12008 ---- CLASSTYPE_ABSTRACT_VIRTUALS (current_class_type) = abstract_virtuals; ! start_sequence (); if (flag_this_is_variable > 0) *************** *** 11801,11804 **** --- 12027,12033 ---- } + insns = get_insns (); + end_sequence (); + /* This is where the body of the constructor begins. If there were no insns in this function body, then the *************** *** 11809,11818 **** last_parm_insn = get_first_nonparm_insn (); if (last_parm_insn == NULL_RTX) ! last_parm_insn = mark; else last_parm_insn = previous_insn (last_parm_insn); ! if (mark != get_last_insn ()) ! reorder_insns (next_insn (mark), get_last_insn (), last_parm_insn); end_protect_partials (); --- 12038,12046 ---- last_parm_insn = get_first_nonparm_insn (); if (last_parm_insn == NULL_RTX) ! last_parm_insn = get_last_insn (); else last_parm_insn = previous_insn (last_parm_insn); ! emit_insns_after (insns, last_parm_insn); end_protect_partials (); *************** *** 11911,11915 **** if (flag_handle_exceptions) ! expand_exception_blocks(); /* This must come after expand_function_end because cleanups might --- 12139,12143 ---- if (flag_handle_exceptions) ! expand_exception_blocks (); /* This must come after expand_function_end because cleanups might *************** *** 12023,12026 **** --- 12251,12255 ---- named_label_uses = NULL_TREE; + current_class_decl = NULL_TREE; } *************** *** 12051,12055 **** tree declarator, declspecs, raises; { ! tree fndecl = grokdeclarator (declarator, declspecs, MEMFUNCDEF, 0, raises); /* Something too ugly to handle. */ --- 12280,12285 ---- tree declarator, declspecs, raises; { ! tree fndecl = grokdeclarator (declarator, declspecs, MEMFUNCDEF, 0, raises, ! NULL_TREE); /* Something too ugly to handle. */ *************** *** 12222,12228 **** tree type; { ! tree decl; ! if (current_binding_level->n_incomplete == 0) return; --- 12452,12458 ---- tree type; { ! tree *list; ! if (current_binding_level->incomplete == NULL_TREE) return; *************** *** 12230,12265 **** return; ! for (decl = current_binding_level->names; decl; decl = TREE_CHAIN (decl)) ! if (TREE_TYPE (decl) == type ! || (TREE_TYPE (decl) ! && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE ! && TREE_TYPE (TREE_TYPE (decl)) == type)) ! { ! if (TREE_CODE (decl) == TYPE_DECL) ! layout_type (TREE_TYPE (decl)); ! else ! { ! int toplevel = toplevel_bindings_p (); ! if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE ! && TREE_TYPE (TREE_TYPE (decl)) == type) ! layout_type (TREE_TYPE (decl)); ! layout_decl (decl, 0); ! rest_of_decl_compilation (decl, NULL_PTR, toplevel, 0); ! if (! toplevel) ! { ! tree cleanup; ! expand_decl (decl); ! cleanup = maybe_build_cleanup (decl); ! expand_decl_init (decl); ! if (! expand_decl_cleanup (decl, cleanup)) ! cp_error ("parser lost in parsing declaration of `%D'", ! decl); ! } ! } ! /* ! my_friendly_assert (current_binding_level->n_incomplete > 0, 164); ! */ ! --current_binding_level->n_incomplete; ! } } --- 12460,12492 ---- return; ! for (list = ¤t_binding_level->incomplete; *list; ) ! { ! tree decl = TREE_VALUE (*list); ! if (decl && TREE_TYPE (decl) == type ! || (TREE_TYPE (decl) ! && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE ! && TREE_TYPE (TREE_TYPE (decl)) == type)) ! { ! int toplevel = toplevel_bindings_p (); ! if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE ! && TREE_TYPE (TREE_TYPE (decl)) == type) ! layout_type (TREE_TYPE (decl)); ! layout_decl (decl, 0); ! rest_of_decl_compilation (decl, NULL_PTR, toplevel, 0); ! if (! toplevel) ! { ! tree cleanup; ! expand_decl (decl); ! cleanup = maybe_build_cleanup (decl); ! expand_decl_init (decl); ! if (! cp_expand_decl_cleanup (decl, cleanup)) ! cp_error ("parser lost in parsing declaration of `%D'", ! decl); ! } ! *list = TREE_CHAIN (*list); ! } ! else ! list = &TREE_CHAIN (*list); ! } } *************** *** 12412,12415 **** --- 12639,12647 ---- tree args = argtypes ? *argtypes : TYPE_ARG_TYPES (function); + if (TYPE_READONLY (TREE_TYPE (TREE_VALUE (args)))) + cp_error ("static member function `%#D' declared const", *decl); + if (TYPE_VOLATILE (TREE_TYPE (TREE_VALUE (args)))) + cp_error ("static member function `%#D' declared volatile", *decl); + args = TREE_CHAIN (args); tmp = build_function_type (TREE_TYPE (function), args); *************** *** 12416,12422 **** tmp = build_type_variant (tmp, TYPE_READONLY (function), TYPE_VOLATILE (function)); ! tmp = build_exception_variant (TYPE_METHOD_BASETYPE (function), tmp, TYPE_RAISES_EXCEPTIONS (function)); TREE_TYPE (*decl) = tmp; DECL_STATIC_FUNCTION_P (*decl) = 1; if (fn) --- 12648,12656 ---- tmp = build_type_variant (tmp, TYPE_READONLY (function), TYPE_VOLATILE (function)); ! tmp = build_exception_variant (tmp, TYPE_RAISES_EXCEPTIONS (function)); TREE_TYPE (*decl) = tmp; + if (DECL_ARGUMENTS (*decl)) + DECL_ARGUMENTS (*decl) = TREE_CHAIN (DECL_ARGUMENTS (*decl)); DECL_STATIC_FUNCTION_P (*decl) = 1; if (fn) *************** *** 12549,12550 **** --- 12783,12878 ---- free (p); } + + /* FSF LOCAL dje prefix attributes */ + /* Split SPECS_ATTRS, a list of declspecs and prefix attributes, into two + lists. SPECS_ATTRS may also be just a typespec (eg: RECORD_TYPE). + + The head of the declspec list is stored in DECLSPECS. + The head of the attribute list is stored in PREFIX_ATTRIBUTES. + + Note that attributes in SPECS_ATTRS are stored in the TREE_PURPOSE of + the list elements. We drop the containing TREE_LIST nodes and link the + resulting attributes together the way decl_attributes expects them. */ + + void + split_specs_attrs (specs_attrs, declspecs, prefix_attributes) + tree specs_attrs; + tree *declspecs, *prefix_attributes; + { + tree t, s, a, next, specs, attrs; + + /* This can happen in c++ (eg: decl: typespec initdecls ';'). */ + if (specs_attrs != NULL_TREE + && TREE_CODE (specs_attrs) != TREE_LIST) + { + *declspecs = specs_attrs; + *prefix_attributes = NULL_TREE; + return; + } + + /* Remember to keep the lists in the same order, element-wise. */ + + specs = s = NULL_TREE; + attrs = a = NULL_TREE; + for (t = specs_attrs; t; t = next) + { + next = TREE_CHAIN (t); + /* Declspecs have a non-NULL TREE_VALUE. */ + if (TREE_VALUE (t) != NULL_TREE) + { + if (specs == NULL_TREE) + specs = s = t; + else + { + TREE_CHAIN (s) = t; + s = t; + } + } + else + { + if (attrs == NULL_TREE) + attrs = a = TREE_PURPOSE (t); + else + { + TREE_CHAIN (a) = TREE_PURPOSE (t); + a = TREE_PURPOSE (t); + } + } + } + + /* Terminate the lists. */ + if (s != NULL_TREE) + TREE_CHAIN (s) = NULL_TREE; + if (a != NULL_TREE) + TREE_CHAIN (a) = NULL_TREE; + + /* All done. */ + *declspecs = specs; + *prefix_attributes = attrs; + } + + /* Strip attributes from SPECS_ATTRS, a list of declspecs and attributes. + This function is used by the parser when a rule will accept attributes + in a particular position, but we don't want to support that just yet. + + A warning is issued for every ignored attribute. */ + + tree + strip_attrs (specs_attrs) + tree specs_attrs; + { + tree specs, attrs; + + split_specs_attrs (specs_attrs, &specs, &attrs); + + while (attrs) + { + warning ("`%s' attribute ignored", + IDENTIFIER_POINTER (TREE_PURPOSE (attrs))); + attrs = TREE_CHAIN (attrs); + } + + return specs; + } + /* END FSF LOCAL */ + diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/decl.h gcc-2.7.1/cp/decl.h *** gcc-2.7.0/cp/decl.h Thu Jun 15 08:19:50 1995 --- gcc-2.7.1/cp/decl.h Wed Oct 11 22:28:39 1995 *************** *** 31,34 **** --- 31,37 ---- }; + /* We need this in here to get the decl_context definition. */ + extern tree grokdeclarator PROTO((tree, tree, enum decl_context, int, tree, tree)); + /* C++: Keep these around to reduce calls to `get_identifier'. Identifiers for `this' in member functions and the auto-delete diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/decl2.c gcc-2.7.1/cp/decl2.c *** gcc-2.7.0/cp/decl2.c Thu Jun 15 08:20:47 1995 --- gcc-2.7.1/cp/decl2.c Wed Oct 11 22:28:51 1995 *************** *** 1,4 **** /* Process declarations and variables for C compiler. ! Copyright (C) 1988, 1992, 1993, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,4 ---- /* Process declarations and variables for C compiler. ! Copyright (C) 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) *************** *** 39,43 **** #include "defaults.h" - extern tree grokdeclarator (); extern tree get_file_function_name (); extern tree cleanups_this_call; --- 39,42 ---- *************** *** 363,367 **** /* Nonzero if we want the new ANSI rules for pushing a new scope for `for' ! initialization variables. Default to on. */ int flag_new_for_scope = 1; --- 362,370 ---- /* Nonzero if we want the new ANSI rules for pushing a new scope for `for' ! initialization variables. ! 0: Old rules, set by -fno-for-scope. ! 2: New ANSI rules, set by -ffor-scope. ! 1: Try to implement new ANSI rules, but with backup compatibility ! (and warnings). This is the default, for now. */ int flag_new_for_scope = 1; *************** *** 414,418 **** {"check-new", &flag_check_new, 1}, {"repo", &flag_use_repository, 1}, ! {"for-scope", &flag_new_for_scope, 1} }; --- 417,421 ---- {"check-new", &flag_check_new, 1}, {"repo", &flag_use_repository, 1}, ! {"for-scope", &flag_new_for_scope, 2} }; *************** *** 674,678 **** : TYPE_ARG_TYPES (fntype))); if (raises) ! fntype = build_exception_variant (ctype, fntype, raises); TREE_TYPE (function) = fntype; --- 677,681 ---- : TYPE_ARG_TYPES (fntype))); if (raises) ! fntype = build_exception_variant (fntype, raises); TREE_TYPE (function) = fntype; *************** *** 716,721 **** char *sf = input_filename; ! lineno = til->line; ! input_filename = til->file; cp_warning ("template `%#D' instantiated in file without #pragma interface", decl); --- 719,727 ---- char *sf = input_filename; ! if (til) ! { ! lineno = til->line; ! input_filename = til->file; ! } cp_warning ("template `%#D' instantiated in file without #pragma interface", decl); *************** *** 861,864 **** --- 867,872 ---- tree parm; tree qualtype; + tree fntype = TREE_TYPE (function); + tree raises = TYPE_RAISES_EXCEPTIONS (fntype); if (fn_name == NULL_TREE) *************** *** 956,961 **** TREE_CHAIN (last_function_parms) = parm; ! TREE_TYPE (function) = build_cplus_method_type (qualtype, void_type_node, ! arg_types); TYPE_HAS_DESTRUCTOR (ctype) = 1; } --- 964,974 ---- TREE_CHAIN (last_function_parms) = parm; ! fntype = build_cplus_method_type (qualtype, void_type_node, ! arg_types); ! if (raises) ! { ! fntype = build_exception_variant (fntype, raises); ! } ! TREE_TYPE (function) = fntype; TYPE_HAS_DESTRUCTOR (ctype) = 1; } *************** *** 968,975 **** arg_types = hash_tree_chain (integer_type_node, TREE_CHAIN (arg_types)); ! TREE_TYPE (function) ! = build_cplus_method_type (qualtype, ! TREE_TYPE (TREE_TYPE (function)), ! arg_types); arg_types = TYPE_ARG_TYPES (TREE_TYPE (function)); } --- 981,992 ---- arg_types = hash_tree_chain (integer_type_node, TREE_CHAIN (arg_types)); ! fntype = build_cplus_method_type (qualtype, ! TREE_TYPE (TREE_TYPE (function)), ! arg_types); ! if (raises) ! { ! fntype = build_exception_variant (fntype, raises); ! } ! TREE_TYPE (function) = fntype; arg_types = TYPE_ARG_TYPES (TREE_TYPE (function)); } *************** *** 979,983 **** if (TREE_CODE (TREE_TYPE (function)) == FUNCTION_TYPE) /* Only true for static member functions. */ ! these_arg_types = hash_tree_chain (TYPE_POINTER_TO (qualtype), arg_types); --- 996,1000 ---- if (TREE_CODE (TREE_TYPE (function)) == FUNCTION_TYPE) /* Only true for static member functions. */ ! these_arg_types = hash_tree_chain (build_pointer_type (qualtype), arg_types); *************** *** 1210,1214 **** CNAME is the same here as it is for grokclassfn above. */ ! void check_classfn (ctype, cname, function) tree ctype, cname, function; --- 1227,1231 ---- CNAME is the same here as it is for grokclassfn above. */ ! tree check_classfn (ctype, cname, function) tree ctype, cname, function; *************** *** 1226,1231 **** /* First suss out ctors and dtors. */ ! if (*methods ! && (fn_name == cname || fn_name == DECL_NAME (*methods))) goto got_it; --- 1243,1247 ---- /* First suss out ctors and dtors. */ ! if (*methods && fn_name == DECL_NAME (*methods)) goto got_it; *************** *** 1239,1243 **** { if (DECL_ASSEMBLER_NAME (function) == DECL_ASSEMBLER_NAME (fndecl)) ! return; #if 0 /* This should work, but causes libg++ to fail --- 1255,1259 ---- { if (DECL_ASSEMBLER_NAME (function) == DECL_ASSEMBLER_NAME (fndecl)) ! return fndecl; #if 0 /* This should work, but causes libg++ to fail *************** *** 1246,1250 **** the name may have been changed by asm("new_name"). */ if (decls_match (function, fndecl)) ! return; #else if (DECL_NAME (function) == DECL_NAME (fndecl)) --- 1262,1266 ---- the name may have been changed by asm("new_name"). */ if (decls_match (function, fndecl)) ! return fndecl; #else if (DECL_NAME (function) == DECL_NAME (fndecl)) *************** *** 1262,1266 **** TREE_TYPE (TREE_TYPE (fndecl)), 1) && compparms (p1, p2, 3)) ! return; } #endif --- 1278,1287 ---- TREE_TYPE (TREE_TYPE (fndecl)), 1) && compparms (p1, p2, 3)) ! { ! if (DECL_STATIC_FUNCTION_P (fndecl) ! && TREE_CODE (TREE_TYPE (function)) == METHOD_TYPE) ! revert_static_member_fn (&function, NULL, NULL); ! return fndecl; ! } } #endif *************** *** 1273,1278 **** if (methods != end) ! cp_error ("argument list for `%#D' does not match any in class `%T'", ! function, ctype); else { --- 1294,1306 ---- if (methods != end) ! { ! tree fndecl = *methods; ! cp_error ("prototype for `%#D' does not match any in class `%T'", ! function, ctype); ! cp_error_at ("candidate%s: %+#D", DECL_CHAIN (fndecl) ? "s are" : " is", ! fndecl); ! while (fndecl = DECL_CHAIN (fndecl), fndecl) ! cp_error_at (" %#D", fndecl); ! } else { *************** *** 1285,1288 **** --- 1313,1317 ---- avoid spurious errors. */ add_method (ctype, methods, function); + return NULL_TREE; } *************** *** 1308,1313 **** tree ! grokfield (declarator, declspecs, raises, init, asmspec_tree) ! tree declarator, declspecs, raises, init, asmspec_tree; { register tree value; --- 1337,1342 ---- tree ! grokfield (declarator, declspecs, raises, init, asmspec_tree, attrlist) ! tree declarator, declspecs, raises, init, asmspec_tree, attrlist; { register tree value; *************** *** 1334,1338 **** init = NULL_TREE; ! value = grokdeclarator (declarator, declspecs, FIELD, init != 0, raises); if (! value) return value; /* friend or constructor went bad. */ --- 1363,1368 ---- init = NULL_TREE; ! value = grokdeclarator (declarator, declspecs, FIELD, init != 0, ! raises, attrlist); if (! value) return value; /* friend or constructor went bad. */ *************** *** 1506,1509 **** --- 1536,1540 ---- if (TREE_CODE (value) == FUNCTION_DECL) { + check_default_args (value); if (DECL_CHAIN (value) != NULL_TREE) { *************** *** 1548,1552 **** tree declarator, declspecs, width; { ! register tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, NULL_TREE); if (! value) return NULL_TREE; /* friends went bad. */ --- 1579,1584 ---- tree declarator, declspecs, width; { ! register tree value = grokdeclarator (declarator, declspecs, BITFIELD, ! 0, NULL_TREE, NULL_TREE); if (! value) return NULL_TREE; /* friends went bad. */ *************** *** 1751,1755 **** found: decl = grokdeclarator (build_parse_node (CALL_EXPR, type_id, parmlist, NULL_TREE), ! declspecs, FIELD, 0, NULL_TREE); if (decl == NULL_TREE) return NULL_TREE; --- 1783,1787 ---- found: decl = grokdeclarator (build_parse_node (CALL_EXPR, type_id, parmlist, NULL_TREE), ! declspecs, FIELD, 0, NULL_TREE, NULL_TREE); if (decl == NULL_TREE) return NULL_TREE; *************** *** 1794,1798 **** tree declspecs, declarator; { ! tree t = grokdeclarator (declarator, declspecs, TYPENAME, 0, NULL_TREE); return build_typename_overload (t); } --- 1826,1831 ---- tree declspecs, declarator; { ! tree t = grokdeclarator (declarator, declspecs, TYPENAME, 0, ! NULL_TREE, NULL_TREE); return build_typename_overload (t); } *************** *** 2034,2038 **** setup_vtbl_ptr () { ! extern rtx base_init_expr; if (base_init_expr == 0 --- 2067,2071 ---- setup_vtbl_ptr () { ! extern tree base_init_expr; if (base_init_expr == 0 *************** *** 2196,2199 **** --- 2229,2237 ---- continue; + if (TREE_PRIVATE (field)) + cp_pedwarn_at ("private member `%#D' in anonymous union", field); + else if (TREE_PROTECTED (field)) + cp_pedwarn_at ("protected member `%#D' in anonymous union", field); + decl = build_decl (VAR_DECL, DECL_NAME (field), TREE_TYPE (field)); /* tell `pushdecl' that this is not tentative. */ *************** *** 2446,2451 **** tree decl; { ! tree entries = TREE_CHAIN (CONSTRUCTOR_ELTS (DECL_INITIAL (decl))); for (; entries; entries = TREE_CHAIN (entries)) { --- 2484,2491 ---- tree decl; { ! tree entries = CONSTRUCTOR_ELTS (DECL_INITIAL (decl)); + skip_rtti_stuff (&entries); + for (; entries; entries = TREE_CHAIN (entries)) { *************** *** 2754,2758 **** { tree ctype = DECL_CLASS_CONTEXT (decl); ! if (CLASSTYPE_INTERFACE_KNOWN (ctype)) { DECL_NOT_REALLY_EXTERN (decl) --- 2794,2798 ---- { tree ctype = DECL_CLASS_CONTEXT (decl); ! if (CLASSTYPE_INTERFACE_KNOWN (ctype) && ! DECL_ARTIFICIAL (decl)) { DECL_NOT_REALLY_EXTERN (decl) *************** *** 2871,2875 **** fnname = get_file_function_name ('D'); ! start_function (void_list_node, build_parse_node (CALL_EXPR, fnname, void_list_node, NULL_TREE), 0, 0); fnname = DECL_ASSEMBLER_NAME (current_function_decl); store_parm_decls (); --- 2911,2918 ---- fnname = get_file_function_name ('D'); ! start_function (void_list_node, ! build_parse_node (CALL_EXPR, fnname, void_list_node, ! NULL_TREE), ! NULL_TREE, NULL_TREE, 0); fnname = DECL_ASSEMBLER_NAME (current_function_decl); store_parm_decls (); *************** *** 2897,2901 **** { mark_addressable (decl); ! temp = build1 (ADDR_EXPR, TYPE_POINTER_TO (type), decl); } temp = build_delete (TREE_TYPE (temp), temp, --- 2940,2944 ---- { mark_addressable (decl); ! temp = build1 (ADDR_EXPR, build_pointer_type (type), decl); } temp = build_delete (TREE_TYPE (temp), temp, *************** *** 2928,2932 **** { fnname = get_file_function_name ('I'); ! start_function (void_list_node, build_parse_node (CALL_EXPR, fnname, void_list_node, NULL_TREE), 0, 0); fnname = DECL_ASSEMBLER_NAME (current_function_decl); store_parm_decls (); --- 2971,2978 ---- { fnname = get_file_function_name ('I'); ! start_function (void_list_node, ! build_parse_node (CALL_EXPR, fnname, ! void_list_node, NULL_TREE), ! NULL_TREE, NULL_TREE, 0); fnname = DECL_ASSEMBLER_NAME (current_function_decl); store_parm_decls (); *************** *** 2970,3007 **** DECL_STATIC_FUNCTION_P (current_function_decl) = 1; - #if 0 - if (init) - { - if (TREE_CODE (init) == VAR_DECL) - { - /* This behavior results when there are - multiple declarations of an aggregate, - the last of which defines it. */ - if (DECL_RTL (init) == DECL_RTL (decl)) - { - my_friendly_assert (DECL_INITIAL (decl) == error_mark_node - || (TREE_CODE (DECL_INITIAL (decl)) == CONSTRUCTOR - && CONSTRUCTOR_ELTS (DECL_INITIAL (decl)) == NULL_TREE), - 199); - init = DECL_INITIAL (init); - if (TREE_CODE (init) == CONSTRUCTOR - && CONSTRUCTOR_ELTS (init) == NULL_TREE) - init = NULL_TREE; - } - else if (TREE_TYPE (decl) == TREE_TYPE (init)) - { - #if 1 - my_friendly_abort (200); - #else - /* point to real decl's rtl anyway. */ - DECL_RTL (init) = DECL_RTL (decl); - my_friendly_assert (DECL_INITIAL (decl) == error_mark_node, - 201); - init = DECL_INITIAL (init); - #endif /* 1 */ - } - } - } - #endif /* 0 */ if (IS_AGGR_TYPE (TREE_TYPE (decl)) || TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE) --- 3016,3019 ---- *************** *** 3027,3031 **** expand_expr (decl, const0_rtx, VOIDmode, 0); free_temp_slots (); ! expand_aggr_init (build_indirect_ref (decl, NULL_PTR), init, 0, 0); } } --- 3039,3052 ---- expand_expr (decl, const0_rtx, VOIDmode, 0); free_temp_slots (); ! if (TREE_CODE (init) == TREE_VEC) ! { ! expand_expr (expand_vec_init (decl, TREE_VEC_ELT (init, 0), ! TREE_VEC_ELT (init, 1), ! TREE_VEC_ELT (init, 2), 0), ! const0_rtx, VOIDmode, 0); ! free_temp_slots (); ! } ! else ! expand_aggr_init (build_indirect_ref (decl, NULL_PTR), init, 0, 0); } } *************** *** 3050,3053 **** --- 3071,3076 ---- } + expand_builtin_throw (); + permanent_allocation (1); *************** *** 3457,3461 **** tree decl; { ! return error_mark_node; } --- 3480,3487 ---- tree decl; { ! tree type; ! ! /* Ignore for now, unimplemented. */ ! return NULL_TREE; } *************** *** 3464,3466 **** --- 3490,3511 ---- tree namespace; { + } + + void + check_default_args (x) + tree x; + { + tree arg = TYPE_ARG_TYPES (TREE_TYPE (x)); + int saw_def = 0, i = 0 - (TREE_CODE (TREE_TYPE (x)) == METHOD_TYPE); + for (; arg && arg != void_list_node; arg = TREE_CHAIN (arg), ++i) + { + if (TREE_PURPOSE (arg)) + saw_def = 1; + else if (saw_def) + { + cp_error ("default argument missing for parameter %P of `%#D'", + i, x); + break; + } + } } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/errfn.c gcc-2.7.1/cp/errfn.c *** gcc-2.7.0/cp/errfn.c Thu Jun 15 08:21:45 1995 --- gcc-2.7.1/cp/errfn.c Wed Oct 11 22:28:54 1995 *************** *** 1,4 **** /* Provide a call-back mechanism for handling error output. ! Copyright (C) 1993 Free Software Foundation, Inc. Contributed by Jason Merrill (jason@cygnus.com) --- 1,4 ---- /* Provide a call-back mechanism for handling error output. ! Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. Contributed by Jason Merrill (jason@cygnus.com) *************** *** 44,52 **** #define STRDUP(f) (ap = (char *) alloca (strlen (f) +1), strcpy (ap, (f)), ap) ! #define NARGS 3 ! #define arglist a1, a2, a3 ! #define arglist_dcl HOST_WIDE_INT a1, a2, a3; ! #define ARGSINIT args[0] = a1; args[1] = a2; args[2] = a3; ! #define ARGSLIST args[0], args[1], args[2] static void --- 44,52 ---- #define STRDUP(f) (ap = (char *) alloca (strlen (f) +1), strcpy (ap, (f)), ap) ! #define NARGS 4 ! #define arglist a1, a2, a3, a4 ! #define arglist_dcl HOST_WIDE_INT a1, a2, a3, a4; ! #define ARGSINIT args[0] = a1; args[1] = a2; args[2] = a3; args[3] = a4; ! #define ARGSLIST args[0], args[1], args[2], args[3] static void diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/error.c gcc-2.7.1/cp/error.c *** gcc-2.7.0/cp/error.c Thu Jun 15 08:22:04 1995 --- gcc-2.7.1/cp/error.c Wed Oct 11 22:29:00 1995 *************** *** 1,5 **** /* Call-backs for C++ error reporting. This code is non-reentrant. ! Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,5 ---- /* Call-backs for C++ error reporting. This code is non-reentrant. ! Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 36,39 **** --- 36,40 ---- #define P parm_as_string #define T type_as_string + #define V cv_as_string #define _ (cp_printer *) 0 *************** *** 46,50 **** _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x30 */ _, A, _, C, D, E, _, _, _, _, _, _, L, _, _, O, /* 0x40 */ ! P, _, _, _, T, _, _, _, _, _, _, _, _, _, _, _, /* 0x50 */ _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x60 */ _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x70 */ --- 47,51 ---- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x30 */ _, A, _, C, D, E, _, _, _, _, _, _, L, _, _, O, /* 0x40 */ ! P, _, _, _, T, _, V, _, _, _, _, _, _, _, _, _, /* 0x50 */ _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x60 */ _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x70 */ *************** *** 57,60 **** --- 58,62 ---- #undef P #undef T + #undef V #undef _ *************** *** 270,274 **** name = TYPE_NAME (t); ! if (DECL_CONTEXT (name)) { /* FUNCTION_DECL or RECORD_TYPE */ --- 272,276 ---- name = TYPE_NAME (t); ! if (name && DECL_CONTEXT (name)) { /* FUNCTION_DECL or RECORD_TYPE */ *************** *** 278,285 **** /* kludge around weird behavior on g++.brendan/line1.C */ ! if (TREE_CODE (name) != IDENTIFIER_NODE) name = DECL_NAME (name); ! if (ANON_AGGRNAME_P (name)) { OB_PUTS ("{anonymous"); --- 280,287 ---- /* kludge around weird behavior on g++.brendan/line1.C */ ! if (name && TREE_CODE (name) != IDENTIFIER_NODE) name = DECL_NAME (name); ! if (name == 0 || ANON_AGGRNAME_P (name)) { OB_PUTS ("{anonymous"); *************** *** 513,516 **** --- 515,521 ---- tree n = lookup_name (t, 0); + if (n == NULL_TREE) + return NULL_TREE; + if (TREE_CODE (n) == FUNCTION_DECL) return n; *************** *** 644,667 **** can feed identifiers to cp_error and get them demangled properly. */ case IDENTIFIER_NODE: ! if (DESTRUCTOR_NAME_P (t)) ! { ! OB_PUTC ('~'); ! dump_decl (DECL_NAME (ident_fndecl (t)), 0); ! } ! else if (IDENTIFIER_TYPENAME_P (t)) ! { ! OB_PUTS ("operator "); ! /* Not exactly IDENTIFIER_TYPE_VALUE. */ ! dump_type (TREE_TYPE (t), 0); ! break; ! } ! else if (IDENTIFIER_OPNAME_P (t)) ! { ! char *name_string = operator_name_string (t); ! OB_PUTS ("operator "); ! OB_PUTCP (name_string); ! } ! else ! OB_PUTID (t); break; --- 649,676 ---- can feed identifiers to cp_error and get them demangled properly. */ case IDENTIFIER_NODE: ! { tree f; ! if (DESTRUCTOR_NAME_P (t) ! && (f = ident_fndecl (t)) ! && DECL_LANGUAGE (f) == lang_cplusplus) ! { ! OB_PUTC ('~'); ! dump_decl (DECL_NAME (f), 0); ! } ! else if (IDENTIFIER_TYPENAME_P (t)) ! { ! OB_PUTS ("operator "); ! /* Not exactly IDENTIFIER_TYPE_VALUE. */ ! dump_type (TREE_TYPE (t), 0); ! break; ! } ! else if (IDENTIFIER_OPNAME_P (t)) ! { ! char *name_string = operator_name_string (t); ! OB_PUTS ("operator "); ! OB_PUTCP (name_string); ! } ! else ! OB_PUTID (t); ! } break; *************** *** 786,790 **** } ! if (DESTRUCTOR_NAME_P (name)) parmtypes = TREE_CHAIN (parmtypes); --- 795,799 ---- } ! if (DESTRUCTOR_NAME_P (name) && DECL_LANGUAGE (t) == lang_cplusplus) parmtypes = TREE_CHAIN (parmtypes); *************** *** 825,829 **** /* There ought to be a better way to find out whether or not something is a destructor. */ ! if (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (t))) { OB_PUTC ('~'); --- 834,839 ---- /* There ought to be a better way to find out whether or not something is a destructor. */ ! if (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (t)) ! && DECL_LANGUAGE (t) == lang_cplusplus) { OB_PUTC ('~'); *************** *** 1456,1458 **** --- 1466,1482 ---- return type_as_string (p, v); + } + + char * + cv_as_string (p, v) + tree p; + int v; + { + OB_INIT (); + + dump_readonly_or_volatile (p, before); + + OB_FINISH (); + + return (char *)obstack_base (&scratch_obstack); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/except.c gcc-2.7.1/cp/except.c *** gcc-2.7.0/cp/except.c Thu Jun 15 08:22:20 1995 --- gcc-2.7.1/cp/except.c Wed Oct 11 22:29:08 1995 *************** *** 36,155 **** extern void (*interim_eh_hook) PROTO((tree)); /* holds the fndecl for __builtin_return_address () */ tree builtin_return_address_fndecl; - /* Define at your own risk! */ - #ifndef CROSS_COMPILE - #ifdef sun - #ifdef sparc - #define TRY_NEW_EH - #endif - #endif - #ifdef _IBMR2 - #ifndef __rs6000 - #define __rs6000 - #endif - #endif - #ifdef mips - #ifndef __mips - #define __mips - #endif - #endif - #ifdef __i386__ - #ifndef __i386 - #define __i386 - #endif - #endif - #if defined(__i386) || defined(__rs6000) || defined(__hppa) || defined(__mc68000) || defined (__mips) || defined (__arm) || defined (__alpha) - #define TRY_NEW_EH - #endif - #endif - - #ifndef TRY_NEW_EH - - static void - sorry_no_eh () - { - static int warned = 0; - if (! warned) - { - sorry ("exception handling not supported"); - warned = 1; - } - } - - void - expand_exception_blocks () - { - } - - void - start_protect () - { - } - - void - end_protect (finalization) - tree finalization; - { - } - - void - expand_start_try_stmts () - { - sorry_no_eh (); - } - - void - expand_end_try_stmts () - { - } - - void - expand_start_all_catch () - { - } - - void - expand_end_all_catch () - { - } - - void - expand_start_catch_block (declspecs, declarator) - tree declspecs, declarator; - { - } - - void - expand_end_catch_block () - { - } - - void - init_exception_processing () - { - } - - void - expand_throw (exp) - tree exp; - { - sorry_no_eh (); - } - - #else - - /* Make 'label' the first numbered label of the current function */ - void - make_first_label(label) - rtx label; - { - if (CODE_LABEL_NUMBER(label) < get_first_label_num()) - set_new_first_and_last_label_num (CODE_LABEL_NUMBER(label), - max_label_num()); - } - static int doing_eh (do_warn) --- 36,45 ---- extern void (*interim_eh_hook) PROTO((tree)); + rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx)); /* holds the fndecl for __builtin_return_address () */ tree builtin_return_address_fndecl; + tree throw_fndecl; static int doing_eh (do_warn) *************** *** 172,185 **** /* NO GNEWS IS GOOD GNEWS WITH GARRY GNUS: This version is much closer ! to supporting exception handling as per Stroustrup's 2nd edition. It is a complete rewrite of all the EH stuff that was here before Shortcomings: ! 1. The type of the throw and catch must still match ! exactly (no support yet for matching base classes) ! 2. Throw specifications of functions still don't work. Cool Things: 1. Destructors are called properly :-) 2. No overhead for the non-exception thrown case. ! 3. Fixing shortcomings 1 and 2 is simple. -Tad Hunt (tad@mail.csh.rit.edu) --- 62,73 ---- /* NO GNEWS IS GOOD GNEWS WITH GARRY GNUS: This version is much closer ! to supporting exception handling as per ANSI C++ working draft. It is a complete rewrite of all the EH stuff that was here before Shortcomings: ! 1. Throw specifications of functions still don't work. Cool Things: 1. Destructors are called properly :-) 2. No overhead for the non-exception thrown case. ! 3. Fixing shortcoming 1 is simple. -Tad Hunt (tad@mail.csh.rit.edu) *************** *** 190,197 **** /* used to cache a call to __builtin_return_address () */ static tree BuiltinReturnAddress; ! ! ! ! #include --- 78,82 ---- /* used to cache a call to __builtin_return_address () */ static tree BuiltinReturnAddress; ! #include *************** *** 207,213 **** char label[100]; ! assemble_integer (start_label, BITS_PER_WORD/BITS_PER_UNIT, 1); ! assemble_integer (end_label, BITS_PER_WORD/BITS_PER_UNIT, 1); ! assemble_integer (eh_label, BITS_PER_WORD/BITS_PER_UNIT, 1); putc ('\n', file); /* blank line */ } --- 92,98 ---- char label[100]; ! assemble_integer (start_label, GET_MODE_SIZE (Pmode), 1); ! assemble_integer (end_label, GET_MODE_SIZE (Pmode), 1); ! assemble_integer (eh_label, GET_MODE_SIZE (Pmode), 1); putc ('\n', file); /* blank line */ } *************** *** 270,274 **** data_section (); else ! #if defined(__rs6000) data_section (); #else --- 155,159 ---- data_section (); else ! #if defined(TARGET_POWERPC) /* are we on a __rs6000? */ data_section (); #else *************** *** 337,358 **** Since we don't want to generate the catch block inline with the regular flow of the function, we need to have some way of doing ! so. Luckily, we have a couple of routines "get_last_insn ()" and ! "set_last_insn ()" provided. When the start of a catch block is ! encountered, we save a pointer to the last insn generated. After ! the catch block is generated, we save a pointer to the first ! catch block insn and the last catch block insn with the routines ! "NEXT_INSN ()" and "get_last_insn ()". We then set the last insn ! to be the last insn generated before the catch block, and set the ! NEXT_INSN (last_insn) to zero. ! ! Since catch blocks might be nested inside other catch blocks, and ! we munge the chain of generated insns after the catch block is ! generated, we need to store the pointers to the last insn ! generated in a stack, so that when the end of a catch block is ! encountered, the last insn before the current catch block can be ! popped and set to be the last insn, and the first and last insns ! of the catch block just generated can be enqueue'd for output at ! a later time. ! Next we must insure that when the catch block is executed, all finalizations for the matching try block have been completed. If --- 222,230 ---- Since we don't want to generate the catch block inline with the regular flow of the function, we need to have some way of doing ! so. Luckily, we can use sequences to defer the catch sections. ! When the start of a catch block is encountered, we start the ! sequence. After the catch block is generated, we end the ! sequence. ! Next we must insure that when the catch block is executed, all finalizations for the matching try block have been completed. If *************** *** 380,385 **** /* used to cache "terminate ()", "unexpected ()", "set_terminate ()", and ! "set_unexpected ()" after default_conversion. (lib-except.c) */ ! static tree Terminate, Unexpected, SetTerminate, SetUnexpected, CatchMatch; /* used to cache __find_first_exception_table_match () --- 252,257 ---- /* used to cache "terminate ()", "unexpected ()", "set_terminate ()", and ! "set_unexpected ()" after default_conversion. (lib-except.c) */ ! static tree Terminate, Unexpected, SetTerminate, SetUnexpected, CatchMatch, Throw; /* used to cache __find_first_exception_table_match () *************** *** 387,394 **** static tree FirstExceptionMatch; ! /* used to cache a call to __unwind_function () (lib-except.c) */ static tree Unwind; ! /* holds a ready to emit call to "terminate ()". */ static tree TerminateFunctionCall; --- 259,266 ---- static tree FirstExceptionMatch; ! /* used to cache a call to __unwind_function () (lib-except.c) */ static tree Unwind; ! /* holds a ready to emit call to "terminate ()". */ static tree TerminateFunctionCall; *************** *** 399,403 **** /* data structures for my various quick and dirty stacks and queues Eventually, most of this should go away, because I think it can be ! integrated with stuff already built into the compiler. */ /* =================================================================== */ --- 271,275 ---- /* data structures for my various quick and dirty stacks and queues Eventually, most of this should go away, because I think it can be ! integrated with stuff already built into the compiler. */ /* =================================================================== */ *************** *** 433,447 **** struct ehNode *tail; }; - - struct exceptNode { - rtx catchstart; - rtx catchend; - - struct exceptNode *chain; - }; - - struct exceptStack { - struct exceptNode *top; - }; /* ========================================================================= */ --- 305,308 ---- *************** *** 454,469 **** /* Holds the pc for doing "throw" */ ! rtx saved_pc; /* Holds the type of the thing being thrown. */ ! rtx saved_throw_type; /* Holds the value being thrown. */ ! rtx saved_throw_value; ! rtx throw_label; static struct ehStack ehstack; static struct ehQueue ehqueue; static struct ehQueue eh_table_output_queue; - static struct exceptStack exceptstack; static struct labelNode *false_label_stack = NULL; static struct labelNode *caught_return_label_stack = NULL; --- 315,332 ---- /* Holds the pc for doing "throw" */ ! tree saved_pc; /* Holds the type of the thing being thrown. */ ! tree saved_throw_type; /* Holds the value being thrown. */ ! tree saved_throw_value; ! int throw_used; + static rtx catch_clauses; + static first_catch_label; + static struct ehStack ehstack; static struct ehQueue ehqueue; static struct ehQueue eh_table_output_queue; static struct labelNode *false_label_stack = NULL; static struct labelNode *caught_return_label_stack = NULL; *************** *** 473,480 **** static struct ehEntry *pop_eh_entry PROTO((struct ehStack *stack)); static void enqueue_eh_entry PROTO((struct ehQueue *queue, struct ehEntry *entry)); - static void push_except_stmts PROTO((struct exceptStack *exceptstack, - rtx catchstart, rtx catchend)); - static int pop_except_stmts PROTO((struct exceptStack *exceptstack, - rtx *catchstart, rtx *catchend)); static rtx push_eh_entry PROTO((struct ehStack *stack)); static struct ehEntry *dequeue_eh_entry PROTO((struct ehQueue *queue)); --- 336,339 ---- *************** *** 481,487 **** static void new_eh_queue PROTO((struct ehQueue *queue)); static void new_eh_stack PROTO((struct ehStack *stack)); - static void new_except_stack PROTO((struct exceptStack *queue)); - static void push_last_insn PROTO(()); - static rtx pop_last_insn PROTO(()); static void push_label_entry PROTO((struct labelNode **labelstack, rtx label)); static rtx pop_label_entry PROTO((struct labelNode **labelstack)); --- 340,343 ---- *************** *** 533,573 **** } - static void - push_except_stmts (exceptstack, catchstart, catchend) - struct exceptStack *exceptstack; - rtx catchstart, catchend; - { - struct exceptNode *newnode = (struct exceptNode*) - xmalloc (sizeof (struct exceptNode)); - - newnode->catchstart = catchstart; - newnode->catchend = catchend; - newnode->chain = exceptstack->top; - - exceptstack->top = newnode; - } - - static int - pop_except_stmts (exceptstack, catchstart, catchend) - struct exceptStack *exceptstack; - rtx *catchstart, *catchend; - { - struct exceptNode *tempnode; - - if (!exceptstack->top) { - *catchstart = *catchend = NULL_RTX; - return 0; - } - - tempnode = exceptstack->top; - exceptstack->top = exceptstack->top->chain; - - *catchstart = tempnode->catchstart; - *catchend = tempnode->catchend; - free (tempnode); - - return 1; - } - /* Push to permanent obstack for rtl generation. One level only! */ --- 389,392 ---- *************** *** 713,722 **** } static void ! new_except_stack (stack) ! struct exceptStack *stack; { ! stack->top = NULL; } /* ========================================================================= */ --- 532,563 ---- } + /* cheesyness to save some typing. returns the return value rtx */ + rtx + do_function_call (func, params, return_type) + tree func, params, return_type; + { + tree func_call; + func_call = build_function_call (func, params); + expand_call (func_call, NULL_RTX, 0); + if (return_type != NULL_TREE) + return hard_function_value (return_type, func_call); + return NULL_RTX; + } + static void ! expand_internal_throw (pc) ! rtx pc; { ! tree params; ! ! emit_move_insn (DECL_RTL (saved_pc), pc); ! #ifdef JUMP_TO_THROW ! emit_indirect_jump (gen_rtx (SYMBOL_REF, Pmode, "__throw")); ! #else ! do_function_call (Throw, NULL_TREE, NULL_TREE); ! #endif ! throw_used = 1; } + /* ========================================================================= */ *************** *** 741,745 **** - Initializing the eh_table_output_queue - Initializing the ehstack - - Initializing the exceptstack */ --- 582,585 ---- *************** *** 753,756 **** --- 593,598 ---- tree find_first_exception_match_fndecl; tree unwind_fndecl; + tree declspecs; + tree d; /* void (*)() */ *************** *** 804,811 **** define_function ("__unwind_function", build_function_type (void_type_node, ! tree_cons (NULL_TREE, ptr_type_node, void_list_node)), NOT_BUILT_IN, pushdecl, 0); Unexpected = default_conversion (unexpected_fndecl); --- 646,662 ---- define_function ("__unwind_function", build_function_type (void_type_node, ! tree_cons (NULL_TREE, ptr_type_node, ! void_list_node)), ! NOT_BUILT_IN, ! pushdecl, ! 0); ! throw_fndecl = ! define_function ("__throw", ! build_function_type (void_type_node, void_list_node), NOT_BUILT_IN, pushdecl, 0); + DECL_EXTERNAL (throw_fndecl) = 0; + TREE_PUBLIC (throw_fndecl) = 0; Unexpected = default_conversion (unexpected_fndecl); *************** *** 816,819 **** --- 667,671 ---- FirstExceptionMatch = default_conversion (find_first_exception_match_fndecl); Unwind = default_conversion (unwind_fndecl); + Throw = default_conversion (throw_fndecl); BuiltinReturnAddress = default_conversion (builtin_return_address_fndecl); *************** *** 821,869 **** pop_lang_context (); ! throw_label = gen_label_rtx (); ! #ifdef sparc ! saved_pc = gen_rtx (REG, Pmode, 16); ! saved_throw_type = gen_rtx (REG, Pmode, 17); ! saved_throw_value = gen_rtx (REG, Pmode, 18); ! #endif ! #ifdef __i386 ! saved_pc = gen_rtx (REG, Pmode, 3); ! saved_throw_type = gen_rtx (REG, Pmode, 4); ! saved_throw_value = gen_rtx (REG, Pmode, 5); ! #endif ! #ifdef __rs6000 ! saved_pc = gen_rtx (REG, Pmode, 13); ! saved_throw_type = gen_rtx (REG, Pmode, 14); ! saved_throw_value = gen_rtx (REG, Pmode, 15); ! #endif ! #ifdef __hppa ! saved_pc = gen_rtx (REG, Pmode, 5); ! saved_throw_type = gen_rtx (REG, Pmode, 6); ! saved_throw_value = gen_rtx (REG, Pmode, 7); ! #endif ! #ifdef __mc68000 ! saved_pc = gen_rtx (REG, Pmode, 10); ! saved_throw_type = gen_rtx (REG, Pmode, 11); ! saved_throw_value = gen_rtx (REG, Pmode, 12); ! #endif ! #ifdef __mips ! saved_pc = gen_rtx (REG, Pmode, 16); ! saved_throw_type = gen_rtx (REG, Pmode, 17); ! saved_throw_value = gen_rtx (REG, Pmode, 18); ! #endif ! #ifdef __arm ! saved_pc = gen_rtx (REG, Pmode, 7); ! saved_throw_type = gen_rtx (REG, Pmode, 8); ! saved_throw_value = gen_rtx (REG, Pmode, 9); ! #endif ! #ifdef __alpha ! saved_pc = gen_rtx (REG, Pmode, 9); ! saved_throw_type = gen_rtx (REG, Pmode, 10); ! saved_throw_value = gen_rtx (REG, Pmode, 11); ! #endif new_eh_queue (&ehqueue); new_eh_queue (&eh_table_output_queue); new_eh_stack (&ehstack); ! new_except_stack (&exceptstack); } --- 673,701 ---- pop_lang_context (); ! new_eh_queue (&ehqueue); new_eh_queue (&eh_table_output_queue); new_eh_stack (&ehstack); ! ! declspecs = tree_cons (NULL_TREE, get_identifier ("void"), NULL_TREE); ! d = build_parse_node (INDIRECT_REF, get_identifier ("__eh_pc")); ! d = start_decl (d, declspecs, 0, NULL_TREE); ! DECL_COMMON (d) = 1; ! cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); ! saved_pc = lookup_name (get_identifier ("__eh_pc"), 0); ! ! declspecs = tree_cons (NULL_TREE, get_identifier ("void"), NULL_TREE); ! d = build_parse_node (INDIRECT_REF, get_identifier ("__eh_type")); ! d = start_decl (d, declspecs, 0, NULL_TREE); ! DECL_COMMON (d) = 1; ! cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); ! saved_throw_type = lookup_name (get_identifier ("__eh_type"), 0); ! ! declspecs = tree_cons (NULL_TREE, get_identifier ("void"), NULL_TREE); ! d = build_parse_node (INDIRECT_REF, get_identifier ("__eh_value")); ! d = start_decl (d, declspecs, 0, NULL_TREE); ! DECL_COMMON (d) = 1; ! cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); ! saved_throw_value = lookup_name (get_identifier ("__eh_value"), 0); } *************** *** 873,880 **** start_protect () { ! if (doing_eh (0)) ! { ! emit_label (push_eh_entry (&ehstack)); ! } } --- 705,712 ---- start_protect () { ! if (! doing_eh (0)) ! return; ! ! emit_label (push_eh_entry (&ehstack)); } *************** *** 894,897 **** --- 726,735 ---- emit_label (entry->end_label); + /* Put in something that takes up space, as otherwise the end + address for the EH region could have the exact same address as + the outer region, causing us to miss the fact that resuming + exception handling with this PC value would be inside the outer + region. */ + emit_insn (gen_nop ()); entry->finalization = finalization; *************** *** 904,911 **** expand_start_try_stmts () { ! if (doing_eh (1)) ! { ! start_protect (); ! } } --- 742,749 ---- expand_start_try_stmts () { ! if (! doing_eh (1)) ! return; ! ! start_protect (); } *************** *** 916,956 **** } - struct insn_save_node { - rtx last; - struct insn_save_node *chain; - }; - - static struct insn_save_node *InsnSave = NULL; - - - /* Used to keep track of where the catch blocks start. */ - static void - push_last_insn () - { - struct insn_save_node *newnode = (struct insn_save_node*) - xmalloc (sizeof (struct insn_save_node)); - - newnode->last = get_last_insn (); - newnode->chain = InsnSave; - InsnSave = newnode; - } - - /* Use to keep track of where the catch blocks start. */ - static rtx - pop_last_insn () - { - struct insn_save_node *tempnode; - rtx temprtx; - - if (!InsnSave) return NULL_RTX; - - tempnode = InsnSave; - temprtx = tempnode->last; - InsnSave = InsnSave->chain; - - free (tempnode); - - return temprtx; - } /* call this to start processing of all the catch blocks. */ --- 754,757 ---- *************** *** 966,982 **** emit_line_note (input_filename, lineno); label = gen_label_rtx (); ! /* The label for the exception handling block we will save. */ emit_label (label); ! push_label_entry (&caught_return_label_stack, label); ! ! /* Remember where we started. */ ! push_last_insn (); ! emit_insn (gen_nop ()); ! /* Will this help us not stomp on it? */ ! emit_insn (gen_rtx (USE, VOIDmode, saved_throw_type)); ! emit_insn (gen_rtx (USE, VOIDmode, saved_throw_value)); while (1) --- 767,788 ---- emit_line_note (input_filename, lineno); label = gen_label_rtx (); ! ! /* The label for the exception handling block we will save. This is ! Lresume, in the documention. */ emit_label (label); ! /* Put in something that takes up space, as otherwise the end ! address for the EH region could have the exact same address as ! the outer region, causing us to miss the fact that resuming ! exception handling with this PC value would be inside the outer ! region. */ emit_insn (gen_nop ()); ! push_label_entry (&caught_return_label_stack, label); ! ! /* Start a new sequence for all the catch blocks. We will add this ! to the gloabl sequence catch_clauses, when we have completed all ! the handlers in this handler-seq. */ ! start_sequence (); while (1) *************** *** 991,1037 **** break; free (entry); } - - /* This goes when the below moves out of our way. */ - #if 1 - label = gen_label_rtx (); - emit_jump (label); - #endif - - /* All this should be out of line, and saved back in the exception handler - block area. */ - #if 1 - entry->start_label = entry->exception_handler_label; - /* These are saved for the exception table. */ - push_rtl_perm (); - entry->end_label = gen_label_rtx (); - entry->exception_handler_label = gen_label_rtx (); - entry->finalization = TerminateFunctionCall; - entry->context = current_function_decl; - assemble_external (TREE_OPERAND (Terminate, 0)); - pop_rtl_from_perm (); - - LABEL_PRESERVE_P (entry->start_label) = 1; - LABEL_PRESERVE_P (entry->end_label) = 1; - LABEL_PRESERVE_P (entry->exception_handler_label) = 1; - - emit_label (entry->end_label); - - enqueue_eh_entry (&eh_table_output_queue, copy_eh_entry (entry)); - - /* After running the finalization, continue on out to the next - cleanup, if we have nothing better to do. */ - emit_move_insn (saved_pc, gen_rtx (LABEL_REF, Pmode, entry->end_label)); - /* Will this help us not stomp on it? */ - emit_insn (gen_rtx (USE, VOIDmode, saved_throw_type)); - emit_insn (gen_rtx (USE, VOIDmode, saved_throw_value)); - make_first_label(throw_label); - emit_jump (throw_label); - emit_label (entry->exception_handler_label); - expand_expr (entry->finalization, const0_rtx, VOIDmode, 0); - emit_barrier (); - #endif - emit_label (label); } --- 797,809 ---- break; + /* The below can be optimized away, and we could just fall into the + next EH handler, if we are certain they are nested. */ + /* Code to throw out to outer context, if we fall off end of the + handler. */ + expand_internal_throw (gen_rtx (LABEL_REF, + Pmode, + entry->end_label)); free (entry); } } *************** *** 1040,1045 **** expand_end_all_catch () { ! rtx catchstart, catchend, last; ! rtx label; if (! doing_eh (1)) --- 812,816 ---- expand_end_all_catch () { ! rtx new_catch_clause; if (! doing_eh (1)) *************** *** 1047,1065 **** /* Code to throw out to outer context, if we fall off end of catch ! handlers. */ ! emit_move_insn (saved_pc, gen_rtx (LABEL_REF, ! Pmode, ! top_label_entry (&caught_return_label_stack))); ! make_first_label(throw_label); ! emit_jump (throw_label); ! ! /* Find the start of the catch block. */ ! last = pop_last_insn (); ! catchstart = NEXT_INSN (last); ! catchend = get_last_insn (); ! ! NEXT_INSN (last) = 0; ! set_last_insn (last); ! /* this level of catch blocks is done, so set up the successful catch jump label for the next layer of catch blocks. */ --- 818,831 ---- /* Code to throw out to outer context, if we fall off end of catch ! handlers. This is rethrow (Lresume, same id, same obj); in the ! documentation. */ ! expand_internal_throw (gen_rtx (LABEL_REF, ! Pmode, ! top_label_entry (&caught_return_label_stack))); ! ! /* Now we have the complete catch sequence. */ ! new_catch_clause = get_insns (); ! end_sequence (); ! /* this level of catch blocks is done, so set up the successful catch jump label for the next layer of catch blocks. */ *************** *** 1066,1070 **** pop_label_entry (&caught_return_label_stack); ! push_except_stmts (&exceptstack, catchstart, catchend); /* Here we fall through into the continuation code. */ --- 832,841 ---- pop_label_entry (&caught_return_label_stack); ! /* Add the new sequence of catchs to the main one for this ! function. */ ! push_to_sequence (catch_clauses); ! emit_insns (new_catch_clause); ! catch_clauses = get_insns (); ! end_sequence (); /* Here we fall through into the continuation code. */ *************** *** 1071,1139 **** } ! ! /* this is called from expand_exception_blocks () to expand the toplevel ! finalizations for a function. */ ! void ! expand_leftover_cleanups () { ! struct ehEntry *entry; ! rtx first_label = NULL_RTX; ! ! if (! doing_eh (0)) ! return; ! ! /* Will this help us not stomp on it? */ ! emit_insn (gen_rtx (USE, VOIDmode, saved_throw_type)); ! emit_insn (gen_rtx (USE, VOIDmode, saved_throw_value)); ! while ((entry = dequeue_eh_entry (&ehqueue)) != 0) ! { ! if (! first_label) ! first_label = entry->exception_handler_label; ! emit_label (entry->exception_handler_label); ! expand_expr (entry->finalization, const0_rtx, VOIDmode, 0); ! /* leftover try block, opps. */ ! if (entry->finalization == integer_zero_node) ! abort (); ! free (entry); ! } ! if (first_label) { ! rtx label; ! struct ehEntry entry; ! /* These are saved for the exception table. */ ! push_rtl_perm (); ! label = gen_label_rtx (); ! entry.start_label = first_label; ! entry.end_label = label; ! entry.exception_handler_label = gen_label_rtx (); ! entry.finalization = TerminateFunctionCall; ! entry.context = current_function_decl; ! assemble_external (TREE_OPERAND (Terminate, 0)); ! pop_rtl_from_perm (); ! ! LABEL_PRESERVE_P (entry.start_label) = 1; ! LABEL_PRESERVE_P (entry.end_label) = 1; ! LABEL_PRESERVE_P (entry.exception_handler_label) = 1; ! ! emit_label (label); ! ! enqueue_eh_entry (&eh_table_output_queue, copy_eh_entry (&entry)); ! ! /* After running the finalization, continue on out to the next ! cleanup, if we have nothing better to do. */ ! emit_move_insn (saved_pc, gen_rtx (LABEL_REF, Pmode, entry.end_label)); ! /* Will this help us not stomp on it? */ ! emit_insn (gen_rtx (USE, VOIDmode, saved_throw_type)); ! emit_insn (gen_rtx (USE, VOIDmode, saved_throw_value)); ! make_first_label(throw_label); ! emit_jump (throw_label); ! emit_label (entry.exception_handler_label); ! expand_expr (entry.finalization, const0_rtx, VOIDmode, 0); ! emit_barrier (); } } --- 842,872 ---- } ! /* Build a type value for use at runtime for a type that is matched ! against by the exception handling system. */ ! static tree ! build_eh_type_type (type) ! tree type; { ! char *typestring; ! tree exp; ! if (type == error_mark_node) ! return error_mark_node; ! /* peel back references, so they match. */ ! if (TREE_CODE (type) == REFERENCE_TYPE) ! type = TREE_TYPE (type); ! /* Peel off cv qualifiers. */ ! type = TYPE_MAIN_VARIANT (type); ! if (flag_rtti) { ! return build1 (ADDR_EXPR, ptr_type_node, get_typeid (type)); } + + typestring = build_overload_name (type, 1, 1); + exp = combine_strings (build_string (strlen (typestring)+1, typestring)); + return build1 (ADDR_EXPR, ptr_type_node, exp); } *************** *** 1144,1150 **** tree exp; { - char *typestring; - tree type; - if (flag_rtti) { --- 877,880 ---- *************** *** 1152,1164 **** return build1 (ADDR_EXPR, ptr_type_node, exp); } ! type = TREE_TYPE (exp); ! ! /* peel back references, so they match. */ ! if (TREE_CODE (type) == REFERENCE_TYPE) ! type = TREE_TYPE (type); ! ! typestring = build_overload_name (type, 1, 1); ! exp = combine_strings (build_string (strlen (typestring)+1, typestring)); ! return build1 (ADDR_EXPR, ptr_type_node, exp); } --- 882,886 ---- return build1 (ADDR_EXPR, ptr_type_node, exp); } ! return build_eh_type_type (TREE_TYPE (exp)); } *************** *** 1183,1189 **** expand_start_bindings (0); - /* These are saved for the exception table. */ - push_rtl_perm (); false_label_rtx = gen_label_rtx (); protect_label_rtx = gen_label_rtx (); pop_rtl_from_perm (); --- 905,911 ---- expand_start_bindings (0); false_label_rtx = gen_label_rtx (); + /* This is saved for the exception table. */ + push_rtl_perm (); protect_label_rtx = gen_label_rtx (); pop_rtl_from_perm (); *************** *** 1197,1201 **** tree init_type; ! decl = grokdeclarator (declarator, declspecs, CATCHPARM, 1, NULL_TREE); if (decl == NULL_TREE) --- 919,924 ---- tree init_type; ! decl = grokdeclarator (declarator, declspecs, CATCHPARM, 1, ! NULL_TREE, NULL_TREE); if (decl == NULL_TREE) *************** *** 1207,1218 **** /* Figure out the type that the initializer is. */ init_type = TREE_TYPE (decl); ! if (TREE_CODE (init_type) != REFERENCE_TYPE) init_type = build_reference_type (init_type); ! exp = make_tree (ptr_type_node, saved_throw_value); exp = tree_cons (NULL_TREE, ! build_eh_type (decl), tree_cons (NULL_TREE, ! make_tree (ptr_type_node, saved_throw_type), tree_cons (NULL_TREE, exp, NULL_TREE))); exp = build_function_call (CatchMatch, exp); --- 930,942 ---- /* Figure out the type that the initializer is. */ init_type = TREE_TYPE (decl); ! if (TREE_CODE (init_type) != REFERENCE_TYPE ! && TREE_CODE (init_type) != POINTER_TYPE) init_type = build_reference_type (init_type); ! exp = saved_throw_value; exp = tree_cons (NULL_TREE, ! build_eh_type_type (TREE_TYPE (decl)), tree_cons (NULL_TREE, ! saved_throw_type, tree_cons (NULL_TREE, exp, NULL_TREE))); exp = build_function_call (CatchMatch, exp); *************** *** 1249,1319 **** ! /* Call this to end a catch block. Its responsible for emitting the ! code to handle jumping back to the correct place, and for emitting ! the label to jump to if this catch block didn't match. */ ! void expand_end_catch_block () { ! if (doing_eh (1)) ! { ! rtx start_protect_label_rtx; ! rtx end_protect_label_rtx; ! tree decls; ! struct ehEntry entry; ! ! /* label we jump to if we caught the exception */ ! emit_jump (top_label_entry (&caught_return_label_stack)); ! /* Code to throw out to outer context, if we get a throw from within ! our catch handler. */ ! /* These are saved for the exception table. */ ! push_rtl_perm (); ! entry.exception_handler_label = gen_label_rtx (); ! pop_rtl_from_perm (); ! emit_label (entry.exception_handler_label); ! emit_move_insn (saved_pc, gen_rtx (LABEL_REF, ! Pmode, ! top_label_entry (&caught_return_label_stack))); ! make_first_label(throw_label); ! emit_jump (throw_label); ! /* No associated finalization. */ ! entry.finalization = NULL_TREE; ! entry.context = current_function_decl; ! /* Because we are reordered out of line, we have to protect this. */ ! /* label for the start of the protection region. */ ! start_protect_label_rtx = pop_label_entry (&false_label_stack); ! ! /* Cleanup the EH parameter. */ ! decls = getdecls (); ! expand_end_bindings (decls, decls != NULL_TREE, 0); ! ! /* label we emit to jump to if this catch block didn't match. */ ! emit_label (end_protect_label_rtx = pop_label_entry (&false_label_stack)); ! /* Because we are reordered out of line, we have to protect this. */ ! entry.start_label = start_protect_label_rtx; ! entry.end_label = end_protect_label_rtx; ! LABEL_PRESERVE_P (entry.start_label) = 1; ! LABEL_PRESERVE_P (entry.end_label) = 1; ! LABEL_PRESERVE_P (entry.exception_handler_label) = 1; ! /* These set up a call to throw the caught exception into the outer ! context. */ ! enqueue_eh_entry (&eh_table_output_queue, copy_eh_entry (&entry)); } } ! /* cheesyness to save some typing. returns the return value rtx */ ! rtx ! do_function_call (func, params, return_type) ! tree func, params, return_type; { ! tree func_call; ! func_call = build_function_call (func, params); ! expand_call (func_call, NULL_RTX, 0); ! if (return_type != NULL_TREE) ! return hard_function_value (return_type, func_call); ! return NULL_RTX; } --- 973,1075 ---- ! /* this is called from expand_exception_blocks and ! expand_end_catch_block to expand the toplevel finalizations for a ! function. We return the first label emitted, if any, otherwise ! return NULL_RTX. */ ! static rtx ! expand_leftover_cleanups () { ! struct ehEntry *entry; ! rtx first_label = NULL_RTX; ! while ((entry = dequeue_eh_entry (&ehqueue)) != 0) ! { ! if (! first_label) ! first_label = entry->exception_handler_label; ! emit_label (entry->exception_handler_label); ! expand_expr (entry->finalization, const0_rtx, VOIDmode, 0); ! /* The below can be optimized away, and we could just fall into the ! next EH handler, if we are certain they are nested. */ ! /* Code to throw out to outer context, if we fall off end of the ! handler. */ ! expand_internal_throw (gen_rtx (LABEL_REF, ! Pmode, ! entry->end_label)); ! /* leftover try block, opps. */ ! if (entry->finalization == integer_zero_node) ! abort (); ! free (entry); } + + return first_label; } ! /* Call this to end a catch block. Its responsible for emitting the ! code to handle jumping back to the correct place, and for emitting ! the label to jump to if this catch block didn't match. */ ! void expand_end_catch_block () { ! rtx start_protect_label_rtx; ! rtx end_protect_label_rtx; ! tree decls; ! struct ehEntry entry; ! ! if (! doing_eh (1)) ! return; ! ! /* fall to outside the try statement when done executing handler and ! we fall off end of handler. This is jump Lresume in the ! documentation. */ ! emit_jump (top_label_entry (&caught_return_label_stack)); ! ! /* We end the rethrow protection region as soon as we hit a label. */ ! end_protect_label_rtx = expand_leftover_cleanups (); ! ! /* Code to throw out to outer context, if we get a throw from within ! our catch handler. */ ! /* These are saved for the exception table. */ ! push_rtl_perm (); ! entry.exception_handler_label = gen_label_rtx (); ! pop_rtl_from_perm (); ! /* This label is Lhandler in the documentation. */ ! emit_label (entry.exception_handler_label); ! expand_internal_throw (gen_rtx (LABEL_REF, ! Pmode, ! top_label_entry (&caught_return_label_stack))); ! ! /* No associated finalization. */ ! entry.finalization = NULL_TREE; ! entry.context = current_function_decl; ! ! if (end_protect_label_rtx == NULL_RTX) ! end_protect_label_rtx = entry.exception_handler_label; ! ! /* Because we are emitted out of line, we have to protect this. */ ! /* label for the start of the protection region. */ ! start_protect_label_rtx = pop_label_entry (&false_label_stack); ! ! /* Cleanup the EH parameter. */ ! decls = getdecls (); ! expand_end_bindings (decls, decls != NULL_TREE, 0); ! ! /* label we emit to jump to if this catch block didn't match. */ ! /* This the closing } in the `if (eq) {' of the documentation. */ ! emit_label (pop_label_entry (&false_label_stack)); ! ! /* Because we are reordered out of line, we have to protect this. */ ! entry.start_label = start_protect_label_rtx; ! entry.end_label = end_protect_label_rtx; ! ! LABEL_PRESERVE_P (entry.start_label) = 1; ! LABEL_PRESERVE_P (entry.end_label) = 1; ! LABEL_PRESERVE_P (entry.exception_handler_label) = 1; ! ! /* These set up a call to throw the caught exception into the outer ! context. */ ! enqueue_eh_entry (&eh_table_output_queue, copy_eh_entry (&entry)); } *************** *** 1320,1345 **** /* unwind the stack. */ static void ! do_unwind (throw_label) ! rtx throw_label; { ! #ifdef sparc ! extern FILE *asm_out_file; tree fcall; tree params; rtx return_val_rtx; /* call to __builtin_return_address () */ ! params=tree_cons (NULL_TREE, integer_zero_node, NULL_TREE); fcall = build_function_call (BuiltinReturnAddress, params); ! return_val_rtx = expand_expr (fcall, NULL_RTX, SImode, 0); /* In the return, the new pc is pc+8, as the value coming in is really the address of the call insn, not the next insn. */ ! emit_move_insn (return_val_rtx, plus_constant(gen_rtx (LABEL_REF, ! Pmode, ! throw_label), -8)); ! /* We use three values, PC, type, and value */ ! easy_expand_asm ("st %l0,[%fp]"); ! easy_expand_asm ("st %l1,[%fp+4]"); ! easy_expand_asm ("st %l2,[%fp+8]"); easy_expand_asm ("ret"); easy_expand_asm ("restore"); --- 1076,1097 ---- /* unwind the stack. */ static void ! do_unwind (inner_throw_label) ! rtx inner_throw_label; { ! #if defined(SPARC_STACK_ALIGN) /* was sparc */ tree fcall; tree params; rtx return_val_rtx; + rtx temp; /* call to __builtin_return_address () */ ! params = tree_cons (NULL_TREE, integer_zero_node, NULL_TREE); fcall = build_function_call (BuiltinReturnAddress, params); ! return_val_rtx = expand_expr (fcall, NULL_RTX, Pmode, 0); /* In the return, the new pc is pc+8, as the value coming in is really the address of the call insn, not the next insn. */ ! temp = gen_reg_rtx (Pmode); ! emit_move_insn (temp, inner_throw_label); ! emit_move_insn (return_val_rtx, plus_constant (temp, -8)); easy_expand_asm ("ret"); easy_expand_asm ("restore"); *************** *** 1346,1375 **** emit_barrier (); #endif ! #if defined(__i386) || defined(__rs6000) || defined(__hppa) || defined(__mc68000) || defined (__mips) || defined(__alpha) ! extern FILE *asm_out_file; ! tree fcall; ! tree params; ! rtx return_val_rtx; ! /* call to __builtin_return_address () */ ! params=tree_cons (NULL_TREE, integer_zero_node, NULL_TREE); ! fcall = build_function_call (BuiltinReturnAddress, params); ! return_val_rtx = expand_expr (fcall, NULL_RTX, SImode, 0); ! #if 0 ! /* I would like to do this here, but doesn't seem to work. */ ! emit_move_insn (return_val_rtx, gen_rtx (LABEL_REF, ! Pmode, ! throw_label)); ! /* So, for now, just pass throw label to stack unwinder. */ ! #endif ! /* We use three values, PC, type, and value */ ! params = tree_cons (NULL_TREE, make_tree (ptr_type_node, ! gen_rtx (LABEL_REF, Pmode, throw_label)), NULL_TREE); ! ! do_function_call (Unwind, params, NULL_TREE); ! assemble_external (TREE_OPERAND (Unwind, 0)); ! emit_barrier (); #endif ! #if m88k rtx temp_frame = frame_pointer_rtx; --- 1098,1111 ---- emit_barrier (); #endif ! #if defined(ARM_FRAME_RTX) /* was __arm */ ! if (flag_omit_frame_pointer) ! sorry ("this implementation of exception handling requires a frame pointer"); ! emit_move_insn (stack_pointer_rtx, ! gen_rtx (MEM, Pmode, plus_constant (hard_frame_pointer_rtx, -8))); ! emit_move_insn (hard_frame_pointer_rtx, ! gen_rtx (MEM, Pmode, plus_constant (hard_frame_pointer_rtx, -12))); #endif ! #if defined(TARGET_88000) /* was m88k */ rtx temp_frame = frame_pointer_rtx; *************** *** 1394,1408 **** #endif #endif ! #ifdef __arm ! if (flag_omit_frame_pointer) ! sorry ("this implementation of exception handling requires a frame pointer"); ! emit_move_insn (stack_pointer_rtx, ! gen_rtx (MEM, SImode, plus_constant (hard_frame_pointer_rtx, -8))); ! emit_move_insn (hard_frame_pointer_rtx, ! gen_rtx (MEM, SImode, plus_constant (hard_frame_pointer_rtx, -12))); #endif } /* is called from expand_exception_blocks () to generate the code in a function to "throw" if anything in the function needs to perform a throw. --- 1130,1157 ---- #endif #endif ! #if !defined(TARGET_88000) && !defined(ARM_FRAME_RTX) && !defined(SPARC_STACK_ALIGN) ! tree fcall; ! tree params; ! rtx return_val_rtx; ! /* call to __builtin_return_address () */ ! params = tree_cons (NULL_TREE, integer_zero_node, NULL_TREE); ! fcall = build_function_call (BuiltinReturnAddress, params); ! return_val_rtx = expand_expr (fcall, NULL_RTX, Pmode, 0); ! #if 0 ! /* I would like to do this here, but doesn't seem to work. */ ! emit_move_insn (return_val_rtx, inner_throw_label); ! /* So, for now, just pass throw label to stack unwinder. */ ! #endif ! params = tree_cons (NULL_TREE, make_tree (ptr_type_node, ! inner_throw_label), NULL_TREE); ! ! do_function_call (Unwind, params, NULL_TREE); ! assemble_external (TREE_OPERAND (Unwind, 0)); ! emit_barrier (); #endif } + /* is called from expand_exception_blocks () to generate the code in a function to "throw" if anything in the function needs to perform a throw. *************** *** 1421,1425 **** */ ! static void expand_builtin_throw () { --- 1170,1174 ---- */ ! void expand_builtin_throw () { *************** *** 1427,1441 **** tree params; rtx return_val_rtx; ! rtx gotta_rethrow_it = gen_label_rtx (); ! rtx gotta_call_terminate = gen_label_rtx (); ! rtx unwind_and_throw = gen_label_rtx (); ! rtx goto_unwind_and_throw = gen_label_rtx (); ! make_first_label(throw_label); ! emit_label (throw_label); /* search for an exception handler for the saved_pc */ return_val_rtx = do_function_call (FirstExceptionMatch, ! tree_cons (NULL_TREE, make_tree (ptr_type_node, saved_pc), NULL_TREE), ptr_type_node); assemble_external (TREE_OPERAND (FirstExceptionMatch, 0)); --- 1176,1218 ---- tree params; rtx return_val_rtx; ! rtx gotta_rethrow_it; ! rtx gotta_call_terminate; ! rtx unwind_and_throw; ! rtx goto_unwind_and_throw; ! rtx top_of_loop; ! rtx unwind_first; ! tree t; ! ! if (! doing_eh (0)) ! return; ! ! if (! throw_used) ! return; ! params = void_list_node; ! t = build_parse_node (CALL_EXPR, get_identifier ("__throw"), params, NULL_TREE); ! start_function (decl_tree_cons (NULL_TREE, get_identifier ("static"), ! void_list_node), ! t, NULL_TREE, NULL_TREE, 0); ! store_parm_decls (); ! pushlevel (0); ! clear_last_expr (); ! push_momentary (); ! expand_start_bindings (0); ! ! gotta_rethrow_it = gen_label_rtx (); ! gotta_call_terminate = gen_label_rtx (); ! unwind_and_throw = gen_label_rtx (); ! goto_unwind_and_throw = gen_label_rtx (); ! top_of_loop = gen_label_rtx (); ! unwind_first = gen_label_rtx (); ! ! emit_jump (unwind_first); ! ! emit_label (top_of_loop); /* search for an exception handler for the saved_pc */ return_val_rtx = do_function_call (FirstExceptionMatch, ! tree_cons (NULL_TREE, saved_pc, NULL_TREE), ptr_type_node); assemble_external (TREE_OPERAND (FirstExceptionMatch, 0)); *************** *** 1455,1466 **** /* call to __builtin_return_address () */ ! #ifdef __arm /* This replaces a 'call' to __builtin_return_address */ return_val_rtx = gen_reg_rtx (Pmode); ! emit_move_insn (return_val_rtx, gen_rtx (MEM, SImode, plus_constant (hard_frame_pointer_rtx, -4))); #else ! params=tree_cons (NULL_TREE, integer_zero_node, NULL_TREE); fcall = build_function_call (BuiltinReturnAddress, params); ! return_val_rtx = expand_expr (fcall, NULL_RTX, SImode, 0); #endif --- 1232,1243 ---- /* call to __builtin_return_address () */ ! #if defined(ARM_FRAME_RTX) /* was __arm */ /* This replaces a 'call' to __builtin_return_address */ return_val_rtx = gen_reg_rtx (Pmode); ! emit_move_insn (return_val_rtx, gen_rtx (MEM, Pmode, plus_constant (hard_frame_pointer_rtx, -4))); #else ! params = tree_cons (NULL_TREE, integer_zero_node, NULL_TREE); fcall = build_function_call (BuiltinReturnAddress, params); ! return_val_rtx = expand_expr (fcall, NULL_RTX, Pmode, 0); #endif *************** *** 1471,1475 **** emit_jump_insn (gen_beq (gotta_call_terminate)); ! #ifdef __arm /* On the ARM, '__builtin_return_address', must have 4 subtracted from it. */ --- 1248,1252 ---- emit_jump_insn (gen_beq (gotta_call_terminate)); ! #if defined(ARM_FRAME_RTX) /* was __arm */ /* On the ARM, '__builtin_return_address', must have 4 subtracted from it. */ *************** *** 1481,1487 **** later processors when running in 32 bit mode. */ if (!TARGET_6) ! emit_insn (gen_rtx (SET, SImode, return_val_rtx, gen_rtx (AND, SImode, return_val_rtx, GEN_INT (0x03fffffc)))); #else ! #ifndef sparc /* On the SPARC, __builtin_return_address is already -8, no need to subtract any more from it. */ --- 1258,1264 ---- later processors when running in 32 bit mode. */ if (!TARGET_6) ! emit_insn (gen_rtx (SET, Pmode, return_val_rtx, gen_rtx (AND, Pmode, return_val_rtx, GEN_INT (0x03fffffc)))); #else ! #if !defined(SPARC_STACK_ALIGN) /* was sparc */ /* On the SPARC, __builtin_return_address is already -8, no need to subtract any more from it. */ *************** *** 1491,1499 **** /* yes it did */ ! emit_move_insn (saved_pc, return_val_rtx); ! do_unwind (throw_label); ! make_first_label(throw_label); ! emit_jump (throw_label); /* no it didn't --> therefore we need to call terminate */ emit_label (gotta_call_terminate); --- 1268,1277 ---- /* yes it did */ ! t = build_modify_expr (saved_pc, NOP_EXPR, make_tree (ptr_type_node, return_val_rtx)); ! expand_expr (t, const0_rtx, VOIDmode, 0); + do_unwind (gen_rtx (LABEL_REF, Pmode, top_of_loop)); + emit_jump (top_of_loop); + /* no it didn't --> therefore we need to call terminate */ emit_label (gotta_call_terminate); *************** *** 1500,1505 **** --- 1278,1394 ---- do_function_call (Terminate, NULL_TREE, NULL_TREE); assemble_external (TREE_OPERAND (Terminate, 0)); + + { + rtx ret_val, return_val_rtx; + emit_label (unwind_first); + ret_val = expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS, + 0, hard_frame_pointer_rtx); + + /* Set it up so that we continue inside, at the top of the loop. */ + emit_move_insn (ret_val, gen_rtx (LABEL_REF, Pmode, top_of_loop)); + #ifdef NORMAL_RETURN_ADDR_OFFSET + return_val_rtx = plus_constant (ret_val, -NORMAL_RETURN_ADDR_OFFSET); + if (return_val_rtx != ret_val) + emit_move_insn (ret_val, return_val_rtx); + #endif + + /* Fall into epilogue to unwind prologue. */ + } + + expand_end_bindings (getdecls(), 1, 0); + poplevel (1, 0, 0); + pop_momentary (); + + finish_function (lineno, 0, 0); + } + + + void + expand_start_eh_spec () + { + start_protect (); } + void + expand_end_eh_spec (raises) + tree raises; + { + tree expr, second_try; + rtx check = gen_label_rtx (); + rtx cont; + rtx ret = gen_reg_rtx (Pmode); + rtx flag = gen_reg_rtx (TYPE_MODE (integer_type_node)); + rtx end = gen_label_rtx (); + + expr = make_node (RTL_EXPR); + TREE_TYPE (expr) = void_type_node; + RTL_EXPR_RTL (expr) = const0_rtx; + TREE_SIDE_EFFECTS (expr) = 1; + start_sequence_for_rtl_expr (expr); + cont = gen_label_rtx (); + emit_move_insn (ret, gen_rtx (LABEL_REF, Pmode, cont)); + emit_jump (check); + emit_label (cont); + jumpif (make_tree (integer_type_node, flag), end); + do_function_call (Terminate, NULL_TREE, NULL_TREE); + assemble_external (TREE_OPERAND (Terminate, 0)); + emit_barrier (); + RTL_EXPR_SEQUENCE (expr) = get_insns (); + end_sequence (); + + second_try = expr; + + expr = make_node (RTL_EXPR); + TREE_TYPE (expr) = void_type_node; + RTL_EXPR_RTL (expr) = const0_rtx; + TREE_SIDE_EFFECTS (expr) = 1; + start_sequence_for_rtl_expr (expr); + + cont = gen_label_rtx (); + emit_move_insn (ret, gen_rtx (LABEL_REF, Pmode, cont)); + emit_jump (check); + emit_label (cont); + jumpif (make_tree (integer_type_node, flag), end); + start_protect (); + do_function_call (Unexpected, NULL_TREE, NULL_TREE); + assemble_external (TREE_OPERAND (Unexpected, 0)); + emit_barrier (); + end_protect (second_try); + + emit_label (check); + emit_move_insn (flag, const1_rtx); + cont = gen_label_rtx (); + while (raises) + { + tree exp; + tree match_type = TREE_VALUE (raises); + + if (match_type) + { + /* check TREE_VALUE (raises) here */ + exp = saved_throw_value; + exp = tree_cons (NULL_TREE, + build_eh_type_type (match_type), + tree_cons (NULL_TREE, + saved_throw_type, + tree_cons (NULL_TREE, exp, NULL_TREE))); + exp = build_function_call (CatchMatch, exp); + assemble_external (TREE_OPERAND (CatchMatch, 0)); + + jumpif (exp, cont); + } + + raises = TREE_CHAIN (raises); + } + emit_move_insn (flag, const0_rtx); + emit_label (cont); + emit_indirect_jump (ret); + emit_label (end); + + RTL_EXPR_SEQUENCE (expr) = get_insns (); + end_sequence (); + + end_protect (expr); + } /* This is called to expand all the toplevel exception handling *************** *** 1509,1516 **** expand_exception_blocks () { - rtx catchstart, catchend; - rtx last; static rtx funcend; funcend = gen_label_rtx (); emit_jump (funcend); --- 1398,1406 ---- expand_exception_blocks () { static rtx funcend; + rtx insns; + start_sequence (); + funcend = gen_label_rtx (); emit_jump (funcend); *************** *** 1517,1541 **** /* expand_null_return (); */ ! while (pop_except_stmts (&exceptstack, &catchstart, &catchend)) { ! last = get_last_insn (); ! NEXT_INSN (last) = catchstart; ! PREV_INSN (catchstart) = last; ! NEXT_INSN (catchend) = 0; ! set_last_insn (catchend); ! } expand_leftover_cleanups (); { ! static int have_done = 0; ! if (! have_done && TREE_PUBLIC (current_function_decl) ! && DECL_INTERFACE_KNOWN (current_function_decl) ! && ! DECL_EXTERNAL (current_function_decl)) { ! have_done = 1; ! expand_builtin_throw (); } } emit_label (funcend); } --- 1407,1489 ---- /* expand_null_return (); */ ! start_sequence (); + /* Add all the catch clauses here. */ + emit_insns (catch_clauses); + catch_clauses = NULL_RTX; + expand_leftover_cleanups (); + insns = get_insns (); + end_sequence (); + + /* Do this after we expand leftover cleanups, so that the end_protect + that expand_end_eh_spec does will match the right start_protect, + and make sure it comes out before the terminate protected region. */ + if (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl))) + { + expand_end_eh_spec (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl))); + push_to_sequence (insns); + + /* Now expand any new ones. */ + expand_leftover_cleanups (); + + insns = get_insns (); + end_sequence (); + } + + if (insns) + { + struct ehEntry entry; + + /* These are saved for the exception table. */ + push_rtl_perm (); + entry.start_label = gen_label_rtx (); + entry.end_label = gen_label_rtx (); + entry.exception_handler_label = gen_label_rtx (); + entry.finalization = TerminateFunctionCall; + entry.context = current_function_decl; + assemble_external (TREE_OPERAND (Terminate, 0)); + pop_rtl_from_perm (); + + LABEL_PRESERVE_P (entry.start_label) = 1; + LABEL_PRESERVE_P (entry.end_label) = 1; + LABEL_PRESERVE_P (entry.exception_handler_label) = 1; + + emit_label (entry.start_label); + emit_insns (insns); + + enqueue_eh_entry (&eh_table_output_queue, copy_eh_entry (&entry)); + + emit_label (entry.exception_handler_label); + expand_expr (entry.finalization, const0_rtx, VOIDmode, 0); + emit_label (entry.end_label); + emit_barrier (); + } + { ! /* Mark the end of the stack unwinder. */ ! rtx unwind_insns; ! start_sequence (); ! end_eh_unwinder (funcend); ! expand_leftover_cleanups (); ! unwind_insns = get_insns (); ! end_sequence (); ! if (unwind_insns) { ! insns = unwind_insns; ! emit_insns (insns); } } + emit_label (funcend); + + /* Only if we had previous insns do we want to emit the jump around + them. If there weren't any, then insns will remain NULL_RTX. */ + if (insns) + insns = get_insns (); + end_sequence (); + + emit_insns (insns); } *************** *** 1568,1592 **** { tree throw_type; ! rtx throw_type_rtx; ! rtx throw_value_rtx; /* throw expression */ /* First, decay it. */ ! exp = default_conversion (exp); ! /* Make a copy of the thrown object. WP 15.1.5 */ ! exp = build_new (NULL_TREE, TREE_TYPE (exp), ! build_tree_list (NULL_TREE, exp), ! 0); ! ! if (exp == error_mark_node) ! error (" in thrown expression"); ! ! throw_type = build_eh_type (build_indirect_ref (exp, NULL_PTR)); ! throw_type_rtx = expand_expr (throw_type, NULL_RTX, VOIDmode, 0); ! ! throw_value_rtx = expand_expr (exp, NULL_RTX, VOIDmode, 0); ! emit_move_insn (saved_throw_value, throw_value_rtx); ! emit_move_insn (saved_throw_type, throw_type_rtx); } else --- 1516,1548 ---- { tree throw_type; ! tree e; /* throw expression */ /* First, decay it. */ ! exp = decay_conversion (exp); ! ! if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE) ! { ! throw_type = build_eh_type (exp); ! exp = build_reinterpret_cast (ptr_type_node, exp); ! } ! else ! { ! /* Make a copy of the thrown object. WP 15.1.5 */ ! exp = build_new (NULL_TREE, TREE_TYPE (exp), ! build_tree_list (NULL_TREE, exp), ! 0); ! ! if (exp == error_mark_node) ! error (" in thrown expression"); ! ! throw_type = build_eh_type (build_indirect_ref (exp, NULL_PTR)); ! } ! e = build_modify_expr (saved_throw_type, NOP_EXPR, throw_type); ! expand_expr (e, const0_rtx, VOIDmode, 0); ! e = build_modify_expr (saved_throw_value, NOP_EXPR, exp); ! e = build1 (CLEANUP_POINT_EXPR, TREE_TYPE (e), e); ! expand_expr (e, const0_rtx, VOIDmode, 0); } else *************** *** 1596,1607 **** } ! emit_move_insn (saved_pc, gen_rtx (LABEL_REF, Pmode, label)); ! make_first_label(throw_label); ! emit_jump (throw_label); } - /* end of: my-cp-except.c */ - #endif - void end_protect_partials () { --- 1552,1558 ---- } ! expand_internal_throw (gen_rtx (LABEL_REF, Pmode, label)); } void end_protect_partials () { *************** *** 1616,1623 **** might_have_exceptions_p () { - #ifdef TRY_NEW_EH if (eh_table_output_queue.head) return 1; - #endif return 0; } --- 1567,1572 ---- *************** *** 1629,1633 **** { int count = 0; - #ifdef TRY_NEW_EH extern FILE *asm_out_file; struct ehEntry *entry; --- 1578,1581 ---- *************** *** 1640,1645 **** /* Beginning marker for table. */ ! ASM_OUTPUT_ALIGN (asm_out_file, 2); ! ASM_OUTPUT_LABEL (asm_out_file, "__EXCEPTION_TABLE__"); output_exception_table_entry (asm_out_file, const0_rtx, const0_rtx, const0_rtx); --- 1588,1593 ---- /* Beginning marker for table. */ ! assemble_align (GET_MODE_ALIGNMENT (Pmode)); ! assemble_label ("__EXCEPTION_TABLE__"); output_exception_table_entry (asm_out_file, const0_rtx, const0_rtx, const0_rtx); *************** *** 1659,1667 **** /* Ending marker for table. */ ! ASM_OUTPUT_LABEL (asm_out_file, "__EXCEPTION_END__"); output_exception_table_entry (asm_out_file, constm1_rtx, constm1_rtx, constm1_rtx); - - #endif /* TRY_NEW_EH */ } --- 1607,1613 ---- /* Ending marker for table. */ ! assemble_label ("__EXCEPTION_END__"); output_exception_table_entry (asm_out_file, constm1_rtx, constm1_rtx, constm1_rtx); } *************** *** 1669,1673 **** register_exception_table () { - #ifdef TRY_NEW_EH emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__register_exceptions"), 0, VOIDmode, 1, --- 1615,1618 ---- *************** *** 1674,1678 **** gen_rtx (SYMBOL_REF, Pmode, "__EXCEPTION_TABLE__"), Pmode); - #endif /* TRY_NEW_EH */ } --- 1619,1622 ---- *************** *** 1689,1691 **** --- 1633,1690 ---- } return e; + } + + start_eh_unwinder () + { + start_protect (); + } + + end_eh_unwinder (end) + rtx end; + { + tree expr; + rtx return_val_rtx, ret_val, label; + + if (! doing_eh (0)) + return; + + expr = make_node (RTL_EXPR); + TREE_TYPE (expr) = void_type_node; + RTL_EXPR_RTL (expr) = const0_rtx; + TREE_SIDE_EFFECTS (expr) = 1; + start_sequence_for_rtl_expr (expr); + + ret_val = expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS, + 0, hard_frame_pointer_rtx); + return_val_rtx = copy_to_reg (ret_val); + #ifdef NORMAL_RETURN_ADDR_OFFSET + return_val_rtx = plus_constant (return_val_rtx, NORMAL_RETURN_ADDR_OFFSET-1); + #else + return_val_rtx = plus_constant (return_val_rtx, -1); + #endif + emit_move_insn (DECL_RTL (saved_pc), return_val_rtx); + + #ifdef JUMP_TO_THROW + emit_move_insn (ret_val, gen_rtx (SYMBOL_REF, Pmode, "__throw")); + #else + label = gen_label_rtx (); + emit_move_insn (ret_val, gen_rtx (LABEL_REF, Pmode, label)); + #endif + + #ifdef NORMAL_RETURN_ADDR_OFFSET + return_val_rtx = plus_constant (ret_val, -NORMAL_RETURN_ADDR_OFFSET); + if (return_val_rtx != ret_val) + emit_move_insn (ret_val, return_val_rtx); + #endif + + emit_jump (end); + + #ifndef JUMP_TO_THROW + emit_label (label); + do_function_call (Throw, NULL_TREE, NULL_TREE); + #endif + + RTL_EXPR_SEQUENCE (expr) = get_insns (); + end_sequence (); + end_protect (expr); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/expr.c gcc-2.7.1/cp/expr.c *** gcc-2.7.0/cp/expr.c Thu Jun 15 08:22:41 1995 --- gcc-2.7.1/cp/expr.c Wed Oct 11 22:29:14 1995 *************** *** 1,5 **** /* Convert language-specific tree expression to rtl instructions, for GNU compiler. ! Copyright (C) 1988, 1992, 1993 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,5 ---- /* Convert language-specific tree expression to rtl instructions, for GNU compiler. ! Copyright (C) 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 106,110 **** && DECL_CONSTRUCTOR_P (TREE_OPERAND (func, 0))) { ! type = TYPE_POINTER_TO (type); /* Don't clobber a value that might be part of a default parameter value. */ --- 106,110 ---- && DECL_CONSTRUCTOR_P (TREE_OPERAND (func, 0))) { ! type = build_pointer_type (type); /* Don't clobber a value that might be part of a default parameter value. */ *************** *** 133,138 **** 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 --- 133,136 ---- *************** *** 142,150 **** } - preserve_temp_slots (DECL_RTL (slot)); call_exp = build (CALL_EXPR, type, func, args, 0); TREE_SIDE_EFFECTS (call_exp) = 1; return_target = expand_call (call_exp, call_target, ignore); - free_temp_slots (); if (call_target == 0) { --- 140,146 ---- *************** *** 230,233 **** --- 226,237 ---- expand_throw (TREE_OPERAND (exp, 0)); return NULL; + + case UNSAVE_EXPR: + { + rtx temp; + temp = expand_expr (TREE_OPERAND (exp, 0), target, tmode, modifier); + TREE_OPERAND (exp, 0) = unsave_expr_now (TREE_OPERAND (exp, 0)); + return temp; + } default: diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/g++.1 gcc-2.7.1/cp/g++.1 *** gcc-2.7.0/cp/g++.1 Thu May 12 22:57:12 1994 --- gcc-2.7.1/cp/g++.1 Wed Oct 11 22:29:20 1995 *************** *** 9,13 **** .. .SH NAME ! g++ \- GNU project C++ Compiler (v2.4) .SH SYNOPSIS .RB g++ " [" \c --- 9,13 ---- .. .SH NAME ! g++ \- GNU project C++ Compiler .SH SYNOPSIS .RB g++ " [" \c *************** *** 32,37 **** \&\|', `\|\c .B .cc\c ! \&\|', or `\|\c .B .cxx\c \&\|'; preprocessed C++ files use the suffix `\|\c .B .ii\c --- 32,41 ---- \&\|', `\|\c .B .cc\c ! \&\|', `\|\c .B .cxx\c + \&\|', `\|\c + .B .cpp\c + \&\|', or `\|\c + .B .c++\c \&\|'; preprocessed C++ files use the suffix `\|\c .B .ii\c diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/g++.c gcc-2.7.1/cp/g++.c *** gcc-2.7.0/cp/g++.c Thu Jun 15 08:23:15 1995 --- gcc-2.7.1/cp/g++.c Wed Oct 11 22:29:24 1995 *************** *** 41,45 **** #include #include ! #ifndef _WIN32 #include /* May get R_OK, etc. on some systems. */ #else --- 41,45 ---- #include #include ! #if !defined(_WIN32) #include /* May get R_OK, etc. on some systems. */ #else *************** *** 60,63 **** --- 60,67 ---- #define MATHLIB (1<<2) + #ifndef MATH_LIBRARY + #define MATH_LIBRARY "-lm" + #endif + /* On MSDOS, write temp files in current dir because there's no place else we can expect to use. */ *************** *** 239,249 **** char *name; { ! char *s; ! ! if (errno < sys_nerr) ! s = concat ("%s: ", sys_errlist[errno], ""); ! else ! s = "cannot open %s"; ! fatal (s, name); } --- 243,247 ---- char *name; { ! fatal (concat ("%s: ", my_strerror (errno)), name); } *************** *** 395,402 **** char *saw_math = 0; ! /* The number of arguments being added to what's in argv. By ! default it's one new argument (adding `-lstdc++'). We use this ! to track the number of times we've inserted -xc++/-xnone as well. */ ! int added = 1; /* An array used to flag each argument that needs a bit set for --- 393,400 ---- char *saw_math = 0; ! /* The number of arguments being added to what's in argv, other than ! libraries. We use this to track the number of times we've inserted ! -xc++/-xnone. */ ! int added = 0; /* An array used to flag each argument that needs a bit set for *************** *** 411,415 **** { library = 2; - ++added; } --- 409,412 ---- *************** *** 454,458 **** if (library != 0 && strcmp (argv[i], "-nostdlib") == 0) { - added--; library = 0; } --- 451,454 ---- *************** *** 467,471 **** /* If they only gave us `-v', don't try to link in libg++. */ - added--; library = 0; } --- 463,466 ---- *************** *** 483,487 **** /* Don't specify libraries if we won't link, since that would cause a warning. */ - added--; library = 0; } --- 478,481 ---- *************** *** 516,522 **** fatal ("argument to `%s' missing\n", quote); ! if (added) { ! arglist = (char **) malloc ((argc + added + 1) * sizeof (char *)); for (i = 1, j = 1; i < argc; i++, j++) --- 510,516 ---- fatal ("argument to `%s' missing\n", quote); ! if (added || library) { ! arglist = (char **) malloc ((argc + added + 4) * sizeof (char *)); for (i = 1, j = 1; i < argc; i++, j++) *************** *** 553,556 **** --- 547,552 ---- if (saw_math) arglist[j++] = saw_math; + else if (library) + arglist[j++] = MATH_LIBRARY; arglist[j] = NULL; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/gc.c gcc-2.7.1/cp/gc.c *** gcc-2.7.0/cp/gc.c Thu Jun 15 08:23:33 1995 --- gcc-2.7.1/cp/gc.c Wed Oct 11 22:29:29 1995 *************** *** 1,4 **** /* Garbage collection primitives for GNU C++. ! Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) --- 1,4 ---- /* Garbage collection primitives for GNU C++. ! Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) *************** *** 323,327 **** DECL_GC_OFFSET (to)); ! if (! expand_decl_cleanup (to, cleanup)) { compiler_error ("cannot unprotect parameter in this scope"); --- 323,327 ---- DECL_GC_OFFSET (to)); ! if (! cp_expand_decl_cleanup (to, cleanup)) { compiler_error ("cannot unprotect parameter in this scope"); *************** *** 390,398 **** if (!TYPE_VIRTUAL_P (type) || CLASSTYPE_VFIELD (type) == NULL_TREE) ! return (exp); - if (flag_vtable_thunks) - abort(); - vptr = fold (size_binop (PLUS_EXPR, size_binop (FLOOR_DIV_EXPR, --- 390,395 ---- if (!TYPE_VIRTUAL_P (type) || CLASSTYPE_VFIELD (type) == NULL_TREE) ! return exp; vptr = fold (size_binop (PLUS_EXPR, size_binop (FLOOR_DIV_EXPR, *************** *** 400,433 **** size_int (BITS_PER_UNIT)), exp)); ! vptr = build1 (INDIRECT_REF, TYPE_POINTER_TO (vtable_entry_type), vptr); ! offset = build_component_ref (build_array_ref (vptr, integer_zero_node), ! delta_identifier, ! NULL_TREE, 0); ! return build (PLUS_EXPR, class_star_type_node, exp, ! convert (ptrdiff_type_node, offset)); ! } ! ! /* Given the expression EXP of type `class *', return the ! type descriptor for the object pointed to by EXP. */ ! tree ! build_classof (exp) ! tree exp; ! { ! tree type = TREE_TYPE (exp); ! tree vptr; ! tree t_desc_entry; ! ! if (TREE_CODE (type) != POINTER_TYPE) ! { ! error ("`classof' applied to non-pointer type"); ! return error_mark_node; ! } ! vptr = build1 (INDIRECT_REF, TYPE_POINTER_TO (vtable_entry_type), exp); ! t_desc_entry = build_component_ref (build_array_ref (vptr, integer_one_node), ! get_identifier (VTABLE_PFN_NAME), ! NULL_TREE, 0); ! TREE_TYPE (t_desc_entry) = TYPE_POINTER_TO (__t_desc_type_node); ! return t_desc_entry; } --- 397,413 ---- size_int (BITS_PER_UNIT)), exp)); ! vptr = build1 (INDIRECT_REF, build_pointer_type (vtable_entry_type), vptr); ! if (flag_vtable_thunks) ! offset = build_array_ref (vptr, integer_zero_node); ! else ! offset = build_component_ref (build_array_ref (vptr, integer_zero_node), ! delta_identifier, ! NULL_TREE, 0); ! ! type = build_type_variant (ptr_type_node, TREE_READONLY (exp), ! TREE_THIS_VOLATILE (exp)); ! return build (PLUS_EXPR, type, exp, ! convert (ptrdiff_type_node, offset)); } *************** *** 448,460 **** type = TREE_TYPE (exp); ! #if 0 ! /* Fergus Henderson says we decided at the Waterloo ! meeting to strip the top cv-qualifiers. */ ! if (TYPE_VOLATILE (exp) || TYPE_READONLY (exp)) ! type = build_type_variant (type, TYPE_READONLY (exp), TYPE_VOLATILE (exp)); ! #else /* Strip top-level cv-qualifiers. */ type = TYPE_MAIN_VARIANT (type); - #endif /* if b is an instance of B, typeid(b) == typeid(B). Do this before --- 428,434 ---- type = TREE_TYPE (exp); ! /* Strip top-level cv-qualifiers. */ type = TYPE_MAIN_VARIANT (type); /* if b is an instance of B, typeid(b) == typeid(B). Do this before *************** *** 463,466 **** --- 437,447 ---- return get_typeid (type); + /* peel back references, so they match. */ + if (TREE_CODE (type) == REFERENCE_TYPE) + type = TREE_TYPE (type); + + /* Peel off cv qualifiers. */ + type = TYPE_MAIN_VARIANT (type); + /* Apply trivial conversion T -> T& for dereferenced ptrs. */ if (TREE_CODE (type) == RECORD_TYPE) *************** *** 472,476 **** /* build reference to type_info from vtable. */ tree t; ! t = build_vfn_ref ((tree *) NULL_TREE, exp, build_int_2 (0, 0)); TREE_TYPE (t) = build_pointer_type (__class_desc_type_node); t = build_indirect_ref (t, NULL); --- 453,462 ---- /* build reference to type_info from vtable. */ tree t; ! ! if (flag_vtable_thunks) ! t = build_vfn_ref ((tree *) NULL_TREE, exp, integer_one_node); ! else ! t = build_vfn_ref ((tree *) NULL_TREE, exp, integer_zero_node); ! TREE_TYPE (t) = build_pointer_type (__class_desc_type_node); t = build_indirect_ref (t, NULL); *************** *** 551,555 **** if (TYPE_SIZE (TREE_TYPE (exprtype)) == 0) goto fail; ! if (TREE_TYPE (type) == void_type_node) break; /* else fall through */ --- 537,544 ---- if (TYPE_SIZE (TREE_TYPE (exprtype)) == 0) goto fail; ! if (TREE_READONLY (TREE_TYPE (exprtype)) && ! ! TYPE_READONLY (TREE_TYPE (type))) ! goto fail; ! if (TYPE_MAIN_VARIANT (TREE_TYPE (type)) == void_type_node) break; /* else fall through */ *************** *** 566,570 **** --- 555,563 ---- if (ec == RECORD_TYPE) { + exprtype = build_type_variant (exprtype, TREE_READONLY (expr), + TREE_THIS_VOLATILE (expr)); exprtype = build_reference_type (exprtype); + expr = convert_to_reference (exprtype, expr, CONV_IMPLICIT, + LOOKUP_NORMAL, NULL_TREE); ec = REFERENCE_TYPE; } *************** *** 596,600 **** { /* 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. */ --- 589,594 ---- { /* if TYPE is `void *', return pointer to complete object. */ ! if (tc == POINTER_TYPE ! && TYPE_MAIN_VARIANT (TREE_TYPE (type)) == void_type_node) { /* if b is an object, dynamic_cast(&b) == (void *)&b. */ *************** *** 917,921 **** } #endif ! base_list = finish_table (NULL_TREE, TYPE_POINTER_TO (__t_desc_type_node), base_list, 0); off_list = finish_table (NULL_TREE, integer_type_node, --- 911,915 ---- } #endif ! base_list = finish_table (NULL_TREE, build_pointer_type (__t_desc_type_node), base_list, 0); off_list = finish_table (NULL_TREE, integer_type_node, *************** *** 1331,1336 **** } ! parents = finish_table (NULL_TREE, TYPE_POINTER_TO (__t_desc_type_node), parents, 0); ! vbases = finish_table (NULL_TREE, TYPE_POINTER_TO (__t_desc_type_node), vbases, 0); offsets = finish_table (NULL_TREE, integer_type_node, offsets, 0); if (methods == NULL_TREE) --- 1325,1330 ---- } ! parents = finish_table (NULL_TREE, build_pointer_type (__t_desc_type_node), parents, 0); ! vbases = finish_table (NULL_TREE, build_pointer_type (__t_desc_type_node), vbases, 0); offsets = finish_table (NULL_TREE, integer_type_node, offsets, 0); if (methods == NULL_TREE) *************** *** 1429,1433 **** } ! parm_types = finish_table (NULL_TREE, TYPE_POINTER_TO (__t_desc_type_node), nreverse (parm_types), 0); parm_count = build_int_2 (p_count, 0); --- 1423,1427 ---- } ! parm_types = finish_table (NULL_TREE, build_pointer_type (__t_desc_type_node), nreverse (parm_types), 0); parm_count = build_int_2 (p_count, 0); *************** *** 1464,1468 **** tree_cons (NULL_TREE, build_t_desc (TREE_TYPE (TREE_TYPE (decl)), ! IS_AGGR_TYPE (taggr)), ! tree_cons (NULL_TREE, build_c_cast (TYPE_POINTER_TO (default_function_type), build_unary_op (ADDR_EXPR, decl, 0), 0), tree_cons (NULL_TREE, parm_count, tree_cons (NULL_TREE, req_count, --- 1458,1462 ---- tree_cons (NULL_TREE, build_t_desc (TREE_TYPE (TREE_TYPE (decl)), ! IS_AGGR_TYPE (taggr)), ! tree_cons (NULL_TREE, build_c_cast (build_pointer_type (default_function_type), build_unary_op (ADDR_EXPR, decl, 0), 0), tree_cons (NULL_TREE, parm_count, tree_cons (NULL_TREE, req_count, diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/gxx.gperf gcc-2.7.1/cp/gxx.gperf *** gcc-2.7.0/cp/gxx.gperf Tue Jan 24 03:09:07 1995 --- gcc-2.7.1/cp/gxx.gperf Wed Oct 11 22:29:33 1995 *************** *** 10,20 **** __attribute, ATTRIBUTE, NORID __attribute__, ATTRIBUTE, NORID - __classof, CLASSOF, NORID - __classof__, CLASSOF, NORID __const, TYPE_QUAL, RID_CONST __const__, TYPE_QUAL, RID_CONST __extension__, EXTENSION, NORID - __headof, HEADOF, NORID - __headof__, HEADOF, NORID __inline, SCSPEC, RID_INLINE __inline__, SCSPEC, RID_INLINE --- 10,16 ---- *************** *** 41,45 **** char, TYPESPEC, RID_CHAR, class, AGGR, RID_CLASS, - classof, CLASSOF, NORID, compl, '~', NORID, const, TYPE_QUAL, RID_CONST, --- 37,40 ---- *************** *** 60,64 **** friend, SCSPEC, RID_FRIEND, goto, GOTO, NORID, - headof, HEADOF, NORID, if, IF, NORID, inline, SCSPEC, RID_INLINE, --- 55,58 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/gxxint.texi gcc-2.7.1/cp/gxxint.texi *** gcc-2.7.0/cp/gxxint.texi Tue May 16 07:13:35 1995 --- gcc-2.7.1/cp/gxxint.texi Wed Oct 11 22:29:39 1995 *************** *** 925,951 **** @section Templates ! g++ uses the simple approach to instantiating templates: it blindly ! generates the code for each instantiation as needed. For class ! templates, g++ pushes the template parameters into the namespace for the ! duration of the instantiation; for function templates, it's a simple ! search and replace. ! ! This approach does not support any of the template definition-time error ! checking that is being bandied about by X3J16. It makes no attempt to deal ! with name binding in a consistent way. ! ! Instantiation of a class template is triggered by the use of a template ! class anywhere but in a straight declaration like @code{class A}. ! This is wrong; in fact, it should not be triggered by typedefs or ! declarations of pointers. Now that explicit instantiation is supported, ! this misfeature is not necessary. - Important functions: - @table @code ! @item instantiate_class_template ! This function @end table @node Access Control, Error Reporting, Templates, Top @section Access Control --- 925,969 ---- @section Templates ! A template is represented by a @code{TEMPLATE_DECL}. The specific ! fields used are: @table @code ! @item DECL_TEMPLATE_RESULT ! The generic decl on which instantiations are based. This looks just ! like any other decl. ! ! @item DECL_TEMPLATE_PARMS ! The parameters to this template. @end table + The generic decl is parsed as much like any other decl as possible, + given the parameterization. The template decl is not built up until the + generic decl has been completed. For template classes, a template decl + is generated for each member function and static data member, as well. + + Template members of template classes are represented by a TEMPLATE_DECL + for the class' parameters around another TEMPLATE_DECL for the member's + parameters. + + All declarations that are instantiations or specializations of templates + refer to their template and parameters through DECL_TEMPLATE_INFO. + + How should I handle parsing member functions with the proper param + decls? Set them up again or try to use the same ones? Currently we do + the former. We can probably do this without any extra machinery in + store_pending_inline, by deducing the parameters from the decl in + do_pending_inlines. PRE_PARSED_TEMPLATE_DECL? + + If a base is a parm, we can't check anything about it. If a base is not + a parm, we need to check it for name binding. Do finish_base_struct if + no bases are parameterized (only if none, including indirect, are + parms). Nah, don't bother trying to do any of this until instantiation + -- we only need to do name binding in advance. + + Always set up method vec and fields, inc. synthesized methods. Really? + We can't know the types of the copy folks, or whether we need a + destructor, or can have a default ctor, until we know our bases and + fields. Otherwise, we can assume and fix ourselves later. Hopefully. + @node Access Control, Error Reporting, Templates, Top @section Access Control *************** *** 1195,1198 **** --- 1213,1223 ---- throwing. The only bad part, is that the stack remains large. + The below points out some things that work in g++'s exception handling. + + All completely constructed temps and local variables are cleaned up in + all unwinded scopes. Completely constructed parts of partially + constructed objects are cleaned up. This includes partially built + arrays. Exception specifications are now handled. + The below points out some flaws in g++'s exception handling, as it now stands. *************** *** 1200,1238 **** Only exact type matching or reference matching of throw types works when -fno-rtti is used. Only works on a SPARC (like Suns), i386, arm and ! rs6000 machines. Partial support is also in for alpha, hppa, m68k and ! mips machines, but a stack unwinder called __unwind_function has to be ! written, and added to libgcc2 for them. See below for details on ! __unwind_function. All completely constructed temps and local variables ! are cleaned up in all unwinded scopes. Completed parts of partially ! constructed objects are cleaned up with the exception that partially ! built arrays are not cleaned up as required. Don't expect exception ! handling to work right if you optimize, in fact the compiler will ! probably core dump. If two EH regions are the exact same size, the ! backend cannot tell which one is first. It punts by picking the last ! one, if they tie. This is usually right. We really should stick in a ! nop, if they are the same size. ! ! When we invoke the copy constructor for an exception object because it ! is passed by value, and if we take a hit (exception) inside the copy ! constructor someplace, where do we go? I have tentatively choosen to ! not catch throws by the outer block at the same unwind level, if one ! exists, but rather to allow the frame to unwind into the next series of ! handlers, if any. If this is the wrong way to do it, we will need to ! protect the rest of the handler in some fashion. Maybe just changing ! the handler's handler to protect the whole series of handlers is the ! right way to go. This part is wrong. We should call terminate if an ! exception is thrown while doing things like trying to copy the exception ! object. ! Exception specifications are handled syntax wise, but not semantic wise. ! build_exception_variant should sort the incoming list, so that is implements set compares, not exact list equality. Type smashing should smash exception specifications using set union. ! Thrown objects are allocated on the heap, in the usual way, but they are ! never deleted. They should be deleted by the catch clauses. If one ! runs out of heap space, throwing an object will probably never work. ! This could be relaxed some by passing an __in_chrg parameter to track ! who has control over the exception object. When the backend returns a value, it can create new exception regions --- 1225,1276 ---- Only exact type matching or reference matching of throw types works when -fno-rtti is used. Only works on a SPARC (like Suns), i386, arm and ! rs6000 machines. Partial support is in for all other machines, but a ! stack unwinder called __unwind_function has to be written, and added to ! libgcc2 for them. See below for details on __unwind_function. Don't ! expect exception handling to work right if you optimize, in fact the ! compiler will probably core dump. RTL_EXPRs for EH cond variables for ! && and || exprs should probably be wrapped in UNSAVE_EXPRs, and ! RTL_EXPRs tweaked so that they can be unsaved, and the UNSAVE_EXPR code ! should be in the backend, or alternatively, UNSAVE_EXPR should be ripped ! out and exactly one finalization allowed to be expanded by the backend. ! I talked with kenner about this, and we have to allow multiple ! expansions. ! ! We only do pointer conversions on exception matching a la 15.3 p2 case ! 3: `A handler with type T, const T, T&, or const T& is a match for a ! throw-expression with an object of type E if [3]T is a pointer type and ! E is a pointer type that can be converted to T by a standard pointer ! conversion (_conv.ptr_) not involving conversions to pointers to private ! or protected base classes.' when -frtti is given. ! ! We don't call delete on new expressions that die because the ctor threw ! an exception. See except/18 for a test case. ! ! 15.2 para 13: The exception being handled should be rethrown if control ! reaches the end of a handler of the function-try-block of a constructor ! or destructor, right now, it is not. ! ! 15.2 para 12: If a return statement appears in a handler of ! function-try-block of a constructor, the program is ill-formed, but this ! isn't diagnosed. ! ! 15.2 para 11: If the handlers of a function-try-block contain a jump ! into the body of a constructor or destructor, the program is ill-formed, ! but this isn't diagnosed. ! ! 15.2 para 9: Check that the fully constructed base classes and members ! of an object are destroyed before entering the handler of a ! function-try-block of a constructor or destructor for that object. ! build_exception_variant should sort the incoming list, so that it implements set compares, not exact list equality. Type smashing should smash exception specifications using set union. ! Thrown objects are usually allocated on the heap, in the usual way, but ! they are never deleted. They should be deleted by the catch clauses. ! If one runs out of heap space, throwing an object will probably never ! work. This could be relaxed some by passing an __in_chrg parameter to ! track who has control over the exception object. Thrown objects are not ! allocated on the heap when they are pointer to object types. When the backend returns a value, it can create new exception regions *************** *** 1240,1256 **** context of the last associated cleanup that ran to completion. The __unwind_function takes a pointer to the throw handler, and is expected to pop the stack frame that was built to call it, as well as ! the frame underneath and then jump to the throw handler. It must not ! change the three registers allocated for the pointer to the exception ! object, the pointer to the type descriptor that identifies the type of ! the exception object, and the pointer to the code that threw. On hppa, ! these are %r5, %r6, %r7. On m68k these are a2, a3, a4. On mips they ! are s0, s1, s2. On Alpha these are $9, $10, $11. It takes about a day ! to write this routine, if someone wants to volunteer to write this ! routine for any architecture, exception support for that architecture ! will be added to g++. Please send in those code donations. The backend must be extended to fully support exceptions. Right now there are a few hooks into the alpha exception handling backend that --- 1278,1429 ---- context of the last associated cleanup that ran to completion. + The structure of the code that is generated for C++ exception handling + code is shown below: + + @example + Ln: throw value; + copy value onto heap + jump throw (Ln, id, address of copy of value on heap) + + try { + +Lstart: the start of the main EH region + |... ... + +Lend: the end of the main EH region + } catch (T o) { + ...1 + } + Lresume: + nop used to make sure there is something before + the next region ends, if there is one + ... ... + + jump Ldone + [ + Lmainhandler: handler for the region Lstart-Lend + cleanup + ] zero or more, depending upon automatic vars with dtors + +Lpartial: + | jump Lover + +Lhere: + rethrow (Lhere, same id, same obj); + Lterm: handler for the region Lpartial-Lhere + call terminate + Lover: + [ + [ + call throw_type_match + if (eq) { + ] these lines disappear when there is no catch condition + +Lsregion2: + | ...1 + | jump Lresume + |Lhandler: handler for the region Lsregion2-Leregion2 + | rethrow (Lresume, same id, same obj); + +Leregion2 + } + ] there are zero or more of these sections, depending upon how many + catch clauses there are + ----------------------------- expand_end_all_catch -------------------------- + here we have fallen off the end of all catch + clauses, so we rethrow to outer + rethrow (Lresume, same id, same obj); + ----------------------------- expand_end_all_catch -------------------------- + [ + L1: maybe throw routine + ] depending upon if we have expanded it or not + Ldone: + ret + + start_all_catch emits labels: Lresume, + + #end example + The __unwind_function takes a pointer to the throw handler, and is expected to pop the stack frame that was built to call it, as well as ! the frame underneath and then jump to the throw handler. It must ! restore all registers to their proper values as well as all other ! machine state as determined by the context in which we are unwinding ! into. The way I normally start is to compile: ! ! void *g; ! foo(void* a) { g = a; } ! ! with -S, and change the thing that alters the PC (return, or ret ! usually) to not alter the PC, making sure to leave all other semantics ! (like adjusting the stack pointer, or frame pointers) in. After that, ! replicate the prologue once more at the end, again, changing the PC ! altering instructions, and finally, at the very end, jump to `g'. ! ! It takes about a week to write this routine, if someone wants to ! volunteer to write this routine for any architecture, exception support ! for that architecture will be added to g++. Please send in those code ! donations. One other thing that needs to be done, is to double check ! that __builtin_return_address (0) works. ! ! @subsection Specific Targets + For the alpha, the __unwind_function will be something resembling: + @example + void + __unwind_function(void *ptr) + @{ + /* First frame */ + asm ("ldq $15, 8($30)"); /* get the saved frame ptr; 15 is fp, 30 is sp */ + asm ("bis $15, $15, $30"); /* reload sp with the fp we found */ + + /* Second frame */ + asm ("ldq $15, 8($30)"); /* fp */ + asm ("bis $15, $15, $30"); /* reload sp with the fp we found */ + + /* Return */ + asm ("ret $31, ($16), 1"); /* return to PTR, stored in a0 */ + @} + @end example + + @noindent + However, there are a few problems preventing it from working. First of + all, the gcc-internal function @code{__builtin_return_address} needs to + work given an argument of 0 for the alpha. As it stands as of August + 30th, 1995, the code for @code{BUILT_IN_RETURN_ADDRESS} in @file{expr.c} + will definitely not work on the alpha. Instead, we need to define + the macros @code{DYNAMIC_CHAIN_ADDRESS} (maybe), + @code{RETURN_ADDR_IN_PREVIOUS_FRAME}, and definitely need a new + definition for @code{RETURN_ADDR_RTX}. + + In addition (and more importantly), we need a way to reliably find the + frame pointer on the alpha. The use of the value 8 above to restore the + frame pointer (register 15) is incorrect. On many systems, the frame + pointer is consistently offset to a specific point on the stack. On the + alpha, however, the frame pointer is pushed last. First the return + address is stored, then any other registers are saved (e.g., @code{s0}), + and finally the frame pointer is put in place. So @code{fp} could have + an offset of 8, but if the calling function saved any registers at all, + they add to the offset. + + The only places the frame size is noted are with the @samp{.frame} + directive, for use by the debugger and the OSF exception handling model + (useless to us), and in the initial computation of the new value for + @code{sp}, the stack pointer. For example, the function may start with: + + @example + lda $30,-32($30) + .frame $15,32,$26,0 + @end example + + @noindent + The 32 above is exactly the value we need. With this, we can be sure + that the frame pointer is stored 8 bytes less---in this case, at 24(sp)). + The drawback is that there is no way that I (Brendan) have found to let + us discover the size of a previous frame @emph{inside} the definition + of @code{__unwind_function}. + + So to accomplish exception handling support on the alpha, we need two + things: first, a way to figure out where the frame pointer was stored, + and second, a functional @code{__builtin_return_address} implementation + for except.c to be able to use it. + + @subsection Backend Exception Support + The backend must be extended to fully support exceptions. Right now there are a few hooks into the alpha exception handling backend that *************** *** 1285,1288 **** --- 1458,1533 ---- The above is not meant to be exhaustive, but does include all things I have thought of so far. I am sure other limitations exist. + + Below are some notes on the migration of the exception handling code + backend from the C++ frontend to the backend. + + NOTEs are to be used to denote the start of an exception region, and the + end of the region. I presume that the interface used to generate these + notes in the backend would be two functions, start_exception_region and + end_exception_region (or something like that). The frontends are + required to call them in pairs. When marking the end of a region, an + argument can be passed to indicate the handler for the marked region. + This can be passed in many ways, currently a tree is used. Another + possibility would be insns for the handler, or a label that denotes a + handler. I have a feeling insns might be the the best way to pass it. + Semantics are, if an exception is thrown inside the region, control is + transfered unconditionally to the handler. If control passes through + the handler, then the backend is to rethrow the exception, in the + context of the end of the original region. The handler is protected by + the conventional mechanisms; it is the frontend's responsibility to + protect the handler, if special semantics are required. + + This is a very low level view, and it would be nice is the backend + supported a somewhat higher level view in addition to this view. This + higher level could include source line number, name of the source file, + name of the language that threw the exception and possibly the name of + the exception. Kenner may want to rope you into doing more than just + the basics required by C++. You will have to resolve this. He may want + you to do support for non-local gotos, first scan for exception handler, + if none is found, allow the debugger to be entered, without any cleanups + being done. To do this, the backend would have to know the difference + between a cleanup-rethrower, and a real handler, if would also have to + have a way to know if a handler `matches' a thrown exception, and this + is frontend specific. + + The UNSAVE_EXPR tree code has to be migrated to the backend. Exprs such + as TARGET_EXPRs, WITH_CLEANUP_EXPRs, CALL_EXPRs and RTL_EXPRs have to be + changed to support unsaving. This is meant to be a complete list. + SAVE_EXPRs can be unsaved already. expand_decl_cleanup should be + changed to unsave it's argument, if needed. See + cp/tree.c:cp_expand_decl_cleanup, unsave_expr_now, unsave_expr, and + cp/expr.c:cplus_expand_expr(case UNSAVE_EXPR:) for the UNSAVE_EXPR code. + Now, as to why... because kenner already tripped over the exact same + problem in Ada, we talked about it, he didn't like any of the solution, + but yet, didn't like no solution either. He was willing to live with + the drawbacks of this solution. The drawback is unsave_expr_now. It + should have a callback into the frontend, to allow the unsaveing of + frontend special codes. The callback goes in, inplace of the call to + my_friendly_abort. + + The stack unwinder is one of the hardest parts to do. It is highly + machine dependent. The form that kenner seems to like was a couple of + macros, that would do the machine dependent grunt work. One preexisting + function that might be of some use is __builtin_return_address (). One + macro he seemed to want was __builtin_return_address, and the other + would do the hard work of fixing up the registers, adjusting the stack + pointer, frame pointer, arg pointer and so on. + + The eh archive (~mrs/eh) might be good reading for understanding the Ada + perspective, and some of kenners mindset, and a detailed explanation + (Message-Id: <9308301130.AA10543@vlsi1.ultra.nyu.edu>) of the concepts + involved. + + Here is a guide to existing backend type code. It is all in + cp/except.c. Check out do_unwind, and expand_builtin_throw for current + code on how to figure out what handler matches an exception, + emit_exception_table for code on emitting the PC range table that is + built during compilation, expand_exception_blocks for code that emits + all the handlers at the end of a functions, end_protect to mark the end + of an exception region, start_protect to mark the start of an exception + region, lang_interim_eh is the master hook used by the backend into the + EH backend that now exists in the frontend, and expand_internal_throw to + raise an exception. + @node Free Store, Concept Index, Exception Handling, Top diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/hash.h gcc-2.7.1/cp/hash.h *** gcc-2.7.0/cp/hash.h Mon Nov 28 19:54:35 1994 --- gcc-2.7.1/cp/hash.h Wed Oct 11 22:29:43 1995 *************** *** 4,13 **** struct resword { char *name; short token; enum rid rid;}; ! #define TOTAL_KEYWORDS 101 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 16 #define MIN_HASH_VALUE 4 ! #define MAX_HASH_VALUE 210 ! /* maximum key range = 207, duplicates = 0 */ #ifdef __GNUC__ --- 4,13 ---- struct resword { char *name; short token; enum rid rid;}; ! #define TOTAL_KEYWORDS 97 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 16 #define MIN_HASH_VALUE 4 ! #define MAX_HASH_VALUE 219 ! /* maximum key range = 216, duplicates = 0 */ #ifdef __GNUC__ *************** *** 21,37 **** static unsigned char asso_values[] = { ! 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, ! 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, ! 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, ! 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, ! 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, ! 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, ! 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, ! 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, ! 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, ! 211, 211, 211, 211, 211, 0, 211, 35, 1, 69, ! 61, 0, 19, 65, 20, 100, 211, 5, 11, 52, ! 3, 25, 6, 2, 31, 26, 4, 41, 24, 64, ! 10, 24, 211, 211, 211, 211, 211, 211, }; register int hval = len; --- 21,37 ---- static unsigned char asso_values[] = { ! 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ! 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ! 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ! 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ! 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ! 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ! 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ! 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ! 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ! 220, 220, 220, 220, 220, 0, 220, 88, 16, 19, ! 52, 0, 9, 72, 1, 77, 220, 0, 0, 38, ! 13, 44, 38, 30, 27, 57, 1, 14, 0, 2, ! 2, 7, 220, 220, 220, 220, 220, 220, }; register int hval = len; *************** *** 66,207 **** {"",}, {"",}, {"",}, {"",}, {"else", ELSE, NORID,}, - {"",}, {"",}, {"",}, {"true", CXX_TRUE, NORID,}, ! {"extern", SCSPEC, RID_EXTERN,}, {"not", '!', NORID,}, ! {"not_eq", EQCOMPARE, NORID,}, {"",}, {"",}, ! {"__inline", SCSPEC, RID_INLINE}, {"",}, ! {"__inline__", SCSPEC, RID_INLINE}, {"",}, - {"xor_eq", ASSIGN, NORID,}, - {"",}, {"",}, {"",}, - {"template", TEMPLATE, RID_TEMPLATE,}, - {"",}, {"",}, - {"__alignof__", ALIGNOF, NORID}, {"__extension__", EXTENSION, NORID}, ! {"bool", TYPESPEC, RID_BOOL,}, {"",}, ! {"typeof", TYPEOF, NORID,}, {"",}, ! {"try", TRY, NORID,}, ! {"or_eq", ASSIGN, NORID,}, ! {"__asm__", GCC_ASM_KEYWORD, NORID}, {"",}, ! {"__headof__", HEADOF, NORID}, {"",}, {"private", VISSPEC, RID_PRIVATE,}, {"__const__", TYPE_QUAL, RID_CONST}, {"__volatile", TYPE_QUAL, RID_VOLATILE}, ! {"__const", TYPE_QUAL, RID_CONST}, {"__volatile__", TYPE_QUAL, RID_VOLATILE}, ! {"__alignof", ALIGNOF, NORID}, ! {"and_eq", ASSIGN, NORID,}, ! {"xor", '^', NORID,}, {"static_cast", STATIC_CAST, NORID,}, - {"break", BREAK, NORID,}, - {"namespace", NAMESPACE, NORID,}, - {"__classof__", CLASSOF, NORID}, - {"typedef", SCSPEC, RID_TYPEDEF,}, {"false", CXX_FALSE, NORID,}, {"sizeof", SIZEOF, NORID,}, - {"__headof", HEADOF, NORID}, - {"for", FOR, NORID,}, - {"",}, - {"__label__", LABEL, NORID}, - {"switch", SWITCH, NORID,}, - {"virtual", SCSPEC, RID_VIRTUAL,}, {"or", OROR, NORID,}, - {"__typeof__", TYPEOF, NORID}, - {"this", THIS, NORID,}, - {"",}, - {"bitor", '|', NORID,}, - {"float", TYPESPEC, RID_FLOAT,}, - {"typename", TYPENAME_KEYWORD, NORID,}, - {"__classof", CLASSOF, NORID}, - {"short", TYPESPEC, RID_SHORT,}, - {"delete", DELETE, NORID,}, {"double", TYPESPEC, RID_DOUBLE,}, {"",}, - {"new", NEW, NORID,}, - {"typeid", TYPEID, NORID,}, - {"",}, - {"case", CASE, NORID,}, {"union", AGGR, RID_UNION,}, ! {"sigof", SIGOF, NORID /* Extension */,}, ! {"__typeof", TYPEOF, NORID}, {"struct", AGGR, RID_RECORD,}, ! {"volatile", TYPE_QUAL, RID_VOLATILE,}, {"signature", AGGR, RID_SIGNATURE /* Extension */,}, ! {"while", WHILE, NORID,}, ! {"return", RETURN, NORID,}, {"",}, {"__asm", GCC_ASM_KEYWORD, NORID}, {"protected", VISSPEC, RID_PROTECTED,}, - {"reinterpret_cast", REINTERPRET_CAST, NORID,}, - {"friend", SCSPEC, RID_FRIEND,}, {"",}, ! {"do", DO, NORID,}, ! {"auto", SCSPEC, RID_AUTO,}, ! {"asm", ASM_KEYWORD, NORID,}, ! {"compl", '~', NORID,}, ! {"public", VISSPEC, RID_PUBLIC,}, {"",}, ! {"mutable", SCSPEC, RID_MUTABLE,}, {"",}, {"signed", TYPESPEC, RID_SIGNED,}, ! {"",}, ! {"throw", THROW, NORID,}, ! {"and", ANDAND, NORID,}, {"",}, {"",}, {"",}, ! {"bitand", '&', NORID,}, ! {"const", TYPE_QUAL, RID_CONST,}, ! {"static", SCSPEC, RID_STATIC,}, ! {"headof", HEADOF, NORID,}, ! {"int", TYPESPEC, RID_INT,}, ! {"enum", ENUM, NORID,}, ! {"",}, ! {"__signed__", TYPESPEC, RID_SIGNED}, {"default", DEFAULT, NORID,}, ! {"",}, ! {"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,}, ! {"using", USING, NORID,}, ! {"__attribute", ATTRIBUTE, NORID}, {"",}, ! {"__attribute__", ATTRIBUTE, NORID}, {"",}, {"goto", GOTO, NORID,}, - {"operator", OPERATOR, NORID,}, - {"if", IF, NORID,}, - {"continue", CONTINUE, NORID,}, - {"explicit", SCSPEC, RID_EXPLICIT,}, - {"",}, {"",}, - {"class", AGGR, RID_CLASS,}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"char", TYPESPEC, RID_CHAR,}, - {"",}, {"",}, {"",}, {"",}, - {"classof", CLASSOF, NORID,}, - {"",}, {"",}, {"",}, {"",}, - {"long", TYPESPEC, RID_LONG,}, - {"",}, {"",}, {"",}, {"",}, - {"void", TYPESPEC, RID_VOID,}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"overload", OVERLOAD, NORID,}, - {"",}, {"",}, - {"catch", CATCH, NORID,}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"__signed", TYPESPEC, RID_SIGNED}, - {"register", SCSPEC, RID_REGISTER,}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"const_cast", CONST_CAST, NORID,}, - {"",}, {"",}, {"dynamic_cast", DYNAMIC_CAST, NORID,}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"inline", SCSPEC, RID_INLINE,}, ! {"",}, {"",}, {"",}, ! {"unsigned", TYPESPEC, RID_UNSIGNED,}, }; --- 66,207 ---- {"",}, {"",}, {"",}, {"",}, {"else", ELSE, NORID,}, {"true", CXX_TRUE, NORID,}, ! {"",}, ! {"while", WHILE, NORID,}, ! {"virtual", SCSPEC, RID_VIRTUAL,}, ! {"",}, {"",}, ! {"try", TRY, NORID,}, ! {"",}, {"",}, {"",}, {"",}, ! {"typeof", TYPEOF, NORID,}, {"not", '!', NORID,}, ! {"new", NEW, NORID,}, ! {"extern", SCSPEC, RID_EXTERN,}, ! {"bool", TYPESPEC, RID_BOOL,}, {"",}, {"",}, ! {"case", CASE, NORID,}, ! {"__alignof__", ALIGNOF, NORID}, {"",}, ! {"typedef", SCSPEC, RID_TYPEDEF,}, {"",}, {"__extension__", EXTENSION, NORID}, ! {"",}, {"",}, ! {"__alignof", ALIGNOF, NORID}, ! {"xor", '^', NORID,}, {"",}, ! {"__inline", SCSPEC, RID_INLINE}, {"",}, ! {"__inline__", SCSPEC, RID_INLINE}, {"",}, ! {"xor_eq", ASSIGN, NORID,}, ! {"for", FOR, NORID,}, ! {"",}, {"",}, ! {"continue", CONTINUE, NORID,}, {"",}, + {"catch", CATCH, NORID,}, {"private", VISSPEC, RID_PRIVATE,}, + {"",}, + {"typename", TYPENAME_KEYWORD, NORID,}, + {"template", TEMPLATE, RID_TEMPLATE,}, + {"not_eq", EQCOMPARE, NORID,}, + {"",}, {"",}, + {"throw", THROW, NORID,}, + {"__const", TYPE_QUAL, RID_CONST}, {"__const__", TYPE_QUAL, RID_CONST}, {"__volatile", TYPE_QUAL, RID_VOLATILE}, ! {"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,}, {"__volatile__", TYPE_QUAL, RID_VOLATILE}, ! {"delete", DELETE, NORID,}, ! {"typeid", TYPEID, NORID,}, ! {"return", RETURN, NORID,}, ! {"__typeof__", TYPEOF, NORID}, ! {"compl", '~', NORID,}, ! {"public", VISSPEC, RID_PUBLIC,}, ! {"__asm__", GCC_ASM_KEYWORD, NORID}, ! {"switch", SWITCH, NORID,}, ! {"",}, ! {"friend", SCSPEC, RID_FRIEND,}, ! {"__typeof", TYPEOF, NORID}, ! {"",}, {"static_cast", STATIC_CAST, NORID,}, {"false", CXX_FALSE, NORID,}, {"sizeof", SIZEOF, NORID,}, {"or", OROR, NORID,}, {"double", TYPESPEC, RID_DOUBLE,}, {"",}, {"union", AGGR, RID_UNION,}, ! {"char", TYPESPEC, RID_CHAR,}, {"struct", AGGR, RID_RECORD,}, ! {"or_eq", ASSIGN, NORID,}, ! {"enum", ENUM, NORID,}, ! {"int", TYPESPEC, RID_INT,}, ! {"const", TYPE_QUAL, RID_CONST,}, ! {"static", SCSPEC, RID_STATIC,}, ! {"reinterpret_cast", REINTERPRET_CAST, NORID,}, ! {"",}, ! {"explicit", SCSPEC, RID_EXPLICIT,}, ! {"__signed__", TYPESPEC, RID_SIGNED}, ! {"if", IF, NORID,}, ! {"__attribute", ATTRIBUTE, NORID}, ! {"short", TYPESPEC, RID_SHORT,}, ! {"__attribute__", ATTRIBUTE, NORID}, ! {"bitor", '|', NORID,}, {"signature", AGGR, RID_SIGNATURE /* Extension */,}, ! {"",}, ! {"__sigof__", SIGOF, NORID /* Extension */,}, ! {"volatile", TYPE_QUAL, RID_VOLATILE,}, ! {"__label__", LABEL, NORID}, ! {"do", DO, NORID,}, {"",}, {"__asm", GCC_ASM_KEYWORD, NORID}, {"protected", VISSPEC, RID_PROTECTED,}, {"",}, ! {"float", TYPESPEC, RID_FLOAT,}, ! {"using", USING, NORID,}, {"",}, ! {"const_cast", CONST_CAST, NORID,}, {"",}, + {"void", TYPESPEC, RID_VOID,}, + {"break", BREAK, NORID,}, + {"namespace", NAMESPACE, NORID,}, + {"",}, {"",}, {"",}, {"",}, + {"sigof", SIGOF, NORID /* Extension */,}, + {"",}, {"",}, {"",}, + {"this", THIS, NORID,}, + {"",}, {"",}, {"",}, {"",}, + {"and_eq", ASSIGN, NORID,}, + {"",}, {"",}, {"",}, {"signed", TYPESPEC, RID_SIGNED,}, ! {"asm", ASM_KEYWORD, NORID,}, {"",}, {"",}, {"",}, ! {"mutable", SCSPEC, RID_MUTABLE,}, ! {"",}, {"",}, {"",}, ! {"__signed", TYPESPEC, RID_SIGNED}, ! {"class", AGGR, RID_CLASS,}, ! {"register", SCSPEC, RID_REGISTER,}, ! {"",}, {"",}, {"",}, ! {"and", ANDAND, NORID,}, ! {"",}, {"",}, {"",}, {"",}, ! {"long", TYPESPEC, RID_LONG,}, {"default", DEFAULT, NORID,}, ! {"operator", OPERATOR, NORID,}, ! {"unsigned", TYPESPEC, RID_UNSIGNED,}, ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"inline", SCSPEC, RID_INLINE,}, {"",}, ! {"bitand", '&', NORID,}, {"",}, {"goto", GOTO, NORID,}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"dynamic_cast", DYNAMIC_CAST, NORID,}, + {"",}, {"",}, {"",}, {"",}, {"",}, + {"__signature__", AGGR, RID_SIGNATURE /* Extension */,}, + {"",}, + {"auto", SCSPEC, RID_AUTO,}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, ! {"",}, {"",}, ! {"overload", OVERLOAD, NORID,}, }; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/init.c gcc-2.7.1/cp/init.c *** gcc-2.7.0/cp/init.c Thu Jun 15 08:24:20 1995 --- gcc-2.7.1/cp/init.c Wed Oct 11 22:29:58 1995 *************** *** 730,734 **** assemble_external (vtbl); TREE_USED (vtbl) = 1; ! vtbl = build1 (ADDR_EXPR, TYPE_POINTER_TO (TREE_TYPE (vtbl)), vtbl); decl = convert_pointer_to_real (vtype_binfo, decl); vtbl_ptr = build_vfield_ref (build_indirect_ref (decl, NULL_PTR), vtype); --- 730,734 ---- assemble_external (vtbl); TREE_USED (vtbl) = 1; ! vtbl = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (vtbl)), vtbl); decl = convert_pointer_to_real (vtype_binfo, decl); vtbl_ptr = build_vfield_ref (build_indirect_ref (decl, NULL_PTR), vtype); *************** *** 841,846 **** && TYPE_NEEDS_CONSTRUCTING (DECL_CONTEXT (field))) { ! cp_error ("member `%D' comes from base class needing constructor", ! field); return 0; } --- 841,850 ---- && TYPE_NEEDS_CONSTRUCTING (DECL_CONTEXT (field))) { ! if (current_function_decl && DECL_CONSTRUCTOR_P (current_function_decl)) ! cp_error ("initialization of `%D' inside constructor for `%T'", ! field, type); ! else ! cp_error ("member `%D' comes from base class needing constructor", ! field); return 0; } *************** *** 1072,1075 **** --- 1076,1081 ---- is to be stored in EXP, or it is a parameter list to go to a constructor, which will operate on EXP. + If INIT is not a parameter list for a constructor, then set + LOOKUP_ONLYCONVERTING. If FLAGS is LOOKUP_ONLYCONVERTING then it is the = init form of the initializer, if FLAGS is 0, then it is the (init) form. *************** *** 1110,1113 **** --- 1116,1120 ---- tree type = TREE_TYPE (exp); int was_const = TREE_READONLY (exp); + int was_volatile = TREE_THIS_VOLATILE (exp); if (init == error_mark_node) *************** *** 1115,1118 **** --- 1122,1129 ---- TREE_READONLY (exp) = 0; + TREE_THIS_VOLATILE (exp) = 0; + + if (init && TREE_CODE (init) != TREE_LIST) + flags |= LOOKUP_ONLYCONVERTING; if (TREE_CODE (type) == ARRAY_TYPE) *************** *** 1120,1126 **** /* Must arrange to initialize each element of EXP from elements of INIT. */ - int was_const_elts = TYPE_READONLY (TREE_TYPE (type)); tree itype = init ? TREE_TYPE (init) : NULL_TREE; ! if (was_const_elts) { TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type); --- 1131,1136 ---- /* Must arrange to initialize each element of EXP from elements of INIT. */ tree itype = init ? TREE_TYPE (init) : NULL_TREE; ! if (TYPE_READONLY (TREE_TYPE (type)) || TYPE_VOLATILE (TREE_TYPE (type))) { TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type); *************** *** 1148,1151 **** --- 1158,1162 ---- init && comptypes (TREE_TYPE (init), TREE_TYPE (exp), 1)); TREE_READONLY (exp) = was_const; + TREE_THIS_VOLATILE (exp) = was_volatile; TREE_TYPE (exp) = type; if (init) *************** *** 1169,1172 **** --- 1180,1184 ---- init, alias_this, LOOKUP_NORMAL|flags); TREE_READONLY (exp) = was_const; + TREE_THIS_VOLATILE (exp) = was_volatile; } *************** *** 1226,1229 **** --- 1238,1243 ---- else { + if (flags & LOOKUP_ONLYCONVERTING) + flags |= LOOKUP_NO_CONVERSION; rval = build_method_call (exp, constructor_name_full (type), parms, binfo, flags); *************** *** 1783,1787 **** { basetype_path = TYPE_BINFO (type); ! decl = build1 (NOP_EXPR, TYPE_POINTER_TO (type), error_mark_node); } else if (current_class_decl == 0) --- 1797,1801 ---- { basetype_path = TYPE_BINFO (type); ! decl = build1 (NOP_EXPR, build_pointer_type (type), error_mark_node); } else if (current_class_decl == 0) *************** *** 1788,1792 **** { dont_use_this = 1; ! decl = build1 (NOP_EXPR, TYPE_POINTER_TO (type), error_mark_node); } else --- 1802,1806 ---- { dont_use_this = 1; ! decl = build1 (NOP_EXPR, build_pointer_type (type), error_mark_node); } else *************** *** 2189,2193 **** if (TREE_ADDRESSABLE (member) == 0) { ! cp_error_at ("member `%D' is non-static in static member function context", member); error ("at this point in file"); TREE_ADDRESSABLE (member) = 1; --- 2203,2208 ---- if (TREE_ADDRESSABLE (member) == 0) { ! cp_error_at ("member `%D' is non-static but referenced as a static member", ! member); error ("at this point in file"); TREE_ADDRESSABLE (member) = 1; *************** *** 3034,3038 **** && (TYPE_GETS_NEW (true_type) & (1 << has_array))) rval = build_opfncall (code, LOOKUP_NORMAL, ! TYPE_POINTER_TO (true_type), size, placement); else if (placement) { --- 3049,3053 ---- && (TYPE_GETS_NEW (true_type) & (1 << has_array))) rval = build_opfncall (code, LOOKUP_NORMAL, ! build_pointer_type (true_type), size, placement); else if (placement) { *************** *** 3061,3067 **** if (alignment) { ! rval = build (PLUS_EXPR, TYPE_POINTER_TO (true_type), rval, alignment); ! rval = build (BIT_AND_EXPR, TYPE_POINTER_TO (true_type), rval, build1 (BIT_NOT_EXPR, integer_type_node, alignment)); --- 3076,3082 ---- if (alignment) { ! rval = build (PLUS_EXPR, build_pointer_type (true_type), rval, alignment); ! rval = build (BIT_AND_EXPR, build_pointer_type (true_type), rval, build1 (BIT_NOT_EXPR, integer_type_node, alignment)); *************** *** 3097,3101 **** rval = save_expr (build_binary_op (PLUS_EXPR, rval, extra, 1)); /* Store header info. */ ! cookie = build_indirect_ref (build (MINUS_EXPR, TYPE_POINTER_TO (BI_header_type), rval, extra), NULL_PTR); exp1 = build (MODIFY_EXPR, void_type_node, --- 3112,3116 ---- rval = save_expr (build_binary_op (PLUS_EXPR, rval, extra, 1)); /* Store header info. */ ! cookie = build_indirect_ref (build (MINUS_EXPR, build_pointer_type (BI_header_type), rval, extra), NULL_PTR); exp1 = build (MODIFY_EXPR, void_type_node, *************** *** 3184,3189 **** /* In case of static initialization, SAVE_EXPR is good enough. */ rval = save_expr (rval); - init = copy_to_permanent (init); rval = copy_to_permanent (rval); static_aggregates = perm_tree_cons (init, rval, static_aggregates); } --- 3199,3209 ---- /* In case of static initialization, SAVE_EXPR is good enough. */ rval = save_expr (rval); rval = copy_to_permanent (rval); + init = copy_to_permanent (init); + init = expand_vec_init (decl, rval, + build_binary_op (MINUS_EXPR, nelts, + integer_one_node, 1), + init, 0); + init = copy_to_permanent (init); static_aggregates = perm_tree_cons (init, rval, static_aggregates); } *************** *** 3303,3306 **** --- 3323,3494 ---- } + static tree + build_vec_delete_1 (base, maxindex, type, auto_delete_vec, auto_delete, + use_global_delete) + tree base, maxindex, type; + tree auto_delete_vec, auto_delete; + int use_global_delete; + { + tree virtual_size; + tree ptype = build_pointer_type (type); + tree size_exp = size_in_bytes (type); + + /* Temporary variables used by the loop. */ + tree tbase, tbase_init; + + /* This is the body of the loop that implements the deletion of a + single element, and moves temp variables to next elements. */ + tree body; + + /* This is the LOOP_EXPR that governs the deletion of the elements. */ + tree loop; + + /* This is the thing that governs what to do after the loop has run. */ + tree deallocate_expr = 0; + + /* This is the BIND_EXPR which holds the outermost iterator of the + loop. It is convenient to set this variable up and test it before + executing any other code in the loop. + This is also the containing expression returned by this function. */ + tree controller = NULL_TREE; + + /* This is the BLOCK to record the symbol binding for debugging. */ + tree block; + + if (! IS_AGGR_TYPE (type) || ! TYPE_NEEDS_DESTRUCTOR (type)) + { + loop = integer_zero_node; + goto no_destructor; + } + + /* The below is short by BI_header_size */ + virtual_size = fold (size_binop (MULT_EXPR, size_exp, maxindex)); + + tbase = build_decl (VAR_DECL, NULL_TREE, ptype); + tbase_init = build_modify_expr (tbase, NOP_EXPR, + fold (build (PLUS_EXPR, ptype, + base, + virtual_size))); + DECL_REGISTER (tbase) = 1; + controller = build (BIND_EXPR, void_type_node, tbase, 0, 0); + TREE_SIDE_EFFECTS (controller) = 1; + block = build_block (tbase, 0, 0, 0, 0); + add_block_current_level (block); + + if (auto_delete != integer_zero_node + && auto_delete != integer_two_node) + { + tree base_tbd = convert (ptype, + build_binary_op (MINUS_EXPR, + convert (ptr_type_node, base), + BI_header_size, + 1)); + /* This is the real size */ + virtual_size = size_binop (PLUS_EXPR, virtual_size, BI_header_size); + body = build_tree_list (NULL_TREE, + build_x_delete (ptype, base_tbd, + 2 | use_global_delete, + virtual_size)); + body = build (COND_EXPR, void_type_node, + build (BIT_AND_EXPR, integer_type_node, + auto_delete, integer_one_node), + body, integer_zero_node); + } + else + body = NULL_TREE; + + body = tree_cons (NULL_TREE, + build_delete (ptype, tbase, auto_delete, + LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 1), + body); + + body = tree_cons (NULL_TREE, + build_modify_expr (tbase, NOP_EXPR, build (MINUS_EXPR, ptype, tbase, size_exp)), + body); + + body = tree_cons (NULL_TREE, + build (EXIT_EXPR, void_type_node, + build (EQ_EXPR, boolean_type_node, base, tbase)), + body); + + loop = build (LOOP_EXPR, void_type_node, build_compound_expr (body)); + + loop = tree_cons (NULL_TREE, tbase_init, + tree_cons (NULL_TREE, loop, NULL_TREE)); + loop = build_compound_expr (loop); + + no_destructor: + /* If the delete flag is one, or anything else with the low bit set, + delete the storage. */ + if (auto_delete_vec == integer_zero_node + || auto_delete_vec == integer_two_node) + deallocate_expr = integer_zero_node; + else + { + tree base_tbd; + + /* The below is short by BI_header_size */ + virtual_size = fold (size_binop (MULT_EXPR, size_exp, maxindex)); + + if (! TYPE_VEC_NEW_USES_COOKIE (type)) + /* no header */ + base_tbd = base; + else + { + base_tbd = convert (ptype, + build_binary_op (MINUS_EXPR, + convert (string_type_node, base), + BI_header_size, + 1)); + /* True size with header. */ + virtual_size = size_binop (PLUS_EXPR, virtual_size, BI_header_size); + } + deallocate_expr = build_x_delete (ptype, base_tbd, + 2 | use_global_delete, + virtual_size); + if (auto_delete_vec != integer_one_node) + deallocate_expr = build (COND_EXPR, void_type_node, + build (BIT_AND_EXPR, integer_type_node, + auto_delete_vec, integer_one_node), + deallocate_expr, integer_zero_node); + } + + if (loop && deallocate_expr != integer_zero_node) + { + body = tree_cons (NULL_TREE, loop, + tree_cons (NULL_TREE, deallocate_expr, NULL_TREE)); + body = build_compound_expr (body); + } + else + body = loop; + + /* Outermost wrapper: If pointer is null, punt. */ + body = build (COND_EXPR, void_type_node, + build (NE_EXPR, boolean_type_node, base, integer_zero_node), + body, integer_zero_node); + body = build1 (NOP_EXPR, void_type_node, body); + + if (controller) + { + TREE_OPERAND (controller, 1) = body; + return controller; + } + else + return convert (void_type_node, body); + } + + /* Build a tree to cleanup partially built arrays. + BASE is that starting address of the array. + COUNT is the count of objects that have been built, that need destroying. + TYPE is the type of elements in the array. */ + static tree + build_array_eh_cleanup (base, count, type) + tree base, count, type; + { + tree expr = build_vec_delete_1 (base, count, type, integer_two_node, + integer_zero_node, 0); + return expr; + } + /* `expand_vec_init' performs initialization of a vector of aggregate types. *************** *** 3347,3356 **** /* Set to zero in case size is <= 0. Optimizer will delete this if it is not needed. */ ! rval = get_temp_regvar (TYPE_POINTER_TO (type), ! convert (TYPE_POINTER_TO (type), null_pointer_node)); base = default_conversion (base); ! base = convert (TYPE_POINTER_TO (type), base); expand_assignment (rval, base, 0, 0); ! base = get_temp_regvar (TYPE_POINTER_TO (type), base); if (init != NULL_TREE --- 3535,3544 ---- /* Set to zero in case size is <= 0. Optimizer will delete this if it is not needed. */ ! rval = get_temp_regvar (build_pointer_type (type), ! convert (build_pointer_type (type), null_pointer_node)); base = default_conversion (base); ! base = convert (build_pointer_type (type), base); expand_assignment (rval, base, 0, 0); ! base = get_temp_regvar (build_pointer_type (type), base); if (init != NULL_TREE *************** *** 3361,3365 **** tree elts = CONSTRUCTOR_ELTS (init); tree baseref = build1 (INDIRECT_REF, type, base); ! tree baseinc = build (PLUS_EXPR, TYPE_POINTER_TO (type), base, size); int host_i = TREE_INT_CST_LOW (maxindex); --- 3549,3553 ---- tree elts = CONSTRUCTOR_ELTS (init); tree baseref = build1 (INDIRECT_REF, type, base); ! tree baseinc = build (PLUS_EXPR, build_pointer_type (type), base, size); int host_i = TREE_INT_CST_LOW (maxindex); *************** *** 3438,3441 **** --- 3626,3631 ---- expand_start_cond (build (GE_EXPR, boolean_type_node, iterator, integer_zero_node), 0); + if (TYPE_NEEDS_DESTRUCTOR (type)) + start_protect (); expand_start_loop_continue_elsewhere (1); *************** *** 3463,3467 **** if (init != 0) sorry ("cannot initialize multi-dimensional array with initializer"); ! expand_vec_init (decl, build1 (NOP_EXPR, TYPE_POINTER_TO (TREE_TYPE (type)), base), array_type_nelts (type), 0, 0); } --- 3653,3657 ---- if (init != 0) sorry ("cannot initialize multi-dimensional array with initializer"); ! expand_vec_init (decl, build1 (NOP_EXPR, build_pointer_type (TREE_TYPE (type)), base), array_type_nelts (type), 0, 0); } *************** *** 3470,3478 **** expand_assignment (base, ! build (PLUS_EXPR, TYPE_POINTER_TO (type), base, size), 0, 0); if (base2) expand_assignment (base2, ! build (PLUS_EXPR, TYPE_POINTER_TO (type), base2, size), 0, 0); expand_loop_continue_here (); expand_exit_loop_if_false (0, build (NE_EXPR, boolean_type_node, --- 3660,3668 ---- expand_assignment (base, ! build (PLUS_EXPR, build_pointer_type (type), base, size), 0, 0); if (base2) expand_assignment (base2, ! build (PLUS_EXPR, build_pointer_type (type), base2, size), 0, 0); expand_loop_continue_here (); expand_exit_loop_if_false (0, build (NE_EXPR, boolean_type_node, *************** *** 3486,3489 **** --- 3676,3686 ---- } expand_end_loop (); + if (TYPE_NEEDS_DESTRUCTOR (type)) + end_protect (build_array_eh_cleanup (rval, + build_binary_op (MINUS_EXPR, + maxindex, + iterator, + 1), + type)); expand_end_cond (); if (obey_regdecls) *************** *** 3593,3596 **** --- 3790,3798 ---- if (TREE_SIDE_EFFECTS (addr)) addr = save_expr (addr); + if (TYPE_DOMAIN (type) == NULL_TREE) + { + error ("unknown array size in delete"); + return error_mark_node; + } return build_vec_delete (addr, array_type_nelts (type), c_sizeof_nowarn (TREE_TYPE (type)), *************** *** 3840,3844 **** this_auto_delete = integer_zero_node; ! expr = build_delete (TYPE_POINTER_TO (BINFO_TYPE (base_binfo)), addr, this_auto_delete, flags, 0); exprstmt = tree_cons (NULL_TREE, expr, exprstmt); --- 4042,4046 ---- this_auto_delete = integer_zero_node; ! expr = build_delete (build_pointer_type (BINFO_TYPE (base_binfo)), addr, this_auto_delete, flags, 0); exprstmt = tree_cons (NULL_TREE, expr, exprstmt); *************** *** 3854,3861 **** /* May be zero offset if other baseclasses are virtual. */ ! expr = fold (build (PLUS_EXPR, TYPE_POINTER_TO (BINFO_TYPE (base_binfo)), addr, BINFO_OFFSET (base_binfo))); ! expr = build_delete (TYPE_POINTER_TO (BINFO_TYPE (base_binfo)), expr, integer_zero_node, flags, 0); --- 4056,4063 ---- /* May be zero offset if other baseclasses are virtual. */ ! expr = fold (build (PLUS_EXPR, build_pointer_type (BINFO_TYPE (base_binfo)), addr, BINFO_OFFSET (base_binfo))); ! expr = build_delete (build_pointer_type (BINFO_TYPE (base_binfo)), expr, integer_zero_node, flags, 0); *************** *** 3898,3902 **** while (vbases) { ! tree this_addr = convert_force (TYPE_POINTER_TO (BINFO_TYPE (vbases)), addr, 0); result = tree_cons (NULL_TREE, --- 4100,4104 ---- while (vbases) { ! tree this_addr = convert_force (build_pointer_type (BINFO_TYPE (vbases)), addr, 0); result = tree_cons (NULL_TREE, *************** *** 3933,3960 **** int use_global_delete; { - tree ptype = TREE_TYPE (base); tree type; - tree virtual_size; - /* Temporary variables used by the loop. */ - tree tbase, size_exp, tbase_init; - - /* This is the body of the loop that implements the deletion of a - single element, and moves temp variables to next elements. */ - tree body; - - /* This is the LOOP_EXPR that governs the deletion of the elements. */ - tree loop; - - /* This is the thing that governs what to do after the loop has run. */ - tree deallocate_expr = 0; ! /* This is the BIND_EXPR which holds the outermost iterator of the ! loop. It is convenient to set this variable up and test it before ! executing any other code in the loop. ! This is also the containing expression returned by this function. */ ! tree controller = NULL_TREE; ! /* This is the BLOCK to record the symbol binding for debugging. */ ! tree block; base = stabilize_reference (base); --- 4135,4144 ---- int use_global_delete; { tree type; ! if (TREE_CODE (base) == OFFSET_REF) ! base = resolve_offset_ref (base); ! type = TREE_TYPE (base); base = stabilize_reference (base); *************** *** 3964,3971 **** base = save_expr (base); ! if (TREE_CODE (ptype) == POINTER_TYPE) { /* Step back one from start of vector, and read dimension. */ ! tree cookie_addr = build (MINUS_EXPR, TYPE_POINTER_TO (BI_header_type), base, BI_header_size); tree cookie = build_indirect_ref (cookie_addr, NULL_PTR); --- 4148,4155 ---- base = save_expr (base); ! if (TREE_CODE (type) == POINTER_TYPE) { /* Step back one from start of vector, and read dimension. */ ! tree cookie_addr = build (MINUS_EXPR, build_pointer_type (BI_header_type), base, BI_header_size); tree cookie = build_indirect_ref (cookie_addr, NULL_PTR); *************** *** 3972,3984 **** maxindex = build_component_ref (cookie, nc_nelts_field_id, 0, 0); do ! ptype = TREE_TYPE (ptype); ! while (TREE_CODE (ptype) == ARRAY_TYPE); } ! else if (TREE_CODE (ptype) == ARRAY_TYPE) { /* get the total number of things in the array, maxindex is a bad name */ ! maxindex = array_type_nelts_total (ptype); ! while (TREE_CODE (ptype) == ARRAY_TYPE) ! ptype = TREE_TYPE (ptype); base = build_unary_op (ADDR_EXPR, base, 1); } --- 4156,4168 ---- maxindex = build_component_ref (cookie, nc_nelts_field_id, 0, 0); do ! type = TREE_TYPE (type); ! while (TREE_CODE (type) == ARRAY_TYPE); } ! else if (TREE_CODE (type) == ARRAY_TYPE) { /* get the total number of things in the array, maxindex is a bad name */ ! maxindex = array_type_nelts_total (type); ! while (TREE_CODE (type) == ARRAY_TYPE) ! type = TREE_TYPE (type); base = build_unary_op (ADDR_EXPR, base, 1); } *************** *** 3988,4115 **** return error_mark_node; } - type = ptype; - ptype = TYPE_POINTER_TO (type); - - size_exp = size_in_bytes (type); - - if (! IS_AGGR_TYPE (type) || ! TYPE_NEEDS_DESTRUCTOR (type)) - { - loop = integer_zero_node; - goto no_destructor; - } - - /* The below is short by BI_header_size */ - virtual_size = fold (size_binop (MULT_EXPR, size_exp, maxindex)); - - tbase = build_decl (VAR_DECL, NULL_TREE, ptype); - tbase_init = build_modify_expr (tbase, NOP_EXPR, - fold (build (PLUS_EXPR, ptype, - base, - virtual_size))); - DECL_REGISTER (tbase) = 1; - controller = build (BIND_EXPR, void_type_node, tbase, 0, 0); - TREE_SIDE_EFFECTS (controller) = 1; - block = build_block (tbase, 0, 0, 0, 0); - add_block_current_level (block); - - if (auto_delete != integer_zero_node - && auto_delete != integer_two_node) - { - tree base_tbd = convert (ptype, - build_binary_op (MINUS_EXPR, - convert (ptr_type_node, base), - BI_header_size, - 1)); - /* This is the real size */ - virtual_size = size_binop (PLUS_EXPR, virtual_size, BI_header_size); - body = build_tree_list (NULL_TREE, - build_x_delete (ptype, base_tbd, - 2 | use_global_delete, - virtual_size)); - body = build (COND_EXPR, void_type_node, - build (BIT_AND_EXPR, integer_type_node, - auto_delete, integer_one_node), - body, integer_zero_node); - } - else - body = NULL_TREE; - - body = tree_cons (NULL_TREE, - build_delete (ptype, tbase, auto_delete, - LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 1), - body); - - body = tree_cons (NULL_TREE, - build_modify_expr (tbase, NOP_EXPR, build (MINUS_EXPR, ptype, tbase, size_exp)), - body); - - body = tree_cons (NULL_TREE, - build (EXIT_EXPR, void_type_node, - build (EQ_EXPR, boolean_type_node, base, tbase)), - body); - - loop = build (LOOP_EXPR, void_type_node, build_compound_expr (body)); - - loop = tree_cons (NULL_TREE, tbase_init, - tree_cons (NULL_TREE, loop, NULL_TREE)); - loop = build_compound_expr (loop); - - no_destructor: - /* If the delete flag is one, or anything else with the low bit set, - delete the storage. */ - if (auto_delete_vec == integer_zero_node - || auto_delete_vec == integer_two_node) - deallocate_expr = integer_zero_node; - else - { - tree base_tbd; - - /* The below is short by BI_header_size */ - virtual_size = fold (size_binop (MULT_EXPR, size_exp, maxindex)); - - if (! TYPE_VEC_NEW_USES_COOKIE (type)) - /* no header */ - base_tbd = base; - else - { - base_tbd = convert (ptype, - build_binary_op (MINUS_EXPR, - convert (string_type_node, base), - BI_header_size, - 1)); - /* True size with header. */ - virtual_size = size_binop (PLUS_EXPR, virtual_size, BI_header_size); - } - deallocate_expr = build_x_delete (ptype, base_tbd, - 2 | use_global_delete, - virtual_size); - if (auto_delete_vec != integer_one_node) - deallocate_expr = build (COND_EXPR, void_type_node, - build (BIT_AND_EXPR, integer_type_node, - auto_delete_vec, integer_one_node), - deallocate_expr, integer_zero_node); - } - - if (loop && deallocate_expr != integer_zero_node) - { - body = tree_cons (NULL_TREE, loop, - tree_cons (NULL_TREE, deallocate_expr, NULL_TREE)); - body = build_compound_expr (body); - } - else - body = loop; - - /* Outermost wrapper: If pointer is null, punt. */ - body = build (COND_EXPR, void_type_node, - build (NE_EXPR, boolean_type_node, base, integer_zero_node), - body, integer_zero_node); - body = build1 (NOP_EXPR, void_type_node, body); ! if (controller) ! { ! TREE_OPERAND (controller, 1) = body; ! return controller; ! } ! else ! return convert (void_type_node, body); } --- 4172,4177 ---- return error_mark_node; } ! return build_vec_delete_1 (base, maxindex, type, auto_delete_vec, auto_delete, ! use_global_delete); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/input.c gcc-2.7.1/cp/input.c *** gcc-2.7.0/cp/input.c Thu Jun 15 08:23:55 1995 --- gcc-2.7.1/cp/input.c Thu Jun 22 19:31:01 1995 *************** *** 1,4 **** /* Input handling for G++. ! Copyright (C) 1992, 1993 Free Software Foundation, Inc. Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. --- 1,4 ---- /* Input handling for G++. ! Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/lex.c gcc-2.7.1/cp/lex.c *** gcc-2.7.0/cp/lex.c Thu Jun 15 08:25:37 1995 --- gcc-2.7.1/cp/lex.c Wed Oct 11 22:30:15 1995 *************** *** 1,4 **** /* Separate lexical analyzer for GNU C++. ! Copyright (C) 1987, 1989, 1992, 1993, 1994 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,4 ---- /* Separate lexical analyzer for GNU C++. ! Copyright (C) 1987, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) *************** *** 1560,1565 **** without loss of clarity. */ void ! reinit_parse_for_block (yychar, obstackp, is_template) ! int yychar; struct obstack *obstackp; int is_template; --- 1560,1565 ---- without loss of clarity. */ void ! reinit_parse_for_block (pyychar, obstackp, is_template) ! int pyychar; struct obstack *obstackp; int is_template; *************** *** 1573,1593 **** int look_for_lbrac = 0; ! if (yychar == '{') 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) --- 1573,1605 ---- int look_for_lbrac = 0; ! if (pyychar == '{') obstack_1grow (obstackp, '{'); ! else if (pyychar == '=') look_for_semicolon = 1; ! else if (pyychar == ':') { ! obstack_1grow (obstackp, pyychar); ! look_for_lbrac = 1; ! blev = 0; } ! else if (pyychar == RETURN && !is_template) ! { ! obstack_grow (obstackp, "return", 6); ! look_for_lbrac = 1; ! blev = 0; ! } ! else if (pyychar == TRY && !is_template) { ! obstack_grow (obstackp, "try", 3); look_for_lbrac = 1; blev = 0; } + else + { + yyerror (is_template + ? "parse error in template specification" + : "parse error in method specification"); + obstack_1grow (obstackp, '{'); + } if (nextchar != EOF) *************** *** 1641,1645 **** blev--; if (blev == 0 && !look_for_semicolon) ! goto done; } else if (c == '\\') --- 1653,1676 ---- blev--; if (blev == 0 && !look_for_semicolon) ! { ! if (pyychar == TRY) ! { ! if (peekyylex () == CATCH) ! { ! yylex (); ! obstack_grow (obstackp, " catch ", 7); ! look_for_lbrac = 1; ! } ! else ! { ! yychar = '{'; ! goto done; ! } ! } ! else ! { ! goto done; ! } ! } } else if (c == '\\') *************** *** 1784,1788 **** declarator = build_parse_node (ADDR_EXPR, declarator); ! fn = grokfield (declarator, declspecs, NULL_TREE, NULL_TREE, NULL_TREE); } --- 1815,1820 ---- declarator = build_parse_node (ADDR_EXPR, declarator); ! fn = grokfield (declarator, declspecs, NULL_TREE, NULL_TREE, ! NULL_TREE, NULL_TREE); } *************** *** 2279,2284 **** #endif #endif } - goto skipline; } else if (c == 'd') --- 2311,2316 ---- #endif #endif + goto skipline; } } else if (c == 'd') *************** *** 2818,2821 **** --- 2850,2856 ---- see_typename () { + looking_for_typename = 1; + if (yychar < 0) + if ((yychar = yylex()) < 0) yychar = 0; looking_for_typename = 0; if (yychar == IDENTIFIER) *************** *** 2917,2920 **** --- 2952,2990 ---- } } + + if (TREE_CODE (id) == VAR_DECL && DECL_DEAD_FOR_LOCAL (id)) + { + tree shadowed = DECL_SHADOWED_FOR_VAR (id); + if (shadowed) + { + if (!DECL_ERROR_REPORTED (id)) + { + warning ("name lookup of `%s' changed", + IDENTIFIER_POINTER (token)); + cp_warning_at (" matches this `%D' under current ANSI rules", + shadowed); + cp_warning_at (" matches this `%D' under old rules", id); + DECL_ERROR_REPORTED (id) = 1; + } + id = shadowed; + } + else if (!DECL_ERROR_REPORTED (id)) + { + static char msg[] + = "name lookup of `%s' changed for new ANSI `for' scoping"; + DECL_ERROR_REPORTED (id) = 1; + if (TYPE_NEEDS_DESTRUCTOR (TREE_TYPE (id))) + { + error (msg, IDENTIFIER_POINTER (token)); + cp_error_at (" cannot use obsolete binding at `%D' because it has a destructor", id); + id = error_mark_node; + } + else + { + pedwarn (msg, IDENTIFIER_POINTER (token)); + cp_pedwarn_at (" using obsolete binding at `%D'", id); + } + } + } /* TREE_USED is set in `hack_identifier'. */ if (TREE_CODE (id) == CONST_DECL) *************** *** 3107,3110 **** --- 3177,3186 ---- c = getc (finput); } + + if (linemode && c == '\n') + { + put_back (c); + c = EOF; + } } else *************** *** 4618,4621 **** --- 4694,4700 ---- handle_pragma_token (")", NULL_TREE); break; + case ',': + handle_pragma_token (",", NULL_TREE); + break; case '=': handle_pragma_token ("=", NULL_TREE); *************** *** 4629,4633 **** return; default: ! abort (); } } --- 4708,4715 ---- return; default: ! handle_pragma_token (NULL_PTR, NULL_TREE); ! while (yylex () != END_OF_LINE) ! /* continue */; ! return; } } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/lex.h gcc-2.7.1/cp/lex.h *** gcc-2.7.0/cp/lex.h Tue Jan 24 03:10:01 1995 --- gcc-2.7.1/cp/lex.h Thu Jun 22 19:31:16 1995 *************** *** 1,4 **** /* Define constants and variables for communication with parse.y. ! Copyright (C) 1987, 1992, 1993 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) and by Brendan Kehoe (brendan@cygnus.com). --- 1,4 ---- /* Define constants and variables for communication with parse.y. ! Copyright (C) 1987, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) and by Brendan Kehoe (brendan@cygnus.com). diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/method.c gcc-2.7.1/cp/method.c *** gcc-2.7.0/cp/method.c Thu Jun 15 08:26:02 1995 --- gcc-2.7.1/cp/method.c Wed Oct 11 22:30:25 1995 *************** *** 1,5 **** /* Handle the hair of processing (but not expanding) inline functions. Also manage function and variable name overloading. ! Copyright (C) 1987, 1989, 1992, 1993, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) --- 1,5 ---- /* Handle the hair of processing (but not expanding) inline functions. Also manage function and variable name overloading. ! Copyright (C) 1987, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) *************** *** 166,177 **** return; - case -3: - if (TYPE_READONLY (TREE_TYPE (TREE_VALUE (parmtypes)))) - cp_error ("call to const %s `%#D' with non-const object", name_kind, - cp->function); - else - cp_error ("call to non-const %s `%#D' with const object", name_kind, - cp->function); - return; case -2: cp_error ("too few arguments for %s `%#D'", name_kind, cp->function); --- 166,169 ---- *************** *** 181,192 **** return; case 0: ! if (TREE_CODE (TREE_TYPE (cp->function)) == METHOD_TYPE) ! { ! /* Happens when we have an ambiguous base class. */ ! my_friendly_assert (get_binfo (DECL_CLASS_CONTEXT (cp->function), ! TREE_TYPE (TREE_TYPE (TREE_VALUE (parmtypes))), 1) == error_mark_node, ! 241); ! return; ! } } --- 173,185 ---- return; case 0: ! if (TREE_CODE (TREE_TYPE (cp->function)) != METHOD_TYPE) ! break; ! case -3: ! /* Happens when the implicit object parameter is rejected. */ ! my_friendly_assert (! TYPE_READONLY (TREE_TYPE (TREE_VALUE (parmtypes))), ! 241); ! cp_error ("call to non-const %s `%#D' with const object", ! name_kind, cp->function); ! return; } *************** *** 355,358 **** --- 348,377 ---- } + /* Encoding for an INTEGER_CST value. */ + static void + build_overload_int (value) + tree value; + { + my_friendly_assert (TREE_CODE (value) == INTEGER_CST, 243); + if (TYPE_PRECISION (value) == 2 * HOST_BITS_PER_WIDE_INT) + { + if (tree_int_cst_lt (value, integer_zero_node)) + { + OB_PUTC ('m'); + value = build_int_2 (~ TREE_INT_CST_LOW (value), + - TREE_INT_CST_HIGH (value)); + } + if (TREE_INT_CST_HIGH (value) + != (TREE_INT_CST_LOW (value) >> (HOST_BITS_PER_WIDE_INT - 1))) + { + /* need to print a DImode value in decimal */ + sorry ("conversion of long long as PT parameter"); + } + /* else fall through to print in smaller mode */ + } + /* Wordsize or smaller */ + icat (TREE_INT_CST_LOW (value)); + } + static void build_overload_value (type, value) *************** *** 364,371 **** my_friendly_assert (TREE_CODE (type) == PARM_DECL, 242); type = TREE_TYPE (type); if (TREE_CODE (type) == POINTER_TYPE && TREE_CODE (TREE_TYPE (type)) == OFFSET_TYPE) { ! /* Handle a pointer to member as a template instantiation parameter, boy, what fun! */ type = integer_type_node; --- 383,397 ---- my_friendly_assert (TREE_CODE (type) == PARM_DECL, 242); type = TREE_TYPE (type); + + if (numeric_output_need_bar) + { + OB_PUTC ('_'); + numeric_output_need_bar = 0; + } + if (TREE_CODE (type) == POINTER_TYPE && TREE_CODE (TREE_TYPE (type)) == OFFSET_TYPE) { ! /* Handle a pointer to data member as a template instantiation parameter, boy, what fun! */ type = integer_type_node; *************** *** 377,380 **** --- 403,409 ---- } + if (TYPE_PTRMEMFUNC_P (type)) + type = TYPE_PTRMEMFUNC_FN_TYPE (type); + switch (TREE_CODE (type)) { *************** *** 381,409 **** case INTEGER_TYPE: case ENUMERAL_TYPE: - { - my_friendly_assert (TREE_CODE (value) == INTEGER_CST, 243); - if (TYPE_PRECISION (value) == 2 * HOST_BITS_PER_WIDE_INT) - { - if (tree_int_cst_lt (value, integer_zero_node)) - { - OB_PUTC ('m'); - value = build_int_2 (~ TREE_INT_CST_LOW (value), - - TREE_INT_CST_HIGH (value)); - } - if (TREE_INT_CST_HIGH (value) - != (TREE_INT_CST_LOW (value) >> (HOST_BITS_PER_WIDE_INT - 1))) - { - /* need to print a DImode value in decimal */ - sorry ("conversion of long long as PT parameter"); - } - /* else fall through to print in smaller mode */ - } - /* Wordsize or smaller */ - icat (TREE_INT_CST_LOW (value)); - return; - } case BOOLEAN_TYPE: { ! icat (TREE_INT_CST_LOW (value)); return; } --- 410,417 ---- case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: { ! build_overload_int (value); ! numeric_output_need_bar = 1; return; } *************** *** 452,455 **** --- 460,464 ---- } OB_PUTCP (digit_buffer); + numeric_output_need_bar = 1; return; } *************** *** 456,459 **** --- 465,515 ---- #endif case POINTER_TYPE: + if (TREE_CODE (TREE_TYPE (type)) == METHOD_TYPE + && TREE_CODE (value) != ADDR_EXPR) + { + if (TREE_CODE (value) == CONSTRUCTOR) + { + /* This is dangerous code, crack built up pointer to members. */ + tree args = CONSTRUCTOR_ELTS (value); + tree a1 = TREE_VALUE (args); + tree a2 = TREE_VALUE (TREE_CHAIN (args)); + tree a3 = CONSTRUCTOR_ELTS (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args)))); + a3 = TREE_VALUE (a3); + STRIP_NOPS (a3); + if (TREE_CODE (a1) == INTEGER_CST + && TREE_CODE (a2) == INTEGER_CST) + { + build_overload_int (a1); + OB_PUTC ('_'); + build_overload_int (a2); + OB_PUTC ('_'); + if (TREE_CODE (a3) == ADDR_EXPR) + { + a3 = TREE_OPERAND (a3, 0); + if (TREE_CODE (a3) == FUNCTION_DECL) + { + numeric_output_need_bar = 0; + build_overload_identifier (DECL_ASSEMBLER_NAME (a3)); + return; + } + } + else if (TREE_CODE (a3) == INTEGER_CST) + { + OB_PUTC ('i'); + build_overload_int (a3); + numeric_output_need_bar = 1; + return; + } + } + } + sorry ("template instantiation with pointer to method that is too complex"); + return; + } + if (TREE_CODE (value) == INTEGER_CST) + { + build_overload_int (value); + numeric_output_need_bar = 1; + return; + } value = TREE_OPERAND (value, 0); if (TREE_CODE (value) == VAR_DECL) *************** *** 510,517 **** else { /* It's a PARM_DECL. */ build_overload_name (TREE_TYPE (parm), 0, 0); build_overload_value (parm, arg); - numeric_output_need_bar = 1; } } --- 566,574 ---- else { + parm = tsubst (parm, &TREE_VEC_ELT (arglist, 0), + TREE_VEC_LENGTH (arglist), NULL_TREE); /* It's a PARM_DECL. */ build_overload_name (TREE_TYPE (parm), 0, 0); build_overload_value (parm, arg); } } *************** *** 1324,1328 **** /* Look for an `operator++ (int)'. If they didn't have one, then we fall back to the old way of doing things. */ ! for (t = TREE_VALUE (fields1); t ; t = TREE_CHAIN (t)) { t2 = TYPE_ARG_TYPES (TREE_TYPE (t)); --- 1381,1385 ---- /* Look for an `operator++ (int)'. If they didn't have one, then we fall back to the old way of doing things. */ ! for (t = TREE_VALUE (fields1); t ; t = DECL_CHAIN (t)) { t2 = TYPE_ARG_TYPES (TREE_TYPE (t)); *************** *** 1340,1349 **** /* There's probably a LOT of code in the world that ! relies upon this old behavior. So we'll only give this ! warning when we've been given -pedantic. A few ! releases after 2.4, we'll convert this to be a pedwarn ! or something else more appropriate. */ ! if (pedantic) ! warning ("no `operator%s (int)' declared for postfix `%s'", op, op); xarg2 = NULL_TREE; --- 1397,1403 ---- /* There's probably a LOT of code in the world that ! relies upon this old behavior. */ ! if (! flag_traditional) ! pedwarn ("no `operator%s (int)' declared for postfix `%s', using prefix operator instead", op, op); xarg2 = NULL_TREE; *************** *** 1749,1753 **** thunk = build_decl (THUNK_DECL, thunk_id, TREE_TYPE (func_decl)); DECL_RESULT (thunk) ! = build_decl (RESULT_DECL, NULL_TREE, TREE_TYPE (vtable_entry_type)); make_function_rtl (thunk); DECL_INITIAL (thunk) = function; --- 1803,1809 ---- thunk = build_decl (THUNK_DECL, thunk_id, TREE_TYPE (func_decl)); DECL_RESULT (thunk) ! = build_decl (RESULT_DECL, 0, TYPE_MAIN_VARIANT (TREE_TYPE (vtable_entry_type))); ! TREE_READONLY (thunk) = TYPE_READONLY (TREE_TYPE (vtable_entry_type)); ! TREE_THIS_VOLATILE (thunk) = TYPE_VOLATILE (TREE_TYPE (vtable_entry_type)); make_function_rtl (thunk); DECL_INITIAL (thunk) = function; *************** *** 2195,2199 **** interface_unknown = CLASSTYPE_INTERFACE_UNKNOWN (base); interface_only = CLASSTYPE_INTERFACE_ONLY (base); ! start_function (NULL_TREE, fndecl, NULL_TREE, 1); store_parm_decls (); --- 2251,2255 ---- interface_unknown = CLASSTYPE_INTERFACE_UNKNOWN (base); interface_only = CLASSTYPE_INTERFACE_ONLY (base); ! start_function (NULL_TREE, fndecl, NULL_TREE, NULL_TREE, 1); store_parm_decls (); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/parse.y gcc-2.7.1/cp/parse.y *** gcc-2.7.0/cp/parse.y Thu Jun 15 08:26:35 1995 --- gcc-2.7.1/cp/parse.y Fri Nov 3 17:57:33 1995 *************** *** 1,4 **** /* YACC parser for C++ syntax. ! Copyright (C) 1988, 1989, 1993, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,4 ---- /* YACC parser for C++ syntax. ! Copyright (C) 1988, 1989, 1993, 1994, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) *************** *** 56,61 **** extern int end_of_file; extern int current_class_depth; - extern int flag_new_for_scope; void yyerror (); --- 56,64 ---- extern int end_of_file; extern int current_class_depth; + /* FSF LOCAL dje prefix attributes */ + extern tree strip_attrs PROTO((tree)); + /* END FSF LOCAL */ + void yyerror (); *************** *** 133,137 **** %token SIZEOF ENUM /* STRUCT UNION */ IF ELSE WHILE DO FOR SWITCH CASE DEFAULT %token BREAK CONTINUE RETURN GOTO ASM_KEYWORD GCC_ASM_KEYWORD TYPEOF ALIGNOF ! %token HEADOF CLASSOF SIGOF %token ATTRIBUTE EXTENSION LABEL --- 136,140 ---- %token SIZEOF ENUM /* STRUCT UNION */ IF ELSE WHILE DO FOR SWITCH CASE DEFAULT %token BREAK CONTINUE RETURN GOTO ASM_KEYWORD GCC_ASM_KEYWORD TYPEOF ALIGNOF ! %token SIGOF %token ATTRIBUTE EXTENSION LABEL *************** *** 206,213 **** %type structsp opt.component_decl_list component_decl_list ! %type component_decl components component_declarator ! %type notype_components notype_component_declarator %type after_type_component_declarator after_type_component_declarator0 - %type notype_component_declarator0 component_decl_1 %type enumlist enumerator %type type_id absdcl type_quals --- 209,216 ---- %type structsp opt.component_decl_list component_decl_list ! %type component_decl component_decl_1 components notype_components ! %type component_declarator component_declarator0 ! %type notype_component_declarator notype_component_declarator0 %type after_type_component_declarator after_type_component_declarator0 %type enumlist enumerator %type type_id absdcl type_quals *************** *** 216,220 **** %type xexpr parmlist parms parm bad_parm full_parm %type identifiers_or_typenames ! %type fcast_or_absdcl regcast_or_absdcl sub_cast_expr %type expr_or_declarator complex_notype_declarator %type notype_unqualified_id unqualified_id qualified_id --- 219,223 ---- %type xexpr parmlist parms parm bad_parm full_parm %type identifiers_or_typenames ! %type fcast_or_absdcl regcast_or_absdcl %type expr_or_declarator complex_notype_declarator %type notype_unqualified_id unqualified_id qualified_id *************** *** 229,233 **** --- 232,238 ---- %type fn.def1 /* Not really! */ %type fn.def2 return_id + %type ctor_initializer_opt %type named_class_head named_class_head_sans_basetype + %type named_complex_class_head_sans_basetype %type unnamed_class_head %type class_head base_class_list *************** *** 235,239 **** %type base_class maybe_base_class_list base_class.1 %type exception_specification_opt ansi_raise_identifier ansi_raise_identifiers - %type component_declarator0 %type operator_name %type object aggr --- 240,243 ---- *************** *** 275,279 **** /* List of types and structure classes of the current declaration. */ static tree current_declspecs; ! static tree prefix_attributes = NULL_TREE; /* When defining an aggregate, this is the most recent one being defined. */ --- 279,288 ---- /* List of types and structure classes of the current declaration. */ static tree current_declspecs; ! /* List of prefix attributes in effect. ! Prefix attributes are parsed by the reserved_declspecs and declmods ! rules. They create a list that contains *both* declspecs and attrs. */ ! /* ??? It is not clear yet that all cases where an attribute can now appear in ! a declspec list have been updated. */ ! static tree prefix_attributes; /* When defining an aggregate, this is the most recent one being defined. */ *************** *** 333,338 **** extdef { if (! toplevel_bindings_p () && ! pseudo_global_level_p()) ! pop_everything (); ! prefix_attributes = NULL_TREE; } ; --- 342,346 ---- extdef { if (! toplevel_bindings_p () && ! pseudo_global_level_p()) ! pop_everything (); } ; *************** *** 425,428 **** --- 433,440 ---- | aggr identifier { $$ = build_tree_list ($1, $2); goto ttpa; } + | TYPENAME_KEYWORD + { $$ = build_tree_list (class_type_node, NULL_TREE); } + | TYPENAME_KEYWORD identifier + { $$ = build_tree_list (class_type_node, $2); } ; *************** *** 498,502 **** d = start_decl ($2, /*current_declspecs*/NULL_TREE, 0, $3); ! cplus_decl_attributes (d, $5, prefix_attributes); cp_finish_decl (d, NULL_TREE, $4, 0, 0); end_template_decl ($1, d, 0, def); --- 510,514 ---- d = start_decl ($2, /*current_declspecs*/NULL_TREE, 0, $3); ! cplus_decl_attributes (d, $5, /*prefix_attributes*/NULL_TREE); cp_finish_decl (d, NULL_TREE, $4, 0, 0); end_template_decl ($1, d, 0, def); *************** *** 509,521 **** fn_tmpl_end { ! tree d; int momentary; int def = ($7 != ';'); ! ! current_declspecs = $2; momentary = suspend_momentary (); ! d = start_decl ($3, current_declspecs, ! 0, $4); ! cplus_decl_attributes (d, $6, prefix_attributes); cp_finish_decl (d, NULL_TREE, $5, 0, 0); end_template_decl ($1, d, 0, def); --- 521,531 ---- fn_tmpl_end { ! tree d, specs, attrs; int momentary; int def = ($7 != ';'); ! split_specs_attrs ($2, &specs, &attrs); momentary = suspend_momentary (); ! d = start_decl ($3, specs, 0, $4); ! cplus_decl_attributes (d, $6, attrs); cp_finish_decl (d, NULL_TREE, $5, 0, 0); end_template_decl ($1, d, 0, def); *************** *** 530,535 **** | template_header declmods notype_declarator fn_tmpl_end { int def = ($4 != ';'); ! tree d = start_decl ($3, $2, 0, NULL_TREE); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); end_template_decl ($1, d, 0, def); --- 540,548 ---- | template_header declmods notype_declarator fn_tmpl_end { + tree d, specs, attrs; int def = ($4 != ';'); ! split_specs_attrs ($2, &specs, &attrs); ! d = start_decl ($3, specs, 0, NULL_TREE); ! cplus_decl_attributes (d, NULL_TREE, attrs); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); end_template_decl ($1, d, 0, def); *************** *** 556,561 **** /* Normal case to make fast: "const i;". */ | declmods notype_declarator ';' ! { tree d; ! d = start_decl ($2, $$, 0, NULL_TREE); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); } --- 569,576 ---- /* Normal case to make fast: "const i;". */ | declmods notype_declarator ';' ! { tree d, specs, attrs; ! split_specs_attrs ($1, &specs, &attrs); ! d = start_decl ($2, specs, 0, NULL_TREE); ! cplus_decl_attributes (d, NULL_TREE, attrs); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); } *************** *** 566,571 **** /* Normal case: make this fast. */ | typed_declspecs declarator ';' ! { tree d; ! d = start_decl ($2, $$, 0, NULL_TREE); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); note_list_got_semicolon ($$); --- 581,588 ---- /* Normal case: make this fast. */ | typed_declspecs declarator ';' ! { tree d, specs, attrs; ! split_specs_attrs ($1, &specs, &attrs); ! d = start_decl ($2, specs, 0, NULL_TREE); ! cplus_decl_attributes (d, NULL_TREE, attrs); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); note_list_got_semicolon ($$); *************** *** 576,580 **** | typed_declspecs ';' { ! tree t = $$; shadow_tag (t); if (TREE_CODE (t) == TREE_LIST --- 593,598 ---- | typed_declspecs ';' { ! tree t, attrs; ! split_specs_attrs ($1, &t, &attrs); shadow_tag (t); if (TREE_CODE (t) == TREE_LIST *************** *** 598,637 **** ; ! fndef: ! fn.def1 base_init compstmt_or_error ! { ! finish_function (lineno, 1, 0); ! /* finish_function performs these three statements: ! expand_end_bindings (getdecls (), 1, 0); ! poplevel (1, 1, 0); ! expand_end_bindings (0, 0, 0); ! poplevel (0, 0, 1); ! */ if ($$) process_next_inline ($$); } ! | fn.def1 return_init base_init compstmt_or_error { - finish_function (lineno, 1, 0); - /* finish_function performs these three statements: - - expand_end_bindings (getdecls (), 1, 0); - poplevel (1, 1, 0); - - expand_end_bindings (0, 0, 0); - poplevel (0, 0, 1); - */ if ($$) process_next_inline ($$); } ! | fn.def1 nodecls compstmt_or_error ! { finish_function (lineno, 0, 0); ! if ($$) process_next_inline ($$); } ! | fn.def1 return_init ';' nodecls compstmt_or_error ! { finish_function (lineno, 0, 0); ! if ($$) process_next_inline ($$); } ! | fn.def1 return_init nodecls compstmt_or_error ! { finish_function (lineno, 0, 0); ! if ($$) process_next_inline ($$); } | typed_declspecs declarator error {} --- 616,648 ---- ; ! ctor_initializer_opt: ! nodecls ! { $$ = 0; } ! | base_init ! { $$ = 1; } ! ; ! ! maybe_return_init: ! /* empty */ ! | return_init ! | return_init ';' ! ; ! eat_saved_input: ! /* empty */ ! | END_OF_SAVED_INPUT ! ; ! fndef: ! fn.def1 maybe_return_init ctor_initializer_opt compstmt_or_error ! { ! finish_function (lineno, (int)$3, 0); if ($$) process_next_inline ($$); } ! | fn.def1 maybe_return_init function_try_block { if ($$) process_next_inline ($$); } ! eat_saved_input | typed_declspecs declarator error {} *************** *** 644,648 **** fn.def1: typed_declspecs declarator exception_specification_opt ! { if (! start_function ($$, $2, $3, 0)) YYERROR1; reinit_parse_for_function (); --- 655,661 ---- fn.def1: typed_declspecs declarator exception_specification_opt ! { tree specs, attrs; ! split_specs_attrs ($1, &specs, &attrs); ! if (! start_function (specs, $2, $3, attrs, 0)) YYERROR1; reinit_parse_for_function (); *************** *** 649,653 **** $$ = NULL_TREE; } | declmods notype_declarator exception_specification_opt ! { if (! start_function ($$, $2, $3, 0)) YYERROR1; reinit_parse_for_function (); --- 662,667 ---- $$ = NULL_TREE; } | declmods notype_declarator exception_specification_opt ! { tree specs = strip_attrs ($1); ! if (! start_function (specs, $2, $3, NULL_TREE, 0)) YYERROR1; reinit_parse_for_function (); *************** *** 654,658 **** $$ = NULL_TREE; } | notype_declarator exception_specification_opt ! { if (! start_function (NULL_TREE, $$, $2, 0)) YYERROR1; reinit_parse_for_function (); --- 668,672 ---- $$ = NULL_TREE; } | notype_declarator exception_specification_opt ! { if (! start_function (NULL_TREE, $$, $2, NULL_TREE, 0)) YYERROR1; reinit_parse_for_function (); *************** *** 659,663 **** $$ = NULL_TREE; } | PRE_PARSED_FUNCTION_DECL ! { start_function (NULL_TREE, TREE_VALUE ($$), NULL_TREE, 1); reinit_parse_for_function (); } ; --- 673,678 ---- $$ = NULL_TREE; } | PRE_PARSED_FUNCTION_DECL ! { start_function (NULL_TREE, TREE_VALUE ($$), ! NULL_TREE, NULL_TREE, 1); reinit_parse_for_function (); } ; *************** *** 667,673 **** fn.def2: typed_declspecs '(' parmlist ')' type_quals exception_specification_opt ! { ! $$ = build_parse_node (CALL_EXPR, TREE_VALUE ($1), $3, $5); ! $$ = start_method (TREE_CHAIN ($1), $$, $6); rest_of_mdef: if (! $$) --- 682,688 ---- fn.def2: typed_declspecs '(' parmlist ')' type_quals exception_specification_opt ! { tree specs = strip_attrs ($1); ! $$ = build_parse_node (CALL_EXPR, TREE_VALUE (specs), $3, $5); ! $$ = start_method (TREE_CHAIN (specs), $$, $6); rest_of_mdef: if (! $$) *************** *** 677,690 **** reinit_parse_for_method (yychar, $$); } | typed_declspecs LEFT_RIGHT type_quals exception_specification_opt ! { ! $$ = build_parse_node (CALL_EXPR, TREE_VALUE ($1), empty_parms (), $3); ! $$ = start_method (TREE_CHAIN ($1), $$, $4); goto rest_of_mdef; } | typed_declspecs declarator exception_specification_opt ! { $$ = start_method ($$, $2, $3); goto rest_of_mdef; } | declmods notype_declarator exception_specification_opt ! { $$ = start_method ($$, $2, $3); goto rest_of_mdef; } | notype_declarator exception_specification_opt { $$ = start_method (NULL_TREE, $$, $2); goto rest_of_mdef; } --- 692,707 ---- reinit_parse_for_method (yychar, $$); } | typed_declspecs LEFT_RIGHT type_quals exception_specification_opt ! { tree specs = strip_attrs ($1); ! $$ = build_parse_node (CALL_EXPR, TREE_VALUE (specs), empty_parms (), $3); ! $$ = start_method (TREE_CHAIN (specs), $$, $4); goto rest_of_mdef; } | typed_declspecs declarator exception_specification_opt ! { tree specs = strip_attrs ($1); ! $$ = start_method (specs, $2, $3); goto rest_of_mdef; } | declmods notype_declarator exception_specification_opt ! { tree specs = strip_attrs ($1); ! $$ = start_method (specs, $2, $3); goto rest_of_mdef; } | notype_declarator exception_specification_opt { $$ = start_method (NULL_TREE, $$, $2); goto rest_of_mdef; } *************** *** 803,811 **** { do_type_instantiation ($3 ? $3 : $2, NULL_TREE); } | TEMPLATE typed_declspecs declarator ! { do_function_instantiation ($2, $3, NULL_TREE); } | SCSPEC TEMPLATE specialization template_instantiation { do_type_instantiation ($4 ? $4 : $3, $1); } | SCSPEC TEMPLATE typed_declspecs declarator ! { do_function_instantiation ($3, $4, $1); } ; --- 820,834 ---- { do_type_instantiation ($3 ? $3 : $2, NULL_TREE); } | TEMPLATE typed_declspecs declarator ! { tree specs = strip_attrs ($2); ! do_function_instantiation (specs, $3, NULL_TREE); } ! | TEMPLATE notype_declarator ! { do_function_instantiation (NULL_TREE, $2, NULL_TREE); } | SCSPEC TEMPLATE specialization template_instantiation { do_type_instantiation ($4 ? $4 : $3, $1); } | SCSPEC TEMPLATE typed_declspecs declarator ! { tree specs = strip_attrs ($3); ! do_function_instantiation (specs, $4, $1); } ! | SCSPEC TEMPLATE notype_declarator ! { do_function_instantiation (NULL_TREE, $3, $1); } ; *************** *** 968,972 **** $6 = suspend_momentary (); $$ = start_decl ($2, current_declspecs, 1, $3); ! cplus_decl_attributes ($$, $5, prefix_attributes); } init --- 991,996 ---- $6 = suspend_momentary (); $$ = start_decl ($2, current_declspecs, 1, $3); ! cplus_decl_attributes ($$, $5, ! /*prefix_attributes*/ NULL_TREE); } init *************** *** 1159,1164 **** cast_expr: ! sub_cast_expr ! | regcast_or_absdcl sub_cast_expr %prec UNARY { $$ = reparse_absdcl_as_casts ($$, $2); } | regcast_or_absdcl '{' initlist maybecomma '}' %prec UNARY --- 1183,1188 ---- cast_expr: ! unary_expr ! | regcast_or_absdcl unary_expr %prec UNARY { $$ = reparse_absdcl_as_casts ($$, $2); } | regcast_or_absdcl '{' initlist maybecomma '}' %prec UNARY *************** *** 1175,1201 **** ; - sub_cast_expr: - unary_expr - | HEADOF '(' expr ')' - { $$ = build_headof ($3); } - | CLASSOF '(' expr ')' - { $$ = build_classof ($3); } - | CLASSOF '(' TYPENAME ')' - { if (is_aggr_typedef ($3, 1)) - { - tree type = IDENTIFIER_TYPE_VALUE ($3); - if (! IS_SIGNATURE(type)) - $$ = CLASSTYPE_RTTI (type); - else - { - sorry ("signature name as argument of `classof'"); - $$ = error_mark_node; - } - } - else - $$ = error_mark_node; - } - ; - expr_no_commas: cast_expr --- 1199,1202 ---- *************** *** 1475,1490 **** } | functional_cast ! | DYNAMIC_CAST '<' type_id '>' '(' expr ')' ! { tree type = groktypename ($3); ! $$ = build_dynamic_cast (type, $6); } ! | STATIC_CAST '<' type_id '>' '(' expr ')' ! { tree type = groktypename ($3); ! $$ = build_static_cast (type, $6); } ! | REINTERPRET_CAST '<' type_id '>' '(' expr ')' ! { tree type = groktypename ($3); ! $$ = build_reinterpret_cast (type, $6); } ! | CONST_CAST '<' type_id '>' '(' expr ')' ! { tree type = groktypename ($3); ! $$ = build_const_cast (type, $6); } | TYPEID '(' expr ')' { $$ = build_typeid ($3); } --- 1476,1507 ---- } | functional_cast ! | DYNAMIC_CAST '<' ! { dont_allow_type_definitions = "inside dynamic_cast"; } ! type_id '>' ! { dont_allow_type_definitions = 0; } ! '(' expr ')' ! { tree type = groktypename ($4); ! $$ = build_dynamic_cast (type, $8); } ! | STATIC_CAST '<' ! { dont_allow_type_definitions = "inside static_cast"; } ! type_id '>' ! { dont_allow_type_definitions = 0; } ! '(' expr ')' ! { tree type = groktypename ($4); ! $$ = build_static_cast (type, $8); } ! | REINTERPRET_CAST '<' ! { dont_allow_type_definitions = "inside reinterpret_cast"; } ! type_id '>' ! { dont_allow_type_definitions = 0; } ! '(' expr ')' ! { tree type = groktypename ($4); ! $$ = build_reinterpret_cast (type, $8); } ! | CONST_CAST '<' ! { dont_allow_type_definitions = "inside const_cast"; } ! type_id '>' ! { dont_allow_type_definitions = 0; } ! '(' expr ')' ! { tree type = groktypename ($4); ! $$ = build_const_cast (type, $8); } | TYPEID '(' expr ')' { $$ = build_typeid ($3); } *************** *** 1719,1726 **** ; - setattrs: /* empty */ - { prefix_attributes = chainon (prefix_attributes, $0); } - ; - decl: /* Normal case: make this fast. */ --- 1736,1739 ---- *************** *** 1735,1741 **** } | typed_declspecs declarator ';' ! { tree d = $1; ! int yes = suspend_momentary (); ! d = start_decl ($2, d, 0, NULL_TREE); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); resume_momentary (yes); --- 1748,1757 ---- } | typed_declspecs declarator ';' ! { tree d, specs, attrs; ! int yes; ! split_specs_attrs ($1, &specs, &attrs); ! yes = suspend_momentary (); ! d = start_decl ($2, specs, 0, NULL_TREE); ! cplus_decl_attributes (d, NULL_TREE, attrs); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); resume_momentary (yes); *************** *** 1798,1802 **** /* Declspecs which contain at least one type specifier or typedef name. (Just `const' or `volatile' is not enough.) ! A typedef'd name following these is taken as a name to be declared. */ typed_declspecs: --- 1814,1819 ---- /* Declspecs which contain at least one type specifier or typedef name. (Just `const' or `volatile' is not enough.) ! A typedef'd name following these is taken as a name to be declared. ! In the result, declspecs have a non-NULL TREE_VALUE, attributes do not. */ typed_declspecs: *************** *** 1834,1841 **** IDENTIFIER_POINTER ($2)); $$ = decl_tree_cons (NULL_TREE, $2, $$); } ! | reserved_declspecs attributes setattrs ! { $$ = $1; } ! | attributes setattrs ! { $$ = NULL_TREE; } ; --- 1851,1858 ---- IDENTIFIER_POINTER ($2)); $$ = decl_tree_cons (NULL_TREE, $2, $$); } ! | reserved_declspecs attributes ! { $$ = decl_tree_cons ($2, NULL_TREE, $1); } ! | attributes ! { $$ = decl_tree_cons ($1, NULL_TREE, NULL_TREE); } ; *************** *** 1842,1846 **** /* List of just storage classes and type modifiers. A declaration can start with just this, but then it cannot be used ! to redeclare a typedef-name. */ declmods: --- 1859,1864 ---- /* List of just storage classes and type modifiers. A declaration can start with just this, but then it cannot be used ! to redeclare a typedef-name. ! In the result, declspecs have a non-NULL TREE_VALUE, attributes do not. */ declmods: *************** *** 1858,1868 **** $$ = decl_tree_cons (NULL_TREE, $2, $$); TREE_STATIC ($$) = TREE_STATIC ($1); } ! | declmods attributes setattrs ! { $$ = $1; } ! | attributes setattrs ! { $$ = NULL_TREE; } ; - /* Used instead of declspecs where storage classes are not allowed (that is, for typenames and structure components). --- 1876,1885 ---- $$ = decl_tree_cons (NULL_TREE, $2, $$); TREE_STATIC ($$) = TREE_STATIC ($1); } ! | declmods attributes ! { $$ = decl_tree_cons ($2, NULL_TREE, $1); } ! | attributes ! { $$ = decl_tree_cons ($1, NULL_TREE, NULL_TREE); } ; /* Used instead of declspecs where storage classes are not allowed (that is, for typenames and structure components). *************** *** 1898,1906 **** | TYPEOF '(' expr ')' { $$ = TREE_TYPE ($3); ! if (pedantic) pedwarn ("ANSI C++ forbids `typeof'"); } | TYPEOF '(' type_id ')' { $$ = groktypename ($3); ! if (pedantic) pedwarn ("ANSI C++ forbids `typeof'"); } | SIGOF '(' expr ')' --- 1915,1923 ---- | TYPEOF '(' expr ')' { $$ = TREE_TYPE ($3); ! if (pedantic && !in_system_header) pedwarn ("ANSI C++ forbids `typeof'"); } | TYPEOF '(' type_id ')' { $$ = groktypename ($3); ! if (pedantic && !in_system_header) pedwarn ("ANSI C++ forbids `typeof'"); } | SIGOF '(' expr ')' *************** *** 1965,1969 **** initdcl0: declarator exception_specification_opt maybeasm maybe_attribute '=' ! { current_declspecs = $0; if (TREE_CODE (current_declspecs) != TREE_LIST) current_declspecs = get_decl_list (current_declspecs); --- 1982,1987 ---- initdcl0: declarator exception_specification_opt maybeasm maybe_attribute '=' ! { split_specs_attrs ($0, ¤t_declspecs, ! &prefix_attributes); if (TREE_CODE (current_declspecs) != TREE_LIST) current_declspecs = get_decl_list (current_declspecs); *************** *** 1984,1988 **** | declarator exception_specification_opt maybeasm maybe_attribute { tree d; ! current_declspecs = $0; if (TREE_CODE (current_declspecs) != TREE_LIST) current_declspecs = get_decl_list (current_declspecs); --- 2002,2007 ---- | declarator exception_specification_opt maybeasm maybe_attribute { tree d; ! split_specs_attrs ($0, ¤t_declspecs, ! &prefix_attributes); if (TREE_CODE (current_declspecs) != TREE_LIST) current_declspecs = get_decl_list (current_declspecs); *************** *** 2015,2019 **** notype_initdcl0: notype_declarator exception_specification_opt maybeasm maybe_attribute '=' ! { current_declspecs = $0; $5 = suspend_momentary (); $$ = start_decl ($1, current_declspecs, 1, $2); --- 2034,2039 ---- notype_initdcl0: notype_declarator exception_specification_opt maybeasm maybe_attribute '=' ! { split_specs_attrs ($0, ¤t_declspecs, ! &prefix_attributes); $5 = suspend_momentary (); $$ = start_decl ($1, current_declspecs, 1, $2); *************** *** 2025,2029 **** | notype_declarator exception_specification_opt maybeasm maybe_attribute { tree d; ! current_declspecs = $0; $$ = suspend_momentary (); d = start_decl ($1, current_declspecs, 0, $2); --- 2045,2050 ---- | notype_declarator exception_specification_opt maybeasm maybe_attribute { tree d; ! split_specs_attrs ($0, ¤t_declspecs, ! &prefix_attributes); $$ = suspend_momentary (); d = start_decl ($1, current_declspecs, 0, $2); *************** *** 2035,2038 **** --- 2056,2060 ---- notype_declarator exception_specification_opt maybeasm maybe_attribute '=' { current_declspecs = NULL_TREE; + prefix_attributes = NULL_TREE; $5 = suspend_momentary (); $$ = start_decl ($1, current_declspecs, 1, $2); *************** *** 2045,2048 **** --- 2067,2071 ---- { tree d; current_declspecs = NULL_TREE; + prefix_attributes = NULL_TREE; $$ = suspend_momentary (); d = start_decl ($1, current_declspecs, 0, $2); *************** *** 2269,2276 **** aggr identifier { current_aggr = $$; $$ = $2; } - | aggr complex_type_name - { current_aggr = $$; $$ = $2; } - | aggr template_type %prec EMPTY - { current_aggr = $$; $$ = $2; } | specialization ; --- 2292,2295 ---- *************** *** 2289,2292 **** --- 2308,2318 ---- ; + named_complex_class_head_sans_basetype: + aggr nested_name_specifier identifier + { current_aggr = $$; $$ = $3; } + | aggr template_type %prec EMPTY + { current_aggr = $$; $$ = $2; } + ; + do_xref_defn: /* empty */ %prec EMPTY { $$ = xref_tag (current_aggr, $0, NULL_TREE, 0); } *************** *** 2303,2306 **** --- 2329,2338 ---- xref_basetypes (current_aggr, $1, $2, $3); } + | named_complex_class_head_sans_basetype maybe_base_class_list + { + $$ = TREE_TYPE ($1); + if ($2) + xref_basetypes (current_aggr, $1, TREE_TYPE ($1), $2); + } ; *************** *** 2315,2322 **** %prec EMPTY /* empty */ { $$ = NULL_TREE; } ! | ':' %prec EMPTY { yyungetc(':', 1); $$ = NULL_TREE; } ! | ':' base_class_list %prec EMPTY ! { $$ = $2; } ; --- 2347,2354 ---- %prec EMPTY /* empty */ { $$ = NULL_TREE; } ! | ':' see_typename %prec EMPTY { yyungetc(':', 1); $$ = NULL_TREE; } ! | ':' see_typename base_class_list %prec EMPTY ! { $$ = $3; } ; *************** *** 2323,2328 **** base_class_list: base_class ! | base_class_list ',' base_class ! { $$ = chainon ($$, $3); } ; --- 2355,2360 ---- base_class_list: base_class ! | base_class_list ',' see_typename base_class ! { $$ = chainon ($$, $4); } ; *************** *** 2331,2335 **** { tree type; - do_base_class1: type = IDENTIFIER_TYPE_VALUE ($$); if (! is_aggr_typedef ($$, 1)) --- 2363,2366 ---- *************** *** 2355,2366 **** $$ = build_tree_list ((tree)access_default, $$); } ! | base_class_access_list base_class.1 { tree type; ! do_base_class2: ! type = IDENTIFIER_TYPE_VALUE ($2); if (current_aggr == signature_type_node) error ("access and source specifiers not allowed in signature"); ! if (! is_aggr_typedef ($2, 1)) $$ = NULL_TREE; else if (current_aggr == signature_type_node --- 2386,2396 ---- $$ = build_tree_list ((tree)access_default, $$); } ! | base_class_access_list see_typename base_class.1 { tree type; ! type = IDENTIFIER_TYPE_VALUE ($3); if (current_aggr == signature_type_node) error ("access and source specifiers not allowed in signature"); ! if (! is_aggr_typedef ($3, 1)) $$ = NULL_TREE; else if (current_aggr == signature_type_node *************** *** 2374,2378 **** sorry ("signature inheritance, base type `%s' ignored", IDENTIFIER_POINTER ($$)); ! $$ = build_tree_list ((tree)access_public, $2); } else if (type && IS_SIGNATURE (type)) --- 2404,2408 ---- sorry ("signature inheritance, base type `%s' ignored", IDENTIFIER_POINTER ($$)); ! $$ = build_tree_list ((tree)access_public, $3); } else if (type && IS_SIGNATURE (type)) *************** *** 2382,2386 **** } else ! $$ = build_tree_list ((tree) $$, $2); } ; --- 2412,2416 ---- } else ! $$ = build_tree_list ((tree) $$, $3); } ; *************** *** 2435,2444 **** base_class_access_list: ! VISSPEC ! | SCSPEC { if ($$ != ridpointers[(int)RID_VIRTUAL]) sorry ("non-virtual access"); $$ = access_default_virtual; } ! | base_class_access_list VISSPEC { int err = 0; if ($2 == access_protected) --- 2465,2474 ---- base_class_access_list: ! VISSPEC see_typename ! | SCSPEC see_typename { if ($$ != ridpointers[(int)RID_VIRTUAL]) sorry ("non-virtual access"); $$ = access_default_virtual; } ! | base_class_access_list VISSPEC see_typename { int err = 0; if ($2 == access_protected) *************** *** 2466,2470 **** } } ! | base_class_access_list SCSPEC { if ($2 != ridpointers[(int)RID_VIRTUAL]) sorry ("non-virtual access"); --- 2496,2500 ---- } } ! | base_class_access_list SCSPEC see_typename { if ($2 != ridpointers[(int)RID_VIRTUAL]) sorry ("non-virtual access"); *************** *** 2592,2595 **** --- 2622,2626 ---- component_decl: component_decl_1 ';' + { } | component_decl_1 '}' { error ("missing ';' before right brace"); *************** *** 2599,2602 **** --- 2630,2637 ---- | fn.def2 ':' /* base_init compstmt */ { $$ = finish_method ($$); } + | fn.def2 TRY /* base_init compstmt */ + { $$ = finish_method ($$); } + | fn.def2 RETURN /* base_init compstmt */ + { $$ = finish_method ($$); } | fn.def2 '{' /* nodecls compstmt */ { $$ = finish_method ($$); } *************** *** 2610,2623 **** speedup would be insignificant. */ typed_declspecs components ! { ! $$ = grok_x_components ($$, $2); ! } | declmods notype_components ! { ! $$ = grok_x_components ($$, $2); ! } | notype_declarator exception_specification_opt maybeasm maybe_attribute maybe_init ! { $$ = grokfield ($$, NULL_TREE, $2, $5, $3); ! cplus_decl_attributes ($$, $4, prefix_attributes); } | ':' expr_no_commas { $$ = grokbitfield (NULL_TREE, NULL_TREE, $2); } --- 2645,2654 ---- speedup would be insignificant. */ typed_declspecs components ! { $$ = grok_x_components ($1, $2); } | declmods notype_components ! { $$ = grok_x_components ($1, $2); } | notype_declarator exception_specification_opt maybeasm maybe_attribute maybe_init ! { $$ = grokfield ($$, NULL_TREE, $2, $5, $3, ! build_tree_list ($4, NULL_TREE)); } | ':' expr_no_commas { $$ = grokbitfield (NULL_TREE, NULL_TREE, $2); } *************** *** 2634,2646 **** parmlist? */ | typed_declspecs '(' parmlist ')' type_quals exception_specification_opt maybeasm maybe_attribute maybe_init ! { $$ = build_parse_node (CALL_EXPR, TREE_VALUE ($1), $3, $5); ! $$ = grokfield ($$, TREE_CHAIN ($1), $6, $9, $7); ! cplus_decl_attributes ($$, $8, prefix_attributes); } | typed_declspecs LEFT_RIGHT type_quals exception_specification_opt maybeasm maybe_attribute maybe_init ! { $$ = build_parse_node (CALL_EXPR, TREE_VALUE ($1), empty_parms (), $3); ! $$ = grokfield ($$, TREE_CHAIN ($1), $4, $7, $5); ! cplus_decl_attributes ($$, $6, prefix_attributes); } | using_decl { $$ = do_class_using_decl ($1); } --- 2665,2681 ---- parmlist? */ | typed_declspecs '(' parmlist ')' type_quals exception_specification_opt maybeasm maybe_attribute maybe_init ! { tree specs, attrs; ! split_specs_attrs ($1, &specs, &attrs); ! $$ = build_parse_node (CALL_EXPR, TREE_VALUE (specs), $3, $5); ! $$ = grokfield ($$, TREE_CHAIN (specs), $6, $9, $7, ! build_tree_list ($8, attrs)); } | typed_declspecs LEFT_RIGHT type_quals exception_specification_opt maybeasm maybe_attribute maybe_init ! { tree specs, attrs; ! split_specs_attrs ($1, &specs, &attrs); ! $$ = build_parse_node (CALL_EXPR, TREE_VALUE (specs), empty_parms (), $3); ! $$ = grokfield ($$, TREE_CHAIN (specs), $4, $7, $5, ! build_tree_list ($6, attrs)); } | using_decl { $$ = do_class_using_decl ($1); } *************** *** 2648,2651 **** --- 2683,2687 ---- /* The case of exactly one component is handled directly by component_decl. */ + /* ??? Huh? ^^^ */ components: /* empty: possibly anonymous */ *************** *** 2690,2698 **** after_type_component_declarator0: after_type_declarator exception_specification_opt maybeasm maybe_attribute maybe_init ! { current_declspecs = $0; ! $$ = grokfield ($$, current_declspecs, $2, $5, $3); ! cplus_decl_attributes ($$, $4, prefix_attributes); } | TYPENAME ':' expr_no_commas maybe_attribute ! { current_declspecs = $0; $$ = grokbitfield ($$, current_declspecs, $3); cplus_decl_attributes ($$, $4, prefix_attributes); } --- 2726,2738 ---- after_type_component_declarator0: after_type_declarator exception_specification_opt maybeasm maybe_attribute maybe_init ! { split_specs_attrs ($0, ¤t_declspecs, ! &prefix_attributes); ! $0 = current_declspecs; ! $$ = grokfield ($$, current_declspecs, $2, $5, $3, ! build_tree_list ($4, prefix_attributes)); } | TYPENAME ':' expr_no_commas maybe_attribute ! { split_specs_attrs ($0, ¤t_declspecs, ! &prefix_attributes); ! $0 = current_declspecs; $$ = grokbitfield ($$, current_declspecs, $3); cplus_decl_attributes ($$, $4, prefix_attributes); } *************** *** 2701,2713 **** notype_component_declarator0: notype_declarator exception_specification_opt maybeasm maybe_attribute maybe_init ! { current_declspecs = $0; ! $$ = grokfield ($$, current_declspecs, $2, $5, $3); ! cplus_decl_attributes ($$, $4, prefix_attributes); } | IDENTIFIER ':' expr_no_commas maybe_attribute ! { current_declspecs = $0; $$ = grokbitfield ($$, current_declspecs, $3); cplus_decl_attributes ($$, $4, prefix_attributes); } | ':' expr_no_commas maybe_attribute ! { current_declspecs = $0; $$ = grokbitfield (NULL_TREE, current_declspecs, $2); cplus_decl_attributes ($$, $3, prefix_attributes); } --- 2741,2759 ---- notype_component_declarator0: notype_declarator exception_specification_opt maybeasm maybe_attribute maybe_init ! { split_specs_attrs ($0, ¤t_declspecs, ! &prefix_attributes); ! $0 = current_declspecs; ! $$ = grokfield ($$, current_declspecs, $2, $5, $3, ! build_tree_list ($4, prefix_attributes)); } | IDENTIFIER ':' expr_no_commas maybe_attribute ! { split_specs_attrs ($0, ¤t_declspecs, ! &prefix_attributes); ! $0 = current_declspecs; $$ = grokbitfield ($$, current_declspecs, $3); cplus_decl_attributes ($$, $4, prefix_attributes); } | ':' expr_no_commas maybe_attribute ! { split_specs_attrs ($0, ¤t_declspecs, ! &prefix_attributes); ! $0 = current_declspecs; $$ = grokbitfield (NULL_TREE, current_declspecs, $2); cplus_decl_attributes ($$, $3, prefix_attributes); } *************** *** 2716,2721 **** after_type_component_declarator: after_type_declarator exception_specification_opt maybeasm maybe_attribute maybe_init ! { $$ = grokfield ($$, current_declspecs, $2, $5, $3); ! cplus_decl_attributes ($$, $4, prefix_attributes); } | TYPENAME ':' expr_no_commas maybe_attribute { $$ = grokbitfield ($$, current_declspecs, $3); --- 2762,2767 ---- after_type_component_declarator: after_type_declarator exception_specification_opt maybeasm maybe_attribute maybe_init ! { $$ = grokfield ($$, current_declspecs, $2, $5, $3, ! build_tree_list ($4, prefix_attributes)); } | TYPENAME ':' expr_no_commas maybe_attribute { $$ = grokbitfield ($$, current_declspecs, $3); *************** *** 2725,2730 **** notype_component_declarator: notype_declarator exception_specification_opt maybeasm maybe_attribute maybe_init ! { $$ = grokfield ($$, current_declspecs, $2, $5, $3); ! cplus_decl_attributes ($$, $4, prefix_attributes); } | IDENTIFIER ':' expr_no_commas maybe_attribute { $$ = grokbitfield ($$, current_declspecs, $3); --- 2771,2776 ---- notype_component_declarator: notype_declarator exception_specification_opt maybeasm maybe_attribute maybe_init ! { $$ = grokfield ($$, current_declspecs, $2, $5, $3, ! build_tree_list ($4, prefix_attributes)); } | IDENTIFIER ':' expr_no_commas maybe_attribute { $$ = grokbitfield ($$, current_declspecs, $3); *************** *** 2908,2913 **** { $$ = build_parse_node (ARRAY_REF, $$, NULL_TREE); } | notype_qualified_id ! { push_nested_class (TREE_TYPE (OP0 ($$)), 3); ! TREE_COMPLEXITY ($$) = current_class_depth; } ; --- 2954,2963 ---- { $$ = build_parse_node (ARRAY_REF, $$, NULL_TREE); } | notype_qualified_id ! { if (TREE_TYPE (OP0 ($$)) != current_class_type) ! { ! push_nested_class (TREE_TYPE (OP0 ($$)), 3); ! TREE_COMPLEXITY ($$) = current_class_depth; ! } ! } ; *************** *** 3175,3180 **** simple_stmt: decl ! { finish_stmt (); ! prefix_attributes = NULL_TREE; } | expr ';' { --- 3225,3229 ---- simple_stmt: decl ! { finish_stmt (); } | expr ';' { *************** *** 3227,3234 **** | FOR { emit_line_note (input_filename, lineno); ! if (flag_new_for_scope) { /* Conditionalize .pushlevel */ pushlevel (0); clear_last_expr (); push_momentary (); --- 3276,3284 ---- | FOR { emit_line_note (input_filename, lineno); ! if (flag_new_for_scope > 0) { /* Conditionalize .pushlevel */ pushlevel (0); + note_level_for_for (); clear_last_expr (); push_momentary (); *************** *** 3253,3257 **** pop_momentary (); expand_end_loop (); ! if (flag_new_for_scope) { expand_end_bindings (getdecls (), kept_level_p (), 1); --- 3303,3307 ---- pop_momentary (); expand_end_loop (); ! if (flag_new_for_scope > 0) { expand_end_bindings (getdecls (), kept_level_p (), 1); *************** *** 3416,3419 **** --- 3466,3486 ---- ; + function_try_block: + TRY + { + if (! current_function_parms_stored) + store_parm_decls (); + expand_start_early_try_stmts (); + } + ctor_initializer_opt compstmt_or_error + { expand_end_try_stmts (); + expand_start_all_catch (); } + handler_seq + { + expand_end_all_catch (); + finish_function (lineno, (int)$3, 0); + } + ; + try_block: TRY *************** *** 3428,3432 **** handler_seq: /* empty */ ! | handler_seq CATCH .pushlevel handler_args compstmt { expand_end_catch_block (); } .poplevel --- 3495,3503 ---- handler_seq: /* empty */ ! | handler_seq CATCH .pushlevel ! { dont_allow_type_definitions = "inside exception declarations"; } ! handler_args ! { dont_allow_type_definitions = 0; } ! compstmt { expand_end_catch_block (); } .poplevel *************** *** 3632,3639 **** /* typed_declspecs dont_see_typename '*' IDENTIFIER ! { $$ = build_tree_list ($$, build_parse_node (INDIRECT_REF, $4)); see_typename (); } | typed_declspecs dont_see_typename '&' IDENTIFIER ! { $$ = build_tree_list ($$, build_parse_node (ADDR_EXPR, $4)); see_typename (); } | TYPENAME IDENTIFIER --- 3703,3712 ---- /* typed_declspecs dont_see_typename '*' IDENTIFIER ! { tree specs = strip_attrs ($1); ! $$ = build_tree_list (specs, build_parse_node (INDIRECT_REF, $4)); see_typename (); } | typed_declspecs dont_see_typename '&' IDENTIFIER ! { tree specs = strip_attrs ($1); ! $$ = build_tree_list (specs, build_parse_node (ADDR_EXPR, $4)); see_typename (); } | TYPENAME IDENTIFIER *************** *** 3645,3649 **** TYPESPEC IDENTIFIER. */ typed_declspecs1 declarator ! { $$ = build_tree_list ($$, $2); } | typed_typespecs declarator { $$ = build_tree_list ($$, $2); } --- 3718,3723 ---- TYPESPEC IDENTIFIER. */ typed_declspecs1 declarator ! { tree specs = strip_attrs ($1); ! $$ = build_tree_list (specs, $2); } | typed_typespecs declarator { $$ = build_tree_list ($$, $2); } *************** *** 3651,3659 **** { $$ = build_tree_list (get_decl_list ($$), $2); } | typed_declspecs1 absdcl ! { $$ = build_tree_list ($$, $2); } | typed_declspecs1 %prec EMPTY ! { $$ = build_tree_list ($$, NULL_TREE); } | declmods notype_declarator ! { $$ = build_tree_list ($$, $2); } ; --- 3725,3736 ---- { $$ = build_tree_list (get_decl_list ($$), $2); } | typed_declspecs1 absdcl ! { tree specs = strip_attrs ($1); ! $$ = build_tree_list (specs, $2); } | typed_declspecs1 %prec EMPTY ! { tree specs = strip_attrs ($1); ! $$ = build_tree_list (specs, NULL_TREE); } | declmods notype_declarator ! { tree specs = strip_attrs ($1); ! $$ = build_tree_list (specs, $2); } ; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/pt.c gcc-2.7.1/cp/pt.c *** gcc-2.7.0/cp/pt.c Thu Jun 15 08:27:07 1995 --- gcc-2.7.1/cp/pt.c Wed Oct 11 22:30:47 1995 *************** *** 1,4 **** /* Handle parameterized types (templates) for GNU C++. ! Copyright (C) 1992, 1993 Free Software Foundation, Inc. Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. --- 1,4 ---- /* Handle parameterized types (templates) for GNU C++. ! Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. *************** *** 44,48 **** extern struct obstack permanent_obstack; - extern tree grokdeclarator (); extern int lineno; --- 44,47 ---- *************** *** 53,56 **** --- 52,60 ---- int processing_template_defn; + /* This is a kludge to handle instantiation of template methods that are + used before their definition. It should not be necessary after the + template rewrite. */ + static tree template_classes; + #define obstack_chunk_alloc xmalloc #define obstack_chunk_free free *************** *** 98,102 **** /* is a const-param */ parm = grokdeclarator (TREE_VALUE (parm), TREE_PURPOSE (parm), ! PARM, 0, NULL_TREE); /* A template parameter is not modifiable. */ TREE_READONLY (parm) = 1; --- 102,106 ---- /* is a const-param */ parm = grokdeclarator (TREE_VALUE (parm), TREE_PURPOSE (parm), ! PARM, 0, NULL_TREE, NULL_TREE); /* A template parameter is not modifiable. */ TREE_READONLY (parm) = 1; *************** *** 235,239 **** || code == OP_IDENTIFIER || code == SCOPE_REF, 264); ! d2 = grokdeclarator (d2, NULL_TREE, MEMFUNCDEF, 0, NULL_TREE); decl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (d2), TREE_TYPE (d2)); --- 239,243 ---- || code == OP_IDENTIFIER || code == SCOPE_REF, 264); ! d2 = grokdeclarator (d2, NULL_TREE, MEMFUNCDEF, 0, NULL_TREE, NULL_TREE); decl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (d2), TREE_TYPE (d2)); *************** *** 325,370 **** } ! /* If TYPE contains a template parm type, then substitute that type ! with its actual type that is found in TVEC. */ ! static void ! grok_template_type (tvec, type) ! tree tvec; ! tree* type; ! { ! switch (TREE_CODE (*type)) ! { ! case TEMPLATE_TYPE_PARM: ! if (*type != TYPE_MAIN_VARIANT (*type)) ! { ! /* we are here for cases like const T* etc. */ ! grok_template_type (tvec, &TYPE_MAIN_VARIANT (*type)); ! *type = cp_build_type_variant (TYPE_MAIN_VARIANT (*type), ! TYPE_READONLY (*type), ! TYPE_VOLATILE (*type)); ! } ! else ! *type = TREE_VEC_ELT (tvec, TEMPLATE_TYPE_IDX (*type)); ! return; ! case POINTER_TYPE: ! case REFERENCE_TYPE: ! grok_template_type (tvec, &TREE_TYPE (*type)); ! return; ! case FUNCTION_TYPE: ! { ! tree p; ! ! /* take care of function's return type first */ ! grok_template_type (tvec, &TREE_TYPE (*type)); ! ! /* take care of function's arguments */ ! for (p = TYPE_ARG_TYPES (*type); p; p = TREE_CHAIN (p)) ! grok_template_type (tvec, &TREE_VALUE (p)); ! return; ! } ! default: ! break; ! } ! return; ! } /* Convert all template arguments to their appropriate types, and return --- 329,333 ---- } ! tree tsubst PROTO ((tree, tree*, int, tree)); /* Convert all template arguments to their appropriate types, and return *************** *** 444,457 **** 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 { ! grok_template_type (vec, &TREE_TYPE (parm)); ! val = digest_init (TREE_TYPE (parm), arg, (tree *) 0); if (val == error_mark_node) --- 407,415 ---- if (is_type) val = groktypename (arg); else { ! tree t = tsubst (TREE_TYPE (parm), &TREE_VEC_ELT (vec, 0), ! TREE_VEC_LENGTH (vec), in_decl); ! val = digest_init (t, arg, (tree *) 0); if (val == error_mark_node) *************** *** 467,478 **** 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) ! && ! DECL_PUBLIC (a)) { ! cp_error ("address of non-extern `%E' cannot be used as template argument", a); val = error_mark_node; } --- 425,463 ---- val = error_mark_node; } ! else if (POINTER_TYPE_P (TREE_TYPE (val)) ! && ! integer_zerop (val) ! && TREE_CODE (TREE_TYPE (TREE_TYPE (val))) != OFFSET_TYPE ! && TREE_CODE (TREE_TYPE (TREE_TYPE (val))) != METHOD_TYPE) { ! t = val; ! STRIP_NOPS (t); ! if (TREE_CODE (t) == ADDR_EXPR) ! { ! tree a = TREE_OPERAND (t, 0); ! STRIP_NOPS (a); ! if (TREE_CODE (a) == STRING_CST) ! { ! cp_error ("string literal %E is not a valid template argument", a); ! error ("because it is the address of an object with static linkage"); ! val = error_mark_node; ! } ! else if (TREE_CODE (a) != VAR_DECL ! && TREE_CODE (a) != FUNCTION_DECL) ! goto bad; ! else if (! DECL_PUBLIC (a)) ! { ! cp_error ("address of non-extern `%E' cannot be used as template argument", a); ! val = error_mark_node; ! } ! } ! else { ! bad: ! cp_error ("`%E' is not a valid template argument", t); ! error ("it must be %s%s with external linkage", ! TREE_CODE (TREE_TYPE (val)) == POINTER_TYPE ! ? "a pointer to " : "", ! TREE_CODE (TREE_TYPE (TREE_TYPE (val))) == FUNCTION_TYPE ! ? "a function" : "an object"); val = error_mark_node; } *************** *** 681,684 **** --- 666,670 ---- /* add const decl to namespace */ tree val; + tree parmtype; if (requires_type) { *************** *** 686,694 **** continue; } ! val = digest_init (TREE_TYPE (parm), arg, (tree *) 0); if (val != error_mark_node) { decl = build_decl (CONST_DECL, DECL_NAME (parm), ! TREE_TYPE (parm)); DECL_INITIAL (decl) = val; TREE_READONLY (decl) = 1; --- 672,682 ---- continue; } ! parmtype = tsubst (TREE_TYPE (parm), &TREE_VEC_ELT (arglist, 0), ! TREE_VEC_LENGTH (arglist), NULL_TREE); ! val = digest_init (parmtype, arg, (tree *) 0); if (val != error_mark_node) { decl = build_decl (CONST_DECL, DECL_NAME (parm), ! parmtype); DECL_INITIAL (decl) = val; TREE_READONLY (decl) = 1; *************** *** 780,784 **** return uses_template_parms (TREE_TYPE (t)); case METHOD_TYPE: ! if (uses_template_parms (TYPE_OFFSET_BASETYPE (t))) return 1; if (uses_template_parms (TYPE_ARG_TYPES (t))) --- 768,772 ---- return uses_template_parms (TREE_TYPE (t)); case METHOD_TYPE: ! if (uses_template_parms (TYPE_METHOD_BASETYPE (t))) return 1; if (uses_template_parms (TYPE_ARG_TYPES (t))) *************** *** 1075,1078 **** --- 1063,1068 ---- if (!flag_external_templates) interface_unknown++; + template_classes + = perm_tree_cons (classname, NULL_TREE, template_classes); } else *************** *** 1152,1156 **** } ! static tree tsubst (t, args, nargs, in_decl) tree t, *args; --- 1142,1146 ---- } ! tree tsubst (t, args, nargs, in_decl) tree t, *args; *************** *** 1491,1494 **** --- 1481,1491 ---- r = build_decl (PARM_DECL, DECL_NAME (t), type); DECL_INITIAL (r) = TREE_TYPE (r); + DECL_ARTIFICIAL (r) = DECL_ARTIFICIAL (t); + #ifdef PROMOTE_PROTOTYPES + if ((TREE_CODE (type) == INTEGER_TYPE + || TREE_CODE (type) == ENUMERAL_TYPE) + && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)) + DECL_ARG_TYPE (r) = integer_type_node; + #endif if (TREE_CHAIN (t)) TREE_CHAIN (r) = tsubst (TREE_CHAIN (t), args, nargs, TREE_CHAIN (t)); *************** *** 1571,1575 **** case METHOD_TYPE: { ! tree values = TYPE_VALUES (t); /* same as TYPE_ARG_TYPES */ tree context = TYPE_CONTEXT (t); tree new_value; --- 1568,1572 ---- case METHOD_TYPE: { ! tree values = TYPE_ARG_TYPES (t); tree context = TYPE_CONTEXT (t); tree new_value; *************** *** 1738,1746 **** && DECL_STATIC_FUNCTION_P (fndecl)) { - tree olddecl = DECL_RESULT (tmpl); revert_static_member_fn (&DECL_RESULT (tmpl), NULL, NULL); /* Chop off the this pointer that grokclassfn so kindly added for us (it didn't know yet if the fn was static or not). */ - DECL_ARGUMENTS (olddecl) = TREE_CHAIN (DECL_ARGUMENTS (olddecl)); DECL_ARGUMENTS (fndecl) = TREE_CHAIN (DECL_ARGUMENTS (fndecl)); } --- 1735,1741 ---- *************** *** 1750,1754 **** /* If we have a preexisting version of this function, don't expand the template version, use the other instead. */ ! if (TREE_STATIC (fndecl)) { SET_DECL_TEMPLATE_SPECIALIZATION (fndecl); --- 1745,1749 ---- /* If we have a preexisting version of this function, don't expand the template version, use the other instead. */ ! if (TREE_STATIC (fndecl) || DECL_TEMPLATE_SPECIALIZATION (fndecl)) { SET_DECL_TEMPLATE_SPECIALIZATION (fndecl); *************** *** 1912,1915 **** --- 1907,1912 ---- } + extern struct pending_input *to_be_restored; + /* NAME is the IDENTIFIER value of a PRE_PARSED_CLASS_DECL. */ void *************** *** 1917,1921 **** tree name; { - extern struct pending_input *to_be_restored; tree t, decl; --- 1914,1917 ---- *************** *** 2368,2371 **** --- 2364,2373 ---- struct pending_inline *i, *new_list = 0; + { + tree t; + for (t = template_classes; t; t = TREE_CHAIN (t)) + instantiate_member_templates (TREE_PURPOSE (t)); + } + if (!pending_template_expansions) return 0; *************** *** 2520,2524 **** tree declspecs, declarator, storage; { ! tree decl = grokdeclarator (declarator, declspecs, NORMAL, 0, 0); tree name; tree fn; --- 2522,2527 ---- tree declspecs, declarator, storage; { ! tree decl = grokdeclarator (declarator, declspecs, NORMAL, 0, ! NULL_TREE, NULL_TREE); tree name; tree fn; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/ptree.c gcc-2.7.1/cp/ptree.c *** gcc-2.7.0/cp/ptree.c Thu Jun 15 08:27:27 1995 --- gcc-2.7.1/cp/ptree.c Wed Jun 28 16:38:11 1995 *************** *** 1,4 **** /* Prints out trees in human readable form. ! Copyright (C) 1992, 1993 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,4 ---- /* Prints out trees in human readable form. ! Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/search.c gcc-2.7.1/cp/search.c *** gcc-2.7.0/cp/search.c Thu Jun 15 08:28:10 1995 --- gcc-2.7.1/cp/search.c Wed Oct 11 22:31:00 1995 *************** *** 1,5 **** /* Breadth-first and depth-first routines for searching multiple-inheritance lattice for GNU C++. ! Copyright (C) 1987, 1989, 1992, 1993, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) --- 1,5 ---- /* Breadth-first and depth-first routines for searching multiple-inheritance lattice for GNU C++. ! Copyright (C) 1987, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) *************** *** 382,385 **** --- 382,444 ---- } + /* Get a virtual binfo that is found inside BINFO's hierarchy that is + the same type as the type given in PARENT. To be optimal, we want + the first one that is found by going through the least number of + virtual bases. DEPTH should be NULL_PTR. */ + static tree + get_vbase (parent, binfo, depth) + tree parent, binfo; + unsigned int *depth; + { + tree binfos; + int i, n_baselinks; + tree rval = NULL_TREE; + + if (depth == 0) + { + unsigned int d = (unsigned int)-1; + return get_vbase (parent, binfo, &d); + } + + if (BINFO_TYPE (binfo) == parent && TREE_VIA_VIRTUAL (binfo)) + { + *depth = 0; + return binfo; + } + + *depth = *depth - 1; + + binfos = BINFO_BASETYPES (binfo); + n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0; + + /* Process base types. */ + for (i = 0; i < n_baselinks; i++) + { + tree base_binfo = TREE_VEC_ELT (binfos, i); + tree nrval; + + if (*depth == 0) + break; + + nrval = get_vbase (parent, base_binfo, depth); + if (nrval) + rval = nrval; + } + *depth = *depth+1; + return rval; + } + + /* Convert EXPR to a virtual base class of type TYPE. We know that + EXPR is a non-null POINTER_TYPE to RECORD_TYPE. We also know that + the type of what expr points to has a virtual base of type TYPE. */ + tree + convert_pointer_to_vbase (type, expr) + tree type; + tree expr; + { + tree vb = get_vbase (type, TYPE_BINFO (TREE_TYPE (TREE_TYPE (expr))), NULL_PTR); + return convert_pointer_to_real (vb, expr); + } + /* This is the newer recursive depth first search routine. */ #if 0 /* unused */ *************** *** 2071,2084 **** if (do_self && CLASSTYPE_VFIELDS (BINFO_TYPE (binfo))) { ! /* Get around first entry reserved for RTTI. */ ! tree tmp = TREE_CHAIN (BINFO_VIRTUALS (binfo)); ! while (tmp) { ! tree base_pfn = FNADDR_FROM_VTABLE_ENTRY (TREE_VALUE (tmp)); tree base_fndecl = TREE_OPERAND (base_pfn, 0); if (DECL_ABSTRACT_VIRTUAL_P (base_fndecl)) abstract_virtuals = tree_cons (NULL_TREE, base_fndecl, abstract_virtuals); ! tmp = TREE_CHAIN (tmp); } } --- 2130,2144 ---- if (do_self && CLASSTYPE_VFIELDS (BINFO_TYPE (binfo))) { ! tree virtuals = BINFO_VIRTUALS (binfo); ! ! skip_rtti_stuff (&virtuals); ! while (virtuals) { ! tree base_pfn = FNADDR_FROM_VTABLE_ENTRY (TREE_VALUE (virtuals)); tree base_fndecl = TREE_OPERAND (base_pfn, 0); if (DECL_ABSTRACT_VIRTUAL_P (base_fndecl)) abstract_virtuals = tree_cons (NULL_TREE, base_fndecl, abstract_virtuals); ! virtuals = TREE_CHAIN (virtuals); } } *************** *** 2093,2097 **** tree type; { ! tree vbases, tmp; tree abstract_virtuals = CLASSTYPE_ABSTRACT_VIRTUALS (type); --- 2153,2157 ---- tree type; { ! tree vbases; tree abstract_virtuals = CLASSTYPE_ABSTRACT_VIRTUALS (type); *************** *** 2102,2116 **** for (vbases = CLASSTYPE_VBASECLASSES (type); vbases; vbases = TREE_CHAIN (vbases)) { ! if (! BINFO_VIRTUALS (vbases)) ! continue; ! tmp = TREE_CHAIN (BINFO_VIRTUALS (vbases)); ! while (tmp) { ! tree base_pfn = FNADDR_FROM_VTABLE_ENTRY (TREE_VALUE (tmp)); tree base_fndecl = TREE_OPERAND (base_pfn, 0); if (DECL_ABSTRACT_VIRTUAL_P (base_fndecl)) abstract_virtuals = tree_cons (NULL_TREE, base_fndecl, abstract_virtuals); ! tmp = TREE_CHAIN (tmp); } } --- 2162,2176 ---- for (vbases = CLASSTYPE_VBASECLASSES (type); vbases; vbases = TREE_CHAIN (vbases)) { ! tree virtuals = BINFO_VIRTUALS (vbases); ! ! skip_rtti_stuff (&virtuals); ! while (virtuals) { ! tree base_pfn = FNADDR_FROM_VTABLE_ENTRY (TREE_VALUE (virtuals)); tree base_fndecl = TREE_OPERAND (base_pfn, 0); if (DECL_ABSTRACT_VIRTUAL_P (base_fndecl)) abstract_virtuals = tree_cons (NULL_TREE, base_fndecl, abstract_virtuals); ! virtuals = TREE_CHAIN (virtuals); } } *************** *** 2247,2251 **** BINFO_INHERITANCE_CHAIN (last) = binfo_of_derived; BINFO_INHERITANCE_CHAIN (binfo_of_derived) = NULL_TREE; ! return build_vbase_path (PLUS_EXPR, TYPE_POINTER_TO (to_type), expr, last, 1); } --- 2307,2311 ---- BINFO_INHERITANCE_CHAIN (last) = binfo_of_derived; BINFO_INHERITANCE_CHAIN (binfo_of_derived) = NULL_TREE; ! return build_vbase_path (PLUS_EXPR, build_pointer_type (to_type), expr, last, 1); } *************** *** 2471,2475 **** CLASSTYPE_SEARCH_SLOT (vbase) ! = (char *) build (PLUS_EXPR, TYPE_POINTER_TO (vbase), vbase_decl_ptr, BINFO_OFFSET (binfo)); } --- 2531,2535 ---- CLASSTYPE_SEARCH_SLOT (vbase) ! = (char *) build (PLUS_EXPR, build_pointer_type (vbase), vbase_decl_ptr, BINFO_OFFSET (binfo)); } *************** *** 2503,2507 **** this_vbase_ptr = vbase_decl_ptr_intermediate; ! if (TYPE_POINTER_TO (type) != TYPE_MAIN_VARIANT (TREE_TYPE (this_vbase_ptr))) my_friendly_abort (125); --- 2563,2567 ---- this_vbase_ptr = vbase_decl_ptr_intermediate; ! if (build_pointer_type (type) != TYPE_MAIN_VARIANT (TREE_TYPE (this_vbase_ptr))) my_friendly_abort (125); *************** *** 2574,2577 **** --- 2634,2649 ---- if (get_base_distance (DECL_CLASS_CONTEXT (fndecl), t, 0, &path) < 0) { + /* DECL_CLASS_CONTEXT can be ambiguous in t. */ + if (get_base_distance (DECL_CLASS_CONTEXT (fndecl), vbase, 0, &path) >= 0) + { + while (path) + { + /* Not sure if checking path == vbase is necessary here, but just in + case it is. */ + if (TREE_VIA_VIRTUAL (path) || path == vbase) + return binfo_member (BINFO_TYPE (path), CLASSTYPE_VBASECLASSES (t)); + path = BINFO_INHERITANCE_CHAIN (path); + } + } /* This shouldn't happen, I don't want errors! */ warning ("recoverable compiler error, fixups for virtual function"); *************** *** 2620,2627 **** } ! /* Skip RTTI fake object. */ ! n = 1; ! if (virtuals) ! virtuals = TREE_CHAIN (virtuals); while (virtuals) { --- 2692,2697 ---- } ! n = skip_rtti_stuff (&virtuals); ! while (virtuals) { *************** *** 2784,2787 **** --- 2854,2861 ---- else { + #if 1 + addr = convert_pointer_to_vbase (TREE_TYPE (vbases), vbase_decl_ptr); + #else + /* This should should never work better than the above. (mrs) */ tree vbinfo = get_binfo (TREE_TYPE (vbases), TREE_TYPE (vbase_decl), *************** *** 2806,2809 **** --- 2880,2884 ---- continue; } + #endif } *************** *** 3017,3027 **** /* Subroutines of push_class_decls (). */ /* Add the instance variables which this class contributed to the ! current class binding contour. When a redefinition occurs, ! if the redefinition is strictly within a single inheritance path, ! we just overwrite (in the case of a data field) or ! cons (in the case of a member function) the old declaration with ! the new. If the fields are not within a single inheritance path, ! we must cons them in either case. In order to know what decls are new (stemming from the current --- 3092,3196 ---- /* Subroutines of push_class_decls (). */ + /* Add in a decl to the envelope. */ + static void + envelope_add_decl (type, decl, values) + tree type, decl, *values; + { + tree context, *tmp; + tree name = DECL_NAME (decl); + int dont_add = 0; + + /* virtual base names are always unique. */ + if (VBASE_NAME_P (name)) + *values = NULL_TREE; + + /* Possible ambiguity. If its defining type(s) + is (are all) derived from us, no problem. */ + else if (*values && TREE_CODE (*values) != TREE_LIST) + { + tree value = *values; + /* Only complain if we shadow something we can access. */ + if (warn_shadow && TREE_CODE (decl) == FUNCTION_DECL + && ((DECL_LANG_SPECIFIC (*values) + && DECL_CLASS_CONTEXT (value) == current_class_type) + || ! TREE_PRIVATE (value))) + /* Should figure out access control more accurately. */ + { + cp_warning_at ("member `%#D' is shadowed", value); + cp_warning_at ("by member function `%#D'", decl); + warning ("in this context"); + } + + context = (TREE_CODE (value) == FUNCTION_DECL + && DECL_VIRTUAL_P (value)) + ? DECL_CLASS_CONTEXT (value) + : DECL_CONTEXT (value); + + if (context == type) + { + if (TREE_CODE (value) == TYPE_DECL + && DECL_ARTIFICIAL (value)) + *values = NULL_TREE; + else + dont_add = 1; + } + else if (context && TYPE_DERIVES_FROM (context, type)) + { + /* Don't add in *values to list */ + *values = NULL_TREE; + } + else + *values = build_tree_list (NULL_TREE, value); + } + else + for (tmp = values; *tmp;) + { + tree value = TREE_VALUE (*tmp); + my_friendly_assert (TREE_CODE (value) != TREE_LIST, 999); + context = (TREE_CODE (value) == FUNCTION_DECL + && DECL_VIRTUAL_P (value)) + ? DECL_CLASS_CONTEXT (value) + : DECL_CONTEXT (value); + + if (context && TYPE_DERIVES_FROM (context, type)) + { + /* remove *tmp from list */ + *tmp = TREE_CHAIN (*tmp); + } + else + tmp = &TREE_CHAIN (*tmp); + } + + if (! dont_add) + { + /* Put the new contents in our envelope. */ + if (TREE_CODE (decl) == FUNCTION_DECL) + { + *values = tree_cons (name, decl, *values); + TREE_NONLOCAL_FLAG (*values) = 1; + TREE_TYPE (*values) = unknown_type_node; + } + else + { + if (*values) + { + *values = tree_cons (NULL_TREE, decl, *values); + /* Mark this as a potentially ambiguous member. */ + /* Leaving TREE_TYPE blank is intentional. + We cannot use `error_mark_node' (lookup_name) + or `unknown_type_node' (all member functions use this). */ + TREE_NONLOCAL_FLAG (*values) = 1; + } + else + *values = decl; + } + } + } + /* Add the instance variables which this class contributed to the ! current class binding contour. When a redefinition occurs, if the ! redefinition is strictly within a single inheritance path, we just ! overwrite the old declaration with the new. If the fields are not ! within a single inheritance path, we must cons them. In order to know what decls are new (stemming from the current *************** *** 3062,3182 **** } - #if 0 - if (TREE_CODE (fields) != TYPE_DECL) - { - DECL_PUBLIC (fields) = 0; - DECL_PROTECTED (fields) = 0; - DECL_PRIVATE (fields) = 0; - } - #endif - if (DECL_NAME (fields)) { ! tree class_value = IDENTIFIER_CLASS_VALUE (DECL_NAME (fields)); ! ! /* If the class value is an envelope of the kind described in ! the comment above, we try to rule out possible ambiguities. ! If we can't do that, keep a TREE_LIST with possibly ambiguous ! decls in there. */ ! 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); ! tree context; ! ! /* Possible ambiguity. If its defining type(s) ! is (are all) derived from us, no problem. */ ! if (TREE_CODE (value) != TREE_LIST) ! { ! context = (TREE_CODE (value) == FUNCTION_DECL ! && DECL_VIRTUAL_P (value)) ! ? DECL_CLASS_CONTEXT (value) ! : DECL_CONTEXT (value); ! ! if (context == type) ! { ! if (TREE_CODE (value) == TYPE_DECL ! && DECL_ARTIFICIAL (value)) ! value = fields; ! /* else the old value wins */ ! } ! else if (context && TYPE_DERIVES_FROM (context, type)) ! value = fields; ! else ! value = tree_cons (NULL_TREE, fields, ! build_tree_list (NULL_TREE, value)); ! } ! else ! { ! /* All children may derive from us, in which case ! there is no problem. Otherwise, we have to ! keep lists around of what the ambiguities might be. */ ! tree values; ! int problem = 0; ! ! for (values = value; values; values = TREE_CHAIN (values)) ! { ! tree sub_values = TREE_VALUE (values); ! if (TREE_CODE (sub_values) == TREE_LIST) ! { ! for (; sub_values; sub_values = TREE_CHAIN (sub_values)) ! { ! register tree list_mbr = TREE_VALUE (sub_values); ! ! context = (TREE_CODE (list_mbr) == FUNCTION_DECL ! && DECL_VIRTUAL_P (list_mbr)) ! ? DECL_CLASS_CONTEXT (list_mbr) ! : DECL_CONTEXT (list_mbr); ! ! if (! TYPE_DERIVES_FROM (context, type)) ! { ! value = tree_cons (NULL_TREE, TREE_VALUE (values), value); ! problem = 1; ! break; ! } ! } ! } ! else ! { ! context = (TREE_CODE (sub_values) == FUNCTION_DECL ! && DECL_VIRTUAL_P (sub_values)) ! ? DECL_CLASS_CONTEXT (sub_values) ! : DECL_CONTEXT (sub_values); ! ! if (context && ! TYPE_DERIVES_FROM (context, type)) ! { ! value = tree_cons (NULL_TREE, values, value); ! problem = 1; ! break; ! } ! } ! } ! if (! problem) value = fields; ! } ! ! /* Mark this as a potentially ambiguous member. */ ! if (TREE_CODE (value) == TREE_LIST) ! { ! /* Leaving TREE_TYPE blank is intentional. ! We cannot use `error_mark_node' (lookup_name) ! or `unknown_type_node' (all member functions use this). */ ! TREE_NONLOCAL_FLAG (value) = 1; ! } ! ! /* Put the new contents in our envelope. */ ! TREE_PURPOSE (class_value) = value; ! } ! else { /* See comment above for a description of envelopes. */ ! tree envelope = tree_cons (fields, class_value, ! closed_envelopes); ! ! closed_envelopes = envelope; ! IDENTIFIER_CLASS_VALUE (DECL_NAME (fields)) = envelope; } } } --- 3231,3253 ---- } if (DECL_NAME (fields)) { ! tree name = DECL_NAME (fields); ! tree class_value = IDENTIFIER_CLASS_VALUE (name); ! /* If the class value is not an envelope of the kind described in ! the comment above, we create a new envelope. */ ! if (class_value == NULL_TREE || TREE_CODE (class_value) != TREE_LIST ! || TREE_PURPOSE (class_value) == NULL_TREE ! || TREE_CODE (TREE_PURPOSE (class_value)) == IDENTIFIER_NODE) { /* See comment above for a description of envelopes. */ ! closed_envelopes = tree_cons (NULL_TREE, class_value, ! closed_envelopes); ! IDENTIFIER_CLASS_VALUE (name) = closed_envelopes; ! class_value = IDENTIFIER_CLASS_VALUE (name); } + + envelope_add_decl (type, fields, &TREE_PURPOSE (class_value)); } } *************** *** 3189,3264 **** end = TREE_VEC_END (method_vec); - /* This does not work for multiple inheritance yet. */ while (methods != end) { /* This will cause lookup_name to return a pointer ! to the tree_list of possible methods of this name. ! If the order is a problem, we can nreverse them. */ ! tree tmp; ! tree class_value = IDENTIFIER_CLASS_VALUE (DECL_NAME (*methods)); ! ! if (class_value && TREE_CODE (class_value) == TREE_LIST ! && TREE_PURPOSE (class_value) != NULL_TREE ! && TREE_CODE (TREE_PURPOSE (class_value)) != IDENTIFIER_NODE) ! { ! tree old = TREE_PURPOSE (class_value); ! ! maybe_push_cache_obstack (); ! if (TREE_CODE (old) == TREE_LIST) ! tmp = tree_cons (DECL_NAME (*methods), *methods, old); ! else ! { ! /* Only complain if we shadow something we can access. */ ! if (old ! && warn_shadow ! && ((DECL_LANG_SPECIFIC (old) ! && DECL_CLASS_CONTEXT (old) == current_class_type) ! || ! TREE_PRIVATE (old))) ! /* Should figure out access control more accurately. */ ! { ! cp_warning_at ("member `%#D' is shadowed", old); ! cp_warning_at ("by member function `%#D'", *methods); ! warning ("in this context"); ! } ! tmp = build_tree_list (DECL_NAME (*methods), *methods); ! } ! pop_obstacks (); ! ! TREE_TYPE (tmp) = unknown_type_node; ! #if 0 ! TREE_OVERLOADED (tmp) = DECL_OVERLOADED (*methods); ! #endif ! TREE_NONLOCAL_FLAG (tmp) = 1; ! ! /* Put the new contents in our envelope. */ ! TREE_PURPOSE (class_value) = tmp; ! } ! else { - maybe_push_cache_obstack (); - tmp = build_tree_list (DECL_NAME (*methods), *methods); - pop_obstacks (); - - TREE_TYPE (tmp) = unknown_type_node; - #if 0 - TREE_OVERLOADED (tmp) = DECL_OVERLOADED (*methods); - #endif - TREE_NONLOCAL_FLAG (tmp) = 1; - /* See comment above for a description of envelopes. */ ! closed_envelopes = tree_cons (tmp, class_value, closed_envelopes); ! IDENTIFIER_CLASS_VALUE (DECL_NAME (*methods)) = closed_envelopes; ! } ! #if 0 ! tmp = *methods; ! while (tmp != 0) ! { ! DECL_PUBLIC (tmp) = 0; ! DECL_PROTECTED (tmp) = 0; ! DECL_PRIVATE (tmp) = 0; ! tmp = DECL_CHAIN (tmp); } ! #endif methods++; --- 3260,3289 ---- end = TREE_VEC_END (method_vec); while (methods != end) { /* This will cause lookup_name to return a pointer ! to the tree_list of possible methods of this name. */ ! tree name = DECL_NAME (*methods); ! tree class_value = IDENTIFIER_CLASS_VALUE (name); ! ! /* If the class value is not an envelope of the kind described in ! the comment above, we create a new envelope. */ ! if (class_value == NULL_TREE || TREE_CODE (class_value) != TREE_LIST ! || TREE_PURPOSE (class_value) == NULL_TREE ! || TREE_CODE (TREE_PURPOSE (class_value)) == IDENTIFIER_NODE) { /* See comment above for a description of envelopes. */ ! closed_envelopes = tree_cons (NULL_TREE, class_value, closed_envelopes); ! IDENTIFIER_CLASS_VALUE (name) = closed_envelopes; ! class_value = IDENTIFIER_CLASS_VALUE (name); } ! ! /* Here we try to rule out possible ambiguities. ! If we can't do that, keep a TREE_LIST with possibly ambiguous ! decls in there. */ ! maybe_push_cache_obstack (); ! envelope_add_decl (type, *methods, &TREE_PURPOSE (class_value)); ! pop_obstacks (); methods++; *************** *** 3317,3355 **** tree id; struct obstack *ambient_obstack = current_obstack; - - #if 0 - tree tags = CLASSTYPE_TAGS (type); - - while (tags) - { - tree code_type_node; - tree tag; - - switch (TREE_CODE (TREE_VALUE (tags))) - { - case ENUMERAL_TYPE: - code_type_node = enum_type_node; - break; - case RECORD_TYPE: - code_type_node = record_type_node; - break; - case CLASS_TYPE: - code_type_node = class_type_node; - break; - case UNION_TYPE: - code_type_node = union_type_node; - break; - default: - my_friendly_abort (297); - } - tag = xref_tag (code_type_node, TREE_PURPOSE (tags), - TYPE_BINFO_BASETYPE (TREE_VALUE (tags), 0), 0); - #if 0 /* not yet, should get fixed properly later */ - pushdecl (make_type_decl (TREE_PURPOSE (tags), TREE_VALUE (tags))); - #else - pushdecl (build_decl (TYPE_DECL, TREE_PURPOSE (tags), TREE_VALUE (tags))); - #endif - } - #endif search_stack = push_search_level (search_stack, &search_obstack); --- 3342,3345 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/sig.c gcc-2.7.1/cp/sig.c *** gcc-2.7.0/cp/sig.c Thu Jun 15 08:28:38 1995 --- gcc-2.7.1/cp/sig.c Wed Oct 11 22:31:10 1995 *************** *** 1,4 **** /* Functions dealing with signatures and signature pointers/references. ! Copyright (C) 1992, 1995 Free Software Foundation, Inc. Contributed by Gerald Baumgartner (gb@cs.purdue.edu) --- 1,4 ---- /* Functions dealing with signatures and signature pointers/references. ! Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Contributed by Gerald Baumgartner (gb@cs.purdue.edu) *************** *** 145,149 **** void * optr; const s * sptr; - vtbl_type_node * vptr; }; --- 145,148 ---- *************** *** 153,157 **** const void * optr; const s * sptr; - vtbl_type_node * vptr; }; --- 152,155 ---- *************** *** 163,167 **** tree obj_type = build_type_variant (void_type_node, constp, volatilep); tree optr_type = build_pointer_type (obj_type); ! tree optr, sptr, vptr; optr = build_lang_field_decl (FIELD_DECL, --- 161,165 ---- tree obj_type = build_type_variant (void_type_node, constp, volatilep); tree optr_type = build_pointer_type (obj_type); ! tree optr, sptr; optr = build_lang_field_decl (FIELD_DECL, *************** *** 172,180 **** if (m) ! { ! /* We can share `sptr' and `vptr' among type variants. */ ! sptr = TREE_CHAIN (TYPE_FIELDS (m)); ! vptr = TREE_CHAIN (sptr); ! } else { --- 170,175 ---- if (m) ! /* We can share the `sptr' field among type variants. */ ! sptr = TREE_CHAIN (TYPE_FIELDS (m)); else { *************** *** 184,196 **** get_identifier (SIGNATURE_SPTR_NAME), build_pointer_type (sig_tbl_type)); - vptr = build_lang_field_decl (FIELD_DECL, - get_identifier (SIGNATURE_VPTR_NAME), - build_pointer_type (vtbl_type_node)); DECL_FIELD_CONTEXT (sptr) = t; DECL_CLASS_CONTEXT (sptr) = t; ! DECL_FIELD_CONTEXT (vptr) = t; ! DECL_CLASS_CONTEXT (vptr) = t; ! TREE_CHAIN (sptr) = vptr; ! TREE_CHAIN (vptr) = NULL_TREE; } --- 179,185 ---- get_identifier (SIGNATURE_SPTR_NAME), build_pointer_type (sig_tbl_type)); DECL_FIELD_CONTEXT (sptr) = t; DECL_CLASS_CONTEXT (sptr) = t; ! TREE_CHAIN (sptr) = NULL_TREE; } *************** *** 197,206 **** TREE_CHAIN (optr) = sptr; TYPE_FIELDS (t) = optr; - /* To make `build_vfn_ref' work when building a signature method call. */ - CLASSTYPE_VFIELD (t) = vptr; - DECL_FCONTEXT (CLASSTYPE_VFIELD (t)) = t; TYPE_ALIGN (t) = TYPE_ALIGN (optr_type); ! /* A signature pointer/reference isn't a `real' class. */ IS_AGGR_TYPE (t) = 0; } --- 186,192 ---- TREE_CHAIN (optr) = sptr; TYPE_FIELDS (t) = optr; TYPE_ALIGN (t) = TYPE_ALIGN (optr_type); ! /* A signature pointer/reference type isn't a `real' class type. */ IS_AGGR_TYPE (t) = 0; } *************** *** 574,585 **** else { ! tree code, offset, pfn; if (rhs_method == sig_method) { ! code = integer_two_node; ! offset = integer_zero_node; pfn = build_unary_op (ADDR_EXPR, rhs_method, 0); TREE_TYPE (pfn) = ptr_type_node; offset_p = 0; /* we can't offset the rhs sig table */ } --- 560,577 ---- else { ! tree tag, vb_off, delta, index, pfn, vt_off; ! tree tag_decl, vb_off_decl, delta_decl, index_decl; ! tree pfn_decl, vt_off_decl; if (rhs_method == sig_method) { ! /* default implementation */ ! tag = build_unary_op (NEGATE_EXPR, integer_one_node, 0); ! vb_off = build_unary_op (NEGATE_EXPR, integer_one_node, 0); ! delta = integer_zero_node; ! index = integer_zero_node; pfn = build_unary_op (ADDR_EXPR, rhs_method, 0); TREE_TYPE (pfn) = ptr_type_node; + TREE_ADDRESSABLE (rhs_method) = 1; offset_p = 0; /* we can't offset the rhs sig table */ } *************** *** 586,597 **** else if (DECL_VINDEX (rhs_method)) { ! code = integer_one_node; ! offset = DECL_VINDEX (rhs_method); ! pfn = null_pointer_node; } else { ! code = integer_zero_node; ! offset = integer_zero_node; pfn = build_unary_op (ADDR_EXPR, rhs_method, 0); TREE_TYPE (pfn) = ptr_type_node; --- 578,598 ---- else if (DECL_VINDEX (rhs_method)) { ! /* virtual member function */ ! tag = integer_one_node; ! vb_off = build_unary_op (NEGATE_EXPR, integer_one_node, 0); ! delta = BINFO_OFFSET (get_binfo (DECL_CLASS_CONTEXT (rhs_method), ! rhstype, 1)); ! index = DECL_VINDEX (rhs_method); ! vt_off = get_vfield_offset (get_binfo (DECL_CONTEXT (rhs_method), ! rhstype, 0)); } else { ! /* non-virtual member function */ ! tag = integer_zero_node; ! vb_off = build_unary_op (NEGATE_EXPR, integer_one_node, 0); ! delta = BINFO_OFFSET (get_binfo (DECL_CLASS_CONTEXT (rhs_method), ! rhstype, 1)); ! index = integer_zero_node; pfn = build_unary_op (ADDR_EXPR, rhs_method, 0); TREE_TYPE (pfn) = ptr_type_node; *************** *** 599,607 **** } ! tbl_entry = tree_cons (NULL_TREE, code, ! tree_cons (NULL_TREE, offset, ! build_tree_list (NULL_TREE, pfn))); ! tbl_entry = build_nt (CONSTRUCTOR, NULL_TREE, tbl_entry); ! TREE_HAS_CONSTRUCTOR (tbl_entry) = 1; TREE_CONSTANT (tbl_entry) = 1; } --- 600,637 ---- } ! /* Since digest_init doesn't handle initializing selected fields ! of a struct (i.e., anonymous union), we build the constructor ! by hand, without calling digest_init. */ ! tag_decl = TYPE_FIELDS (sigtable_entry_type); ! vb_off_decl = TREE_CHAIN (tag_decl); ! delta_decl = TREE_CHAIN (vb_off_decl); ! index_decl = TREE_CHAIN (delta_decl); ! pfn_decl = TREE_CHAIN (index_decl); ! vt_off_decl = TREE_CHAIN (pfn_decl); ! ! tag = convert (TREE_TYPE (tag_decl), tag); ! vb_off = convert (TREE_TYPE (vb_off_decl), vb_off); ! delta = convert (TREE_TYPE (delta_decl), delta); ! index = convert (TREE_TYPE (index_decl), index); ! ! if (DECL_VINDEX (rhs_method)) ! { ! vt_off = convert (TREE_TYPE (vt_off_decl), vt_off); ! ! tbl_entry = build_tree_list (vt_off_decl, vt_off); ! } ! else ! { ! pfn = convert (TREE_TYPE (pfn_decl), pfn); ! ! tbl_entry = build_tree_list (pfn_decl, pfn); ! } ! tbl_entry = tree_cons (delta_decl, delta, ! tree_cons (index_decl, index, tbl_entry)); ! tbl_entry = tree_cons (tag_decl, tag, ! tree_cons (vb_off_decl, vb_off, tbl_entry)); ! tbl_entry = build (CONSTRUCTOR, sigtable_entry_type, ! NULL_TREE, tbl_entry); ! TREE_CONSTANT (tbl_entry) = 1; } *************** *** 745,749 **** tree rhstype = TREE_TYPE (rhs); tree sig_ty = SIGNATURE_TYPE (lhstype); ! tree sig_tbl, sptr_expr, optr_expr, vptr_expr; tree result; --- 775,779 ---- tree rhstype = TREE_TYPE (rhs); tree sig_ty = SIGNATURE_TYPE (lhstype); ! tree sig_tbl, sptr_expr, optr_expr; tree result; *************** *** 782,786 **** optr_expr = build_optr_ref (rhs); sptr_expr = build_sptr_ref (rhs); - vptr_expr = build_vptr_ref (rhs); } else --- 812,815 ---- *************** *** 806,810 **** sptr_expr = build_unary_op (ADDR_EXPR, sig_tbl, 0); TREE_TYPE (sptr_expr) = build_pointer_type (sig_ty); - vptr_expr = build_vptr_ref (rhs); } } --- 835,838 ---- *************** *** 811,822 **** else { - tree rhs_vptr; - - if (TYPE_USES_COMPLEX_INHERITANCE (TREE_TYPE (rhstype))) - { - sorry ("class with multiple inheritance as implementation of signature"); - return error_mark_node; - } - sig_tbl = build_sigtable (sig_ty, TREE_TYPE (rhstype), rhs); if (sig_tbl == error_mark_node) --- 839,842 ---- *************** *** 833,845 **** else sptr_expr = build_unary_op (ADDR_EXPR, sig_tbl, 0); - if (CLASSTYPE_VFIELD (TREE_TYPE (rhstype))) - { - rhs_vptr = DECL_NAME (CLASSTYPE_VFIELD (TREE_TYPE (rhstype))); - vptr_expr = build_component_ref (build_indirect_ref (rhs, 0), - rhs_vptr, NULL_TREE, 0); - } - else - vptr_expr = copy_node (null_pointer_node); - TREE_TYPE (vptr_expr) = build_pointer_type (vtbl_type_node); } --- 853,856 ---- *************** *** 847,852 **** { result = tree_cons (NULL_TREE, optr_expr, ! tree_cons (NULL_TREE, sptr_expr, ! build_tree_list (NULL_TREE, vptr_expr))); result = build_nt (CONSTRUCTOR, NULL_TREE, result); TREE_HAS_CONSTRUCTOR (result) = 1; --- 858,862 ---- { result = tree_cons (NULL_TREE, optr_expr, ! build_tree_list (NULL_TREE, sptr_expr)); result = build_nt (CONSTRUCTOR, NULL_TREE, result); TREE_HAS_CONSTRUCTOR (result) = 1; *************** *** 862,873 **** sptr_expr = build_modify_expr (build_sptr_ref (lhs), NOP_EXPR, sptr_expr); - vptr_expr = build_modify_expr (build_vptr_ref (lhs), NOP_EXPR, - vptr_expr); result = tree_cons (NULL_TREE, optr_expr, tree_cons (NULL_TREE, sptr_expr, ! tree_cons (NULL_TREE, vptr_expr, ! build_tree_list (NULL_TREE, ! lhs)))); result = build_compound_expr (result); } --- 872,879 ---- sptr_expr = build_modify_expr (build_sptr_ref (lhs), NOP_EXPR, sptr_expr); result = tree_cons (NULL_TREE, optr_expr, tree_cons (NULL_TREE, sptr_expr, ! build_tree_list (NULL_TREE, lhs))); result = build_compound_expr (result); } *************** *** 912,915 **** --- 918,923 ---- { tree saved_instance = save_this (instance); /* Create temp for `this'. */ + tree object_ptr = build_optr_ref (saved_instance); + tree new_object_ptr, new_parms; tree signature_tbl_ptr = build_sptr_ref (saved_instance); tree sig_field_name = DECL_NAME (DECL_MEMFUNC_POINTER_TO (function)); *************** *** 918,931 **** signature_tbl_ptr), sig_field_name, basetype_path, 1); ! tree code, offset, pfn, vfn; tree deflt_call = NULL_TREE, direct_call, virtual_call, result; ! code = build_component_ref (tbl_entry, get_identifier (SIGTABLE_CODE_NAME), ! NULL_TREE, 1); ! offset = build_component_ref (tbl_entry, ! get_identifier (SIGTABLE_OFFSET_NAME), ! NULL_TREE, 1); ! pfn = build_component_ref (tbl_entry, get_identifier (SIGTABLE_PFN_NAME), ! NULL_TREE, 1); TREE_TYPE (pfn) = build_pointer_type (TREE_TYPE (function)); --- 926,938 ---- signature_tbl_ptr), sig_field_name, basetype_path, 1); ! tree tag, delta, pfn, vt_off, index, vfn; tree deflt_call = NULL_TREE, direct_call, virtual_call, result; ! tbl_entry = save_expr (tbl_entry); ! tag = build_component_ref (tbl_entry, tag_identifier, NULL_TREE, 1); ! delta = build_component_ref (tbl_entry, delta_identifier, NULL_TREE, 1); ! pfn = build_component_ref (tbl_entry, pfn_identifier, NULL_TREE, 1); ! vt_off = build_component_ref (tbl_entry, vt_off_identifier, NULL_TREE, 1); ! index = build_component_ref (tbl_entry, index_identifier, NULL_TREE, 1); TREE_TYPE (pfn) = build_pointer_type (TREE_TYPE (function)); *************** *** 933,941 **** { pfn = save_expr (pfn); ! deflt_call = build_function_call (pfn, ! tree_cons (NULL_TREE, saved_instance, ! TREE_CHAIN (parms))); } { /* Cast the signature method to have `this' of a normal pointer type. */ --- 940,955 ---- { pfn = save_expr (pfn); ! deflt_call = build_function_call (pfn, parms); } + new_object_ptr = build (PLUS_EXPR, build_pointer_type (basetype), + convert (ptrdiff_type_node, object_ptr), + convert (ptrdiff_type_node, delta)); + + parms = tree_cons (NULL_TREE, + convert (build_pointer_type (basetype), object_ptr), + TREE_CHAIN (parms)); + new_parms = tree_cons (NULL_TREE, new_object_ptr, TREE_CHAIN (parms)); + { /* Cast the signature method to have `this' of a normal pointer type. */ *************** *** 943,955 **** TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (TREE_TYPE (pfn)))) = ! build_type_variant (TYPE_POINTER_TO (basetype), TYPE_READONLY (old_this), TYPE_VOLATILE (old_this)); ! direct_call = build_function_call (pfn, parms); ! vfn = build_vfn_ref (&TREE_VALUE (parms), saved_instance, offset); ! TREE_TYPE (vfn) = build_pointer_type (TREE_TYPE (function)); ! virtual_call = build_function_call (vfn, parms); /* Undo the cast, make `this' a signature pointer again. */ --- 957,989 ---- TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (TREE_TYPE (pfn)))) = ! build_type_variant (build_pointer_type (basetype), TYPE_READONLY (old_this), TYPE_VOLATILE (old_this)); ! direct_call = build_function_call (pfn, new_parms); ! ! { ! tree vfld, vtbl, aref; ! ! vfld = build (PLUS_EXPR, ! build_pointer_type (build_pointer_type (vtbl_type_node)), ! convert (ptrdiff_type_node, object_ptr), ! convert (ptrdiff_type_node, vt_off)); ! vtbl = build_indirect_ref (build_indirect_ref (vfld, NULL_PTR), ! NULL_PTR); ! aref = build_array_ref (vtbl, index); ! ! if (flag_vtable_thunks) ! vfn = aref; ! else ! vfn = build_component_ref (aref, pfn_identifier, 0, 0); ! ! TREE_TYPE (vfn) = build_pointer_type (TREE_TYPE (function)); ! if (flag_vtable_thunks) ! virtual_call = build_function_call (vfn, parms); ! else ! virtual_call = build_function_call (vfn, new_parms); ! } /* Undo the cast, make `this' a signature pointer again. */ *************** *** 971,984 **** if (IS_DEFAULT_IMPLEMENTATION (function)) { ! tree test = build_binary_op_nodefault (EQ_EXPR, code, integer_one_node, ! EQ_EXPR); ! result = build_conditional_expr (code, build_conditional_expr (test, ! virtual_call, ! deflt_call), direct_call); } else ! result = build_conditional_expr (code, virtual_call, direct_call); /* If we created a temporary variable for `this', initialize it first. */ --- 1005,1018 ---- if (IS_DEFAULT_IMPLEMENTATION (function)) { ! tree test = build_binary_op_nodefault (LT_EXPR, tag, integer_zero_node, ! LT_EXPR); ! result = build_conditional_expr (tag, build_conditional_expr (test, ! deflt_call, ! virtual_call), direct_call); } else ! result = build_conditional_expr (tag, virtual_call, direct_call); /* If we created a temporary variable for `this', initialize it first. */ *************** *** 1011,1026 **** { tree field = get_identifier (SIGNATURE_SPTR_NAME); - - return build_component_ref (instance, field, NULL_TREE, 1); - } - - /* Create a COMPONENT_REF expression for referencing the VPTR field - of a signature pointer or reference. */ - - tree - build_vptr_ref (instance) - tree instance; - { - tree field = get_identifier (SIGNATURE_VPTR_NAME); return build_component_ref (instance, field, NULL_TREE, 1); --- 1045,1048 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/spew.c gcc-2.7.1/cp/spew.c *** gcc-2.7.0/cp/spew.c Thu Jun 15 08:29:02 1995 --- gcc-2.7.1/cp/spew.c Wed Oct 11 22:31:16 1995 *************** *** 1,4 **** /* Type Analyzer for GNU C++. ! Copyright (C) 1987, 1989, 1992, 1993 Free Software Foundation, Inc. Hacked... nay, bludgeoned... by Mark Eichin (eichin@cygnus.com) --- 1,4 ---- /* Type Analyzer for GNU C++. ! Copyright (C) 1987, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. Hacked... nay, bludgeoned... by Mark Eichin (eichin@cygnus.com) *************** *** 245,248 **** --- 245,255 ---- tree got_scope; tree got_object; + + int + peekyylex() + { + scan_tokens (0); + return nth_token (0)->yychar; + } int diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/tree.c gcc-2.7.1/cp/tree.c *** gcc-2.7.0/cp/tree.c Thu Jun 15 08:29:28 1995 --- gcc-2.7.1/cp/tree.c Wed Oct 11 22:31:27 1995 *************** *** 1,4 **** /* Language-dependent node constructors for parse phase of GNU compiler. ! Copyright (C) 1987, 1988, 1992, 1993 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,4 ---- /* Language-dependent node constructors for parse phase of GNU compiler. ! Copyright (C) 1987, 88, 92, 93, 94, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) *************** *** 237,241 **** TREE_OPERAND (rval, 2) = error_mark_node; rval = build (WITH_CLEANUP_EXPR, type, rval, 0, ! build_delete (TYPE_POINTER_TO (type), build_unary_op (ADDR_EXPR, slot, 0), integer_two_node, --- 237,241 ---- TREE_OPERAND (rval, 2) = error_mark_node; rval = build (WITH_CLEANUP_EXPR, type, rval, 0, ! build_delete (build_pointer_type (type), build_unary_op (ADDR_EXPR, slot, 0), integer_two_node, *************** *** 754,758 **** an integer and VAR_SIZE is a tree expression. If VAR_SIZE is null, the size is just CONST_SIZE. Naturally we try to avoid using ! VAR_SIZE. And so far, we've been sucessful. */ #if 0 register tree var_size = 0; --- 754,758 ---- an integer and VAR_SIZE is a tree expression. If VAR_SIZE is null, the size is just CONST_SIZE. Naturally we try to avoid using ! VAR_SIZE. And so far, we've been successful. */ #if 0 register tree var_size = 0; *************** *** 1319,1323 **** tree elem; { ! int i; tree virtuals; --- 1319,1323 ---- tree elem; { ! unsigned HOST_WIDE_INT n; tree virtuals; *************** *** 1333,1342 **** fprintf (stderr, "virtuals:\n"); virtuals = BINFO_VIRTUALS (elem); ! if (virtuals != 0) ! { ! /* skip the rtti type descriptor entry */ ! virtuals = TREE_CHAIN (virtuals); ! } ! i = 1; while (virtuals) { --- 1333,1339 ---- fprintf (stderr, "virtuals:\n"); virtuals = BINFO_VIRTUALS (elem); ! ! n = skip_rtti_stuff (&virtuals); ! while (virtuals) { *************** *** 1344,1350 **** fprintf (stderr, "%s [%d =? %d]\n", IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)), ! i, TREE_INT_CST_LOW (DECL_VINDEX (fndecl))); virtuals = TREE_CHAIN (virtuals); - i += 1; } } --- 1341,1347 ---- fprintf (stderr, "%s [%d =? %d]\n", IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)), ! n, TREE_INT_CST_LOW (DECL_VINDEX (fndecl))); ! ++n; virtuals = TREE_CHAIN (virtuals); } } *************** *** 1568,1576 **** } ! /* Build the FUNCTION_TYPE or METHOD_TYPE which may raise exceptions listed in RAISES. */ tree ! build_exception_variant (ctype, type, raises) ! tree ctype, type; tree raises; { --- 1565,1573 ---- } ! /* Build the FUNCTION_TYPE or METHOD_TYPE which may throw exceptions listed in RAISES. */ tree ! build_exception_variant (type, raises) ! tree type; tree raises; { *************** *** 1903,1905 **** --- 1900,1995 ---- { return mapcar (t, bot_manip); + } + + tree + unsave_expr (expr) + tree expr; + { + tree t; + + t = build1 (UNSAVE_EXPR, TREE_TYPE (expr), expr); + TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (expr); + return t; + } + + /* Modify a tree in place so that all the evaluate only once things + are cleared out. Return the EXPR given. */ + tree + unsave_expr_now (expr) + tree expr; + { + enum tree_code code; + register int i; + + if (expr == NULL_TREE) + return expr; + + code = TREE_CODE (expr); + switch (code) + { + case SAVE_EXPR: + SAVE_EXPR_RTL (expr) = NULL_RTX; + break; + + case TARGET_EXPR: + sorry ("TARGET_EXPR reused inside UNSAVE_EXPR"); + break; + + case RTL_EXPR: + warning ("RTL_EXPR reused inside UNSAVE_EXPR"); + RTL_EXPR_SEQUENCE (expr) = NULL_RTX; + break; + + case CALL_EXPR: + CALL_EXPR_RTL (expr) = NULL_RTX; + if (TREE_OPERAND (expr, 1) + && TREE_CODE (TREE_OPERAND (expr, 1)) == TREE_LIST) + { + tree exp = TREE_OPERAND (expr, 1); + while (exp) + { + unsave_expr_now (TREE_VALUE (exp)); + exp = TREE_CHAIN (exp); + } + } + break; + + case WITH_CLEANUP_EXPR: + warning ("WITH_CLEANUP_EXPR reused inside UNSAVE_EXPR"); + RTL_EXPR_RTL (expr) = NULL_RTX; + break; + } + + switch (TREE_CODE_CLASS (code)) + { + case 'c': /* a constant */ + case 't': /* a type node */ + case 'x': /* something random, like an identifier or an ERROR_MARK. */ + case 'd': /* A decl node */ + case 'b': /* A block node */ + return expr; + + case 'e': /* an expression */ + case 'r': /* a reference */ + case 's': /* an expression with side effects */ + case '<': /* a comparison expression */ + case '2': /* a binary arithmetic expression */ + case '1': /* a unary arithmetic expression */ + for (i = tree_code_length[(int) code] - 1; i >= 0; i--) + unsave_expr_now (TREE_OPERAND (expr, i)); + return expr; + + default: + my_friendly_abort (999); + } + } + + /* Since cleanup may have SAVE_EXPRs in it, we protect it with an + UNSAVE_EXPR as the backend cannot yet handle SAVE_EXPRs in cleanups + by itself. */ + int + cp_expand_decl_cleanup (decl, cleanup) + tree decl, cleanup; + { + return expand_decl_cleanup (decl, unsave_expr (cleanup)); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/tree.def gcc-2.7.1/cp/tree.def *** gcc-2.7.0/cp/tree.def Thu Jun 15 08:30:00 1995 --- gcc-2.7.1/cp/tree.def Wed Oct 11 22:31:34 1995 *************** *** 36,39 **** --- 36,48 ---- DEFTREECODE (VEC_DELETE_EXPR, "vec_dl_expr", "e", 2) + /* For a UNSAVE_EXPR, operand 0 is the value to unsave. By unsave, we + mean that all _EXPRs such as TARGET_EXPRs, SAVE_EXPRs, + WITH_CLEANUP_EXPRs, CALL_EXPRs and RTL_EXPRs, that are protected + from being evaluated more than once should be reset so that a new + expand_expr call of this expr will cause those to be re-evaluated. + This is useful when we want to reuse a tree in different places, + but where we must re-expand. */ + DEFTREECODE (UNSAVE_EXPR, "unsave_expr", "e", 1) + /* Value is reference to particular overloaded class method. Operand 0 is the class name (an IDENTIFIER_NODE); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/typeck.c gcc-2.7.1/cp/typeck.c *** gcc-2.7.0/cp/typeck.c Thu Jun 15 08:30:45 1995 --- gcc-2.7.1/cp/typeck.c Fri Nov 3 17:57:14 1995 *************** *** 219,226 **** else { ! int cmp = simple_cst_equal (TREE_PURPOSE (p1), TREE_PURPOSE (p2)); ! if (cmp < 0) ! my_friendly_abort (111); ! if (cmp == 0) any_change = 1; TREE_PURPOSE (n) = TREE_PURPOSE (p2); --- 219,223 ---- else { ! if (1 != simple_cst_equal (TREE_PURPOSE (p1), TREE_PURPOSE (p2))) any_change = 1; TREE_PURPOSE (n) = TREE_PURPOSE (p2); *************** *** 420,424 **** return build_type_attribute_variant (t2, attributes); /* Merge the element types, and have a size if either arg has one. */ ! t1 = build_array_type (elt, TYPE_DOMAIN (TYPE_DOMAIN (t1) ? t1 : t2)); return build_type_attribute_variant (t1, attributes); } --- 417,421 ---- return build_type_attribute_variant (t2, attributes); /* Merge the element types, and have a size if either arg has one. */ ! t1 = build_cplus_array_type (elt, TYPE_DOMAIN (TYPE_DOMAIN (t1) ? t1 : t2)); return build_type_attribute_variant (t1, attributes); } *************** *** 444,448 **** rval = build_function_type (valtype, p2); if ((raises = TYPE_RAISES_EXCEPTIONS (t2))) ! rval = build_exception_variant (NULL_TREE, rval, raises); return build_type_attribute_variant (rval, attributes); } --- 441,445 ---- rval = build_function_type (valtype, p2); if ((raises = TYPE_RAISES_EXCEPTIONS (t2))) ! rval = build_exception_variant (rval, raises); return build_type_attribute_variant (rval, attributes); } *************** *** 452,456 **** rval = build_function_type (valtype, p1); if (raises) ! rval = build_exception_variant (NULL_TREE, rval, raises); return build_type_attribute_variant (rval, attributes); } --- 449,453 ---- rval = build_function_type (valtype, p1); if (raises) ! rval = build_exception_variant (rval, raises); return build_type_attribute_variant (rval, attributes); } *************** *** 457,461 **** rval = build_function_type (valtype, commonparms (p1, p2)); ! rval = build_exception_variant (NULL_TREE, rval, raises); return build_type_attribute_variant (rval, attributes); } --- 454,458 ---- rval = build_function_type (valtype, commonparms (p1, p2)); ! rval = build_exception_variant (rval, raises); return build_type_attribute_variant (rval, attributes); } *************** *** 502,506 **** t3 = common_type (t1, t2); t3 = build_cplus_method_type (basetype, TREE_TYPE (t3), TYPE_ARG_TYPES (t3)); ! t1 = build_exception_variant (basetype, t3, raises); } else --- 499,503 ---- t3 = common_type (t1, t2); t3 = build_cplus_method_type (basetype, TREE_TYPE (t3), TYPE_ARG_TYPES (t3)); ! t1 = build_exception_variant (t3, raises); } else *************** *** 676,682 **** case OFFSET_TYPE: ! val = (comptypes (TYPE_POINTER_TO (TYPE_OFFSET_BASETYPE (t1)), ! TYPE_POINTER_TO (TYPE_OFFSET_BASETYPE (t2)), strict) ! && comptypes (TREE_TYPE (t1), TREE_TYPE (t2), strict)); break; --- 673,679 ---- case OFFSET_TYPE: ! val = (comptypes (build_pointer_type (TYPE_OFFSET_BASETYPE (t1)), ! build_pointer_type (TYPE_OFFSET_BASETYPE (t2)), strict) ! && comptypes (TREE_TYPE (t1), TREE_TYPE (t2), strict)); break; *************** *** 690,698 **** but not vice-versa! */ ! val = (comptypes (TYPE_POINTER_TO (TYPE_METHOD_BASETYPE (t2)), ! TYPE_POINTER_TO (TYPE_METHOD_BASETYPE (t1)), strict) ! && comptypes (TREE_TYPE (t1), TREE_TYPE (t2), strict) ! && compparms (TREE_CHAIN (TYPE_ARG_TYPES (t1)), ! TREE_CHAIN (TYPE_ARG_TYPES (t2)), strict)); break; --- 687,693 ---- but not vice-versa! */ ! val = (comptypes (TREE_TYPE (t1), TREE_TYPE (t2), strict) ! && compparms (TYPE_ARG_TYPES (t1), ! TYPE_ARG_TYPES (t2), strict)); break; *************** *** 746,750 **** case TEMPLATE_TYPE_PARM: ! return 1; case UNINSTANTIATED_P_TYPE: --- 741,745 ---- case TEMPLATE_TYPE_PARM: ! return TEMPLATE_TYPE_IDX (t1) == TEMPLATE_TYPE_IDX (t2); case UNINSTANTIATED_P_TYPE: *************** *** 814,821 **** else if (TREE_CODE (ttl) == POINTER_TYPE || TREE_CODE (ttl) == ARRAY_TYPE) ! return comp_ptr_ttypes (ttl, ttr); } ! return comp_target_types (ttl, ttr, nptrs - 1); } --- 809,845 ---- else if (TREE_CODE (ttl) == POINTER_TYPE || TREE_CODE (ttl) == ARRAY_TYPE) ! { ! if (comp_ptr_ttypes (ttl, ttr)) ! return 1; ! else if (comp_ptr_ttypes (ttr, ttl)) ! return -1; ! return 0; ! } } ! /* Const and volatile mean something different for function types, ! so the usual checks are not appropriate. */ ! if (TREE_CODE (ttl) == FUNCTION_TYPE || TREE_CODE (ttl) == METHOD_TYPE) ! return comp_target_types (ttl, ttr, nptrs - 1); ! ! /* Make sure that the cv-quals change only in the same direction as ! the target type. */ ! { ! int t; ! int c = TYPE_READONLY (ttl) - TYPE_READONLY (ttr); ! int v = TYPE_VOLATILE (ttl) - TYPE_VOLATILE (ttr); ! ! if ((c > 0 && v < 0) || (c < 0 && v > 0)) ! return 0; ! ! if (TYPE_MAIN_VARIANT (ttl) == TYPE_MAIN_VARIANT (ttr)) ! return (c + v < 0) ? -1 : 1; ! ! t = comp_target_types (ttl, ttr, nptrs - 1); ! if ((t == 1 && c + v >= 0) || (t == -1 && c + v <= 0)) ! return t; ! ! return 0; ! } } *************** *** 856,862 **** if (nptrs < 0) return 0; ! if (comptypes (TYPE_POINTER_TO (ttl), TYPE_POINTER_TO (ttr), 0)) return 1; ! if (comptypes (TYPE_POINTER_TO (ttr), TYPE_POINTER_TO (ttl), 0)) return -1; return 0; --- 880,886 ---- if (nptrs < 0) return 0; ! if (comptypes (build_pointer_type (ttl), build_pointer_type (ttr), 0)) return 1; ! if (comptypes (build_pointer_type (ttr), build_pointer_type (ttl), 0)) return -1; return 0; *************** *** 1412,1416 **** TREE_REFERENCE_EXPR (inner) = 1; } ! return convert (TYPE_POINTER_TO (TREE_TYPE (type)), inner); } --- 1436,1440 ---- TREE_REFERENCE_EXPR (inner) = 1; } ! return convert (build_pointer_type (TREE_TYPE (type)), inner); } *************** *** 1846,1857 **** register tree type = TREE_TYPE (pointer); ! if (ptr == current_class_decl && C_C_D) return C_C_D; ! ptr = build_expr_type_conversion (WANT_POINTER, pointer, 1); ! if (ptr) { ! pointer = ptr; ! type = TREE_TYPE (pointer); } --- 1870,1885 ---- register tree type = TREE_TYPE (pointer); ! if (ptr == current_class_decl) return C_C_D; ! if (IS_AGGR_TYPE (type)) { ! ptr = build_expr_type_conversion (WANT_POINTER, pointer, 1); ! ! if (ptr) ! { ! pointer = ptr; ! type = TREE_TYPE (pointer); ! } } *************** *** 1859,1864 **** { if (TREE_CODE (pointer) == ADDR_EXPR ! && (TREE_TYPE (TREE_OPERAND (pointer, 0)) ! == TREE_TYPE (type))) return TREE_OPERAND (pointer, 0); else --- 1887,1896 ---- { if (TREE_CODE (pointer) == ADDR_EXPR ! && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (pointer, 0))) ! == TYPE_MAIN_VARIANT (TREE_TYPE (type))) ! && (TREE_READONLY (TREE_OPERAND (pointer, 0)) ! == TYPE_READONLY (TREE_TYPE (type))) ! && (TREE_THIS_VOLATILE (TREE_OPERAND (pointer, 0)) ! == TYPE_VOLATILE (TREE_TYPE (type)))) return TREE_OPERAND (pointer, 0); else *************** *** 2144,2148 **** } /* Yow: call from a static member function. */ ! decl = build1 (NOP_EXPR, TYPE_POINTER_TO (current_class_type), error_mark_node); decl = build_indirect_ref (decl, NULL_PTR); --- 2176,2180 ---- } /* Yow: call from a static member function. */ ! decl = build1 (NOP_EXPR, build_pointer_type (current_class_type), error_mark_node); decl = build_indirect_ref (decl, NULL_PTR); *************** *** 2223,2227 **** /* Explicitly named method? */ if (TREE_CODE (function) == FUNCTION_DECL) ! ctypeptr = TYPE_POINTER_TO (DECL_CLASS_CONTEXT (function)); /* Expression with ptr-to-method type? It could either be a plain usage, or it might be a case where the ptr-to-method is being --- 2255,2259 ---- /* Explicitly named method? */ if (TREE_CODE (function) == FUNCTION_DECL) ! ctypeptr = build_pointer_type (DECL_CLASS_CONTEXT (function)); /* Expression with ptr-to-method type? It could either be a plain usage, or it might be a case where the ptr-to-method is being *************** *** 2230,2234 **** { tree rec = TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (fntype))); ! ctypeptr = TYPE_POINTER_TO (rec); } /* Unexpected node type? */ --- 2262,2266 ---- { tree rec = TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (fntype))); ! ctypeptr = build_pointer_type (rec); } /* Unexpected node type? */ *************** *** 2273,2290 **** if (TYPE_PTRMEMFUNC_P (TREE_TYPE (function))) { ! tree fntype = TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (function)); ! tree index = save_expr (build_component_ref (function, ! index_identifier, ! 0, 0)); ! tree e1 = build (GT_EXPR, boolean_type_node, index, ! convert (delta_type_node, integer_zero_node)); ! tree delta = convert (ptrdiff_type_node, ! build_component_ref (function, delta_identifier, 0, 0)); ! tree delta2 = DELTA2_FROM_PTRMEMFUNC (function); ! tree e2; ! tree e3; ! tree aref, vtbl; ! tree instance; tree instance_ptr = *instance_ptrptr; --- 2305,2311 ---- if (TYPE_PTRMEMFUNC_P (TREE_TYPE (function))) { ! tree fntype, index, e1, delta, delta2, e2, e3, aref, vtbl; tree instance; + tree instance_ptr = *instance_ptrptr; *************** *** 2292,2295 **** --- 2313,2329 ---- instance_ptr = save_expr (instance_ptr); + if (TREE_SIDE_EFFECTS (function)) + function = save_expr (function); + + fntype = TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (function)); + index = save_expr (build_component_ref (function, + index_identifier, + 0, 0)); + e1 = build (GT_EXPR, boolean_type_node, index, + convert (delta_type_node, integer_zero_node)); + delta = convert (ptrdiff_type_node, + build_component_ref (function, delta_identifier, 0, 0)); + delta2 = DELTA2_FROM_PTRMEMFUNC (function); + /* convert down to the right base, before using the instance. */ instance *************** *** 4409,4417 **** else targ = build_cplus_new (TREE_TYPE (arg), arg, 1); ! return build1 (ADDR_EXPR, TYPE_POINTER_TO (TREE_TYPE (arg)), targ); } if (TREE_CODE (arg) == SAVE_EXPR && TREE_CODE (targ) == INDIRECT_REF) ! return build (SAVE_EXPR, TYPE_POINTER_TO (TREE_TYPE (arg)), TREE_OPERAND (targ, 0), current_function_decl, NULL); --- 4443,4451 ---- else targ = build_cplus_new (TREE_TYPE (arg), arg, 1); ! return build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (arg)), targ); } if (TREE_CODE (arg) == SAVE_EXPR && TREE_CODE (targ) == INDIRECT_REF) ! return build (SAVE_EXPR, build_pointer_type (TREE_TYPE (arg)), TREE_OPERAND (targ, 0), current_function_decl, NULL); *************** *** 4516,4519 **** --- 4550,4555 ---- TREE_USED (x) = 1; TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1; + if (asm_out_file) + assemble_external (x); return 1; *************** *** 4560,4564 **** } ! ifexp = truthvalue_conversion (ifexp); if (TREE_CODE (ifexp) == ERROR_MARK) --- 4596,4600 ---- } ! ifexp = convert (boolean_type_node, ifexp); if (TREE_CODE (ifexp) == ERROR_MARK) *************** *** 4747,4751 **** type1, type2, result_type); ! result_type = TYPE_POINTER_TO (result_type); } } --- 4783,4787 ---- type1, type2, result_type); ! result_type = build_pointer_type (result_type); } } *************** *** 5016,5019 **** --- 5052,5058 ---- tree t1, t2; + if (type == error_mark_node || expr == error_mark_node) + return error_mark_node; + if (TYPE_PTRMEMFUNC_P (type)) type = TYPE_PTRMEMFUNC_FN_TYPE (type); *************** *** 5234,5242 **** Also, pedantically, don't let (void *) (FOO *) 0 be a null pointer constant. */ ! if (value == expr ! || (pedantic ! && TREE_CODE (value) == INTEGER_CST ! && TREE_CODE (expr) == INTEGER_CST ! && TREE_CODE (TREE_TYPE (expr)) != INTEGER_TYPE)) value = non_lvalue (value); --- 5273,5282 ---- Also, pedantically, don't let (void *) (FOO *) 0 be a null pointer constant. */ ! if (TREE_CODE (type) != REFERENCE_TYPE ! && (value == expr ! || (pedantic ! && TREE_CODE (value) == INTEGER_CST ! && TREE_CODE (expr) == INTEGER_CST ! && TREE_CODE (TREE_TYPE (expr)) != INTEGER_TYPE))) value = non_lvalue (value); *************** *** 5671,5675 **** /* Do the default thing */; else if (! TYPE_HAS_CONSTRUCTOR (lhstype)) ! cp_error ("`%T' has no constructors", lhstype); else if (TYPE_HAS_TRIVIAL_INIT_REF (lhstype) && TYPE_MAIN_VARIANT (lhstype) == TYPE_MAIN_VARIANT (TREE_TYPE (newrhs))) --- 5711,5718 ---- /* Do the default thing */; else if (! TYPE_HAS_CONSTRUCTOR (lhstype)) ! { ! cp_error ("`%T' has no constructors", lhstype); ! return error_mark_node; ! } else if (TYPE_HAS_TRIVIAL_INIT_REF (lhstype) && TYPE_MAIN_VARIANT (lhstype) == TYPE_MAIN_VARIANT (TREE_TYPE (newrhs))) *************** *** 5692,5696 **** /* Do the default thing */; else if (! TYPE_HAS_ASSIGNMENT (lhstype)) ! cp_error ("`%T' does not define operator=", lhstype); else if (TYPE_HAS_TRIVIAL_ASSIGN_REF (lhstype) && TYPE_MAIN_VARIANT (lhstype) == TYPE_MAIN_VARIANT (TREE_TYPE (newrhs))) --- 5735,5742 ---- /* Do the default thing */; else if (! TYPE_HAS_ASSIGNMENT (lhstype)) ! { ! cp_error ("`%T' does not define operator=", lhstype); ! return error_mark_node; ! } else if (TYPE_HAS_TRIVIAL_ASSIGN_REF (lhstype) && TYPE_MAIN_VARIANT (lhstype) == TYPE_MAIN_VARIANT (TREE_TYPE (newrhs))) *************** *** 6095,6101 **** /* Can't initialize directly from a TARGET_EXPR, since that would ! cause the lhs to be constructed twice. So we force the ! TARGET_EXPR to be expanded. expand_expr should really do this ! by itself. */ if (TREE_CODE (newrhs) == TARGET_EXPR) newrhs = expand_target_expr (newrhs); --- 6141,6147 ---- /* Can't initialize directly from a TARGET_EXPR, since that would ! cause the lhs to be constructed twice, and possibly result in ! accidental self-initialization. So we force the TARGET_EXPR to be ! expanded. expand_expr should really do this by itself. */ if (TREE_CODE (newrhs) == TARGET_EXPR) newrhs = expand_target_expr (newrhs); *************** *** 6206,6210 **** /* Get difference in deltas for different pointer to member function ! types. Return inetger_zero_node, if FROM cannot be converted to a TO type. If FORCE is true, then allow reverse conversions as well. */ static tree --- 6252,6256 ---- /* Get difference in deltas for different pointer to member function ! types. Return integer_zero_node, if FROM cannot be converted to a TO type. If FORCE is true, then allow reverse conversions as well. */ static tree *************** *** 6346,6349 **** --- 6392,6412 ---- if (integer_zerop (nindex)) pfn = integer_zero_node; + else if (integer_zerop (fold (size_binop (PLUS_EXPR, nindex, integer_one_node)))) + { + tree e3; + delta = get_delta_difference (TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (pfn)))), + TYPE_METHOD_BASETYPE (TREE_TYPE (type)), + force); + delta = build_binary_op (PLUS_EXPR, delta, ndelta, 1); + pfn = build1 (NOP_EXPR, type, npfn); + TREE_CONSTANT (pfn) = TREE_CONSTANT (npfn); + + u = build_nt (CONSTRUCTOR, 0, tree_cons (pfn_identifier, pfn, NULL_TREE)); + u = build_nt (CONSTRUCTOR, 0, tree_cons (NULL_TREE, delta, + tree_cons (NULL_TREE, nindex, + tree_cons (NULL_TREE, u, NULL_TREE)))); + e3 = digest_init (TYPE_GET_PTRMEMFUNC_TYPE (type), u, (tree*)0); + return e3; + } else { *************** *** 6616,6620 **** if (ctt < 0) cp_pedwarn ("converting `%T' to `%T' is a contravariance violation", ! ttr, ttl); if (TYPE_MAIN_VARIANT (ttl) != void_type_node --- 6679,6683 ---- if (ctt < 0) cp_pedwarn ("converting `%T' to `%T' is a contravariance violation", ! rhstype, type); if (TYPE_MAIN_VARIANT (ttl) != void_type_node *************** *** 7381,7384 **** --- 7444,7452 ---- store_expr (result, original_result_rtx, 0); expand_cleanups_to (NULL_TREE); + use_variable (DECL_RTL (result)); + if (ctor_label && TREE_CODE (ctor_label) != ERROR_MARK) + expand_goto (ctor_label); + else + expand_null_return (); } else if (retval && retval != result) *************** *** 7401,7410 **** else expand_return (result); - - use_variable (DECL_RTL (result)); - if (ctor_label && TREE_CODE (ctor_label) != ERROR_MARK) - expand_goto (ctor_label); - else - expand_null_return (); } else --- 7469,7472 ---- *************** *** 7523,7535 **** return 0; ! if (TYPE_READONLY (from) > TYPE_READONLY (to) ! || TYPE_VOLATILE (from) > TYPE_VOLATILE (to)) ! return 0; ! if (! constp ! && (TYPE_READONLY (to) > TYPE_READONLY (from) ! || TYPE_VOLATILE (to) > TYPE_READONLY (from))) ! return 0; ! constp &= TYPE_READONLY (to); if (TREE_CODE (to) != POINTER_TYPE) --- 7585,7602 ---- return 0; ! /* Const and volatile mean something different for function types, ! so the usual checks are not appropriate. */ ! if (TREE_CODE (to) != FUNCTION_TYPE && TREE_CODE (to) != METHOD_TYPE) ! { ! if (TYPE_READONLY (from) > TYPE_READONLY (to) ! || TYPE_VOLATILE (from) > TYPE_VOLATILE (to)) ! return 0; ! if (! constp ! && (TYPE_READONLY (to) > TYPE_READONLY (from) ! || TYPE_VOLATILE (to) > TYPE_READONLY (from))) ! return 0; ! constp &= TYPE_READONLY (to); ! } if (TREE_CODE (to) != POINTER_TYPE) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/typeck2.c gcc-2.7.1/cp/typeck2.c *** gcc-2.7.0/cp/typeck2.c Thu Jun 15 08:31:22 1995 --- gcc-2.7.1/cp/typeck2.c Wed Oct 11 22:32:11 1995 *************** *** 885,891 **** if (code == ARRAY_TYPE || code == RECORD_TYPE || code == UNION_TYPE) { ! if (raw_constructor) return process_init_constructor (type, init, (tree *)0); ! else if (TYPE_NEEDS_CONSTRUCTING (type)) { /* This can only be reached when caller is initializing --- 885,897 ---- if (code == ARRAY_TYPE || code == RECORD_TYPE || code == UNION_TYPE) { ! if (raw_constructor && TYPE_NON_AGGREGATE_CLASS (type)) ! { ! cp_error ("subobject of type `%T' must be initialized by constructor, not by `%E'", ! type, init); ! return error_mark_node; ! } ! else if (raw_constructor) return process_init_constructor (type, init, (tree *)0); ! else if (TYPE_NON_AGGREGATE_CLASS (type)) { /* This can only be reached when caller is initializing diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cp/xref.c gcc-2.7.1/cp/xref.c *** gcc-2.7.0/cp/xref.c Thu Jun 15 08:31:53 1995 --- gcc-2.7.1/cp/xref.c Thu Jun 22 19:32:40 1995 *************** *** 1,4 **** /* Code for handling XREF output from GNU C++. ! Copyright (C) 1992, 1993 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) --- 1,4 ---- /* Code for handling XREF output from GNU C++. ! Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cplus-dem.c gcc-2.7.1/cplus-dem.c *** gcc-2.7.0/cplus-dem.c Thu Jun 15 07:22:07 1995 --- gcc-2.7.1/cplus-dem.c Mon Aug 28 06:22:35 1995 *************** *** 1185,1189 **** success, or the first unconsumed token on failure. ! If the constRUCTOR or DESTRUCTOR flags are set in WORK, then we are demangling a constructor or destructor. In this case we prepend "class::class" or "class::~class" to DECLP. --- 1185,1189 ---- success, or the first unconsumed token on failure. ! If the CONSTRUCTOR or DESTRUCTOR flags are set in WORK, then we are demangling a constructor or destructor. In this case we prepend "class::class" or "class::~class" to DECLP. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cpp.texi gcc-2.7.1/cpp.texi *** gcc-2.7.0/cpp.texi Wed Jun 14 16:22:28 1995 --- gcc-2.7.1/cpp.texi Fri Oct 6 13:45:02 1995 *************** *** 2478,2482 **** After the file name comes zero or more flags, which are @samp{1}, ! @samp{2} or @samp{3}. If there are multiple flags, spaces separate them. Here is what the flags mean: --- 2478,2482 ---- After the file name comes zero or more flags, which are @samp{1}, ! @samp{2}, @samp{3}, or @samp{4}. If there are multiple flags, spaces separate them. Here is what the flags mean: *************** *** 2489,2492 **** --- 2489,2495 ---- This indicates that the following text comes from a system header file, so certain warnings should be suppressed. + @item 4 + This indicates that the following text should be treated as C. + @c maybe cross reference NO_IMPLICIT_EXTERN_C @end table *************** *** 2800,2803 **** --- 2803,2807 ---- @item -lang-c + @itemx -lang-c89 @itemx -lang-c++ @itemx -lang-objc *************** *** 2804,2819 **** @itemx -lang-objc++ @findex -lang-c @findex -lang-c++ @findex -lang-objc @findex -lang-objc++ ! Specify the source language. @samp{-lang-c++} makes the preprocessor ! handle C++ comment syntax (comments may begin with @samp{//}, in which ! case they end at end of line), and includes extra default include ! directories for C++; and @samp{-lang-objc} enables the Objective C ! @samp{#import} directive. @samp{-lang-c} explicitly turns off both of ! these extensions, and @samp{-lang-objc++} enables both. These options are generated by the compiler driver @code{gcc}, but not ! passed from the @samp{gcc} command line. @item -lint --- 2808,2828 ---- @itemx -lang-objc++ @findex -lang-c + @findex -lang-c89 @findex -lang-c++ @findex -lang-objc @findex -lang-objc++ ! Specify the source language. @samp{-lang-c} is the default; it ! allows recognition of C++ comments (comments that begin with ! @samp{//} and end at end of line), since this is ! a common feature and it will most likely be in the next C standard. ! @samp{-lang-c89} disables recognition of C++ comments. @samp{-lang-c++} ! handles C++ comment syntax and includes extra default include ! directories for C++. @samp{-lang-objc} enables the Objective C ! @samp{#import} directive. @samp{-lang-objc++} enables both C++ and Objective C ! extensions. These options are generated by the compiler driver @code{gcc}, but not ! passed from the @samp{gcc} command line unless you use the driver's ! @samp{-Wp} option. @item -lint diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cppexp.c gcc-2.7.1/cppexp.c *** gcc-2.7.0/cppexp.c Thu Jun 15 07:23:32 1995 --- gcc-2.7.1/cppexp.c Tue Nov 7 09:57:44 1995 *************** *** 358,366 **** max_chars = MAX_LONG_TYPE_SIZE / width; ! while (1) { - if (ptr >= CPP_PWRITTEN (pfile) || (c = *ptr++) == '\'') - break; - if (c == '\\') { --- 358,364 ---- max_chars = MAX_LONG_TYPE_SIZE / width; ! ++ptr; ! while (ptr < tok_end && ((c = *ptr++) != '\'')) { if (c == '\\') { diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cpphash.h gcc-2.7.1/cpphash.h *** gcc-2.7.0/cpphash.h Sat Jan 7 17:05:58 1995 --- gcc-2.7.1/cpphash.h Wed Jul 5 02:43:01 1995 *************** *** 1,4 **** - enum node_type; - /* different kinds of things that can appear in the value field of a hash node. Actually, this may be useless now. */ --- 1,2 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cpplib.c gcc-2.7.1/cpplib.c *** gcc-2.7.0/cpplib.c Thu Jun 15 07:24:38 1995 --- gcc-2.7.1/cpplib.c Sat Nov 4 10:43:48 1995 *************** *** 240,247 **** } while(0) - /* Name under which this program was invoked. */ - - char *progname; - struct cpp_pending { struct cpp_pending *next; --- 240,243 ---- *************** *** 2115,2120 **** cpp_buffer *ip = CPP_BUFFER (pfile); ! if (CPP_OPTIONS (pfile)->no_line_commands ! || ip->fname == NULL || CPP_OPTIONS (pfile)->no_output) { return; } --- 2111,2115 ---- cpp_buffer *ip = CPP_BUFFER (pfile); ! if (ip->fname == NULL || CPP_OPTIONS (pfile)->no_output) { return; } *************** *** 2125,2128 **** --- 2120,2126 ---- adjust_position (CPP_LINE_BASE (ip), ip->cur, &line, &col); + if (CPP_OPTIONS (pfile)->no_line_commands) + return; + if (conditional) { if (line == pfile->lineno) *************** *** 5659,5662 **** --- 5657,5661 ---- fp->buf = (U_CHAR *) xrealloc (fp->buf, bsize + 2); } + fp->cur = fp->buf; length = st_size; } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cppmain.c gcc-2.7.1/cppmain.c *** gcc-2.7.0/cppmain.c Thu Jun 15 07:25:35 1995 --- gcc-2.7.1/cppmain.c Sat Nov 4 10:31:26 1995 *************** *** 30,33 **** --- 30,35 ---- extern char *getenv (); + char *progname; + cpp_reader parse_in; cpp_options options; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/cse.c gcc-2.7.1/cse.c *** gcc-2.7.0/cse.c Thu Jun 15 07:26:31 1995 --- gcc-2.7.1/cse.c Sun Nov 5 11:01:11 1995 *************** *** 344,347 **** --- 344,352 ---- static int cse_jumps_altered; + /* Nonzero if we put a LABEL_REF into the hash table. Since we may have put + it into an INSN without a REG_LABEL, we have to rerun jump after CSE + to put in the note. */ + static int recorded_label_ref; + /* canon_hash stores 1 in do_not_record if it notices a reference to CC0, PC, or some other volatile *************** *** 1288,1291 **** --- 1293,1301 ---- } + /* If X is a label, show we recorded it. */ + if (GET_CODE (x) == LABEL_REF + || (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS + && GET_CODE (XEXP (XEXP (x, 0), 0)) == LABEL_REF)) + recorded_label_ref = 1; /* Put an element for X into the right hash bucket. */ *************** *** 1527,1531 **** if (regno >= FIRST_PSEUDO_REGISTER) ! remove_from_table (lookup_for_remove (x, hash, GET_MODE (x)), hash); else { --- 1537,1549 ---- if (regno >= FIRST_PSEUDO_REGISTER) ! { ! /* Because a register can be referenced in more than one mode, ! we might have to remove more than one table entry. */ ! ! struct table_elt *elt; ! ! while (elt = lookup_for_remove (x, hash, GET_MODE (x))) ! remove_from_table (elt, hash); ! } else { *************** *** 1898,1906 **** the integers representing the constant. */ hash += (unsigned) code + (unsigned) GET_MODE (x); ! for (i = 2; i < GET_RTX_LENGTH (CONST_DOUBLE); i++) ! { ! unsigned tem = XINT (x, i); ! hash += tem; ! } return hash; --- 1916,1928 ---- the integers representing the constant. */ hash += (unsigned) code + (unsigned) GET_MODE (x); ! if (GET_MODE (x) != VOIDmode) ! for (i = 2; i < GET_RTX_LENGTH (CONST_DOUBLE); i++) ! { ! unsigned tem = XINT (x, i); ! hash += tem; ! } ! else ! hash += ((unsigned) CONST_DOUBLE_LOW (x) ! + (unsigned) CONST_DOUBLE_HIGH (x)); return hash; *************** *** 2270,2273 **** --- 2292,2326 ---- base = qty_const[reg_qty[REGNO (XEXP (base, 0))]]; } + /* This can happen as the result of virtual register instantiation, + if the initial offset is too large to be a valid address. */ + else if (GET_CODE (base) == PLUS + && GET_CODE (XEXP (base, 0)) == REG + && GET_CODE (XEXP (base, 1)) == REG + && qty_const != 0 + && REGNO_QTY_VALID_P (REGNO (XEXP (base, 0))) + && (qty_mode[reg_qty[REGNO (XEXP (base, 0))]] + == GET_MODE (XEXP (base, 0))) + && qty_const[reg_qty[REGNO (XEXP (base, 0))]] + && REGNO_QTY_VALID_P (REGNO (XEXP (base, 1))) + && (qty_mode[reg_qty[REGNO (XEXP (base, 1))]] + == GET_MODE (XEXP (base, 1))) + && qty_const[reg_qty[REGNO (XEXP (base, 1))]]) + { + rtx tem = qty_const[reg_qty[REGNO (XEXP (base, 1))]]; + base = qty_const[reg_qty[REGNO (XEXP (base, 0))]]; + + /* One of the two values must be a constant. */ + if (GET_CODE (base) != CONST_INT) + { + if (GET_CODE (tem) != CONST_INT) + abort (); + start = INTVAL (tem); + } + else + { + start = INTVAL (base); + base = tem; + } + } /* Handle everything that we can find inside an address that has been *************** *** 2316,2320 **** size = *pend - *pstart - INTVAL (XEXP (base, 1)) - 1; ! start += *pstart - INTVAL (XEXP (base, 1)) - 1; base = *pbase; } --- 2369,2374 ---- size = *pend - *pstart - INTVAL (XEXP (base, 1)) - 1; ! start += *pstart + INTVAL (XEXP (base, 1)) + 1; ! end += *pend; base = *pbase; } *************** *** 2440,2443 **** --- 2494,2516 ---- return 0; + /* This can happen as the result of virtual register instantiation, if + the initial constant is too large to be a valid address. This gives + us a three instruction sequence, load large offset into a register, + load fp minus a constant into a register, then a MEM which is the + sum of the two `constant' registers. */ + if (GET_CODE (x) == MEM + && GET_CODE (XEXP (x, 0)) == PLUS + && GET_CODE (XEXP (XEXP (x, 0), 0)) == REG + && GET_CODE (XEXP (XEXP (x, 0), 1)) == REG + && REGNO_QTY_VALID_P (REGNO (XEXP (XEXP (x, 0), 0))) + && (GET_MODE (XEXP (XEXP (x, 0), 0)) + == qty_mode[reg_qty[REGNO (XEXP (XEXP (x, 0), 0))]]) + && qty_const[reg_qty[REGNO (XEXP (XEXP (x, 0), 0))]] + && REGNO_QTY_VALID_P (REGNO (XEXP (XEXP (x, 0), 1))) + && (GET_MODE (XEXP (XEXP (x, 0), 1)) + == qty_mode[reg_qty[REGNO (XEXP (XEXP (x, 0), 1))]]) + && qty_const[reg_qty[REGNO (XEXP (XEXP (x, 0), 1))]]) + return 0; + return rtx_addr_varies_p (x); } *************** *** 6318,6321 **** --- 6391,6401 ---- src_folded = fold_rtx (src, insn); + #if 0 + /* ??? This caused bad code to be generated for the m68k port with -O2. + Suppose src is (CONST_INT -1), and that after truncation src_folded + is (CONST_INT 3). Suppose src_folded is then used for src_const. + At the end we will add src and src_const to the same equivalence + class. We now have 3 and -1 on the same equivalence class. This + causes later instructions to be mis-optimized. */ /* If storing a constant in a bitfield, pre-truncate the constant so we will be able to record it later. */ *************** *** 6333,6336 **** --- 6413,6417 ---- << INTVAL (width)) - 1)); } + #endif /* Compute SRC's hash code, and also notice if it *************** *** 7410,7413 **** --- 7491,7500 ---- REG_NOTES (prev) = note; } + + /* If INSN has a REG_EQUAL note, and this note mentions REG0, + then we must delete it, because the value in REG0 has changed. */ + note = find_reg_note (insn, REG_EQUAL, NULL_RTX); + if (note && reg_mentioned_p (dest, XEXP (note, 0))) + remove_note (insn, note); } } *************** *** 8140,8143 **** --- 8227,8231 ---- cse_jumps_altered = 0; + recorded_label_ref = 0; constant_pool_entries_cost = 0; val.path_size = 0; *************** *** 8295,8299 **** max_elements_made = n_elements_made; ! return cse_jumps_altered; } --- 8383,8387 ---- max_elements_made = n_elements_made; ! return cse_jumps_altered || recorded_label_ref; } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/dwarfout.c gcc-2.7.1/dwarfout.c *** gcc-2.7.0/dwarfout.c Thu Jun 15 07:28:59 1995 --- gcc-2.7.1/dwarfout.c Thu Oct 26 21:40:07 1995 *************** *** 1,4 **** /* Output Dwarf format symbol table information from the GNU C compiler. ! Copyright (C) 1992, 1993 Free Software Foundation, Inc. Written by Ron Guilmette (rfg@netcom.com) for --- 1,4 ---- /* Output Dwarf format symbol table information from the GNU C compiler. ! Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc. Written by Ron Guilmette (rfg@netcom.com) for *************** *** 3464,3467 **** --- 3464,3469 ---- else if (strcmp (language_string, "GNU Ada") == 0) language_attribute (LANG_ADA83); + else if (strcmp (language_string, "GNU F77") == 0) + language_attribute (LANG_FORTRAN77); else if (flag_traditional) language_attribute (LANG_C); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/emit-rtl.c gcc-2.7.1/emit-rtl.c *** gcc-2.7.0/emit-rtl.c Thu Jun 15 07:29:36 1995 --- gcc-2.7.1/emit-rtl.c Thu Sep 14 16:09:30 1995 *************** *** 858,861 **** --- 858,868 ---- if (result) return result; + else if (GET_CODE (x) == REG) + { + /* Must be a hard reg that's not valid in MODE. */ + result = gen_lowpart_common (mode, copy_to_reg (x)); + if (result == 0) + abort (); + } else if (GET_CODE (x) == MEM) { diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/expmed.c gcc-2.7.1/expmed.c *** gcc-2.7.0/expmed.c Thu Jun 15 07:30:40 1995 --- gcc-2.7.1/expmed.c Thu Jul 13 19:25:37 1995 *************** *** 1738,1742 **** op1 = expand_expr (amount, NULL_RTX, VOIDmode, 0); ! #if SHIFT_COUNT_TRUNCATED if (SHIFT_COUNT_TRUNCATED && GET_CODE (op1) == CONST_INT --- 1738,1742 ---- op1 = expand_expr (amount, NULL_RTX, VOIDmode, 0); ! #ifdef SHIFT_COUNT_TRUNCATED if (SHIFT_COUNT_TRUNCATED && GET_CODE (op1) == CONST_INT diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/expr.c gcc-2.7.1/expr.c *** gcc-2.7.0/expr.c Thu Jun 15 07:31:31 1995 --- gcc-2.7.1/expr.c Thu Nov 9 11:00:35 1995 *************** *** 1834,1838 **** clear_storage (object, size) rtx object; ! int size; { if (GET_MODE (object) == BLKmode) --- 1834,1838 ---- clear_storage (object, size) rtx object; ! rtx size; { if (GET_MODE (object) == BLKmode) *************** *** 1842,1851 **** VOIDmode, 3, XEXP (object, 0), Pmode, const0_rtx, ptr_mode, ! GEN_INT (size), ptr_mode); #else emit_library_call (bzero_libfunc, 0, VOIDmode, 2, ! XEXP (object, 0), Pmode, ! GEN_INT (size), ptr_mode); #endif } --- 1842,1855 ---- VOIDmode, 3, XEXP (object, 0), Pmode, const0_rtx, ptr_mode, ! convert_to_mode (TYPE_MODE (sizetype), ! size, TREE_UNSIGNED (sizetype)), ! TYPE_MODE (sizetype)); #else emit_library_call (bzero_libfunc, 0, VOIDmode, 2, ! XEXP (object, 0), Pmode, ! convert_to_mode (TYPE_MODE (sizetype), ! size, TREE_UNSIGNED (sizetype)), ! TYPE_MODE (sizetype)); #endif } *************** *** 1983,1986 **** --- 1987,1993 ---- #endif + /* Show the output dies here. */ + emit_insn (gen_rtx (CLOBBER, VOIDmode, x)); + for (i = 0; i < (GET_MODE_SIZE (mode) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD; *************** *** 2710,2713 **** --- 2717,2721 ---- target = protect_from_queue (target, 1); + do_pending_stack_adjust (); NO_DEFER_POP; jumpifnot (TREE_OPERAND (exp, 0), lab1); *************** *** 2785,2790 **** /* If TEMP is a volatile MEM and we want a result value, make ! the access now so it gets done only once. */ ! if (GET_CODE (temp) == MEM && MEM_VOLATILE_P (temp) && want_value) temp = copy_to_reg (temp); --- 2793,2801 ---- /* If TEMP is a volatile MEM and we want a result value, make ! the access now so it gets done only once. Likewise if ! it contains TARGET. */ ! if (GET_CODE (temp) == MEM && want_value ! && (MEM_VOLATILE_P (temp) ! || reg_mentioned_p (SUBREG_REG (target), XEXP (temp, 0)))) temp = copy_to_reg (temp); *************** *** 2996,3000 **** else if (list_length (CONSTRUCTOR_ELTS (exp)) != list_length (TYPE_FIELDS (type))) ! clear_storage (target, int_size_in_bytes (type)); else /* Inform later passes that the old value is dead. */ --- 3007,3011 ---- else if (list_length (CONSTRUCTOR_ELTS (exp)) != list_length (TYPE_FIELDS (type))) ! clear_storage (target, expr_size (exp)); else /* Inform later passes that the old value is dead. */ *************** *** 3082,3086 **** if (list_length (CONSTRUCTOR_ELTS (exp)) < maxelt - minelt + 1 || (GET_CODE (target) == REG && TREE_STATIC (exp))) ! clear_storage (target, int_size_in_bytes (type)); else /* Inform later passes that the old value is dead. */ --- 3093,3097 ---- if (list_length (CONSTRUCTOR_ELTS (exp)) < maxelt - minelt + 1 || (GET_CODE (target) == REG && TREE_STATIC (exp))) ! clear_storage (target, expr_size (exp)); else /* Inform later passes that the old value is dead. */ *************** *** 3164,3168 **** if (CONSTRUCTOR_ELTS (exp) == NULL_TREE) { ! clear_storage (target, nbytes); return; } --- 3175,3179 ---- if (CONSTRUCTOR_ELTS (exp) == NULL_TREE) { ! clear_storage (target, expr_size (exp)); return; } *************** *** 3169,3173 **** if (nbytes < 0) ! abort(); domain_min = convert (sizetype, TYPE_MIN_VALUE (domain)); --- 3180,3184 ---- if (nbytes < 0) ! abort (); domain_min = convert (sizetype, TYPE_MIN_VALUE (domain)); *************** *** 3286,3290 **** if (need_to_clear_first && endb - startb != nbytes * BITS_PER_UNIT) ! clear_storage (target, nbytes); need_to_clear_first = 0; emit_library_call (memset_libfunc, 0, --- 3297,3301 ---- if (need_to_clear_first && endb - startb != nbytes * BITS_PER_UNIT) ! clear_storage (target, expr_size (exp)); need_to_clear_first = 0; emit_library_call (memset_libfunc, 0, *************** *** 3301,3305 **** if (need_to_clear_first) { ! clear_storage (target, nbytes); need_to_clear_first = 0; } --- 3312,3316 ---- if (need_to_clear_first) { ! clear_storage (target, expr_size (exp)); need_to_clear_first = 0; } *************** *** 3609,3615 **** index = fold (build (MINUS_EXPR, index_type, index, low_bound)); ! if (TYPE_PRECISION (index_type) != POINTER_SIZE) { ! index = convert (type_for_size (POINTER_SIZE, 0), index); index_type = TREE_TYPE (index); } --- 3620,3627 ---- index = fold (build (MINUS_EXPR, index_type, index, low_bound)); ! if (TYPE_PRECISION (index_type) != TYPE_PRECISION (sizetype)) { ! index = convert (type_for_size (TYPE_PRECISION (sizetype), 0), ! index); index_type = TREE_TYPE (index); } *************** *** 3814,3820 **** have no way of allocating temporaries of variable size. So we assume here that something at a higher level has prevented a ! clash. This is somewhat bogus, but the best we can do. */ || (TREE_TYPE (exp) != 0 && TYPE_SIZE (TREE_TYPE (exp)) != 0 ! && TREE_CODE (TYPE_SIZE (TREE_TYPE (exp))) != INTEGER_CST)) return 1; --- 3826,3834 ---- have no way of allocating temporaries of variable size. So we assume here that something at a higher level has prevented a ! clash. This is somewhat bogus, but the best we can do. Only ! do this when X is BLKmode. */ || (TREE_TYPE (exp) != 0 && TYPE_SIZE (TREE_TYPE (exp)) != 0 ! && TREE_CODE (TYPE_SIZE (TREE_TYPE (exp))) != INTEGER_CST ! && GET_MODE (x) == BLKmode)) return 1; *************** *** 3893,3901 **** case RTL_EXPR: ! exp_rtl = RTL_EXPR_RTL (exp); ! if (exp_rtl == 0) ! /* We don't know what this can modify. */ return 0; break; --- 3907,3917 ---- case RTL_EXPR: ! /* If a sequence exists, we would have to scan every instruction ! in the sequence to see if it was safe. This is probably not ! worthwhile. */ ! if (RTL_EXPR_SEQUENCE (exp)) return 0; + exp_rtl = RTL_EXPR_RTL (exp); break; *************** *** 4623,4630 **** tree size = size_in_bytes (type); ! /* Convert the integer argument to a type the same size as a ! pointer so the multiply won't overflow spuriously. */ ! if (TYPE_PRECISION (index_type) != POINTER_SIZE) ! index = convert (type_for_size (POINTER_SIZE, 0), index); if (TREE_CODE (size) != INTEGER_CST --- 4639,4647 ---- tree size = size_in_bytes (type); ! /* Convert the integer argument to a type the same size as sizetype ! so the multiply won't overflow spuriously. */ ! if (TYPE_PRECISION (index_type) != TYPE_PRECISION (sizetype)) ! index = convert (type_for_size (TYPE_PRECISION (sizetype), 0), ! index); if (TREE_CODE (size) != INTEGER_CST *************** *** 4639,4649 **** TREE_SIDE_EFFECTS (array_adr) = 0; ! elt = build1 (INDIRECT_REF, type, ! fold (build (PLUS_EXPR, ! TYPE_POINTER_TO (variant_type), ! array_adr, ! fold (build (MULT_EXPR, ! TYPE_POINTER_TO (variant_type), ! index, size))))); /* Volatility, etc., of new expression is same as old --- 4656,4673 ---- TREE_SIDE_EFFECTS (array_adr) = 0; ! elt ! = build1 ! (INDIRECT_REF, type, ! fold (build (PLUS_EXPR, ! TYPE_POINTER_TO (variant_type), ! array_adr, ! fold ! (build1 ! (NOP_EXPR, ! TYPE_POINTER_TO (variant_type), ! fold (build (MULT_EXPR, TREE_TYPE (index), ! index, ! convert (TREE_TYPE (index), ! size))))))));; /* Volatility, etc., of new expression is same as old *************** *** 4757,4762 **** /* In some cases, we will be offsetting OP0's address by a constant. So get it as a sum, if possible. If we will be using it ! directly in an insn, we validate it. */ ! op0 = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_SUM); /* If this is a constant, put it into a register if it is a --- 4781,4796 ---- /* In some cases, we will be offsetting OP0's address by a constant. So get it as a sum, if possible. If we will be using it ! directly in an insn, we validate it. ! ! If TEM's type is a union of variable size, pass TARGET to the inner ! computation, since it will need a temporary and TARGET is known ! to have to do. This occurs in unchecked conversion in Ada. */ ! ! op0 = expand_expr (tem, ! (TREE_CODE (TREE_TYPE (tem)) == UNION_TYPE ! && (TREE_CODE (TYPE_SIZE (TREE_TYPE (tem))) ! != INTEGER_CST) ! ? target : NULL_RTX), ! VOIDmode, EXPAND_SUM); /* If this is a constant, put it into a register if it is a *************** *** 5824,5827 **** --- 5858,5862 ---- } + do_pending_stack_adjust (); NO_DEFER_POP; op0 = gen_label_rtx (); *************** *** 6014,6017 **** --- 6049,6053 ---- RTL_EXPR_RTL (cond) = flag; RTL_EXPR_SEQUENCE (cond) = NULL_RTX; + cond = save_expr (cond); if (! left_cleanups) *************** *** 6051,6054 **** --- 6087,6093 ---- abort (); + if (! ignore) + target = original_target; + if (target == 0) { *************** *** 7111,7114 **** --- 7150,7205 ---- return size_int (strlen (ptr + offset)); } + + rtx + expand_builtin_return_addr (fndecl_code, count, tem) + enum built_in_function fndecl_code; + rtx tem; + int count; + { + int i; + + /* Some machines need special handling before we can access + arbitrary frames. For example, on the sparc, we must first flush + all register windows to the stack. */ + #ifdef SETUP_FRAME_ADDRESSES + SETUP_FRAME_ADDRESSES (); + #endif + + /* On the sparc, the return address is not in the frame, it is in a + register. There is no way to access it off of the current frame + pointer, but it can be accessed off the previous frame pointer by + reading the value from the register window save area. */ + #ifdef RETURN_ADDR_IN_PREVIOUS_FRAME + if (fndecl_code == BUILT_IN_RETURN_ADDRESS) + count--; + #endif + + /* Scan back COUNT frames to the specified frame. */ + for (i = 0; i < count; i++) + { + /* Assume the dynamic chain pointer is in the word that the + frame address points to, unless otherwise specified. */ + #ifdef DYNAMIC_CHAIN_ADDRESS + tem = DYNAMIC_CHAIN_ADDRESS (tem); + #endif + tem = memory_address (Pmode, tem); + tem = copy_to_reg (gen_rtx (MEM, Pmode, tem)); + } + + /* For __builtin_frame_address, return what we've got. */ + if (fndecl_code == BUILT_IN_FRAME_ADDRESS) + return tem; + + /* For __builtin_return_address, Get the return address from that + frame. */ + #ifdef RETURN_ADDR_RTX + tem = RETURN_ADDR_RTX (count, tem); + #else + tem = memory_address (Pmode, + plus_constant (tem, GET_MODE_SIZE (Pmode))); + tem = gen_rtx (MEM, Pmode, tem); + #endif + return tem; + } /* Expand an expression EXP that calls a built-in function, *************** *** 7552,7588 **** else { ! int count = TREE_INT_CST_LOW (TREE_VALUE (arglist)); ! rtx tem = frame_pointer_rtx; ! int i; ! ! /* Some machines need special handling before we can access arbitrary ! frames. For example, on the sparc, we must first flush all ! register windows to the stack. */ ! #ifdef SETUP_FRAME_ADDRESSES ! SETUP_FRAME_ADDRESSES (); ! #endif - /* On the sparc, the return address is not in the frame, it is - in a register. There is no way to access it off of the current - frame pointer, but it can be accessed off the previous frame - pointer by reading the value from the register window save - area. */ - #ifdef RETURN_ADDR_IN_PREVIOUS_FRAME - if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_RETURN_ADDRESS) - count--; - #endif - - /* Scan back COUNT frames to the specified frame. */ - for (i = 0; i < count; i++) - { - /* Assume the dynamic chain pointer is in the word that - the frame address points to, unless otherwise specified. */ - #ifdef DYNAMIC_CHAIN_ADDRESS - tem = DYNAMIC_CHAIN_ADDRESS (tem); - #endif - tem = memory_address (Pmode, tem); - tem = copy_to_reg (gen_rtx (MEM, Pmode, tem)); - } - /* For __builtin_frame_address, return what we've got. */ if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) --- 7643,7650 ---- else { ! rtx tem = expand_builtin_return_addr (DECL_FUNCTION_CODE (fndecl), ! TREE_INT_CST_LOW (TREE_VALUE (arglist)), ! hard_frame_pointer_rtx); /* For __builtin_frame_address, return what we've got. */ if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) *************** *** 7589,7601 **** return tem; ! /* For __builtin_return_address, ! Get the return address from that frame. */ ! #ifdef RETURN_ADDR_RTX ! return RETURN_ADDR_RTX (count, tem); ! #else ! tem = memory_address (Pmode, ! plus_constant (tem, GET_MODE_SIZE (Pmode))); ! return copy_to_reg (gen_rtx (MEM, Pmode, tem)); ! #endif } --- 7651,7657 ---- return tem; ! if (GET_CODE (tem) != REG) ! tem = copy_to_reg (tem); ! return tem; } *************** *** 7777,7784 **** memory_address (BLKmode, dest_rtx)); /* There could be a void* cast on top of the object. */ ! if (TREE_CODE (dest) == NOP_EXPR) ! type = TREE_TYPE (TREE_TYPE (TREE_OPERAND (dest, 0))); ! else ! type = TREE_TYPE (TREE_TYPE (dest)); MEM_IN_STRUCT_P (dest_mem) = AGGREGATE_TYPE_P (type); src_mem = gen_rtx (MEM, BLKmode, --- 7833,7839 ---- memory_address (BLKmode, dest_rtx)); /* There could be a void* cast on top of the object. */ ! while (TREE_CODE (dest) == NOP_EXPR) ! dest = TREE_OPERAND (dest, 0); ! type = TREE_TYPE (TREE_TYPE (dest)); MEM_IN_STRUCT_P (dest_mem) = AGGREGATE_TYPE_P (type); src_mem = gen_rtx (MEM, BLKmode, *************** *** 7788,7795 **** EXPAND_SUM))); /* There could be a void* cast on top of the object. */ ! if (TREE_CODE (src) == NOP_EXPR) ! type = TREE_TYPE (TREE_TYPE (TREE_OPERAND (src, 0))); ! else ! type = TREE_TYPE (TREE_TYPE (src)); MEM_IN_STRUCT_P (src_mem) = AGGREGATE_TYPE_P (type); --- 7843,7849 ---- EXPAND_SUM))); /* There could be a void* cast on top of the object. */ ! while (TREE_CODE (src) == NOP_EXPR) ! src = TREE_OPERAND (src, 0); ! type = TREE_TYPE (TREE_TYPE (src)); MEM_IN_STRUCT_P (src_mem) = AGGREGATE_TYPE_P (type); *************** *** 8660,8663 **** --- 8714,8718 ---- case RTL_EXPR: case WITH_CLEANUP_EXPR: + case CLEANUP_POINT_EXPR: return; *************** *** 8950,8953 **** --- 9005,9009 ---- RTL_EXPR_RTL (cond) = flag; RTL_EXPR_SEQUENCE (cond) = NULL_RTX; + cond = save_expr (cond); new_cleanups = build (COND_EXPR, void_type_node, *************** *** 9007,9010 **** --- 9063,9067 ---- RTL_EXPR_RTL (cond) = flag; RTL_EXPR_SEQUENCE (cond) = NULL_RTX; + cond = save_expr (cond); new_cleanups = build (COND_EXPR, void_type_node, diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/expr.h gcc-2.7.1/expr.h *** gcc-2.7.0/expr.h Thu Jun 15 07:32:10 1995 --- gcc-2.7.1/expr.h Fri Oct 27 06:16:56 1995 *************** *** 1,4 **** /* Definitions for code generation pass of GNU compiler. ! Copyright (C) 1987, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Definitions for code generation pass of GNU compiler. ! Copyright (C) 1987, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 633,637 **** /* Write zeros through the storage of OBJECT. If OBJECT has BLKmode, SIZE is its length in bytes. */ ! extern void clear_storage PROTO((rtx, int)); /* Emit insns to set X from Y. */ --- 633,637 ---- /* Write zeros through the storage of OBJECT. If OBJECT has BLKmode, SIZE is its length in bytes. */ ! extern void clear_storage PROTO((rtx, rtx)); /* Emit insns to set X from Y. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/extend.texi gcc-2.7.1/extend.texi *** gcc-2.7.0/extend.texi Thu Jun 15 17:26:42 1995 --- gcc-2.7.1/extend.texi Sat Sep 2 01:46:47 1995 *************** *** 48,51 **** --- 48,52 ---- or that they can never return. * Function Prototypes:: Prototype declarations and old-style definitions. + * C++ Comments:: C++ comments are recognized. * Dollar Signs:: Dollar sign is allowed in identifiers. * Character Escapes:: @samp{\e} stands for the character @key{ESC}. *************** *** 91,94 **** --- 92,96 ---- or that they can never return. * Function Prototypes:: Prototype declarations and old-style definitions. + * C++ Comments:: C++ comments are recognized. * Dollar Signs:: Dollar sign is allowed in identifiers. * Character Escapes:: @samp{\e} stands for the character @key{ESC}. *************** *** 1579,1582 **** --- 1581,1597 ---- extension is irrelevant. + @node C++ Comments + @section C++ Style Comments + @cindex // + @cindex C++ comments + @cindex comments, C++ style + + In GNU C, you may use C++ style comments, which start with @samp{//} and + continue until the end of the line. Many other C implementations allow + such comments, and they are likely to be in a future C standard. + However, C++ style comments are not recognized if you specify + @w{@samp{-ansi}} or @w{@samp{-traditional}}, since they are incompatible + with traditional constructs like @code{dividend//*comment*/divisor}. + @node Dollar Signs @section Dollar Signs in Identifier Names *************** *** 2612,2615 **** --- 2627,2635 ---- @end smallexample + These names are not macros: they are predefined string variables. + For example, @samp{#ifdef __FUNCTION__} does not have any special + meaning inside a function, since the preprocessor does not do anything + special with the identifier @code{__FUNCTION__}. + @node C++ Extensions @chapter Extensions to the C++ Language *************** *** 2969,2975 **** @end table ! Currently, g++ implements neither automatic model. The g++ team hopes ! to have a repository working for 2.7.0. In the mean time, you have ! three options for dealing with template instantiations: @enumerate --- 2989,2994 ---- @end table ! Currently, g++ implements neither automatic model. In the mean time, ! you have three options for dealing with template instantiations: @enumerate *************** *** 3064,3073 **** type modules in Trellis/Owl, categories in Scratchpad II, and types in POOL-I. For a more detailed discussion of signatures, see ! @cite{Signatures: A C++ Extension for Type Abstraction and Subtype ! Polymorphism} by @w{Gerald} Baumgartner and Vincent F. Russo (Tech report ! CSD--TR--93--059, Dept. of Computer Sciences, Purdue University, ! December 1994, to appear in @emph{Software Practice & Experience}). ! You can get the tech report by anonymous FTP from ! @code{ftp.cs.purdue.edu} in @file{pub/reports/TR93-059.PS.Z}. Syntactically, a signature declaration is a collection of --- 3083,3094 ---- type modules in Trellis/Owl, categories in Scratchpad II, and types in POOL-I. For a more detailed discussion of signatures, see ! @cite{Signatures: A Language Extension for Improving Type Abstraction and ! Subtype Polymorphism in C++} ! by @w{Gerald} Baumgartner and Vincent F. Russo (Tech report ! CSD--TR--95--051, Dept. of Computer Sciences, Purdue University, ! August 1995, a slightly improved version appeared in ! @emph{Software---Practice & Experience}, @b{25}(8), pp. 863--889, ! August 1995). You can get the tech report by anonymous FTP from ! @code{ftp.cs.purdue.edu} in @file{pub/gb/Signature-design.ps.gz}. Syntactically, a signature declaration is a collection of diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/final.c gcc-2.7.1/final.c *** gcc-2.7.0/final.c Thu Jun 15 07:32:51 1995 --- gcc-2.7.1/final.c Thu Oct 26 08:00:41 1995 *************** *** 888,909 **** in the last statement of the preceding function. */ if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED) ! { ! last_linenum = high_block_linenum = high_function_linenum ! = NOTE_LINE_NUMBER (first); ! if (write_symbols == SDB_DEBUG) ! /* For sdb, let's not, but say we did. ! We need to set last_linenum for sdbout_function_begin, ! but we can't have an actual line number before the .bf symbol. ! (sdb_begin_function_line is not set, ! and other compilers don't do it.) */ ! ; #ifdef XCOFF_DEBUGGING_INFO ! else if (write_symbols == XCOFF_DEBUG) ! xcoffout_output_first_source_line (file, last_linenum); #endif ! else output_source_line (file, first); - } #ifdef LEAF_REG_REMAP --- 888,911 ---- in the last statement of the preceding function. */ if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED) ! last_linenum = high_block_linenum = high_function_linenum ! = NOTE_LINE_NUMBER (first); ! /* For SDB and XCOFF, the function beginning must be marked between ! the function label and the prologue. We always need this, even when ! -g1 was used. */ ! #ifdef SDB_DEBUGGING_INFO ! if (write_symbols == SDB_DEBUG) ! sdbout_begin_function (last_linenum); ! else ! #endif #ifdef XCOFF_DEBUGGING_INFO ! if (write_symbols == XCOFF_DEBUG) ! xcoffout_begin_function (file, last_linenum); ! else #endif ! /* But only output line number for other debug info types if -g2 ! or better. */ ! if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED) output_source_line (file, first); #ifdef LEAF_REG_REMAP *************** *** 1313,1325 **** if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG) { - #ifdef SDB_DEBUGGING_INFO - if (write_symbols == SDB_DEBUG) - sdbout_begin_function (last_linenum); - #endif - #ifdef XCOFF_DEBUGGING_INFO - if (write_symbols == XCOFF_DEBUG) - xcoffout_begin_function (file, last_linenum); - #endif #ifdef DWARF_DEBUGGING_INFO if (write_symbols == DWARF_DEBUG) dwarfout_begin_function (); --- 1315,1321 ---- if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG) { #ifdef DWARF_DEBUGGING_INFO + /* This outputs a marker where the function body starts, so it + must be after the prologue. */ if (write_symbols == DWARF_DEBUG) dwarfout_begin_function (); *************** *** 1691,1695 **** for (i = 1; i < XVECLEN (body, 0); i++) ! final_scan_insn (XVECEXP (body, 0, i), file, 0, prescan, 1); #ifdef DBR_OUTPUT_SEQEND DBR_OUTPUT_SEQEND (file); --- 1687,1699 ---- for (i = 1; i < XVECLEN (body, 0); i++) ! { ! rtx insn = XVECEXP (body, 0, i); ! rtx next = NEXT_INSN (insn); ! /* We loop in case any instruction in a delay slot gets ! split. */ ! do ! insn = final_scan_insn (insn, file, 0, prescan, 1); ! while (insn != next); ! } #ifdef DBR_OUTPUT_SEQEND DBR_OUTPUT_SEQEND (file); *************** *** 1806,1809 **** --- 1810,1815 ---- && SET_DEST (body) == pc_rtx && GET_CODE (SET_SRC (body)) == IF_THEN_ELSE + && GET_RTX_CLASS (GET_CODE (XEXP (SET_SRC (body), 0))) == '<' + && XEXP (XEXP (SET_SRC (body), 0), 0) == cc0_rtx /* This is done during prescan; it is not done again in final scan when prescan has been done. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/fix-header.c gcc-2.7.1/fix-header.c *** gcc-2.7.0/fix-header.c Thu Jun 15 07:33:44 1995 --- gcc-2.7.1/fix-header.c Mon Aug 28 06:23:21 1995 *************** *** 17,21 **** /* This program massages a system include file (such as stdio.h), ! into a form more conformant with ANSI/POSIX, and more suitable for C++: * extern "C" { ... } braces are added (inside #ifndef __cplusplus), --- 17,21 ---- /* This program massages a system include file (such as stdio.h), ! into a form more conforming with ANSI/POSIX, and more suitable for C++: * extern "C" { ... } braces are added (inside #ifndef __cplusplus), diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/fixinc-nt.sed gcc-2.7.1/fixinc-nt.sed *** gcc-2.7.0/fixinc-nt.sed --- gcc-2.7.1/fixinc-nt.sed Tue Sep 12 17:15:23 1995 *************** *** 0 **** --- 1,5 ---- + s/!__STDC__/!defined (__STRICT_ANSI__)/g + s/getcwd(char \*, int)/getcwd(char *, size_t)/ + s/Format\[\]/Format\[1\]/ + s/^#if !defined (__cplusplus)/#if 0/ + s/^#define DECLSPEC_IMPORT __declspec(dllimport)/#define DECLSPEC_IMPORT/ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/fixinc.winnt gcc-2.7.1/fixinc.winnt *** gcc-2.7.0/fixinc.winnt Thu Jun 15 17:03:55 1995 --- gcc-2.7.1/fixinc.winnt Tue Sep 12 17:30:30 1995 *************** *** 29,45 **** # provide many essential definitions and declarations if # __STDC__ is 1. This script modifies the header files to check ! # for __STRICT_ANSI__ being defined instead. However the most ! # important modification is to change all occurrences of __stdcall ! # and __cdecl to __attribute__((stdcall)) and __attribute__((cdecl)), ! # respectively. Once munged, the # resulting new system include files are placed in a directory ! # that GNU C will search *before* searching the /mstools/h ! # directory. This script should work properly for an /mstools/h ! # directory dated 9/4/94 on the installation CDROM. # # See README-fixinc for more information. # Directory containing the original header files. ! INPUT=${2-${INPUT-/mstools/h}} # Fail if no arg to specify a directory for the output. --- 29,54 ---- # provide many essential definitions and declarations if # __STDC__ is 1. This script modifies the header files to check ! # for __STRICT_ANSI__ being defined instead. Once munged, the # resulting new system include files are placed in a directory ! # that GNU C will search *before* searching the Include ! # directory. # # See README-fixinc for more information. + ORIG_DIR=`pwd` + # Directory containing the original header files. ! cd $2; SEDFILE=`${PWDCMD-pwd}`/fixinc-nt.sed ! echo $SEDFILE ! if [ ! -f $SEDFILE ] ! then echo fixincludes: sed script 'fixinc-nt.sed' not found ! exit 1 ! fi ! echo 'Using sed script: ' ${SEDFILE} ! ! cd $ORIG_DIR ! ! INPUT=${INCLUDE} ! echo 'Using the Include environment variable to find header files to fix' # Fail if no arg to specify a directory for the output. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/fixincludes gcc-2.7.1/fixincludes *** gcc-2.7.0/fixincludes Sun Jun 11 13:37:31 1995 --- gcc-2.7.1/fixincludes Sun Nov 5 11:05:06 1995 *************** *** 372,375 **** --- 372,379 ---- #ifndef __WCHAR_TYPE__\ #define __WCHAR_TYPE__ int\ + #endif\ + #ifndef __cplusplus + ' \ + -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/a\ #endif ' \ *************** *** 701,704 **** --- 705,733 ---- fi + # Check for (...) in C++ code in HP/UX sys/file.h. + file=sys/file.h + if [ -r $file ] && [ ! -r ${LIB}/$file ]; then + cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file" + chmod +w ${LIB}/$file 2>/dev/null + chmod a+r ${LIB}/$file 2>/dev/null + fi + + if [ -r ${LIB}/$file ]; then + if egrep HPUX_SOURCE ${LIB}/$file > /dev/null; then + echo Fixing $file, use of '(...)' + sed -e 's/(\.\.\.)/(struct file * ...)/' ${LIB}/$file > ${LIB}/${file}.sed + rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file + if cmp $file ${LIB}/$file >/dev/null 2>&1; then + rm ${LIB}/$file + else + # Find any include directives that use "file". + for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do + dir=`echo $file | sed -e s'|/[^/]*$||'` + required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include" + done + fi + fi + fi + # Check for superfluous `static' (in Ultrix 4.2) # On Ultrix 4.3, includes of other files (r3_cpu.h,r4_cpu.h) is broken. *************** *** 879,886 **** sed -e 's/int abort/void abort/g' \ -e 's/int free/void free/g' \ ! -e 's/char \* calloc/void \* calloc/g' \ ! -e 's/char \* malloc/void \* malloc/g' \ ! -e 's/char \* realloc/void \* realloc/g' \ ! -e 's/int exit/void exit/g' \ -e '/typedef[ a-zA-Z_]*[ ]size_t[ ]*;/i\ #ifndef _GCC_SIZE_T\ --- 908,915 ---- sed -e 's/int abort/void abort/g' \ -e 's/int free/void free/g' \ ! -e 's/char[ ]*\*[ ]*calloc/void \* calloc/g' \ ! -e 's/char[ ]*\*[ ]*malloc/void \* malloc/g' \ ! -e 's/char[ ]*\*[ ]*realloc/void \* realloc/g' \ ! -e 's/int[ ][ ]*exit/void exit/g' \ -e '/typedef[ a-zA-Z_]*[ ]size_t[ ]*;/i\ #ifndef _GCC_SIZE_T\ *************** *** 904,907 **** --- 933,937 ---- # Fix return type of free and {c,m,re}alloc in on SunOS 4.1. + # Also fix return type of {m,re}alloc in on sysV68 file=malloc.h if [ -r $file ] && [ ! -r ${LIB}/$file ]; then *************** *** 915,918 **** --- 945,950 ---- sed -e 's/typedef[ ]char \* malloc_t/typedef void \* malloc_t/g' \ -e 's/int[ ][ ]*free/void free/g' \ + -e 's/char\([ ]*\*[ ]*malloc\)/void\1/g' \ + -e 's/char\([ ]*\*[ ]*realloc\)/void\1/g' \ ${LIB}/$file > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file *************** *** 1069,1072 **** --- 1101,1116 ---- fi + # There is a similar problem with the VxWorks drv/netif/if_med.h file. + file=drv/netif/if_med.h + if [ -r ${LIB}/$file ]; then + if egrep 'Wind River' ${LIB}/$file > /dev/null; then + echo Fixing $file, overeager sed script + rm ${LIB}/$file + sed -e 's|//.*$||g' $file > ${LIB}/$file + chmod +w ${LIB}/$file 2>/dev/null + chmod a+r ${LIB}/$file 2>/dev/null + fi + fi + # Some IRIX header files contains the string "//" for file in elf_abi.h elf.h; do *************** *** 1831,1834 **** --- 1875,1880 ---- fi + # Fix return value of mem{ccpy,chr,cpy,set} and str{len,spn,cspn} + # in string.h on sysV68 # Correct the return type for strlen in string.h on Lynx. # Correct the argument type for ffs in string.h on Alpha OSF/1 V2.0. *************** *** 1842,1849 **** if [ -r ${LIB}/$file ]; then ! echo Fixing $file sed -e 's/extern[ ]*int[ ]*strlen();/extern unsigned int strlen();/' \ -e 's/extern[ ]*int[ ]*ffs[ ]*(long);/extern int ffs(int);/' \ -e 's/strdup(char \*s1);/strdup(const char *s1);/' \ ${LIB}/$file > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file --- 1888,1901 ---- if [ -r ${LIB}/$file ]; then ! echo Fixing $file, mem{ccpy,chr,cpy,set} and str{len,spn,cspn} return value sed -e 's/extern[ ]*int[ ]*strlen();/extern unsigned int strlen();/' \ -e 's/extern[ ]*int[ ]*ffs[ ]*(long);/extern int ffs(int);/' \ -e 's/strdup(char \*s1);/strdup(const char *s1);/' \ + -e '/^extern char$/N' \ + -e 's/^extern char\(\n \*memccpy(),\)$/extern void\1/'\ + -e '/^ strncmp(),$/N'\ + -e 's/^\( strncmp()\),\n\( strlen(),\)$/\1;\ + extern unsigned int\ + \2/'\ ${LIB}/$file > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file *************** *** 1946,1952 **** -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/a\ #endif'\ ! -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;[ ]*$/i\ #ifndef __cplusplus'\ ! -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;[ ]*$/a\ #endif'\ ${LIB}/$file > ${LIB}/${file}.sed --- 1998,2004 ---- -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/a\ #endif'\ ! -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/i\ #ifndef __cplusplus'\ ! -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/a\ #endif'\ ${LIB}/$file > ${LIB}/${file}.sed diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/flow.c gcc-2.7.1/flow.c *** gcc-2.7.0/flow.c Thu Jun 15 07:34:32 1995 --- gcc-2.7.1/flow.c Mon Aug 28 06:23:34 1995 *************** *** 1863,1867 **** /* Return 1 if register REGNO was used before it was set. In other words, if it is live at function entry. ! Don't count global regster variables, though. */ int --- 1863,1867 ---- /* Return 1 if register REGNO was used before it was set. In other words, if it is live at function entry. ! Don't count global register variables, though. */ int diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/fold-const.c gcc-2.7.1/fold-const.c *** gcc-2.7.0/fold-const.c Thu Jun 15 07:35:19 1995 --- gcc-2.7.1/fold-const.c Fri Sep 15 18:26:12 1995 *************** *** 72,76 **** static tree decode_field_reference PROTO((tree, int *, int *, enum machine_mode *, int *, ! int *, tree *)); static int all_ones_mask_p PROTO((tree, int)); static int simple_operand_p PROTO((tree)); --- 72,76 ---- static tree decode_field_reference PROTO((tree, int *, int *, enum machine_mode *, int *, ! int *, tree *, tree *)); static int all_ones_mask_p PROTO((tree, int)); static int simple_operand_p PROTO((tree)); *************** *** 77,81 **** static tree range_test PROTO((enum tree_code, tree, enum tree_code, enum tree_code, tree, tree, tree)); ! static tree unextend PROTO((tree, int, int)); static tree fold_truthop PROTO((enum tree_code, tree, tree, tree)); static tree strip_compound_expr PROTO((tree, tree)); --- 77,81 ---- static tree range_test PROTO((enum tree_code, tree, enum tree_code, enum tree_code, tree, tree, tree)); ! static tree unextend PROTO((tree, int, int, tree)); static tree fold_truthop PROTO((enum tree_code, tree, tree, tree)); static tree strip_compound_expr PROTO((tree, tree)); *************** *** 463,467 **** register int i, j; unsigned HOST_WIDE_INT work; ! register int carry = 0; HOST_WIDE_INT lnum = lnum_orig; HOST_WIDE_INT hnum = hnum_orig; --- 463,467 ---- register int i, j; unsigned HOST_WIDE_INT work; ! register unsigned HOST_WIDE_INT carry = 0; HOST_WIDE_INT lnum = lnum_orig; HOST_WIDE_INT hnum = hnum_orig; *************** *** 530,534 **** /* Full double precision division, with thanks to Don Knuth's "Seminumerical Algorithms". */ ! int quo_est, scale, num_hi_sig, den_hi_sig; /* Find the highest non-zero divisor digit. */ --- 530,535 ---- /* Full double precision division, with thanks to Don Knuth's "Seminumerical Algorithms". */ ! int num_hi_sig, den_hi_sig; ! unsigned HOST_WIDE_INT quo_est, scale; /* Find the highest non-zero divisor digit. */ *************** *** 1358,1362 **** return arg1; /* Handle general case of two integer constants. */ ! return const_binop (code, arg0, arg1, 1); } --- 1359,1363 ---- return arg1; /* Handle general case of two integer constants. */ ! return const_binop (code, arg0, arg1, 0); } *************** *** 2383,2386 **** --- 2384,2389 ---- BIT_AND_EXPR or derived from the width of the field. + *PAND_MASK is set the the mask found in a BIT_AND_EXPR, if any. + Return 0 if this is not a component reference or is one that we can't do anything with. */ *************** *** 2388,2392 **** static tree decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp, ! pvolatilep, pmask) tree exp; int *pbitsize, *pbitpos; --- 2391,2395 ---- static tree decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp, ! pvolatilep, pmask, pand_mask) tree exp; int *pbitsize, *pbitpos; *************** *** 2394,2397 **** --- 2397,2401 ---- int *punsignedp, *pvolatilep; tree *pmask; + tree *pand_mask; { tree and_mask = 0; *************** *** 2440,2443 **** --- 2444,2448 ---- *pmask = mask; + *pand_mask = and_mask; return inner; } *************** *** 2622,2632 **** /* Subroutine for fold_truthop: C is an INTEGER_CST interpreted as a P bit value. Arrange things so the extra bits will be set to zero if and ! only if C is signed-extended to its full width. */ static tree ! unextend (c, p, unsignedp) tree c; int p; int unsignedp; { tree type = TREE_TYPE (c); --- 2627,2639 ---- /* Subroutine for fold_truthop: C is an INTEGER_CST interpreted as a P bit value. Arrange things so the extra bits will be set to zero if and ! only if C is signed-extended to its full width. If MASK is nonzero, ! it is an INTEGER_CST that should be AND'ed with the extra bits. */ static tree ! unextend (c, p, unsignedp, mask) tree c; int p; int unsignedp; + tree mask; { tree type = TREE_TYPE (c); *************** *** 2647,2650 **** --- 2654,2660 ---- temp = const_binop (LSHIFT_EXPR, temp, size_int (modesize - 1), 0); temp = const_binop (RSHIFT_EXPR, temp, size_int (modesize - p - 1), 0); + if (mask != 0) + temp = const_binop (BIT_AND_EXPR, temp, convert (TREE_TYPE (c), mask), 0); + return convert (type, const_binop (BIT_XOR_EXPR, c, temp, 0)); } *************** *** 2700,2703 **** --- 2710,2714 ---- enum machine_mode lnmode, rnmode; tree ll_mask, lr_mask, rl_mask, rr_mask; + tree ll_and_mask, lr_and_mask, rl_and_mask, rr_and_mask; tree l_const, r_const; tree type, result; *************** *** 2789,2802 **** ll_inner = decode_field_reference (ll_arg, &ll_bitsize, &ll_bitpos, &ll_mode, ! &ll_unsignedp, &volatilep, &ll_mask); lr_inner = decode_field_reference (lr_arg, &lr_bitsize, &lr_bitpos, &lr_mode, ! &lr_unsignedp, &volatilep, &lr_mask); rl_inner = decode_field_reference (rl_arg, &rl_bitsize, &rl_bitpos, &rl_mode, ! &rl_unsignedp, &volatilep, &rl_mask); rr_inner = decode_field_reference (rr_arg, &rr_bitsize, &rr_bitpos, &rr_mode, ! &rr_unsignedp, &volatilep, &rr_mask); /* It must be true that the inner operation on the lhs of each --- 2800,2817 ---- ll_inner = decode_field_reference (ll_arg, &ll_bitsize, &ll_bitpos, &ll_mode, ! &ll_unsignedp, &volatilep, &ll_mask, ! &ll_and_mask); lr_inner = decode_field_reference (lr_arg, &lr_bitsize, &lr_bitpos, &lr_mode, ! &lr_unsignedp, &volatilep, &lr_mask, ! &lr_and_mask); rl_inner = decode_field_reference (rl_arg, &rl_bitsize, &rl_bitpos, &rl_mode, ! &rl_unsignedp, &volatilep, &rl_mask, ! &rl_and_mask); rr_inner = decode_field_reference (rr_arg, &rr_bitsize, &rr_bitpos, &rr_mode, ! &rr_unsignedp, &volatilep, &rr_mask, ! &rr_and_mask); /* It must be true that the inner operation on the lhs of each *************** *** 2867,2871 **** if (l_const) { ! l_const = convert (type, unextend (l_const, ll_bitsize, ll_unsignedp)); l_const = const_binop (LSHIFT_EXPR, l_const, size_int (xll_bitpos), 0); if (! integer_zerop (const_binop (BIT_AND_EXPR, l_const, --- 2882,2887 ---- if (l_const) { ! l_const = convert (type, l_const); ! l_const = unextend (l_const, ll_bitsize, ll_unsignedp, ll_and_mask); l_const = const_binop (LSHIFT_EXPR, l_const, size_int (xll_bitpos), 0); if (! integer_zerop (const_binop (BIT_AND_EXPR, l_const, *************** *** 2884,2888 **** if (r_const) { ! r_const = convert (type, unextend (r_const, rl_bitsize, rl_unsignedp)); r_const = const_binop (LSHIFT_EXPR, r_const, size_int (xrl_bitpos), 0); if (! integer_zerop (const_binop (BIT_AND_EXPR, r_const, --- 2900,2905 ---- if (r_const) { ! r_const = convert (type, r_const); ! r_const = unextend (r_const, rl_bitsize, rl_unsignedp, rl_and_mask); r_const = const_binop (LSHIFT_EXPR, r_const, size_int (xrl_bitpos), 0); if (! integer_zerop (const_binop (BIT_AND_EXPR, r_const, *************** *** 3430,3434 **** it is wider than the final type and doesn't change the signedness (for integers). Avoid this if the final type is a pointer ! since then we sometimes need the inner conversion. */ if ((((inter_int || inter_ptr) && (inside_int || inside_ptr)) || (inter_float && inside_float)) --- 3447,3452 ---- it is wider than the final type and doesn't change the signedness (for integers). Avoid this if the final type is a pointer ! since then we sometimes need the inner conversion. Likewise if ! the outer has a precision not equal to the size of its mode. */ if ((((inter_int || inter_ptr) && (inside_int || inside_ptr)) || (inter_float && inside_float)) *************** *** 3435,3438 **** --- 3453,3458 ---- && inter_prec >= inside_prec && (inter_float || inter_unsignedp == inside_unsignedp) + && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (final_type)) + && TYPE_MODE (final_type) == TYPE_MODE (inter_type)) && ! final_ptr) return convert (final_type, TREE_OPERAND (TREE_OPERAND (t, 0), 0)); *************** *** 3456,3460 **** == (final_unsignedp && final_prec > inter_prec)) && ! (inside_ptr && inter_prec != final_prec) ! && ! (final_ptr && inside_prec != inter_prec)) return convert (final_type, TREE_OPERAND (TREE_OPERAND (t, 0), 0)); } --- 3476,3483 ---- == (final_unsignedp && final_prec > inter_prec)) && ! (inside_ptr && inter_prec != final_prec) ! && ! (final_ptr && inside_prec != inter_prec) ! && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (final_type)) ! && TYPE_MODE (final_type) == TYPE_MODE (inter_type)) ! && ! final_ptr) return convert (final_type, TREE_OPERAND (TREE_OPERAND (t, 0), 0)); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/function.c gcc-2.7.1/function.c *** gcc-2.7.0/function.c Thu Jun 15 17:50:37 1995 --- gcc-2.7.1/function.c Sun Nov 12 18:08:38 1995 *************** *** 169,172 **** --- 169,177 ---- int current_function_varargs; + /* Nonzero if current function uses stdarg.h or equivalent. + Zero for functions that use varargs.h. */ + + int current_function_stdarg; + /* Quantities of various kinds of registers used for the current function's args. */ *************** *** 363,366 **** --- 368,377 ---- /* Non-zero if this should survive a call to free_temp_slots. */ int keep; + /* The offset of the slot from the frame_pointer, including extra space + for alignment. This info is for combine_temp_slots. */ + int base_offset; + /* The size of the slot, including extra space for alignment. This + info is for combine_temp_slots. */ + int full_size; }; *************** *** 414,418 **** static struct temp_slot *find_temp_slot_from_address PROTO((rtx)); static void put_reg_into_stack PROTO((struct function *, rtx, tree, ! enum machine_mode, enum machine_mode)); static void fixup_var_refs PROTO((rtx, enum machine_mode, int)); static struct fixup_replacement --- 425,430 ---- static struct temp_slot *find_temp_slot_from_address PROTO((rtx)); static void put_reg_into_stack PROTO((struct function *, rtx, tree, ! enum machine_mode, enum machine_mode, ! int)); static void fixup_var_refs PROTO((rtx, enum machine_mode, int)); static struct fixup_replacement *************** *** 488,491 **** --- 500,504 ---- p->arg_offset_rtx = current_function_arg_offset_rtx; p->varargs = current_function_varargs; + p->stdarg = current_function_stdarg; p->uses_const_pool = current_function_uses_const_pool; p->uses_pic_offset_table = current_function_uses_pic_offset_table; *************** *** 564,567 **** --- 577,581 ---- current_function_arg_offset_rtx = p->arg_offset_rtx; current_function_varargs = p->varargs; + current_function_stdarg = p->stdarg; current_function_uses_const_pool = p->uses_const_pool; current_function_uses_pic_offset_table = p->uses_pic_offset_table; *************** *** 835,838 **** --- 849,854 ---- p->in_use = p->addr_taken = 0; p->size = best_p->size - rounded_size; + p->base_offset = best_p->base_offset + rounded_size; + p->full_size = best_p->full_size - rounded_size; p->slot = gen_rtx (MEM, BLKmode, plus_constant (XEXP (best_p->slot, 0), *************** *** 847,850 **** --- 863,867 ---- best_p->size = rounded_size; + best_p->full_size = rounded_size; } } *************** *** 864,873 **** know the actual size of the temporary slot until assign_stack_local has performed all the frame alignment and size rounding for the ! requested temporary. Otherwise combine_temp_slots won't think that ! adjacent slots really are adjacent. */ #ifdef FRAME_GROWS_DOWNWARD p->size = frame_offset_old - frame_offset; #else ! p->size = frame_offset - frame_offset_old; #endif p->address = 0; --- 881,900 ---- know the actual size of the temporary slot until assign_stack_local has performed all the frame alignment and size rounding for the ! requested temporary. Note that extra space added for alignment ! can be either above or below this stack slot depending on which ! way the frame grows. We include the extra space if and only if it ! is above this slot. */ #ifdef FRAME_GROWS_DOWNWARD p->size = frame_offset_old - frame_offset; #else ! p->size = size; ! #endif ! /* Now define the fields used by combine_temp_slots. */ ! #ifdef FRAME_GROWS_DOWNWARD ! p->base_offset = frame_offset; ! p->full_size = frame_offset_old - frame_offset; ! #else ! p->base_offset = frame_offset_old; ! p->full_size = frame_offset - frame_offset_old; #endif p->address = 0; *************** *** 916,931 **** if (! q->in_use && GET_MODE (q->slot) == BLKmode) { ! if (rtx_equal_p (plus_constant (XEXP (p->slot, 0), p->size), ! XEXP (q->slot, 0))) { /* Q comes after P; combine Q into P. */ p->size += q->size; delete_q = 1; } ! else if (rtx_equal_p (plus_constant (XEXP (q->slot, 0), q->size), ! XEXP (p->slot, 0))) { /* P comes after Q; combine P into Q. */ q->size += p->size; delete_p = 1; break; --- 943,958 ---- if (! q->in_use && GET_MODE (q->slot) == BLKmode) { ! if (p->base_offset + p->full_size == q->base_offset) { /* Q comes after P; combine Q into P. */ p->size += q->size; + p->full_size += q->full_size; delete_q = 1; } ! else if (q->base_offset + q->full_size == p->base_offset) { /* P comes after Q; combine P into Q. */ q->size += p->size; + q->full_size += p->full_size; delete_p = 1; break; *************** *** 1236,1240 **** if (GET_CODE (reg) == REG) put_reg_into_stack (function, reg, TREE_TYPE (decl), ! promoted_mode, decl_mode); else if (GET_CODE (reg) == CONCAT) { --- 1263,1267 ---- if (GET_CODE (reg) == REG) put_reg_into_stack (function, reg, TREE_TYPE (decl), ! promoted_mode, decl_mode, TREE_SIDE_EFFECTS (decl)); else if (GET_CODE (reg) == CONCAT) { *************** *** 1243,1257 **** enum machine_mode part_mode = GET_MODE (XEXP (reg, 0)); tree part_type = TREE_TYPE (TREE_TYPE (decl)); ! #ifdef STACK_GROWS_DOWNWARD /* Since part 0 should have a lower address, do it second. */ ! put_reg_into_stack (function, XEXP (reg, 1), ! part_type, part_mode, part_mode); ! put_reg_into_stack (function, XEXP (reg, 0), ! part_type, part_mode, part_mode); #else ! put_reg_into_stack (function, XEXP (reg, 0), ! part_type, part_mode, part_mode); ! put_reg_into_stack (function, XEXP (reg, 1), ! part_type, part_mode, part_mode); #endif --- 1270,1284 ---- enum machine_mode part_mode = GET_MODE (XEXP (reg, 0)); tree part_type = TREE_TYPE (TREE_TYPE (decl)); ! #ifdef FRAME_GROWS_DOWNWARD /* Since part 0 should have a lower address, do it second. */ ! put_reg_into_stack (function, XEXP (reg, 1), part_type, part_mode, ! part_mode, TREE_SIDE_EFFECTS (decl)); ! put_reg_into_stack (function, XEXP (reg, 0), part_type, part_mode, ! part_mode, TREE_SIDE_EFFECTS (decl)); #else ! put_reg_into_stack (function, XEXP (reg, 0), part_type, part_mode, ! part_mode, TREE_SIDE_EFFECTS (decl)); ! put_reg_into_stack (function, XEXP (reg, 1), part_type, part_mode, ! part_mode, TREE_SIDE_EFFECTS (decl)); #endif *************** *** 1258,1261 **** --- 1285,1290 ---- /* Change the CONCAT into a combined MEM for both parts. */ PUT_CODE (reg, MEM); + MEM_VOLATILE_P (reg) = MEM_VOLATILE_P (XEXP (reg, 0)); + /* The two parts are in memory order already. Use the lower parts address as ours. */ *************** *** 1270,1277 **** into the stack frame of FUNCTION (0 means the current function). DECL_MODE is the machine mode of the user-level data type. ! PROMOTED_MODE is the machine mode of the register. */ static void ! put_reg_into_stack (function, reg, type, promoted_mode, decl_mode) struct function *function; rtx reg; --- 1299,1307 ---- into the stack frame of FUNCTION (0 means the current function). DECL_MODE is the machine mode of the user-level data type. ! PROMOTED_MODE is the machine mode of the register. ! VOLATILE_P is nonzero if this is for a "volatile" decl. */ static void ! put_reg_into_stack (function, reg, type, promoted_mode, decl_mode, volatile_p) struct function *function; rtx reg; *************** *** 1278,1281 **** --- 1308,1312 ---- tree type; enum machine_mode promoted_mode, decl_mode; + int volatile_p; { rtx new = 0; *************** *** 1297,1305 **** } XEXP (reg, 0) = XEXP (new, 0); /* `volatil' bit means one thing for MEMs, another entirely for REGs. */ ! REG_USERVAR_P (reg) = 0; PUT_CODE (reg, MEM); - PUT_MODE (reg, decl_mode); /* If this is a memory ref that contains aggregate components, --- 1328,1336 ---- } + PUT_MODE (reg, decl_mode); XEXP (reg, 0) = XEXP (new, 0); /* `volatil' bit means one thing for MEMs, another entirely for REGs. */ ! MEM_VOLATILE_P (reg) = volatile_p; PUT_CODE (reg, MEM); /* If this is a memory ref that contains aggregate components, *************** *** 3170,3173 **** --- 3201,3206 ---- != void_type_node)); + current_function_stdarg = stdarg; + /* If the reg that the virtual arg pointer will be translated into is not a fixed reg or is the stack pointer, make a copy of the virtual *************** *** 3430,3434 **** whether this parameter already has a stack slot allocated, because an arg block exists only if current_function_args_size ! is larger than some threshhold, and we haven't calculated that yet. So, for now, we just assume that stack slots never exist in this case. */ --- 3463,3467 ---- whether this parameter already has a stack slot allocated, because an arg block exists only if current_function_args_size ! is larger than some threshold, and we haven't calculated that yet. So, for now, we just assume that stack slots never exist in this case. */ *************** *** 3681,3685 **** TYPE_MODE (DECL_ARG_TYPE (parm)), DECL_ARG_TYPE (parm), ! ! last_named)) { rtx copy; --- 3714,3719 ---- TYPE_MODE (DECL_ARG_TYPE (parm)), DECL_ARG_TYPE (parm), ! ! last_named) ! && ! TREE_ADDRESSABLE (DECL_ARG_TYPE (parm))) { rtx copy; *************** *** 4210,4215 **** void ! setjmp_args_warning (block) ! tree block; { register tree decl; --- 4244,4248 ---- void ! setjmp_args_warning () { register tree decl; *************** *** 4796,4802 **** current_function_outgoing_args_size = 0; - /* Initialize the insn lengths. */ - init_insn_lengths (); - /* Prevent ever trying to delete the first instruction of a function. Also tell final how to output a linenum before the function prologue. */ --- 4829,4832 ---- *************** *** 4836,4841 **** frame_pointer_needed = 0; ! /* By default assume not varargs. */ current_function_varargs = 0; } --- 4866,4872 ---- frame_pointer_needed = 0; ! /* By default assume not varargs or stdarg. */ current_function_varargs = 0; + current_function_stdarg = 0; } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/function.h gcc-2.7.1/function.h *** gcc-2.7.0/function.h Thu Jun 15 07:36:35 1995 --- gcc-2.7.1/function.h Fri Jul 14 08:02:33 1995 *************** *** 1,4 **** /* Structure for saving state for a nested function. ! Copyright (C) 1989, 1992, 1993, 1994 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, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 85,88 **** --- 85,89 ---- rtx arg_offset_rtx; int varargs; + int stdarg; int max_parm_reg; rtx *parm_reg_stack_loc; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/gcc.1 gcc-2.7.1/gcc.1 *** gcc-2.7.0/gcc.1 Mon May 15 23:11:30 1995 --- gcc-2.7.1/gcc.1 Thu Jul 13 19:23:51 1995 *************** *** 503,507 **** \-fpic \-fPIC ! \-freg\-struct\-returno \-fshared\-data \-fshort\-enums --- 503,507 ---- \-fpic \-fPIC ! \-freg\-struct\-return \-fshared\-data \-fshort\-enums *************** *** 1681,1685 **** .TP \ \ \ \(bu ! An expression-statement contains no side effects. .TP \ \ \ \(bu --- 1681,1693 ---- .TP \ \ \ \(bu ! An expression-statement or the left-hand side of a comma expression ! contains no side effects. ! To suppress the warning, cast the unused expression to void. ! For example, an expression such as `\|\c ! .B x[i,j]\c ! \&\|' will cause a warning, ! but `\|\c ! .B x[(void)i,j]\c ! \&\|' will not. .TP \ \ \ \(bu *************** *** 2467,2472 **** restore frame pointers; it also makes an extra register available in many functions. \c ! .I It also makes debugging impossible on ! most machines. .Sp On some machines, such as the Vax, this flag has no effect, because --- 2475,2480 ---- restore frame pointers; it also makes an extra register available in many functions. \c ! .I It also makes debugging impossible on most machines\c ! \&. .Sp On some machines, such as the Vax, this flag has no effect, because diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/gcc.c gcc-2.7.1/gcc.c *** gcc-2.7.0/gcc.c Thu Jun 15 07:38:02 1995 --- gcc-2.7.1/gcc.c Tue Sep 12 17:15:11 1995 *************** *** 42,45 **** --- 42,47 ---- #else #include + int __spawnv (); + int __spawnvp (); #endif *************** *** 296,299 **** --- 298,302 ---- static void give_switch PROTO((int, int)); static int used_arg PROTO((char *, int)); + static int default_arg PROTO((char *, int)); static void set_multilib_dir PROTO((void)); static void print_multilib_info PROTO((void)); *************** *** 600,604 **** {".c", "@c"}, {"@c", ! "cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ --- 603,607 ---- {".c", "@c"}, {"@c", ! "cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ *************** *** 621,625 **** %{!pipe:%g.s} %A\n }}}}"}, {"-", ! "%{E:cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ --- 624,628 ---- %{!pipe:%g.s} %A\n }}}}"}, {"-", ! "%{E:cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\ *************** *** 2112,2164 **** #endif /* not __MSDOS__ and not OS2 and not _WIN32 */ ! #if defined(OS2) || defined(_WIN32) ! #ifdef _WIN32 ! ! /* This is a kludge to get around the Microsoft C spawn functions' propensity ! to remove the outermost set of double quotes from all arguments. */ ! ! const char * const ! fix_argv (argvec) ! char **argvec; { ! int i; ! ! for (i = 1; argvec[i] != 0; i++) ! { ! int len, j; ! char *temp, *newtemp; ! ! temp = argvec[i]; ! len = strlen (temp); ! for (j = 0; j < len; j++) ! { ! if (temp[j] == '"') ! { ! newtemp = xmalloc (len + 2); ! strncpy (newtemp, temp, j); ! newtemp [j] = '\\'; ! strncpy (&newtemp [j+1], &temp [j], len-j); ! newtemp [len+1] = 0; ! temp = newtemp; ! len++; ! j++; ! } ! } ! ! argvec[i] = temp; ! } ! ! return (const char* const*) argvec; } ! ! #define FIX_ARGV(a) fix_argv(a) ! ! #else ! #define FIX_ARGV(a) a - #endif - static int pexecute (search_flag, program, argv, not_last) --- 2115,2133 ---- #endif /* not __MSDOS__ and not OS2 and not _WIN32 */ ! #if defined(OS2) ! static int ! pexecute (search_flag, program, argv, not_last) ! int search_flag; ! char *program; ! char *argv[]; ! int not_last; { ! return (search_flag ? spawnv : spawnvp) (1, program, argv); } ! #endif /* OS2 */ ! #if defined(_WIN32) static int pexecute (search_flag, program, argv, not_last) *************** *** 2168,2174 **** int not_last; { ! return (search_flag ? spawnv : spawnvp) (1, program, FIX_ARGV (argv)); } ! #endif /* OS2 or _WIN32 */ --- 2137,2143 ---- int not_last; { ! return (search_flag ? __spawnv : __spawnvp) (1, program, argv); } ! #endif /* _WIN32 */ *************** *** 4338,4342 **** if (gcc_exec_prefix) add_prefix (&startfile_prefixes, ! concat (gcc_exec_prefix, standard_startfile_prefix), 0, 0, NULL_PTR); add_prefix (&startfile_prefixes, --- 4307,4312 ---- if (gcc_exec_prefix) add_prefix (&startfile_prefixes, ! concat3 (gcc_exec_prefix, machine_suffix, ! standard_startfile_prefix), 0, 0, NULL_PTR); add_prefix (&startfile_prefixes, *************** *** 4359,4363 **** if (*standard_startfile_prefix != DIR_SEPARATOR && gcc_exec_prefix) add_prefix (&startfile_prefixes, ! concat (gcc_exec_prefix, standard_startfile_prefix), 0, 0, NULL_PTR); } --- 4329,4334 ---- if (*standard_startfile_prefix != DIR_SEPARATOR && gcc_exec_prefix) add_prefix (&startfile_prefixes, ! concat3 (gcc_exec_prefix, machine_suffix, ! standard_startfile_prefix), 0, 0, NULL_PTR); } *************** *** 4757,4761 **** s = concat ("%s: ", my_strerror( errno )); else ! s = "cannot open %s"; fatal (s, name); } --- 4728,4732 ---- s = concat ("%s: ", my_strerror( errno )); else ! s = "cannot open `%s'"; fatal (s, name); } *************** *** 4770,4774 **** s = concat ("%s: ", my_strerror( errno )); else ! s = "cannot open %s"; error (s, name); } --- 4741,4745 ---- s = concat ("%s: ", my_strerror( errno )); else ! s = "cannot open `%s'"; error (s, name); } *************** *** 4781,4787 **** if (errno < sys_nerr) ! s = concat ("installation problem, cannot exec %s: ", my_strerror( errno )); else ! s = "installation problem, cannot exec %s"; error (s, name); } --- 4752,4759 ---- if (errno < sys_nerr) ! s = concat ("installation problem, cannot exec `%s': ", ! my_strerror (errno)); else ! s = "installation problem, cannot exec `%s'"; error (s, name); } *************** *** 5028,5031 **** --- 5000,5028 ---- } + /* Check whether a particular argument is a default argument. */ + + #ifndef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS { NULL } + #endif + + static char *multilib_defaults[] = MULTILIB_DEFAULTS; + + static int + default_arg (p, len) + char *p; + int len; + { + int count = sizeof multilib_defaults / sizeof multilib_defaults[0]; + int i; + + for (i = 0; i < count; i++) + if (multilib_defaults[i] != NULL + && strncmp (multilib_defaults[i], p, len) == 0 + && multilib_defaults[i][len] == '\0') + return 1; + + return 0; + } + /* Work out the subdirectory to use based on the options. The format of multilib_select is a list of elements. *************** *** 5042,5046 **** int this_path_len; char *this_path, *this_arg; ! int failed; while (*p != '\0') --- 5039,5044 ---- int this_path_len; char *this_path, *this_arg; ! int not_arg; ! int ok; while (*p != '\0') *************** *** 5064,5068 **** /* Check the arguments. */ ! failed = 0; ++p; while (*p != ';') --- 5062,5066 ---- /* Check the arguments. */ ! ok = 1; ++p; while (*p != ';') *************** *** 5071,5075 **** abort (); ! if (failed) { ++p; --- 5069,5073 ---- abort (); ! if (! ok) { ++p; *************** *** 5085,5093 **** } ! if (*this_arg == '!') ! failed = used_arg (this_arg + 1, p - (this_arg + 1)); else ! failed = ! used_arg (this_arg, p - this_arg); if (*p == ' ') ++p; --- 5083,5108 ---- } ! if (*this_arg != '!') ! not_arg = 0; else ! { ! not_arg = 1; ! ++this_arg; ! } + /* If this is a default argument, we can just ignore it. + This is true even if this_arg begins with '!'. Beginning + with '!' does not mean that this argument is necessarily + inappropriate for this library: it merely means that + there is a more specific library which uses this + argument. If this argument is a default, we need not + consider that more specific library. */ + if (! default_arg (this_arg, p - this_arg)) + { + ok = used_arg (this_arg, p - this_arg); + if (not_arg) + ok = ! ok; + } + if (*p == ' ') ++p; *************** *** 5094,5098 **** } ! if (! failed) { if (this_path_len != 1 --- 5109,5113 ---- } ! if (ok) { if (this_path_len != 1 *************** *** 5124,5128 **** char *p = multilib_select; char *last_path = 0, *this_path; ! int skip, use_arg; int last_path_len = 0; --- 5139,5143 ---- char *p = multilib_select; char *last_path = 0, *this_path; ! int skip; int last_path_len = 0; *************** *** 5151,5154 **** --- 5166,5208 ---- last_path = this_path; last_path_len = p - this_path; + + /* If this directory requires any default arguments, we can skip + it. We will already have printed a directory identical to + this one which does not require that default argument. */ + if (! skip) + { + char *q; + + q = p + 1; + while (*q != ';') + { + char *arg; + + if (*q == '\0') + abort (); + + if (*q == '!') + arg = NULL; + else + arg = q; + + while (*q != ' ' && *q != ';') + { + if (*q == '\0') + abort (); + ++q; + } + + if (arg != NULL + && default_arg (arg, q - arg)) + { + skip = 1; + break; + } + + if (*q == ' ') + ++q; + } + } if (! skip) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/gcc.texi gcc-2.7.1/gcc.texi *** gcc-2.7.0/gcc.texi Thu Jun 15 17:33:52 1995 --- gcc-2.7.1/gcc.texi Mon Nov 6 09:47:57 1995 *************** *** 148,157 **** @center Richard M. Stallman @sp 3 ! @center Last updated 14 June 1995 @sp 1 @c The version number appears twice more in this file. ! @center for version 2.7 ! @c @center (preliminary draft, which will change) @page @vskip 0pt plus 1filll --- 148,156 ---- @center Richard M. Stallman @sp 3 ! @center Last updated 6 November 1995 @sp 1 @c The version number appears twice more in this file. ! @center for version 2.7.1 @page @vskip 0pt plus 1filll *************** *** 158,168 **** Copyright @copyright{} 1988, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. @sp 2 ! For GCC Version 2.7.@* ! @c Printed November, 1994.@* ! @c ISBN 1-882114-35-3 @sp 1 Published by the Free Software Foundation @* ! 675 Massachusetts Avenue @* ! Cambridge, MA 02139 USA @sp 1 Permission is granted to make and distribute verbatim copies of --- 157,168 ---- Copyright @copyright{} 1988, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. @sp 2 ! For GCC Version 2.7.1@* @sp 1 Published by the Free Software Foundation @* ! 59 Temple Place - Suite 330@* ! Boston, MA 02111-1307, USA@* ! Last printed November, 1995.@* ! Printed copies are available for $50 each.@* ! ISBN 1-882114-66-3 @sp 1 Permission is granted to make and distribute verbatim copies of *************** *** 198,202 **** This manual documents how to run, install and port the GNU compiler, as well as its new features and incompatibilities, and how to ! report bugs. It corresponds to GNU CC version 2.7. @end ifset @end ifset --- 198,202 ---- This manual documents how to run, install and port the GNU compiler, as well as its new features and incompatibilities, and how to ! report bugs. It corresponds to GNU CC version 2.7.1. @end ifset @end ifset *************** *** 205,209 **** This manual documents how to run and install the GNU compiler, as well as its new features and incompatibilities, and how to report ! bugs. It corresponds to GNU CC version 2.7. @end ifclear @ifclear USING --- 205,209 ---- This manual documents how to run and install the GNU compiler, as well as its new features and incompatibilities, and how to report ! bugs. It corresponds to GNU CC version 2.7.1. @end ifclear @ifclear USING *************** *** 210,214 **** This manual documents how to port the GNU compiler, as well as its new features and incompatibilities, and how to report ! bugs. It corresponds to GNU CC version 2.7. @end ifclear --- 210,214 ---- This manual documents how to port the GNU compiler, as well as its new features and incompatibilities, and how to report ! bugs. It corresponds to GNU CC version 2.7.1. @end ifclear *************** *** 239,242 **** --- 239,243 ---- * Target Macros:: How to write the machine description C macros. * Config:: Writing the @file{xm-@var{machine}.h} file. + * Fragments:: Writing the @file{t-@var{target}} and @file{x-@var{host}} files. @end ifset *************** *** 250,254 **** @display Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. ! 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies --- 251,255 ---- @display Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. ! 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies *************** *** 596,600 **** You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software ! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @end smallexample --- 597,601 ---- You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @end smallexample *************** *** 771,777 **** @item ! Torbjorn Granlund of the Swedish Institute of Computer Science ! implemented multiply-by-constant optimization and better long long ! support, and improved leaf function register allocation. @item --- 772,778 ---- @item ! Torbjorn Granlund implemented multiply- and divide-by-constant ! optimization, improved long long support, and improved leaf function ! register allocation. @item *************** *** 814,817 **** --- 815,821 ---- Oliver M. Kellogg of Deutsche Aerospace contributed the port to the MIL-STD-1750A. + + @item + Michael K. Gschwind contributed the port to the PDP-11. @end itemize *************** *** 875,880 **** @end quotation ! Apple and Lotus have tried to create a new form of legal monopoly: a ! copyright on a user interface. An interface is a kind of language---a set of conventions for --- 879,884 ---- @end quotation ! Apple, Lotus, and now CDC have tried to create a new form of legal ! monopoly: a copyright on a user interface. An interface is a kind of language---a set of conventions for *************** *** 897,906 **** monopolies, for the same reason: if languages become property, they expect to own many de-facto standard languages. But Apple and Lotus are ! the ones who have actually sued. Lotus has won lawsuits against two ! small companies, which were thus put out of business. Then they sued ! Borland; this case is now before the court of appeals. Apple's lawsuit ! against HP and Microsoft is also being decided by an appeals court. ! Widespread rumors that Apple had lost the case are untrue; as of July ! 1994, the final outcome is unknown. If the monopolists get their way, they will hobble the software field: --- 901,920 ---- monopolies, for the same reason: if languages become property, they expect to own many de-facto standard languages. But Apple and Lotus are ! the ones who have actually sued. Apple's lawsuit was defeated, for ! reasons only partly related to the general issue of interface copyright. ! ! Lotus won lawsuits against two small companies, which were thus put out ! of business. Then they sued Borland; they won in the trial court (no ! surprise, since it was the same court that had ruled for Lotus twice ! before), but the decision was reversed by the court of appeals, with ! help from the League for Programming Freedom in the form of a ! friend-of-the-court brief. We are now waiting to see if the Supreme ! Court will hear the case. If it does, the League for Programming ! Freedom will again submit a brief. ! ! The battle is not over. Just this summer a company that produced a ! simulator for a CDC computer was shut down by a copyright lawsuit by ! CDC, which charged that the simulator infringed the copyright on the ! manuals for the computer. If the monopolists get their way, they will hobble the software field: *************** *** 931,940 **** @itemize @bullet @item ! Adobe is expected to claim a monopoly on the interfaces of various popular ! application programs, if Borland's appeal against Lotus fails. @item Open Computing magazine reported a Microsoft vice president as threatening ! to sue people who copy the interface of Windows. @end itemize --- 945,955 ---- @itemize @bullet @item ! Adobe is expected to claim a monopoly on the interfaces of various ! popular application programs, if Lotus ultimately wins the case against ! Borland. @item Open Computing magazine reported a Microsoft vice president as threatening ! to sue people who imitate the interface of Windows. @end itemize *************** *** 955,976 **** issue, and is not affiliated with the Free Software Foundation. ! The League's activities include publicizing the issue, as is being done here, and filing friend-of-the-court briefs on behalf of defendants sued ! by monopolists. Recently the League filed a friend-of-the-court brief ! for Borland in its appeal against Lotus. ! The League's membership rolls include John McCarthy, inventor of Lisp, ! Marvin Minsky, founder of the MIT Artificial Intelligence lab, Guy L. ! Steele, Jr., author of well-known books on Lisp and C, as well as ! Richard Stallman, the developer of GNU CC. Please join and add your ! name to the list. Membership dues in the League are $42 per year for ! programmers, managers and professionals; $10.50 for students; $21 for ! others. Activist members are especially important, but members who have no time to give are also important. Surveys at major ACM conferences have ! indicated a vast majority of attendees agree with the League. If just ! ten percent of the programmers who agree with the League join the ! League, we will probably triumph. To join, or for more information, phone (617) 243-4091 or write to: --- 970,991 ---- issue, and is not affiliated with the Free Software Foundation. ! The League's activities include publicizing the issues, as is being done here, and filing friend-of-the-court briefs on behalf of defendants sued ! by monopolists. ! The League's membership rolls include Donald Knuth, the foremost ! authority on algorithms, John McCarthy, inventor of Lisp, Marvin Minsky, ! founder of the MIT Artificial Intelligence lab, Guy L. Steele, Jr., ! author of well-known books on Lisp and C, as well as Richard Stallman, ! the developer of GNU CC. Please join and add your name to the list. ! Membership dues in the League are $42 per year for programmers, managers ! and professionals; $10.50 for students; $21 for others. Activist members are especially important, but members who have no time to give are also important. Surveys at major ACM conferences have ! indicated a vast majority of attendees agree with the League on both ! issues (interface copyrights and software patents). If just ten percent ! of the programmers who agree with the League join the League, we will ! probably triumph. To join, or for more information, phone (617) 243-4091 or write to: *************** *** 1004,1016 **** @item ! When employers ask you to sign contracts giving them copyright or patent ! rights, insist on clauses saying they can use these rights only ! defensively. Don't rely on ``company policy,'' since that can change at ! any time; don't rely on an individual executive's private word, since ! that person may be replaced. Get a commitment just as binding as the ! commitment they get from you. @item ! Write to Congress to explain the importance of this issue. @display --- 1019,1036 ---- @item ! When employers ask you to sign contracts giving them copyright on your ! work, insist on a clause saying they will not claim the copyright covers ! imitating the interface. ! ! @item ! When employers ask you to sign contracts giving them patent rights, ! insist on clauses saying they can use these rights only defensively. ! Don't rely on ``company policy,'' since that can change at any time; ! don't rely on an individual executive's private word, since that person ! may be replaced. Get a commitment just as binding as the commitment ! they get from you. @item ! Write to Congress to explain the importance of these issues. @display *************** *** 1731,1735 **** instructions they must be emulated by the operating system. Long doubles do not work in Sun OS versions 4.0.3 and earlier, because the ! kernel eumulator uses an obsolete and incompatible format. Long doubles do not work in Sun OS version 4.1.1 due to a problem in a Sun library. Long doubles do work on Sun OS versions 4.1.2 and higher, but GNU CC --- 1751,1755 ---- instructions they must be emulated by the operating system. Long doubles do not work in Sun OS versions 4.0.3 and earlier, because the ! kernel emulator uses an obsolete and incompatible format. Long doubles do not work in Sun OS version 4.1.1 due to a problem in a Sun library. Long doubles do work on Sun OS versions 4.1.2 and higher, but GNU CC *************** *** 1765,1769 **** @item ! In extremely rare cases involvving some very large functions you may receive errors from the HP linker complaining about an out of bounds unconditional branch offset. This used to occur more often in previous --- 1785,1789 ---- @item ! In extremely rare cases involving some very large functions you may receive errors from the HP linker complaining about an out of bounds unconditional branch offset. This used to occur more often in previous *************** *** 1904,1908 **** @smallexample ! -L/usr/local/lib/gcc-lib/we32k-att-sysv/2.7.0 -lgcc -lc_s @end smallexample --- 1924,1928 ---- @smallexample ! -L/usr/local/lib/gcc-lib/we32k-att-sysv/2.7.1 -lgcc -lc_s @end smallexample *************** *** 2503,2507 **** Code like this may run successfully under some other compilers, especially those that delete temporaries relatively late. However, the ! GNU C++ behavior is also standard-conformant, so if your program depends on late destruction of temporaries it is not portable. --- 2523,2527 ---- Code like this may run successfully under some other compilers, especially those that delete temporaries relatively late. However, the ! GNU C++ behavior is also standard-conforming, so if your program depends on late destruction of temporaries it is not portable. *************** *** 2985,2990 **** GNU Compiler Bugs Free Software Foundation ! 675 Mass Ave ! Cambridge, MA 02139 @end example --- 3005,3010 ---- GNU Compiler Bugs Free Software Foundation ! 59 Temple Place - Suite 330 ! Boston, MA 02111-1307, USA @end example *************** *** 4558,4561 **** --- 4578,4710 ---- benefit of GNU CC's built-in @code{alloca}. + @node Fragments + @chapter Makefile Fragments + @cindex makefile fragment + + When you configure GNU CC using the @file{configure} script + (@pxref{Installation}), it will construct the file @file{Makefile} from + the template file @file{Makefile.in}. When it does this, it will + incorporate makefile fragment files from the @file{config} directory, + named @file{t-@var{target}} and @file{x-@var{host}}. If these files do + not exist, it means nothing needs to be added for a given target or + host. + + @menu + * Target Fragment:: Writing the @file{t-@var{target}} file. + * Host Fragment:: Writing the @file{x-@var{host}} file. + @end menu + + @node Target Fragment + @section The Target Makefile Fragment + @cindex target makefile fragment + @cindex @file{t-@var{target}} + + The target makefile fragment, @file{t-@var{target}}, defines special + target dependent variables and targets used in the @file{Makefile}: + + @table @code + @findex LIBGCC1 + @item LIBGCC1 + The rule to use to build @file{libgcc1.a}. + If your target does not need to use the functions in @file{libgcc1.a}, + set this to empty. + @xref{Interface}. + + @findex CROSS_LIBGCC1 + @item CROSS_LIBGCC1 + The rule to use to build @file{libgcc1.a} when building a cross + compiler. If your target does not need to use the functions in + @file{libgcc1.a}, set this to empty. @xref{Cross Runtime}. + + @findex LIBGCC2_CFLAGS + @item LIBGCC2_CFLAGS + Compiler flags to use when compiling @file{libgcc2.c}. + + @findex LIB2FUNCS_EXTRA + @item LIB2FUNCS_EXTRA + A list of source file names to be compiled or assembled and inserted + into @file{libgcc.a}. + + @findex CRTSTUFF_T_CFLAGS + @item CRTSTUFF_T_CFLAGS + Special flags used when compiling @file{crtstuff.c}. + @xref{Initialization}. + + @findex MULTILIB_OPTIONS + @item MULTILIB_OPTIONS + For some targets, invoking GNU CC in different ways produces objects + that can not be linked together. For example, for some targets GNU CC + produces both big and little endian code. For these targets, you must + arrange for multiple versions of @file{libgcc.a} to be compiled, one for + each set of incompatible options. When GNU CC invokes the linker, it + arranges to link in the right version of @file{libgcc.a}, based on + the command line options used. + + The @code{MULTILIB_OPTIONS} macro lists the set of options for which + special versions of @file{libgcc.a} must be built. Write options that + are mutually incompatible side by side, separated by a slash. Write + options that may be used together separated by a space. The build + procedure will build all combinations of compatible options. + + For example, if you set @code{MULTILIB_OPTIONS} to @samp{m68000/m68020 + msoft-float}, @file{Makefile} will build special versions of + @file{libgcc.a} using the options @samp{-m68000}, @samp{-m68020}, + @samp{-msoft-float}, @samp{-m68000 -msoft-float}, and @samp{-m68020 + -msoft-float}. + + @findex MULTILIB_DIRNAMES + @item MULTILIB_DIRNAMES + If @code{MULTILIB_OPTIONS} is used, this variable specifies the + directory names that should be used to hold the various libraries. + Write one element in @code{MULTILIB_DIRNAMES} for each element in + @code{MULTILIB_OPTIONS}. If @code{MULTILIB_DIRNAMES} is not used, the + default value will be @code{MULTILIB_OPTIONS}, with all slashes treated + as spaces. + + For example, if @code{MULTILIB_OPTIONS} is @samp{m68000/m68020 + msoft-float}, then the default value of @code{MULTILIB_DIRNAMES} is + @samp{m68000 m68020 msoft-float}. You may specify a different value if + you desire a different set of directory names. + + @findex MULTILIB_MATCHES + @item MULTILIB_MATCHES + Sometimes the same option may be written in two different ways. If an + option is listed in @code{MULTILIB_OPTIONS}, GNU CC needs to know about + any synonyms. In that case, set @code{MULTILIB_MATCHES} to a list of + items of the form @samp{option=option} to describe all relevant + synonyms. For example, @samp{m68000=mc68000 m68020=mc68020}. + @end table + + @node Host Fragment + @section The Host Makefile Fragment + @cindex host makefile fragment + @cindex @file{x-@var{host}} + + The host makefile fragment, @file{x-@var{host}}, defines special host + dependent variables and targets used in the @file{Makefile}: + + @table @code + @findex CC + @item CC + The compiler to use when building the first stage. + + @findex CLIB + @item CLIB + Additional host libraries to link with. + + @findex OLDCC + @item OLDCC + The compiler to use when building @file{libgcc1.a} for a native + compilation. + + @findex OLDAR + @item OLDAR + The version of @code{ar} to use when building @file{libgcc1.a} for a native + compilation. + + @findex INSTALL + @item INSTALL + The install program to use. + @end table @node Index diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/genmultilib gcc-2.7.1/genmultilib *** gcc-2.7.0/genmultilib Thu Jun 15 17:05:25 1995 --- gcc-2.7.1/genmultilib Fri Oct 20 18:56:37 1995 *************** *** 1,5 **** #!/bin/sh # Generates multilib.h. ! # Copyright (C) 1994 Free Software Foundation, Inc. #This file is part of GNU CC. --- 1,5 ---- #!/bin/sh # Generates multilib.h. ! # Copyright (C) 1994, 1995 Free Software Foundation, Inc. #This file is part of GNU CC. *************** *** 60,72 **** # "m68000=mc68000" # This produces: ! # #define MULTILIB_MATCHES "\ ! # m68000/msoft-float m68000 msoft-float;\ ! # m68000/msoft-float mc68000 msoft-float;\ ! # m68020/msoft-float m68020 msoft-float;\ ! # msoft-float !m68000 !mc68000 !m68020 msoft-float;\ ! # m68000 m68000 !msoft-float;\ ! # m68000 mc60000 !msoft-float;\ ! # m68020 m68020 !msoft-float;\ # . !m68000 !mc68000 !m68020 !msoft-float;\ # " # The effect is that `gcc -msoft-float' (for example) will append --- 60,72 ---- # "m68000=mc68000" # This produces: ! # #define MULTILIB_SELECT "\ # . !m68000 !mc68000 !m68020 !msoft-float;\ + # m68000 m68000 !m68020 !msoft-float;\ + # m68000 mc60000 !m68020 !msoft-float;\ + # m68020 !m68000 !mc68000 m68020 !msoft-float;\ + # msoft-float !m68000 !mc68000 !m68020 msoft-float;\ + # m68000/msoft-float m68000 !m68020 msoft-float;\ + # m68000/msoft-float mc68000 !m68020 msoft-float;\ + # m68020/msoft-float !m68000 !mc68000 m68020 msoft-float;\ # " # The effect is that `gcc -msoft-float' (for example) will append *************** *** 162,171 **** l=`echo ${first} | sed -e 's/=.*$//' -e 's/?/=/g'` r=`echo ${first} | sed -e 's/^.*=//' -e 's/?/=/g'` ! case " ${optout} " in ! *" ${l} "*) newopt=`echo " ${optout} " | sed -e "s/ ${l} / ${r} /" -e 's/^ //' -e 's/ $//'` dirout="${dirout}" optout="${newopt}" ./tmpmultilib2 $@ ! ;; ! esac fi EOF --- 162,169 ---- l=`echo ${first} | sed -e 's/=.*$//' -e 's/?/=/g'` r=`echo ${first} | sed -e 's/^.*=//' -e 's/?/=/g'` ! if expr " ${optout} " : ".* ${l} .*" > /dev/null; then newopt=`echo " ${optout} " | sed -e "s/ ${l} / ${r} /" -e 's/^ //' -e 's/ $//'` dirout="${dirout}" optout="${newopt}" ./tmpmultilib2 $@ ! fi fi EOF *************** *** 203,226 **** # Look through the options. We must output each option that is ! # present, and negate each option that is not present. If an ! # element of a set is present, we need not negate the other elements ! # of the set. optout= for set in ${options}; do setopts=`echo ${set} | sed -e 's|/| |g'` - found= for opt in ${setopts}; do ! case "${combo}" in ! *"/${opt}/"*) optout="${optout} ${opt}" ! found=yes ! ;; ! esac ! done ! if [ "${found}" = "" ]; then ! for opt in ${setopts}; do optout="${optout} !${opt}" ! done ! fi done optout=`echo ${optout} | sed -e 's/^ //'` --- 201,215 ---- # Look through the options. We must output each option that is ! # present, and negate each option that is not present. optout= for set in ${options}; do setopts=`echo ${set} | sed -e 's|/| |g'` for opt in ${setopts}; do ! if expr "${combo} " : ".*/${opt}/.*" > /dev/null; then optout="${optout} ${opt}" ! else optout="${optout} !${opt}" ! fi ! done done optout=`echo ${optout} | sed -e 's/^ //'` diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/genrecog.c gcc-2.7.1/genrecog.c *** gcc-2.7.0/genrecog.c Thu Jun 15 07:43:46 1995 --- gcc-2.7.1/genrecog.c Thu Oct 26 19:13:09 1995 *************** *** 1,4 **** /* Generate code from machine description to recognize rtl as insns. ! Copyright (C) 1987, 1988, 1992, 1993, 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Generate code from machine description to recognize rtl as insns. ! Copyright (C) 1987, 88, 92, 93, 94, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 1344,1354 **** printf ("XINT (x%d, 1) == %d && ", depth, p->elt_one_int); if (p->test_elt_zero_wide) ! printf ( #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT ! "XWINT (x%d, 0) == %d && ", #else ! "XWINT (x%d, 0) == %ld && ", #endif ! depth, p->elt_zero_wide); if (p->veclen) printf ("XVECLEN (x%d, 0) == %d && ", depth, p->veclen); --- 1344,1363 ---- printf ("XINT (x%d, 1) == %d && ", depth, p->elt_one_int); if (p->test_elt_zero_wide) ! { ! /* Set offset to 1 iff the number might get propagated to ! unsigned long by ANSI C rules, else 0. ! Prospective hosts are required to have at least 32 bit ! ints, and integer constants in machine descriptions ! must fit in 32 bit, thus it suffices to check only ! for 1 << 31 . */ ! HOST_WIDE_INT offset = p->elt_zero_wide == -2147483647 - 1; ! printf ( #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT ! "XWINT (x%d, 0) == %d%s && ", #else ! "XWINT (x%d, 0) == %ld%s && ", #endif ! depth, p->elt_zero_wide + offset, offset ? "-1" : ""); ! } if (p->veclen) printf ("XVECLEN (x%d, 0) == %d && ", depth, p->veclen); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/getopt.c gcc-2.7.1/getopt.c *** gcc-2.7.0/getopt.c Thu Jun 15 18:11:54 1995 --- gcc-2.7.1/getopt.c Thu Nov 9 11:29:41 1995 *************** *** 60,70 **** #endif /* GNU C library. */ /* This is for other GNU distributions with internationalized messages. ! The GNU C Library itself does not yet support such messages. */ ! #if HAVE_LIBINTL_H # include #else ! # define gettext(msgid) (msgid) #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' --- 60,73 ---- #endif /* GNU C library. */ + #ifndef _ /* This is for other GNU distributions with internationalized messages. ! When compiling libc, the _ macro is predefined. */ ! #ifdef HAVE_LIBINTL_H # include + # define _(msgid) gettext (msgid) #else ! # define _(msgid) (msgid) #endif + #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' *************** *** 517,521 **** { if (opterr) ! fprintf (stderr, gettext ("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); --- 520,524 ---- { if (opterr) ! fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); *************** *** 540,544 **** /* --option */ fprintf (stderr, ! gettext ("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else --- 543,547 ---- /* --option */ fprintf (stderr, ! _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else *************** *** 545,549 **** /* +option or -option */ fprintf (stderr, ! gettext ("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); --- 548,552 ---- /* +option or -option */ fprintf (stderr, ! _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); *************** *** 560,564 **** if (opterr) fprintf (stderr, ! gettext ("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); --- 563,567 ---- if (opterr) fprintf (stderr, ! _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); *************** *** 588,596 **** if (argv[optind][1] == '-') /* --option */ ! fprintf (stderr, gettext ("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ ! fprintf (stderr, gettext ("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } --- 591,599 ---- if (argv[optind][1] == '-') /* --option */ ! fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ ! fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } *************** *** 617,624 **** if (posixly_correct) /* 1003.2 specifies the format of this message. */ ! fprintf (stderr, gettext ("%s: illegal option -- %c\n"), argv[0], c); else ! fprintf (stderr, gettext ("%s: invalid option -- %c\n"), argv[0], c); } --- 620,627 ---- if (posixly_correct) /* 1003.2 specifies the format of this message. */ ! fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else ! fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } *************** *** 656,660 **** /* 1003.2 specifies the format of this message. */ fprintf (stderr, ! gettext ("%s: option requires an argument -- %c\n"), argv[0], c); } --- 659,663 ---- /* 1003.2 specifies the format of this message. */ fprintf (stderr, ! _("%s: option requires an argument -- %c\n"), argv[0], c); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/ginclude/stdarg.h gcc-2.7.1/ginclude/stdarg.h *** gcc-2.7.0/ginclude/stdarg.h Sun Apr 30 08:10:28 1995 --- gcc-2.7.1/ginclude/stdarg.h Tue Sep 12 12:50:36 1995 *************** *** 39,42 **** --- 39,45 ---- #include #else + #if defined (__PPC__) && defined (_CALL_SYSV) + #include + #else /* Define __gnuc_va_list. */ *************** *** 44,48 **** #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST ! #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) typedef char *__gnuc_va_list; #else --- 47,51 ---- #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST ! #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__) typedef char *__gnuc_va_list; #else *************** *** 91,94 **** --- 94,98 ---- #endif /* _STDARG_H */ + #endif /* not powerpc with V.4 calling sequence */ #endif /* not h8300 */ #endif /* not alpha */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/ginclude/stddef.h gcc-2.7.1/ginclude/stddef.h *** gcc-2.7.0/ginclude/stddef.h Tue May 30 19:02:59 1995 --- gcc-2.7.1/ginclude/stddef.h Sat Aug 19 16:39:22 1995 *************** *** 238,242 **** --- 238,244 ---- #define __WCHAR_TYPE__ int #endif + #ifndef __cplusplus typedef __WCHAR_TYPE__ wchar_t; + #endif #endif #endif diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/ginclude/va-alpha.h gcc-2.7.1/ginclude/va-alpha.h *** gcc-2.7.0/ginclude/va-alpha.h Fri Jun 16 06:57:21 1995 --- gcc-2.7.1/ginclude/va-alpha.h Thu Aug 31 18:16:05 1995 *************** *** 13,17 **** typedef struct { char *__base; /* Pointer to first integer register. */ ! long __offset; /* Byte offset of args so far. */ } __gnuc_va_list; #endif /* not __GNUC_VA_LIST */ --- 13,17 ---- typedef struct { char *__base; /* Pointer to first integer register. */ ! int __offset; /* Byte offset of args so far. */ } __gnuc_va_list; #endif /* not __GNUC_VA_LIST */ *************** *** 87,92 **** #define __va_tsize(__type) \ ! (((sizeof (__type) + sizeof (long long) - 1) \ ! / sizeof (long long)) * sizeof (long long)) #define va_arg(__va, __type) \ --- 87,92 ---- #define __va_tsize(__type) \ ! (((sizeof (__type) + __extension__ sizeof (long long) - 1) \ ! / __extension__ sizeof (long long)) * __extension__ sizeof (long long)) #define va_arg(__va, __type) \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/ginclude/va-mips.h gcc-2.7.1/ginclude/va-mips.h *** gcc-2.7.0/ginclude/va-mips.h Fri Feb 24 21:28:34 1995 --- gcc-2.7.1/ginclude/va-mips.h Sun Aug 13 21:32:30 1995 *************** *** 8,12 **** ! /* These macros implement varargs for GNU C--either traditional or ANSU. */ /* Define __gnuc_va_list. */ --- 8,12 ---- ! /* These macros implement varargs for GNU C--either traditional or ANSI. */ /* Define __gnuc_va_list. */ *************** *** 30,34 **** #endif ! #if __mips>=3 #define __va_rounded_size(__TYPE) \ (((sizeof (__TYPE) + 8 - 1) / 8) * 8) --- 30,34 ---- #endif ! #ifdef __mips64 #define __va_rounded_size(__TYPE) \ (((sizeof (__TYPE) + 8 - 1) / 8) * 8) *************** *** 44,59 **** #ifdef _STDARG_H - #if defined(_MIPS_SIM) && (_MIPS_SIM == _MIPS_SIM_ABI64) - #define va_start(__AP, __LASTARG) \ - (__AP = __builtin_next_arg (__LASTARG) - 64 \ - + (__builtin_args_info (2) > 8 ? 64 : __builtin_args_info(2) * 8)) - #else #define va_start(__AP, __LASTARG) \ (__AP = (__gnuc_va_list) __builtin_next_arg (__LASTARG)) - #endif #else #define va_alist __builtin_va_alist ! #if __mips>=3 /* This assumes that `long long int' is always a 64 bit type. */ #define va_dcl long long int __builtin_va_alist; __va_ellipsis --- 44,53 ---- #ifdef _STDARG_H #define va_start(__AP, __LASTARG) \ (__AP = (__gnuc_va_list) __builtin_next_arg (__LASTARG)) #else #define va_alist __builtin_va_alist ! #ifdef __mips64 /* This assumes that `long long int' is always a 64 bit type. */ #define va_dcl long long int __builtin_va_alist; __va_ellipsis *************** *** 61,70 **** #define va_dcl int __builtin_va_alist; __va_ellipsis #endif ! /* Need alternate code for _MIPS_SIM_ABI64, but don't use that symbol ! because it may not be defined. */ #if defined(_MIPS_SIM) && (_MIPS_SIM == _MIPS_SIM_ABI64) #define va_start(__AP) \ ! (__AP = __builtin_next_arg () - 64 \ ! + (__builtin_args_info (2) > 8 ? 64 : __builtin_args_info(2) * 8)) #else #define va_start(__AP) __AP = (char *) &__builtin_va_alist --- 55,63 ---- #define va_dcl int __builtin_va_alist; __va_ellipsis #endif ! /* Need alternate code for _MIPS_SIM_ABI64. */ #if defined(_MIPS_SIM) && (_MIPS_SIM == _MIPS_SIM_ABI64) #define va_start(__AP) \ ! (__AP = (__gnuc_va_list) __builtin_next_arg () \ ! + (__builtin_args_info (2) >= 8 ? -8 : 0)) #else #define va_start(__AP) __AP = (char *) &__builtin_va_alist *************** *** 79,87 **** /* We cast to void * and then to TYPE * because this avoids a warning about increasing the alignment requirement. */ ! /* The __mips>=3 cases are reversed from the 32 bit cases, because the standard 32 bit calling convention left-aligns all parameters smaller than a word, ! whereas the __mips>=3 calling convention does not (and hence they are right aligned). */ ! #if __mips>=3 #ifdef __MIPSEB__ #define va_arg(__AP, __type) \ --- 72,80 ---- /* We cast to void * and then to TYPE * because this avoids a warning about increasing the alignment requirement. */ ! /* The __mips64 cases are reversed from the 32 bit cases, because the standard 32 bit calling convention left-aligns all parameters smaller than a word, ! whereas the __mips64 calling convention does not (and hence they are right aligned). */ ! #ifdef __mips64 #ifdef __MIPSEB__ #define va_arg(__AP, __type) \ *************** *** 95,99 **** #endif ! #else /* not __mips>=3 */ #ifdef __MIPSEB__ --- 88,92 ---- #endif ! #else /* not __mips64 */ #ifdef __MIPSEB__ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/ginclude/va-ppc.h gcc-2.7.1/ginclude/va-ppc.h *** gcc-2.7.0/ginclude/va-ppc.h --- gcc-2.7.1/ginclude/va-ppc.h Mon Oct 9 12:35:19 1995 *************** *** 0 **** --- 1,144 ---- + /* GNU C varargs support for the PowerPC with V.4 calling sequence */ + + /* Define __gnuc_va_list. */ + + #ifndef __GNUC_VA_LIST + #define __GNUC_VA_LIST + + /* Note that the names in this structure are in the user's namespace, but + that the V.4 abi explicitly states that these names should be used. */ + typedef struct { + char gpr; /* index into the array of 8 GPRs stored in the + register save area gpr=0 corresponds to r3, + gpr=1 to r4, etc. */ + char fpr; /* index into the array of 8 FPRs stored in the + register save area fpr=0 corresponds to f1, + fpr=1 to f2, etc. */ + char *overflow_arg_area; /* location on stack that holds the next + overflow argument */ + char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */ + } __gnuc_va_list[1]; + #endif /* not __GNUC_VA_LIST */ + + /* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ + #if defined (_STDARG_H) || defined (_VARARGS_H) + + /* Register save area located below the frame pointer */ + typedef struct { + long __gp_save[8]; /* save area for GP registers */ + double __fp_save[8]; /* save area for FP registers */ + } __va_regsave_t; + + /* Macros to access the register save area */ + /* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ + #define __VA_FP_REGSAVE(AP,TYPE) \ + ((TYPE *) (void *) (&(((__va_regsave_t *) \ + (AP)->reg_save_area)->__fp_save[(int)(AP)->fpr]))) + + #define __VA_GP_REGSAVE(AP,TYPE) \ + ((TYPE *) (void *) (&(((__va_regsave_t *) \ + (AP)->reg_save_area)->__gp_save[(int)(AP)->gpr]))) + + /* Common code for va_start for both varargs and stdarg. This depends + on the format of rs6000_args in rs6000.h. The fields used are: + + #0 WORDS # words used for GP regs/stack values + #1 FREGNO next available FP register + #2 NARGS_PROTOTYPE # args left in the current prototype + #3 ORIG_NARGS original value of NARGS_PROTOTYPE + #4 VARARGS_OFFSET offset from frame pointer of varargs area */ + + #define __va_words __builtin_args_info (0) + #define __va_fregno __builtin_args_info (1) + #define __va_nargs __builtin_args_info (2) + #define __va_orig_nargs __builtin_args_info (3) + #define __va_varargs_offset __builtin_args_info (4) + + #define __va_start_common(AP, FAKE) \ + __extension__ ({ \ + register int __words = __va_words - FAKE; \ + \ + (AP)->gpr = (__words < 8) ? __words : 8; \ + (AP)->fpr = __va_fregno - 33; \ + (AP)->reg_save_area = (((char *) __builtin_frame_address (0)) \ + + __va_varargs_offset); \ + (AP)->overflow_arg_area = ((char *)__builtin_saveregs () \ + + (((__words >= 8) ? __words - 8 : 0) \ + * sizeof (long))); \ + (void)0; \ + }) + + #ifdef _STDARG_H /* stdarg.h support */ + + /* Calling __builtin_next_arg gives the proper error message if LASTARG is + not indeed the last argument. */ + #define va_start(AP,LASTARG) \ + (__builtin_next_arg (LASTARG), __va_start_common (AP, 0)) + + #else /* varargs.h support */ + + #define va_start(AP) __va_start_common (AP, 1) + #define va_alist __va_1st_arg + #define va_dcl register int va_alist; ... + + #endif /* _STDARG_H */ + + #ifdef _SOFT_FLOAT + #define __va_float_p(TYPE) 0 + #else + #define __va_float_p(TYPE) (__builtin_classify_type(*(TYPE *)0) == 8) + #endif + + #define __va_aggregate_p(TYPE) (__builtin_classify_type(*(TYPE *)0) >= 12) + #define __va_size(TYPE) ((sizeof(TYPE) + sizeof (long) - 1) / sizeof (long)) + + #define va_arg(AP,TYPE) \ + __extension__ (*({ \ + register TYPE *__ptr; \ + \ + if (__va_float_p (TYPE) && (AP)->fpr < 8) \ + { \ + __ptr = __VA_FP_REGSAVE (AP, TYPE); \ + (AP)->fpr++; \ + } \ + \ + else if (__va_aggregate_p (TYPE) && (AP)->gpr < 8) \ + { \ + __ptr = * __VA_GP_REGSAVE (AP, TYPE *); \ + (AP)->gpr++; \ + } \ + \ + else if (!__va_float_p (TYPE) && !__va_aggregate_p (TYPE) \ + && (AP)->gpr + __va_size(TYPE) <= 8) \ + { \ + __ptr = __VA_GP_REGSAVE (AP, TYPE); \ + (AP)->gpr += __va_size (TYPE); \ + } \ + \ + else if (!__va_float_p (TYPE) && !__va_aggregate_p (TYPE) \ + && (AP)->gpr < 8) \ + { \ + (AP)->gpr = 8; \ + __ptr = (TYPE *) (void *) ((AP)->overflow_arg_area); \ + (AP)->overflow_arg_area += __va_size (TYPE) * sizeof (long); \ + } \ + \ + else if (__va_aggregate_p (TYPE)) \ + { \ + __ptr = * (TYPE **) (void *) ((AP)->overflow_arg_area); \ + (AP)->overflow_arg_area += sizeof (TYPE *); \ + } \ + else \ + { \ + __ptr = (TYPE *) (void *) ((AP)->overflow_arg_area); \ + (AP)->overflow_arg_area += __va_size (TYPE) * sizeof (long); \ + } \ + \ + __ptr; \ + })) + + #define va_end(AP) ((void)0) + + #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/ginclude/va-sparc.h gcc-2.7.1/ginclude/va-sparc.h *** gcc-2.7.0/ginclude/va-sparc.h Fri Apr 14 19:43:11 1995 --- gcc-2.7.1/ginclude/va-sparc.h Tue Sep 12 18:52:08 1995 *************** *** 75,79 **** AP.__va_next_fp_limit = (AP.__va_next_fp + \ (__builtin_args_info (1) < 16 ? (16 - __builtin_args_info (1) + 1) / 2 : 0)); \ ! AP.__va_next_stack = (__va_greg *) __builtin_next_arg (__builtin_va_alist); \ }) #else --- 75,80 ---- AP.__va_next_fp_limit = (AP.__va_next_fp + \ (__builtin_args_info (1) < 16 ? (16 - __builtin_args_info (1) + 1) / 2 : 0)); \ ! AP.__va_next_stack = (__va_greg *) __builtin_next_arg (__builtin_va_alist) \ ! - (__builtin_args_info (0) >= 6 || __builtin_args_info (1) >= 16 ? 1 : 0); \ }) #else *************** *** 185,189 **** #define va_arg(pvar,TYPE) \ __extension__ \ ! (*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class) \ ? ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE *), \ *(TYPE **) (void *) ((char *)(pvar) - __va_rounded_size (TYPE *))) \ --- 186,192 ---- #define va_arg(pvar,TYPE) \ __extension__ \ ! (*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \ ! || (__builtin_classify_type (*(TYPE*) 0) == __real_type_class \ ! && sizeof (TYPE) == 16)) \ ? ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE *), \ *(TYPE **) (void *) ((char *)(pvar) - __va_rounded_size (TYPE *))) \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/ginclude/varargs.h gcc-2.7.1/ginclude/varargs.h *** gcc-2.7.0/ginclude/varargs.h Sun Apr 30 08:10:30 1995 --- gcc-2.7.1/ginclude/varargs.h Sun Aug 13 18:18:55 1995 *************** *** 37,40 **** --- 37,43 ---- #include #else + #if defined (__PPC__) && defined (_CALL_SYSV) + #include + #else #ifdef __NeXT__ *************** *** 109,112 **** --- 112,116 ---- #endif /* big-endian */ + #endif /* not powerpc with V.4 calling sequence */ #endif /* not h8300 */ #endif /* not alpha */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/gmon.c gcc-2.7.1/gmon.c *** gcc-2.7.0/gmon.c Sat Mar 14 00:04:01 1992 --- gcc-2.7.1/gmon.c Thu Aug 31 17:51:55 1995 *************** *** 49,52 **** --- 49,56 ---- extern char *minbrk asm ("minbrk"); + #ifdef __alpha + extern char *sbrk (); + #endif + /* * froms is actually a bunch of unsigned shorts indexing tos Binary files gcc-2.7.0/hv and gcc-2.7.1/hv differ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/install.texi gcc-2.7.1/install.texi *** gcc-2.7.0/install.texi Fri Jun 16 15:42:32 1995 --- gcc-2.7.1/install.texi Sat Nov 4 10:28:11 1995 *************** *** 71,78 **** Here is an example: ! from an MSDOS console window or from the program manager dialog box. ! Configure.bat assumes that you have already installed and in your path a ! Unix-like sed program which is used to modify Makefile.in to create a ! working Makefile.@smallexample ./configure --build=sparc-sun-sunos4.1 @end smallexample --- 71,75 ---- Here is an example: ! @smallexample ./configure --build=sparc-sun-sunos4.1 @end smallexample *************** *** 193,207 **** @item @ifset INTERNALS ! A symbolic link named @file{config.h} is made to the top-level config ! file for the machine you will run the compiler on (@pxref{Config}). ! This file is responsible for defining information about the host ! machine. It includes @file{tm.h}. @end ifset @ifclear INTERNALS ! A symbolic link named @file{config.h} is made to the top-level config ! file for the machine you plan to run the compiler on (@pxref{Config,,The ! Configuration File, gcc.info, Using and Porting GCC}). This file is ! responsible for defining information about the host machine. It ! includes @file{tm.h}. @end ifclear --- 190,204 ---- @item @ifset INTERNALS ! A file named @file{config.h} is created that contains a @samp{#include} ! of the top-level config file for the machine you will run the compiler ! on (@pxref{Config}). This file is responsible for defining information ! about the host machine. It includes @file{tm.h}. @end ifset @ifclear INTERNALS ! A file named @file{config.h} is created that contains a @samp{#include} ! of the top-level config file for the machine you will run the compiler ! on (@pxref{Config,,The Configuration File, gcc.info, Using and Porting ! GCC}). This file is responsible for defining information about the host ! machine. It includes @file{tm.h}. @end ifclear *************** *** 215,219 **** @item ! A symbolic link named @file{tconfig.h} is made to the top-level config file for your target machine. This is used for compiling certain programs to run on that machine. --- 212,216 ---- @item ! A file named @file{tconfig.h} is created which includes the top-level config file for your target machine. This is used for compiling certain programs to run on that machine. *************** *** 220,238 **** @item ! A symbolic link named @file{tm.h} is made to the machine-description ! macro file for your target machine. It should be in the subdirectory ! @file{config} and its name is often @file{@var{machine}.h}. ! ! @item ! A symbolic link named @file{md} will be made to the machine description ! pattern file. It should be in the @file{config} subdirectory and its ! name should be @file{@var{machine}.md}; but @var{machine} is often not ! the same as the name used in the @file{tm.h} file because the ! @file{md} files are more general. ! ! @item ! A symbolic link named @file{aux-output.c} will be made to the output ! subroutine file for your machine. It should be in the @file{config} ! subdirectory and its name should be @file{@var{machine}.c}. @item --- 217,224 ---- @item ! A file named @file{tm.h} is created which includes the ! machine-description macro file for your target machine. It should be in ! the subdirectory @file{config} and its name is often ! @file{@var{machine}.h}. @item *************** *** 243,247 **** @file{x-@var{host}}. If these files do not exist, it means nothing needs to be added for a given target or host. - @c does the above work now? --mew @end itemize --- 229,232 ---- *************** *** 316,320 **** other files. Likewise, you should ignore warnings about ``constant is so large that it is unsigned'' in @file{insn-emit.c} and ! @file{insn-recog.c}. Any other compilation errors may represent bugs in the port to your machine or operating system, and @ifclear INSTALLONLY --- 301,306 ---- other files. Likewise, you should ignore warnings about ``constant is so large that it is unsigned'' in @file{insn-emit.c} and ! @file{insn-recog.c} and a warning about a comparison always being zero ! in @file{enquire.o}. Any other compilation errors may represent bugs in the port to your machine or operating system, and @ifclear INSTALLONLY *************** *** 362,366 **** @smallexample ! make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O" @end smallexample --- 348,352 ---- @smallexample ! make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2" @end smallexample *************** *** 387,391 **** @smallexample ! make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O -msoft-float" @end smallexample --- 373,377 ---- @smallexample ! make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -msoft-float" @end smallexample *************** *** 427,435 **** On some systems, meaningful comparison of object files is impossible; they always appear ``different.'' This is currently true on Solaris and ! probably on all systems that use ELF object file format. On some ! versions of Irix on SGI machines and OSF/1 on Alpha systems, you will ! not be able to compare the files without specifying @file{-save-temps}; ! see the description of individual systems above to see if you get ! comparison failures. You may have similar problems on other systems. Use this command to compare the files: --- 413,421 ---- On some systems, meaningful comparison of object files is impossible; they always appear ``different.'' This is currently true on Solaris and ! some systems that use ELF object file format. On some versions of Irix ! on SGI machines and DEC Unix (OSF/1) on Alpha systems, you will not be ! able to compare the files without specifying @file{-save-temps}; see the ! description of individual systems above to see if you get comparison ! failures. You may have similar problems on other systems. Use this command to compare the files: *************** *** 462,473 **** @item - Build the Objective C library (if you have built the Objective C - compiler). Here is the command to do this: - - @smallexample - make objc-runtime CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" - @end smallexample - - @item Install the compiler driver, the compiler's passes and run-time support with @samp{make install}. Use the same value for @code{CC}, --- 448,451 ---- *************** *** 514,525 **** @item - Install the Objective C library (if you are installing the Objective C - compiler). Here is the command to do this: - - @smallexample - make install-libobjc CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" - @end smallexample - - @item If you're going to use C++, it's likely that you need to also install the libg++ distribution. It should be available from the same --- 492,495 ---- *************** *** 634,638 **** supports the Tektronix Assembler, but instead produces output for @code{as1750}, an assembler/linker available under the GNU Public ! License for the 1750A. Contact @emph{okellogg@@salyko.cube.net} for more details on obtaining @samp{as1750}. A similarly licensed simulator for the 1750A is available from same address. --- 604,608 ---- supports the Tektronix Assembler, but instead produces output for @code{as1750}, an assembler/linker available under the GNU Public ! License for the 1750A. Contact @emph{kellogg@@space.otn.dasa.de} for more details on obtaining @samp{as1750}. A similarly licensed simulator for the 1750A is available from same address. *************** *** 648,661 **** @table @code ! @item NREL The program code section. ! @item SREL The read/write (RAM) data section. ! @item KREL The read-only (ROM) constants section. ! @item IREL Initialization section (code to copy KREL to SREL). @end table --- 618,631 ---- @table @code ! @item Normal The program code section. ! @item Static The read/write (RAM) data section. ! @item Konst The read-only (ROM) constants section. ! @item Init Initialization section (code to copy KREL to SREL). @end table *************** *** 666,684 **** GNU CC. - There is a problem with long argument lists to functions. The compiler - aborts if the sum of space needed by all arguments exceeds 14 words. - This is because the arguments are passed in registers (R0..R13) not on - the stack, and there is a problem with passing further arguments (i.e. - beyond those in R0..R13) via the stack. - - If efficiency is less important than using long argument lists, you - can change the definition of the @code{FUNCTION_ARG} macro in - @file{config/1750/1750a.h} to always return zero. If you do that, - GNU CC will pass all parameters on the stack. - @item alpha-*-osf1 Systems using processors that implement the DEC Alpha architecture and ! are running the OSF/1 operating system, for example the DEC Alpha AXP ! systems. (VMS on the Alpha is not currently supported by GNU CC.) GNU CC writes a @samp{.verstamp} directive to the assembler output file --- 636,644 ---- GNU CC. @item alpha-*-osf1 Systems using processors that implement the DEC Alpha architecture and ! are running the DEC Unix (OSF/1) operating system, for example the DEC ! Alpha AXP systems. (VMS on the Alpha is not currently supported by GNU ! CC.) GNU CC writes a @samp{.verstamp} directive to the assembler output file *************** *** 685,689 **** unless it is built as a cross-compiler. It gets the version to use from the system header file @file{/usr/include/stamp.h}. If you install a ! new version of OSF/1, you should rebuild GCC to pick up the new version stamp. --- 645,649 ---- unless it is built as a cross-compiler. It gets the version to use from the system header file @file{/usr/include/stamp.h}. If you install a ! new version of DEC Unix, you should rebuild GCC to pick up the new version stamp. *************** *** 696,700 **** a few cases and may not work properly. ! @code{make compare} may fail on old versions of OSF/1 unless you add @samp{-save-temps} to @code{CFLAGS}. On these systems, the name of the assembler input file is stored in the object file, and that makes --- 656,660 ---- a few cases and may not work properly. ! @code{make compare} may fail on old versions of DEC Unix unless you add @samp{-save-temps} to @code{CFLAGS}. On these systems, the name of the assembler input file is stored in the object file, and that makes *************** *** 888,893 **** @item i386-*-linuxaout ! Use this configuration to generate a.out binaries on Linux. This is an ! obsolete configuration. You must use gas/binutils version 2.5.2 or later. --- 848,853 ---- @item i386-*-linuxaout ! Use this configuration to generate a.out binaries on Linux. This configuration ! is being superseded. You must use gas/binutils version 2.5.2 or later. *************** *** 1309,1319 **** GNU CC. Also, releases of AIX prior to AIX 3.2.4 include a version of the IBM assembler which does not accept debugging directives: assembler ! updates are available as PTFs. See the file @file{README.RS6000} for ! more details on both of these problems. ! Only AIX is supported on the PowerPC. GNU CC does not yet support the ! 64-bit PowerPC instructions. ! Objective C does not work on this architecture. AIX on the RS/6000 provides support (NLS) for environments outside of --- 1269,1281 ---- GNU CC. Also, releases of AIX prior to AIX 3.2.4 include a version of the IBM assembler which does not accept debugging directives: assembler ! updates are available as PTFs. Also, if you are using AIX 3.2.5 or ! greater and the GNU assembler, you must have a version modified after ! October 16th, 1995 in order for the GNU C compiler to build. See the ! file @file{README.RS6000} for more details on of these problems. ! GNU CC does not yet support the 64-bit PowerPC instructions. ! Objective C does not work on this architecture because it makes assumptions ! that are incompatible with the calling conventions. AIX on the RS/6000 provides support (NLS) for environments outside of *************** *** 1326,1346 **** "C" or "En_US". @item powerpc-*-elf @itemx powerpc-*-sysv4 ! PowerPC system in big endian mode, running System V.4. This system is ! currently under development. @item powerpc-*-eabi ! Embedded PowerPC system in big endian mode. This system is currently ! under development. @item powerpcle-*-elf ! @itemx powerpcle-*-eabi ! PowerPC system in little endian mode, running System V.4. This system ! is currently under development. @itemx powerpcle-*-sysv4 ! Embedded PowerPC system in little endian mode. This system is currently ! under development. @item vax-dec-ultrix --- 1288,1339 ---- "C" or "En_US". + Due to changes in the way that GNU CC invokes the binder (linker) for AIX + 4.1, you may now receive warnings of duplicate symbols from the link step + that were not reported before. The assembly files generated by GNU CC for + AIX have always included multiple symbol definitions for certain global + variable and function declarations in the original program. The warnings + should not prevent the linker from producing a correct library or runnable + executable. + @item powerpc-*-elf @itemx powerpc-*-sysv4 ! PowerPC system in big endian mode, running System V.4. ! ! This configuration is currently under development. + @item powerpc-*-eabiaix + Embedded PowerPC system in big endian mode with -mcall-aix selected as + the default. This system is currently under development. + + @item powerpc-*-eabisim + Embedded PowerPC system in big endian mode for use in running under the + PSIM simulator. This system is currently under development. + @item powerpc-*-eabi ! Embedded PowerPC system in big endian mode. + This configuration is currently under development. + @item powerpcle-*-elf ! @itemx powerpcle-*-sysv4 ! PowerPC system in little endian mode, running System V.4. ! ! This configuration is currently under development. @itemx powerpcle-*-sysv4 ! Embedded PowerPC system in little endian mode. ! ! This system is currently under development. ! ! @item powerpcle-*-eabisim ! Embedded PowerPC system in little endian mode for use in running under ! the PSIM simulator. ! ! This system is currently under development. ! ! @itemx powerpcle-*-eabi ! Embedded PowerPC system in little endian mode. ! ! This configuration is currently under development. @item vax-dec-ultrix diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/integrate.c gcc-2.7.1/integrate.c *** gcc-2.7.0/integrate.c Thu Jun 15 07:46:08 1995 --- gcc-2.7.1/integrate.c Fri Oct 20 18:48:13 1995 *************** *** 670,674 **** BLOCK_SUBBLOCKS (t) = nreverse (subblocks); /* If the BLOCK being cloned is already marked as having been instantiated ! from something else, then leave that `origin' marking alone. Elsewise, mark the clone as having originated from the BLOCK we are cloning. */ if (BLOCK_ABSTRACT_ORIGIN (t) == NULL_TREE) --- 670,674 ---- BLOCK_SUBBLOCKS (t) = nreverse (subblocks); /* If the BLOCK being cloned is already marked as having been instantiated ! from something else, then leave that `origin' marking alone. Otherwise, mark the clone as having originated from the BLOCK we are cloning. */ if (BLOCK_ABSTRACT_ORIGIN (t) == NULL_TREE) *************** *** 708,715 **** so modifying the rtl is not a problem. ! ??? Actually, we do not verify that FNDECL is not inline expanded ! by other functions which must also be written down at the end ! of compilation. We could set flag_no_inline to nonzero when ! the time comes to write down such functions. */ void --- 708,715 ---- so modifying the rtl is not a problem. ! We don't have to worry about FNDECL being inline expanded by ! other functions which are written at the end of compilation ! because flag_no_inline is turned on when we begin writing ! functions at the end of compilation. */ void *************** *** 1700,1703 **** --- 1700,1708 ---- = gen_reg_rtx (GET_MODE (SET_DEST (new_set))); } + /* If the source and destination are the same and it + has a note on it, keep the insn. */ + else if (rtx_equal_p (SET_DEST (set), SET_SRC (set)) + && REG_NOTES (insn) != 0) + copy = emit_insn (copy_rtx_and_substitute (pattern, map)); else break; *************** *** 1969,1972 **** --- 1974,1978 ---- { tree d; + tree newd; push_obstacks_nochange (); *************** *** 1987,1992 **** /* These args would always appear unused, if not for this. */ TREE_USED (d) = 1; - /* Prevent warning for shadowing with these. */ - DECL_ABSTRACT_ORIGIN (d) = t; if (DECL_LANG_SPECIFIC (d)) --- 1993,1996 ---- *************** *** 1993,1997 **** copy_lang_decl (d); ! pushdecl (d); } --- 1997,2018 ---- copy_lang_decl (d); ! /* Must set DECL_ABSTRACT_ORIGIN here for local variables, to ensure ! that we don't get -Wshadow warnings. But don't set it here if ! pushdecl might return a duplicate decl, as that will result in ! incorrect DWARF debug info. */ ! if (! DECL_EXTERNAL (d) || ! TREE_PUBLIC (d)) ! /* Prevent warning for shadowing with these. */ ! DECL_ABSTRACT_ORIGIN (d) = t; ! ! newd = pushdecl (d); ! ! /* If we didn't set DECL_ABSTRACT_ORIGIN above, then set it now. ! Simpler to just set it always rather than checking. ! If the decl we get back is the copy of 't' that we started with, ! then set the DECL_ABSTRACT_ORIGIN. Otherwise, we must have a ! duplicate decl, and we got the older one back. In that case, setting ! DECL_ABSTRACT_ORIGIN is not appropriate. */ ! if (newd == d) ! DECL_ABSTRACT_ORIGIN (d) = t; } *************** *** 2911,2915 **** for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg)) DECL_ABSTRACT_ORIGIN (arg) = arg; ! if (DECL_INITIAL (decl) != NULL_TREE) set_block_origin_self (DECL_INITIAL (decl)); } --- 2932,2937 ---- for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg)) DECL_ABSTRACT_ORIGIN (arg) = arg; ! if (DECL_INITIAL (decl) != NULL_TREE ! && DECL_INITIAL (decl) != error_mark_node) set_block_origin_self (DECL_INITIAL (decl)); } *************** *** 2966,2970 **** for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg)) DECL_ABSTRACT (arg) = setting; ! if (DECL_INITIAL (decl) != NULL_TREE) set_block_abstract_flags (DECL_INITIAL (decl), setting); } --- 2988,2993 ---- for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg)) DECL_ABSTRACT (arg) = setting; ! if (DECL_INITIAL (decl) != NULL_TREE ! && DECL_INITIAL (decl) != error_mark_node) set_block_abstract_flags (DECL_INITIAL (decl), setting); } *************** *** 2981,2984 **** --- 3004,3008 ---- rtx head; rtx last; + int save_flag_no_inline = flag_no_inline; if (output_bytecode) *************** *** 2988,2991 **** --- 3012,3019 ---- } + /* Things we allocate from here on are part of this function, not + permanent. */ + temporary_allocation (); + head = DECL_SAVED_INSNS (fndecl); current_function_decl = fndecl; *************** *** 3071,3076 **** --- 3099,3111 ---- DECL_DEFER_OUTPUT (fndecl) = 0; + /* Integrating function calls isn't safe anymore, so turn on + flag_no_inline. */ + flag_no_inline = 1; + /* Compile this function all the way down to assembly code. */ rest_of_compilation (fndecl); + + /* Reset flag_no_inline to its original value. */ + flag_no_inline = save_flag_no_inline; current_function_decl = 0; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/invoke.texi gcc-2.7.1/invoke.texi *** gcc-2.7.0/invoke.texi Thu Jun 15 17:27:11 1995 --- gcc-2.7.1/invoke.texi Tue Oct 3 11:40:43 1995 *************** *** 104,109 **** @smallexample -fall-virtual -fdollars-in-identifiers -felide-constructors ! -fenum-int-equiv -fexternal-templates -fhandle-signatures ! -fmemoize-lookups -fno-default-inline -fno-gnu-keywords -fnonnull-objects -foperator-names -fstrict-prototype -fthis-is-variable -nostdinc++ -traditional +e@var{n} --- 104,109 ---- @smallexample -fall-virtual -fdollars-in-identifiers -felide-constructors ! -fenum-int-equiv -fexternal-templates -ffor-scope -fno-for-scope ! -fhandle-signatures -fmemoize-lookups -fno-default-inline -fno-gnu-keywords -fnonnull-objects -foperator-names -fstrict-prototype -fthis-is-variable -nostdinc++ -traditional +e@var{n} *************** *** 261,264 **** --- 261,265 ---- -mtoc -mno-toc -mtraceback -mno-traceback -mlittle -mlittle-endian -mbig -mbig-endian + -mcall-aix -mcall-sysv -mprototype @emph{RT Options} *************** *** 542,547 **** predefined macros such as @code{unix} and @code{vax} that identify the type of system you are using. It also enables the undesirable and ! rarely used ANSI trigraph feature, and disallows @samp{$} as part of ! identifiers. The alternate keywords @code{__asm__}, @code{__extension__}, --- 543,548 ---- predefined macros such as @code{unix} and @code{vax} that identify the type of system you are using. It also enables the undesirable and ! rarely used ANSI trigraph feature, disallows @samp{$} as part of ! identifiers, and disables recognition of C++ style @samp{//} comments. The alternate keywords @code{__asm__}, @code{__extension__}, *************** *** 865,868 **** --- 866,883 ---- @xref{Template Instantiation}, for more information. + @item -ffor-scope + @item -fno-for-scope + If -ffor-scope is specified, the scope of variables declared in + a @i{for-init-statement} is limited to the @samp{for} loop itself, + as specified by the draft C++ standard. + If -fno-for-scope is specified, the scope of variables declared in + a @i{for-init-statement} extends to the end of the enclosing scope, + as was the case in old versions of gcc, and other (traditional) + implementations of C++. + + The default if neither flag is given to follow the standard, + but to allow and give a warning for old-style code that would + otherwise be invalid, or have different behavior. + @item -fno-gnu-keywords Do not recognize @code{classof}, @code{headof}, @code{signature}, *************** *** 1267,1271 **** @item ! An expression-statement contains no side effects. @item --- 1282,1290 ---- @item ! An expression-statement or the left-hand side of a comma expression ! contains no side effects. ! To suppress the warning, cast the unused expression to void. ! For example, an expression such as @samp{x[i,j]} will cause a warning, ! but @samp{x[(void)i,j]} will not. @item *************** *** 1717,1722 **** @samp{-O2} turns on all optional optimizations except for loop unrolling ! and function inlining. It also turns on frame pointer elimination on ! machines where doing so does not interfere with debugging. @item -O3 --- 1736,1742 ---- @samp{-O2} turns on all optional optimizations except for loop unrolling ! and function inlining. It also turns on the @samp{-fforce-mem} option ! on all machines and frame pointer elimination on machines where doing so ! does not interfere with debugging. @item -O3 *************** *** 1766,1774 **** @item -fforce-mem Force memory operands to be copied into registers before doing ! arithmetic on them. This may produce better code by making all ! memory references potential common subexpressions. When they are ! not common subexpressions, instruction combination should ! eliminate the separate register-load. I am interested in hearing ! about the difference this makes. @item -fforce-addr --- 1786,1793 ---- @item -fforce-mem Force memory operands to be copied into registers before doing ! arithmetic on them. This produces better code by making all memory ! references potential common subexpressions. When they are not common ! subexpressions, instruction combination should eliminate the separate ! register-load. The @samp{-O2} option turns on this option. @item -fforce-addr *************** *** 1775,1780 **** Force memory address constants to be copied into registers before doing arithmetic on them. This may produce better code just as ! @samp{-fforce-mem} may. I am interested in hearing about the ! difference this makes. @item -fomit-frame-pointer --- 1794,1798 ---- Force memory address constants to be copied into registers before doing arithmetic on them. This may produce better code just as ! @samp{-fforce-mem} may. @item -fomit-frame-pointer *************** *** 3226,3230 **** requests the assembler mnemonics defined for the POWER architecture. Instructions defined in only one architecture have only one mnemonic; ! GNU CC uses that mnemonic irrespective of which of thse options is specified. --- 3244,3248 ---- requests the assembler mnemonics defined for the POWER architecture. Instructions defined in only one architecture have only one mnemonic; ! GNU CC uses that mnemonic irrespective of which of these options is specified. *************** *** 3369,3372 **** --- 3387,3411 ---- the same as @samp{-mbig}. + @item -mcall-sysv + On System V.4 and embedded PowerPC systems compile code using calling + conventions that adheres to the March 1995 draft of the System V + Application Binary Interface, PowerPC processor supplement. This is the + default unless you configured GCC using @samp{powerpc-*-eabiaix}. + + @item -mcall-aix + On System V.4 and embedded PowerPC systems compile code using calling + conventions that are similar to those used on AIX. This is the + default if you configured GCC using @samp{powerpc-*-eabiaix}. + + @item -mprototype + @item -mno-prototype + On System V.4 and embedded PowerPC systems assume that all calls to + variable argument functions are properly prototyped. Otherwise, the + compiler must insert an instruction before every non prototyped call to + set or clear bit 6 of the condition code register (@var{CR}) to + indicate whether floating point values were passed in the floating point + registers in case the function takes a variable arguments. With + @samp{-mprototype}, only calls to prototyped variable argument functions + will set or clear the bit. @end table @node RT Options diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/jump.c gcc-2.7.1/jump.c *** gcc-2.7.0/jump.c Thu Jun 15 07:47:02 1995 --- gcc-2.7.1/jump.c Thu Oct 26 07:27:39 1995 *************** *** 872,876 **** && ! side_effects_p (SET_SRC (temp1)) && ! may_trap_p (SET_SRC (temp1)) ! && rtx_cost (SET_SRC (temp1)) < 10) { rtx new = gen_reg_rtx (GET_MODE (temp2)); --- 872,876 ---- && ! side_effects_p (SET_SRC (temp1)) && ! may_trap_p (SET_SRC (temp1)) ! && rtx_cost (SET_SRC (temp1), SET) < 10) { rtx new = gen_reg_rtx (GET_MODE (temp2)); *************** *** 911,915 **** && ! side_effects_p (SET_SRC (temp1)) && ! may_trap_p (SET_SRC (temp1)) ! && rtx_cost (SET_SRC (temp1)) < 10 && (temp4 = single_set (temp3)) != 0 && rtx_equal_p (SET_DEST (temp4), temp2) --- 911,915 ---- && ! side_effects_p (SET_SRC (temp1)) && ! may_trap_p (SET_SRC (temp1)) ! && rtx_cost (SET_SRC (temp1), SET) < 10 && (temp4 = single_set (temp3)) != 0 && rtx_equal_p (SET_DEST (temp4), temp2) *************** *** 916,920 **** && ! side_effects_p (SET_SRC (temp4)) && ! may_trap_p (SET_SRC (temp4)) ! && rtx_cost (SET_SRC (temp4)) < 10) { rtx new = gen_reg_rtx (GET_MODE (temp2)); --- 916,920 ---- && ! side_effects_p (SET_SRC (temp4)) && ! may_trap_p (SET_SRC (temp4)) ! && rtx_cost (SET_SRC (temp4), SET) < 10) { rtx new = gen_reg_rtx (GET_MODE (temp2)); *************** *** 963,967 **** && ! side_effects_p (SET_SRC (temp1)) && ! may_trap_p (SET_SRC (temp1)) ! && rtx_cost (SET_SRC (temp1)) < 10 && (temp4 = single_set (temp3)) != 0 && (temp2 = SET_DEST (temp4), GET_CODE (temp2) == REG) --- 963,967 ---- && ! side_effects_p (SET_SRC (temp1)) && ! may_trap_p (SET_SRC (temp1)) ! && rtx_cost (SET_SRC (temp1), SET) < 10 && (temp4 = single_set (temp3)) != 0 && (temp2 = SET_DEST (temp4), GET_CODE (temp2) == REG) *************** *** 973,977 **** && ! side_effects_p (SET_SRC (temp4)) && ! may_trap_p (SET_SRC (temp4)) ! && rtx_cost (SET_SRC (temp4)) < 10) { rtx new = gen_reg_rtx (GET_MODE (temp2)); --- 973,977 ---- && ! side_effects_p (SET_SRC (temp4)) && ! may_trap_p (SET_SRC (temp4)) ! && rtx_cost (SET_SRC (temp4), SET) < 10) { rtx new = gen_reg_rtx (GET_MODE (temp2)); *************** *** 2123,2132 **** jump after INSN. - Note that it is possible we can get confused here if the jump immediately - after the loop start branches outside the loop but within an outer loop. - If we are near the exit of that loop, we will copy its exit test. This - will not generate incorrect code, but could suppress some optimizations. - However, such cases are degenerate loops anyway. - Return 1 if we made the change, else 0. --- 2123,2126 ---- *************** *** 2169,2175 **** return 0; case NOTE: if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG ! || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END) return 0; break; --- 2163,2179 ---- return 0; case NOTE: + /* We could be in front of the wrong NOTE_INSN_LOOP_END if there is + a jump immediately after the loop start that branches outside + the loop but within an outer loop, near the exit test. + If we copied this exit test and created a phony + NOTE_INSN_LOOP_VTOP, this could make instructions immediately + before the exit test look like these could be safely moved + out of the loop even if they actually may be never executed. + This can be avoided by checking here for NOTE_INSN_LOOP_CONT. */ + if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG ! || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END ! || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_CONT) return 0; break; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/libgcc2.c gcc-2.7.1/libgcc2.c *** gcc-2.7.0/libgcc2.c Thu Jun 15 07:48:01 1995 --- gcc-2.7.1/libgcc2.c Tue Nov 7 10:52:00 1995 *************** *** 117,121 **** } DIunion; ! #if defined (L_udivmoddi4) || defined (L_muldi3) || defined (L_udiv_w_sdiv) #include "longlong.h" --- 117,123 ---- } DIunion; ! #if (defined (L_udivmoddi4) || defined (L_muldi3) || defined (L_udiv_w_sdiv)\ ! || defined (L_divdi3) || defined (L_udivdi3) \ ! || defined (L_moddi3) || defined (L_umoddi3)) #include "longlong.h" *************** *** 290,293 **** --- 292,296 ---- #ifdef L_udiv_w_sdiv + #if defined (sdiv_qrnnd) USItype __udiv_w_sdiv (rp, a1, a0, d) *************** *** 387,392 **** --- 390,407 ---- return q; } + #else + /* If sdiv_qrnnd doesn't exist, define dummy __udiv_w_sdiv. */ + USItype + __udiv_w_sdiv (rp, a1, a0, d) + USItype *rp, a1, a0, d; + {} + #endif #endif + #if (defined (L_udivdi3) || defined (L_divdi3) || \ + defined (L_umoddi3) || defined (L_moddi3)) + #define L_udivmoddi4 + #endif + #ifdef L_udivmoddi4 static const UQItype __clz_tab[] = *************** *** 402,405 **** --- 417,424 ---- }; + #if (defined (L_udivdi3) || defined (L_divdi3) || \ + defined (L_umoddi3) || defined (L_moddi3)) + static inline + #endif UDItype __udivmoddi4 (n, d, rp) *************** *** 1075,1078 **** --- 1094,1099 ---- #undef float #undef double + #undef MIN + #undef MAX #include *************** *** 1096,1099 **** --- 1117,1122 ---- #undef float #undef double + #undef MIN + #undef MAX #include *************** *** 1117,1120 **** --- 1140,1145 ---- #undef float #undef double + #undef MIN + #undef MAX #include *************** *** 2109,2113 **** so that they are valid empty lists if no other definition is loaded. */ #if !defined(INIT_SECTION_ASM_OP) && !defined(CTOR_LISTS_DEFINED_EXTERNALLY) ! #ifdef __NeXT__ /* After 2.3, try this definition on all systems. */ func_ptr __CTOR_LIST__[2] = {0, 0}; --- 2134,2138 ---- so that they are valid empty lists if no other definition is loaded. */ #if !defined(INIT_SECTION_ASM_OP) && !defined(CTOR_LISTS_DEFINED_EXTERNALLY) ! #if defined(__NeXT__) || defined(_AIX) /* After 2.3, try this definition on all systems. */ func_ptr __CTOR_LIST__[2] = {0, 0}; *************** *** 2205,2209 **** Assuming a correctly sorted table (ascending order) this routine should ! return the tighest match... In the advent of a tie, we have to give the last entry, as it represents --- 2230,2234 ---- Assuming a correctly sorted table (ascending order) this routine should ! return the tightest match... In the advent of a tie, we have to give the last entry, as it represents *************** *** 2325,2331 **** what to pop for certain, this is just a guess. */ asm("leal -16(%ebp),%esp"); ! asm("pop %eax"); /* really for popl %ebx */ ! asm("pop %eax"); /* really for popl %esi */ ! asm("pop %eax"); /* really for popl %edi */ asm("movl %ebp,%esp"); asm("popl %ebp"); --- 2350,2356 ---- what to pop for certain, this is just a guess. */ asm("leal -16(%ebp),%esp"); ! asm("pop %ebx"); ! asm("pop %esi"); ! asm("pop %edi"); asm("movl %ebp,%esp"); asm("popl %ebp"); *************** *** 2334,2340 **** asm("ret"); } ! #endif ! ! #if #machine(rs6000) __unwind_function(void *ptr) { --- 2359,2363 ---- asm("ret"); } ! #elif #machine(rs6000) __unwind_function(void *ptr) { *************** *** 2352,2358 **** asm("mtctr 3;bctr # b 3"); } ! #endif /* rs6000 */ ! ! #if #machine(powerpc) __unwind_function(void *ptr) { --- 2375,2379 ---- asm("mtctr 3;bctr # b 3"); } ! #elif #machine(powerpc) __unwind_function(void *ptr) { *************** *** 2369,2372 **** --- 2390,2414 ---- asm("# br"); asm("mtctr 3;bctr # b 3"); + } + #elif #machine(vax) + __unwind_function(void *ptr) + { + __label__ return_again; + + /* Replace our frame's return address with the label below. + During execution, we will first return here instead of to + caller, then second return takes caller's frame off the stack. + Two returns matches two actual calls, so is less likely to + confuse debuggers. `16' corresponds to RETURN_ADDRESS_OFFSET. */ + __asm ("movl %0,16(fp)" : : "p" (&& return_again)); + return; + + return_again: + return; + } + #else + __unwind_function(void *ptr) + { + abort (); } #endif /* powerpc */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/local-alloc.c gcc-2.7.1/local-alloc.c *** gcc-2.7.0/local-alloc.c Thu Jun 15 07:48:26 1995 --- gcc-2.7.1/local-alloc.c Mon Aug 21 13:15:44 1995 *************** *** 1,4 **** /* Allocate registers within a basic block, for GNU compiler. ! Copyright (C) 1987, 1988, 1991, 1993, 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Allocate registers within a basic block, for GNU compiler. ! Copyright (C) 1987, 88, 91, 93, 94, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 2035,2038 **** --- 2035,2044 ---- } } + + /* If this register is used in an auto-increment address, then extend its + life to after this insn, so that it won't get allocated together with + the result of this insn. */ + if (! output_p && find_regno_note (this_insn, REG_INC, regno)) + output_p = 1; if (regno < FIRST_PSEUDO_REGISTER) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/longlong.h gcc-2.7.1/longlong.h *** gcc-2.7.0/longlong.h Thu Jun 15 07:48:52 1995 --- gcc-2.7.1/longlong.h Tue Oct 3 12:23:03 1995 *************** *** 1,4 **** /* longlong.h -- definitions for mixed size 32/64 bit arithmetic. ! Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. This definition file is free software; you can redistribute it --- 1,4 ---- /* longlong.h -- definitions for mixed size 32/64 bit arithmetic. ! Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc. This definition file is free software; you can redistribute it *************** *** 553,561 **** #if defined (__mips__) #define umul_ppmm(w1, w0, u, v) \ ! __asm__ ("multu %2,%3 ! mflo %0 ! mfhi %1" \ ! : "=d" ((USItype)(w0)), \ ! "=d" ((USItype)(w1)) \ : "d" ((USItype)(u)), \ "d" ((USItype)(v))) --- 553,559 ---- #if defined (__mips__) #define umul_ppmm(w1, w0, u, v) \ ! __asm__ ("multu %2,%3" \ ! : "=l" ((USItype)(w0)), \ ! "=h" ((USItype)(w1)) \ : "d" ((USItype)(u)), \ "d" ((USItype)(v))) *************** *** 731,748 **** "1" ((USItype)(al)), \ "g" ((USItype)(bl))) ! /* This insn doesn't work on ancient pyramids. */ #define umul_ppmm(w1, w0, u, v) \ ! ({union { \ ! UDItype __ll; \ ! struct {USItype __h, __l;} __i; \ ! } __xx; \ ! __xx.__i.__l = u; \ ! __asm__ ("uemul %3,%0" \ ! : "=r" (__xx.__i.__h), \ ! "=r" (__xx.__i.__l) \ ! : "1" (__xx.__i.__l), \ "g" ((USItype)(v))); \ ! (w1) = __xx.__i.__h; \ ! (w0) = __xx.__i.__l;}) #endif /* __pyr__ */ --- 729,743 ---- "1" ((USItype)(al)), \ "g" ((USItype)(bl))) ! /* This insn works on Pyramids with AP, XP, or MI CPUs, but not with SP. */ #define umul_ppmm(w1, w0, u, v) \ ! ({union {UDItype __ll; \ ! struct {USItype __h, __l;} __i; \ ! } __xx; \ ! __asm__ ("movw %1,%R0 ! uemul %2,%0" \ ! : "=&r" (__xx.__ll) \ ! : "g" ((USItype) (u)), \ "g" ((USItype)(v))); \ ! (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;}) #endif /* __pyr__ */ *************** *** 1173,1177 **** else \ { \ ! for (__a = SI_TYPE_SIZE - 8; __a > 0; __a -= 8) \ if (((__xr >> __a) & 0xff) != 0) \ break; \ --- 1168,1172 ---- else \ { \ ! for (__a = SI_TYPE_SIZE - 8; __a > 0; __a -= 8) \ if (((__xr >> __a) & 0xff) != 0) \ break; \ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/loop.c gcc-2.7.1/loop.c *** gcc-2.7.0/loop.c Thu Jun 15 07:49:22 1995 --- gcc-2.7.1/loop.c Tue Oct 3 12:17:16 1995 *************** *** 1,3 **** ! /* Move constant computations out of loops. Copyright (C) 1987, 88, 89, 91-4, 1995 Free Software Foundation, Inc. --- 1,3 ---- ! /* Perform various loop optimizations, including strength reduction. Copyright (C) 1987, 88, 89, 91-4, 1995 Free Software Foundation, Inc. *************** *** 98,101 **** --- 98,106 ---- rtx *loop_number_exit_labels; + /* Indexed by loop number, counts the number of LABEL_REFs on + loop_number_exit_labels for this loop and all loops nested inside it. */ + + int *loop_number_exit_count; + /* Holds the number of loop iterations. It is zero if the number could not be calculated. Must be unsigned since the number of iterations can *************** *** 373,376 **** --- 378,382 ---- loop_invalid = (char *) alloca (max_loop_num * sizeof (char)); loop_number_exit_labels = (rtx *) alloca (max_loop_num * sizeof (rtx)); + loop_number_exit_count = (int *) alloca (max_loop_num * sizeof (int)); /* Find and process each loop. *************** *** 2241,2244 **** --- 2247,2251 ---- loop_invalid[next_loop] = 0; loop_number_exit_labels[next_loop] = 0; + loop_number_exit_count[next_loop] = 0; current_loop = next_loop; break; *************** *** 2332,2335 **** --- 2339,2344 ---- rtx p; rtx our_next = next_real_insn (insn); + int dest_loop; + int outer_loop = -1; /* Go backwards until we reach the start of the loop, a label, *************** *** 2343,2346 **** --- 2352,2376 ---- ; + /* Check for the case where we have a jump to an inner nested + loop, and do not perform the optimization in that case. */ + + if (JUMP_LABEL (insn)) + { + dest_loop = uid_loop_num[INSN_UID (JUMP_LABEL (insn))]; + if (dest_loop != -1) + { + for (outer_loop = dest_loop; outer_loop != -1; + outer_loop = loop_outer_loop[outer_loop]) + if (outer_loop == this_loop_num) + break; + } + } + + /* Make sure that the target of P is within the current loop. */ + + if (GET_CODE (p) == JUMP_INSN && JUMP_LABEL (p) + && uid_loop_num[INSN_UID (JUMP_LABEL (p))] != this_loop_num) + outer_loop = this_loop_num; + /* If we stopped on a JUMP_INSN to the next insn after INSN, we have a block of code to try to move. *************** *** 2352,2356 **** and move the block of code to the spot we found. */ ! if (GET_CODE (p) == JUMP_INSN && JUMP_LABEL (p) != 0 /* Just ignore jumps to labels that were never emitted. --- 2382,2387 ---- and move the block of code to the spot we found. */ ! if (outer_loop == -1 ! && GET_CODE (p) == JUMP_INSN && JUMP_LABEL (p) != 0 /* Just ignore jumps to labels that were never emitted. *************** *** 2408,2411 **** --- 2439,2444 ---- if (JUMP_LABEL (insn)) { + int loop_num; + for (q = 0, r = loop_number_exit_labels[this_loop_num]; *************** *** 2422,2425 **** --- 2455,2463 ---- } + for (loop_num = this_loop_num; + loop_num != -1 && loop_num != target_loop_num; + loop_num = loop_outer_loop[loop_num]) + loop_number_exit_count[loop_num]--; + /* If we didn't find it, then something is wrong. */ if (! r) *************** *** 2509,2517 **** false. */ ! if (dest_loop != loop_num && loop_num != -1) { LABEL_OUTSIDE_LOOP_P (x) = 1; LABEL_NEXTREF (x) = loop_number_exit_labels[loop_num]; loop_number_exit_labels[loop_num] = x; } --- 2547,2572 ---- false. */ ! /* A check to make sure the label is not in an inner nested loop, ! since this does not count as a loop exit. */ ! if (dest_loop != -1) { + for (outer_loop = dest_loop; outer_loop != -1; + outer_loop = loop_outer_loop[outer_loop]) + if (outer_loop == loop_num) + break; + } + else + outer_loop = -1; + + if (loop_num != -1 && outer_loop == -1) + { LABEL_OUTSIDE_LOOP_P (x) = 1; LABEL_NEXTREF (x) = loop_number_exit_labels[loop_num]; loop_number_exit_labels[loop_num] = x; + + for (outer_loop = loop_num; + outer_loop != -1 && outer_loop != dest_loop; + outer_loop = loop_outer_loop[outer_loop]) + loop_number_exit_count[outer_loop]++; } *************** *** 2570,2575 **** if (loop_num != -1) ! loop_number_exit_labels[loop_num] = x; return; } --- 2625,2635 ---- if (loop_num != -1) ! { ! loop_number_exit_labels[loop_num] = x; + for (outer_loop = loop_num; outer_loop != -1; + outer_loop = loop_outer_loop[outer_loop]) + loop_number_exit_count[outer_loop]++; + } return; } *************** *** 3906,3910 **** how the loop exits. Otherwise, emit the insn after the loop, since this is slightly more efficient. */ ! if (loop_number_exit_labels[uid_loop_num[INSN_UID (loop_start)]]) insert_before = loop_start; else --- 3966,3970 ---- how the loop exits. Otherwise, emit the insn after the loop, since this is slightly more efficient. */ ! if (loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]]) insert_before = loop_start; else *************** *** 3998,4002 **** how the loop exits. Otherwise, emit the insn after the loop, since this is slightly more efficient. */ ! if (loop_number_exit_labels[uid_loop_num[INSN_UID (loop_start)]]) insert_before = loop_start; else --- 4058,4062 ---- how the loop exits. Otherwise, emit the insn after the loop, since this is slightly more efficient. */ ! if (loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]]) insert_before = loop_start; else *************** *** 5713,5717 **** if (bl->giv_count == 0 ! && ! loop_number_exit_labels[uid_loop_num[INSN_UID (loop_start)]]) { rtx bivreg = regno_reg_rtx[bl->regno]; --- 5773,5777 ---- if (bl->giv_count == 0 ! && ! loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]]) { rtx bivreg = regno_reg_rtx[bl->regno]; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/loop.h gcc-2.7.1/loop.h *** gcc-2.7.0/loop.h Thu Jun 15 07:49:51 1995 --- gcc-2.7.1/loop.h Fri Jul 14 08:23:28 1995 *************** *** 1,4 **** /* Loop optimization definitions for GNU C-Compiler ! Copyright (C) 1991 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Loop optimization definitions for GNU C-Compiler ! Copyright (C) 1991, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 147,150 **** --- 147,151 ---- extern int *loop_outer_loop; extern rtx *loop_number_exit_labels; + extern int *loop_number_exit_count; extern unsigned HOST_WIDE_INT loop_n_iterations; extern int max_reg_before_loop; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/make-cc1.com gcc-2.7.1/make-cc1.com *** gcc-2.7.0/make-cc1.com Fri May 19 06:57:07 1995 --- gcc-2.7.1/make-cc1.com Thu Jun 22 19:14:15 1995 *************** *** 154,158 **** $! $gas := $gnu_cc:[000000]gcc-as.exe ! $if f$search(gas-"$").eqs."" then goto gas_message !must be VAXC $define/user sys$error sys$scratch:gas_test.tmp $gas -1 nla0: -o nla0: --- 154,158 ---- $! $gas := $gnu_cc:[000000]gcc-as.exe ! $if f$search(gas-"$").eqs."" then goto gas_missing_message !must be VAXC $define/user sys$error sys$scratch:gas_test.tmp $gas -1 nla0: -o nla0: *************** *** 159,179 **** $size=f$file_attributes("sys$scratch:gas_test.tmp","ALQ") $delete/nolog sys$scratch:gas_test.tmp;* ! $if size.eq.0 then goto no_message ! $gas_message: ! $type sys$input ! ! Note: GCC 2.x treats external variables differently than GCC 1.x does. ! Before you use GCC 2.x, you should obtain a version of the assembler which ! contains the patches to work with GCC 2.x (GCC-AS 1.38 does not contain ! these patches - whatever comes after this probably will). The assembler ! in gcc-vms-1.42.tar.gz from prep does contain the proper patches. ! If you do not update the assembler, the compiler will still work, but `extern const' variables will be treated as `extern'. This will result in linker warning messages about mismatched psect attributes, and these variables will be placed in read/write storage. ! $! ! $no_message: $! $! --- 159,197 ---- $size=f$file_attributes("sys$scratch:gas_test.tmp","ALQ") $delete/nolog sys$scratch:gas_test.tmp;* ! $if size.eq.0 then goto skip_gas_message ! $type sys$input: !an old version of gas was found ! ----- ! Note: you appear to have an old version of gas, the GNU assembler. ! GCC 2.x treats external variables differently than GCC 1.x does. Before ! you use GCC 2.x, you should obtain a version of the assembler which works ! with GCC 2.x (gas-1.38 and earlier did not have the necessary support; ! gas-2.0 through gas-2.3 did not work reliably for vax/vms configuration). ! The assembler in gcc-vms-1.42 contained patches to provide the proper ! support, and more recent versions have an up to date version of gas which ! provides the support. gas from binutils-2.5 or later is recommended. ! ! If you do not update the assembler, the compiler will still work, but `extern const' variables will be treated as `extern'. This will result in linker warning messages about mismatched psect attributes, and these variables will be placed in read/write storage. + ----- ! $goto skip_gas_message ! $gas_missing_message: ! $type sys$input: !no version of gas was found ! ! ----- ! Note: you appear to be missing gas, the GNU assembler. Since ! GCC produces assembly code as output from compilation, you need the ! assembler to make full use of the compiler. It should be put in place ! as GNU_CC:[000000]GCC-AS.EXE. ! ! A prebuilt copy of gas is available from the "gcc-vms" distribution, ! and the gas source code is included in the GNU "binutils" distribution. ! Version 2.5.2 or later is recommended. ! ----- ! ! $skip_gas_message: $! $! *************** *** 180,184 **** $ if DO_DEBUG.eq.1 then LDFLAGS = LDFLAGS + "/Debug" $! ! $if DO_LINK.eq.1 then goto compile_cc1 $! $! Build alloca if necessary (in 'LIBS for use with VAXC) --- 198,202 ---- $ if DO_DEBUG.eq.1 then LDFLAGS = LDFLAGS + "/Debug" $! ! $if DO_LINK.eq.1 then goto no_yfiles !compile_cc1 $! $! Build alloca if necessary (in 'LIBS for use with VAXC) diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/md.texi gcc-2.7.1/md.texi *** gcc-2.7.0/md.texi Thu Jun 15 17:27:19 1995 --- gcc-2.7.1/md.texi Wed Jun 28 15:37:18 1995 *************** *** 2740,2744 **** the operands. ! @findex prev_nonnote_insn The way to refer to the operands in @var{condition} is to write @code{operands[@var{i}]} for operand number @var{i} (as matched by --- 2740,2744 ---- the operands. ! @findex prev_active_insn The way to refer to the operands in @var{condition} is to write @code{operands[@var{i}]} for operand number @var{i} (as matched by *************** *** 2745,2749 **** @code{(match_operand @var{i} @dots{})}). Use the variable @code{insn} to refer to the last of the insns being matched; use ! @code{prev_nonnote_insn} to find the preceding insns. @findex dead_or_set_p --- 2745,2749 ---- @code{(match_operand @var{i} @dots{})}). Use the variable @code{insn} to refer to the last of the insns being matched; use ! @code{prev_active_insn} to find the preceding insns. @findex dead_or_set_p diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/mips-tdump.c gcc-2.7.1/mips-tdump.c *** gcc-2.7.0/mips-tdump.c Thu Jun 15 07:51:19 1995 --- gcc-2.7.1/mips-tdump.c Thu Oct 26 17:57:05 1995 *************** *** 1,4 **** /* Read and manage MIPS symbol tables from object modules. ! Copyright (C) 1991, 1994 Free Software Foundation, Inc. Contributed by hartzell@boulder.colorado.edu, Rewritten by meissner@osf.org. --- 1,4 ---- /* Read and manage MIPS symbol tables from object modules. ! Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc. Contributed by hartzell@boulder.colorado.edu, Rewritten by meissner@osf.org. *************** *** 145,148 **** --- 145,153 ---- st_StaParam = stStaParam, /* Fortran static parameters */ st_Constant = stConstant, /* const */ + #ifdef stStruct + st_Struct = stStruct, /* struct */ + st_Union = stUnion, /* union */ + st_Enum = stEnum, /* enum */ + #endif st_Str = stStr, /* string */ st_Number = stNumber, /* pure number (ie. 4 NOR 2+2) */ *************** *** 261,267 **** void print_sym_hdr __proto((HDRR *)); void print_file_desc __proto((FDR *, int)); ! void print_symbol __proto((SYMR *, int, char *, AUXU *, int)); void print_aux __proto((AUXU, int, int)); ! void emit_aggregate __proto((char *, AUXU, AUXU, const char *)); char *st_to_string __proto((st_t)); char *sc_to_string __proto((sc_t)); --- 266,272 ---- void print_sym_hdr __proto((HDRR *)); void print_file_desc __proto((FDR *, int)); ! void print_symbol __proto((SYMR *, int, char *, AUXU *, int, FDR *)); void print_aux __proto((AUXU, int, int)); ! void emit_aggregate __proto((char *, AUXU, AUXU, const char *, FDR *)); char *st_to_string __proto((st_t)); char *sc_to_string __proto((sc_t)); *************** *** 268,272 **** char *glevel_to_string __proto((glevel_t)); char *lang_to_string __proto((lang_t)); ! char *type_to_string __proto((AUXU *, int)); #ifndef __alpha --- 273,277 ---- char *glevel_to_string __proto((glevel_t)); char *lang_to_string __proto((lang_t)); ! char *type_to_string __proto((AUXU *, int, FDR *)); #ifndef __alpha *************** *** 410,413 **** --- 415,423 ---- case st_Constant: return "Constant"; case st_StaParam: return "StaticParam"; + #ifdef stStruct + case st_Struct: return "Struct"; + case st_Union: return "Union"; + case st_Enum: return "Enum"; + #endif case st_Str: return "String"; case st_Number: return "Number"; *************** *** 442,448 **** char * ! type_to_string (aux_ptr, index) AUXU *aux_ptr; int index; { AUXU u; --- 452,459 ---- char * ! type_to_string (aux_ptr, index, fdp) AUXU *aux_ptr; int index; + FDR *fdp; { AUXU u; *************** *** 541,545 **** case bt_Struct: /* Structure (Record) */ ! emit_aggregate (p1, aux_ptr[index], aux_ptr[index+1], "struct"); used_ptr[index] = 1; if (aux_ptr[index].rndx.rfd == ST_RFDESCAPE) --- 552,556 ---- case bt_Struct: /* Structure (Record) */ ! emit_aggregate (p1, aux_ptr[index], aux_ptr[index+1], "struct", fdp); used_ptr[index] = 1; if (aux_ptr[index].rndx.rfd == ST_RFDESCAPE) *************** *** 554,558 **** case bt_Union: /* Union */ ! emit_aggregate (p1, aux_ptr[index], aux_ptr[index+1], "union"); used_ptr[index] = 1; if (aux_ptr[index].rndx.rfd == ST_RFDESCAPE) --- 565,569 ---- case bt_Union: /* Union */ ! emit_aggregate (p1, aux_ptr[index], aux_ptr[index+1], "union", fdp); used_ptr[index] = 1; if (aux_ptr[index].rndx.rfd == ST_RFDESCAPE) *************** *** 567,571 **** case bt_Enum: /* Enumeration */ ! emit_aggregate (p1, aux_ptr[index], aux_ptr[index+1], "enum"); used_ptr[index] = 1; if (aux_ptr[index].rndx.rfd == ST_RFDESCAPE) --- 578,582 ---- case bt_Enum: /* Enumeration */ ! emit_aggregate (p1, aux_ptr[index], aux_ptr[index+1], "enum", fdp); used_ptr[index] = 1; if (aux_ptr[index].rndx.rfd == ST_RFDESCAPE) *************** *** 883,887 **** void ! print_symbol (sym_ptr, number, strbase, aux_base, ifd) SYMR *sym_ptr; int number; --- 894,898 ---- void ! print_symbol (sym_ptr, number, strbase, aux_base, ifd, fdp) SYMR *sym_ptr; int number; *************** *** 889,892 **** --- 900,904 ---- AUXU *aux_base; int ifd; + FDR *fdp; { sc_t storage_class = (sc_t) sym_ptr->sc; *************** *** 956,960 **** used_ptr[index] = used_ptr[index+1] = 1; printf (" End+1 symbol: %-7ld Type: %s\n", ! aux_base[index].isym, type_to_string (aux_base, index+1)); } else /* global symbol */ --- 968,973 ---- used_ptr[index] = used_ptr[index+1] = 1; printf (" End+1 symbol: %-7ld Type: %s\n", ! aux_base[index].isym, ! type_to_string (aux_base, index+1, fdp)); } else /* global symbol */ *************** *** 978,981 **** --- 991,1002 ---- break; + #ifdef stStruct + case st_Struct: + case st_Union: + case st_Enum: + printf (" End+1 symbol: %lu\n", index); + break; + #endif + default: if (!MIPS_IS_STAB (sym_ptr)) *************** *** 983,987 **** used_ptr[index] = 1; printf (" Type: %s\n", ! type_to_string (aux_base, index)); } break; --- 1004,1008 ---- used_ptr[index] = 1; printf (" Type: %s\n", ! type_to_string (aux_base, index, fdp)); } break; *************** *** 1078,1082 **** void ! emit_aggregate (string, u, u2, which) char *string; AUXU u; --- 1099,1103 ---- void ! emit_aggregate (string, u, u2, which, fdp) char *string; AUXU u; *************** *** 1083,1105 **** AUXU u2; const char *which; { ! int ifd = u.rndx.rfd; ! int index = u.rndx.index; ! int sym_base, ss_base; ! int name; if (ifd == ST_RFDESCAPE) ifd = u2.isym; ! ! sym_base = file_desc[ifd].isymBase; ! ss_base = file_desc[ifd].issBase; - name = (index == indexNil) ? 0 : l_symbols[index + sym_base].iss; sprintf (string, ! "%s %s { ifd = %d, index = %d }", ! which, ! (name == 0) ? "/* no name */" : &l_strings[ ss_base + name ], ! ifd, ! index); } --- 1104,1135 ---- AUXU u2; const char *which; + FDR *fdp; { ! unsigned int ifd = u.rndx.rfd; ! unsigned int index = u.rndx.index; ! const char *name; if (ifd == ST_RFDESCAPE) ifd = u2.isym; ! ! /* An ifd of -1 is an opaque type. An escaped index of 0 is a ! struct return type of a procedure compiled without -g. */ ! if (ifd == 0xffffffff ! || (u.rndx.rfd == ST_RFDESCAPE && index == 0)) ! name = ""; ! else if (index == indexNil) ! name = ""; ! else ! { ! if (fdp == 0 || sym_hdr.crfd == 0) ! fdp = &file_desc[ifd]; ! else ! fdp = &file_desc[rfile_desc[fdp->rfdBase + ifd]]; ! name = &l_strings[fdp->issBase + l_symbols[index + fdp->isymBase].iss]; ! } sprintf (string, ! "%s %s { ifd = %u, index = %u }", ! which, name, ifd, index); } *************** *** 1206,1210 **** str_base, aux_base, ! -1); if (want_scope && cur_scope != (scope_t *)0) --- 1236,1241 ---- str_base, aux_base, ! -1, ! fdp); if (want_scope && cur_scope != (scope_t *)0) *************** *** 1525,1529 **** print_symbol (&e_symbols[i].asym, i, e_strings, aux_symbols + file_desc[e_symbols[i].ifd].iauxBase, ! e_symbols[i].ifd); /* --- 1556,1561 ---- print_symbol (&e_symbols[i].asym, i, e_strings, aux_symbols + file_desc[e_symbols[i].ifd].iauxBase, ! e_symbols[i].ifd, ! &file_desc[e_symbols[i].ifd]); /* *************** *** 1549,1553 **** (long) aux_symbols[i].isym, (long) aux_symbols[i].isym, ! type_to_string (aux_symbols, i)); } } --- 1581,1585 ---- (long) aux_symbols[i].isym, (long) aux_symbols[i].isym, ! type_to_string (aux_symbols, i, (FDR *) 0)); } } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/mips-tfile.c gcc-2.7.1/mips-tfile.c *** gcc-2.7.0/mips-tfile.c Thu Jun 15 07:51:47 1995 --- gcc-2.7.1/mips-tfile.c Thu Aug 31 17:52:10 1995 *************** *** 1758,1764 **** #ifndef __alpha extern char *sbrk __proto((int)); - extern PTR_T malloc __proto((Size_t)); - extern PTR_T calloc __proto((Size_t, Size_t)); - extern PTR_T realloc __proto((PTR_T, Size_t)); extern void free __proto((PTR_T)); #endif --- 1758,1761 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/objc/Makefile gcc-2.7.1/objc/Makefile *** gcc-2.7.0/objc/Makefile Thu Jun 15 17:07:09 1995 --- gcc-2.7.1/objc/Makefile Tue Sep 12 17:15:15 1995 *************** *** 61,65 **** libobjc.a: $(OBJC_O) -rm -f libobjc.a ! $(AR) rc libobjc.a $(OBJC_O) # ranlib is run in the parent directory's makefile. --- 61,65 ---- libobjc.a: $(OBJC_O) -rm -f libobjc.a ! $(AR) rc libobjc.a $? # ranlib is run in the parent directory's makefile. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/objc/hash.h gcc-2.7.1/objc/hash.h *** gcc-2.7.0/objc/hash.h Thu Jun 15 08:39:29 1995 --- gcc-2.7.1/objc/hash.h Mon Aug 28 06:50:37 1995 *************** *** 1,4 **** /* Hash tables for Objective C method dispatch. ! Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Hash tables for Objective C method dispatch. ! Copyright (C) 1993, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 64,68 **** * This data type is the function that compares two hash keys and returns an * integer greater than, equal to, or less than 0, according as the first ! * parameter is lexico-graphically greater than, equal to, or less than the * second. */ --- 64,68 ---- * This data type is the function that compares two hash keys and returns an * integer greater than, equal to, or less than 0, according as the first ! * parameter is lexicographically greater than, equal to, or less than the * second. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/objc/objc-api.h gcc-2.7.1/objc/objc-api.h *** gcc-2.7.0/objc/objc-api.h Thu Jun 15 08:41:19 1995 --- gcc-2.7.1/objc/objc-api.h Sun Aug 13 21:46:57 1995 *************** *** 335,338 **** --- 335,340 ---- SEL sel_get_any_uid(const char *name); + SEL sel_get_any_typed_uid(const char *name); + SEL sel_get_typed_uid(const char *name, const char*); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/objc/selector.c gcc-2.7.1/objc/selector.c *** gcc-2.7.0/objc/selector.c Thu Jun 15 08:44:43 1995 --- gcc-2.7.1/objc/selector.c Sun Aug 13 21:46:53 1995 *************** *** 147,150 **** --- 147,173 ---- } + /* Return selector representing name; prefer a selector with non-NULL type */ + SEL + sel_get_any_typed_uid (const char *name) + { + struct objc_list *l; + sidx i; + SEL s; + + i = (sidx) hash_value_for_key (__objc_selector_hash, name); + if (i == 0) + return 0; + + for (l = (struct objc_list*)sarray_get (__objc_selector_array, i); + l; l = l->tail) + { + s = (SEL) l->head; + if (s->sel_types) + return s; + } + + return s; + } + /* return selector representing name */ SEL diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/objc-act.c gcc-2.7.1/objc-act.c *** gcc-2.7.0/objc-act.c Thu Jun 15 07:53:28 1995 --- gcc-2.7.1/objc-act.c Mon Aug 28 06:25:19 1995 *************** *** 2789,2793 **** sprintf (buf, "%d", forwarding_offset (parms)); ! /* Indicate registe.r */ if (offset_is_register) obstack_1grow (&util_obstack, '+'); --- 2789,2793 ---- sprintf (buf, "%d", forwarding_offset (parms)); ! /* Indicate register. */ if (offset_is_register) obstack_1grow (&util_obstack, '+'); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/obstack.c gcc-2.7.1/obstack.c *** gcc-2.7.0/obstack.c Thu Jun 15 18:12:08 1995 --- gcc-2.7.1/obstack.c Thu Nov 9 11:29:58 1995 *************** *** 18,33 **** #include "obstack.h" ! /* This is just to get __GNU_LIBRARY__ defined. */ ! #include /* Comment out all this code if we are using the GNU C Library, and are not ! actually compiling the library itself. This code is part of the GNU C ! Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU ! program understand `configure --with-gnu-libc' and omit the object files, ! it is simpler to just do this in the source for each such file. */ ! #if defined (_LIBC) || !defined (__GNU_LIBRARY__) --- 18,45 ---- #include "obstack.h" ! /* NOTE BEFORE MODIFYING THIS FILE: This version number must be ! incremented whenever callers compiled using an old obstack.h can no ! longer properly call the functions in this obstack.c. */ ! #define OBSTACK_INTERFACE_VERSION 1 /* Comment out all this code if we are using the GNU C Library, and are not ! actually compiling the library itself, and the installed library ! supports the same library interface we do. This code is part of the GNU ! C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU ! program understand `configure --with-gnu-libc' and omit the object ! files, it is simpler to just do this in the source for each such file. */ ! #include /* Random thing to get __GNU_LIBRARY__. */ ! #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 ! #include ! #if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION ! #define ELIDE_CODE ! #endif ! #endif ! ! ! #ifndef ELIDE_CODE *************** *** 483,485 **** #endif /* 0 */ ! #endif /* _LIBC or not __GNU_LIBRARY__. */ --- 495,497 ---- #endif /* 0 */ ! #endif /* !ELIDE_CODE */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/obstack.c.old gcc-2.7.1/obstack.c.old *** gcc-2.7.0/obstack.c.old --- gcc-2.7.1/obstack.c.old Thu Nov 9 11:29:59 1995 *************** *** 0 **** --- 1,497 ---- + /* obstack.c - subroutines used implicitly by object stack macros + Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #include "obstack.h" + + /* NOTE BEFORE MODIFYING THIS FILE: This version number must be + incremented whenever callers compiled using an old obstack.h can no + longer properly call the functions in this obstack.c. */ + #define OBSTACK_INTERFACE_VERSION 1 + + /* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself, and the installed library + supports the same library interface we do. This code is part of the GNU + C Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object + files, it is simpler to just do this in the source for each such file. */ + + #include /* Random thing to get __GNU_LIBRARY__. */ + #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 + #include + #if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION + #define ELIDE_CODE + #endif + #endif + + + #ifndef ELIDE_CODE + + + #if defined (__STDC__) && __STDC__ + #define POINTER void * + #else + #define POINTER char * + #endif + + /* Determine default alignment. */ + struct fooalign {char x; double d;}; + #define DEFAULT_ALIGNMENT \ + ((PTR_INT_TYPE) ((char *)&((struct fooalign *) 0)->d - (char *)0)) + /* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT. + But in fact it might be less smart and round addresses to as much as + DEFAULT_ROUNDING. So we prepare for it to do that. */ + union fooround {long x; double d;}; + #define DEFAULT_ROUNDING (sizeof (union fooround)) + + /* When we copy a long block of data, this is the unit to do it with. + On some machines, copying successive ints does not work; + in such a case, redefine COPYING_UNIT to `long' (if that works) + or `char' as a last resort. */ + #ifndef COPYING_UNIT + #define COPYING_UNIT int + #endif + + /* The non-GNU-C macros copy the obstack into this global variable + to avoid multiple evaluation. */ + + struct obstack *_obstack; + + /* Define a macro that either calls functions with the traditional malloc/free + calling interface, or calls functions with the mmalloc/mfree interface + (that adds an extra first argument), based on the state of use_extra_arg. + For free, do not use ?:, since some compilers, like the MIPS compilers, + do not allow (expr) ? void : void. */ + + #define CALL_CHUNKFUN(h, size) \ + (((h) -> use_extra_arg) \ + ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ + : (*(h)->chunkfun) ((size))) + + #define CALL_FREEFUN(h, old_chunk) \ + do { \ + if ((h) -> use_extra_arg) \ + (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ + else \ + (*(h)->freefun) ((old_chunk)); \ + } while (0) + + + /* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). + Objects start on multiples of ALIGNMENT (0 means use default). + CHUNKFUN is the function to use to allocate chunks, + and FREEFUN the function to free them. + + Return nonzero if successful, zero if out of memory. + To recover from an out of memory error, + free up some memory, then call this again. */ + + int + _obstack_begin (h, size, alignment, chunkfun, freefun) + struct obstack *h; + int size; + int alignment; + POINTER (*chunkfun) (); + void (*freefun) (); + { + register struct _obstack_chunk* chunk; /* points to new chunk */ + + if (alignment == 0) + alignment = DEFAULT_ALIGNMENT; + if (size == 0) + /* Default size is what GNU malloc can fit in a 4096-byte block. */ + { + /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. + Use the values for range checking, because if range checking is off, + the extra bytes won't be missed terribly, but if range checking is on + and we used a larger request, a whole extra 4096 bytes would be + allocated. + + These number are irrelevant to the new GNU malloc. I suspect it is + less sensitive to the size of the request. */ + int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) + + 4 + DEFAULT_ROUNDING - 1) + & ~(DEFAULT_ROUNDING - 1)); + size = 4096 - extra; + } + + h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; + h->freefun = freefun; + h->chunk_size = size; + h->alignment_mask = alignment - 1; + h->use_extra_arg = 0; + + chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); + if (!chunk) + { + h->alloc_failed = 1; + return 0; + } + h->alloc_failed = 0; + h->next_free = h->object_base = chunk->contents; + h->chunk_limit = chunk->limit + = (char *) chunk + h->chunk_size; + chunk->prev = 0; + /* The initial chunk now contains no empty object. */ + h->maybe_empty_object = 0; + return 1; + } + + int + _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg) + struct obstack *h; + int size; + int alignment; + POINTER (*chunkfun) (); + void (*freefun) (); + POINTER arg; + { + register struct _obstack_chunk* chunk; /* points to new chunk */ + + if (alignment == 0) + alignment = DEFAULT_ALIGNMENT; + if (size == 0) + /* Default size is what GNU malloc can fit in a 4096-byte block. */ + { + /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. + Use the values for range checking, because if range checking is off, + the extra bytes won't be missed terribly, but if range checking is on + and we used a larger request, a whole extra 4096 bytes would be + allocated. + + These number are irrelevant to the new GNU malloc. I suspect it is + less sensitive to the size of the request. */ + int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) + + 4 + DEFAULT_ROUNDING - 1) + & ~(DEFAULT_ROUNDING - 1)); + size = 4096 - extra; + } + + h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; + h->freefun = freefun; + h->chunk_size = size; + h->alignment_mask = alignment - 1; + h->extra_arg = arg; + h->use_extra_arg = 1; + + chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); + if (!chunk) + { + h->alloc_failed = 1; + return 0; + } + h->alloc_failed = 0; + h->next_free = h->object_base = chunk->contents; + h->chunk_limit = chunk->limit + = (char *) chunk + h->chunk_size; + chunk->prev = 0; + /* The initial chunk now contains no empty object. */ + h->maybe_empty_object = 0; + return 1; + } + + /* Allocate a new current chunk for the obstack *H + on the assumption that LENGTH bytes need to be added + to the current object, or a new object of length LENGTH allocated. + Copies any partial object from the end of the old chunk + to the beginning of the new one. */ + + void + _obstack_newchunk (h, length) + struct obstack *h; + int length; + { + register struct _obstack_chunk* old_chunk = h->chunk; + register struct _obstack_chunk* new_chunk; + register long new_size; + register int obj_size = h->next_free - h->object_base; + register int i; + int already; + + /* Compute size for new chunk. */ + new_size = (obj_size + length) + (obj_size >> 3) + 100; + if (new_size < h->chunk_size) + new_size = h->chunk_size; + + /* Allocate and initialize the new chunk. */ + new_chunk = CALL_CHUNKFUN (h, new_size); + if (!new_chunk) + { + h->alloc_failed = 1; + return; + } + h->alloc_failed = 0; + h->chunk = new_chunk; + new_chunk->prev = old_chunk; + new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size; + + /* Move the existing object to the new chunk. + Word at a time is fast and is safe if the object + is sufficiently aligned. */ + if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT) + { + for (i = obj_size / sizeof (COPYING_UNIT) - 1; + i >= 0; i--) + ((COPYING_UNIT *)new_chunk->contents)[i] + = ((COPYING_UNIT *)h->object_base)[i]; + /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT, + but that can cross a page boundary on a machine + which does not do strict alignment for COPYING_UNITS. */ + already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT); + } + else + already = 0; + /* Copy remaining bytes one by one. */ + for (i = already; i < obj_size; i++) + new_chunk->contents[i] = h->object_base[i]; + + /* If the object just copied was the only data in OLD_CHUNK, + free that chunk and remove it from the chain. + But not if that chunk might contain an empty object. */ + if (h->object_base == old_chunk->contents && ! h->maybe_empty_object) + { + new_chunk->prev = old_chunk->prev; + CALL_FREEFUN (h, old_chunk); + } + + h->object_base = new_chunk->contents; + h->next_free = h->object_base + obj_size; + /* The new chunk certainly contains no empty object yet. */ + h->maybe_empty_object = 0; + } + + /* Return nonzero if object OBJ has been allocated from obstack H. + This is here for debugging. + If you use it in a program, you are probably losing. */ + + #if defined (__STDC__) && __STDC__ + /* Suppress -Wmissing-prototypes warning. We don't want to declare this in + obstack.h because it is just for debugging. */ + int _obstack_allocated_p (struct obstack *h, POINTER obj); + #endif + + int + _obstack_allocated_p (h, obj) + struct obstack *h; + POINTER obj; + { + register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */ + register struct _obstack_chunk* plp; /* point to previous chunk if any */ + + lp = (h)->chunk; + /* We use >= rather than > since the object cannot be exactly at + the beginning of the chunk but might be an empty object exactly + at the end of an adjacent chunk. */ + while (lp != 0 && ((POINTER)lp >= obj || (POINTER)(lp)->limit < obj)) + { + plp = lp->prev; + lp = plp; + } + return lp != 0; + } + + /* Free objects in obstack H, including OBJ and everything allocate + more recently than OBJ. If OBJ is zero, free everything in H. */ + + #undef obstack_free + + /* This function has two names with identical definitions. + This is the first one, called from non-ANSI code. */ + + void + _obstack_free (h, obj) + struct obstack *h; + POINTER obj; + { + register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */ + register struct _obstack_chunk* plp; /* point to previous chunk if any */ + + lp = h->chunk; + /* We use >= because there cannot be an object at the beginning of a chunk. + But there can be an empty object at that address + at the end of another chunk. */ + while (lp != 0 && ((POINTER)lp >= obj || (POINTER)(lp)->limit < obj)) + { + plp = lp->prev; + CALL_FREEFUN (h, lp); + lp = plp; + /* If we switch chunks, we can't tell whether the new current + chunk contains an empty object, so assume that it may. */ + h->maybe_empty_object = 1; + } + if (lp) + { + h->object_base = h->next_free = (char *)(obj); + h->chunk_limit = lp->limit; + h->chunk = lp; + } + else if (obj != 0) + /* obj is not in any of the chunks! */ + abort (); + } + + /* This function is used from ANSI code. */ + + void + obstack_free (h, obj) + struct obstack *h; + POINTER obj; + { + register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */ + register struct _obstack_chunk* plp; /* point to previous chunk if any */ + + lp = h->chunk; + /* We use >= because there cannot be an object at the beginning of a chunk. + But there can be an empty object at that address + at the end of another chunk. */ + while (lp != 0 && ((POINTER)lp >= obj || (POINTER)(lp)->limit < obj)) + { + plp = lp->prev; + CALL_FREEFUN (h, lp); + lp = plp; + /* If we switch chunks, we can't tell whether the new current + chunk contains an empty object, so assume that it may. */ + h->maybe_empty_object = 1; + } + if (lp) + { + h->object_base = h->next_free = (char *)(obj); + h->chunk_limit = lp->limit; + h->chunk = lp; + } + else if (obj != 0) + /* obj is not in any of the chunks! */ + abort (); + } + + #if 0 + /* These are now turned off because the applications do not use it + and it uses bcopy via obstack_grow, which causes trouble on sysV. */ + + /* Now define the functional versions of the obstack macros. + Define them to simply use the corresponding macros to do the job. */ + + #if defined (__STDC__) && __STDC__ + /* These function definitions do not work with non-ANSI preprocessors; + they won't pass through the macro names in parentheses. */ + + /* The function names appear in parentheses in order to prevent + the macro-definitions of the names from being expanded there. */ + + POINTER (obstack_base) (obstack) + struct obstack *obstack; + { + return obstack_base (obstack); + } + + POINTER (obstack_next_free) (obstack) + struct obstack *obstack; + { + return obstack_next_free (obstack); + } + + int (obstack_object_size) (obstack) + struct obstack *obstack; + { + return obstack_object_size (obstack); + } + + int (obstack_room) (obstack) + struct obstack *obstack; + { + return obstack_room (obstack); + } + + void (obstack_grow) (obstack, pointer, length) + struct obstack *obstack; + POINTER pointer; + int length; + { + obstack_grow (obstack, pointer, length); + } + + void (obstack_grow0) (obstack, pointer, length) + struct obstack *obstack; + POINTER pointer; + int length; + { + obstack_grow0 (obstack, pointer, length); + } + + void (obstack_1grow) (obstack, character) + struct obstack *obstack; + int character; + { + obstack_1grow (obstack, character); + } + + void (obstack_blank) (obstack, length) + struct obstack *obstack; + int length; + { + obstack_blank (obstack, length); + } + + void (obstack_1grow_fast) (obstack, character) + struct obstack *obstack; + int character; + { + obstack_1grow_fast (obstack, character); + } + + void (obstack_blank_fast) (obstack, length) + struct obstack *obstack; + int length; + { + obstack_blank_fast (obstack, length); + } + + POINTER (obstack_finish) (obstack) + struct obstack *obstack; + { + return obstack_finish (obstack); + } + + POINTER (obstack_alloc) (obstack, length) + struct obstack *obstack; + int length; + { + return obstack_alloc (obstack, length); + } + + POINTER (obstack_copy) (obstack, pointer, length) + struct obstack *obstack; + POINTER pointer; + int length; + { + return obstack_copy (obstack, pointer, length); + } + + POINTER (obstack_copy0) (obstack, pointer, length) + struct obstack *obstack; + POINTER pointer; + int length; + { + return obstack_copy0 (obstack, pointer, length); + } + + #endif /* __STDC__ */ + + #endif /* 0 */ + + #endif /* !ELIDE_CODE */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/optabs.c gcc-2.7.1/optabs.c *** gcc-2.7.0/optabs.c Thu Jun 15 07:55:15 1995 --- gcc-2.7.1/optabs.c Sat Oct 21 18:16:13 1995 *************** *** 3512,3515 **** --- 3512,3516 ---- expand_float (target, from, 0); emit_jump_insn (gen_jump (label)); + emit_barrier (); /* The sign bit is set. diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/output.h gcc-2.7.1/output.h *** gcc-2.7.0/output.h Thu Jun 15 07:55:44 1995 --- gcc-2.7.1/output.h Fri Jul 14 08:02:05 1995 *************** *** 377,380 **** --- 377,385 ---- extern int current_function_varargs; + /* Nonzero if current function uses stdarg.h or equivalent. + Zero for functions that use varargs.h. */ + + extern int current_function_stdarg; + /* Quantities of various kinds of registers used for the current function's args. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/protoize.c gcc-2.7.1/protoize.c *** gcc-2.7.0/protoize.c Thu Jun 15 07:57:09 1995 --- gcc-2.7.1/protoize.c Mon Oct 9 12:37:32 1995 *************** *** 296,300 **** #endif ! struct default_include { const char *fname; int cplusplus; } include_defaults[] #ifdef INCLUDE_DEFAULTS = INCLUDE_DEFAULTS; --- 296,300 ---- #endif ! struct default_include { const char *fname; int x1, x2; } include_defaults[] #ifdef INCLUDE_DEFAULTS = INCLUDE_DEFAULTS; *************** *** 302,332 **** = { /* Pick up GNU C++ specific include files. */ ! { GPLUSPLUS_INCLUDE_DIR, 1}, #ifdef CROSS_COMPILE /* This is the dir for fixincludes. Put it just before the files that we fix. */ ! { GCC_INCLUDE_DIR, 0}, /* For cross-compilation, this dir name is generated automatically in Makefile.in. */ ! { CROSS_INCLUDE_DIR, 0 }, /* This is another place that the target system's headers might be. */ ! { TOOL_INCLUDE_DIR, 0}, #else /* not CROSS_COMPILE */ /* This should be /use/local/include and should come before the fixincludes-fixed header files. */ ! { LOCAL_INCLUDE_DIR, 0}, /* This is here ahead of GCC_INCLUDE_DIR because assert.h goes here. Likewise, behind LOCAL_INCLUDE_DIR, where glibc puts its assert.h. */ ! { TOOL_INCLUDE_DIR, 0}, /* This is the dir for fixincludes. Put it just before the files that we fix. */ ! { GCC_INCLUDE_DIR, 0}, /* Some systems have an extra dir of include files. */ #ifdef SYSTEM_INCLUDE_DIR ! { SYSTEM_INCLUDE_DIR, 0}, #endif ! { STANDARD_INCLUDE_DIR, 0}, #endif /* not CROSS_COMPILE */ ! { 0, 0} }; #endif /* no INCLUDE_DEFAULTS */ --- 302,332 ---- = { /* Pick up GNU C++ specific include files. */ ! { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, #ifdef CROSS_COMPILE /* This is the dir for fixincludes. Put it just before the files that we fix. */ ! { GCC_INCLUDE_DIR, 0, 0 }, /* For cross-compilation, this dir name is generated automatically in Makefile.in. */ ! { CROSS_INCLUDE_DIR, 0, 0 }, /* This is another place that the target system's headers might be. */ ! { TOOL_INCLUDE_DIR, 0, 0 }, #else /* not CROSS_COMPILE */ /* This should be /use/local/include and should come before the fixincludes-fixed header files. */ ! { LOCAL_INCLUDE_DIR, 0, 1 }, /* This is here ahead of GCC_INCLUDE_DIR because assert.h goes here. Likewise, behind LOCAL_INCLUDE_DIR, where glibc puts its assert.h. */ ! { TOOL_INCLUDE_DIR, 0, 0 }, /* This is the dir for fixincludes. Put it just before the files that we fix. */ ! { GCC_INCLUDE_DIR, 0, 0 }, /* Some systems have an extra dir of include files. */ #ifdef SYSTEM_INCLUDE_DIR ! { SYSTEM_INCLUDE_DIR, 0, 0 }, #endif ! { STANDARD_INCLUDE_DIR, 0, 0}, #endif /* not CROSS_COMPILE */ ! { 0, 0, 0} }; #endif /* no INCLUDE_DEFAULTS */ *************** *** 2541,2561 **** { file_info *file_p = hp->fip; ! const def_dec_info *prev = NULL; ! const def_dec_info *current = file_p->defs_decs; ! if (!( current = file_p->defs_decs)) return; /* no list to reverse */ prev = current; ! if (! (current = current->next_in_file)) return; /* can't reverse a single list element */ ! ((NONCONST def_dec_info *) prev)->next_in_file = NULL; while (current) { ! const def_dec_info *next = current->next_in_file; ! ((NONCONST def_dec_info *) current)->next_in_file = prev; prev = current; current = next; --- 2541,2561 ---- { file_info *file_p = hp->fip; ! def_dec_info *prev = NULL; ! def_dec_info *current = (def_dec_info *)file_p->defs_decs; ! if (!current) return; /* no list to reverse */ prev = current; ! if (! (current = (def_dec_info *)current->next_in_file)) return; /* can't reverse a single list element */ ! prev->next_in_file = NULL; while (current) { ! def_dec_info *next = (def_dec_info *)current->next_in_file; ! current->next_in_file = prev; prev = current; current = next; *************** *** 2994,2998 **** /* Given a pointer to a character in the cleaned text buffer, return a pointer ! to the next non-whitepace character which follows it. */ static const char * --- 2994,2998 ---- /* Given a pointer to a character in the cleaned text buffer, return a pointer ! to the next non-whitespace character which follows it. */ static const char * *************** *** 3971,3975 **** abort (); } ! *scan_p++ = ' '; break; --- 3971,3977 ---- abort (); } ! if (!isspace (*scan_p)) ! *scan_p = ' '; ! scan_p++; break; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/real.c gcc-2.7.1/real.c *** gcc-2.7.0/real.c Thu Jun 15 07:57:39 1995 --- gcc-2.7.1/real.c Tue Aug 15 17:57:18 1995 *************** *** 2636,2642 **** { unsigned EMUSHORT ai[NI], bi[NI]; ! int i; EMULONG lt, lta, ltb; #ifdef NANS /* Return any NaN input. */ --- 2636,2646 ---- { unsigned EMUSHORT ai[NI], bi[NI]; ! int i, sign; EMULONG lt, lta, ltb; + /* IEEE says if result is not a NaN, the sign is "-" if and only if + operands have opposite signs -- but flush -0 to 0 later if not IEEE. */ + sign = eisneg(a) ^ eisneg(b); + #ifdef NANS /* Return any NaN input. */ *************** *** 2656,2660 **** { mtherr ("ediv", INVALID); ! enan (c, eisneg (a) ^ eisneg (b)); return; } --- 2660,2664 ---- { mtherr ("ediv", INVALID); ! enan (c, sign); return; } *************** *** 2664,2673 **** if (eisinf (b)) { - if (eisneg (a) ^ eisneg (b)) - *(c + (NE - 1)) = 0x8000; - else - *(c + (NE - 1)) = 0; einfin (c); ! return; } /* Anything else over infinity is zero. */ --- 2668,2673 ---- if (eisinf (b)) { einfin (c); ! goto divsign; } /* Anything else over infinity is zero. */ *************** *** 2675,2679 **** { eclear (c); ! return; } #endif --- 2675,2679 ---- { eclear (c); ! goto divsign; } #endif *************** *** 2693,2697 **** } eclear (c); ! return; } dnzro1: --- 2693,2697 ---- } eclear (c); ! goto divsign; } dnzro1: *************** *** 2707,2714 **** } } - if (ai[0] == bi[0]) - *(c + (NE - 1)) = 0; - else - *(c + (NE - 1)) = 0x8000; /* Divide by zero is not an invalid operation. It is a divide-by-zero operation! */ --- 2707,2710 ---- *************** *** 2715,2719 **** einfin (c); mtherr ("ediv", SING); ! return; } dnzro2: --- 2711,2715 ---- einfin (c); mtherr ("ediv", SING); ! goto divsign; } dnzro2: *************** *** 2723,2732 **** lt = ltb - lta + EXONE; emdnorm (bi, i, 0, lt, 64); - /* set the sign */ - if (ai[0] == bi[0]) - bi[0] = 0; - else - bi[0] = 0Xffff; emovo (bi, c); } --- 2719,2734 ---- lt = ltb - lta + EXONE; emdnorm (bi, i, 0, lt, 64); emovo (bi, c); + + divsign: + + if (sign + #ifndef IEEE + && (ecmp (c, ezero) != 0) + #endif + ) + *(c+(NE-1)) |= 0x8000; + else + *(c+(NE-1)) &= ~0x8000; } *************** *** 2738,2744 **** { unsigned EMUSHORT ai[NI], bi[NI]; ! int i, j; EMULONG lt, lta, ltb; #ifdef NANS /* NaN times anything is the same NaN. */ --- 2740,2750 ---- { unsigned EMUSHORT ai[NI], bi[NI]; ! int i, j, sign; EMULONG lt, lta, ltb; + /* IEEE says if result is not a NaN, the sign is "-" if and only if + operands have opposite signs -- but flush -0 to 0 later if not IEEE. */ + sign = eisneg(a) ^ eisneg(b); + #ifdef NANS /* NaN times anything is the same NaN. */ *************** *** 2758,2762 **** { mtherr ("emul", INVALID); ! enan (c, eisneg (a) ^ eisneg (b)); return; } --- 2764,2768 ---- { mtherr ("emul", INVALID); ! enan (c, sign); return; } *************** *** 2766,2775 **** if (eisinf (a) || eisinf (b)) { - if (eisneg (a) ^ eisneg (b)) - *(c + (NE - 1)) = 0x8000; - else - *(c + (NE - 1)) = 0; einfin (c); ! return; } #endif --- 2772,2777 ---- if (eisinf (a) || eisinf (b)) { einfin (c); ! goto mulsign; } #endif *************** *** 2789,2793 **** } eclear (c); ! return; } mnzer1: --- 2791,2795 ---- } eclear (c); ! goto mulsign; } mnzer1: *************** *** 2804,2808 **** } eclear (c); ! return; } mnzer2: --- 2806,2810 ---- } eclear (c); ! goto mulsign; } mnzer2: *************** *** 2813,2822 **** lt = lta + ltb - (EXONE - 1); emdnorm (bi, j, 0, lt, 64); - /* calculate sign of product */ - if (ai[0] == bi[0]) - bi[0] = 0; - else - bi[0] = 0xffff; emovo (bi, c); } --- 2815,2830 ---- lt = lta + ltb - (EXONE - 1); emdnorm (bi, j, 0, lt, 64); emovo (bi, c); + + mulsign: + + if (sign + #ifndef IEEE + && (ecmp (c, ezero) != 0) + #endif + ) + *(c+(NE-1)) |= 0x8000; + else + *(c+(NE-1)) &= ~0x8000; } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/recog.c gcc-2.7.1/recog.c *** gcc-2.7.0/recog.c Thu Jun 15 07:58:34 1995 --- gcc-2.7.1/recog.c Sat Jul 1 06:52:35 1995 *************** *** 865,868 **** --- 865,879 ---- if (! reload_completed && GET_CODE (SUBREG_REG (op)) == MEM) return general_operand (op, mode); + + #ifdef CLASS_CANNOT_CHANGE_SIZE + if (GET_CODE (SUBREG_REG (op)) == REG + && REGNO (SUBREG_REG (op)) < FIRST_PSEUDO_REGISTER + && TEST_HARD_REG_BIT (reg_class_contents[(int) CLASS_CANNOT_CHANGE_SIZE], + REGNO (SUBREG_REG (op))) + && (GET_MODE_SIZE (mode) + != GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))))) + return 0; + #endif + op = SUBREG_REG (op); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/regclass.c gcc-2.7.1/regclass.c *** gcc-2.7.0/regclass.c Thu Jun 15 07:59:45 1995 --- gcc-2.7.1/regclass.c Thu Sep 28 15:19:36 1995 *************** *** 1680,1684 **** /* Maximum number of parallel sets and clobbers in any insn in this fn. ! Always at least 3, since the combiner could put that many togetherm and we want this to remain correct for all the remaining passes. */ --- 1680,1684 ---- /* Maximum number of parallel sets and clobbers in any insn in this fn. ! Always at least 3, since the combiner could put that many together and we want this to remain correct for all the remaining passes. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/reload.c gcc-2.7.1/reload.c *** gcc-2.7.0/reload.c Thu Jun 15 08:01:03 1995 --- gcc-2.7.1/reload.c Sat Nov 11 08:23:54 1995 *************** *** 99,102 **** --- 99,103 ---- #include "flags.h" #include "real.h" + #include "output.h" #ifndef REGISTER_MOVE_COST *************** *** 357,360 **** --- 358,371 ---- *picode = CODE_FOR_nothing; + /* If X is a paradoxical SUBREG, use the inner value to determine both the + mode and object being reloaded. */ + if (GET_CODE (x) == SUBREG + && (GET_MODE_SIZE (GET_MODE (x)) + > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))) + { + x = SUBREG_REG (x); + reload_mode = GET_MODE (x); + } + /* If X is a pseudo-register that has an equivalent MEM (actually, if it is still a pseudo-register by now, it *must* have an equivalent MEM *************** *** 725,728 **** --- 736,740 ---- register int i; int dont_share = 0; + int dont_remove_subreg = 0; rtx *in_subreg_loc = 0, *out_subreg_loc = 0; int secondary_in_reload = -1, secondary_out_reload = -1; *************** *** 891,896 **** --- 903,914 ---- GET_MODE (SUBREG_REG (in))))))) { + /* This relies on the fact that emit_reload_insns outputs the + instructions for input reloads of type RELOAD_OTHER in the same + order as the reloads. Thus if the outer reload is also of type + RELOAD_OTHER, we are guaranteed that this inner reload will be + output before the outer reload. */ push_reload (SUBREG_REG (in), NULL_RTX, &SUBREG_REG (in), NULL_PTR, GENERAL_REGS, VOIDmode, VOIDmode, 0, 0, opnum, type); + dont_remove_subreg = 1; } *************** *** 954,957 **** --- 972,1005 ---- } + /* Similar issue for (SUBREG:M1 (REG:M2 ...) ...) for a hard register R where + either M1 is not valid for R or M2 is wider than a word but we only + need one word to store an M2-sized quantity in R. + + However, we must reload the inner reg *as well as* the subreg in + that case. In this case, the inner reg is an in-out reload. */ + + if (out != 0 && GET_CODE (out) == SUBREG + && GET_CODE (SUBREG_REG (out)) == REG + && REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER + && (! HARD_REGNO_MODE_OK (REGNO (SUBREG_REG (out)), outmode) + || (GET_MODE_SIZE (outmode) <= UNITS_PER_WORD + && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) + > UNITS_PER_WORD) + && ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) + / UNITS_PER_WORD) + != HARD_REGNO_NREGS (REGNO (SUBREG_REG (out)), + GET_MODE (SUBREG_REG (out))))))) + { + /* This relies on the fact that emit_reload_insns outputs the + instructions for output reloads of type RELOAD_OTHER in reverse + order of the reloads. Thus if the outer reload is also of type + RELOAD_OTHER, we are guaranteed that this inner reload will be + output after the outer reload. */ + dont_remove_subreg = 1; + push_reload (SUBREG_REG (out), SUBREG_REG (out), &SUBREG_REG (out), + &SUBREG_REG (out), ALL_REGS, VOIDmode, VOIDmode, 0, 0, + opnum, RELOAD_OTHER); + } + /* If IN appears in OUT, we can't share any input-only reload for IN. */ if (in != 0 && out != 0 && GET_CODE (out) == MEM *************** *** 964,968 **** if (in != 0 && GET_CODE (in) == SUBREG && GET_CODE (SUBREG_REG (in)) == REG ! && REGNO (SUBREG_REG (in)) < FIRST_PSEUDO_REGISTER) in = gen_rtx (REG, GET_MODE (in), REGNO (SUBREG_REG (in)) + SUBREG_WORD (in)); --- 1012,1017 ---- if (in != 0 && GET_CODE (in) == SUBREG && GET_CODE (SUBREG_REG (in)) == REG ! && REGNO (SUBREG_REG (in)) < FIRST_PSEUDO_REGISTER ! && ! dont_remove_subreg) in = gen_rtx (REG, GET_MODE (in), REGNO (SUBREG_REG (in)) + SUBREG_WORD (in)); *************** *** 971,975 **** if (out != 0 && GET_CODE (out) == SUBREG && GET_CODE (SUBREG_REG (out)) == REG ! && REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER) out = gen_rtx (REG, GET_MODE (out), REGNO (SUBREG_REG (out)) + SUBREG_WORD (out)); --- 1020,1025 ---- if (out != 0 && GET_CODE (out) == SUBREG && GET_CODE (SUBREG_REG (out)) == REG ! && REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER ! && ! dont_remove_subreg) out = gen_rtx (REG, GET_MODE (out), REGNO (SUBREG_REG (out)) + SUBREG_WORD (out)); *************** *** 4198,4212 **** } ! /* If we have address of a stack slot but it's not valid ! (displacement is too large), compute the sum in a register. */ else if (GET_CODE (ad) == PLUS ! && (XEXP (ad, 0) == frame_pointer_rtx ! #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM ! || XEXP (ad, 0) == hard_frame_pointer_rtx ! #endif ! #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM ! || XEXP (ad, 0) == arg_pointer_rtx ! #endif ! || XEXP (ad, 0) == stack_pointer_rtx) && GET_CODE (XEXP (ad, 1)) == CONST_INT) { --- 4248,4260 ---- } ! /* If we have address of a stack slot but it's not valid because the ! displacement is too large, compute the sum in a register. ! Handle all base registers here, not just fp/ap/sp, because on some ! targets (namely SH) we can also get too large displacements from ! big-endian corrections. */ else if (GET_CODE (ad) == PLUS ! && GET_CODE (XEXP (ad, 0)) == REG ! && REGNO (XEXP (ad, 0)) < FIRST_PSEUDO_REGISTER ! && REG_OK_FOR_BASE_P (XEXP (ad, 0)) && GET_CODE (XEXP (ad, 1)) == CONST_INT) { *************** *** 4562,4565 **** --- 4610,4616 ---- op0 = SUBREG_REG (op0); code0 = GET_CODE (op0); + if (code0 == REG && REGNO (op0) < FIRST_PSEUDO_REGISTER) + op0 = gen_rtx (REG, word_mode, + REGNO (op0) + SUBREG_WORD (orig_op0)); } *************** *** 4568,4571 **** --- 4619,4625 ---- op1 = SUBREG_REG (op1); code1 = GET_CODE (op1); + if (code1 == REG && REGNO (op1) < FIRST_PSEUDO_REGISTER) + op1 = gen_rtx (REG, GET_MODE (op1), + REGNO (op1) + SUBREG_WORD (orig_op1)); } *************** *** 4829,4847 **** case SUBREG: ! /* If this is a SUBREG of a hard register and the resulting register is ! of the wrong class, reload the whole SUBREG. This avoids needless ! copies if SUBREG_REG is multi-word. */ ! if (GET_CODE (SUBREG_REG (x)) == REG ! && REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER) { ! int regno = REGNO (SUBREG_REG (x)) + SUBREG_WORD (x); ! if (! (context ? REGNO_OK_FOR_INDEX_P (regno) ! : REGNO_OK_FOR_BASE_P (regno))) { ! push_reload (x, NULL_RTX, loc, NULL_PTR, ! context ? INDEX_REG_CLASS : BASE_REG_CLASS, ! GET_MODE (x), VOIDmode, 0, 0, opnum, type); ! return 1; } } --- 4883,4917 ---- case SUBREG: ! if (GET_CODE (SUBREG_REG (x)) == REG) { ! /* If this is a SUBREG of a hard register and the resulting register ! is of the wrong class, reload the whole SUBREG. This avoids ! needless copies if SUBREG_REG is multi-word. */ ! if (REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER) ! { ! int regno = REGNO (SUBREG_REG (x)) + SUBREG_WORD (x); ! if (! (context ? REGNO_OK_FOR_INDEX_P (regno) ! : REGNO_OK_FOR_BASE_P (regno))) ! { ! push_reload (x, NULL_RTX, loc, NULL_PTR, ! context ? INDEX_REG_CLASS : BASE_REG_CLASS, ! GET_MODE (x), VOIDmode, 0, 0, opnum, type); ! return 1; ! } ! } ! /* If this is a SUBREG of a pseudo-register, and the pseudo-register ! is larger than the class size, then reload the whole SUBREG. */ ! else { ! enum reg_class class = (context ! ? INDEX_REG_CLASS : BASE_REG_CLASS); ! if (CLASS_MAX_NREGS (class, GET_MODE (SUBREG_REG (x))) ! > reg_class_size[class]) ! { ! push_reload (x, NULL_RTX, loc, NULL_PTR, class, ! GET_MODE (x), VOIDmode, 0, 0, opnum, type); ! return 1; ! } } } *************** *** 5124,5128 **** SUBREG_REG (SET_DEST (x)), loc)) ! /* If the ouput is an earlyclobber operand, this is a conflict. */ || ((GET_CODE (SET_DEST (x)) != REG --- 5194,5198 ---- SUBREG_REG (SET_DEST (x)), loc)) ! /* If the output is an earlyclobber operand, this is a conflict. */ || ((GET_CODE (SET_DEST (x)) != REG *************** *** 5528,5531 **** --- 5598,5607 ---- || need_stable_sp)) return 0; + + #ifdef NON_SAVING_SETJMP + if (NON_SAVING_SETJMP && GET_CODE (p) == NOTE + && NOTE_LINE_NUMBER (p) == NOTE_INSN_SETJMP) + return 0; + #endif #ifdef INSN_CLOBBERS_REGNO_P diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/reload1.c gcc-2.7.1/reload1.c *** gcc-2.7.0/reload1.c Thu Jun 15 08:01:47 1995 --- gcc-2.7.1/reload1.c Sun Nov 5 11:22:22 1995 *************** *** 35,38 **** --- 35,39 ---- #include "basic-block.h" #include "output.h" + #include "real.h" /* This file contains the reload pass of the compiler, which is *************** *** 3236,3240 **** elimination is, in fact, being done. ! If REPLACE isn't set, we can't delete this insn, but neededn't process it since it won't be used unless something changes. */ if (replace) --- 3237,3241 ---- elimination is, in fact, being done. ! If REPLACE isn't set, we can't delete this insn, but needn't process it since it won't be used unless something changes. */ if (replace) *************** *** 5650,5653 **** --- 5651,5655 ---- rtx operand_reload_insns = 0; rtx other_operand_reload_insns = 0; + rtx other_output_reload_insns = 0; rtx following_insn = NEXT_INSN (insn); rtx before_insn = insn; *************** *** 6259,6262 **** --- 6261,6274 ---- continue; } + /* Likewise for a SUBREG of an operand that dies. */ + else if (GET_CODE (old) == SUBREG + && GET_CODE (SUBREG_REG (old)) == REG + && 0 != (note = find_reg_note (insn, REG_UNUSED, + SUBREG_REG (old)))) + { + XEXP (note, 0) = gen_lowpart_common (GET_MODE (old), + reload_reg_rtx[j]); + continue; + } else if (GET_CODE (old) == SCRATCH) /* If we aren't optimizing, there won't be a REG_UNUSED note, *************** *** 6278,6282 **** abort (); ! push_to_sequence (output_reload_insns[reload_opnum[j]]); /* Determine the mode to reload in. --- 6290,6297 ---- abort (); ! if (reload_when_needed[j] == RELOAD_OTHER) ! start_sequence (); ! else ! push_to_sequence (output_reload_insns[reload_opnum[j]]); /* Determine the mode to reload in. *************** *** 6344,6347 **** --- 6359,6363 ---- rtx third_reloadreg = reload_reg_rtx[reload_secondary_out_reload[secondary_reload]]; + rtx tem; /* Copy primary reload reg to secondary reload reg. *************** *** 6349,6352 **** --- 6365,6379 ---- secondary reload reg to OLD using our insn. */ + /* If REAL_OLD is a paradoxical SUBREG, remove it + and try to put the opposite SUBREG on + RELOADREG. */ + if (GET_CODE (real_old) == SUBREG + && (GET_MODE_SIZE (GET_MODE (real_old)) + > GET_MODE_SIZE (GET_MODE (SUBREG_REG (real_old)))) + && 0 != (tem = gen_lowpart_common + (GET_MODE (SUBREG_REG (real_old)), + reloadreg))) + real_old = SUBREG_REG (real_old), reloadreg = tem; + gen_reload (reloadreg, second_reloadreg, reload_opnum[j], reload_when_needed[j]); *************** *** 6410,6414 **** } ! output_reload_insns[reload_opnum[j]] = get_insns (); end_sequence (); } --- 6437,6449 ---- } ! if (reload_when_needed[j] == RELOAD_OTHER) ! { ! if (other_output_reload_insns) ! emit_insns (other_output_reload_insns); ! other_output_reload_insns = get_insns (); ! } ! else ! output_reload_insns[reload_opnum[j]] = get_insns (); ! end_sequence (); } *************** *** 6421,6425 **** RELOAD_FOR_OTHER_ADDRESS reloads for input addresses. ! RELOAD_OTHER reloads. For each operand, any RELOAD_FOR_INPUT_ADDRESS reloads followed by --- 6456,6460 ---- RELOAD_FOR_OTHER_ADDRESS reloads for input addresses. ! RELOAD_OTHER reloads, output in ascending order by reload number. For each operand, any RELOAD_FOR_INPUT_ADDRESS reloads followed by *************** *** 6433,6438 **** For each operand, any RELOAD_FOR_OUTPUT_ADDRESS reload followed by ! the RELOAD_FOR_OUTPUT reload for that operand. */ emit_insns_before (other_input_address_reload_insns, before_insn); emit_insns_before (other_input_reload_insns, before_insn); --- 6468,6476 ---- For each operand, any RELOAD_FOR_OUTPUT_ADDRESS reload followed by ! the RELOAD_FOR_OUTPUT reload for that operand. + Any RELOAD_OTHER output reloads, output in descending order by + reload number. */ + emit_insns_before (other_input_address_reload_insns, before_insn); emit_insns_before (other_input_reload_insns, before_insn); *************** *** 6452,6455 **** --- 6490,6495 ---- emit_insns_before (output_reload_insns[j], following_insn); } + + emit_insns_before (other_output_reload_insns, following_insn); /* Move death notes from INSN diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/reorg.c gcc-2.7.1/reorg.c *** gcc-2.7.0/reorg.c Thu Jun 15 08:02:32 1995 --- gcc-2.7.1/reorg.c Fri Sep 15 17:38:55 1995 *************** *** 1373,1377 **** } ! /* Look at the relative rarities of the fallthough and destination. If they differ, we can predict the branch that way. */ --- 1373,1377 ---- } ! /* Look at the relative rarities of the fallthrough and destination. If they differ, we can predict the branch that way. */ *************** *** 2858,2867 **** && no_labels_between_p (insn, trial)) { slots_filled++; delay_list = add_to_delay_list (trial, delay_list); /* Remove the unconditional jump from consideration for delay slot ! filling and unthread it. */ ! if (unfilled_slots_base[i + 1] == trial) ! unfilled_slots_base[i + 1] = 0; { rtx next = NEXT_INSN (trial); --- 2858,2879 ---- && no_labels_between_p (insn, trial)) { + rtx *tmp; slots_filled++; delay_list = add_to_delay_list (trial, delay_list); + + /* TRIAL may have had its delay slot filled, then unfilled. When + the delay slot is unfilled, TRIAL is placed back on the unfilled + slots obstack. Unfortunately, it is placed on the end of the + obstack, not in its original location. Therefore, we must search + from entry i + 1 to the end of the unfilled slots obstack to + try and find TRIAL. */ + tmp = &unfilled_slots_base[i + 1]; + while (*tmp != trial && tmp != unfilled_slots_next) + tmp++; + /* Remove the unconditional jump from consideration for delay slot ! filling and unthread it. */ ! if (*tmp == trial) ! *tmp = 0; { rtx next = NEXT_INSN (trial); *************** *** 2963,2974 **** call might not return). ! If this is a conditional jump, see if it merges back to us early ! enough for us to pick up insns from the merge point. Don't do ! this if there is another branch to our label unless we pass all of ! them. ! ! Another similar merge is if we jump to the same place that a ! later unconditional jump branches to. In that case, we don't ! care about the number of uses of our label. */ if (slots_filled != slots_to_fill --- 2975,2984 ---- call might not return). ! There used to be code which continued past the target label if ! we saw all uses of the target label. This code did not work, ! because it failed to account for some instructions which were ! both annulled and marked as from the target. This can happen as a ! result of optimize_skip. Since this code was redundant with ! fill_eager_delay_slots anyways, it was just deleted. */ if (slots_filled != slots_to_fill *************** *** 2980,2985 **** rtx target = 0; int maybe_never = 0; - int passed_label = 0; - int target_uses; struct resources needed_at_jump; --- 2990,2993 ---- *************** *** 2998,3008 **** mark_referenced_resources (insn, &needed, 1); if (GET_CODE (insn) == JUMP_INSN) ! { ! /* Get our target and show how many more uses we want to ! see before we hit the label. */ ! target = JUMP_LABEL (insn); ! target_uses = LABEL_NUSES (target) - 1; ! } ! } --- 3006,3010 ---- mark_referenced_resources (insn, &needed, 1); if (GET_CODE (insn) == JUMP_INSN) ! target = JUMP_LABEL (insn); } *************** *** 3013,3032 **** next_trial = next_nonnote_insn (trial); ! if (GET_CODE (trial) == CODE_LABEL) ! { ! passed_label = 1; ! ! /* If this is our target, see if we have seen all its uses. ! If so, indicate we have passed our target and ignore it. ! All other labels cause us to stop our search. */ ! if (trial == target && target_uses == 0) ! { ! target = 0; ! continue; ! } ! else ! break; ! } ! else if (GET_CODE (trial) == BARRIER) break; --- 3015,3020 ---- next_trial = next_nonnote_insn (trial); ! if (GET_CODE (trial) == CODE_LABEL ! || GET_CODE (trial) == BARRIER) break; *************** *** 3053,3059 **** if (target == 0) break; ! else if (JUMP_LABEL (trial_delay) == target) ! target_uses--; ! else { mark_target_live_regs --- 3041,3045 ---- if (target == 0) break; ! else if (JUMP_LABEL (trial_delay) != target) { mark_target_live_regs *************** *** 3088,3093 **** #endif - if (passed_label) - update_block (trial, trial); delete_insn (trial); if (slots_to_fill == ++slots_filled) --- 3074,3077 ---- *************** *** 3415,3418 **** --- 3399,3404 ---- if (new_thread == old_trial) new_thread = trial; + if (thread == old_trial) + thread = trial; pat = PATTERN (trial); if ((thread_if_true *************** *** 3678,3682 **** continue; ! /* Get the next active fallthough and target insns and see if we own them. Then see whether the branch is likely true. We don't need to do a lot of this for unconditional branches. */ --- 3664,3668 ---- continue; ! /* Get the next active fallthrough and target insns and see if we own them. Then see whether the branch is likely true. We don't need to do a lot of this for unconditional branches. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/rtlanal.c gcc-2.7.1/rtlanal.c *** gcc-2.7.0/rtlanal.c Thu Jun 15 08:03:58 1995 --- gcc-2.7.1/rtlanal.c Fri Oct 6 13:13:57 1995 *************** *** 1,4 **** /* Analyze RTL for C-Compiler ! Copyright (C) 1987, 88, 91, 92, 93, 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Analyze RTL for C-Compiler ! Copyright (C) 1987, 88, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 429,434 **** static int reg_set_flag; ! void ! reg_set_p_1 (x) rtx x; { --- 429,434 ---- static int reg_set_flag; ! static void ! reg_set_p_1 (x, pat) rtx x; { *************** *** 906,910 **** || GET_CODE (reg_set_last_value) == SUBREG) && ! reg_set_between_p (reg_set_last_value, ! NEXT_INSN (insn), orig_insn))) return reg_set_last_value; else --- 906,910 ---- || GET_CODE (reg_set_last_value) == SUBREG) && ! reg_set_between_p (reg_set_last_value, ! insn, orig_insn))) return reg_set_last_value; else diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/scan-decls.c gcc-2.7.1/scan-decls.c *** gcc-2.7.0/scan-decls.c Thu Jun 15 08:04:57 1995 --- gcc-2.7.1/scan-decls.c Mon Jun 19 14:18:43 1995 *************** *** 247,251 **** default: ! prev_id_start = NULL; } } --- 247,251 ---- default: ! prev_id_start = 0; } } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/stmt.c gcc-2.7.1/stmt.c *** gcc-2.7.0/stmt.c Thu Jun 15 08:08:17 1995 --- gcc-2.7.1/stmt.c Tue Sep 12 19:01:54 1995 *************** *** 468,481 **** static void emit_case_nodes PROTO((rtx, case_node_ptr, rtx, tree)); - int bc_expand_exit_loop_if_false (); - void bc_expand_start_cond (); - void bc_expand_end_cond (); - void bc_expand_start_else (); - void bc_expand_end_bindings (); - void bc_expand_start_case (); - void bc_check_for_full_enumeration_handling (); - void bc_expand_end_case (); - void bc_expand_decl (); - extern rtx bc_allocate_local (); extern rtx bc_allocate_variable_array (); --- 468,471 ---- *************** *** 564,568 **** if (!optimize && (GET_CODE (last_insn) == CODE_LABEL ! || prev_real_insn (last_insn) == 0)) emit_insn (gen_nop ()); } --- 554,559 ---- if (!optimize && (GET_CODE (last_insn) == CODE_LABEL ! || (GET_CODE (last_insn) == NOTE ! && prev_real_insn (last_insn) == 0))) emit_insn (gen_nop ()); } *************** *** 1256,1260 **** = emit_insns_after (cleanup_insns, f->before_jump); ! TREE_VALUE (lists) = 0; } --- 1247,1251 ---- = emit_insns_after (cleanup_insns, f->before_jump); ! f->cleanup_list_list = TREE_CHAIN (lists); } *************** *** 1518,1521 **** --- 1509,1513 ---- { int j; + int allows_reg = 0; /* If there's an erroneous arg, emit no insn, *************** *** 1533,1545 **** /* Make sure constraint has neither `=' nor `+'. */ ! for (j = 0; j < TREE_STRING_LENGTH (TREE_PURPOSE (tail)); j++) ! if (TREE_STRING_POINTER (TREE_PURPOSE (tail))[j] == '=' ! || TREE_STRING_POINTER (TREE_PURPOSE (tail))[j] == '+') { error ("input operand constraint contains `%c'", TREE_STRING_POINTER (TREE_PURPOSE (tail))[j]); return; } XVECEXP (body, 3, i) /* argvec */ = expand_expr (TREE_VALUE (tail), NULL_RTX, VOIDmode, 0); --- 1525,1557 ---- /* Make sure constraint has neither `=' nor `+'. */ ! for (j = 0; j < TREE_STRING_LENGTH (TREE_PURPOSE (tail)) - 1; j++) ! switch (TREE_STRING_POINTER (TREE_PURPOSE (tail))[j]) { + case '+': case '=': error ("input operand constraint contains `%c'", TREE_STRING_POINTER (TREE_PURPOSE (tail))[j]); return; + + case '?': case '!': case '*': case '%': case '&': + case 'V': case 'm': case 'o': case '<': case '>': + case 'E': case 'F': case 'G': case 'H': case 'X': + case 's': case 'i': case 'n': + case 'I': case 'J': case 'K': case 'L': case 'M': + case 'N': case 'O': case 'P': case ',': + #ifdef EXTRA_CONSTRAINT + case 'Q': case 'R': case 'S': case 'T': case 'U': + #endif + break; + + case '0': case '1': case '2': case '3': case '4': + case 'p': case 'g': case 'r': + default: + allows_reg = 1; + break; } + if (! allows_reg) + mark_addressable (TREE_VALUE (tail)); + XVECEXP (body, 3, i) /* argvec */ = expand_expr (TREE_VALUE (tail), NULL_RTX, VOIDmode, 0); *************** *** 1547,1553 **** && ! general_operand (XVECEXP (body, 3, i), TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))))) ! XVECEXP (body, 3, i) ! = force_reg (TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))), ! XVECEXP (body, 3, i)); XVECEXP (body, 4, i) /* constraints */ = gen_rtx (ASM_INPUT, TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))), --- 1559,1587 ---- && ! general_operand (XVECEXP (body, 3, i), TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))))) ! { ! if (allows_reg) ! XVECEXP (body, 3, i) ! = force_reg (TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))), ! XVECEXP (body, 3, i)); ! else ! XVECEXP (body, 3, i) ! = force_const_mem (TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))), ! XVECEXP (body, 3, i)); ! } ! ! if (! allows_reg ! && (GET_CODE (XVECEXP (body, 3, i)) == REG ! || GET_CODE (XVECEXP (body, 3, i)) == SUBREG ! || GET_CODE (XVECEXP (body, 3, i)) == CONCAT)) ! { ! tree type = TREE_TYPE (TREE_VALUE (tail)); ! rtx memloc = assign_stack_temp (TYPE_MODE (type), ! int_size_in_bytes (type), 1); ! ! MEM_IN_STRUCT_P (memloc) = AGGREGATE_TYPE_P (type); ! emit_move_insn (memloc, XVECEXP (body, 3, i)); ! XVECEXP (body, 3, i) = memloc; ! } ! XVECEXP (body, 4, i) /* constraints */ = gen_rtx (ASM_INPUT, TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))), *************** *** 1852,1855 **** --- 1886,1890 ---- t = make_node (RTL_EXPR); resume_momentary (momentary); + do_pending_stack_adjust (); start_sequence_for_rtl_expr (t); NO_DEFER_POP; *************** *** 2723,2771 **** && GET_CODE (DECL_RTL (DECL_RESULT (current_function_decl))) == REG) { ! int i; int big_endian_correction = 0; int bytes = int_size_in_bytes (TREE_TYPE (retval_rhs)); int n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; rtx *result_pseudos = (rtx *) alloca (sizeof (rtx) * n_regs); ! rtx result_reg; rtx result_val = expand_expr (retval_rhs, NULL_RTX, VOIDmode, 0); enum machine_mode tmpmode, result_reg_mode; ! /* Structures smaller than a word are aligned to the least significant ! byte (to the right). On a BYTES_BIG_ENDIAN machine, this means we ! must skip the empty high order bytes when calculating the bit ! offset. */ ! if (BYTES_BIG_ENDIAN && bytes < UNITS_PER_WORD) ! big_endian_correction = (BITS_PER_WORD - (bytes * BITS_PER_UNIT)); ! ! for (i = 0; i < n_regs; i++) ! { ! rtx reg = gen_reg_rtx (word_mode); ! rtx word = operand_subword_force (result_val, i, BLKmode); ! int bitsize = MIN (TYPE_ALIGN (TREE_TYPE (retval_rhs)),BITS_PER_WORD); ! int bitpos; ! ! result_pseudos[i] = reg; ! ! /* Clobber REG and move each partword into it. Ensure we don't ! go past the end of the structure. Note that the loop below ! works because we've already verified that padding and ! endianness are compatible. */ ! emit_insn (gen_rtx (CLOBBER, VOIDmode, reg)); ! ! for (bitpos = 0; ! bitpos < BITS_PER_WORD && bytes > 0; ! bitpos += bitsize, bytes -= bitsize / BITS_PER_UNIT) { ! int xbitpos = bitpos + big_endian_correction; ! store_bit_field (reg, bitsize, xbitpos, word_mode, ! extract_bit_field (word, bitsize, bitpos, 1, ! NULL_RTX, word_mode, ! word_mode, ! bitsize / BITS_PER_UNIT, ! BITS_PER_WORD), ! bitsize / BITS_PER_UNIT, BITS_PER_WORD); } } --- 2758,2815 ---- && GET_CODE (DECL_RTL (DECL_RESULT (current_function_decl))) == REG) { ! int i, bitpos, xbitpos; int big_endian_correction = 0; int bytes = int_size_in_bytes (TREE_TYPE (retval_rhs)); int n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + int bitsize = MIN (TYPE_ALIGN (TREE_TYPE (retval_rhs)),BITS_PER_WORD); rtx *result_pseudos = (rtx *) alloca (sizeof (rtx) * n_regs); ! rtx result_reg, src, dst; rtx result_val = expand_expr (retval_rhs, NULL_RTX, VOIDmode, 0); enum machine_mode tmpmode, result_reg_mode; ! /* Structures whose size is not a multiple of a word are aligned ! to the least significant byte (to the right). On a BYTES_BIG_ENDIAN ! machine, this means we must skip the empty high order bytes when ! calculating the bit offset. */ ! if (BYTES_BIG_ENDIAN && bytes % UNITS_PER_WORD) ! big_endian_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) ! * BITS_PER_UNIT)); ! ! /* Copy the structure BITSIZE bits at a time. */ ! for (bitpos = 0, xbitpos = big_endian_correction; ! bitpos < bytes * BITS_PER_UNIT; ! bitpos += bitsize, xbitpos += bitsize) ! { ! /* We need a new destination pseudo each time xbitpos is ! on a word boundary and when xbitpos == big_endian_correction ! (the first time through). */ ! if (xbitpos % BITS_PER_WORD == 0 ! || xbitpos == big_endian_correction) { ! /* Generate an appropriate register. */ ! dst = gen_reg_rtx (word_mode); ! result_pseudos[xbitpos / BITS_PER_WORD] = dst; ! /* Clobber the destination before we move anything into it. */ ! emit_insn (gen_rtx (CLOBBER, VOIDmode, dst)); } + + /* We need a new source operand each time bitpos is on a word + boundary. */ + if (bitpos % BITS_PER_WORD == 0) + src = operand_subword_force (result_val, + bitpos / BITS_PER_WORD, + BLKmode); + + /* Use bitpos for the source extraction (left justified) and + xbitpos for the destination store (right justified). */ + store_bit_field (dst, bitsize, xbitpos % BITS_PER_WORD, word_mode, + extract_bit_field (src, bitsize, + bitpos % BITS_PER_WORD, 1, + NULL_RTX, word_mode, + word_mode, + bitsize / BITS_PER_UNIT, + BITS_PER_WORD), + bitsize / BITS_PER_UNIT, BITS_PER_WORD); } *************** *** 3267,3286 **** /* Generate RTL for the automatic variable declaration DECL. ! (Other kinds of declarations are simply ignored if seen here.) ! CLEANUP is an expression to be executed at exit from this binding contour; ! for example, in C++, it might call the destructor for this variable. ! ! If CLEANUP contains any SAVE_EXPRs, then you must preevaluate them ! either before or after calling `expand_decl' but before compiling ! any subsequent expressions. This is because CLEANUP may be expanded ! more than once, on different branches of execution. ! For the same reason, CLEANUP may not contain a CALL_EXPR ! except as its topmost node--else `preexpand_calls' would get confused. ! ! If CLEANUP is nonzero and DECL is zero, we record a cleanup ! that is not associated with any particular variable. ! ! There is no special support here for C++ constructors. ! They should be handled by the proper code in DECL_INITIAL. */ void --- 3311,3315 ---- /* Generate RTL for the automatic variable declaration DECL. ! (Other kinds of declarations are simply ignored if seen here.) */ void *************** *** 3655,3659 **** If CLEANUP contains any SAVE_EXPRs, then you must preevaluate them ! either before or after calling `expand_decl' but before compiling any subsequent expressions. This is because CLEANUP may be expanded more than once, on different branches of execution. --- 3684,3688 ---- If CLEANUP contains any SAVE_EXPRs, then you must preevaluate them ! either before or after calling `expand_decl_cleanup' but before compiling any subsequent expressions. This is because CLEANUP may be expanded more than once, on different branches of execution. *************** *** 3698,3702 **** rtx x; ! expand_decl (decl, cleanup); x = DECL_RTL (decl); --- 3727,3732 ---- rtx x; ! expand_decl (decl); ! expand_decl_cleanup (decl, cleanup); x = DECL_RTL (decl); diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/stor-layout.c gcc-2.7.1/stor-layout.c *** gcc-2.7.0/stor-layout.c Thu Jun 15 08:08:47 1995 --- gcc-2.7.1/stor-layout.c Tue Oct 3 19:15:07 1995 *************** *** 47,51 **** int maximum_field_alignment; ! /* If non-zero, the alignment of a bitsting or (power-)set value, in bits. May be overridden by front-ends. */ int set_alignment = 0; --- 47,51 ---- int maximum_field_alignment; ! /* If non-zero, the alignment of a bitstring or (power-)set value, in bits. May be overridden by front-ends. */ int set_alignment = 0; *************** *** 82,85 **** --- 82,95 ---- } + void + put_pending_sizes (chain) + tree chain; + { + if (pending_sizes) + abort (); + + pending_sizes = chain; + } + /* Given a size SIZE that may not be a constant, return a SAVE_EXPR to serve as the actual size-expression for a type or decl. */ *************** *** 738,745 **** && TYPE_SIZE (element)) { ! tree length ! = size_binop (PLUS_EXPR, size_one_node, ! size_binop (MINUS_EXPR, TYPE_MAX_VALUE (index), ! TYPE_MIN_VALUE (index))); /* If neither bound is a constant and sizetype is signed, make --- 748,773 ---- && TYPE_SIZE (element)) { ! tree ub = TYPE_MAX_VALUE (index); ! tree lb = TYPE_MIN_VALUE (index); ! tree length; ! ! /* If UB is max (lb - 1, x), remove the MAX_EXPR since the ! test for negative below covers it. */ ! if (TREE_CODE (ub) == MAX_EXPR ! && TREE_CODE (TREE_OPERAND (ub, 0)) == MINUS_EXPR ! && integer_onep (TREE_OPERAND (TREE_OPERAND (ub, 0), 1)) ! && operand_equal_p (TREE_OPERAND (TREE_OPERAND (ub, 0), 0), ! lb, 0)) ! ub = TREE_OPERAND (ub, 1); ! else if (TREE_CODE (ub) == MAX_EXPR ! && TREE_CODE (TREE_OPERAND (ub, 1)) == MINUS_EXPR ! && integer_onep (TREE_OPERAND (TREE_OPERAND (ub, 1), 1)) ! && operand_equal_p (TREE_OPERAND (TREE_OPERAND (ub, 1), ! 0), ! lb, 0)) ! ub = TREE_OPERAND (ub, 0); ! ! length = size_binop (PLUS_EXPR, size_one_node, ! size_binop (MINUS_EXPR, ub, lb)); /* If neither bound is a constant and sizetype is signed, make diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/stupid.c gcc-2.7.1/stupid.c *** gcc-2.7.0/stupid.c Thu Jun 15 08:09:19 1995 --- gcc-2.7.1/stupid.c Sun Oct 29 07:45:22 1995 *************** *** 1,4 **** /* Dummy data flow analysis for GNU compiler in nonoptimizing mode. ! Copyright (C) 1987, 1991, 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Dummy data flow analysis for GNU compiler in nonoptimizing mode. ! Copyright (C) 1987, 1991, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 424,431 **** if (code == SET || code == CLOBBER) { ! if (SET_DEST (x) != 0 && GET_CODE (SET_DEST (x)) == REG) { /* Register is being assigned. */ ! regno = REGNO (SET_DEST (x)); /* For hard regs, update the where-live info. */ --- 424,440 ---- if (code == SET || code == CLOBBER) { ! if (SET_DEST (x) != 0 ! && (GET_CODE (SET_DEST (x)) == REG ! || (GET_CODE (SET_DEST (x)) == SUBREG ! && GET_CODE (SUBREG_REG (SET_DEST (x))) == REG ! && (REGNO (SUBREG_REG (SET_DEST (x))) ! >= FIRST_PSEUDO_REGISTER)))) { /* Register is being assigned. */ ! /* If setting a SUBREG, we treat the entire reg as being set. */ ! if (GET_CODE (SET_DEST (x)) == SUBREG) ! regno = REGNO (SUBREG_REG (SET_DEST (x))); ! else ! regno = REGNO (SET_DEST (x)); /* For hard regs, update the where-live info. */ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/texinfo.tex gcc-2.7.1/texinfo.tex *** gcc-2.7.0/texinfo.tex Thu Jun 15 18:12:25 1995 --- gcc-2.7.1/texinfo.tex Thu Nov 9 11:30:15 1995 *************** *** 35,39 **** % This automatically updates the version number based on RCS. \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} ! \deftexinfoversion$Revision: 2.145 $ \message{Loading texinfo package [Version \texinfoversion]:} --- 35,39 ---- % This automatically updates the version number based on RCS. \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} ! \deftexinfoversion$Revision: 2.149 $ \message{Loading texinfo package [Version \texinfoversion]:} *************** *** 67,71 **** % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 ! \gdef\tie{\leavevmode\penalty\@M\ } } \let\~ = \tie % And make it available as @~. --- 67,74 ---- % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 ! % Avoid using \@M directly, because that causes trouble ! % if the definition is written into an index file. ! \global\let\tiepenalty = \@M ! \gdef\tie{\lvvmode\penalty\tiepenalty\ } } \let\~ = \tie % And make it available as @~. *************** *** 1105,1113 **** \def\t#1{% ! {\tt \nohyphenation \rawbackslash \frenchspacing #1}% \null } ! \let\ttfont = \t ! %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null} \def\samp #1{`\tclose{#1}'\null} \def\key #1{{\tt \nohyphenation \uppercase{#1}}\null} --- 1108,1115 ---- \def\t#1{% ! {\tt \rawbackslash \frenchspacing #1}% \null } ! \let\ttfont=\t \def\samp #1{`\tclose{#1}'\null} \def\key #1{{\tt \nohyphenation \uppercase{#1}}\null} *************** *** 1158,1161 **** --- 1160,1164 ---- \global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} } + \def\realdash{-} \def\realunder{_} *************** *** 1545,1549 **** \aboveenvbreak % \begingroup % ! \def\Edescription{\Etable}% Neccessary kludge. \let\itemindex=#1% \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % --- 1548,1552 ---- \aboveenvbreak % \begingroup % ! \def\Edescription{\Etable}% Necessary kludge. \let\itemindex=#1% \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % *************** *** 1989,1994 **** --- 1992,2004 ---- \def\dfn##1{\realbackslash dfn {##1}}% \def\emph##1{\realbackslash emph {##1}}% + \unsepspaces } + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\\leavevmode \penalty \@M \ ). + {\obeyspaces + \gdef\unsepspaces{\obeyspaces\let =\space}} + % \indexnofonts no-ops all font-change commands. % This is used when outputting the strings to sort the index by. *************** *** 2241,2245 **** % Insert the text of the index entry. TeX will do line-breaking on it. #1% ! % The following is kluged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. --- 2251,2255 ---- % Insert the text of the index entry. TeX will do line-breaking on it. #1% ! % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. *************** *** 2579,2583 **** }} ! \outer\def\appenixsection{\parsearg\appendixsecyyy} \outer\def\appendixsec{\parsearg\appendixsecyyy} \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz --- 2589,2593 ---- }} ! \outer\def\appendixsection{\parsearg\appendixsecyyy} \outer\def\appendixsec{\parsearg\appendixsecyyy} \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz *************** *** 3011,3017 **** % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) % \def\tocentry#1#2{\begingroup \hyphenpenalty = 10000 ! \entry{#1}{#2}% \endgroup} --- 3021,3028 ---- % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) % + % \turnoffactive is for the sake of @" used for umlauts. \def\tocentry#1#2{\begingroup \hyphenpenalty = 10000 ! \entry{\turnoffactive #1}{\turnoffactive #2}% \endgroup} diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/tm.texi gcc-2.7.1/tm.texi *** gcc-2.7.0/tm.texi Sun Jun 11 13:45:25 1995 --- gcc-2.7.1/tm.texi Sun Sep 3 08:59:01 1995 *************** *** 200,213 **** @findex LINK_LIBGCC_SPECIAL @item LINK_LIBGCC_SPECIAL ! Define this macro meaning that @code{gcc} should find the library ! @file{libgcc.a} by hand, rather than passing the argument @samp{-lgcc} ! to tell the linker to do the search; also, @code{gcc} should not ! generate @samp{-L} options to pass to the linker (as it normally does). @findex LINK_LIBGCC_SPECIAL_1 @item LINK_LIBGCC_SPECIAL_1 ! Define this macro meaning that @code{gcc} should find the ! library @file{libgcc.a} by hand, rather than passing the argument ! @samp{-lgcc} to tell the linker to do the search. @findex RELATIVE_PREFIX_NOT_LINKDIR --- 200,228 ---- @findex LINK_LIBGCC_SPECIAL @item LINK_LIBGCC_SPECIAL ! Define this macro if the driver program should find the library ! @file{libgcc.a} itself and should not pass @samp{-L} options to the ! linker. If you do not define this macro, the driver program will pass ! the argument @samp{-lgcc} to tell the linker to do the search and will ! pass @samp{-L} options to it. @findex LINK_LIBGCC_SPECIAL_1 @item LINK_LIBGCC_SPECIAL_1 ! Define this macro if the driver program should find the library ! @file{libgcc.a}. If you do not define this macro, the driver program will pass ! the argument @samp{-lgcc} to tell the linker to do the search. ! This macro is similar to @code{LINK_LIBGCC_SPECIAL}, except that it does ! not affect @samp{-L} options. ! ! @findex MULTILIB_DEFAULTS ! @item MULTILIB_DEFAULTS ! Define this macro as a C expression for the initializer of an array of ! string to tell the driver program which options are defaults for this ! target and thus do not need to be handled specially when using ! @code{MULTILIB_OPTIONS}. ! ! Do not define this macro if @code{MULTILIB_OPTIONS} is not defined in ! the target makefile fragment or if none of the options listed in ! @code{MULTILIB_OPTIONS} are set by default. ! @xref{Target Fragment}. @findex RELATIVE_PREFIX_NOT_LINKDIR diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/toplev.c gcc-2.7.1/toplev.c *** gcc-2.7.0/toplev.c Thu Jun 15 08:09:51 1995 --- gcc-2.7.1/toplev.c Fri Oct 20 17:56:35 1995 *************** *** 142,145 **** --- 142,149 ---- static char *decl_name (); + #ifdef __alpha + extern char *sbrk (); + #endif + /* Name of program invoked, sans directories. */ *************** *** 1049,1053 **** if (input_file_stack && input_file_stack->next != 0 ! && input_file_stack_tick != last_error_tick) { fprintf (stderr, "In file included"); --- 1053,1058 ---- if (input_file_stack && input_file_stack->next != 0 ! && input_file_stack_tick != last_error_tick ! && file == input_filename) { fprintf (stderr, "In file included"); *************** *** 1081,1085 **** HOST_WIDE_INT v2 = va_arg(ap, HOST_WIDE_INT); HOST_WIDE_INT v3 = va_arg(ap, HOST_WIDE_INT); ! fprintf (stderr, s, v1, v2, v3); } #endif --- 1086,1091 ---- HOST_WIDE_INT v2 = va_arg(ap, HOST_WIDE_INT); HOST_WIDE_INT v3 = va_arg(ap, HOST_WIDE_INT); ! HOST_WIDE_INT v4 = va_arg(ap, HOST_WIDE_INT); ! fprintf (stderr, s, v1, v2, v3, v4); } #endif *************** *** 1858,1862 **** /* Strip off a legitimate source ending from the input string NAME of ! length LEN. */ void --- 1864,1870 ---- /* Strip off a legitimate source ending from the input string NAME of ! length LEN. Rather than having to know the names used by all of ! our front ends, we strip off an ending of a period followed by one, ! two, or three characters. */ void *************** *** 1865,1894 **** int len; { ! if (len > 2 && ! strcmp (".c", name + len - 2)) ! name[len - 2] = 0; ! else if (len > 2 && ! strcmp (".m", name + len - 2)) ! name[len - 2] = 0; ! else if (len > 2 && ! strcmp (".i", name + len - 2)) ! name[len - 2] = 0; ! else if (len > 3 && ! strcmp (".ii", name + len - 3)) ! name[len - 3] = 0; ! else if (len > 3 && ! strcmp (".co", name + len - 3)) ! name[len - 3] = 0; ! else if (len > 3 && ! strcmp (".cc", name + len - 3)) ! name[len - 3] = 0; ! else if (len > 2 && ! strcmp (".C", name + len - 2)) ! name[len - 2] = 0; ! else if (len > 4 && ! strcmp (".cxx", name + len - 4)) ! name[len - 4] = 0; ! else if (len > 4 && ! strcmp (".cpp", name + len - 4)) ! name[len - 4] = 0; ! else if (len > 2 && ! strcmp (".f", name + len - 2)) ! name[len - 2] = 0; ! /* Ada will use extensions like .ada, .adb, and .ads, so just test ! for "ad". */ ! else if (len > 4 && ! strncmp (".ad", name + len - 4, 3)) ! name[len - 4] = 0; ! else if (len > 4 && ! strcmp (".atr", name + len - 4)) ! name[len - 4] = 0; } --- 1873,1882 ---- int len; { ! if (len > 2 && name[len - 2] == '.') ! name[len - 2] = '\0'; ! else if (len > 3 && name[len - 3] == '.') ! name[len - 3] = '\0'; ! else if (len > 4 && name[len - 4] == '.') ! name[len - 4] = '\0'; } *************** *** 3280,3283 **** --- 3268,3274 ---- reload_completed = 0; + /* Clear out the insn_length contents now that they are no longer valid. */ + init_insn_lengths (); + /* Clear out the real_constant_chain before some of the rtx's it runs through become garbage. */ *************** *** 3801,3805 **** #endif if (write_symbols == NO_DEBUG) ! warning ("`-%s' option not supported on this version of GCC", str); else if (level == 0) write_symbols = NO_DEBUG; --- 3792,3797 ---- #endif if (write_symbols == NO_DEBUG) ! warning ("`-%s' not supported by this configuration of GCC", ! str); else if (level == 0) write_symbols = NO_DEBUG; *************** *** 3860,3864 **** && strcmp (language_string, "GNU C++") == 0) { ! warning ("-g option not supported for C++ on SVR4 systems"); write_symbols = NO_DEBUG; } --- 3852,3856 ---- && strcmp (language_string, "GNU C++") == 0) { ! warning ("-g option not supported for C++ on systems using the DWARF debugging format"); write_symbols = NO_DEBUG; } *************** *** 3919,3925 **** if (flag_print_mem) { - #ifdef __alpha - char *sbrk (); - #endif char *lim = (char *) sbrk (0); --- 3911,3914 ---- diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/tree.c gcc-2.7.1/tree.c *** gcc-2.7.0/tree.c Thu Jun 15 08:10:23 1995 --- gcc-2.7.1/tree.c Sun Oct 1 21:26:56 1995 *************** *** 2059,2064 **** --- 2059,2069 ---- return staticp (TREE_OPERAND (arg, 0)); + #if 0 + /* This case is technically correct, but results in setting + TREE_CONSTANT on ADDR_EXPRs that cannot be evaluated at + compile time. */ case INDIRECT_REF: return TREE_CONSTANT (TREE_OPERAND (arg, 0)); + #endif case ARRAY_REF: *************** *** 2111,2115 **** if (TREE_CONSTANT (t) || (TREE_READONLY (t) && ! TREE_SIDE_EFFECTS (t)) ! || TREE_CODE (t) == SAVE_EXPR) return t; --- 2116,2120 ---- if (TREE_CONSTANT (t) || (TREE_READONLY (t) && ! TREE_SIDE_EFFECTS (t)) ! || TREE_CODE (t) == SAVE_EXPR || TREE_CODE (t) == ERROR_MARK) return t; *************** *** 3594,3598 **** trust what might be in the operand, so say we don't know the situation. */ ! if (code1 >= sizeof standard_tree_code_type / sizeof standard_tree_code_type[0]) return -1; --- 3599,3603 ---- trust what might be in the operand, so say we don't know the situation. */ ! if ((int) code1 >= sizeof standard_tree_code_type / sizeof standard_tree_code_type[0]) return -1; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/tree.h gcc-2.7.1/tree.h *** gcc-2.7.0/tree.h Thu Jun 15 08:10:49 1995 --- gcc-2.7.1/tree.h Mon Sep 25 17:49:40 1995 *************** *** 1290,1293 **** --- 1290,1294 ---- extern tree round_up PROTO((tree, int)); extern tree get_pending_sizes PROTO((void)); + extern void put_pending_sizes PROTO((tree)); /* Type for sizes of data-type. */ *************** *** 1298,1302 **** extern int maximum_field_alignment; ! /* If non-zero, the alignment of a bitsting or (power-)set value, in bits. */ extern int set_alignment; --- 1299,1303 ---- extern int maximum_field_alignment; ! /* If non-zero, the alignment of a bitstring or (power-)set value, in bits. */ extern int set_alignment; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/unroll.c gcc-2.7.1/unroll.c *** gcc-2.7.0/unroll.c Thu Jun 15 08:11:44 1995 --- gcc-2.7.1/unroll.c Sat Aug 19 17:33:26 1995 *************** *** 854,857 **** --- 854,870 ---- labels[i] = gen_label_rtx (); + /* Check for the case where the initial value is greater than or equal + to the final value. In that case, we want to execute exactly + one loop iteration. The code below will fail for this case. */ + + emit_cmp_insn (initial_value, final_value, neg_inc ? LE : GE, + NULL_RTX, mode, 0, 0); + if (neg_inc) + emit_jump_insn (gen_ble (labels[1])); + else + emit_jump_insn (gen_bge (labels[1])); + JUMP_LABEL (get_last_insn ()) = labels[1]; + LABEL_NUSES (labels[1])++; + /* Assuming the unroll_number is 4, and the increment is 2, then for a negative increment: for a positive increment: *************** *** 870,873 **** --- 883,887 ---- { int cmp_const; + enum rtx_code cmp_code; /* For negative increments, must invert the constant compared *************** *** 874,885 **** against, except when comparing against zero. */ if (i == 0) ! cmp_const = 0; else if (neg_inc) ! cmp_const = unroll_number - i; else ! cmp_const = i; emit_cmp_insn (diff, GEN_INT (abs_inc * cmp_const), ! EQ, NULL_RTX, mode, 0, 0); if (i == 0) --- 888,908 ---- against, except when comparing against zero. */ if (i == 0) ! { ! cmp_const = 0; ! cmp_code = EQ; ! } else if (neg_inc) ! { ! cmp_const = unroll_number - i; ! cmp_code = GE; ! } else ! { ! cmp_const = i; ! cmp_code = LE; ! } emit_cmp_insn (diff, GEN_INT (abs_inc * cmp_const), ! cmp_code, NULL_RTX, mode, 0, 0); if (i == 0) *************** *** 905,915 **** { int cmp_const; if (neg_inc) ! cmp_const = abs_inc - 1; else ! cmp_const = abs_inc * (unroll_number - 1) + 1; ! emit_cmp_insn (diff, GEN_INT (cmp_const), EQ, NULL_RTX, mode, 0, 0); --- 928,945 ---- { int cmp_const; + enum rtx_code cmp_code; if (neg_inc) ! { ! cmp_const = abs_inc - 1; ! cmp_code = LE; ! } else ! { ! cmp_const = abs_inc * (unroll_number - 1) + 1; ! cmp_code = GE; ! } ! emit_cmp_insn (diff, GEN_INT (cmp_const), cmp_code, NULL_RTX, mode, 0, 0); *************** *** 1383,1390 **** if (GET_CODE (increment) == LO_SUM) increment = XEXP (increment, 1); ! else if (GET_CODE (increment) == IOR) { ! /* The rs6000 port loads some constants with IOR. */ rtx second_part = XEXP (increment, 1); src_insn = PREV_INSN (src_insn); --- 1413,1423 ---- if (GET_CODE (increment) == LO_SUM) increment = XEXP (increment, 1); ! else if (GET_CODE (increment) == IOR ! || GET_CODE (increment) == ASHIFT) { ! /* The rs6000 port loads some constants with IOR. ! The alpha port loads some constants with ASHIFT. */ rtx second_part = XEXP (increment, 1); + enum rtx_code code = GET_CODE (increment); src_insn = PREV_INSN (src_insn); *************** *** 1397,1401 **** abort (); ! increment = GEN_INT (INTVAL (increment) | INTVAL (second_part)); } --- 1430,1437 ---- abort (); ! if (code == IOR) ! increment = GEN_INT (INTVAL (increment) | INTVAL (second_part)); ! else ! increment = GEN_INT (INTVAL (increment) << INTVAL (second_part)); } *************** *** 2358,2362 **** value on loop exit. */ ! /* loop_number_exit_labels is non-zero if the loop has an exit other than a fall through at the end. */ --- 2394,2398 ---- value on loop exit. */ ! /* loop_number_exit_count is non-zero if the loop has an exit other than a fall through at the end. */ *************** *** 2364,2368 **** biv_final_value = 0; if (unroll_type != UNROLL_COMPLETELY ! && (loop_number_exit_labels[uid_loop_num[INSN_UID (loop_start)]] || unroll_type == UNROLL_NAIVE) && (uid_luid[regno_last_uid[bl->regno]] >= INSN_LUID (loop_end) --- 2400,2404 ---- biv_final_value = 0; if (unroll_type != UNROLL_COMPLETELY ! && (loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]] || unroll_type == UNROLL_NAIVE) && (uid_luid[regno_last_uid[bl->regno]] >= INSN_LUID (loop_end) *************** *** 2398,2407 **** /* If the initial value of the biv is itself (i.e. it is too complicated for strength_reduce to compute), or is a hard ! register, then we must create a new pseudo reg to hold the ! initial value of the biv. */ if (GET_CODE (bl->initial_value) == REG && (REGNO (bl->initial_value) == bl->regno ! || REGNO (bl->initial_value) < FIRST_PSEUDO_REGISTER)) { rtx tem = gen_reg_rtx (bl->biv->mode); --- 2434,2444 ---- /* If the initial value of the biv is itself (i.e. it is too complicated for strength_reduce to compute), or is a hard ! register, or it isn't invariant, then we must create a new ! pseudo reg to hold the initial value of the biv. */ if (GET_CODE (bl->initial_value) == REG && (REGNO (bl->initial_value) == bl->regno ! || REGNO (bl->initial_value) < FIRST_PSEUDO_REGISTER ! || ! invariant_p (bl->initial_value))) { rtx tem = gen_reg_rtx (bl->biv->mode); *************** *** 2451,2455 **** how the loop exits. Otherwise emit the insn after the loop, since this is slightly more efficient. */ ! if (! loop_number_exit_labels[uid_loop_num[INSN_UID (loop_start)]]) emit_insn_before (gen_move_insn (bl->biv->src_reg, biv_final_value), --- 2488,2492 ---- how the loop exits. Otherwise emit the insn after the loop, since this is slightly more efficient. */ ! if (! loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]]) emit_insn_before (gen_move_insn (bl->biv->src_reg, biv_final_value), *************** *** 2574,2578 **** final_value = 0; if (unroll_type != UNROLL_COMPLETELY ! && (loop_number_exit_labels[uid_loop_num[INSN_UID (loop_start)]] || unroll_type == UNROLL_NAIVE) && v->giv_type != DEST_ADDR --- 2611,2615 ---- final_value = 0; if (unroll_type != UNROLL_COMPLETELY ! && (loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]] || unroll_type == UNROLL_NAIVE) && v->giv_type != DEST_ADDR *************** *** 2914,2917 **** --- 2951,2968 ---- enum rtx_code code; int jump_count = 0; + int label_count = 0; + int this_loop_num = uid_loop_num[INSN_UID (loop_start)]; + + /* In addition to checking all exits of this loop, we must also check + all exits of inner nested loops that would exit this loop. We don't + have any way to identify those, so we just give up if there are any + such inner loop exits. */ + + for (label = loop_number_exit_labels[this_loop_num]; label; + label = LABEL_NEXTREF (label)) + label_count++; + + if (label_count != loop_number_exit_count[this_loop_num]) + return 0; /* HACK: Must also search the loop fall through exit, create a label_ref *************** *** 2919,2924 **** list to it. */ label = gen_rtx (LABEL_REF, VOIDmode, loop_end); ! LABEL_NEXTREF (label) ! = loop_number_exit_labels[uid_loop_num[INSN_UID (loop_start)]]; for ( ; label; label = LABEL_NEXTREF (label)) --- 2970,2974 ---- list to it. */ label = gen_rtx (LABEL_REF, VOIDmode, loop_end); ! LABEL_NEXTREF (label) = loop_number_exit_labels[this_loop_num]; for ( ; label; label = LABEL_NEXTREF (label)) *************** *** 2999,3003 **** if (loop_n_iterations != 0 ! && ! loop_number_exit_labels[uid_loop_num[INSN_UID (loop_start)]] && invariant_p (bl->initial_value)) { --- 3049,3053 ---- if (loop_n_iterations != 0 ! && ! loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]] && invariant_p (bl->initial_value)) { *************** *** 3077,3081 **** if (loop_n_iterations != 0 ! && ! loop_number_exit_labels[uid_loop_num[INSN_UID (loop_start)]]) { /* ?? It is tempting to use the biv's value here since these insns will --- 3127,3131 ---- if (loop_n_iterations != 0 ! && ! loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]]) { /* ?? It is tempting to use the biv's value here since these insns will diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/varasm.c gcc-2.7.1/varasm.c *** gcc-2.7.0/varasm.c Thu Jun 15 08:12:06 1995 --- gcc-2.7.1/varasm.c Thu Aug 31 19:02:53 1995 *************** *** 1576,1580 **** { if (output_bytecode) ! bc_emit_labelref (name); else fputs (&name[1], file); --- 1576,1580 ---- { if (output_bytecode) ! bc_emit_labelref (name, 0); else fputs (&name[1], file); *************** *** 2955,2958 **** --- 2955,2959 ---- union real_extract du; struct addr_const addr; + struct {HOST_WIDE_INT high, low;} di; } un; }; *************** *** 2985,2991 **** value->kind = RTX_DOUBLE; if (GET_MODE (x) != VOIDmode) ! value->mode = GET_MODE (x); ! bcopy ((char *) &CONST_DOUBLE_LOW (x), ! (char *) &value->un.du, sizeof value->un.du); break; --- 2986,2999 ---- value->kind = RTX_DOUBLE; if (GET_MODE (x) != VOIDmode) ! { ! value->mode = GET_MODE (x); ! bcopy ((char *) &CONST_DOUBLE_LOW (x), ! (char *) &value->un.du, sizeof value->un.du); ! } ! else ! { ! value->un.di.low = CONST_DOUBLE_LOW (x); ! value->un.di.high = CONST_DOUBLE_HIGH (x); ! } break; *************** *** 3686,3690 **** if (size == 4 && TREE_CODE (TREE_OPERAND (addr_part, 0)) == VAR_DECL) ! bc_emit_labelref (DECL_ASSEMBLER_NAME (TREE_OPERAND (addr_part, 0)), TREE_INT_CST_LOW (const_part)); else --- 3694,3699 ---- if (size == 4 && TREE_CODE (TREE_OPERAND (addr_part, 0)) == VAR_DECL) ! bc_emit_labelref (IDENTIFIER_POINTER ! (DECL_ASSEMBLER_NAME (TREE_OPERAND (addr_part, 0))), TREE_INT_CST_LOW (const_part)); else diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/version.c gcc-2.7.1/version.c *** gcc-2.7.0/version.c Thu Jun 15 17:38:00 1995 --- gcc-2.7.1/version.c Mon Jun 19 13:14:48 1995 *************** *** 1 **** ! char *version_string = "2.7.0"; --- 1 ---- ! char *version_string = "2.7.1"; diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/vmsconfig.com gcc-2.7.1/vmsconfig.com *** gcc-2.7.0/vmsconfig.com Fri May 19 06:57:02 1995 --- gcc-2.7.1/vmsconfig.com Mon Aug 28 06:27:38 1995 *************** *** 195,199 **** PROCEDURE process_objc_lib( ) ! ! ! Intrepret objc/Makefile, after finishing the top makefile. ! ON_ERROR --- 195,199 ---- PROCEDURE process_objc_lib( ) ! ! ! Interpret objc/Makefile, after finishing the top makefile. ! ON_ERROR *************** *** 452,456 **** $ $! ! $! Constuct a header file based on subdirectory contents $! $make_lang_incl: subroutine --- 452,456 ---- $ $! ! $! Construct a header file based on subdirectory contents $! $make_lang_incl: subroutine Binary files gcc-2.7.0/vz and gcc-2.7.1/vz differ diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/xcoffout.c gcc-2.7.1/xcoffout.c *** gcc-2.7.0/xcoffout.c Thu Jun 15 08:12:30 1995 --- gcc-2.7.1/xcoffout.c Sun Oct 29 07:47:09 1995 *************** *** 1,4 **** /* Output xcoff-format symbol table information from GNU compiler. ! Copyright (C) 1992, 1994 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,4 ---- /* Output xcoff-format symbol table information from GNU compiler. ! Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. *************** *** 55,58 **** --- 55,59 ---- int xcoff_begin_function_line = -1; + int xcoff_inlining = 0; /* Name of the current include file. */ *************** *** 81,85 **** #define ABS_OR_RELATIVE_LINENO(LINENO) \ ! (xcoff_current_include_file ? (LINENO) : (LINENO) - xcoff_begin_function_line) /* Output source line numbers via ".line" rather than ".stabd". */ --- 82,86 ---- #define ABS_OR_RELATIVE_LINENO(LINENO) \ ! ((xcoff_inlining) ? (LINENO) : (LINENO) - xcoff_begin_function_line) /* Output source line numbers via ".line" rather than ".stabd". */ *************** *** 317,333 **** } - /* In XCOFF, we have to have this .bf before the function prologue. - Rely on the value of `dbx_begin_function_line' not to duplicate .bf. */ - - void - xcoffout_output_first_source_line (file, last_linenum) - FILE *file; - int last_linenum; - { - ASM_OUTPUT_LFB (file, last_linenum); - dbxout_parms (DECL_ARGUMENTS (current_function_decl)); - ASM_OUTPUT_SOURCE_LINE (file, last_linenum); - } - /* Output debugging info to FILE to switch to sourcefile FILENAME. INLINE_P is true if this is from an inlined function. */ --- 318,321 ---- *************** *** 341,346 **** if (filename && (xcoff_lastfile == 0 || strcmp (filename, xcoff_lastfile) ! || (inline_p && ! xcoff_current_include_file) ! || (! inline_p && xcoff_current_include_file))) { if (xcoff_current_include_file) --- 329,334 ---- if (filename && (xcoff_lastfile == 0 || strcmp (filename, xcoff_lastfile) ! || (inline_p && ! xcoff_inlining) ! || (! inline_p && xcoff_inlining))) { if (xcoff_current_include_file) *************** *** 351,354 **** --- 339,343 ---- xcoff_current_include_file = NULL; } + xcoff_inlining=inline_p; if (strcmp (main_input_filename, filename) || inline_p) { *************** *** 474,487 **** int i; ! for (i = 0; name[i]; ++i) ! { ! if (name[i] == '[') ! { ! n = (char *) alloca (i + 1); ! strncpy (n, name, i); ! n[i] = '\0'; ! break; ! } ! } /* Any pending .bi or .ei must occur before the .function pseudo op. --- 463,479 ---- int i; ! if (*n == '*') ! n++; ! else ! for (i = 0; name[i]; ++i) ! { ! if (name[i] == '[') ! { ! n = (char *) alloca (i + 1); ! strncpy (n, name, i); ! n[i] = '\0'; ! break; ! } ! } /* Any pending .bi or .ei must occur before the .function pseudo op. *************** *** 504,507 **** --- 496,501 ---- { ASM_OUTPUT_LFB (file, last_linenum); + dbxout_parms (DECL_ARGUMENTS (current_function_decl)); + ASM_OUTPUT_SOURCE_LINE (file, last_linenum); } diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c -x TAGS -x gcc.?? -x gcc.??s -x gcc.aux -x gcc.info* -x cpp.?? -x cpp.??s -x cpp.aux -x cpp.info* -x cp/parse.c -x cp/parse.h gcc-2.7.0/xcoffout.h gcc-2.7.1/xcoffout.h *** gcc-2.7.0/xcoffout.h Tue May 16 07:44:51 1995 --- gcc-2.7.1/xcoffout.h Sun Oct 29 07:47:04 1995 *************** *** 85,91 **** && GET_CODE (current_sym_addr) == SYMBOL_REF) \ { \ ! char *_p; \ ! for (_p = XSTR (current_sym_addr, 0); *_p != '[' && *_p; _p++) \ ! fprintf (asmfile, "%c", *_p); \ } \ else if (current_sym_addr) \ --- 85,94 ---- && GET_CODE (current_sym_addr) == SYMBOL_REF) \ { \ ! char *_p = XSTR (current_sym_addr, 0); \ ! if (*_p == '*') \ ! fprintf (asmfile, "%s", _p+1); \ ! else \ ! for (; *_p != '[' && *_p; _p++) \ ! fprintf (asmfile, "%c", *_p); \ } \ else if (current_sym_addr) \