From d405059b2306bd35f956dc8405eeda0917e85153 Mon Sep 17 00:00:00 2001 From: kloczek Date: Mon, 31 Jan 2000 02:31:45 +0000 Subject: [PATCH] - bunch patches from Debian potato (full destription inside patches). Changed files: gcc-alpha-complex-float.patch -> 1.1 gcc-arm-config.patch -> 1.1 gcc-bootstrap.patch -> 1.1 gcc-builtin-apply.patch -> 1.1 gcc-cpp-dos-newlines.patch -> 1.1 gcc-cpp-macro-doc.patch -> 1.1 gcc-default-arch.patch -> 1.1 gcc-g++-is-tree.patch -> 1.1 gcc-gcj-backport.patch -> 1.1 gcc-gpc.patch -> 1.1 gcc-libstdc++-bastring.patch -> 1.1 gcc-libstdc++-out-of-mem.patch -> 1.1 gcc-libstdc++-wall3.patch -> 1.1 gcc-libstdc++-wstring.patch -> 1.1 gcc-m68k-pic.patch -> 1.1 gcc-manpage.patch -> 1.1 gcc-ppc-andrew-dwarf-eh.patch -> 1.1 gcc-ppc-descriptions.patch -> 1.1 gcc-ppc-ice.patch -> 1.1 gcc-sparc32-rfi.patch -> 1.1 --- gcc-alpha-complex-float.patch | 164 + gcc-arm-config.patch | 372 ++ gcc-bootstrap.patch | 153 + gcc-builtin-apply.patch | 62 + gcc-cpp-dos-newlines.patch | 76 + gcc-cpp-macro-doc.patch | 96 + gcc-default-arch.patch | 30 + gcc-g++-is-tree.patch | 82 + gcc-gcj-backport.patch | 6526 ++++++++++++++++++++++++++++++++ gcc-gpc.patch | 361 ++ gcc-libstdc++-bastring.patch | 46 + gcc-libstdc++-out-of-mem.patch | 57 + gcc-libstdc++-wall3.patch | 153 + gcc-libstdc++-wstring.patch | 15 + gcc-m68k-pic.patch | 64 + gcc-manpage.patch | 20 + gcc-ppc-andrew-dwarf-eh.patch | 622 +++ gcc-ppc-descriptions.patch | 231 ++ gcc-ppc-ice.patch | 24 + gcc-sparc32-rfi.patch | 21 + 20 files changed, 9175 insertions(+) create mode 100644 gcc-alpha-complex-float.patch create mode 100644 gcc-arm-config.patch create mode 100644 gcc-bootstrap.patch create mode 100644 gcc-builtin-apply.patch create mode 100644 gcc-cpp-dos-newlines.patch create mode 100644 gcc-cpp-macro-doc.patch create mode 100644 gcc-default-arch.patch create mode 100644 gcc-g++-is-tree.patch create mode 100644 gcc-gcj-backport.patch create mode 100644 gcc-gpc.patch create mode 100644 gcc-libstdc++-bastring.patch create mode 100644 gcc-libstdc++-out-of-mem.patch create mode 100644 gcc-libstdc++-wall3.patch create mode 100644 gcc-libstdc++-wstring.patch create mode 100644 gcc-m68k-pic.patch create mode 100644 gcc-manpage.patch create mode 100644 gcc-ppc-andrew-dwarf-eh.patch create mode 100644 gcc-ppc-descriptions.patch create mode 100644 gcc-ppc-ice.patch create mode 100644 gcc-sparc32-rfi.patch diff --git a/gcc-alpha-complex-float.patch b/gcc-alpha-complex-float.patch new file mode 100644 index 0000000..6793955 --- /dev/null +++ b/gcc-alpha-complex-float.patch @@ -0,0 +1,164 @@ +# DP: Fix for complex math on alpha + +I've tested this patch with building glibc and it enables it to compile, I +haven't been able to test the resulting binaries yet, however. I assume +this will fix the g77 problems too. + + * flow.c (insn_dead_p): Don't kill part of a complex number. + * emit-rtl.c (gen_lowpart_common): Handle narrow complex reg values. + (gen_highpart): Likewise. + * calls.c (expand_call): Narrow complex variable uses two regs. + * alpha/alpha.h (ALPHA_ARG_SIZE): Likewise. + (HARD_REGNO_NREGS): Likewise. + +*** ../gcc/flow.c Tue Feb 4 18:34:01 1997 +--- gcc/flow.c Sun Mar 16 09:17:52 1997 +*************** +*** 1819,1824 **** +--- 1819,1828 ---- + & ((REGSET_ELT_TYPE) 1 + << ((regno + n) % REGSET_ELT_BITS))) != 0) + return 0; ++ ++ /* Don't allow part of a complex number to be deleted. */ ++ if (GET_MODE_CLASS (GET_MODE (r)) == MODE_COMPLEX_FLOAT) ++ return 0; + } + + return 1; +*** ../gcc/calls.c Sat Jan 4 18:43:38 1997 +--- gcc/calls.c Sun Mar 16 09:54:39 1997 +*************** +*** 1893,1898 **** +--- 1893,1903 ---- + validize_mem (args[i].value), nregs, + args[i].mode); + ++ /* Indicate two regs used to hold a short complex arg. */ ++ if (GET_MODE_CLASS (args[i].mode) == MODE_COMPLEX_FLOAT ++ && GET_MODE_SIZE (args[i].mode) <= UNITS_PER_WORD) ++ nregs = 2; ++ + /* Handle calls that pass values in multiple non-contiguous + locations. The Irix 6 ABI has examples of this. */ + if (GET_CODE (reg) == PARALLEL) +*** ../gcc/config/alpha/alpha.h Sun Jan 19 13:17:06 1997 +--- gcc/config/alpha/alpha.h Sun Mar 16 14:39:59 1997 +*************** +*** 493,499 **** + but can be less for certain modes in special long registers. */ + + #define HARD_REGNO_NREGS(REGNO, MODE) \ +! ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) + + /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. + On Alpha, the integer registers can hold any mode. The floating-point +--- 493,502 ---- + but can be less for certain modes in special long registers. */ + + #define HARD_REGNO_NREGS(REGNO, MODE) \ +! ((GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ +! && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD) \ +! ? 2 \ +! : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) + + /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. + On Alpha, the integer registers can hold any mode. The floating-point +*************** +*** 923,934 **** + #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) (CUM) = 0 + + /* Define intermediate macro to compute the size (in registers) of an argument +! for the Alpha. */ + + #define ALPHA_ARG_SIZE(MODE, TYPE, NAMED) \ +! ((MODE) != BLKmode \ +! ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ +! : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) + + /* Update the data in CUM to advance over an argument + of mode MODE and data type TYPE. +--- 926,941 ---- + #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) (CUM) = 0 + + /* Define intermediate macro to compute the size (in registers) of an argument +! for the Alpha. +! A short complex arg takes two registers. */ + + #define ALPHA_ARG_SIZE(MODE, TYPE, NAMED) \ +! ((GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ +! && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD) \ +! ? 2 \ +! : ((MODE) != BLKmode + \ +! ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ +! : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)) + + /* Update the data in CUM to advance over an argument + of mode MODE and data type TYPE. +--- gcc/gcc/emit-rtl.c.alpha Fri Jul 16 11:12:20 1999 ++++ gcc/emit-rtl.c Thu Jul 29 10:01:33 1999 +@@ -743,6 +743,17 @@ gen_lowpart_common (mode, x) + && ! HARD_REGNO_MODE_OK (REGNO (x) + word, mode) + && HARD_REGNO_MODE_OK (REGNO (x), GET_MODE (x))) + return 0; ++ ++ else if (GET_MODE_CLASS (GET_MODE (x)) == MODE_COMPLEX_FLOAT ++ && GET_MODE_SIZE (GET_MODE (x)) <= UNITS_PER_WORD ++ && REGNO (x) < FIRST_PSEUDO_REGISTER) ++ { ++ if (REG_FUNCTION_VALUE_P (x)) ++ return gen_rtx (SUBREG, mode, x, 0); ++ else ++ return gen_rtx (REG, mode, REGNO (x)); ++ } ++ + else if (REGNO (x) < FIRST_PSEUDO_REGISTER + /* integrate.c can't handle parts of a return value register. */ + && (! REG_FUNCTION_VALUE_P (x) +@@ -966,11 +977,6 @@ gen_realpart (mode, x) + { + if (GET_CODE (x) == CONCAT && GET_MODE (XEXP (x, 0)) == mode) + return XEXP (x, 0); +- else if (WORDS_BIG_ENDIAN +- && GET_MODE_BITSIZE (mode) < BITS_PER_WORD +- && REG_P (x) +- && REGNO (x) < FIRST_PSEUDO_REGISTER) +- fatal ("Unable to access real part of complex value in a hard register on this target"); + else if (WORDS_BIG_ENDIAN) + return gen_highpart (mode, x); + else +@@ -989,11 +995,6 @@ gen_imagpart (mode, x) + return XEXP (x, 1); + else if (WORDS_BIG_ENDIAN) + return gen_lowpart (mode, x); +- else if (!WORDS_BIG_ENDIAN +- && GET_MODE_BITSIZE (mode) < BITS_PER_WORD +- && REG_P (x) +- && REGNO (x) < FIRST_PSEUDO_REGISTER) +- fatal ("Unable to access imaginary part of complex value in a hard +register on this target"); + else + return gen_highpart (mode, x); + } +@@ -1128,6 +1129,16 @@ gen_highpart (mode, x) + word = ((GET_MODE_SIZE (GET_MODE (x)) + - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD)) + / UNITS_PER_WORD); ++ ++ if (GET_MODE_CLASS (GET_MODE (x)) == MODE_COMPLEX_FLOAT ++ && GET_MODE_SIZE (GET_MODE (x)) <= UNITS_PER_WORD ++ && REGNO (x) < FIRST_PSEUDO_REGISTER) ++ { ++ if (REG_FUNCTION_VALUE_P (x)) ++ return gen_rtx (SUBREG, mode, x, 1); ++ else ++ return gen_rtx (REG, mode, REGNO (x) + 1); ++ } + + if (REGNO (x) < FIRST_PSEUDO_REGISTER + /* integrate.c can't handle parts of a return value register. */ +-- +Joel Klecker (aka Espy) Debian GNU/Linux Developer + + diff --git a/gcc-arm-config.patch b/gcc-arm-config.patch new file mode 100644 index 0000000..a65d4d4 --- /dev/null +++ b/gcc-arm-config.patch @@ -0,0 +1,372 @@ +# DP: Some fixes for ARM from Philip Blundell + +Tue Jul 27 18:42:12 1999 Bernd Schmidt + + * reload1.c (reload_reg_free_for_value_p): RELOAD_OTHER reloads with + an earlyclobbered output conflict with RELOAD_INPUT reloads. + +Tue Jul 27 18:42:12 1999 Bernd Schmidt + + * reload1.c (reload_reg_free_for_value_p): If two reloads overlap in + their lifetimes, and one of them has an output, they conflict. + +Fri Jul 16 10:29:48 1999 Philip Blundell + + * config/arm/arm.c (legitimize_pic_address): Handle LABEL_REF + correctly. + (arm_poke_function_name): Avoid warning. + * config/arm/arm.h (LEGITIMATE_CONSTANT_P): Allow anything when + generating PIC. + (GO_IF_LEGITIMATE_INDEX): Fix handling of HImode values. + (LEGITIMATE_PIC_OPERAND): Disallow references to labels. + * config/arm/linux-elf.h (MULTILIB_DEFAULTS): Define. + (SUBTARGET_EXTRA_LINK_SPEC): Provide alternative definition for + use with new binutils. + * config/arm/linux-elf26.h (MULTILIB_DEFAULTS): Define. + * config/arm/t-linux (EXTRA_MULTILIB_PARTS): Define. + (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Multilib for hard/soft + float by default. + + * function.c (rtx_equal_for_addressof_p): New function. + (purge_addressof_1): Use it instead of rtx_equal_p. + +--- gcc/function.c 1999/05/20 22:26:35 1.90.4.1 ++++ gcc/function.c 1999/07/16 09:30:04 +@@ -3042,6 +3042,105 @@ + extracted by usage MEM with narrower mode. */ + static rtx purge_addressof_replacements; + ++/* Return 1 if X and Y are identical-looking rtx's. ++ This is the Lisp function EQUAL for rtx arguments. */ ++ ++int ++rtx_equal_for_addressof_p (x, y) ++ rtx x, y; ++{ ++ register int i; ++ register int j; ++ register enum rtx_code code; ++ register char *fmt; ++ ++ if (x == y) ++ return 1; ++ if (x == 0 || y == 0) ++ return 0; ++ ++ code = GET_CODE (x); ++ /* Rtx's of different codes cannot be equal. */ ++ if (code != GET_CODE (y)) ++ return 0; ++ ++ /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent. ++ (REG:SI x) and (REG:HI x) are NOT equivalent. ++ But (MEM:SI x) and (MEM:HI x) are equivalent for our purposes. */ ++ ++ if (code != MEM && (GET_MODE (x) != GET_MODE (y))) ++ return 0; ++ ++ /* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively. */ ++ ++ if (code == REG) ++ return REGNO (x) == REGNO (y); ++ else if (code == LABEL_REF) ++ return XEXP (x, 0) == XEXP (y, 0); ++ else if (code == SYMBOL_REF) ++ return XSTR (x, 0) == XSTR (y, 0); ++ else if (code == SCRATCH || code == CONST_DOUBLE) ++ return 0; ++ ++ /* Compare the elements. If any pair of corresponding elements ++ fail to match, return 0 for the whole things. */ ++ ++ fmt = GET_RTX_FORMAT (code); ++ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) ++ { ++ switch (fmt[i]) ++ { ++ case 'w': ++ if (XWINT (x, i) != XWINT (y, i)) ++ return 0; ++ break; ++ ++ case 'n': ++ case 'i': ++ if (XINT (x, i) != XINT (y, i)) ++ return 0; ++ break; ++ ++ case 'V': ++ case 'E': ++ /* Two vectors must have the same length. */ ++ if (XVECLEN (x, i) != XVECLEN (y, i)) ++ return 0; ++ ++ /* And the corresponding elements must match. */ ++ for (j = 0; j < XVECLEN (x, i); j++) ++ if (rtx_equal_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0) ++ return 0; ++ break; ++ ++ case 'e': ++ if (rtx_equal_p (XEXP (x, i), XEXP (y, i)) == 0) ++ return 0; ++ break; ++ ++ case 'S': ++ case 's': ++ if (strcmp (XSTR (x, i), XSTR (y, i))) ++ return 0; ++ break; ++ ++ case 'u': ++ /* These are just backpointers, so they don't matter. */ ++ break; ++ ++ case '0': ++ break; ++ ++ /* It is believed that rtx's at this level will never ++ contain anything but integers and other rtx's, ++ except for within LABEL_REFs and SYMBOL_REFs. */ ++ default: ++ abort (); ++ } ++ } ++ return 1; ++} ++ + /* Helper function for purge_addressof. See if the rtx expression at *LOC + in INSN needs to be changed. If FORCE, always put any ADDRESSOFs into + the stack. */ +@@ -3122,7 +3221,7 @@ + for (tem = purge_bitfield_addressof_replacements; + tem != NULL_RTX; + tem = XEXP (XEXP (tem, 1), 1)) +- if (rtx_equal_p (x, XEXP (tem, 0))) ++ if (rtx_equal_for_addressof_p (x, XEXP (tem, 0))) + { + *loc = XEXP (XEXP (tem, 1), 0); + return; +@@ -3132,7 +3231,7 @@ + for (tem = purge_addressof_replacements; + tem != NULL_RTX; + tem = XEXP (XEXP (tem, 1), 1)) +- if (rtx_equal_p (XEXP (x, 0), XEXP (tem, 0))) ++ if (rtx_equal_for_addressof_p (XEXP (x, 0), XEXP (tem, 0))) + { + rtx z = XEXP (XEXP (tem, 1), 0); + +--- gcc/config/arm/arm.c 1999/06/19 06:34:36 1.43.4.5 ++++ gcc/config/arm/arm.c 1999/07/16 09:27:53 +@@ -1528,7 +1528,20 @@ legitimize_pic_address (orig, mode, reg) + return gen_rtx_PLUS (Pmode, base, offset); + } + else if (GET_CODE (orig) == LABEL_REF) +- current_function_uses_pic_offset_table = 1; ++ { ++ current_function_uses_pic_offset_table = 1; ++ ++ if (NEED_PLT_GOT) ++ { ++ rtx pic_ref, address = gen_reg_rtx (Pmode); ++ ++ emit_insn (gen_pic_load_addr (address, orig)); ++ pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, ++ address); ++ emit_move_insn (address, pic_ref); ++ return address; ++ } ++ } + + return orig; + } +@@ -5445,7 +5458,7 @@ arm_poke_function_name (stream, name) + rtx x; + + length = strlen (name); +- alignlength = (length + 1) + 3 & ~3; ++ alignlength = ((length + 1) + 3) & ~3; + + ASM_OUTPUT_ASCII (stream, name, length + 1); + ASM_OUTPUT_ALIGN (stream, 2); +--- gcc/config/arm/arm.h 1999/06/19 05:37:07 1.34.4.3 ++++ gcc/config/arm/arm.h 1999/07/16 09:28:04 +@@ -1378,9 +1378,11 @@ do { \ + + On the ARM, allow any integer (invalid ones are removed later by insn + patterns), nice doubles and symbol_refs which refer to the function's +- constant pool XXX. */ +-#define LEGITIMATE_CONSTANT_P(X) (! label_mentioned_p (X)) ++ constant pool XXX. + ++ When generating PIC code, allow anything. */ ++#define LEGITIMATE_CONSTANT_P(X) (flag_pic || ! label_mentioned_p (X)) ++ + /* Symbols in the text segment can be accessed without indirecting via the + constant pool; it may take an extra binary operation, but this is still + faster than indirecting via memory. Don't do this when not optimizing, +@@ -1495,9 +1497,8 @@ do \ + && INTVAL (op) <= 31) \ + goto LABEL; \ + } \ +- /* NASTY: Since this limits the addressing of unsigned byte loads */ \ + range = ((MODE) == HImode || (MODE) == QImode) \ +- ? (arm_arch4 ? 256 : 4095) : 4096; \ ++ ? (((MODE) == HImode && arm_arch4) ? 256 : 4095) : 4096; \ + if (code == CONST_INT && INTVAL (INDEX) < range \ + && INTVAL (INDEX) > -range) \ + goto LABEL; \ +@@ -1813,12 +1814,13 @@ extern int arm_pic_register; + + #define FINALIZE_PIC arm_finalize_pic () + +-/* We can't directly access anything that contains a symbol, ++/* We can't directly access anything that contains a symbol or label, + nor can we indirect via the constant pool. */ + #define LEGITIMATE_PIC_OPERAND_P(X) \ +- (! symbol_mentioned_p (X) \ ++ (! symbol_mentioned_p (X) && ! label_mentioned_p (X) \ + && (! CONSTANT_POOL_ADDRESS_P (X) \ +- || ! symbol_mentioned_p (get_pool_constant (X)))) ++ || (! symbol_mentioned_p (get_pool_constant (X))) \ ++ && (! label_mentioned_p (get_pool_constant (X))))) + + /* We need to know when we are making a constant pool; this determines + whether data needs to be in the GOT or can be referenced via a GOT +--- gcc/config/arm/arm.md 1999/06/02 06:43:14 1.27.4.2 ++++ gcc/config/arm/arm.md 1999/07/16 09:28:31 +@@ -2627,7 +2627,8 @@ + : preserve_subexpressions_p ())); + DONE; + } +- if (CONSTANT_P (operands[1]) && flag_pic) ++ if ((CONSTANT_P (operands[1]) || symbol_mentioned_p (operands[1]) ++ || label_mentioned_p (operands[1])) && flag_pic) + operands[1] = legitimize_pic_address (operands[1], SImode, + ((reload_in_progress + || reload_completed) +--- gcc/config/arm/linux-elf.h 1999/03/31 10:25:34 1.7 ++++ gcc/config/arm/linux-elf.h 1999/07/16 09:28:33 +@@ -28,10 +28,16 @@ Boston, MA 02111-1307, USA. */ + /* Default is to use APCS-32 mode. */ + #ifndef SUBTARGET_DEFAULT_APCS26 + #define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_SHORT_BYTE) ++#if 1 + #define SUBTARGET_EXTRA_LINK_SPEC \ ++ " %{mapcs-26:-m armelf_linux26} %{!mapcs-26:-m armelf_linux} -p" ++#else ++#define SUBTARGET_EXTRA_LINK_SPEC \ + " %{mapcs-26:-m elf32arm26} %{!mapcs-26:-m elf32arm}" ++#endif + #define SUBTARGET_EXTRA_ASM_SPEC \ + " %{mapcs-26:-mapcs-26} %(!mapcs-26:-mapcs-32}" ++#define MULTILIB_DEFAULTS { "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" } + #endif + + /* This was defined in linux.h. Define it here also. */ +--- gcc/config/arm/linux-elf26.h 1998/12/16 21:01:40 1.2 ++++ gcc/config/arm/linux-elf26.h 1999/07/16 09:28:33 +@@ -29,4 +29,6 @@ Boston, MA 02111-1307, USA. */ + + #define TARGET_DEFAULT (ARM_FLAG_SHORT_BYTE) + ++#define MULTILIB_DEFAULTS { "mlittle-endian", "mhard-float", "mapcs-26", "mno-thumb-interwork" } ++ + #include "arm/linux-elf.h" +--- gcc/config/arm/t-linux 1999/03/26 15:30:20 1.5 ++++ gcc/config/arm/t-linux 1999/07/16 09:28:33 +@@ -13,10 +13,15 @@ LIBGCC1 = libgcc1-asm.a + LIB1ASMSRC = arm/lib1funcs.asm + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx + ++MULTILIB_OPTIONS = mhard-float/msoft-float ++MULTILIB_DIRNAMES = hard-float soft-float ++ + # If you want to build both APCS variants as multilib options this is how + # to do it. +-#MULTILIB_OPTIONS = mapcs-32/apcs-26 +-#MULTILIB_DIRNAMES = apcs-32 apcs-26 ++#MULTILIB_OPTIONS += mapcs-32/mapcs-26 ++#MULTILIB_DIRNAMES += apcs-32 apcs-26 ++ ++EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o + + LIBGCC = stmp-multilib + INSTALL_LIBGCC = install-multilib +--- gcc/jump.c 1999/05/31 13:30:06 1.59.4.2 ++++ gcc/jump.c 1999/07/30 10:14:30 +@@ -115,7 +115,7 @@ + static rtx delete_unreferenced_labels PROTO((rtx)); + static void delete_noop_moves PROTO((rtx)); + static int calculate_can_reach_end PROTO((rtx, int, int)); +-static int duplicate_loop_exit_test PROTO((rtx)); ++static int duplicate_loop_exit_test PROTO((rtx, int)); + static void find_cross_jump PROTO((rtx, rtx, int, rtx *, rtx *)); + static void do_cross_jump PROTO((rtx, rtx, rtx)); + static int jump_back_p PROTO((rtx, rtx)); +@@ -338,7 +338,7 @@ + && simplejump_p (temp1)) + { + temp = PREV_INSN (insn); +- if (duplicate_loop_exit_test (insn)) ++ if (duplicate_loop_exit_test (insn, after_regscan)) + { + changed = 1; + next = NEXT_INSN (temp); +@@ -2544,8 +2544,9 @@ + values of regno_first_uid and regno_last_uid. */ + + static int +-duplicate_loop_exit_test (loop_start) ++duplicate_loop_exit_test (loop_start, after_regscan) + rtx loop_start; ++ int after_regscan; + { + rtx insn, set, reg, p, link; + rtx copy = 0; +@@ -2658,6 +2659,9 @@ + reg_map[REGNO (reg)] = gen_reg_rtx (GET_MODE (reg)); + } + } ++ ++ if (after_regscan) ++ reg_scan_update (exitcode, lastexit, max_reg); + + /* Now copy each insn. */ + for (insn = exitcode; insn != lastexit; insn = NEXT_INSN (insn)) +--- gcc/reload1.c 1999/07/07 01:05:39 1.145.4.1 ++++ gcc/reload1.c 1999/07/30 10:15:23 +@@ -5281,7 +5281,7 @@ + if (! reload_in[i] || ! rtx_equal_p (reload_in[i], value) + || reload_out[i] || out) + { +- int time2; ++ int j, time2; + switch (reload_when_needed[i]) + { + case RELOAD_FOR_OTHER_ADDRESS: +@@ -5360,6 +5360,11 @@ + if (! reload_in[i] || rtx_equal_p (reload_in[i], value)) + { + time2 = MAX_RECOG_OPERANDS * 4 + 4; ++ /* Earlyclobbered outputs must conflict with inputs. */ ++ for (j = 0; j < n_earlyclobbers; j++) ++ if (reload_out[i] == reload_earlyclobbers[j]) ++ time2 = MAX_RECOG_OPERANDS * 4 + 3; ++ + break; + } + time2 = 1; +@@ -5375,7 +5380,8 @@ + } + if ((time1 >= time2 + && (! reload_in[i] || reload_out[i] +- || ! rtx_equal_p (reload_in[i], value))) ++ || ! rtx_equal_p (reload_in[i], value) ++ || out)) + || (out && reload_out_reg[reloadnum] + && time2 >= MAX_RECOG_OPERANDS * 4 + 3)) + return 0; + + + diff --git a/gcc-bootstrap.patch b/gcc-bootstrap.patch new file mode 100644 index 0000000..94c8c20 --- /dev/null +++ b/gcc-bootstrap.patch @@ -0,0 +1,153 @@ +# DP: Make bootstrap: restartable at any point +# DP: From: Donn Terry + +Make bootstrap: restartable at any point. + +This is in response to a discussion on this topic. This is "take 2" | +which should work with parallel builds, though I haven't tested that. | + +When doing a make bootstrap, it's hard to know (at least when +not throughly versed in the process details) how to restart +after making a fix. In general, retyping "make bootstrap" +will do the wrong thing (particularly if the host and target +compilers object files are incompatible!) + +This change keeps track of the stages completed. The old +bootstrap2[234] (and *-lean) targets are rewritten, but work the +same. + +I've tested this by doing a make bootstrap (on CVS sources as of | +last night) and by typing 'make bootstrap' after it's done, | +in which case it thinks a moment and does nothing. (Which is exactly +the right answer.) + +I've also done a complete regression, with no surprises. | + +I tested whether stopping/restarting at a few arbitrary points along the +way works with older sources, but haven't tested it real recently, +except to do a ^C halfway through a testbuild at one point. | +Again, if it works at all, it should work as well as it ever did. +I specficially did test it during the period where make bootstrap +wasn't succeeding for me, and it helped a LOT in being able to pick up +where I left off. + +An interesting side-effect: make bootstrap-lean after a make bootstrap | +JUST cleans out stage1, with no unwanted consequences. | + + +Fri May 28 15:27:02 1999 Donn Terry (donn@interix.com) + * Makefile.in: restructure bootstrap stages to allow + clean restart after failure. + +diff -urP egcs.source.old/gcc/Makefile.in egcs.source/gcc/Makefile.in +--- egcs.source.old/gcc/Makefile.in Sun May 23 13:39:21 1999 ++++ egcs.source/gcc/Makefile.in Thu May 27 16:59:42 1999 +@@ -2360,6 +2360,8 @@ clean: mostlyclean intl.clean lang.clean + rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \ + fi ; fi + -rm -fr stage1 stage2 stage3 stage4 ++ -rm -f boot_stage_a boot_stage_b boot_stage_c boot_stage_d ++ -rm -f boot_stage_e boot_stage_f + + # Delete all files that users would normally create + # while building and installing GCC. +@@ -2924,33 +2926,83 @@ diff: + $(LANG_DIFF_EXCLUDES) \ + gcc-$(oldversion) gcc-$(version) > gcc-$(oldversion)-$(version).diff + +-bootstrap bootstrap-lean: force ++ + # Only build the C compiler for stage1, because that is the only one that + # we can guarantee will build with the native compiler, and also it is the + # only thing useful for building stage2. +- $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" +- $(MAKE) stage1 ++boot_stage_a: ++ +$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" ++ touch boot_stage_a ++ echo ---------------------- stage a complete --------------------- ++ ++boot_stage_b: ++ +$(MAKE) stage1 ++ touch boot_stage_b ++ echo ---------------------- stage b complete --------------------- ++ + # This used to define ALLOCA as empty, but that would lead to bad results + # for a subsequent `make install' since that would not have ALLOCA empty. + # To prevent `make install' from compiling alloca.o and then relinking cc1 + # because alloca.o is newer, we permit these recursive makes to compile + # alloca.o. Then cc1 is newer, so it won't have to be relinked. +- $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" +- $(MAKE) stage2 +- -if test $@ = bootstrap-lean; then rm -rf stage1; else true; fi +- $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" ++boot_stage_c: ++ +$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" ++ touch boot_stage_c ++ echo ---------------------- stage c complete --------------------- + +-bootstrap2 bootstrap2-lean: force +- $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" +- $(MAKE) stage2 +- -if test $@ = bootstrap2-lean; then rm -rf stage1; else true; fi +- $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" ++boot_stage_d: ++ +$(MAKE) stage2 ++ touch boot_stage_d ++ echo ---------------------- stage d complete --------------------- + +-bootstrap3 bootstrap3-lean: force +- $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" ++boot_stage_e: ++ +$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" ++ touch boot_stage_e ++ echo ---------------------- stage e complete --------------------- ++ ++# Only bootstrap4 uses stage f. ++boot_stage_f: ++ +$(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)" ++ touch boot_stage_f ++ echo ---------------------- stage f complete --------------------- ++ ++boot_clean_stage1: ++ rm -rf stage1 ++ ++# This next little bit is the way it is for parallel builds. It's simply ++# a chain of stages which DO have to be done sequentially. ++ ++bootstrap_a: boot_stage_a ++bootstrap_b: bootstrap_a boot_stage_b ++bootstrap_c: bootstrap_b boot_stage_c ++bootstrap_d: bootstrap_c boot_stage_d ++bootstrap_e: bootstrap_d boot_stage_e ++bootstrap: force bootstrap_e ++ ++bootstrap-lean_a: boot_stage_a ++bootstrap-lean_b: bootstrap-lean_a boot_stage_b ++bootstrap-lean_c: bootstrap-lean_b boot_stage_c ++bootstrap-lean_d: bootstrap-lean_c boot_stage_d ++bootstrap-lean_e: bootstrap-lean_d boot_clean_stage1 ++bootstrap-lean_f: bootstrap-lean_e boot_stage_e ++bootstrap-lean: force bootstrap-lean_f ++ ++bootstrap2_c: boot_stage_c ++bootstrap2_d: bootstrap2_c boot_stage_d ++bootstrap2_e: bootstrap2_d boot_stage_e ++bootstrap2: force bootstrap2_e ++ ++bootstrap2-lean_c: boot_stage_c ++bootstrap2-lean_d: bootstrap2-lean_c boot_stage_d ++bootstrap2-lean_e: bootstrap2-lean_d boot_clean_stage1 ++bootstrap2-lean_f: bootstrap2-lean_e boot_stage_e ++bootstrap2-lean: force bootstrap2-lean_f ++ ++bootstrap3 bootstrap3-lean: force boot_stage_e ++ ++# Only bootstrap4 uses stage f. ++bootstrap4 bootstrap4-lean: force boot_stage_f + +-bootstrap4 bootstrap4-lean: force +- $(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)" + + # Compare the object files in the current directory with those in the + # stage2 directory. diff --git a/gcc-builtin-apply.patch b/gcc-builtin-apply.patch new file mode 100644 index 0000000..b452e50 --- /dev/null +++ b/gcc-builtin-apply.patch @@ -0,0 +1,62 @@ +# DP: On Sparc, message forwarding in the GNUstep framework +# DP: (gstep-base) relies on this patch. I didn't experience any side +# DP: effects of this "workaround" on a sparc Solaris platform. However +# DP: this workaround affects the all compilers of the egcs package. + +From: Richard Henderson +To: Matthias.Klose@cs.tu-berlin.de, scottc@net-community.com +Subject: Re: patch for expand_builtin_apply for sparc architecture +Date: Mon, 16 Feb 1998 05:11:32 -0800 + +In article <199802160833.JAA11275.cygnus.egcs.bugs@gargleblaster.cs.tu-berlin.de>, +Matthias Klose wrote: +>The following patch fixes the generation of an 'unimp 4095' +>instruction for the expansion of __builtin_apply on the sparc +>architecture; fix by Scott Christley (), but +>doesn't seem to be submitted to the the egcs list. + +You'll have to submit a test case and an explanation of why you think +this is correct. The Sparc32 ABI calls for an unimp instruction to +be emitted following calls to functions that return structures. The +0-4095 immediate is commentary, but that's all the room in that field +so we cannot simply remove the mask. + +My guess is that it is yet another example of why __builtin_apply +is inadequate for the needs of all but completely stack-based calling +conventions and should not be used. + + +r~ + +diff -c gcc/config/sparc/sparc.md~ gcc/config/sparc/sparc.md +*** gcc/config/sparc/sparc.md~ Mon Nov 16 12:31:32 1998 +--- gcc/config/sparc/sparc.md Mon Nov 16 12:35:56 1998 +*************** +*** 7294,7299 **** +--- 7294,7300 ---- + Why cannot we have delay slots filled if it were a CALL? */ + + if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0) ++ #if 0 + emit_jump_insn + (gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (3, +*************** +*** 7302,7307 **** +--- 7303,7318 ---- + GEN_INT (INTVAL (operands[3]) & 0xfff), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_REG (Pmode, 15))))); ++ #else ++ emit_jump_insn ++ (gen_rtx_PARALLEL (VOIDmode, ++ gen_rtvec (3, ++ gen_rtx_SET (VOIDmode, pc_rtx, ++ XEXP (operands[0], 0)), ++ operands[3], ++ gen_rtx_CLOBBER (VOIDmode, ++ gen_rtx_REG (Pmode, 15))))); ++ #endif + else + emit_jump_insn + (gen_rtx_PARALLEL (VOIDmode, diff --git a/gcc-cpp-dos-newlines.patch b/gcc-cpp-dos-newlines.patch new file mode 100644 index 0000000..d05d6b8 --- /dev/null +++ b/gcc-cpp-dos-newlines.patch @@ -0,0 +1,76 @@ +# DP: Handle DOS newlines after backslashes. +# DP: Patch from http://www.cygnus.com/ml/egcs/1999-Jan/0784.html + +--- gcc/cccp.c.orig Thu Jun 24 15:11:40 1999 ++++ gcc/cccp.c Mon Aug 9 12:21:55 1999 +@@ -1023,7 +1023,8 @@ + retrying if necessary. If MAX_READ_LEN is defined, read at most + that bytes at a time. Return a negative value if an error occurs, + otherwise return the actual number of bytes read, +- which must be LEN unless end-of-file was reached. */ ++ which may be < LEN if CRs have been skipped, though we try not to do ++ that. */ + + static int + safe_read (desc, ptr, len) +@@ -1032,6 +1033,7 @@ + int len; + { + int left, rcount, nchars; ++ char *rptr; + + left = len; + while (left > 0) { +@@ -1051,8 +1053,20 @@ + } + if (nchars == 0) + break; +- ptr += nchars; ++ ++ /* CRLF pairs, found with Unix when processing DOS files, ++ throw off backslash-newline removal. ++ Therefore, CRs are thrown away here. */ + left -= nchars; ++ rptr = ptr; ++ while(nchars--) ++ { ++ if(*rptr == '\r' && *(rptr+1) == '\n') ++ left++; ++ else ++ *ptr++ = *rptr; ++ rptr++; ++ } + } + return len - left; + } +@@ -2085,8 +2099,8 @@ + for (;;) { + cnt = safe_read (f, (char *) fp->buf + size, bsize - size); + if (cnt < 0) goto perror; /* error! */ ++ if (cnt == 0) break; /* End of file */ + size += cnt; +- if (size != bsize) break; /* End of file */ + bsize *= 2; + fp->buf = (U_CHAR *) xrealloc (fp->buf, bsize + 2); + } +@@ -5024,6 +5038,8 @@ + map_list_ptr->map_list_map = ptr; + + while ((ch = getc (f)) != '\n') ++ if (ch == '\r') ++ continue; + if (ch == EOF) + break; + } +@@ -5256,9 +5272,9 @@ + i = safe_read (f, (char *) fp->buf + st_size, bsize - st_size); + if (i < 0) + goto nope; /* error! */ +- st_size += i; +- if (st_size != bsize) ++ if (i == 0) + break; /* End of file */ ++ st_size += i; + bsize *= 2; + fp->buf = (U_CHAR *) xrealloc (fp->buf, bsize + 2); + } diff --git a/gcc-cpp-macro-doc.patch b/gcc-cpp-macro-doc.patch new file mode 100644 index 0000000..54b336f --- /dev/null +++ b/gcc-cpp-macro-doc.patch @@ -0,0 +1,96 @@ +# DP: cpp.texi: add a node documenting macro varargs. + +Sat Aug 7 14:56:50 1999 Matthias Klose + + * cpp.texi: cpp.texi: add a node documenting macro varargs (copied + from extend.texi. + +--- gcc/cpp.texi~ Wed May 19 13:22:57 1999 ++++ gcc/cpp.texi Sat Aug 7 14:53:42 1999 +@@ -542,6 +542,7 @@ + * Simple Macros:: Macros that always expand the same way. + * Argument Macros:: Macros that accept arguments that are substituted + into the macro expansion. ++* Macro Varargs:: Macros with variable number of arguments. + * Predefined:: Predefined macros that are always available. + * Stringification:: Macro arguments converted into string constants. + * Concatenation:: Building tokens from parts taken from macro arguments. +@@ -645,7 +646,7 @@ + that the result of its expansion is checked for more macro names. + @xref{Cascaded Macros}. + +-@node Argument Macros, Predefined, Simple Macros, Macros ++@node Argument Macros, Macro Varargs, Simple Macros, Macros + @subsection Macros with Arguments + @cindex macros with argument + @cindex arguments in macro definitions +@@ -799,7 +800,68 @@ + the left parenthesis; it's the @emph{definition} where it matters whether + there is a space. + +-@node Predefined, Stringification, Argument Macros, Macros ++@node Macro Varargs, Predefined, Argument Macros, Macros ++@subsection Macros with Variable Numbers of Arguments ++@cindex variable number of arguments ++@cindex macro with variable arguments ++@cindex rest argument (in macro) ++ ++In GNU C, a macro can accept a variable number of arguments, much as a ++function can. The syntax for defining the macro looks much like that ++used for a function. Here is an example: ++ ++@example ++#define eprintf(format, args...) \ ++ fprintf (stderr, format , ## args) ++@end example ++ ++Here @code{args} is a @dfn{rest argument}: it takes in zero or more ++arguments, as many as the call contains. All of them plus the commas ++between them form the value of @code{args}, which is substituted into ++the macro body where @code{args} is used. Thus, we have this expansion: ++ ++@example ++eprintf ("%s:%d: ", input_file_name, line_number) ++@expansion{} ++fprintf (stderr, "%s:%d: " , input_file_name, line_number) ++@end example ++ ++@noindent ++Note that the comma after the string constant comes from the definition ++of @code{eprintf}, whereas the last comma comes from the value of ++@code{args}. ++ ++The reason for using @samp{##} is to handle the case when @code{args} ++matches no arguments at all. In this case, @code{args} has an empty ++value. In this case, the second comma in the definition becomes an ++embarrassment: if it got through to the expansion of the macro, we would ++get something like this: ++ ++@example ++fprintf (stderr, "success!\n" , ) ++@end example ++ ++@noindent ++which is invalid C syntax. @samp{##} gets rid of the comma, so we get ++the following instead: ++ ++@example ++fprintf (stderr, "success!\n") ++@end example ++ ++This is a special feature of the GNU C preprocessor: @samp{##} before a ++rest argument that is empty discards the preceding sequence of ++non-whitespace characters from the macro definition. (If another macro ++argument precedes, none of it is discarded.) ++ ++It might be better to discard the last preprocessor token instead of the ++last preceding sequence of non-whitespace characters; in fact, we may ++someday change this feature to do so. We advise you to write the macro ++definition so that the preceding sequence of non-whitespace characters ++is just a single token, so that the meaning will not change if we change ++the definition of this feature. ++ ++@node Predefined, Stringification, Macro Varargs, Macros + @subsection Predefined Macros + + @cindex predefined macros diff --git a/gcc-default-arch.patch b/gcc-default-arch.patch new file mode 100644 index 0000000..0f23b8a --- /dev/null +++ b/gcc-default-arch.patch @@ -0,0 +1,30 @@ +# DP: set the default architecture to i386; even if gcc is configured +# DP: with i386-linux, it builds with Pentium instructions, tuned for i386. + +From: Joel Klecker +To: Matthias Klose +Subject: Re: gcc: forwarded message from Markus F.X.J. Oberhumer +Date: Wed, 11 Aug 1999 08:48:54 -0700 + +Found it, and fixed it. + +--- gcc/config/i386/i386.c~ Sat Aug 14 19:35:24 1999 ++++ gcc/config/i386/i386.c Sat Aug 14 19:37:00 1999 +@@ -291,7 +291,7 @@ + + if (ix86_arch_string == 0) + { +- ix86_arch_string = PROCESSOR_PENTIUM_STRING; ++ ix86_arch_string = PROCESSOR_DEFAULT_STRING; + if (ix86_cpu_string == 0) + ix86_cpu_string = PROCESSOR_DEFAULT_STRING; + } +@@ -308,7 +308,7 @@ + if (i == ptt_size) + { + error ("bad value (%s) for -march= switch", ix86_arch_string); +- ix86_arch_string = PROCESSOR_PENTIUM_STRING; ++ ix86_arch_string = PROCESSOR_DEFAULT_STRING; + ix86_arch = PROCESSOR_DEFAULT; + } + diff --git a/gcc-g++-is-tree.patch b/gcc-g++-is-tree.patch new file mode 100644 index 0000000..2c88d17 --- /dev/null +++ b/gcc-g++-is-tree.patch @@ -0,0 +1,82 @@ +# DP: Work around memory corruption (just for 2.95.1) +# DP: by Daniel Jacobowitz + +diff -rcp ../egcs/for-unstable/gcc-2.95/gcc/cp/cp-tree.h gcc-2.95/gcc/cp/cp-tree.h +*** ../egcs/for-unstable/gcc-2.95/gcc/cp/cp-tree.h Thu Jun 24 09:16:17 1999 +--- gcc-2.95/gcc/cp/cp-tree.h Fri Aug 6 17:41:45 1999 +*************** Boston, MA 02111-1307, USA. */ +*** 52,58 **** + 4: BINFO_NEW_VTABLE_MARKED. + TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR, + or FIELD_DECL). +! 5: Not used. + 6: Not used. + + Usage of TYPE_LANG_FLAG_?: +--- 52,58 ---- + 4: BINFO_NEW_VTABLE_MARKED. + TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR, + or FIELD_DECL). +! 5: CALL_EXPR_RTL_IS_TREE. + 6: Not used. + + Usage of TYPE_LANG_FLAG_?: +*************** extern int flag_new_for_scope; +*** 1614,1619 **** +--- 1614,1622 ---- + + /* Nonzero for _TYPE means that the _TYPE defines a destructor. */ + #define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE)) ++ ++ /* Nonzero for CALL_EXPR means that operands[2] is a cv_qualifier tree */ ++ #define CALL_EXPR_RTL_IS_TREE(NODE) (TREE_LANG_FLAG_5(NODE)) + + #if 0 + /* Nonzero for _TYPE node means that creating an object of this type +diff -rcp ../egcs/for-unstable/gcc-2.95/gcc/cp/lex.c gcc-2.95/gcc/cp/lex.c +*** ../egcs/for-unstable/gcc-2.95/gcc/cp/lex.c Thu Jun 24 09:16:26 1999 +--- gcc-2.95/gcc/cp/lex.c Fri Aug 6 16:14:25 1999 +*************** make_call_declarator (target, parms, cv_ +*** 226,231 **** +--- 226,233 ---- + tree target, parms, cv_qualifiers, exception_specification; + { + target = build_parse_node (CALL_EXPR, target, parms, cv_qualifiers); ++ if (cv_qualifiers != NULL_TREE) ++ CALL_EXPR_RTL_IS_TREE (target) = 1; + TREE_TYPE (target) = exception_specification; + return target; + } +*************** set_quals_and_spec (call_declarator, cv_ +*** 235,240 **** +--- 237,246 ---- + tree call_declarator, cv_qualifiers, exception_specification; + { + TREE_OPERAND (call_declarator, 2) = cv_qualifiers; ++ if (cv_qualifiers != NULL_TREE) ++ CALL_EXPR_RTL_IS_TREE (call_declarator) = 1; ++ else ++ CALL_EXPR_RTL_IS_TREE (call_declarator) = 0; + TREE_TYPE (call_declarator) = exception_specification; + } + +diff -rcp ../egcs/for-unstable/gcc-2.95/gcc/cp/tree.c gcc-2.95/gcc/cp/tree.c +*** ../egcs/for-unstable/gcc-2.95/gcc/cp/tree.c Thu Jun 24 09:16:27 1999 +--- gcc-2.95/gcc/cp/tree.c Fri Aug 6 16:08:20 1999 +*************** mapcar (t, func) +*** 1887,1892 **** +--- 1887,1893 ---- + /* tree.def says that operand two is RTL, but + make_call_declarator puts trees in there. */ + if (TREE_OPERAND (t, 2) ++ && CALL_EXPR_RTL_IS_TREE (t) + && TREE_CODE (TREE_OPERAND (t, 2)) == TREE_LIST) + TREE_OPERAND (t, 2) = mapcar (TREE_OPERAND (t, 2), func); + else + +--bp/iNruPH9dso1Pn-- + + +-- +To UNSUBSCRIBE, email to debian-toolchain-request@lists.debian.org +with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org diff --git a/gcc-gcj-backport.patch b/gcc-gcj-backport.patch new file mode 100644 index 0000000..71a6242 --- /dev/null +++ b/gcc-gcj-backport.patch @@ -0,0 +1,6526 @@ +# DP: J*va patch set for gcc-2.95.2 +# DP: taken from http://waitaki.otago.ac.nz/~bryce/gcj/ +# DP: +# DP: This patch consists of new J*va features and fixes extracted +# DP: from cvs and back-ported to gcc-2.95.2. It allows compilation of the +# DP: latest libgcj snapshots and cvs tree without the problems of the +# DP: current unstable cvs gcc tree (last update 1999-10-31). + +Only in gcc-2.95.2/: build +diff -u -r gcc-2.95.2-orig/gcc/java/ChangeLog gcc-2.95.2/gcc/java/ChangeLog +--- gcc-2.95.2-orig/gcc/java/ChangeLog Mon Oct 25 19:59:13 1999 ++++ gcc-2.95.2/gcc/java/ChangeLog Sun Oct 31 19:09:00 1999 +@@ -1,3 +1,286 @@ ++Fri Oct 29 14:35:18 1999 Alexandre Petit-Bianco ++ ++ * class.c (add_method_1): Set DECL_INLINE to 1 for private, static ++ and final method. ++ ++Fri Oct 29 14:23:32 1999 Alexandre Petit-Bianco ++ ++ * parse.y (expression_statement:): Call function to report ++ improper invocation of a constructor. ++ (parse_ctor_invocation_error): New function. ++ ++1999-10-04 Tom Tromey ++ ++ * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as ++ well. Fixes Java PR gcj/59. ++ * parse-scan.y (yyerror): Report errors. ++ ++Thu Oct 21 01:27:31 1999 Alexandre Petit-Bianco ++ ++ * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR. ++ (qualify_ambiguous_name): Likewise. ++ ++1999-10-21 Tom Tromey ++ ++ * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set ++ in generated `main'. ++ ++Tue Oct 12 22:28:10 1999 Alexandre Petit-Bianco ++ ++ * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1. ++ ++1999-10-07 Anthony Green ++ ++ * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases ++ where CHECK_PUT may fail for valid reasons. ++ ++ * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3, ++ UNSAFE_PUTN): New macros. ++ ++Tue Sep 14 16:24:19 1999 Alexandre Petit-Bianco ++ ++ * jcf-write.c: (RELOCATION_VALUE_0): New macro. ++ (RELOCATION_VALUE_1): Likewise. ++ (emit_iinc, emit_reloc, push_constant1, push_constant2, ++ push_in_const, push_long_const): Prototyped. ++ (push_constant1): Argument `index' is of type HOST_WIDE_INT. ++ (push_constant2): Likewise. ++ (push_int_const): Cast find_constant1's integer arguments to `jword'. ++ (find_constant_wide): Cast find_constant2's integer arguments to ++ `jword'. ++ (find_constant_index): Cast find_constant2's and find_constant2's ++ integer arguments to `jword'. ++ (emit_pop): Argument `value' is of type HOST_WIDE_INT. ++ (emit_switch_reloc): Use RELOCATION_VALUE_0. ++ (emit_if): Use RELOCATION_VALUE_1. ++ (emit_goto): Likewise. ++ (emit_jsr): Likewise. ++ (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second ++ argument to push_long_const to HOST_WIDE_INT. ++ ++Thu Sep 16 15:42:39 1999 Alexandre Petit-Bianco ++ ++ * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK ++ instead of fndecl. ++ ++Sat Sep 11 16:46:44 1999 Alexandre Petit-Bianco ++ ++ * parse.y (find_applicable_accessible_methods_list): Search ++ abstract classes as interfaces. ++ ++Thu Sep 9 17:33:28 1999 Alexandre Petit-Bianco ++ ++ * class.c (finish_class): We're now outside a valid method ++ declaration. Tell the rest of gcc so. ++ ++1999-09-07 Tom Tromey ++ ++ * gjavah.c (add_class_decl): Generate include for gcj/array.h, not ++ java-array.h. ++ (decode_signature_piece): Don't emit "::" in JArray<>. ++ (print_namelet): Only print trailing `;' when printing a class. ++ ++1999-09-03 Tom Tromey ++ ++ * parse.y (strip_out_static_field_access_decl): Return operand if ++ it satisfies JDECL_P. ++ ++1999-09-02 Tom Tromey ++ ++ * gjavah.c (decode_signature_piece): Emit "::" in JArray<>. ++ Handle nested arrays, like `[[I'. ++ ++1999-08-26 Tom Tromey ++ ++ * gjavah.c (print_cxx_classname): Print "::" before qualified ++ name. ++ ++1999-10-19 Tom Tromey ++ ++ * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file. ++ From Mike Moreton . ++ ++1999-09-23 Tom Tromey ++ ++ * jvspec.c (lang_specific_driver): Don't read spec file if ++ -fsyntax-only given. ++ ++1999-09-22 Tom Tromey ++ ++ * lang-specs.h: Added `%(jc1)' to the jc1 spec. ++ ++1999-08-25 Tom Tromey ++ ++ * jvspec.c (lang_specific_driver): Correctly handle --help again. ++ ++1999-10-14 Tom Tromey ++ ++ * jvgenmain.c (usage): New function. ++ (main): Use it. Also, handle `-D' options. ++ * jvspec.c (lang_specific_driver): Recognize -D. ++ (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation. ++ ++Thu Aug 26 09:10:58 1999 Alexandre Petit-Bianco ++ ++ * parse.y (lookup_cl): Changed leading comment. Now does its best ++ to set the column number. ++ (qualify_ambiguous_name): Take WFL wrappers into account. ++ ++Wed Aug 25 15:37:15 1999 Gregg Townsend ++ ++ * verify.c (verify_jvm_instructions): Don't check instruction ++ validity beyond end of method. ++ ++Sun Aug 22 11:07:41 1999 Alexandre Petit-Bianco ++ ++ * parse.y (check_method_redefinition): Changed leading comment. ++ (check_abstract_method_definitions): New function. ++ (java_check_abstract_method_definitions): New function. ++ (java_check_regular_methods): Call it. ++ (verify_constructor_super): Fixed indentation. ++ (lookup_method_invoke): Likewise. ++ ++Thu Aug 19 10:26:18 1999 Alexandre Petit-Bianco ++ ++ * parse.y (method_header): Return a null pointer if the current ++ class node is null. ++ (finish_method_declaration): Return if the current function decl ++ is null. ++ (source_start_java_method): Likewise. ++ (java_method_add_stmt): Likewise. ++ ++Wed Aug 18 13:17:15 1999 Alexandre Petit-Bianco ++ ++ * class.c (emit_register_class): Removed unnecessary call to ++ start_sequence. ++ * parse.y (labeled_block_contains_loop_p): Removed unused local ++ variable. ++ ++Tue Aug 17 22:51:44 1999 Alexandre Petit-Bianco ++ ++ * parse.y (java_refold): Added prototype. ++ ++Tue Aug 17 21:48:41 1999 Alexandre Petit-Bianco ++ ++ * parse.y (BINOP_COMPOUND_CANDIDATES): New macro. ++ (java_stabilize_reference): Removed unnecessary `else'. ++ (java_complete_lhs): Set flag to remember boolean. Call ++ java_refold. Added comments. ++ (java_decl_equiv): New function. ++ (binop_compound_p): Likewise. ++ (java_refold): Likewise. ++ (patch_unaryop): Striped static field access assigned to decl and ++ op. Changed promotion scheme for ++/-- operators. ++ (search_loop): New function. ++ (labeled_block_contains_loop_p): Likewise. ++ (patch_loop_statement): Call labeled_block_contains_loop_p. Added ++ comment. ++ (patch_bc_statement): Call search_loop. Fixed comment. ++ ++1999-08-15 Anthony Green ++ ++ * expr.c (java_lang_expand_expr): Mark static array data as ++ referenced. ++ ++1999-07-25 Anthony Green ++ ++ * gjavah.c (print_stub): New function. ++ (METHOD_IS_NATIVE): New macro. ++ (print_mangled_classname): Make static. ++ (HANDLE_END_FIELD): Don't emit fields during stub generation. ++ (process_file): Perform stub generation. ++ (HANDLE_METHOD): Don't emit class decls during stub ++ generation. ++ (HANDLE_END_METHOD): Take into account stub generation. ++ (print_method_info): Handle stub generation. ++ (print_stub): New function. ++ (print_cxx_classname): Make signature consistant with others. ++ (help): Describe -stubs option. ++ (main): Create stub file. ++ (version): Use version.c. ++ (print_full_cxx_name): New function. ++ (print_c_decl): Use print_full_cxx_name. ++ ++Thu Jul 22 12:41:12 1999 Alexandre Petit-Bianco ++ ++ * check-init.c (check_init): Handle MAX_EXPR. ++ ++1999-07-15 Andrew Haley ++ ++ * lang.c (flag_use_divide_subroutine): New variable. ++ * typeck.c: (convert_ieee_real_to_integer): Bounds check ++ fp-to-integer conversion. ++ (convert): Call convert_ieee_real_to_integer when flag_fast_math ++ is not set. ++ ++ * expr.c (build_java_soft_divmod): New function. ++ (build_java_binop): Call build_java_soft_divmod if ++ flag_use_divide_subroutine is set. ++ * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree ++ soft_lrem_node: new builtin functions. ++ (init_decl_processing) Initialize the new builtins. ++ * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree ++ soft_lrem_node: new builtin functions. ++ (build_java_soft_divmod): New function. ++ * parse.y: Call build_java_soft_divmod if ++ flag_use_divide_subroutine is set. ++ * parse.c: Rebuilt. ++ ++ * jvspec.c (lang_specific_driver): Always allow an extra arg (for ++ a --specs= arg) even if not linking. ++ * lang-options.h (DEFINE_LANG_NAME ("Java")): Add ++ -fuse-divide-subroutine ++ ++Tue Jul 20 13:20:05 1999 Alexandre Petit-Bianco ++ ++ * parse.y (resolve_and_layout): Check methods only once. ++ (resolve_qualified_expression_name): Verify thrown exceptions ++ compatibility. ++ (check_thrown_exceptions): Reject exceptions thrown in ++ initializer. Error message tuned. ++ ++1999-07-14 Andrew Haley ++ ++ * expr.c (expand_expr): Do not return the last statement in a ++ block as the block's value. ++ ++Sat Jul 3 22:26:32 1999 Alexandre Petit-Bianco ++ ++ * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed ++ CALL_EXPR, to avoid order of evaluation changes. ++ ++Fri Jul 2 17:44:08 1999 Alexandre Petit-Bianco ++ ++ * parse.y (qualify_ambiguous_name): Do not use ++ IDENTIFIER_LOCAL_VALUE when name is a STRING_CST. ++ ++Thu Jul 1 23:31:16 1999 Alexandre Petit-Bianco ++ ++ * check-init.c (check_init): Handle MAX_EXPR. ++ * expr.c (force_evaluation_order): Force method call arguments to ++ be evaluated in left-to-right order. ++ * parse.y (qualify_ambiguous_name): Loop again to qualify ++ NEW_ARRAY_EXPR properly. ++ ++Wed Jun 30 17:27:58 1999 Alexandre Petit-Bianco ++ ++ * parse.y (patch_invoke): Resolve unresolved invoked method ++ returned type. ++ (qualify_ambiguous_name): STRING_CST to qualify expression for ++ type name resolution. ++ ++1999-06-24 Andrew Haley ++ ++ * java/class.c (finish_class): Whenever a deferred method is ++ output, rescan the list of methods to see if a new candidate for ++ output can be found. ++ ++ ++====================================================================== ++ ++ ++ ++ + Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com) + + * gcc-2.95.2 Released. +diff -u -r gcc-2.95.2-orig/gcc/java/check-init.c gcc-2.95.2/gcc/java/check-init.c +--- gcc-2.95.2-orig/gcc/java/check-init.c Sat May 15 01:44:08 1999 ++++ gcc-2.95.2/gcc/java/check-init.c Sun Oct 31 12:32:14 1999 +@@ -643,6 +643,8 @@ + case GE_EXPR: + case LT_EXPR: + case LE_EXPR: ++ case MAX_EXPR: ++ case MIN_EXPR: + case ARRAY_REF: + binop: + check_init (TREE_OPERAND (exp, 0), before); +diff -u -r gcc-2.95.2-orig/gcc/java/class.c gcc-2.95.2/gcc/java/class.c +--- gcc-2.95.2-orig/gcc/java/class.c Fri Jun 25 15:27:08 1999 ++++ gcc-2.95.2/gcc/java/class.c Sun Oct 31 19:08:09 1999 +@@ -425,10 +425,13 @@ + + if (access_flags & ACC_PUBLIC) METHOD_PUBLIC (fndecl) = 1; + if (access_flags & ACC_PROTECTED) METHOD_PROTECTED (fndecl) = 1; +- if (access_flags & ACC_PRIVATE) METHOD_PRIVATE (fndecl) = 1; ++ if (access_flags & ACC_PRIVATE) ++ METHOD_PRIVATE (fndecl) = DECL_INLINE (fndecl) = 1; + if (access_flags & ACC_NATIVE) METHOD_NATIVE (fndecl) = 1; +- if (access_flags & ACC_STATIC) METHOD_STATIC (fndecl) = 1; +- if (access_flags & ACC_FINAL) METHOD_FINAL (fndecl) = 1; ++ if (access_flags & ACC_STATIC) ++ METHOD_STATIC (fndecl) = DECL_INLINE (fndecl) = 1; ++ if (access_flags & ACC_FINAL) ++ METHOD_FINAL (fndecl) = DECL_INLINE (fndecl) = 1; + if (access_flags & ACC_SYNCHRONIZED) METHOD_SYNCHRONIZED (fndecl) = 1; + if (access_flags & ACC_ABSTRACT) METHOD_ABSTRACT (fndecl) = 1; + if (access_flags & ACC_TRANSIENT) METHOD_TRANSIENT (fndecl) = 1; +@@ -1200,10 +1203,10 @@ + tree cl; + { + tree method; ++ tree type_methods = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class)); + +- /* Emit deferred inline methods. */ +- for ( method = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class)); +- method != NULL_TREE; method = TREE_CHAIN (method)) ++ /* Emit deferred inline methods. */ ++ for (method = type_methods; method != NULL_TREE; ) + { + if (! TREE_ASM_WRITTEN (method) && DECL_SAVED_INSNS (method) != 0) + { +@@ -1215,10 +1218,16 @@ + temporary_allocation (); + output_inline_function (method); + permanent_allocation (1); ++ /* Scan the list again to see if there are any earlier ++ methods to emit. */ ++ method = type_methods; ++ continue; + } + } ++ method = TREE_CHAIN (method); + } + ++ current_function_decl = NULL_TREE; + make_class_data (current_class); + register_class (); + rest_of_decl_compilation (TYPE_NAME (current_class), (char*) 0, 1, 0); +@@ -1721,7 +1730,6 @@ + tree init_decl; + tree t; + +- start_sequence (); + init_decl = build_decl (FUNCTION_DECL, init_name, init_type); + DECL_ASSEMBLER_NAME (init_decl) = init_name; + TREE_STATIC (init_decl) = 1; +Only in gcc-2.95.2/gcc/java: class.c.orig +diff -u -r gcc-2.95.2-orig/gcc/java/decl.c gcc-2.95.2/gcc/java/decl.c +--- gcc-2.95.2-orig/gcc/java/decl.c Sat Jun 5 20:18:17 1999 ++++ gcc-2.95.2/gcc/java/decl.c Sat Oct 30 19:53:18 1999 +@@ -365,6 +365,11 @@ + tree soft_lookupinterfacemethod_node; + tree soft_fmod_node; + tree soft_exceptioninfo_call_node; ++tree soft_idiv_node; ++tree soft_irem_node; ++tree soft_ldiv_node; ++tree soft_lrem_node; ++ + + /* Build (and pushdecl) a "promoted type" for all standard + types shorter than int. */ +@@ -812,6 +817,26 @@ + BUILT_IN_FMOD, "fmodf"); + #endif + ++ soft_idiv_node ++ = builtin_function ("_Jv_divI", ++ build_function_type (int_type_node, t), ++ NOT_BUILT_IN, NULL_PTR); ++ ++ soft_irem_node ++ = builtin_function ("_Jv_remI", ++ build_function_type (int_type_node, t), ++ NOT_BUILT_IN, NULL_PTR); ++ ++ soft_ldiv_node ++ = builtin_function ("_Jv_divJ", ++ build_function_type (long_type_node, t), ++ NOT_BUILT_IN, NULL_PTR); ++ ++ soft_lrem_node ++ = builtin_function ("_Jv_remJ", ++ build_function_type (long_type_node, t), ++ NOT_BUILT_IN, NULL_PTR); ++ + init_class_processing (); + } + +Only in gcc-2.95.2/gcc/java: decl.c.orig +diff -u -r gcc-2.95.2-orig/gcc/java/expr.c gcc-2.95.2/gcc/java/expr.c +--- gcc-2.95.2-orig/gcc/java/expr.c Sat Jun 5 20:18:19 1999 ++++ gcc-2.95.2/gcc/java/expr.c Sun Oct 31 13:00:28 1999 +@@ -1052,6 +1052,53 @@ + expand_assignment (local_var, res, 0, 0); + } + ++ ++tree ++build_java_soft_divmod (op, type, op1, op2) ++ enum tree_code op; ++ tree type, op1, op2; ++{ ++ tree call = NULL; ++ tree arg1 = convert (type, op1); ++ tree arg2 = convert (type, op2); ++ ++ if (type == int_type_node) ++ { ++ switch (op) ++ { ++ case TRUNC_DIV_EXPR: ++ call = soft_idiv_node; ++ break; ++ case TRUNC_MOD_EXPR: ++ call = soft_irem_node; ++ break; ++ } ++ } ++ else if (type == long_type_node) ++ { ++ switch (op) ++ { ++ case TRUNC_DIV_EXPR: ++ call = soft_ldiv_node; ++ break; ++ case TRUNC_MOD_EXPR: ++ call = soft_lrem_node; ++ break; ++ } ++ } ++ ++ if (! call) ++ fatal ("Internal compiler error in build_java_soft_divmod"); ++ ++ call = build (CALL_EXPR, type, ++ build_address_of (call), ++ tree_cons (NULL_TREE, arg1, ++ build_tree_list (NULL_TREE, arg2)), ++ NULL_TREE); ++ ++ return call; ++} ++ + tree + build_java_binop (op, type, arg1, arg2) + enum tree_code op; +@@ -1100,10 +1147,11 @@ + integer_zero_node)); + return fold (build (COND_EXPR, int_type_node, + ifexp1, integer_negative_one_node, second_compare)); +- } +- ++ } ++ case TRUNC_DIV_EXPR: + case TRUNC_MOD_EXPR: +- if (TREE_CODE (type) == REAL_TYPE) ++ if (TREE_CODE (type) == REAL_TYPE ++ && op == TRUNC_MOD_EXPR) + { + tree call; + if (type != double_type_node) +@@ -1120,6 +1168,12 @@ + call = convert (type, call); + return call; + } ++ ++ if (TREE_CODE (type) == INTEGER_TYPE ++ && flag_use_divide_subroutine ++ && ! flag_syntax_only) ++ return build_java_soft_divmod (op, type, arg1, arg2); ++ + break; + default: ; + } +@@ -1881,6 +1935,7 @@ + DECL_INITIAL (init_decl) = init; + DECL_IGNORED_P (init_decl) = 1; + TREE_READONLY (init_decl) = 1; ++ TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (init_decl)) = 1; + make_decl_rtl (init_decl, NULL, 1); + init = init_decl; + } +@@ -1895,7 +1950,6 @@ + { + tree local; + tree body = BLOCK_EXPR_BODY (exp); +- struct rtx_def *to_return; + pushlevel (2); /* 2 and above */ + expand_start_bindings (0); + local = BLOCK_EXPR_DECLS (exp); +@@ -1913,10 +1967,11 @@ + emit_queue (); + body = TREE_OPERAND (body, 1); + } +- to_return = expand_expr (body, target, tmode, modifier); ++ expand_expr (body, const0_rtx, VOIDmode, 0); ++ emit_queue (); + poplevel (1, 1, 0); + expand_end_bindings (getdecls (), 1, 0); +- return to_return; ++ return const0_rtx; + } + break; + +@@ -2578,6 +2633,10 @@ + + We fix this by using save_expr. This forces the sub-operand to be + copied into a fresh virtual register, ++ ++ For method invocation, we modify the arguments so that a ++ left-to-right order evaluation is performed. Saved expressions ++ will, in CALL_EXPR order, be reused when the call will be expanded. + */ + + tree +@@ -2593,19 +2652,30 @@ + } + else if (TREE_CODE (node) == CALL_EXPR || TREE_CODE (node) == NEW_CLASS_EXPR) + { +- tree last_side_effecting_arg = NULL_TREE; +- tree arg = TREE_OPERAND (node, 1); +- for (; arg != NULL_TREE; arg = TREE_CHAIN (arg)) ++ tree arg, cmp; ++ ++ if (!TREE_OPERAND (node, 1)) ++ return node; ++ ++ /* This reverses the evaluation order. This is a desired effect. */ ++ for (cmp = NULL_TREE, arg = TREE_OPERAND (node, 1); ++ arg; arg = TREE_CHAIN (arg)) + { +- if (TREE_SIDE_EFFECTS (TREE_VALUE (arg))) +- last_side_effecting_arg = arg; ++ tree saved = save_expr (TREE_VALUE (arg)); ++ cmp = (cmp == NULL_TREE ? saved : ++ build (COMPOUND_EXPR, void_type_node, cmp, saved)); ++ TREE_VALUE (arg) = saved; + } +- arg = TREE_OPERAND (node, 1); +- for (; arg != NULL_TREE; arg = TREE_CHAIN (arg)) ++ ++ if (cmp && TREE_CODE (cmp) == COMPOUND_EXPR) ++ TREE_SIDE_EFFECTS (cmp) = 1; ++ ++ if (cmp) + { +- if (arg == last_side_effecting_arg) +- break; +- TREE_VALUE (arg) = save_expr (TREE_VALUE (arg)); ++ cmp = save_expr (build (COMPOUND_EXPR, TREE_TYPE (node), cmp, node)); ++ CAN_COMPLETE_NORMALLY (cmp) = CAN_COMPLETE_NORMALLY (node); ++ TREE_SIDE_EFFECTS (cmp) = 1; ++ node = cmp; + } + } + return node; +Only in gcc-2.95.2/gcc/java: expr.c.orig +Only in gcc-2.95.2/gcc/java: expr.c.rej +diff -u -r gcc-2.95.2-orig/gcc/java/gjavah.c gcc-2.95.2/gcc/java/gjavah.c +--- gcc-2.95.2-orig/gcc/java/gjavah.c Fri May 14 00:05:02 1999 ++++ gcc-2.95.2/gcc/java/gjavah.c Sat Oct 30 15:06:45 1999 +@@ -33,6 +33,8 @@ + #include "java-tree.h" + #include "java-opcodes.h" + ++#include "version.c" ++ + /* The output file. */ + FILE *out = NULL; + +@@ -88,6 +90,11 @@ + #define METHOD_IS_FINAL(Class, Method) \ + (((Class) & ACC_FINAL) || ((Method) & (ACC_FINAL | ACC_PRIVATE))) + ++/* Pass this macro the flags for a method. It will return true if the ++ method is native. */ ++#define METHOD_IS_NATIVE(Method) \ ++ ((Method) & ACC_NATIVE) ++ + /* We keep a linked list of all method names we have seen. This lets + us determine if a method name and a field name are in conflict. */ + struct method_name +@@ -100,11 +107,15 @@ + /* List of method names we've seen. */ + static struct method_name *method_name_list; + +-static void print_field_info PROTO ((FILE *, JCF*, int, int, JCF_u2)); +-static void print_method_info PROTO ((FILE *, JCF*, int, int, JCF_u2)); ++static void print_field_info PROTO ((FILE*, JCF*, int, int, JCF_u2)); ++static void print_mangled_classname PROTO ((FILE*, JCF*, const char*, int)); ++static int print_cxx_classname PROTO ((FILE*, const char*, JCF*, int)); ++static void print_method_info PROTO ((FILE*, JCF*, int, int, JCF_u2)); + static void print_c_decl PROTO ((FILE*, JCF*, int, int, int, const char *)); +-static void decompile_method PROTO ((FILE *, JCF *, int)); +-static void add_class_decl PROTO ((FILE *, JCF *, JCF_u2)); ++static void print_stub PROTO ((FILE*, JCF*, int, int, int, const char *)); ++static void print_full_cxx_name PROTO ((FILE*, JCF*, int, int, int, const char *)); ++static void decompile_method PROTO ((FILE*, JCF*, int)); ++static void add_class_decl PROTO ((FILE*, JCF*, JCF_u2)); + + static int java_float_finite PROTO ((jfloat)); + static int java_double_finite PROTO ((jdouble)); +@@ -130,13 +141,13 @@ + #define HANDLE_END_FIELD() \ + if (field_pass) \ + { \ +- if (out) \ ++ if (out && ! stubs) \ + print_field_info (out, jcf, current_field_name, \ + current_field_signature, \ + current_field_flags); \ + } \ + else \ +- add_class_decl (out, jcf, current_field_signature); ++ if (! stubs) add_class_decl (out, jcf, current_field_signature); + + #define HANDLE_CONSTANTVALUE(VALUEINDEX) current_field_value = (VALUEINDEX) + +@@ -151,14 +162,14 @@ + print_method_info (out, jcf, NAME, SIGNATURE, ACCESS_FLAGS); \ + } \ + else \ +- add_class_decl (out, jcf, SIGNATURE); ++ if (! stubs) add_class_decl (out, jcf, SIGNATURE); + + #define HANDLE_CODE_ATTRIBUTE(MAX_STACK, MAX_LOCALS, CODE_LENGTH) \ + if (out && method_declared) decompile_method (out, jcf, CODE_LENGTH); + + static int decompiled = 0; + #define HANDLE_END_METHOD() \ +- if (out && method_printed) fputs (decompiled ? "\n" : ";\n", out); ++ if (out && method_printed) fputs (decompiled || stubs ? "\n" : ";\n", out); + + #include "jcf-reader.c" + +@@ -562,24 +573,36 @@ + return; + } + +- method_printed = 1; +- generate_access (stream, flags); +- +- fputs (" ", out); +- if ((flags & ACC_STATIC)) +- fputs ("static ", out); +- else if (! METHOD_IS_FINAL (jcf->access_flags, flags)) ++ if (! stubs) + { +- /* Don't print `virtual' if we have a constructor. */ +- if (! is_init) +- fputs ("virtual ", out); +- } +- print_c_decl (out, jcf, name_index, sig_index, is_init, override); ++ method_printed = 1; + +- if ((flags & ACC_ABSTRACT)) +- fputs (" = 0", out); ++ generate_access (stream, flags); ++ ++ fputs (" ", out); ++ if ((flags & ACC_STATIC)) ++ fputs ("static ", out); ++ else if (! METHOD_IS_FINAL (jcf->access_flags, flags)) ++ { ++ /* Don't print `virtual' if we have a constructor. */ ++ if (! is_init) ++ fputs ("virtual ", out); ++ } ++ print_c_decl (out, jcf, name_index, sig_index, is_init, override); ++ ++ if ((flags & ACC_ABSTRACT)) ++ fputs (" = 0", out); ++ else ++ method_declared = 1; ++ } + else +- method_declared = 1; ++ { ++ if (METHOD_IS_NATIVE(flags)) ++ { ++ method_printed = 1; ++ print_stub (out, jcf, name_index, sig_index, is_init, override); ++ } ++ } + } + + /* Try to decompile a method body. Right now we just try to handle a +@@ -653,10 +676,13 @@ + int *need_space; + { + const char *ctype; ++ int array_depth = 0; + + switch (signature[0]) + { + case '[': ++ /* More spaghetti. */ ++ array_loop: + for (signature++; (signature < limit + && *signature >= '0' + && *signature <= '9'); signature++) +@@ -671,13 +697,17 @@ + case 'S': ctype = "jshortArray"; goto printit; + case 'J': ctype = "jlongArray"; goto printit; + case 'Z': ctype = "jbooleanArray"; goto printit; +- case '[': ctype = "jobjectArray"; goto printit; ++ case '[': ++ /* We have a nested array. */ ++ ++array_depth; ++ fputs ("JArray<", stream); ++ goto array_loop; ++ + case 'L': +- /* We have to generate a reference to JArray here, +- so that our output matches what the compiler +- does. */ ++ /* We have to generate a reference to JArray here, so that ++ our output matches what the compiler does. */ + ++signature; +- fputs ("JArray<", stream); ++ fputs ("JArray<", stream); + while (signature < limit && *signature != ';') + { + int ch = UTF8_GET (signature, limit); +@@ -711,6 +741,8 @@ + case 'Z': ctype = "jboolean"; goto printit; + case 'V': ctype = "void"; goto printit; + case 'L': ++ /* Print a leading "::" so we look in the right namespace. */ ++ fputs ("::", stream); + ++signature; + while (*signature && *signature != ';') + { +@@ -737,6 +769,9 @@ + break; + } + ++ while (array_depth-- > 0) ++ fputs ("> *", stream); ++ + return signature; + } + +@@ -791,40 +826,121 @@ + /* Now print the name of the thing. */ + if (need_space) + fputs (" ", stream); +- if (name_override) +- fputs (name_override, stream); +- else if (name_index) +- { +- /* Declare constructors specially. */ +- if (is_init) +- print_base_classname (stream, jcf, jcf->this_class); +- else +- print_name (stream, jcf, name_index); +- } ++ print_full_cxx_name (stream, jcf, name_index, ++ signature_index, is_init, name_override); ++ } ++} + +- if (is_method) ++// Print the unqualified method name followed by the signature. ++static void ++DEFUN(print_full_cxx_name, (stream, jcf, name_index, signature_index, is_init, name_override), ++ FILE* stream AND JCF* jcf ++ AND int name_index AND int signature_index AND int is_init ++ AND const char *name_override) ++{ ++ int length = JPOOL_UTF_LENGTH (jcf, signature_index); ++ unsigned char *str0 = JPOOL_UTF_DATA (jcf, signature_index); ++ register unsigned char *str = str0; ++ unsigned char *limit = str + length; ++ int need_space = 0; ++ int is_method = str[0] == '('; ++ unsigned char *next; ++ ++ if (name_override) ++ fputs (name_override, stream); ++ else if (name_index) ++ { ++ /* Declare constructors specially. */ ++ if (is_init) ++ print_base_classname (stream, jcf, jcf->this_class); ++ else ++ print_name (stream, jcf, name_index); ++ } ++ ++ if (is_method) ++ { ++ /* Have a method or a constructor. Print signature pieces ++ until done. */ ++ fputs (" (", stream); ++ str = str0 + 1; ++ while (str < limit && *str != ')') + { +- /* Have a method or a constructor. Print signature pieces +- until done. */ +- fputs (" (", stream); +- str = str0 + 1; +- while (str < limit && *str != ')') ++ next = decode_signature_piece (stream, str, limit, &need_space); ++ if (! next) + { +- next = decode_signature_piece (stream, str, limit, &need_space); +- if (! next) +- { +- fprintf (stderr, "unparseable signature: `%s'\n", str0); +- found_error = 1; +- return; +- } ++ fprintf (stderr, "unparseable signature: `%s'\n", str0); ++ found_error = 1; ++ return; ++ } ++ ++ if (next < limit && *next != ')') ++ fputs (", ", stream); ++ str = next; ++ } ++ ++ fputs (")", stream); ++ } ++} ++ ++static void ++DEFUN(print_stub, (stream, jcf, name_index, signature_index, is_init, ++ name_override), ++ FILE* stream AND JCF* jcf ++ AND int name_index AND int signature_index ++ AND int is_init AND const char *name_override) ++{ ++ if (JPOOL_TAG (jcf, signature_index) != CONSTANT_Utf8) ++ { ++ fprintf (stream, ""); ++ found_error = 1; ++ } ++ else ++ { ++ int length = JPOOL_UTF_LENGTH (jcf, signature_index); ++ unsigned char *str0 = JPOOL_UTF_DATA (jcf, signature_index); ++ register unsigned char *str = str0; ++ unsigned char *limit = str + length; ++ int need_space = 0; ++ int is_method = str[0] == '('; ++ unsigned char *next; + +- if (next < limit && *next != ')') +- fputs (", ", stream); +- str = next; ++ /* If printing a method, skip to the return signature and print ++ that first. However, there is no return value if this is a ++ constructor. */ ++ if (is_method && ! is_init) ++ { ++ while (str < limit) ++ { ++ int ch = *str++; ++ if (ch == ')') ++ break; + } ++ } + +- fputs (")", stream); ++ /* If printing a field or an ordinary method, then print the ++ "return value" now. */ ++ if (! is_method || ! is_init) ++ { ++ next = decode_signature_piece (stream, str, limit, &need_space); ++ if (! next) ++ { ++ fprintf (stderr, "unparseable signature: `%s'\n", str0); ++ found_error = 1; ++ return; ++ } + } ++ ++ /* Now print the name of the thing. */ ++ print_cxx_classname (stream, "\n", jcf, jcf->this_class); ++ fputs ("::", stream); ++ print_full_cxx_name (stream, jcf, name_index, ++ signature_index, is_init, name_override); ++ fputs ("\n{\n JvFail (\"", stream); ++ print_cxx_classname (stream, "", jcf, jcf->this_class); ++ fputs ("::", stream); ++ print_full_cxx_name (stream, jcf, name_index, ++ signature_index, is_init, name_override); ++ fputs (" not implemented\");\n}\n\n", stream); + } + } + +@@ -846,7 +962,7 @@ + static int + print_cxx_classname (stream, prefix, jcf, index) + FILE *stream; +- char *prefix; ++ const char *prefix; + JCF *jcf; + int index; + { +@@ -865,6 +981,10 @@ + return 0; + + fputs (prefix, stream); ++ ++ /* Print a leading "::" so we look in the right namespace. */ ++ fputs ("::", stream); ++ + while (s < limit) + { + c = UTF8_GET (s, limit); +@@ -1071,7 +1191,10 @@ + { + for (i = 0; i < depth; ++i) + fputc (' ', out); +- fputs ("};\n", out); ++ fputs ("}\n", out); ++ /* Only print a `;' when printing a class. C++ is evil. */ ++ if (name->is_class) ++ fputs (";", out); + } + + free (name->name); +@@ -1103,7 +1226,7 @@ + /* If we see an array, then we include the array header. */ + if (s[i] == '[') + { +- print_include (out, "java-array", -1); ++ print_include (out, "gcj/array", -1); + continue; + } + +@@ -1204,30 +1327,49 @@ + jcf_parse_class (jcf); + + if (written_class_count++ == 0 && out) +- fputs ("// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-\n\n", +- out); ++ if (! stubs) ++ fputs ("// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-\n\n", ++ out); ++ else ++ { ++ fputs ("// This file was created by `gcjh -stubs'. It is -*- c++ -*-. ++// ++// This file is intended to give you a head start on implementing native ++// methods using CNI. ++// Be aware: running `gcjh -stubs' once more for this class may overwrite any ++// edits you have made to this file.\n\n", out); ++ } + + if (out) + { +- print_mangled_classname (out, jcf, "#ifndef __", jcf->this_class); +- fprintf (out, "__\n"); +- +- print_mangled_classname (out, jcf, "#define __", jcf->this_class); +- fprintf (out, "__\n\n"); +- +- /* We do this to ensure that inline methods won't be `outlined' +- by g++. This works as long as method and fields are not +- added by the user. */ +- fprintf (out, "#pragma interface\n"); +- } +- +- if (jcf->super_class && out) +- { +- int super_length; +- unsigned char *supername = super_class_name (jcf, &super_length); +- +- fputs ("\n", out); +- print_include (out, supername, super_length); ++ if (! stubs) ++ { ++ print_mangled_classname (out, jcf, "#ifndef __", jcf->this_class); ++ fprintf (out, "__\n"); ++ ++ print_mangled_classname (out, jcf, "#define __", jcf->this_class); ++ fprintf (out, "__\n\n"); ++ ++ /* We do this to ensure that inline methods won't be `outlined' ++ by g++. This works as long as method and fields are not ++ added by the user. */ ++ fprintf (out, "#pragma interface\n"); ++ ++ if (jcf->super_class) ++ { ++ int super_length; ++ unsigned char *supername = super_class_name (jcf, &super_length); ++ ++ fputs ("\n", out); ++ print_include (out, supername, super_length); ++ } ++ } ++ else ++ { ++ /* Strip off the ".class" portion of the name when printing ++ the include file name. */ ++ print_include (out, jcf->classname, strlen (jcf->classname) - 6); ++ } + } + + /* We want to parse the methods first. But we need to find where +@@ -1246,31 +1388,37 @@ + if (out) + { + fputs ("\n", out); +- print_class_decls (out, jcf, jcf->this_class); ++ ++ if (! stubs) ++ print_class_decls (out, jcf, jcf->this_class); + + for (i = 0; i < prepend_count; ++i) + fprintf (out, "%s\n", prepend_specs[i]); + if (prepend_count > 0) + fputc ('\n', out); +- } +- +- if (out && ! print_cxx_classname (out, "class ", jcf, jcf->this_class)) +- { +- fprintf (stderr, "class is of array type\n"); +- found_error = 1; +- return; +- } +- if (out && jcf->super_class) +- { +- if (! print_cxx_classname (out, " : public ", jcf, jcf->super_class)) ++ ++ if (! stubs) + { +- fprintf (stderr, "base class is of array type\n"); +- found_error = 1; +- return; ++ if (! print_cxx_classname (out, "class ", jcf, jcf->this_class)) ++ { ++ fprintf (stderr, "class is of array type\n"); ++ found_error = 1; ++ return; ++ } ++ if (jcf->super_class) ++ { ++ if (! print_cxx_classname (out, " : public ", ++ jcf, jcf->super_class)) ++ { ++ fprintf (stderr, "base class is of array type\n"); ++ found_error = 1; ++ return; ++ } ++ } ++ ++ fputs ("\n{\n", out); + } + } +- if (out) +- fputs ("\n{\n", out); + + /* Now go back for second pass over methods and fields. */ + JCF_SEEK (jcf, method_start); +@@ -1297,15 +1445,20 @@ + for (i = 0; i < add_count; ++i) + fprintf (out, " %s\n", add_specs[i]); + +- fputs ("};\n", out); ++ if (! stubs) ++ fputs ("};\n", out); + + if (append_count > 0) + fputc ('\n', out); + for (i = 0; i < append_count; ++i) + fprintf (out, "%s\n", append_specs[i]); + +- print_mangled_classname (out, jcf, "\n#endif /* __", jcf->this_class); +- fprintf (out, "__ */\n"); ++ if (!stubs) ++ { ++ print_mangled_classname (out, jcf, ++ "\n#endif /* __", jcf->this_class); ++ fprintf (out, "__ */\n"); ++ } + } + } + +@@ -1327,6 +1480,7 @@ + printf (" -d DIRECTORY Set output directory name\n"); + printf (" --help Print this help, then exit\n"); + printf (" -o FILE Set output file name\n"); ++ printf (" -stubs Generate a C++ implementation stub file\n"); + printf (" -td DIRECTORY Set temporary directory name\n"); + printf (" -v, --verbose Print extra information while running\n"); + printf (" --version Print version number, then exit\n"); +@@ -1346,8 +1500,8 @@ + version () + { + /* FIXME: use version.c? */ +- printf ("gcjh (GNU gcc) 0.0\n\n"); +- printf ("Copyright (C) 1998 Free Software Foundation, Inc.\n"); ++ printf ("gcjh (%s)\n\n", version_string); ++ printf ("Copyright (C) 1998, 1999 Free Software Foundation, Inc.\n"); + printf ("This is free software; see the source for copying conditions. There is NO\n"); + printf ("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"); + exit (0); +@@ -1548,7 +1702,7 @@ + { + int dir_len = strlen (output_directory); + int i, classname_length = strlen (classname); +- current_output_file = (char*) ALLOC (dir_len + classname_length + 4); ++ current_output_file = (char*) ALLOC (dir_len + classname_length + 5); + strcpy (current_output_file, output_directory); + if (dir_len > 0 && output_directory[dir_len-1] != '/') + current_output_file[dir_len++] = '/'; +@@ -1574,7 +1728,8 @@ + jcf_dependency_set_dep_file (current_output_file); + } + } +- strcpy (current_output_file + dir_len, ".h"); ++ strcpy (current_output_file + dir_len, ++ stubs ? ".cc" : ".h"); + jcf_dependency_set_target (current_output_file); + if (! suppress_output) + { +@@ -1601,10 +1756,9 @@ + + /* TODO: + +- * Do whatever the javah -stubs flag does. +- + * Emit "structure forward declarations" when needed. + + * Generate C headers, like javah + + */ ++ +Only in gcc-2.95.2/gcc/java: gjavah.c.orig +Only in gcc-2.95.2/gcc/java: gjavah.c.rej +diff -u -r gcc-2.95.2-orig/gcc/java/java-tree.h gcc-2.95.2/gcc/java/java-tree.h +--- gcc-2.95.2-orig/gcc/java/java-tree.h Fri May 14 02:33:28 1999 ++++ gcc-2.95.2/gcc/java/java-tree.h Sat Oct 30 19:45:50 1999 +@@ -141,6 +141,9 @@ + extern int flag_not_overriding; + extern int flag_static_local_jdk1_1; + ++/* When non zero, call a library routine to do integer divisions. */ ++extern int flag_use_divide_subroutine; ++ + /* The Java .class file that provides main_class; the main input file. */ + extern struct JCF *current_jcf; + +@@ -283,6 +286,10 @@ + extern tree soft_lookupinterfacemethod_node; + extern tree soft_fmod_node; + extern tree soft_exceptioninfo_call_node; ++extern tree soft_idiv_node; ++extern tree soft_irem_node; ++extern tree soft_ldiv_node; ++extern tree soft_lrem_node; + + extern tree access_flags_type_node; + +@@ -544,6 +551,7 @@ + extern tree build_field_ref PROTO ((tree, tree, tree)); + extern void pushdecl_force_head PROTO ((tree)); + extern tree build_java_binop PROTO ((enum tree_code, tree, tree, tree)); ++extern tree build_java_soft_divmod PROTO ((enum tree_code, tree, tree, tree)); + extern tree binary_numeric_promotion PROTO ((tree, tree, tree *, tree *)); + extern tree build_java_arrayaccess PROTO ((tree, tree, tree)); + extern tree build_newarray PROTO ((int, tree)); +Only in gcc-2.95.2/gcc/java: java-tree.h.orig +diff -u -r gcc-2.95.2-orig/gcc/java/jcf-parse.c gcc-2.95.2/gcc/java/jcf-parse.c +--- gcc-2.95.2-orig/gcc/java/jcf-parse.c Thu Apr 22 01:49:42 1999 ++++ gcc-2.95.2/gcc/java/jcf-parse.c Sat Oct 30 14:02:11 1999 +@@ -748,6 +748,8 @@ + /* Mark the file as parsed */ + HAS_BEEN_ALREADY_PARSED_P (file) = 1; + ++ jcf_dependency_add_file (input_filename, 0); ++ + lang_init_source (1); /* Error msgs have no method prototypes */ + + java_init_lex (); /* Initialize the parser */ +diff -u -r gcc-2.95.2-orig/gcc/java/jcf-write.c gcc-2.95.2/gcc/java/jcf-write.c +--- gcc-2.95.2-orig/gcc/java/jcf-write.c Sun Mar 21 18:09:14 1999 ++++ gcc-2.95.2/gcc/java/jcf-write.c Sun Oct 31 18:54:12 1999 +@@ -186,6 +186,9 @@ + struct jcf_block *label; + }; + ++#define RELOCATION_VALUE_0 ((HOST_WIDE_INT)0) ++#define RELOCATION_VALUE_1 ((HOST_WIDE_INT)1) ++ + /* State for single catch clause. */ + + struct jcf_handler +@@ -299,8 +302,14 @@ + static void init_jcf_method PROTO ((struct jcf_partial *, tree)); + static void release_jcf_state PROTO ((struct jcf_partial *)); + static struct chunk * generate_classfile PROTO ((tree, struct jcf_partial *)); ++static void emit_iinc PROTO ((tree, HOST_WIDE_INT, struct jcf_partial *)); ++static void emit_reloc PROTO ((HOST_WIDE_INT, int, struct jcf_block *, ++ struct jcf_partial *)); ++static void push_constant1 PROTO ((HOST_WIDE_INT, struct jcf_partial *)); ++static void push_constant2 PROTO ((HOST_WIDE_INT, struct jcf_partial *)); + +- ++static void push_long_const PROTO ((HOST_WIDE_INT, HOST_WIDE_INT, ++ struct jcf_partial *)); + /* Utility macros for appending (big-endian) data to a buffer. + We assume a local variable 'ptr' points into where we want to + write next, and we assume enoygh space has been allocated. */ +@@ -326,7 +335,13 @@ + #define PUT4(X) (PUT2((X) >> 16), PUT2((X) & 0xFFFF)) + #define PUTN(P, N) (CHECK_PUT(ptr, state, N), memcpy(ptr, P, N), ptr += (N)) + +- ++/* There are some cases below where CHECK_PUT is guaranteed to fail. ++ Use the following macros in those specific cases. */ ++#define UNSAFE_PUT1(X) (*ptr++ = (X)) ++#define UNSAFE_PUT2(X) (UNSAFE_PUT1((X) >> 8), UNSAFE_PUT1((X) & 0xFF)) ++#define UNSAFE_PUT4(X) (UNSAFE_PUT2((X) >> 16), UNSAFE_PUT2((X) & 0xFFFF)) ++#define UNSAFE_PUTN(P, N) (memcpy(ptr, P, N), ptr += (N)) ++ + /* Allocate a new chunk on obstack WORK, and link it in after LAST. + Set the data and size fields to DATA and SIZE, respectively. + However, if DATA is NULL and SIZE>0, allocate a buffer as well. */ +@@ -665,7 +680,7 @@ + + static void + push_constant1 (index, state) +- int index; ++ HOST_WIDE_INT index; + struct jcf_partial *state; + { + RESERVE (3); +@@ -686,7 +701,7 @@ + + static void + push_constant2 (index, state) +- int index; ++ HOST_WIDE_INT index; + struct jcf_partial *state; + { + RESERVE (3); +@@ -717,7 +732,8 @@ + } + else + { +- i = find_constant1 (&state->cpool, CONSTANT_Integer, i & 0xFFFFFFFF); ++ i = find_constant1 (&state->cpool, CONSTANT_Integer, ++ (jword)(i & 0xFFFFFFFF)); + push_constant1 (i, state); + } + } +@@ -730,7 +746,7 @@ + HOST_WIDE_INT w1, w2; + lshift_double (lo, hi, -32, 64, &w1, &w2, 1); + return find_constant2 (&state->cpool, CONSTANT_Long, +- w1 & 0xFFFFFFFF, lo & 0xFFFFFFFF); ++ (jword)(w1 & 0xFFFFFFFF), (jword)(lo & 0xFFFFFFFF)); + } + + /* Find or allocate a constant pool entry for the given VALUE. +@@ -745,7 +761,7 @@ + { + if (TYPE_PRECISION (TREE_TYPE (value)) <= 32) + return find_constant1 (&state->cpool, CONSTANT_Integer, +- TREE_INT_CST_LOW (value) & 0xFFFFFFFF); ++ (jword)(TREE_INT_CST_LOW (value) & 0xFFFFFFFF)); + else + return find_constant_wide (TREE_INT_CST_LOW (value), + TREE_INT_CST_HIGH (value), state); +@@ -756,14 +772,17 @@ + if (TYPE_PRECISION (TREE_TYPE (value)) == 32) + { + words[0] = etarsingle (TREE_REAL_CST (value)) & 0xFFFFFFFF; +- return find_constant1 (&state->cpool, CONSTANT_Float, words[0]); ++ return find_constant1 (&state->cpool, CONSTANT_Float, ++ (jword)words[0]); + } + else + { + etardouble (TREE_REAL_CST (value), words); + return find_constant2 (&state->cpool, CONSTANT_Double, +- words[1-FLOAT_WORDS_BIG_ENDIAN] & 0xFFFFFFFF, +- words[FLOAT_WORDS_BIG_ENDIAN] & 0xFFFFFFFF); ++ (jword)(words[1-FLOAT_WORDS_BIG_ENDIAN] & ++ 0xFFFFFFFF), ++ (jword)(words[FLOAT_WORDS_BIG_ENDIAN] & ++ 0xFFFFFFFF)); + } + } + else if (TREE_CODE (value) == STRING_CST) +@@ -906,7 +925,7 @@ + static void + emit_iinc (var, value, state) + tree var; +- int value; ++ HOST_WIDE_INT value; + struct jcf_partial *state; + { + int slot = DECL_LOCAL_INDEX (var); +@@ -1012,7 +1031,7 @@ + struct jcf_block *label; + struct jcf_partial *state; + { +- emit_reloc (0, BLOCK_START_RELOC, label, state); ++ emit_reloc (RELOCATION_VALUE_0, BLOCK_START_RELOC, label, state); + } + + /* Similar to emit_switch_reloc, +@@ -1041,8 +1060,8 @@ + struct jcf_partial *state; + { + OP1 (opcode); +- // value is 1 byte from reloc back to start of instruction. +- emit_reloc (1, - inv_opcode, target, state); ++ /* value is 1 byte from reloc back to start of instruction. */ ++ emit_reloc (RELOCATION_VALUE_1, - inv_opcode, target, state); + } + + static void +@@ -1051,8 +1070,8 @@ + struct jcf_partial *state; + { + OP1 (OPCODE_goto); +- // Value is 1 byte from reloc back to start of instruction. +- emit_reloc (1, OPCODE_goto_w, target, state); ++ /* Value is 1 byte from reloc back to start of instruction. */ ++ emit_reloc (RELOCATION_VALUE_1, OPCODE_goto_w, target, state); + } + + static void +@@ -1061,8 +1080,8 @@ + struct jcf_partial *state; + { + OP1 (OPCODE_jsr); +- // Value is 1 byte from reloc back to start of instruction. +- emit_reloc (1, OPCODE_jsr_w, target, state); ++ /* Value is 1 byte from reloc back to start of instruction. */ ++ emit_reloc (RELOCATION_VALUE_1, OPCODE_jsr_w, target, state); + } + + /* Generate code to evaluate EXP. If the result is true, +@@ -1690,7 +1709,8 @@ + int index = 0; + RESERVE (13 + 4 * (sw_state.max_case - sw_state.min_case + 1)); + OP1 (OPCODE_tableswitch); +- emit_reloc (0, SWITCH_ALIGN_RELOC, NULL, state); ++ emit_reloc (RELOCATION_VALUE_0, ++ SWITCH_ALIGN_RELOC, NULL, state); + emit_switch_reloc (sw_state.default_label, state); + OP4 (sw_state.min_case); + OP4 (sw_state.max_case); +@@ -1713,7 +1733,8 @@ + { /* Use lookupswitch. */ + RESERVE(9 + 8 * sw_state.num_cases); + OP1 (OPCODE_lookupswitch); +- emit_reloc (0, SWITCH_ALIGN_RELOC, NULL, state); ++ emit_reloc (RELOCATION_VALUE_0, ++ SWITCH_ALIGN_RELOC, NULL, state); + emit_switch_reloc (sw_state.default_label, state); + OP4 (sw_state.num_cases); + for (i = 0; i < sw_state.num_cases; i++) +@@ -1886,7 +1907,7 @@ + if (size == 1) + push_int_const (value, state); + else +- push_long_const (value, value >= 0 ? 0 : -1, state); ++ push_long_const (value, (HOST_WIDE_INT)(value >= 0 ? 0 : -1), state); + NOTE_PUSH (size); + emit_binop (OPCODE_iadd + adjust_typed_op (type, 3), type, state); + if (target != IGNORE_TARGET && ! post_op) +@@ -2775,7 +2796,7 @@ + } + fields_count++; + } +- ptr = fields_count_ptr; PUT2 (fields_count); ++ ptr = fields_count_ptr; UNSAFE_PUT2 (fields_count); + + ptr = methods_count_ptr = append_chunk (NULL, 2, state); + PUT2 (0); +@@ -2841,10 +2862,10 @@ + code_attributes_count++; + i += 8 + 10 * state->lvar_count; + } +- PUT4 (i); /* attribute_length */ +- PUT2 (state->code_SP_max); /* max_stack */ +- PUT2 (localvar_max); /* max_locals */ +- PUT4 (state->code_length); ++ UNSAFE_PUT4 (i); /* attribute_length */ ++ UNSAFE_PUT2 (state->code_SP_max); /* max_stack */ ++ UNSAFE_PUT2 (localvar_max); /* max_locals */ ++ UNSAFE_PUT4 (state->code_length); + + /* Emit the exception table. */ + ptr = append_chunk (NULL, 2 + 8 * state->num_handlers, state); +@@ -2934,7 +2955,7 @@ + methods_count++; + current_function_decl = save_function; + } +- ptr = methods_count_ptr; PUT2 (methods_count); ++ ptr = methods_count_ptr; UNSAFE_PUT2 (methods_count); + + source_file = DECL_SOURCE_FILE (TYPE_NAME (clas)); + for (ptr = source_file; ; ptr++) +Only in gcc-2.95.2/gcc/java: jcf-write.c.orig +Only in gcc-2.95.2/gcc/java: jcf-write.c.rej +diff -u -r gcc-2.95.2-orig/gcc/java/jvgenmain.c gcc-2.95.2/gcc/java/jvgenmain.c +--- gcc-2.95.2-orig/gcc/java/jvgenmain.c Wed Aug 11 17:08:32 1999 ++++ gcc-2.95.2/gcc/java/jvgenmain.c Sat Oct 30 14:02:48 1999 +@@ -1,5 +1,5 @@ + /* Program to generate "main" a Java(TM) class containing a main method. +- Copyright (C) 1998 Free Software Foundation, Inc. ++ Copyright (C) 1998, 1999 Free Software Foundation, Inc. + + This file is part of GNU CC. + +@@ -79,19 +79,37 @@ + (void (*) ()) OBSTACK_CHUNK_FREE); + } + ++static void ++usage (const char *name) ++{ ++ fprintf (stderr, "Usage: %s [OPTIONS]... CLASSNAME [OUTFILE]\n", name); ++ exit (1); ++} ++ + int + main (int argc, const char **argv) + { + const char *classname; + FILE *stream; + char *mangled_classname; ++ int i, last_arg; + +- if (argc < 2 || argc > 3) ++ if (argc < 2) ++ usage (argv[0]); ++ for (i = 1; i < argc; ++i) + { +- fprintf (stderr, "Usage: %s CLASSNAME [OUTFILE]\n", argv[0]); +- exit(-1); ++ if (! strncmp (argv[i], "-D", 2)) ++ { ++ /* Handled later. */ ++ } ++ else ++ break; + } + ++ if (i < argc - 2 || i == argc) ++ usage (argv[0]); ++ last_arg = i; ++ + classname = argv[1]; + + gcc_obstack_init (&name_obstack); +@@ -99,23 +117,46 @@ + obstack_1grow (&name_obstack, '\0'); + mangled_classname = obstack_finish (&name_obstack); + +- if (argc > 2 && strcmp (argv[2], "-") != 0) ++ if (i < argc - 1 && strcmp (argv[i + 1], "-") != 0) + { +- const char *outfile = argv[2]; ++ const char *outfile = argv[i + 1]; + stream = fopen (outfile, "w"); + if (stream == NULL) + { + fprintf (stderr, "%s: Cannot open output file: %s\n", + argv[0], outfile); +- exit (-1); ++ exit (1); + } + } + else + stream = stdout; ++ ++ /* At this point every element of ARGV from 1 to LAST_ARG is a `-D' ++ option. Process them appropriately. */ ++ fprintf (stream, "extern const char **_Jv_Compiler_Properties;\n"); ++ fprintf (stream, "static const char *props[] =\n{\n"); ++ for (i = 1; i < last_arg; ++i) ++ { ++ const char *p; ++ fprintf (stream, " \""); ++ for (p = &argv[i][2]; *p; ++p) ++ { ++ if (! isascii (*p)) ++ fprintf (stream, "\\%o", *p); ++ else if (*p == '\\' || *p == '"') ++ fprintf (stream, "\\%c", *p); ++ else ++ putc (*p, stream); ++ } ++ fprintf (stream, "\",\n"); ++ } ++ fprintf (stream, " 0\n};\n\n"); ++ + fprintf (stream, "extern struct Class %s%s;\n", + class_mangling_prefix, mangled_classname); + fprintf (stream, "int main (int argc, const char **argv)\n"); + fprintf (stream, "{\n"); ++ fprintf (stream, " _Jv_Compiler_Properties = props;\n"); + fprintf (stream, " JvRunMain (&%s%s, argc, argv);\n", + class_mangling_prefix, mangled_classname); + fprintf (stream, "}\n"); +@@ -123,7 +164,7 @@ + { + fprintf (stderr, "%s: Failed to close output file %s\n", + argv[0], argv[2]); +- exit (-1); ++ exit (1); + } + return 0; + } +Only in gcc-2.95.2/gcc/java: jvgenmain.c.orig +diff -u -r gcc-2.95.2-orig/gcc/java/jvspec.c gcc-2.95.2/gcc/java/jvspec.c +--- gcc-2.95.2-orig/gcc/java/jvspec.c Sun Oct 17 10:18:28 1999 ++++ gcc-2.95.2/gcc/java/jvspec.c Sat Oct 30 20:09:50 1999 +@@ -54,7 +54,7 @@ + #define COMBINE_INPUTS 0 + + char jvgenmain_spec[] = +- "jvgenmain %i %{!pipe:%umain.i} |\n\ ++ "jvgenmain %{D*} %i %{!pipe:%umain.i} |\n\ + cc1 %{!pipe:%Umain.i} %1 \ + %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\ + %{g*} %{O*} \ +@@ -167,6 +167,9 @@ + int saw_O = 0; + int saw_g = 0; + ++ /* Saw a `-D' option. */ ++ int saw_D = 0; ++ + /* An array used to flag each argument that needs a bit set for + LANGSPEC, MATHLIB, WITHLIBC, or GCLIB. */ + int *args; +@@ -186,6 +189,9 @@ + /* Non-zero if linking is supposed to happen. */ + int will_link = 1; + ++ /* Non-zero if we want to find the spec file. */ ++ int want_spec_file = 1; ++ + /* The argument we use to specify the spec file. */ + char *spec_file = NULL; + +@@ -224,7 +230,7 @@ + added--; + } + else if (strcmp (argv[i], "-fhelp") == 0) +- will_link = 0; ++ want_spec_file = 0; + else if (strcmp (argv[i], "-v") == 0) + { + saw_verbose_flag = 1; +@@ -240,6 +246,7 @@ + else if (strcmp (argv[i], "-C") == 0) + { + saw_C = 1; ++ want_spec_file = 0; + #if COMBINE_INPUTS + combine_inputs = 1; + #endif +@@ -248,6 +255,8 @@ + library = 0; + will_link = 0; + } ++ else if (argv[i][1] == 'D') ++ saw_D = 1; + else if (argv[i][1] == 'g') + saw_g = 1; + else if (argv[i][1] == 'O') +@@ -288,6 +297,7 @@ + else if (strcmp (argv[i], "-fsyntax-only") == 0 + || strcmp (argv[i], "--syntax-only") == 0) + { ++ want_spec_file = 0; + library = 0; + will_link = 0; + continue; +@@ -331,6 +341,9 @@ + if (quote) + (*fn) ("argument to `%s' missing\n", quote); + ++ if (saw_D && ! main_class_name) ++ fatal ("can't specify `-D' without `--main'\n"); ++ + num_args = argc + added; + if (saw_C) + { +@@ -376,8 +389,7 @@ + } + if (saw_g + saw_O == 0) + num_args++; +- if (will_link) +- num_args++; ++ num_args++; + arglist = (char **) xmalloc ((num_args + 1) * sizeof (char *)); + + for (i = 0, j = 0; i < argc; i++, j++) +@@ -408,7 +420,7 @@ + continue; + } + +- if (will_link && spec_file == NULL && strncmp (argv[i], "-L", 2) == 0) ++ if (spec_file == NULL && strncmp (argv[i], "-L", 2) == 0) + spec_file = find_spec_file (argv[i] + 2); + + if (strncmp (argv[i], "-fmain=", 7) == 0) +@@ -453,10 +465,10 @@ + if (saw_g + saw_O == 0) + arglist[j++] = "-g1"; + +- /* Read the specs file corresponding to libgcj, but only if linking. ++ /* Read the specs file corresponding to libgcj. + If we didn't find the spec file on the -L path, then we hope it + is somewhere in the standard install areas. */ +- if (will_link) ++ if (want_spec_file) + arglist[j++] = spec_file == NULL ? "-specs=libgcj.spec" : spec_file; + + if (saw_C) +Only in gcc-2.95.2/gcc/java: jvspec.c.orig +Only in gcc-2.95.2/gcc/java: jvspec.c.rej +diff -u -r gcc-2.95.2-orig/gcc/java/lang-options.h gcc-2.95.2/gcc/java/lang-options.h +--- gcc-2.95.2-orig/gcc/java/lang-options.h Tue May 11 20:50:13 1999 ++++ gcc-2.95.2/gcc/java/lang-options.h Sat Oct 30 19:45:50 1999 +@@ -43,6 +43,8 @@ + { "-fCLASSPATH", "Set class path" }, + { "-I", "Add directory to class path" }, + { "-foutput-class-dir", "Directory where class files should be written" }, ++ { "-fuse-divide-subroutine", "" }, ++ { "-fno-use-divide-subroutine", "Use built-in instructions for division" }, + { "-Wredundant-modifiers", + "Warn if modifiers are specified when not necessary"}, +- { "-Wunsupported-jdk11", "Warn if `final' local variables are specified"}, ++ { "-Wunsupported-jdk11", "Warn if `final' local variables are specified"}, +Only in gcc-2.95.2/gcc/java: lang-options.h.orig +diff -u -r gcc-2.95.2-orig/gcc/java/lang-specs.h gcc-2.95.2/gcc/java/lang-specs.h +--- gcc-2.95.2-orig/gcc/java/lang-specs.h Mon Feb 1 06:46:51 1999 ++++ gcc-2.95.2/gcc/java/lang-specs.h Sat Oct 30 20:07:34 1999 +@@ -30,7 +30,7 @@ + {".zip", {"@java"} }, + {".jar", {"@java"} }, + {"@java", +- {"%{!E:jc1 %i %1 %{!Q:-quiet} %{d*} %{m*} %{a}\ ++ {"%{!E:jc1 %i %1 %(jc1) %{!Q:-quiet} %{d*} %{m*} %{a}\ + %{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi}\ + %{traditional} %{v:-version} %{pg:-p} %{p}\ + %{f*} %{+e*} %{aux-info*} %{Qn:-fno-ident}\ +Only in gcc-2.95.2/gcc/java: lang-specs.h.orig +Only in gcc-2.95.2/gcc/java: lang-specs.h.rej +diff -u -r gcc-2.95.2-orig/gcc/java/lang.c gcc-2.95.2/gcc/java/lang.c +--- gcc-2.95.2-orig/gcc/java/lang.c Sat May 15 01:44:09 1999 ++++ gcc-2.95.2/gcc/java/lang.c Sat Oct 30 19:45:50 1999 +@@ -105,6 +105,9 @@ + /* When non zero, warns that final local are treated as non final. */ + int flag_static_local_jdk1_1 = 0; + ++/* When non zero, call a library routine to do integer divisions. */ ++int flag_use_divide_subroutine = 1; ++ + /* From gcc/flags.h, and indicates if exceptions are turned on or not. */ + + extern int flag_new_exceptions; +@@ -123,6 +126,7 @@ + {"assume-compiled", &flag_assume_compiled, 1}, + {"emit-class-file", &flag_emit_class_files, 1}, + {"emit-class-files", &flag_emit_class_files, 1}, ++ {"use-divide-subroutine", &flag_use_divide_subroutine, 1}, + }; + + JCF *current_jcf; +Only in gcc-2.95.2/gcc/java: lang.c.orig +diff -u -r gcc-2.95.2-orig/gcc/java/lex.h gcc-2.95.2/gcc/java/lex.h +--- gcc-2.95.2-orig/gcc/java/lex.h Thu May 13 04:52:35 1999 ++++ gcc-2.95.2/gcc/java/lex.h Sun Oct 31 18:48:35 1999 +@@ -123,7 +123,7 @@ + #define SET_MODIFIER_CTX(TOKEN) java_lval->value = (TOKEN) + #define GET_TYPE_PRECISION(NODE) 4 + #define BUILD_OPERATOR(TOKEN) return TOKEN +-#define BUILD_OPERATOR2(TOKEN) return TOKEN ++#define BUILD_OPERATOR2(TOKEN) return ASSIGN_ANY_TK + #define SET_LVAL_NODE(NODE) + #define SET_LVAL_NODE_TYPE(NODE, TYPE) + #define BUILD_ID_WFL(EXP) (EXP) +diff -u -r gcc-2.95.2-orig/gcc/java/parse-scan.c gcc-2.95.2/gcc/java/parse-scan.c +--- gcc-2.95.2-orig/gcc/java/parse-scan.c Mon Oct 25 21:02:09 1999 ++++ gcc-2.95.2/gcc/java/parse-scan.c Sun Oct 31 19:10:26 1999 +@@ -1,117 +1,116 @@ + + /* A Bison parser, made from ./parse-scan.y +- by GNU Bison version 1.25 +- */ ++ by GNU Bison version 1.28 */ + + #define YYBISON 1 /* Identify Bison output. */ + +-#define PLUS_TK 258 +-#define MINUS_TK 259 +-#define MULT_TK 260 +-#define DIV_TK 261 +-#define REM_TK 262 +-#define LS_TK 263 +-#define SRS_TK 264 +-#define ZRS_TK 265 +-#define AND_TK 266 +-#define XOR_TK 267 +-#define OR_TK 268 +-#define BOOL_AND_TK 269 +-#define BOOL_OR_TK 270 +-#define EQ_TK 271 +-#define NEQ_TK 272 +-#define GT_TK 273 +-#define GTE_TK 274 +-#define LT_TK 275 +-#define LTE_TK 276 +-#define PLUS_ASSIGN_TK 277 +-#define MINUS_ASSIGN_TK 278 +-#define MULT_ASSIGN_TK 279 +-#define DIV_ASSIGN_TK 280 +-#define REM_ASSIGN_TK 281 +-#define LS_ASSIGN_TK 282 +-#define SRS_ASSIGN_TK 283 +-#define ZRS_ASSIGN_TK 284 +-#define AND_ASSIGN_TK 285 +-#define XOR_ASSIGN_TK 286 +-#define OR_ASSIGN_TK 287 +-#define PUBLIC_TK 288 +-#define PRIVATE_TK 289 +-#define PROTECTED_TK 290 +-#define STATIC_TK 291 +-#define FINAL_TK 292 +-#define SYNCHRONIZED_TK 293 +-#define VOLATILE_TK 294 +-#define TRANSIENT_TK 295 +-#define NATIVE_TK 296 +-#define PAD_TK 297 +-#define ABSTRACT_TK 298 +-#define MODIFIER_TK 299 +-#define DECR_TK 300 +-#define INCR_TK 301 +-#define DEFAULT_TK 302 +-#define IF_TK 303 +-#define THROW_TK 304 +-#define BOOLEAN_TK 305 +-#define DO_TK 306 +-#define IMPLEMENTS_TK 307 +-#define THROWS_TK 308 +-#define BREAK_TK 309 +-#define IMPORT_TK 310 +-#define ELSE_TK 311 +-#define INSTANCEOF_TK 312 +-#define RETURN_TK 313 +-#define VOID_TK 314 +-#define CATCH_TK 315 +-#define INTERFACE_TK 316 +-#define CASE_TK 317 +-#define EXTENDS_TK 318 +-#define FINALLY_TK 319 +-#define SUPER_TK 320 +-#define WHILE_TK 321 +-#define CLASS_TK 322 +-#define SWITCH_TK 323 +-#define CONST_TK 324 +-#define TRY_TK 325 +-#define FOR_TK 326 +-#define NEW_TK 327 +-#define CONTINUE_TK 328 +-#define GOTO_TK 329 +-#define PACKAGE_TK 330 +-#define THIS_TK 331 +-#define BYTE_TK 332 +-#define SHORT_TK 333 +-#define INT_TK 334 +-#define LONG_TK 335 +-#define CHAR_TK 336 +-#define INTEGRAL_TK 337 +-#define FLOAT_TK 338 +-#define DOUBLE_TK 339 +-#define FP_TK 340 +-#define ID_TK 341 +-#define REL_QM_TK 342 +-#define REL_CL_TK 343 +-#define NOT_TK 344 +-#define NEG_TK 345 +-#define ASSIGN_ANY_TK 346 +-#define ASSIGN_TK 347 +-#define OP_TK 348 +-#define CP_TK 349 +-#define OCB_TK 350 +-#define CCB_TK 351 +-#define OSB_TK 352 +-#define CSB_TK 353 +-#define SC_TK 354 +-#define C_TK 355 +-#define DOT_TK 356 +-#define STRING_LIT_TK 357 +-#define CHAR_LIT_TK 358 +-#define INT_LIT_TK 359 +-#define FP_LIT_TK 360 +-#define TRUE_TK 361 +-#define FALSE_TK 362 +-#define BOOL_LIT_TK 363 +-#define NULL_TK 364 ++#define PLUS_TK 257 ++#define MINUS_TK 258 ++#define MULT_TK 259 ++#define DIV_TK 260 ++#define REM_TK 261 ++#define LS_TK 262 ++#define SRS_TK 263 ++#define ZRS_TK 264 ++#define AND_TK 265 ++#define XOR_TK 266 ++#define OR_TK 267 ++#define BOOL_AND_TK 268 ++#define BOOL_OR_TK 269 ++#define EQ_TK 270 ++#define NEQ_TK 271 ++#define GT_TK 272 ++#define GTE_TK 273 ++#define LT_TK 274 ++#define LTE_TK 275 ++#define PLUS_ASSIGN_TK 276 ++#define MINUS_ASSIGN_TK 277 ++#define MULT_ASSIGN_TK 278 ++#define DIV_ASSIGN_TK 279 ++#define REM_ASSIGN_TK 280 ++#define LS_ASSIGN_TK 281 ++#define SRS_ASSIGN_TK 282 ++#define ZRS_ASSIGN_TK 283 ++#define AND_ASSIGN_TK 284 ++#define XOR_ASSIGN_TK 285 ++#define OR_ASSIGN_TK 286 ++#define PUBLIC_TK 287 ++#define PRIVATE_TK 288 ++#define PROTECTED_TK 289 ++#define STATIC_TK 290 ++#define FINAL_TK 291 ++#define SYNCHRONIZED_TK 292 ++#define VOLATILE_TK 293 ++#define TRANSIENT_TK 294 ++#define NATIVE_TK 295 ++#define PAD_TK 296 ++#define ABSTRACT_TK 297 ++#define MODIFIER_TK 298 ++#define DECR_TK 299 ++#define INCR_TK 300 ++#define DEFAULT_TK 301 ++#define IF_TK 302 ++#define THROW_TK 303 ++#define BOOLEAN_TK 304 ++#define DO_TK 305 ++#define IMPLEMENTS_TK 306 ++#define THROWS_TK 307 ++#define BREAK_TK 308 ++#define IMPORT_TK 309 ++#define ELSE_TK 310 ++#define INSTANCEOF_TK 311 ++#define RETURN_TK 312 ++#define VOID_TK 313 ++#define CATCH_TK 314 ++#define INTERFACE_TK 315 ++#define CASE_TK 316 ++#define EXTENDS_TK 317 ++#define FINALLY_TK 318 ++#define SUPER_TK 319 ++#define WHILE_TK 320 ++#define CLASS_TK 321 ++#define SWITCH_TK 322 ++#define CONST_TK 323 ++#define TRY_TK 324 ++#define FOR_TK 325 ++#define NEW_TK 326 ++#define CONTINUE_TK 327 ++#define GOTO_TK 328 ++#define PACKAGE_TK 329 ++#define THIS_TK 330 ++#define BYTE_TK 331 ++#define SHORT_TK 332 ++#define INT_TK 333 ++#define LONG_TK 334 ++#define CHAR_TK 335 ++#define INTEGRAL_TK 336 ++#define FLOAT_TK 337 ++#define DOUBLE_TK 338 ++#define FP_TK 339 ++#define ID_TK 340 ++#define REL_QM_TK 341 ++#define REL_CL_TK 342 ++#define NOT_TK 343 ++#define NEG_TK 344 ++#define ASSIGN_ANY_TK 345 ++#define ASSIGN_TK 346 ++#define OP_TK 347 ++#define CP_TK 348 ++#define OCB_TK 349 ++#define CCB_TK 350 ++#define OSB_TK 351 ++#define CSB_TK 352 ++#define SC_TK 353 ++#define C_TK 354 ++#define DOT_TK 355 ++#define STRING_LIT_TK 356 ++#define CHAR_LIT_TK 357 ++#define INT_LIT_TK 358 ++#define FP_LIT_TK 359 ++#define TRUE_TK 360 ++#define FALSE_TK 361 ++#define BOOL_LIT_TK 362 ++#define NULL_TK 363 + + #line 37 "./parse-scan.y" + +@@ -200,7 +199,7 @@ + #define YYFLAG -32768 + #define YYNTBASE 110 + +-#define YYTRANSLATE(x) ((unsigned)(x) <= 364 ? yytranslate[x] : 253) ++#define YYTRANSLATE(x) ((unsigned)(x) <= 363 ? yytranslate[x] : 253) + + static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +@@ -228,18 +227,18 @@ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +- 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, +- 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, +- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, +- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, +- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, +- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, +- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, +- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, +- 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, +- 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, +- 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, +- 106, 107, 108, 109 ++ 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, ++ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ++ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, ++ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, ++ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, ++ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, ++ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, ++ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, ++ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, ++ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, ++ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, ++ 107, 108, 109 + }; + + #if YYDEBUG != 0 +@@ -1375,7 +1374,8 @@ + #define YYPURE 1 + + /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +-#line 3 "/usr/cygnus/gnupro-98r2/share/bison.simple" ++#line 3 "/usr/lib/bison.simple" ++/* This file comes from bison-1.28. */ + + /* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. +@@ -1392,46 +1392,66 @@ + + 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. */ ++ Foundation, Inc., 59 Temple Place - Suite 330, ++ Boston, MA 02111-1307, USA. */ + + /* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +-#ifndef alloca ++/* This is the parser code that is written into each bison parser ++ when the %semantic_parser declaration is not specified in the grammar. ++ It was written by Richard Stallman by simplifying the hairy parser ++ used when %semantic_parser is specified. */ ++ ++#ifndef YYSTACK_USE_ALLOCA ++#ifdef alloca ++#define YYSTACK_USE_ALLOCA ++#else /* alloca not defined */ + #ifdef __GNUC__ ++#define YYSTACK_USE_ALLOCA + #define alloca __builtin_alloca + #else /* not GNU C. */ +-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) ++#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) ++#define YYSTACK_USE_ALLOCA + #include + #else /* not sparc */ +-#if defined (MSDOS) && !defined (__TURBOC__) ++/* We think this test detects Watcom and Microsoft C. */ ++/* This used to test MSDOS, but that is a bad idea ++ since that symbol is in the user namespace. */ ++#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) ++#if 0 /* No need for malloc.h, which pollutes the namespace; ++ instead, just don't use alloca. */ + #include ++#endif + #else /* not MSDOS, or __TURBOC__ */ + #if defined(_AIX) +-#include ++/* I don't know what this was needed for, but it pollutes the namespace. ++ So I turned it off. rms, 2 May 1997. */ ++/* #include */ + #pragma alloca +-#else /* not MSDOS, __TURBOC__, or _AIX */ +-#ifdef __hpux +-#ifdef __cplusplus +-extern "C" { +-void *alloca (unsigned int); +-}; +-#else /* not __cplusplus */ +-void *alloca (); +-#endif /* not __cplusplus */ ++#define YYSTACK_USE_ALLOCA ++#else /* not MSDOS, or __TURBOC__, or _AIX */ ++#if 0 ++#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, ++ and on HPUX 10. Eventually we can turn this on. */ ++#define YYSTACK_USE_ALLOCA ++#define alloca __builtin_alloca + #endif /* __hpux */ ++#endif + #endif /* not _AIX */ + #endif /* not MSDOS, or __TURBOC__ */ +-#endif /* not sparc. */ +-#endif /* not GNU C. */ +-#endif /* alloca not defined. */ ++#endif /* not sparc */ ++#endif /* not GNU C */ ++#endif /* alloca not defined */ ++#endif /* YYSTACK_USE_ALLOCA not defined */ + +-/* This is the parser code that is written into each bison parser +- when the %semantic_parser declaration is not specified in the grammar. +- It was written by Richard Stallman by simplifying the hairy parser +- used when %semantic_parser is specified. */ ++#ifdef YYSTACK_USE_ALLOCA ++#define YYSTACK_ALLOC alloca ++#else ++#define YYSTACK_ALLOC malloc ++#endif + + /* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action +@@ -1441,8 +1461,8 @@ + #define yyclearin (yychar = YYEMPTY) + #define YYEMPTY -2 + #define YYEOF 0 +-#define YYACCEPT return(0) +-#define YYABORT return(1) ++#define YYACCEPT goto yyacceptlab ++#define YYABORT goto yyabortlab + #define YYERROR goto yyerrlab1 + /* Like YYERROR except do call yyerror. + This remains here temporarily to ease the +@@ -1523,12 +1543,12 @@ + #ifndef YYMAXDEPTH + #define YYMAXDEPTH 10000 + #endif +- +-/* Prevent warning if -Wstrict-prototypes. */ +-#ifdef __GNUC__ +-int yyparse (void); +-#endif + ++/* Define __yy_memcpy. Note that the size argument ++ should be passed with type unsigned int, because that is what the non-GCC ++ definitions require. With GCC, __builtin_memcpy takes an arg ++ of type size_t, but it can handle unsigned int. */ ++ + #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ + #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) + #else /* not GNU C or C++ */ +@@ -1540,7 +1560,7 @@ + __yy_memcpy (to, from, count) + char *to; + char *from; +- int count; ++ unsigned int count; + { + register char *f = from; + register char *t = to; +@@ -1555,10 +1575,10 @@ + /* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ + static void +-__yy_memcpy (char *to, char *from, int count) ++__yy_memcpy (char *to, char *from, unsigned int count) + { +- register char *f = from; + register char *t = to; ++ register char *f = from; + register int i = count; + + while (i-- > 0) +@@ -1568,7 +1588,7 @@ + #endif + #endif + +-#line 196 "/usr/cygnus/gnupro-98r2/share/bison.simple" ++#line 217 "/usr/lib/bison.simple" + + /* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. +@@ -1589,6 +1609,15 @@ + #define YYPARSE_PARAM_DECL + #endif /* not YYPARSE_PARAM */ + ++/* Prevent warning if -Wstrict-prototypes. */ ++#ifdef __GNUC__ ++#ifdef YYPARSE_PARAM ++int yyparse (void *); ++#else ++int yyparse (void); ++#endif ++#endif ++ + int + yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +@@ -1617,6 +1646,7 @@ + #endif + + int yystacksize = YYINITDEPTH; ++ int yyfree_stacks = 0; + + #ifdef YYPURE + int yychar; +@@ -1701,18 +1731,32 @@ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); ++ if (yyfree_stacks) ++ { ++ free (yyss); ++ free (yyvs); ++#ifdef YYLSP_NEEDED ++ free (yyls); ++#endif ++ } + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; +- yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); +- __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); +- yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); +- __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); ++#ifndef YYSTACK_USE_ALLOCA ++ yyfree_stacks = 1; ++#endif ++ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); ++ __yy_memcpy ((char *)yyss, (char *)yyss1, ++ size * (unsigned int) sizeof (*yyssp)); ++ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); ++ __yy_memcpy ((char *)yyvs, (char *)yyvs1, ++ size * (unsigned int) sizeof (*yyvsp)); + #ifdef YYLSP_NEEDED +- yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); +- __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); ++ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); ++ __yy_memcpy ((char *)yyls, (char *)yyls1, ++ size * (unsigned int) sizeof (*yylsp)); + #endif + #endif /* no yyoverflow */ + +@@ -2156,7 +2200,7 @@ + break;} + } + /* the action file gets copied in in place of this dollarsign */ +-#line 498 "/usr/cygnus/gnupro-98r2/share/bison.simple" ++#line 543 "/usr/lib/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +@@ -2351,6 +2395,30 @@ + + yystate = yyn; + goto yynewstate; ++ ++ yyacceptlab: ++ /* YYACCEPT comes here. */ ++ if (yyfree_stacks) ++ { ++ free (yyss); ++ free (yyvs); ++#ifdef YYLSP_NEEDED ++ free (yyls); ++#endif ++ } ++ return 0; ++ ++ yyabortlab: ++ /* YYABORT comes here. */ ++ if (yyfree_stacks) ++ { ++ free (yyss); ++ free (yyvs); ++#ifdef YYLSP_NEEDED ++ free (yyls); ++#endif ++ } ++ return 1; + } + #line 1105 "./parse-scan.y" + +@@ -2434,6 +2502,8 @@ + yyerror (msg) + char *msg ATTRIBUTE_UNUSED; + { ++ fprintf (stderr, "%s: %d: %s\n", input_filename, lineno, msg); ++ exit (1); + } + + char * +diff -u -r gcc-2.95.2-orig/gcc/java/parse-scan.y gcc-2.95.2/gcc/java/parse-scan.y +--- gcc-2.95.2-orig/gcc/java/parse-scan.y Tue May 4 04:59:16 1999 ++++ gcc-2.95.2/gcc/java/parse-scan.y Sun Oct 31 18:48:35 1999 +@@ -1183,6 +1183,8 @@ + yyerror (msg) + char *msg ATTRIBUTE_UNUSED; + { ++ fprintf (stderr, "%s: %d: %s\n", input_filename, lineno, msg); ++ exit (1); + } + + char * +Only in gcc-2.95.2/gcc/java: parse-scan.y.orig +diff -u -r gcc-2.95.2-orig/gcc/java/parse.c gcc-2.95.2/gcc/java/parse.c +--- gcc-2.95.2-orig/gcc/java/parse.c Mon Oct 25 21:02:09 1999 ++++ gcc-2.95.2/gcc/java/parse.c Sun Oct 31 21:39:17 1999 +@@ -1,7 +1,6 @@ + + /* A Bison parser, made from ./parse.y +- by GNU Bison version 1.27 +- */ ++ by GNU Bison version 1.28 */ + + #define YYBISON 1 /* Identify Bison output. */ + +@@ -167,6 +166,7 @@ + static void parse_warning_context PVPROTO ((tree cl, const char *msg, ...)) + ATTRIBUTE_PRINTF_2; + static void issue_warning_error_from_context PROTO ((tree, const char *msg, va_list)); ++static void parse_ctor_invocation_error PROTO ((void)); + static tree parse_jdk1_1_error PROTO ((char *)); + static void complete_class_report_errors PROTO ((jdep *)); + static int process_imports PROTO ((void)); +@@ -319,6 +319,7 @@ + static tree strip_out_static_field_access_decl PROTO ((tree)); + static jdeplist *reverse_jdep_list PROTO ((struct parser_ctxt *)); + static void static_ref_err PROTO ((tree, tree, tree)); ++static tree java_refold PROTO ((tree)); + + /* Number of error found so far. */ + int java_error_count; +@@ -350,6 +351,10 @@ + binop_lookup [((VALUE) - PLUS_TK)% \ + (sizeof (binop_lookup) / sizeof (binop_lookup[0]))] + ++/* This is the end index for binary operators that can also be used ++ in compound assignements. */ ++#define BINOP_COMPOUND_CANDIDATES 11 ++ + /* Fake WFL used to report error message. It is initialized once if + needed and reused with it's location information is overriden. */ + tree wfl_operator = NULL_TREE; +@@ -376,7 +381,7 @@ + static tree current_static_block = NULL_TREE; + + +-#line 304 "./parse.y" ++#line 310 "./parse.y" + typedef union { + tree node; + int sub_token; +@@ -386,7 +391,7 @@ + } operator; + int value; + } YYSTYPE; +-#line 314 "./parse.y" ++#line 320 "./parse.y" + + #include "lex.c" + #ifndef YYDEBUG +@@ -684,57 +689,57 @@ + + #if YYDEBUG != 0 + static const short yyrline[] = { 0, +- 458, 464, 466, 467, 468, 469, 470, 474, 476, 479, +- 481, 482, 485, 487, 490, 494, 498, 502, 508, 510, +- 512, 514, 519, 521, 524, 528, 533, 538, 540, 541, +- 542, 543, 544, 545, 546, 549, 554, 560, 562, 565, +- 568, 570, 574, 576, 579, 606, 608, 612, 625, 627, +- 631, 638, 643, 645, 655, 660, 675, 679, 682, 685, +- 688, 690, 692, 697, 701, 703, 705, 707, 711, 713, +- 715, 722, 728, 733, 737, 746, 756, 758, 761, 763, +- 764, 765, 769, 771, 773, 774, 776, 781, 784, 794, +- 797, 799, 803, 806, 813, 819, 827, 829, 831, 833, +- 835, 839, 841, 845, 852, 853, 857, 860, 862, 864, +- 866, 868, 870, 872, 874, 881, 884, 886, 895, 897, +- 901, 906, 911, 915, 920, 925, 927, 934, 936, 938, +- 942, 945, 947, 951, 953, 954, 959, 965, 972, 980, +- 987, 990, 993, 997, 1000, 1004, 1013, 1015, 1017, 1021, +- 1023, 1026, 1033, 1041, 1043, 1047, 1054, 1064, 1068, 1071, +- 1074, 1077, 1080, 1083, 1086, 1089, 1091, 1095, 1101, 1106, +- 1108, 1112, 1115, 1119, 1121, 1124, 1126, 1127, 1129, 1133, +- 1137, 1143, 1148, 1151, 1153, 1157, 1163, 1167, 1172, 1181, +- 1185, 1190, 1202, 1204, 1207, 1209, 1211, 1215, 1219, 1222, +- 1226, 1228, 1229, 1230, 1231, 1232, 1236, 1238, 1239, 1240, +- 1241, 1245, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, +- 1255, 1256, 1259, 1264, 1275, 1278, 1282, 1289, 1299, 1305, +- 1311, 1317, 1319, 1325, 1327, 1333, 1335, 1337, 1339, 1341, +- 1345, 1347, 1348, 1349, 1350, 1351, 1352, 1355, 1361, 1363, +- 1365, 1369, 1374, 1379, 1385, 1395, 1401, 1403, 1405, 1412, +- 1415, 1417, 1419, 1423, 1425, 1428, 1432, 1434, 1437, 1444, +- 1450, 1452, 1454, 1458, 1466, 1469, 1471, 1473, 1477, 1482, +- 1491, 1496, 1499, 1506, 1508, 1510, 1514, 1517, 1526, 1533, +- 1535, 1539, 1552, 1554, 1560, 1566, 1570, 1572, 1576, 1579, +- 1581, 1585, 1588, 1590, 1592, 1596, 1599, 1601, 1603, 1607, +- 1610, 1612, 1614, 1618, 1624, 1626, 1630, 1637, 1639, 1641, +- 1643, 1647, 1655, 1658, 1660, 1665, 1669, 1671, 1678, 1686, +- 1703, 1705, 1707, 1711, 1714, 1719, 1721, 1724, 1726, 1728, +- 1730, 1731, 1732, 1733, 1737, 1739, 1741, 1746, 1748, 1750, +- 1752, 1754, 1758, 1761, 1766, 1768, 1773, 1774, 1775, 1776, +- 1777, 1779, 1781, 1783, 1785, 1787, 1791, 1793, 1796, 1802, +- 1807, 1811, 1814, 1816, 1818, 1822, 1824, 1826, 1828, 1832, +- 1835, 1839, 1845, 1847, 1855, 1882, 1884, 1888, 1893, 1900, +- 1904, 1907, 1909, 1920, 1931, 1936, 1945, 1947, 1951, 1954, +- 1956, 1961, 1966, 1971, 1978, 1980, 1981, 1982, 1985, 1990, +- 1995, 1997, 1998, 2000, 2002, 2003, 2005, 2009, 2012, 2016, +- 2019, 2023, 2025, 2027, 2029, 2030, 2032, 2036, 2045, 2047, +- 2049, 2062, 2064, 2070, 2072, 2074, 2078, 2080, 2085, 2090, +- 2095, 2097, 2099, 2103, 2105, 2110, 2115, 2117, 2121, 2123, +- 2128, 2133, 2138, 2140, 2142, 2146, 2148, 2153, 2158, 2163, +- 2168, 2170, 2172, 2174, 2176, 2178, 2182, 2184, 2189, 2194, +- 2196, 2200, 2202, 2207, 2211, 2213, 2218, 2222, 2224, 2229, +- 2233, 2235, 2240, 2244, 2246, 2251, 2255, 2257, 2262, 2268, +- 2270, 2274, 2276, 2279, 2282, 2290, 2292, 2293, 2296, 2298, +- 2301, 2305 ++ 464, 470, 472, 473, 474, 475, 476, 480, 482, 485, ++ 487, 488, 491, 493, 496, 500, 504, 508, 514, 516, ++ 518, 520, 525, 527, 530, 534, 539, 544, 546, 547, ++ 548, 549, 550, 551, 552, 555, 560, 566, 568, 571, ++ 574, 576, 580, 582, 585, 612, 614, 618, 631, 633, ++ 637, 644, 649, 651, 661, 666, 681, 685, 688, 691, ++ 694, 696, 698, 703, 707, 709, 711, 713, 717, 719, ++ 721, 728, 734, 739, 743, 752, 762, 764, 767, 769, ++ 770, 771, 775, 777, 779, 780, 782, 787, 790, 800, ++ 803, 805, 809, 812, 819, 825, 833, 835, 837, 839, ++ 841, 845, 847, 851, 858, 859, 863, 866, 868, 870, ++ 872, 874, 876, 878, 880, 887, 890, 892, 901, 903, ++ 907, 912, 917, 921, 926, 931, 933, 940, 942, 944, ++ 948, 951, 953, 957, 959, 960, 965, 971, 978, 986, ++ 993, 996, 999, 1003, 1006, 1010, 1019, 1021, 1023, 1027, ++ 1029, 1032, 1039, 1047, 1049, 1053, 1060, 1070, 1074, 1077, ++ 1080, 1083, 1086, 1089, 1092, 1095, 1097, 1101, 1107, 1112, ++ 1114, 1118, 1121, 1125, 1127, 1130, 1132, 1133, 1135, 1139, ++ 1143, 1149, 1154, 1157, 1159, 1163, 1169, 1173, 1178, 1187, ++ 1191, 1196, 1208, 1210, 1213, 1215, 1217, 1221, 1225, 1228, ++ 1232, 1234, 1235, 1236, 1237, 1238, 1242, 1244, 1245, 1246, ++ 1247, 1251, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, ++ 1261, 1262, 1265, 1270, 1281, 1284, 1288, 1295, 1305, 1311, ++ 1317, 1323, 1325, 1330, 1332, 1337, 1339, 1341, 1343, 1345, ++ 1349, 1351, 1352, 1353, 1354, 1355, 1356, 1359, 1365, 1367, ++ 1369, 1373, 1378, 1383, 1389, 1399, 1405, 1407, 1409, 1416, ++ 1419, 1421, 1423, 1427, 1429, 1432, 1436, 1438, 1441, 1448, ++ 1454, 1456, 1458, 1462, 1470, 1473, 1475, 1477, 1481, 1486, ++ 1495, 1500, 1503, 1510, 1512, 1514, 1518, 1521, 1530, 1537, ++ 1539, 1543, 1556, 1558, 1564, 1570, 1574, 1576, 1580, 1583, ++ 1585, 1589, 1592, 1594, 1596, 1600, 1603, 1605, 1607, 1611, ++ 1614, 1616, 1618, 1622, 1628, 1630, 1634, 1641, 1643, 1645, ++ 1647, 1651, 1659, 1662, 1664, 1669, 1673, 1675, 1682, 1690, ++ 1707, 1709, 1711, 1715, 1718, 1723, 1725, 1728, 1730, 1732, ++ 1734, 1735, 1736, 1737, 1741, 1743, 1745, 1750, 1752, 1754, ++ 1756, 1758, 1762, 1765, 1770, 1772, 1777, 1778, 1779, 1780, ++ 1781, 1783, 1785, 1787, 1789, 1791, 1795, 1797, 1800, 1806, ++ 1811, 1815, 1818, 1820, 1822, 1826, 1828, 1830, 1832, 1836, ++ 1839, 1843, 1849, 1851, 1859, 1886, 1888, 1892, 1897, 1904, ++ 1908, 1911, 1913, 1924, 1935, 1940, 1949, 1951, 1955, 1958, ++ 1960, 1965, 1970, 1975, 1982, 1984, 1985, 1986, 1989, 1994, ++ 1999, 2001, 2002, 2004, 2006, 2007, 2009, 2013, 2016, 2020, ++ 2023, 2027, 2029, 2031, 2033, 2034, 2036, 2040, 2049, 2051, ++ 2053, 2066, 2068, 2074, 2076, 2078, 2082, 2084, 2089, 2094, ++ 2099, 2101, 2103, 2107, 2109, 2114, 2119, 2121, 2125, 2127, ++ 2132, 2137, 2142, 2144, 2146, 2150, 2152, 2157, 2162, 2167, ++ 2172, 2174, 2176, 2178, 2180, 2182, 2186, 2188, 2193, 2198, ++ 2200, 2204, 2206, 2211, 2215, 2217, 2222, 2226, 2228, 2233, ++ 2237, 2239, 2244, 2248, 2250, 2255, 2259, 2261, 2266, 2272, ++ 2274, 2278, 2280, 2283, 2286, 2294, 2296, 2297, 2300, 2302, ++ 2305, 2309 + }; + #endif + +@@ -2213,7 +2218,7 @@ + + /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ + #line 3 "/usr/lib/bison.simple" +-/* This file comes from bison-1.27. */ ++/* This file comes from bison-1.28. */ + + /* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. +@@ -2426,7 +2431,7 @@ + #endif + #endif + +-#line 216 "/usr/lib/bison.simple" ++#line 217 "/usr/lib/bison.simple" + + /* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. +@@ -2755,66 +2760,66 @@ + switch (yyn) { + + case 1: +-#line 460 "./parse.y" ++#line 466 "./parse.y" + {; + break;} + case 18: +-#line 504 "./parse.y" ++#line 510 "./parse.y" + { + yyval.node = build_java_array_type (yyvsp[-2].node, -1); + CLASS_LOADED_P (yyval.node) = 1; + ; + break;} + case 19: +-#line 509 "./parse.y" ++#line 515 "./parse.y" + { yyval.node = build_unresolved_array_type (yyvsp[-2].node); ; + break;} + case 20: +-#line 511 "./parse.y" ++#line 517 "./parse.y" + { yyval.node = build_unresolved_array_type (yyvsp[-2].node); ; + break;} + case 21: +-#line 513 "./parse.y" ++#line 519 "./parse.y" + {RULE ("']' expected"); RECOVER;; + break;} + case 22: +-#line 515 "./parse.y" ++#line 521 "./parse.y" + {RULE ("']' expected"); RECOVER;; + break;} + case 26: +-#line 530 "./parse.y" ++#line 536 "./parse.y" + { yyval.node = make_qualified_name (yyvsp[-2].node, yyvsp[0].node, yyvsp[-1].operator.location); ; + break;} + case 28: +-#line 539 "./parse.y" ++#line 545 "./parse.y" + {yyval.node = NULL;; + break;} + case 36: +-#line 551 "./parse.y" ++#line 557 "./parse.y" + { + yyval.node = NULL; + ; + break;} + case 37: +-#line 555 "./parse.y" ++#line 561 "./parse.y" + { + yyval.node = NULL; + ; + break;} + case 40: +-#line 567 "./parse.y" ++#line 573 "./parse.y" + { ctxp->package = EXPR_WFL_NODE (yyvsp[-1].node); ; + break;} + case 41: +-#line 569 "./parse.y" ++#line 575 "./parse.y" + {yyerror ("Missing name"); RECOVER;; + break;} + case 42: +-#line 571 "./parse.y" ++#line 577 "./parse.y" + {yyerror ("';' expected"); RECOVER;; + break;} + case 45: +-#line 581 "./parse.y" ++#line 587 "./parse.y" + { + tree name = EXPR_WFL_NODE (yyvsp[-1].node), node, last_name; + int i = IDENTIFIER_LENGTH (name)-1; +@@ -2842,15 +2847,15 @@ + ; + break;} + case 46: +-#line 607 "./parse.y" ++#line 613 "./parse.y" + {yyerror ("Missing name"); RECOVER;; + break;} + case 47: +-#line 609 "./parse.y" ++#line 615 "./parse.y" + {yyerror ("';' expected"); RECOVER;; + break;} + case 48: +-#line 614 "./parse.y" ++#line 620 "./parse.y" + { + tree name = EXPR_WFL_NODE (yyvsp[-3].node); + /* Don't import java.lang.* twice. */ +@@ -2864,15 +2869,15 @@ + ; + break;} + case 49: +-#line 626 "./parse.y" ++#line 632 "./parse.y" + {yyerror ("'*' expected"); RECOVER;; + break;} + case 50: +-#line 628 "./parse.y" ++#line 634 "./parse.y" + {yyerror ("';' expected"); RECOVER;; + break;} + case 51: +-#line 633 "./parse.y" ++#line 639 "./parse.y" + { + maybe_generate_finit (); + maybe_generate_clinit (); +@@ -2880,31 +2885,31 @@ + ; + break;} + case 52: +-#line 639 "./parse.y" ++#line 645 "./parse.y" + { + maybe_generate_clinit (); + yyval.node = yyvsp[0].node; + ; + break;} + case 53: +-#line 644 "./parse.y" ++#line 650 "./parse.y" + { yyval.node = NULL; ; + break;} + case 54: +-#line 646 "./parse.y" ++#line 652 "./parse.y" + { + YYERROR_NOW; + yyerror ("Class or interface declaration expected"); + ; + break;} + case 55: +-#line 657 "./parse.y" ++#line 663 "./parse.y" + { + yyval.value = (1 << yyvsp[0].value); + ; + break;} + case 56: +-#line 661 "./parse.y" ++#line 667 "./parse.y" + { + int acc = (1 << yyvsp[0].value); + if (yyval.value & acc) +@@ -2918,95 +2923,95 @@ + ; + break;} + case 57: +-#line 677 "./parse.y" ++#line 683 "./parse.y" + { create_class (yyvsp[-4].value, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 58: +-#line 679 "./parse.y" ++#line 685 "./parse.y" + { + yyval.node = yyvsp[0].node; + ; + break;} + case 59: +-#line 683 "./parse.y" ++#line 689 "./parse.y" + { create_class (0, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 60: +-#line 685 "./parse.y" ++#line 691 "./parse.y" + { + yyval.node = yyvsp[0].node; + ; + break;} + case 61: +-#line 689 "./parse.y" ++#line 695 "./parse.y" + {yyerror ("Missing class name"); RECOVER;; + break;} + case 62: +-#line 691 "./parse.y" ++#line 697 "./parse.y" + {yyerror ("Missing class name"); RECOVER;; + break;} + case 63: +-#line 693 "./parse.y" ++#line 699 "./parse.y" + { + if (!ctxp->class_err) yyerror ("'{' expected"); + DRECOVER(class1); + ; + break;} + case 64: +-#line 698 "./parse.y" ++#line 704 "./parse.y" + {if (!ctxp->class_err) yyerror ("'{' expected"); RECOVER;; + break;} + case 65: +-#line 702 "./parse.y" ++#line 708 "./parse.y" + { yyval.node = NULL; ; + break;} + case 66: +-#line 704 "./parse.y" ++#line 710 "./parse.y" + { yyval.node = yyvsp[0].node; ; + break;} + case 67: +-#line 706 "./parse.y" ++#line 712 "./parse.y" + {yyerror ("'{' expected"); ctxp->class_err=1;; + break;} + case 68: +-#line 708 "./parse.y" ++#line 714 "./parse.y" + {yyerror ("Missing super class name"); ctxp->class_err=1;; + break;} + case 69: +-#line 712 "./parse.y" ++#line 718 "./parse.y" + { yyval.node = NULL_TREE; ; + break;} + case 70: +-#line 714 "./parse.y" ++#line 720 "./parse.y" + { yyval.node = yyvsp[0].node; ; + break;} + case 71: +-#line 716 "./parse.y" ++#line 722 "./parse.y" + { + ctxp->class_err=1; + yyerror ("Missing interface name"); + ; + break;} + case 72: +-#line 724 "./parse.y" ++#line 730 "./parse.y" + { + ctxp->interface_number = 1; + yyval.node = build_tree_list (yyvsp[0].node, NULL_TREE); + ; + break;} + case 73: +-#line 729 "./parse.y" ++#line 735 "./parse.y" + { + ctxp->interface_number++; + yyval.node = chainon (yyvsp[-2].node, build_tree_list (yyvsp[0].node, NULL_TREE)); + ; + break;} + case 74: +-#line 734 "./parse.y" ++#line 740 "./parse.y" + {yyerror ("Missing interface name"); RECOVER;; + break;} + case 75: +-#line 739 "./parse.y" ++#line 745 "./parse.y" + { + /* Store the location of the `}' when doing xrefs */ + if (flag_emit_xref) +@@ -3016,7 +3021,7 @@ + ; + break;} + case 76: +-#line 747 "./parse.y" ++#line 753 "./parse.y" + { + /* Store the location of the `}' when doing xrefs */ + if (flag_emit_xref) +@@ -3026,27 +3031,27 @@ + ; + break;} + case 82: +-#line 766 "./parse.y" ++#line 772 "./parse.y" + { yyval.node = parse_jdk1_1_error ("instance initializer"); ; + break;} + case 84: +-#line 772 "./parse.y" ++#line 778 "./parse.y" + { yyval.node = yyvsp[-1].node; ; + break;} + case 86: +-#line 775 "./parse.y" ++#line 781 "./parse.y" + { yyval.node = parse_jdk1_1_error ("inner classe declaration"); ; + break;} + case 87: +-#line 777 "./parse.y" ++#line 783 "./parse.y" + { yyval.node = parse_jdk1_1_error ("inner interface declaration"); ; + break;} + case 88: +-#line 783 "./parse.y" ++#line 789 "./parse.y" + { register_fields (0, yyvsp[-2].node, yyvsp[-1].node); ; + break;} + case 89: +-#line 785 "./parse.y" ++#line 791 "./parse.y" + { + check_modifiers + ("Illegal modifier `%s' for field declaration", +@@ -3056,19 +3061,19 @@ + ; + break;} + case 91: +-#line 798 "./parse.y" ++#line 804 "./parse.y" + { yyval.node = chainon (yyvsp[-2].node, yyvsp[0].node); ; + break;} + case 92: +-#line 800 "./parse.y" ++#line 806 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 93: +-#line 805 "./parse.y" ++#line 811 "./parse.y" + { yyval.node = build_tree_list (yyvsp[0].node, NULL_TREE); ; + break;} + case 94: +-#line 807 "./parse.y" ++#line 813 "./parse.y" + { + if (java_error_count) + yyvsp[0].node = NULL_TREE; +@@ -3077,7 +3082,7 @@ + ; + break;} + case 95: +-#line 814 "./parse.y" ++#line 820 "./parse.y" + { + yyerror ("Missing variable initializer"); + yyval.node = build_tree_list (yyvsp[-2].node, NULL_TREE); +@@ -3085,7 +3090,7 @@ + ; + break;} + case 96: +-#line 820 "./parse.y" ++#line 826 "./parse.y" + { + yyerror ("';' expected"); + yyval.node = build_tree_list (yyvsp[-3].node, NULL_TREE); +@@ -3093,85 +3098,85 @@ + ; + break;} + case 98: +-#line 830 "./parse.y" ++#line 836 "./parse.y" + { yyval.node = build_unresolved_array_type (yyvsp[-2].node); ; + break;} + case 99: +-#line 832 "./parse.y" ++#line 838 "./parse.y" + {yyerror ("Invalid declaration"); DRECOVER(vdi);; + break;} + case 100: +-#line 834 "./parse.y" ++#line 840 "./parse.y" + {yyerror ("']' expected"); DRECOVER(vdi);; + break;} + case 101: +-#line 836 "./parse.y" ++#line 842 "./parse.y" + {yyerror ("Unbalanced ']'"); DRECOVER(vdi);; + break;} + case 104: +-#line 847 "./parse.y" ++#line 853 "./parse.y" + { + current_function_decl = yyvsp[0].node; + source_start_java_method (current_function_decl); + ; + break;} + case 105: +-#line 852 "./parse.y" ++#line 858 "./parse.y" + { finish_method_declaration (yyvsp[0].node); ; + break;} + case 106: +-#line 854 "./parse.y" ++#line 860 "./parse.y" + {YYNOT_TWICE yyerror ("'{' expected"); RECOVER;; + break;} + case 107: +-#line 859 "./parse.y" ++#line 865 "./parse.y" + { yyval.node = method_header (0, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 108: +-#line 861 "./parse.y" ++#line 867 "./parse.y" + { yyval.node = method_header (0, void_type_node, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 109: +-#line 863 "./parse.y" ++#line 869 "./parse.y" + { yyval.node = method_header (yyvsp[-3].value, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 110: +-#line 865 "./parse.y" ++#line 871 "./parse.y" + { yyval.node = method_header (yyvsp[-3].value, void_type_node, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 111: +-#line 867 "./parse.y" ++#line 873 "./parse.y" + {RECOVER;; + break;} + case 112: +-#line 869 "./parse.y" ++#line 875 "./parse.y" + {RECOVER;; + break;} + case 113: +-#line 871 "./parse.y" ++#line 877 "./parse.y" + {yyerror ("Identifier expected"); RECOVER;; + break;} + case 114: +-#line 873 "./parse.y" ++#line 879 "./parse.y" + {yyerror ("Identifier expected"); RECOVER;; + break;} + case 115: +-#line 875 "./parse.y" ++#line 881 "./parse.y" + { + yyerror ("Invalid method declaration, return type required"); + RECOVER; + ; + break;} + case 116: +-#line 883 "./parse.y" ++#line 889 "./parse.y" + { yyval.node = method_declarator (yyvsp[-2].node, NULL_TREE); ; + break;} + case 117: +-#line 885 "./parse.y" ++#line 891 "./parse.y" + { yyval.node = method_declarator (yyvsp[-3].node, yyvsp[-1].node); ; + break;} + case 118: +-#line 887 "./parse.y" ++#line 893 "./parse.y" + { + EXPR_WFL_LINECOL (wfl_operator) = yyvsp[-1].operator.location; + TREE_PURPOSE (yyvsp[-2].node) = +@@ -3182,150 +3187,150 @@ + ; + break;} + case 119: +-#line 896 "./parse.y" ++#line 902 "./parse.y" + {yyerror ("')' expected"); DRECOVER(method_declarator);; + break;} + case 120: +-#line 898 "./parse.y" ++#line 904 "./parse.y" + {yyerror ("']' expected"); RECOVER;; + break;} + case 121: +-#line 903 "./parse.y" ++#line 909 "./parse.y" + { + ctxp->formal_parameter_number = 1; + ; + break;} + case 122: +-#line 907 "./parse.y" ++#line 913 "./parse.y" + { + ctxp->formal_parameter_number += 1; + yyval.node = chainon (yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 123: +-#line 912 "./parse.y" ++#line 918 "./parse.y" + {yyerror ("Missing formal parameter term"); RECOVER;; + break;} + case 124: +-#line 917 "./parse.y" ++#line 923 "./parse.y" + { + yyval.node = build_tree_list (yyvsp[0].node, yyvsp[-1].node); + ; + break;} + case 125: +-#line 921 "./parse.y" ++#line 927 "./parse.y" + { + parse_jdk1_1_error ("final parameters"); + yyval.node = build_tree_list (yyvsp[0].node, yyvsp[-1].node); + ; + break;} + case 126: +-#line 926 "./parse.y" ++#line 932 "./parse.y" + {yyerror ("Missing identifier"); RECOVER;; + break;} + case 127: +-#line 928 "./parse.y" ++#line 934 "./parse.y" + { + SOURCE_FRONTEND_DEBUG (("Modifiers: %d", yyvsp[-2].value)); + yyerror ("Missing identifier"); RECOVER; + ; + break;} + case 128: +-#line 935 "./parse.y" ++#line 941 "./parse.y" + { yyval.node = NULL_TREE; ; + break;} + case 129: +-#line 937 "./parse.y" ++#line 943 "./parse.y" + { yyval.node = yyvsp[0].node; ; + break;} + case 130: +-#line 939 "./parse.y" ++#line 945 "./parse.y" + {yyerror ("Missing class type term"); RECOVER;; + break;} + case 131: +-#line 944 "./parse.y" ++#line 950 "./parse.y" + { yyval.node = build_tree_list (yyvsp[0].node, yyvsp[0].node); ; + break;} + case 132: +-#line 946 "./parse.y" ++#line 952 "./parse.y" + { yyval.node = tree_cons (yyvsp[0].node, yyvsp[0].node, yyvsp[-2].node); ; + break;} + case 133: +-#line 948 "./parse.y" ++#line 954 "./parse.y" + {yyerror ("Missing class type term"); RECOVER;; + break;} + case 136: +-#line 955 "./parse.y" ++#line 961 "./parse.y" + { yyval.node = NULL_TREE; ; + break;} + case 137: +-#line 961 "./parse.y" ++#line 967 "./parse.y" + { + TREE_CHAIN (yyvsp[0].node) = ctxp->static_initialized; + ctxp->static_initialized = yyvsp[0].node; + ; + break;} + case 138: +-#line 966 "./parse.y" ++#line 972 "./parse.y" + { + TREE_CHAIN (yyvsp[-1].node) = ctxp->static_initialized; + ctxp->static_initialized = yyvsp[-1].node; + ; + break;} + case 139: +-#line 974 "./parse.y" ++#line 980 "./parse.y" + { + SOURCE_FRONTEND_DEBUG (("Modifiers: %d", yyvsp[0].value)); + ; + break;} + case 140: +-#line 982 "./parse.y" ++#line 988 "./parse.y" + { + current_function_decl = yyvsp[0].node; + source_start_java_method (current_function_decl); + ; + break;} + case 141: +-#line 987 "./parse.y" ++#line 993 "./parse.y" + { finish_method_declaration (yyvsp[0].node); ; + break;} + case 142: +-#line 992 "./parse.y" ++#line 998 "./parse.y" + { yyval.node = method_header (0, NULL_TREE, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 143: +-#line 994 "./parse.y" ++#line 1000 "./parse.y" + { yyval.node = method_header (yyvsp[-2].value, NULL_TREE, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 144: +-#line 999 "./parse.y" ++#line 1005 "./parse.y" + { yyval.node = method_declarator (yyvsp[-2].node, NULL_TREE); ; + break;} + case 145: +-#line 1001 "./parse.y" ++#line 1007 "./parse.y" + { yyval.node = method_declarator (yyvsp[-3].node, yyvsp[-1].node); ; + break;} + case 146: +-#line 1009 "./parse.y" ++#line 1015 "./parse.y" + { + BLOCK_EXPR_BODY (yyvsp[0].node) = empty_stmt_node; + yyval.node = yyvsp[0].node; + ; + break;} + case 147: +-#line 1014 "./parse.y" ++#line 1020 "./parse.y" + { yyval.node = yyvsp[0].node; ; + break;} + case 148: +-#line 1016 "./parse.y" ++#line 1022 "./parse.y" + { yyval.node = yyvsp[0].node; ; + break;} + case 149: +-#line 1018 "./parse.y" ++#line 1024 "./parse.y" + { yyval.node = yyvsp[0].node; ; + break;} + case 152: +-#line 1028 "./parse.y" ++#line 1034 "./parse.y" + { + yyval.node = build_method_invocation (yyvsp[-3].node, NULL_TREE); + yyval.node = build_debugable_stmt (EXPR_WFL_LINECOL (yyvsp[-3].node), yyval.node); +@@ -3333,7 +3338,7 @@ + ; + break;} + case 153: +-#line 1034 "./parse.y" ++#line 1040 "./parse.y" + { + yyval.node = build_method_invocation (yyvsp[-4].node, yyvsp[-2].node); + yyval.node = build_debugable_stmt (EXPR_WFL_LINECOL (yyvsp[-4].node), yyval.node); +@@ -3341,15 +3346,15 @@ + ; + break;} + case 154: +-#line 1042 "./parse.y" ++#line 1048 "./parse.y" + {yyval.node = parse_jdk1_1_error ("explicit constructor invocation"); ; + break;} + case 155: +-#line 1044 "./parse.y" ++#line 1050 "./parse.y" + {yyval.node = parse_jdk1_1_error ("explicit constructor invocation"); ; + break;} + case 156: +-#line 1049 "./parse.y" ++#line 1055 "./parse.y" + { + tree wfl = build_wfl_node (this_identifier_node); + EXPR_WFL_LINECOL (wfl) = yyvsp[0].operator.location; +@@ -3357,7 +3362,7 @@ + ; + break;} + case 157: +-#line 1055 "./parse.y" ++#line 1061 "./parse.y" + { + tree wfl = build_wfl_node (super_identifier_node); + EXPR_WFL_LINECOL (wfl) = yyvsp[0].operator.location; +@@ -3365,133 +3370,133 @@ + ; + break;} + case 158: +-#line 1066 "./parse.y" ++#line 1072 "./parse.y" + { create_interface (0, yyvsp[0].node, NULL_TREE); ; + break;} + case 159: +-#line 1068 "./parse.y" ++#line 1074 "./parse.y" + { + yyval.node = yyvsp[0].node; + ; + break;} + case 160: +-#line 1072 "./parse.y" ++#line 1078 "./parse.y" + { create_interface (yyvsp[-2].value, yyvsp[0].node, NULL_TREE); ; + break;} + case 161: +-#line 1074 "./parse.y" ++#line 1080 "./parse.y" + { + yyval.node = yyvsp[0].node; + ; + break;} + case 162: +-#line 1078 "./parse.y" ++#line 1084 "./parse.y" + { create_interface (0, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 163: +-#line 1080 "./parse.y" ++#line 1086 "./parse.y" + { + yyval.node = yyvsp[0].node; + ; + break;} + case 164: +-#line 1084 "./parse.y" ++#line 1090 "./parse.y" + { create_interface (yyvsp[-3].value, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 165: +-#line 1086 "./parse.y" ++#line 1092 "./parse.y" + { + yyval.node = yyvsp[0].node; + ; + break;} + case 166: +-#line 1090 "./parse.y" ++#line 1096 "./parse.y" + {yyerror ("'{' expected"); RECOVER;; + break;} + case 167: +-#line 1092 "./parse.y" ++#line 1098 "./parse.y" + {yyerror ("'{' expected"); RECOVER;; + break;} + case 168: +-#line 1097 "./parse.y" ++#line 1103 "./parse.y" + { + ctxp->interface_number = 1; + yyval.node = build_tree_list (yyvsp[0].node, NULL_TREE); + ; + break;} + case 169: +-#line 1102 "./parse.y" ++#line 1108 "./parse.y" + { + ctxp->interface_number++; + yyval.node = chainon (yyvsp[-2].node, build_tree_list (yyvsp[0].node, NULL_TREE)); + ; + break;} + case 170: +-#line 1107 "./parse.y" ++#line 1113 "./parse.y" + {yyerror ("Invalid interface type"); RECOVER;; + break;} + case 171: +-#line 1109 "./parse.y" ++#line 1115 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 172: +-#line 1114 "./parse.y" ++#line 1120 "./parse.y" + { yyval.node = NULL_TREE; ; + break;} + case 173: +-#line 1116 "./parse.y" ++#line 1122 "./parse.y" + { yyval.node = NULL_TREE; ; + break;} + case 178: +-#line 1128 "./parse.y" ++#line 1134 "./parse.y" + { yyval.node = parse_jdk1_1_error ("inner class declaration"); ; + break;} + case 179: +-#line 1130 "./parse.y" ++#line 1136 "./parse.y" + { yyval.node = parse_jdk1_1_error ("inner interface declaration"); ; + break;} + case 181: +-#line 1139 "./parse.y" ++#line 1145 "./parse.y" + { + check_abstract_method_header (yyvsp[-1].node); + current_function_decl = NULL_TREE; /* FIXME ? */ + ; + break;} + case 182: +-#line 1144 "./parse.y" ++#line 1150 "./parse.y" + {yyerror ("';' expected"); RECOVER;; + break;} + case 183: +-#line 1150 "./parse.y" ++#line 1156 "./parse.y" + { yyval.node = build_new_array_init (yyvsp[-1].operator.location, NULL_TREE); ; + break;} + case 184: +-#line 1152 "./parse.y" ++#line 1158 "./parse.y" + { yyval.node = build_new_array_init (yyvsp[-2].operator.location, yyvsp[-1].node); ; + break;} + case 185: +-#line 1154 "./parse.y" ++#line 1160 "./parse.y" + { yyval.node = build_new_array_init (yyvsp[-3].operator.location, yyvsp[-2].node); ; + break;} + case 186: +-#line 1159 "./parse.y" ++#line 1165 "./parse.y" + { + yyval.node = tree_cons (maybe_build_array_element_wfl (yyvsp[0].node), + yyvsp[0].node, NULL_TREE); + ; + break;} + case 187: +-#line 1164 "./parse.y" ++#line 1170 "./parse.y" + { + yyval.node = tree_cons (maybe_build_array_element_wfl (yyvsp[0].node), yyvsp[0].node, yyvsp[-2].node); + ; + break;} + case 188: +-#line 1168 "./parse.y" ++#line 1174 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 189: +-#line 1174 "./parse.y" ++#line 1180 "./parse.y" + { + /* Store the location of the `}' when doing xrefs */ + if (current_function_decl && flag_emit_xref) +@@ -3501,15 +3506,15 @@ + ; + break;} + case 190: +-#line 1182 "./parse.y" ++#line 1188 "./parse.y" + { yyval.node = yyvsp[0].node; ; + break;} + case 191: +-#line 1187 "./parse.y" ++#line 1193 "./parse.y" + { enter_block (); ; + break;} + case 192: +-#line 1192 "./parse.y" ++#line 1198 "./parse.y" + { + maybe_absorb_scoping_blocks (); + /* Store the location of the `}' when doing xrefs */ +@@ -3520,35 +3525,35 @@ + ; + break;} + case 196: +-#line 1210 "./parse.y" ++#line 1216 "./parse.y" + { java_method_add_stmt (current_function_decl, yyvsp[0].node); ; + break;} + case 197: +-#line 1212 "./parse.y" ++#line 1218 "./parse.y" + { parse_jdk1_1_error ("inner class declaration"); ; + break;} + case 199: +-#line 1221 "./parse.y" ++#line 1227 "./parse.y" + { declare_local_variables (0, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 200: +-#line 1223 "./parse.y" ++#line 1229 "./parse.y" + { declare_local_variables (yyvsp[-2].value, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 206: +-#line 1233 "./parse.y" ++#line 1239 "./parse.y" + { yyval.node = exit_block (); ; + break;} + case 211: +-#line 1242 "./parse.y" ++#line 1248 "./parse.y" + { yyval.node = exit_block (); ; + break;} + case 223: +-#line 1261 "./parse.y" ++#line 1267 "./parse.y" + { yyval.node = empty_stmt_node; ; + break;} + case 224: +-#line 1266 "./parse.y" ++#line 1272 "./parse.y" + { + yyval.node = build_labeled_block (EXPR_WFL_LINECOL (yyvsp[-1].node), + EXPR_WFL_NODE (yyvsp[-1].node)); +@@ -3558,19 +3563,19 @@ + ; + break;} + case 225: +-#line 1277 "./parse.y" ++#line 1283 "./parse.y" + { yyval.node = finish_labeled_statement (yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 226: +-#line 1279 "./parse.y" ++#line 1285 "./parse.y" + {yyerror ("':' expected"); RECOVER;; + break;} + case 227: +-#line 1284 "./parse.y" ++#line 1290 "./parse.y" + { yyval.node = finish_labeled_statement (yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 228: +-#line 1291 "./parse.y" ++#line 1297 "./parse.y" + { + /* We have a statement. Generate a WFL around it so + we can debug it */ +@@ -3581,7 +3586,7 @@ + ; + break;} + case 229: +-#line 1300 "./parse.y" ++#line 1306 "./parse.y" + { + if (ctxp->prevent_ese != lineno) + yyerror ("Invalid expression statement"); +@@ -3589,7 +3594,7 @@ + ; + break;} + case 230: +-#line 1306 "./parse.y" ++#line 1312 "./parse.y" + { + if (ctxp->prevent_ese != lineno) + yyerror ("Invalid expression statement"); +@@ -3597,7 +3602,7 @@ + ; + break;} + case 231: +-#line 1312 "./parse.y" ++#line 1318 "./parse.y" + { + if (ctxp->prevent_ese != lineno) + yyerror ("Invalid expression statement"); +@@ -3605,84 +3610,82 @@ + ; + break;} + case 232: +-#line 1318 "./parse.y" ++#line 1324 "./parse.y" + {yyerror ("')' expected"); RECOVER;; + break;} + case 233: +-#line 1320 "./parse.y" ++#line 1326 "./parse.y" + { +- yyerror ("Constructor invocation must be first " +- "thing in a constructor"); ++ parse_ctor_invocation_error (); + RECOVER; + ; + break;} + case 234: +-#line 1326 "./parse.y" ++#line 1331 "./parse.y" + {yyerror ("')' expected"); RECOVER;; + break;} + case 235: +-#line 1328 "./parse.y" ++#line 1333 "./parse.y" + { +- yyerror ("Constructor invocation must be first " +- "thing in a constructor"); ++ parse_ctor_invocation_error (); + RECOVER; + ; + break;} + case 236: +-#line 1334 "./parse.y" ++#line 1338 "./parse.y" + {yyerror ("'(' expected"); RECOVER;; + break;} + case 237: +-#line 1336 "./parse.y" ++#line 1340 "./parse.y" + {yyerror ("')' expected"); RECOVER;; + break;} + case 238: +-#line 1338 "./parse.y" ++#line 1342 "./parse.y" + {yyerror ("')' expected"); RECOVER;; + break;} + case 239: +-#line 1340 "./parse.y" ++#line 1344 "./parse.y" + {yyerror ("';' expected"); RECOVER;; + break;} + case 240: +-#line 1342 "./parse.y" ++#line 1346 "./parse.y" + {yyerror ("';' expected"); RECOVER;; + break;} + case 248: +-#line 1357 "./parse.y" ++#line 1361 "./parse.y" + { + yyval.node = build_if_else_statement (yyvsp[-3].operator.location, yyvsp[-2].node, + yyvsp[0].node, NULL_TREE); + ; + break;} + case 249: +-#line 1362 "./parse.y" ++#line 1366 "./parse.y" + {yyerror ("'(' expected"); RECOVER;; + break;} + case 250: +-#line 1364 "./parse.y" ++#line 1368 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 251: +-#line 1366 "./parse.y" ++#line 1370 "./parse.y" + {yyerror ("')' expected"); RECOVER;; + break;} + case 252: +-#line 1371 "./parse.y" ++#line 1375 "./parse.y" + { yyval.node = build_if_else_statement (yyvsp[-5].operator.location, yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ; + break;} + case 253: +-#line 1376 "./parse.y" ++#line 1380 "./parse.y" + { yyval.node = build_if_else_statement (yyvsp[-5].operator.location, yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ; + break;} + case 254: +-#line 1381 "./parse.y" ++#line 1385 "./parse.y" + { + enter_block (); + ; + break;} + case 255: +-#line 1385 "./parse.y" ++#line 1389 "./parse.y" + { + /* Make into "proper list" of COMPOUND_EXPRs. + I.e. make the last statment also have its own +@@ -3693,42 +3696,42 @@ + ; + break;} + case 256: +-#line 1397 "./parse.y" ++#line 1401 "./parse.y" + { + yyval.node = build (SWITCH_EXPR, NULL_TREE, yyvsp[-1].node, NULL_TREE); + EXPR_WFL_LINECOL (yyval.node) = yyvsp[-2].operator.location; + ; + break;} + case 257: +-#line 1402 "./parse.y" ++#line 1406 "./parse.y" + {yyerror ("'(' expected"); RECOVER;; + break;} + case 258: +-#line 1404 "./parse.y" ++#line 1408 "./parse.y" + {yyerror ("Missing term or ')'"); DRECOVER(switch_statement);; + break;} + case 259: +-#line 1406 "./parse.y" ++#line 1410 "./parse.y" + {yyerror ("'{' expected"); RECOVER;; + break;} + case 260: +-#line 1414 "./parse.y" ++#line 1418 "./parse.y" + { yyval.node = NULL_TREE; ; + break;} + case 261: +-#line 1416 "./parse.y" ++#line 1420 "./parse.y" + { yyval.node = NULL_TREE; ; + break;} + case 262: +-#line 1418 "./parse.y" ++#line 1422 "./parse.y" + { yyval.node = NULL_TREE; ; + break;} + case 263: +-#line 1420 "./parse.y" ++#line 1424 "./parse.y" + { yyval.node = NULL_TREE; ; + break;} + case 269: +-#line 1439 "./parse.y" ++#line 1443 "./parse.y" + { + tree lab = build1 (CASE_EXPR, NULL_TREE, yyvsp[-1].node); + EXPR_WFL_LINECOL (lab) = yyvsp[-2].operator.location; +@@ -3736,7 +3739,7 @@ + ; + break;} + case 270: +-#line 1445 "./parse.y" ++#line 1449 "./parse.y" + { + tree lab = build1 (DEFAULT_EXPR, NULL_TREE, NULL_TREE); + EXPR_WFL_LINECOL (lab) = yyvsp[-1].operator.location; +@@ -3744,61 +3747,61 @@ + ; + break;} + case 271: +-#line 1451 "./parse.y" ++#line 1455 "./parse.y" + {yyerror ("Missing or invalid constant expression"); RECOVER;; + break;} + case 272: +-#line 1453 "./parse.y" ++#line 1457 "./parse.y" + {yyerror ("':' expected"); RECOVER;; + break;} + case 273: +-#line 1455 "./parse.y" ++#line 1459 "./parse.y" + {yyerror ("':' expected"); RECOVER;; + break;} + case 274: +-#line 1460 "./parse.y" ++#line 1464 "./parse.y" + { + tree body = build_loop_body (yyvsp[-2].operator.location, yyvsp[-1].node, 0); + yyval.node = build_new_loop (body); + ; + break;} + case 275: +-#line 1468 "./parse.y" ++#line 1472 "./parse.y" + { yyval.node = finish_loop_body (0, NULL_TREE, yyvsp[0].node, 0); ; + break;} + case 276: +-#line 1470 "./parse.y" ++#line 1474 "./parse.y" + {YYERROR_NOW; yyerror ("'(' expected"); RECOVER;; + break;} + case 277: +-#line 1472 "./parse.y" ++#line 1476 "./parse.y" + {yyerror ("Missing term and ')' expected"); RECOVER;; + break;} + case 278: +-#line 1474 "./parse.y" ++#line 1478 "./parse.y" + {yyerror ("')' expected"); RECOVER;; + break;} + case 279: +-#line 1479 "./parse.y" ++#line 1483 "./parse.y" + { yyval.node = finish_loop_body (0, NULL_TREE, yyvsp[0].node, 0); ; + break;} + case 280: +-#line 1484 "./parse.y" ++#line 1488 "./parse.y" + { + tree body = build_loop_body (0, NULL_TREE, 1); + yyval.node = build_new_loop (body); + ; + break;} + case 281: +-#line 1493 "./parse.y" ++#line 1497 "./parse.y" + { yyval.node = finish_loop_body (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[-5].node, 1); ; + break;} + case 282: +-#line 1498 "./parse.y" ++#line 1502 "./parse.y" + { yyval.node = finish_for_loop (EXPR_WFL_LINECOL (yyvsp[-4].node), yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ; + break;} + case 283: +-#line 1500 "./parse.y" ++#line 1504 "./parse.y" + { + yyval.node = finish_for_loop (0, NULL_TREE, yyvsp[-2].node, yyvsp[0].node); + /* We have not condition, so we get rid of the EXIT_EXPR */ +@@ -3807,23 +3810,23 @@ + ; + break;} + case 284: +-#line 1507 "./parse.y" ++#line 1511 "./parse.y" + {yyerror ("Invalid control expression"); RECOVER;; + break;} + case 285: +-#line 1509 "./parse.y" ++#line 1513 "./parse.y" + {yyerror ("Invalid update expression"); RECOVER;; + break;} + case 286: +-#line 1511 "./parse.y" ++#line 1515 "./parse.y" + {yyerror ("Invalid update expression"); RECOVER;; + break;} + case 287: +-#line 1516 "./parse.y" ++#line 1520 "./parse.y" + { yyval.node = finish_for_loop (EXPR_WFL_LINECOL (yyvsp[-4].node), yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node);; + break;} + case 288: +-#line 1518 "./parse.y" ++#line 1522 "./parse.y" + { + yyval.node = finish_for_loop (0, NULL_TREE, yyvsp[-2].node, yyvsp[0].node); + /* We have not condition, so we get rid of the EXIT_EXPR */ +@@ -3832,7 +3835,7 @@ + ; + break;} + case 289: +-#line 1528 "./parse.y" ++#line 1532 "./parse.y" + { + /* This scope defined for local variable that may be + defined within the scope of the for loop */ +@@ -3840,15 +3843,15 @@ + ; + break;} + case 290: +-#line 1534 "./parse.y" ++#line 1538 "./parse.y" + {yyerror ("'(' expected"); DRECOVER(for_1);; + break;} + case 291: +-#line 1536 "./parse.y" ++#line 1540 "./parse.y" + {yyerror ("Invalid init statement"); RECOVER;; + break;} + case 292: +-#line 1541 "./parse.y" ++#line 1545 "./parse.y" + { + /* We now declare the loop body. The loop is + declared as a for loop. */ +@@ -3861,11 +3864,11 @@ + ; + break;} + case 293: +-#line 1553 "./parse.y" ++#line 1557 "./parse.y" + { yyval.node = empty_stmt_node; ; + break;} + case 294: +-#line 1555 "./parse.y" ++#line 1559 "./parse.y" + { + /* Init statement recorded within the previously + defined block scope */ +@@ -3873,7 +3876,7 @@ + ; + break;} + case 295: +-#line 1561 "./parse.y" ++#line 1565 "./parse.y" + { + /* Local variable are recorded within the previously + defined block scope */ +@@ -3881,94 +3884,94 @@ + ; + break;} + case 296: +-#line 1567 "./parse.y" ++#line 1571 "./parse.y" + {yyerror ("';' expected"); DRECOVER(for_init_1);; + break;} + case 297: +-#line 1571 "./parse.y" ++#line 1575 "./parse.y" + {yyval.node = empty_stmt_node;; + break;} + case 298: +-#line 1573 "./parse.y" ++#line 1577 "./parse.y" + { yyval.node = build_debugable_stmt (BUILD_LOCATION (), yyvsp[0].node); ; + break;} + case 299: +-#line 1578 "./parse.y" ++#line 1582 "./parse.y" + { yyval.node = add_stmt_to_compound (NULL_TREE, NULL_TREE, yyvsp[0].node); ; + break;} + case 300: +-#line 1580 "./parse.y" ++#line 1584 "./parse.y" + { yyval.node = add_stmt_to_compound (yyvsp[-2].node, NULL_TREE, yyvsp[0].node); ; + break;} + case 301: +-#line 1582 "./parse.y" ++#line 1586 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 302: +-#line 1587 "./parse.y" ++#line 1591 "./parse.y" + { yyval.node = build_bc_statement (yyvsp[-1].operator.location, 1, NULL_TREE); ; + break;} + case 303: +-#line 1589 "./parse.y" ++#line 1593 "./parse.y" + { yyval.node = build_bc_statement (yyvsp[-2].operator.location, 1, yyvsp[-1].node); ; + break;} + case 304: +-#line 1591 "./parse.y" ++#line 1595 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 305: +-#line 1593 "./parse.y" ++#line 1597 "./parse.y" + {yyerror ("';' expected"); RECOVER;; + break;} + case 306: +-#line 1598 "./parse.y" ++#line 1602 "./parse.y" + { yyval.node = build_bc_statement (yyvsp[-1].operator.location, 0, NULL_TREE); ; + break;} + case 307: +-#line 1600 "./parse.y" ++#line 1604 "./parse.y" + { yyval.node = build_bc_statement (yyvsp[-2].operator.location, 0, yyvsp[-1].node); ; + break;} + case 308: +-#line 1602 "./parse.y" ++#line 1606 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 309: +-#line 1604 "./parse.y" ++#line 1608 "./parse.y" + {yyerror ("';' expected"); RECOVER;; + break;} + case 310: +-#line 1609 "./parse.y" ++#line 1613 "./parse.y" + { yyval.node = build_return (yyvsp[-1].operator.location, NULL_TREE); ; + break;} + case 311: +-#line 1611 "./parse.y" ++#line 1615 "./parse.y" + { yyval.node = build_return (yyvsp[-2].operator.location, yyvsp[-1].node); ; + break;} + case 312: +-#line 1613 "./parse.y" ++#line 1617 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 313: +-#line 1615 "./parse.y" ++#line 1619 "./parse.y" + {yyerror ("';' expected"); RECOVER;; + break;} + case 314: +-#line 1620 "./parse.y" ++#line 1624 "./parse.y" + { + yyval.node = build1 (THROW_EXPR, NULL_TREE, yyvsp[-1].node); + EXPR_WFL_LINECOL (yyval.node) = yyvsp[-2].operator.location; + ; + break;} + case 315: +-#line 1625 "./parse.y" ++#line 1629 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 316: +-#line 1627 "./parse.y" ++#line 1631 "./parse.y" + {yyerror ("';' expected"); RECOVER;; + break;} + case 317: +-#line 1632 "./parse.y" ++#line 1636 "./parse.y" + { + yyval.node = build (SYNCHRONIZED_EXPR, NULL_TREE, yyvsp[-2].node, yyvsp[0].node); + EXPR_WFL_LINECOL (yyval.node) = +@@ -3976,56 +3979,56 @@ + ; + break;} + case 318: +-#line 1638 "./parse.y" ++#line 1642 "./parse.y" + {yyerror ("'{' expected"); RECOVER;; + break;} + case 319: +-#line 1640 "./parse.y" ++#line 1644 "./parse.y" + {yyerror ("'(' expected"); RECOVER;; + break;} + case 320: +-#line 1642 "./parse.y" ++#line 1646 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 321: +-#line 1644 "./parse.y" ++#line 1648 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 322: +-#line 1649 "./parse.y" ++#line 1653 "./parse.y" + { + if ((1 << yyvsp[0].value) != ACC_SYNCHRONIZED) + fatal ("synchronized was '%d' - yyparse", (1 << yyvsp[0].value)); + ; + break;} + case 323: +-#line 1657 "./parse.y" ++#line 1661 "./parse.y" + { yyval.node = build_try_statement (yyvsp[-2].operator.location, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 324: +-#line 1659 "./parse.y" ++#line 1663 "./parse.y" + { yyval.node = build_try_finally_statement (yyvsp[-2].operator.location, yyvsp[-1].node, yyvsp[0].node); ; + break;} + case 325: +-#line 1661 "./parse.y" ++#line 1665 "./parse.y" + { yyval.node = build_try_finally_statement + (yyvsp[-3].operator.location, build_try_statement (yyvsp[-3].operator.location, + yyvsp[-2].node, yyvsp[-1].node), yyvsp[0].node); + ; + break;} + case 326: +-#line 1666 "./parse.y" ++#line 1670 "./parse.y" + {yyerror ("'{' expected"); DRECOVER (try_statement);; + break;} + case 328: +-#line 1672 "./parse.y" ++#line 1676 "./parse.y" + { + TREE_CHAIN (yyvsp[0].node) = yyvsp[-1].node; + yyval.node = yyvsp[0].node; + ; + break;} + case 329: +-#line 1680 "./parse.y" ++#line 1684 "./parse.y" + { + java_method_add_stmt (current_function_decl, yyvsp[0].node); + exit_block (); +@@ -4033,7 +4036,7 @@ + ; + break;} + case 330: +-#line 1688 "./parse.y" ++#line 1692 "./parse.y" + { + /* We add a block to define a scope for + formal_parameter (CCBP). The formal parameter is +@@ -4051,176 +4054,176 @@ + ; + break;} + case 331: +-#line 1704 "./parse.y" ++#line 1708 "./parse.y" + {yyerror ("'(' expected"); RECOVER;; + break;} + case 332: +-#line 1706 "./parse.y" ++#line 1710 "./parse.y" + {yyerror ("Missing term or ')' expected"); DRECOVER (2);; + break;} + case 333: +-#line 1708 "./parse.y" ++#line 1712 "./parse.y" + {yyerror ("')' expected"); DRECOVER (1);; + break;} + case 334: +-#line 1713 "./parse.y" ++#line 1717 "./parse.y" + { yyval.node = yyvsp[0].node; ; + break;} + case 335: +-#line 1715 "./parse.y" ++#line 1719 "./parse.y" + {yyerror ("'{' expected"); RECOVER; ; + break;} + case 339: +-#line 1727 "./parse.y" ++#line 1731 "./parse.y" + { yyval.node = build_this (yyvsp[0].operator.location); ; + break;} + case 340: +-#line 1729 "./parse.y" ++#line 1733 "./parse.y" + {yyval.node = yyvsp[-1].node;; + break;} + case 345: +-#line 1738 "./parse.y" ++#line 1742 "./parse.y" + { yyval.node = parse_jdk1_1_error ("named class literals"); ; + break;} + case 346: +-#line 1740 "./parse.y" ++#line 1744 "./parse.y" + { yyval.node = build_class_ref (yyvsp[-2].node); ; + break;} + case 347: +-#line 1742 "./parse.y" ++#line 1746 "./parse.y" + { yyval.node = build_class_ref (void_type_node); ; + break;} + case 348: +-#line 1747 "./parse.y" ++#line 1751 "./parse.y" + { yyval.node = parse_jdk1_1_error ("class literals"); ; + break;} + case 349: +-#line 1749 "./parse.y" ++#line 1753 "./parse.y" + {yyerror ("')' expected"); RECOVER;; + break;} + case 350: +-#line 1751 "./parse.y" ++#line 1755 "./parse.y" + {yyerror ("'class' or 'this' expected" ); RECOVER;; + break;} + case 351: +-#line 1753 "./parse.y" ++#line 1757 "./parse.y" + {yyerror ("'class' expected" ); RECOVER;; + break;} + case 352: +-#line 1755 "./parse.y" ++#line 1759 "./parse.y" + {yyerror ("'class' expected" ); RECOVER;; + break;} + case 353: +-#line 1760 "./parse.y" ++#line 1764 "./parse.y" + { yyval.node = build_new_invocation (yyvsp[-3].node, yyvsp[-1].node); ; + break;} + case 354: +-#line 1762 "./parse.y" ++#line 1766 "./parse.y" + { yyval.node = build_new_invocation (yyvsp[-2].node, NULL_TREE); ; + break;} + case 355: +-#line 1767 "./parse.y" ++#line 1771 "./parse.y" + { yyval.node = parse_jdk1_1_error ("inner class instance creation"); ; + break;} + case 356: +-#line 1769 "./parse.y" ++#line 1773 "./parse.y" + { yyval.node = parse_jdk1_1_error ("inner class instance creation"); ; + break;} + case 361: +-#line 1778 "./parse.y" ++#line 1782 "./parse.y" + {yyerror ("'(' expected"); DRECOVER(new_1);; + break;} + case 362: +-#line 1780 "./parse.y" ++#line 1784 "./parse.y" + {yyerror ("'(' expected"); RECOVER;; + break;} + case 363: +-#line 1782 "./parse.y" ++#line 1786 "./parse.y" + {yyerror ("')' or term expected"); RECOVER;; + break;} + case 364: +-#line 1784 "./parse.y" ++#line 1788 "./parse.y" + {yyerror ("')' expected"); RECOVER;; + break;} + case 365: +-#line 1786 "./parse.y" ++#line 1790 "./parse.y" + {YYERROR_NOW; yyerror ("Identifier expected"); RECOVER;; + break;} + case 366: +-#line 1788 "./parse.y" ++#line 1792 "./parse.y" + {yyerror ("'(' expected"); RECOVER;; + break;} + case 369: +-#line 1798 "./parse.y" ++#line 1802 "./parse.y" + { + yyval.node = tree_cons (NULL_TREE, yyvsp[0].node, NULL_TREE); + ctxp->formal_parameter_number = 1; + ; + break;} + case 370: +-#line 1803 "./parse.y" ++#line 1807 "./parse.y" + { + ctxp->formal_parameter_number += 1; + yyval.node = tree_cons (NULL_TREE, yyvsp[0].node, yyvsp[-2].node); + ; + break;} + case 371: +-#line 1808 "./parse.y" ++#line 1812 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 372: +-#line 1813 "./parse.y" ++#line 1817 "./parse.y" + { yyval.node = build_newarray_node (yyvsp[-1].node, yyvsp[0].node, 0); ; + break;} + case 373: +-#line 1815 "./parse.y" ++#line 1819 "./parse.y" + { yyval.node = build_newarray_node (yyvsp[-1].node, yyvsp[0].node, 0); ; + break;} + case 374: +-#line 1817 "./parse.y" ++#line 1821 "./parse.y" + { yyval.node = build_newarray_node (yyvsp[-2].node, yyvsp[-1].node, CURRENT_OSB (ctxp));; + break;} + case 375: +-#line 1819 "./parse.y" ++#line 1823 "./parse.y" + { yyval.node = build_newarray_node (yyvsp[-2].node, yyvsp[-1].node, CURRENT_OSB (ctxp));; + break;} + case 376: +-#line 1823 "./parse.y" ++#line 1827 "./parse.y" + { yyval.node = parse_jdk1_1_error ("anonymous array"); ; + break;} + case 377: +-#line 1825 "./parse.y" ++#line 1829 "./parse.y" + { yyval.node = parse_jdk1_1_error ("anonymous array"); ; + break;} + case 378: +-#line 1827 "./parse.y" ++#line 1831 "./parse.y" + {yyerror ("'[' expected"); DRECOVER ("]");; + break;} + case 379: +-#line 1829 "./parse.y" ++#line 1833 "./parse.y" + {yyerror ("']' expected"); RECOVER;; + break;} + case 380: +-#line 1834 "./parse.y" ++#line 1838 "./parse.y" + { yyval.node = build_tree_list (NULL_TREE, yyvsp[0].node); ; + break;} + case 381: +-#line 1836 "./parse.y" ++#line 1840 "./parse.y" + { yyval.node = tree_cons (NULL_TREE, yyvsp[0].node, yyval.node); ; + break;} + case 382: +-#line 1841 "./parse.y" ++#line 1845 "./parse.y" + { + EXPR_WFL_LINECOL (yyvsp[-1].node) = yyvsp[-2].operator.location; + yyval.node = yyvsp[-1].node; + ; + break;} + case 383: +-#line 1846 "./parse.y" ++#line 1850 "./parse.y" + {yyerror ("']' expected"); RECOVER;; + break;} + case 384: +-#line 1848 "./parse.y" ++#line 1852 "./parse.y" + { + yyerror ("Missing term"); + yyerror ("']' expected"); +@@ -4228,7 +4231,7 @@ + ; + break;} + case 385: +-#line 1857 "./parse.y" ++#line 1861 "./parse.y" + { + int allocate = 0; + /* If not initialized, allocate memory for the osb +@@ -4256,19 +4259,19 @@ + ; + break;} + case 386: +-#line 1883 "./parse.y" ++#line 1887 "./parse.y" + { CURRENT_OSB (ctxp)++; ; + break;} + case 387: +-#line 1885 "./parse.y" ++#line 1889 "./parse.y" + { yyerror ("']' expected"); RECOVER;; + break;} + case 388: +-#line 1890 "./parse.y" ++#line 1894 "./parse.y" + { yyval.node = make_qualified_primary (yyvsp[-2].node, yyvsp[0].node, yyvsp[-1].operator.location); ; + break;} + case 389: +-#line 1894 "./parse.y" ++#line 1898 "./parse.y" + { + tree super_wfl = + build_wfl_node (super_identifier_node); +@@ -4277,19 +4280,19 @@ + ; + break;} + case 390: +-#line 1901 "./parse.y" ++#line 1905 "./parse.y" + {yyerror ("Field expected"); DRECOVER (super_field_acces);; + break;} + case 391: +-#line 1906 "./parse.y" ++#line 1910 "./parse.y" + { yyval.node = build_method_invocation (yyvsp[-2].node, NULL_TREE); ; + break;} + case 392: +-#line 1908 "./parse.y" ++#line 1912 "./parse.y" + { yyval.node = build_method_invocation (yyvsp[-3].node, yyvsp[-1].node); ; + break;} + case 393: +-#line 1910 "./parse.y" ++#line 1914 "./parse.y" + { + if (TREE_CODE (yyvsp[-4].node) == THIS_EXPR) + yyval.node = build_this_super_qualified_invocation +@@ -4302,7 +4305,7 @@ + ; + break;} + case 394: +-#line 1921 "./parse.y" ++#line 1925 "./parse.y" + { + if (TREE_CODE (yyvsp[-5].node) == THIS_EXPR) + yyval.node = build_this_super_qualified_invocation +@@ -4315,121 +4318,121 @@ + ; + break;} + case 395: +-#line 1932 "./parse.y" ++#line 1936 "./parse.y" + { + yyval.node = build_this_super_qualified_invocation + (0, yyvsp[-2].node, NULL_TREE, yyvsp[-4].operator.location, yyvsp[-3].operator.location); + ; + break;} + case 396: +-#line 1937 "./parse.y" ++#line 1941 "./parse.y" + { + yyval.node = build_this_super_qualified_invocation + (0, yyvsp[-3].node, yyvsp[-1].node, yyvsp[-5].operator.location, yyvsp[-4].operator.location); + ; + break;} + case 397: +-#line 1946 "./parse.y" ++#line 1950 "./parse.y" + { yyerror ("'(' expected"); DRECOVER (method_invocation); ; + break;} + case 398: +-#line 1948 "./parse.y" ++#line 1952 "./parse.y" + { yyerror ("'(' expected"); DRECOVER (method_invocation); ; + break;} + case 399: +-#line 1953 "./parse.y" ++#line 1957 "./parse.y" + { yyval.node = build_array_ref (yyvsp[-2].operator.location, yyvsp[-3].node, yyvsp[-1].node); ; + break;} + case 400: +-#line 1955 "./parse.y" ++#line 1959 "./parse.y" + { yyval.node = build_array_ref (yyvsp[-2].operator.location, yyvsp[-3].node, yyvsp[-1].node); ; + break;} + case 401: +-#line 1957 "./parse.y" ++#line 1961 "./parse.y" + { + yyerror ("Missing term and ']' expected"); + DRECOVER(array_access); + ; + break;} + case 402: +-#line 1962 "./parse.y" ++#line 1966 "./parse.y" + { + yyerror ("']' expected"); + DRECOVER(array_access); + ; + break;} + case 403: +-#line 1967 "./parse.y" ++#line 1971 "./parse.y" + { + yyerror ("Missing term and ']' expected"); + DRECOVER(array_access); + ; + break;} + case 404: +-#line 1972 "./parse.y" ++#line 1976 "./parse.y" + { + yyerror ("']' expected"); + DRECOVER(array_access); + ; + break;} + case 409: +-#line 1987 "./parse.y" ++#line 1991 "./parse.y" + { yyval.node = build_incdec (yyvsp[0].operator.token, yyvsp[0].operator.location, yyvsp[-1].node, 1); ; + break;} + case 410: +-#line 1992 "./parse.y" ++#line 1996 "./parse.y" + { yyval.node = build_incdec (yyvsp[0].operator.token, yyvsp[0].operator.location, yyvsp[-1].node, 1); ; + break;} + case 413: +-#line 1999 "./parse.y" ++#line 2003 "./parse.y" + {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ; + break;} + case 414: +-#line 2001 "./parse.y" ++#line 2005 "./parse.y" + {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ; + break;} + case 416: +-#line 2004 "./parse.y" ++#line 2008 "./parse.y" + {yyerror ("Missing term"); RECOVER; + break;} + case 417: +-#line 2006 "./parse.y" ++#line 2010 "./parse.y" + {yyerror ("Missing term"); RECOVER; + break;} + case 418: +-#line 2011 "./parse.y" ++#line 2015 "./parse.y" + {yyval.node = build_incdec (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node, 0); ; + break;} + case 419: +-#line 2013 "./parse.y" ++#line 2017 "./parse.y" + {yyerror ("Missing term"); RECOVER; + break;} + case 420: +-#line 2018 "./parse.y" ++#line 2022 "./parse.y" + {yyval.node = build_incdec (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node, 0); ; + break;} + case 421: +-#line 2020 "./parse.y" ++#line 2024 "./parse.y" + {yyerror ("Missing term"); RECOVER; + break;} + case 423: +-#line 2026 "./parse.y" ++#line 2030 "./parse.y" + {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ; + break;} + case 424: +-#line 2028 "./parse.y" ++#line 2032 "./parse.y" + {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ; + break;} + case 426: +-#line 2031 "./parse.y" ++#line 2035 "./parse.y" + {yyerror ("Missing term"); RECOVER; + break;} + case 427: +-#line 2033 "./parse.y" ++#line 2037 "./parse.y" + {yyerror ("Missing term"); RECOVER; + break;} + case 428: +-#line 2038 "./parse.y" ++#line 2042 "./parse.y" + { + tree type = yyvsp[-3].node; + while (CURRENT_OSB (ctxp)--) +@@ -4439,15 +4442,15 @@ + ; + break;} + case 429: +-#line 2046 "./parse.y" ++#line 2050 "./parse.y" + { yyval.node = build_cast (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[0].node); ; + break;} + case 430: +-#line 2048 "./parse.y" ++#line 2052 "./parse.y" + { yyval.node = build_cast (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[0].node); ; + break;} + case 431: +-#line 2050 "./parse.y" ++#line 2054 "./parse.y" + { + char *ptr; + while (CURRENT_OSB (ctxp)--) +@@ -4462,11 +4465,11 @@ + ; + break;} + case 432: +-#line 2063 "./parse.y" ++#line 2067 "./parse.y" + {yyerror ("']' expected, invalid type expression");; + break;} + case 433: +-#line 2065 "./parse.y" ++#line 2069 "./parse.y" + { + if (ctxp->prevent_ese != lineno) + yyerror ("Invalid type expression"); RECOVER; +@@ -4474,243 +4477,243 @@ + ; + break;} + case 434: +-#line 2071 "./parse.y" ++#line 2075 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 435: +-#line 2073 "./parse.y" ++#line 2077 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 436: +-#line 2075 "./parse.y" ++#line 2079 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 438: +-#line 2081 "./parse.y" ++#line 2085 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), + yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 439: +-#line 2086 "./parse.y" ++#line 2090 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 440: +-#line 2091 "./parse.y" ++#line 2095 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 441: +-#line 2096 "./parse.y" ++#line 2100 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 442: +-#line 2098 "./parse.y" ++#line 2102 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 443: +-#line 2100 "./parse.y" ++#line 2104 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 445: +-#line 2106 "./parse.y" ++#line 2110 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 446: +-#line 2111 "./parse.y" ++#line 2115 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 447: +-#line 2116 "./parse.y" ++#line 2120 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 448: +-#line 2118 "./parse.y" ++#line 2122 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 450: +-#line 2124 "./parse.y" ++#line 2128 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 451: +-#line 2129 "./parse.y" ++#line 2133 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 452: +-#line 2134 "./parse.y" ++#line 2138 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 453: +-#line 2139 "./parse.y" ++#line 2143 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 454: +-#line 2141 "./parse.y" ++#line 2145 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 455: +-#line 2143 "./parse.y" ++#line 2147 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 457: +-#line 2149 "./parse.y" ++#line 2153 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 458: +-#line 2154 "./parse.y" ++#line 2158 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 459: +-#line 2159 "./parse.y" ++#line 2163 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 460: +-#line 2164 "./parse.y" ++#line 2168 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 461: +-#line 2169 "./parse.y" ++#line 2173 "./parse.y" + { yyval.node = build_binop (INSTANCEOF_EXPR, yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node); ; + break;} + case 462: +-#line 2171 "./parse.y" ++#line 2175 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 463: +-#line 2173 "./parse.y" ++#line 2177 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 464: +-#line 2175 "./parse.y" ++#line 2179 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 465: +-#line 2177 "./parse.y" ++#line 2181 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 466: +-#line 2179 "./parse.y" ++#line 2183 "./parse.y" + {yyerror ("Invalid reference type"); RECOVER;; + break;} + case 468: +-#line 2185 "./parse.y" ++#line 2189 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 469: +-#line 2190 "./parse.y" ++#line 2194 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 470: +-#line 2195 "./parse.y" ++#line 2199 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 471: +-#line 2197 "./parse.y" ++#line 2201 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 473: +-#line 2203 "./parse.y" ++#line 2207 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 474: +-#line 2208 "./parse.y" ++#line 2212 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 476: +-#line 2214 "./parse.y" ++#line 2218 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 477: +-#line 2219 "./parse.y" ++#line 2223 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 479: +-#line 2225 "./parse.y" ++#line 2229 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 480: +-#line 2230 "./parse.y" ++#line 2234 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 482: +-#line 2236 "./parse.y" ++#line 2240 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 483: +-#line 2241 "./parse.y" ++#line 2245 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 485: +-#line 2247 "./parse.y" ++#line 2251 "./parse.y" + { + yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, + yyvsp[-2].node, yyvsp[0].node); + ; + break;} + case 486: +-#line 2252 "./parse.y" ++#line 2256 "./parse.y" + {yyerror ("Missing term"); RECOVER;; + break;} + case 488: +-#line 2258 "./parse.y" ++#line 2262 "./parse.y" + { + yyval.node = build (CONDITIONAL_EXPR, NULL_TREE, yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); + EXPR_WFL_LINECOL (yyval.node) = yyvsp[-3].operator.location; + ; + break;} + case 489: +-#line 2263 "./parse.y" ++#line 2267 "./parse.y" + { + YYERROR_NOW; + yyerror ("Missing term"); +@@ -4718,19 +4721,19 @@ + ; + break;} + case 490: +-#line 2269 "./parse.y" ++#line 2273 "./parse.y" + {yyerror ("Missing term"); DRECOVER (2);; + break;} + case 491: +-#line 2271 "./parse.y" ++#line 2275 "./parse.y" + {yyerror ("Missing term"); DRECOVER (3);; + break;} + case 494: +-#line 2281 "./parse.y" ++#line 2285 "./parse.y" + { yyval.node = build_assignment (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node); ; + break;} + case 495: +-#line 2283 "./parse.y" ++#line 2287 "./parse.y" + { + if (ctxp->prevent_ese != lineno) + yyerror ("Missing term"); +@@ -4739,7 +4742,7 @@ + break;} + } + /* the action file gets copied in in place of this dollarsign */ +-#line 542 "/usr/lib/bison.simple" ++#line 543 "/usr/lib/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +@@ -4959,7 +4962,7 @@ + } + return 1; + } +-#line 2309 "./parse.y" ++#line 2313 "./parse.y" + + + +@@ -5063,7 +5066,17 @@ + free (toFree); + } + +-/* Reporting JDK1.1 features not implemented */ ++/* Reporting an constructor invocation error. */ ++static void ++parse_ctor_invocation_error () ++{ ++ if (DECL_CONSTRUCTOR_P (current_function_decl)) ++ yyerror ("Constructor invocation must be first thing in a constructor"); ++ else ++ yyerror ("Only constructors can invoke constructors"); ++} ++ ++/* Reporting JDK1.1 features not implemented. */ + + static tree + parse_jdk1_1_error (msg) +@@ -5972,13 +5985,18 @@ + { + tree meth = TREE_VALUE (mdecl); + tree id = TREE_PURPOSE (mdecl); +- tree this_class = TREE_TYPE (ctxp->current_parsed_class); + tree type_wfl = NULL_TREE; +- tree meth_name = NULL_TREE, current, orig_arg; ++ tree meth_name = NULL_TREE; ++ tree current, orig_arg, this_class; + int saved_lineno; + int constructor_ok = 0, must_chain; + + check_modifiers_consistency (flags); ++ ++ if (ctxp->current_parsed_class) ++ this_class = TREE_TYPE (ctxp->current_parsed_class); ++ else ++ return NULL_TREE; + + /* There are some forbidden modifiers for an abstract method and its + class must be abstract as well. */ +@@ -6174,7 +6192,12 @@ + finish_method_declaration (method_body) + tree method_body; + { +- int flags = get_access_flags_from_decl (current_function_decl); ++ int flags; ++ ++ if (!current_function_decl) ++ return; ++ ++ flags = get_access_flags_from_decl (current_function_decl); + + /* 8.4.5 Method Body */ + if ((flags & ACC_ABSTRACT || flags & ACC_NATIVE) && method_body) +@@ -6989,7 +7012,9 @@ + + /* Resolve and layout if necessary */ + layout_class_methods (TREE_TYPE (decl)); +- if (CLASS_FROM_SOURCE_P (TREE_TYPE (decl))) ++ /* Check methods, but only once */ ++ if (CLASS_FROM_SOURCE_P (TREE_TYPE (decl)) ++ && !CLASS_LOADED_P (TREE_TYPE (decl))) + CHECK_METHODS (decl); + if (TREE_TYPE (decl) != current_class && !CLASS_LOADED_P (TREE_TYPE (decl))) + safe_layout_class (TREE_TYPE (decl)); +@@ -7170,7 +7195,7 @@ + + /* Track method being redefined inside the same class. As a side + effect, set DECL_NAME to an IDENTIFIER (prior entering this +- function it's a FWL, so we can track errors more accurately */ ++ function it's a FWL, so we can track errors more accurately.) */ + + static int + check_method_redefinition (class, method) +@@ -7206,9 +7231,126 @@ + return 0; + } + +-/* Check all the methods of CLASS. Methods are first completed then +- checked according to regular method existance rules. +- If no constructor were encountered, then build its declaration. */ ++static void ++check_abstract_method_definitions (do_interface, class_decl, type) ++ int do_interface; ++ tree class_decl, type; ++{ ++ tree class = TREE_TYPE (class_decl); ++ tree method, end_type; ++ ++ end_type = (do_interface ? object_type_node : type); ++ for (method = TYPE_METHODS (type); method; method = TREE_CHAIN (method)) ++ { ++ tree other_super, other_method, method_sig, method_name; ++ int found = 0; ++ ++ if (!METHOD_ABSTRACT (method) || METHOD_FINAL (method)) ++ continue; ++ ++ /* Now verify that somewhere in between TYPE and CLASS, ++ abstract method METHOD gets a non abstract definition ++ that is inherited by CLASS. */ ++ ++ method_sig = build_java_signature (TREE_TYPE (method)); ++ method_name = DECL_NAME (method); ++ if (TREE_CODE (method_name) == EXPR_WITH_FILE_LOCATION) ++ method_name = EXPR_WFL_NODE (method_name); ++ ++ for (other_super = class; other_super != end_type; ++ other_super = CLASSTYPE_SUPER (other_super)) ++ { ++ for (other_method = TYPE_METHODS (other_super); other_method; ++ other_method = TREE_CHAIN (other_method)) ++ { ++ tree s = build_java_signature (TREE_TYPE (other_method)); ++ tree other_name = DECL_NAME (other_method); ++ ++ if (TREE_CODE (other_name) == EXPR_WITH_FILE_LOCATION) ++ other_name = EXPR_WFL_NODE (other_name); ++ if (!IS_CLINIT (other_method) ++ && !DECL_CONSTRUCTOR_P (other_method) ++ && method_name == other_name && method_sig == s) ++ { ++ found = 1; ++ break; ++ } ++ } ++ } ++ ++ /* Report that abstract METHOD didn't find an implementation ++ that CLASS can use. */ ++ if (!found) ++ { ++ char *t = strdup (lang_printable_name ++ (TREE_TYPE (TREE_TYPE (method)), 0)); ++ tree ccn = DECL_NAME (TYPE_NAME (DECL_CONTEXT (method))); ++ tree saved_wfl = NULL_TREE; ++ ++ if (TREE_CODE (DECL_NAME (method)) == EXPR_WITH_FILE_LOCATION) ++ { ++ saved_wfl = DECL_NAME (method); ++ DECL_NAME (method) = EXPR_WFL_NODE (DECL_NAME (method)); ++ } ++ ++ parse_error_context ++ (lookup_cl (class_decl), ++ "Class `%s' doesn't define the abstract method `%s %s' from " ++ "%s `%s'. This method must be defined or %s `%s' must be " ++ "declared abstract", ++ IDENTIFIER_POINTER (DECL_NAME (class_decl)), ++ t, lang_printable_name (method, 0), ++ (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method))) ? ++ "interface" : "class"), ++ IDENTIFIER_POINTER (ccn), ++ (CLASS_INTERFACE (class_decl) ? "interface" : "class"), ++ IDENTIFIER_POINTER (DECL_NAME (class_decl))); ++ ++ free (t); ++ ++ if (saved_wfl) ++ DECL_NAME (method) = saved_wfl; ++ } ++ } ++} ++ ++/* Check that CLASS_DECL somehoow implements all inherited abstract ++ methods. */ ++ ++static void ++java_check_abstract_method_definitions (class_decl) ++ tree class_decl; ++{ ++ tree class = TREE_TYPE (class_decl); ++ tree super, vector; ++ int i; ++ ++ if (CLASS_ABSTRACT (class_decl)) ++ return; ++ ++ /* Check for inherited types */ ++ for (super = CLASSTYPE_SUPER (class); super != object_type_node; ++ super = CLASSTYPE_SUPER (super)) ++ { ++ if (!CLASS_ABSTRACT (TYPE_NAME (super))) ++ continue; ++ ++ check_abstract_method_definitions (0, class_decl, super); ++ } ++ ++ /* Check for implemented interfaces. */ ++ vector = TYPE_BINFO_BASETYPES (class); ++ for (i = 1; i < TREE_VEC_LENGTH (vector); i++) ++ { ++ super = BINFO_TYPE (TREE_VEC_ELT (vector, i)); ++ check_abstract_method_definitions (1, class_decl, super); ++ } ++} ++ ++/* Check all the methods of CLASS_DECL. Methods are first completed ++ then checked according to regular method existance rules. If no ++ constructor for CLASS_DECL were encountered, then build its ++ declaration. */ + + static void + java_check_regular_methods (class_decl) +@@ -7384,7 +7526,7 @@ + + /* Don't forget eventual pending found and saved_found_wfl. Take + into account that we might have exited because we saw an +- aritifical method as the last entry. */ ++ artificial method as the last entry. */ + + if (found && !DECL_ARTIFICIAL (found) && saved_found_wfl) + DECL_NAME (found) = saved_found_wfl; +@@ -7392,6 +7534,10 @@ + if (!TYPE_NVIRTUALS (class)) + TYPE_METHODS (class) = nreverse (TYPE_METHODS (class)); + ++ /* Search for inherited abstract method not yet implemented in this ++ class. */ ++ java_check_abstract_method_definitions (class_decl); ++ + if (!saw_constructor) + { + /* No constructor seen, we craft one, at line 0. Since this +@@ -7597,14 +7743,15 @@ + return NULL_TREE; + } + +-/* Return the line that matches DECL line number. Used during error +- report */ ++/* Return the line that matches DECL line number, and try its best to ++ position the column number. Used during error reports. */ + + static tree + lookup_cl (decl) + tree decl; + { + static tree cl = NULL_TREE; ++ char *line, *found; + + if (!decl) + return NULL_TREE; +@@ -7615,6 +7762,14 @@ + EXPR_WFL_FILENAME_NODE (cl) = get_identifier (DECL_SOURCE_FILE (decl)); + EXPR_WFL_SET_LINECOL (cl, DECL_SOURCE_LINE_FIRST (decl), -1); + ++ line = java_get_line_col (IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE (cl)), ++ EXPR_WFL_LINENO (cl), EXPR_WFL_COLNO (cl)); ++ ++ found = strstr ((const char *)line, ++ (const char *)IDENTIFIER_POINTER (DECL_NAME (decl))); ++ if (found) ++ EXPR_WFL_SET_LINECOL (cl, EXPR_WFL_LINENO (cl), found - line); ++ + return cl; + } + +@@ -8149,6 +8304,9 @@ + tree parm_decl; + int i; + ++ if (!fndecl) ++ return; ++ + current_function_decl = fndecl; + + /* New scope for the function */ +@@ -8268,6 +8426,9 @@ + tree fndecl = current_function_decl; + int flag_asynchronous_exceptions = asynchronous_exceptions; + ++ if (!fndecl) ++ return; ++ + java_parser_context_save_global (); + lineno = ctxp->last_ccb_indent1; + +@@ -8323,6 +8484,8 @@ + java_method_add_stmt (fndecl, expr) + tree fndecl, expr; + { ++ if (!GET_CURRENT_BLOCK (fndecl)) ++ return NULL_TREE; + return add_stmt_to_block (GET_CURRENT_BLOCK (fndecl), NULL_TREE, expr); + } + +@@ -8721,7 +8884,8 @@ + for (mdecl = TYPE_METHODS (class); mdecl; mdecl = TREE_CHAIN (mdecl)) + { + if (DECL_CONSTRUCTOR_P (mdecl) +- && TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (mdecl))) == end_params_node) ++ && TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (mdecl))) ++ == end_params_node) + return 0; + } + } +@@ -9064,6 +9228,8 @@ + == soft_initclass_node) + return TREE_OPERAND (op1, 1); + } ++ else if (JDECL_P (op1)) ++ return op1; + } + return node; + } +@@ -9085,6 +9251,8 @@ + for (q = EXPR_WFL_QUALIFICATION (wfl); q; q = TREE_CHAIN (q)) + { + tree qual_wfl = QUAL_WFL (q); ++ tree ret_decl; /* for EH checking */ ++ int location; /* for EH checking */ + + /* 15.10.1 Field Access Using a Primary */ + switch (TREE_CODE (qual_wfl)) +@@ -9103,14 +9271,21 @@ + /* And code for the function call */ + if (complete_function_arguments (qual_wfl)) + return 1; ++ + if (from_super && TREE_CODE (qual_wfl) == CALL_EXPR) + CALL_USING_SUPER (qual_wfl) = 1; +- *where_found = +- patch_method_invocation (qual_wfl, decl, type, &is_static, NULL); ++ location = (TREE_CODE (qual_wfl) == CALL_EXPR ? ++ EXPR_WFL_LINECOL (TREE_OPERAND (qual_wfl, 0)) : 0); ++ *where_found = patch_method_invocation (qual_wfl, decl, type, ++ &is_static, &ret_decl); + if (*where_found == error_mark_node) + return 1; + *type_found = type = QUAL_DECL_TYPE (*where_found); + ++ /* EH check */ ++ if (location) ++ check_thrown_exceptions (location, ret_decl); ++ + /* If the previous call was static and this one is too, + build a compound expression to hold the two (because in + that case, previous function calls aren't transported as +@@ -9145,6 +9320,7 @@ + + case CONDITIONAL_EXPR: + case STRING_CST: ++ case MODIFY_EXPR: + *where_found = decl = java_complete_tree (qual_wfl); + if (decl == error_mark_node) + return 1; +@@ -9882,6 +10058,11 @@ + if (JPRIMITIVE_TYPE_P (TREE_TYPE (TREE_VALUE (ta))) && + TREE_TYPE (TREE_VALUE (ta)) != TREE_VALUE (t)) + TREE_VALUE (ta) = convert (TREE_VALUE (t), TREE_VALUE (ta)); ++ ++ /* Resolve unresolved returned type isses */ ++ t = TREE_TYPE (TREE_TYPE (method)); ++ if (TREE_CODE (t) == POINTER_TYPE && !CLASS_LOADED_P (TREE_TYPE (t))) ++ resolve_and_layout (TREE_TYPE (t), NULL); + + if (flag_emit_class_files || flag_emit_xref) + func = method; +@@ -10042,7 +10223,7 @@ + parse_error_context (cl, "Can't find %s `%s(%s)' in class `%s'%s", + (lc ? "constructor" : "method"), + (lc ? +- IDENTIFIER_POINTER(DECL_NAME (TYPE_NAME (class))) : ++ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class))) : + IDENTIFIER_POINTER (name)), + IDENTIFIER_POINTER (signature), + IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class))), +@@ -10061,7 +10242,8 @@ + tree list = NULL_TREE, all_list = NULL_TREE; + + /* Search interfaces */ +- if (CLASS_INTERFACE (TYPE_NAME (class))) ++ if (CLASS_INTERFACE (TYPE_NAME (class)) ++ || CLASS_ABSTRACT (TYPE_NAME (class))) + { + static tree searched_interfaces = NULL_TREE; + static int search_not_done = 0; +@@ -10292,7 +10474,7 @@ + break; + case NEW_ARRAY_EXPR: + qual = TREE_CHAIN (qual); +- new_array_found = 1; ++ again = new_array_found = 1; + continue; + case NEW_CLASS_EXPR: + case CONVERT_EXPR: +@@ -10320,12 +10502,8 @@ + && TREE_CODE (TREE_TYPE (qual_wfl)) == EXPR_WITH_FILE_LOCATION) + name = EXPR_WFL_NODE (TREE_TYPE (qual_wfl)); + +- else if (code == ARRAY_REF && +- TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION) +- name = EXPR_WFL_NODE (TREE_OPERAND (qual_wfl, 0)); +- +- else if (code == CALL_EXPR && +- TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION) ++ else if ((code == ARRAY_REF || code == CALL_EXPR || code == MODIFY_EXPR) && ++ TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION) + name = EXPR_WFL_NODE (TREE_OPERAND (qual_wfl, 0)); + + else if (code == STRING_CST || code == CONDITIONAL_EXPR) +@@ -10335,8 +10513,15 @@ + again = 1; + } + else +- name = EXPR_WFL_NODE (qual_wfl); +- ++ { ++ name = EXPR_WFL_NODE (qual_wfl); ++ if (!name) ++ { ++ qual = EXPR_WFL_QUALIFICATION (qual_wfl); ++ again = 1; ++ } ++ } ++ + /* If we have a THIS (from a primary), we set the context accordingly */ + if (name == this_identifier_node) + { +@@ -10370,7 +10555,8 @@ + declaration or parameter declaration, then it is an expression + name. We don't carry this test out if we're in the context of the + use of SUPER or THIS */ +- if (!this_found && !super_found && (decl = IDENTIFIER_LOCAL_VALUE (name))) ++ if (!this_found && !super_found && ++ TREE_CODE (name) != STRING_CST && (decl = IDENTIFIER_LOCAL_VALUE (name))) + { + RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1; + QUAL_RESOLUTION (qual) = decl; +@@ -10387,15 +10573,17 @@ + QUAL_RESOLUTION (qual) = (new_array_found ? NULL_TREE : decl); + } + +- /* We reclassify NAME as a type name if: ++ /* We reclassify NAME as yielding to a type name resolution if: + - NAME is a class/interface declared within the compilation + unit containing NAME, + - NAME is imported via a single-type-import declaration, + - NAME is declared in an another compilation unit of the package + of the compilation unit containing NAME, + - NAME is declared by exactly on type-import-on-demand declaration +- of the compilation unit containing NAME. */ +- else if ((decl = resolve_and_layout (name, NULL_TREE))) ++ of the compilation unit containing NAME. ++ - NAME is actually a STRING_CST. */ ++ else if (TREE_CODE (name) == STRING_CST || ++ (decl = resolve_and_layout (name, NULL_TREE))) + { + RESOLVE_TYPE_NAME_P (qual_wfl) = 1; + QUAL_RESOLUTION (qual) = decl; +@@ -10480,7 +10668,9 @@ + { + tree value = DECL_INITIAL (node); + DECL_INITIAL (node) = NULL_TREE; ++ push_obstacks (&permanent_obstack, &permanent_obstack); + value = fold_constant_for_init (value, node); ++ pop_obstacks (); + DECL_INITIAL (node) = value; + if (value != NULL_TREE) + return value; +@@ -10500,8 +10690,7 @@ + TREE_OPERAND (node, 1) = java_stabilize_reference (op1); + return node; + } +- else +- return stabilize_reference (node); ++ return stabilize_reference (node); + } + + /* Patch tree nodes in a function body. When a BLOCK is found, push +@@ -10683,8 +10872,12 @@ + && JDECL_P (TREE_OPERAND (cn, 1)) + && FIELD_FINAL (TREE_OPERAND (cn, 1)) + && DECL_INITIAL (TREE_OPERAND (cn, 1))) +- cn = fold_constant_for_init (DECL_INITIAL (TREE_OPERAND (cn, 1)), +- TREE_OPERAND (cn, 1)); ++ { ++ push_obstacks (&permanent_obstack, &permanent_obstack); ++ cn = fold_constant_for_init (DECL_INITIAL (TREE_OPERAND (cn, 1)), ++ TREE_OPERAND (cn, 1)); ++ pop_obstacks (); ++ } + + if (!TREE_CONSTANT (cn) && !flag_emit_xref) + { +@@ -10937,7 +11130,11 @@ + && TREE_CODE (nn) == VAR_DECL && TREE_STATIC (nn) + && DECL_INITIAL (nn) != NULL_TREE) + { +- tree value = fold_constant_for_init (nn, nn); ++ tree value; ++ ++ push_obstacks (&permanent_obstack, &permanent_obstack); ++ value = fold_constant_for_init (nn, nn); ++ pop_obstacks (); + if (value != NULL_TREE) + { + tree type = TREE_TYPE (value); +@@ -10951,14 +11148,17 @@ + if (TREE_OPERAND (node, 0) == error_mark_node) + return error_mark_node; + +- if (COMPOUND_ASSIGN_P (wfl_op2)) ++ flag = COMPOUND_ASSIGN_P (wfl_op2); ++ if (flag) + { + tree lvalue = java_stabilize_reference (TREE_OPERAND (node, 0)); + + /* Hand stablize the lhs on both places */ + TREE_OPERAND (node, 0) = lvalue; +- TREE_OPERAND (TREE_OPERAND (node, 1), 0) = lvalue; ++ TREE_OPERAND (TREE_OPERAND (node, 1), 0) = ++ (flag_emit_class_files ? lvalue : save_expr (lvalue)); + ++ /* 15.25.2.a: Left hand is not an array access. FIXME */ + /* Now complete the RHS. We write it back later on. */ + nn = java_complete_tree (TREE_OPERAND (node, 1)); + +@@ -10969,6 +11169,8 @@ + E1 = (T)(E1 op E2), with T being the type of E1. */ + nn = java_complete_tree (build_cast (EXPR_WFL_LINECOL (wfl_op2), + TREE_TYPE (lvalue), nn)); ++ ++ /* 15.25.2.b: Left hand is an array access. FIXME */ + } + + /* If we're about to patch a NEW_ARRAY_INIT, we call a special +@@ -10992,6 +11194,10 @@ + if ((nn = patch_string (TREE_OPERAND (node, 1)))) + TREE_OPERAND (node, 1) = nn; + node = patch_assignment (node, wfl_op1, wfl_op2); ++ /* Reorganize the tree if necessary. */ ++ if (flag && (!JREFERENCE_TYPE_P (TREE_TYPE (node)) ++ || JSTRING_P (TREE_TYPE (node)))) ++ node = java_refold (node); + CAN_COMPLETE_NORMALLY (node) = 1; + return node; + +@@ -12000,6 +12206,81 @@ + #undef BUILD_OPERATOR_STRING + } + ++/* Return 1 if VAR_ACCESS1 is equivalent to VAR_ACCESS2. */ ++ ++static int ++java_decl_equiv (var_acc1, var_acc2) ++ tree var_acc1, var_acc2; ++{ ++ if (JDECL_P (var_acc1)) ++ return (var_acc1 == var_acc2); ++ ++ return (TREE_CODE (var_acc1) == COMPONENT_REF ++ && TREE_CODE (var_acc2) == COMPONENT_REF ++ && TREE_OPERAND (TREE_OPERAND (var_acc1, 0), 0) ++ == TREE_OPERAND (TREE_OPERAND (var_acc2, 0), 0) ++ && TREE_OPERAND (var_acc1, 1) == TREE_OPERAND (var_acc2, 1)); ++} ++ ++/* Return a non zero value if CODE is one of the operators that can be ++ used in conjunction with the `=' operator in a compound assignment. */ ++ ++static int ++binop_compound_p (code) ++ enum tree_code code; ++{ ++ int i; ++ for (i = 0; i < BINOP_COMPOUND_CANDIDATES; i++) ++ if (binop_lookup [i] == code) ++ break; ++ ++ return i < BINOP_COMPOUND_CANDIDATES; ++} ++ ++/* Reorganize after a fold to get SAVE_EXPR to generate what we want. */ ++ ++static tree ++java_refold (t) ++ tree t; ++{ ++ tree c, b, ns, decl; ++ ++ if (TREE_CODE (t) != MODIFY_EXPR) ++ return t; ++ ++ c = TREE_OPERAND (t, 1); ++ if (! (c && TREE_CODE (c) == COMPOUND_EXPR ++ && TREE_CODE (TREE_OPERAND (c, 0)) == MODIFY_EXPR ++ && binop_compound_p (TREE_CODE (TREE_OPERAND (c, 1))))) ++ return t; ++ ++ /* Now the left branch of the binary operator. */ ++ b = TREE_OPERAND (TREE_OPERAND (c, 1), 0); ++ if (! (b && TREE_CODE (b) == NOP_EXPR ++ && TREE_CODE (TREE_OPERAND (b, 0)) == SAVE_EXPR)) ++ return t; ++ ++ ns = TREE_OPERAND (TREE_OPERAND (b, 0), 0); ++ if (! (ns && TREE_CODE (ns) == NOP_EXPR ++ && TREE_CODE (TREE_OPERAND (ns, 0)) == SAVE_EXPR)) ++ return t; ++ ++ decl = TREE_OPERAND (TREE_OPERAND (ns, 0), 0); ++ if ((JDECL_P (decl) || TREE_CODE (decl) == COMPONENT_REF) ++ /* It's got to be the an equivalent decl */ ++ && java_decl_equiv (decl, TREE_OPERAND (TREE_OPERAND (c, 0), 0))) ++ { ++ /* Shorten the NOP_EXPR/SAVE_EXPR path. */ ++ TREE_OPERAND (TREE_OPERAND (c, 1), 0) = TREE_OPERAND (ns, 0); ++ /* Substitute the COMPOUND_EXPR by the BINOP_EXPR */ ++ TREE_OPERAND (t, 1) = TREE_OPERAND (c, 1); ++ /* Change the right part of the BINOP_EXPR */ ++ TREE_OPERAND (TREE_OPERAND (t, 1), 1) = TREE_OPERAND (c, 0); ++ } ++ ++ return t; ++} ++ + /* Binary operators (15.16 up to 15.18). We return error_mark_node on + errors but we modify NODE so that it contains the type computed + according to the expression, when it's fixed. Otherwise, we write +@@ -12046,6 +12327,12 @@ + if (code == RDIV_EXPR && TREE_CODE (prom_type) == INTEGER_TYPE) + TREE_SET_CODE (node, TRUNC_DIV_EXPR); + ++ if (TREE_CODE (prom_type) == INTEGER_TYPE ++ && flag_use_divide_subroutine ++ && ! flag_emit_class_files ++ && (code == RDIV_EXPR || code == TRUNC_MOD_EXPR)) ++ return build_java_soft_divmod (TREE_CODE (node), prom_type, op1, op2); ++ + /* This one is more complicated. FLOATs are processed by a + function call to soft_fmod. Duplicate the value of the + COMPOUND_ASSIGN_P flag. */ +@@ -12658,7 +12945,7 @@ + case PREINCREMENT_EXPR: + /* 15.14.2 Prefix Decrement Operator -- */ + case PREDECREMENT_EXPR: +- decl = strip_out_static_field_access_decl (op); ++ op = decl = strip_out_static_field_access_decl (op); + /* We really should have a JAVA_ARRAY_EXPR to avoid this */ + if (!JDECL_P (decl) + && TREE_CODE (decl) != COMPONENT_REF +@@ -12697,15 +12984,28 @@ + else + { + /* Before the addition, binary numeric promotion is performed on +- both operands */ +- value = build_int_2 (1, 0); +- TREE_TYPE (node) = +- binary_numeric_promotion (op_type, TREE_TYPE (value), &op, &value); +- /* And write the promoted incremented and increment */ ++ both operands, if really necessary */ ++ if (JINTEGRAL_TYPE_P (op_type)) ++ { ++ value = build_int_2 (1, 0); ++ TREE_TYPE (value) = TREE_TYPE (node) = op_type; ++ } ++ else ++ { ++ value = build_int_2 (1, 0); ++ TREE_TYPE (node) = ++ binary_numeric_promotion (op_type, ++ TREE_TYPE (value), &op, &value); ++ } ++ /* And write back into the node. */ + TREE_OPERAND (node, 0) = op; + TREE_OPERAND (node, 1) = value; +- /* Convert the overall back into its original type. */ +- return fold (convert (op_type, node)); ++ /* Convert the overall back into its original type, if ++ necessary, and return */ ++ if (JINTEGRAL_TYPE_P (op_type)) ++ return fold (node); ++ else ++ return fold (convert (op_type, node)); + } + break; + +@@ -13210,6 +13510,7 @@ + new_value = NULL_TREE; + wfl_value = TREE_VALUE (entry); + ++ push_obstacks (&permanent_obstack, &permanent_obstack); + value = java_complete_tree (TREE_VALUE (entry)); + /* patch_string return error_mark_node if arg is error_mark_node */ + if ((patched = patch_string (value))) +@@ -13225,7 +13526,8 @@ + new_value = try_builtin_assignconv (wfl_operator, type, value); + if (!new_value && (new_value = try_reference_assignconv (type, value))) + type_value = promote_type (type); +- ++ ++ pop_obstacks (); + /* Check and report errors */ + if (!new_value) + { +@@ -13564,6 +13866,54 @@ + return loop; + } + ++/* Try to find the loop a block might be related to. This comprises ++ the case where the LOOP_EXPR is found as the second operand of a ++ COMPOUND_EXPR, because the loop happens to have an initialization ++ part, then expressed as the first operand of the COMPOUND_EXPR. If ++ the search finds something, 1 is returned. Otherwise, 0 is ++ returned. The search is assumed to start from a ++ LABELED_BLOCK_EXPR's block. */ ++ ++static tree ++search_loop (statement) ++ tree statement; ++{ ++ if (TREE_CODE (statement) == LOOP_EXPR) ++ return statement; ++ ++ if (TREE_CODE (statement) == BLOCK) ++ statement = BLOCK_SUBBLOCKS (statement); ++ else ++ return NULL_TREE; ++ ++ if (statement && TREE_CODE (statement) == COMPOUND_EXPR) ++ while (statement && TREE_CODE (statement) == COMPOUND_EXPR) ++ statement = TREE_OPERAND (statement, 1); ++ ++ return (TREE_CODE (statement) == LOOP_EXPR ++ && IS_FOR_LOOP_P (statement) ? statement : NULL_TREE); ++} ++ ++/* Return 1 if LOOP can be found in the labeled block BLOCK. 0 is ++ returned otherwise. */ ++ ++static int ++labeled_block_contains_loop_p (block, loop) ++ tree block, loop; ++{ ++ if (!block) ++ return 0; ++ ++ if (LABELED_BLOCK_BODY (block) == loop) ++ return 1; ++ ++ if (IS_FOR_LOOP_P (loop) ++ && search_loop (LABELED_BLOCK_BODY (block)) == loop) ++ return 1; ++ ++ return 0; ++} ++ + /* If the loop isn't surrounded by a labeled statement, create one and + insert LOOP as its body. */ + +@@ -13572,33 +13922,17 @@ + tree loop; + { + tree loop_label; +- tree block = ctxp->current_labeled_block; ++ + TREE_TYPE (loop) = void_type_node; +- if (block != NULL_TREE) +- { +- tree block_body = LABELED_BLOCK_BODY (block); +- if (IS_FOR_LOOP_P (loop)) +- { +- if (TREE_CODE (block_body) == BLOCK) +- { +- block_body = BLOCK_EXPR_BODY (block_body); +- if (block_body == loop +- || (TREE_CODE (block_body) == COMPOUND_EXPR +- && TREE_OPERAND (block_body, 1) == loop)) +- return loop; +- } +- } +- else +- { +- if (block_body == loop) +- return loop; +- } +- } ++ if (labeled_block_contains_loop_p (ctxp->current_labeled_block, loop)) ++ return loop; ++ + loop_label = build_labeled_block (0, NULL_TREE); ++ /* LOOP is an EXPR node, so it should have a valid EXPR_WFL_LINECOL ++ that LOOP_LABEL could enquire about, for a better accuracy. FIXME */ + LABELED_BLOCK_BODY (loop_label) = loop; + PUSH_LABELED_BLOCK (loop_label); +- loop = loop_label; +- return loop; ++ return loop_label; + } + + /* 14.13, 14.14: break and continue Statements */ +@@ -13690,7 +14024,7 @@ + } + target_stmt = LABELED_BLOCK_BODY (labeled_block); + if (TREE_CODE (target_stmt) == SWITCH_EXPR +- || TREE_CODE (target_stmt) == LOOP_EXPR) ++ || search_loop (target_stmt)) + { + bc_label = labeled_block; + break; +@@ -13704,7 +14038,7 @@ + /* Our break/continue don't return values. */ + TREE_TYPE (node) = void_type_node; + /* Encapsulate the break within a compound statement so that it's +- expanded all the times by expand_expr (and not clobered ++ expanded all the times by expand_expr (and not clobbered + sometimes, like after a if statement) */ + node = add_stmt_to_compound (NULL_TREE, void_type_node, node); + TREE_SIDE_EFFECTS (node) = 1; +@@ -14099,11 +14433,20 @@ + continue; + #endif + EXPR_WFL_LINECOL (wfl_operator) = location; +- parse_error_context +- (wfl_operator, "Exception `%s' must be caught, or it must be " +- "declared in the `throws' clause of `%s'", +- lang_printable_name (TREE_VALUE (throws), 0), +- IDENTIFIER_POINTER (DECL_NAME (current_function_decl))); ++ if (DECL_NAME (current_function_decl) == finit_identifier_node) ++ parse_error_context ++ (wfl_operator, "Exception `%s' can't be thrown in initializer", ++ lang_printable_name (TREE_VALUE (throws), 0)); ++ else ++ { ++ parse_error_context ++ (wfl_operator, "Exception `%s' must be caught, or it must be " ++ "declared in the `throws' clause of `%s'", ++ lang_printable_name (TREE_VALUE (throws), 0), ++ (DECL_NAME (current_function_decl) == init_identifier_node ? ++ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))) : ++ IDENTIFIER_POINTER (DECL_NAME (current_function_decl)))); ++ } + } + } + +Only in gcc-2.95.2/gcc/java: parse.c.orig +Only in gcc-2.95.2/gcc/java: parse.c.rej +diff -u -r gcc-2.95.2-orig/gcc/java/parse.y gcc-2.95.2/gcc/java/parse.y +--- gcc-2.95.2-orig/gcc/java/parse.y Mon Jun 28 15:56:22 1999 ++++ gcc-2.95.2/gcc/java/parse.y Sun Oct 31 21:27:43 1999 +@@ -91,6 +91,7 @@ + static void parse_warning_context PVPROTO ((tree cl, const char *msg, ...)) + ATTRIBUTE_PRINTF_2; + static void issue_warning_error_from_context PROTO ((tree, const char *msg, va_list)); ++static void parse_ctor_invocation_error PROTO ((void)); + static tree parse_jdk1_1_error PROTO ((char *)); + static void complete_class_report_errors PROTO ((jdep *)); + static int process_imports PROTO ((void)); +@@ -243,6 +244,7 @@ + static tree strip_out_static_field_access_decl PROTO ((tree)); + static jdeplist *reverse_jdep_list PROTO ((struct parser_ctxt *)); + static void static_ref_err PROTO ((tree, tree, tree)); ++static tree java_refold PROTO ((tree)); + + /* Number of error found so far. */ + int java_error_count; +@@ -274,6 +276,10 @@ + binop_lookup [((VALUE) - PLUS_TK)% \ + (sizeof (binop_lookup) / sizeof (binop_lookup[0]))] + ++/* This is the end index for binary operators that can also be used ++ in compound assignements. */ ++#define BINOP_COMPOUND_CANDIDATES 11 ++ + /* Fake WFL used to report error message. It is initialized once if + needed and reused with it's location information is overriden. */ + tree wfl_operator = NULL_TREE; +@@ -1318,16 +1324,14 @@ + {yyerror ("')' expected"); RECOVER;} + | this_or_super OP_TK CP_TK error + { +- yyerror ("Constructor invocation must be first " +- "thing in a constructor"); ++ parse_ctor_invocation_error (); + RECOVER; + } + | this_or_super OP_TK argument_list error + {yyerror ("')' expected"); RECOVER;} + | this_or_super OP_TK argument_list CP_TK error + { +- yyerror ("Constructor invocation must be first " +- "thing in a constructor"); ++ parse_ctor_invocation_error (); + RECOVER; + } + | name DOT_TK SUPER_TK error +@@ -2409,7 +2413,17 @@ + free (toFree); + } + +-/* Reporting JDK1.1 features not implemented */ ++/* Reporting an constructor invocation error. */ ++static void ++parse_ctor_invocation_error () ++{ ++ if (DECL_CONSTRUCTOR_P (current_function_decl)) ++ yyerror ("Constructor invocation must be first thing in a constructor"); ++ else ++ yyerror ("Only constructors can invoke constructors"); ++} ++ ++/* Reporting JDK1.1 features not implemented. */ + + static tree + parse_jdk1_1_error (msg) +@@ -3318,13 +3332,18 @@ + { + tree meth = TREE_VALUE (mdecl); + tree id = TREE_PURPOSE (mdecl); +- tree this_class = TREE_TYPE (ctxp->current_parsed_class); + tree type_wfl = NULL_TREE; +- tree meth_name = NULL_TREE, current, orig_arg; ++ tree meth_name = NULL_TREE; ++ tree current, orig_arg, this_class; + int saved_lineno; + int constructor_ok = 0, must_chain; + + check_modifiers_consistency (flags); ++ ++ if (ctxp->current_parsed_class) ++ this_class = TREE_TYPE (ctxp->current_parsed_class); ++ else ++ return NULL_TREE; + + /* There are some forbidden modifiers for an abstract method and its + class must be abstract as well. */ +@@ -3520,7 +3539,12 @@ + finish_method_declaration (method_body) + tree method_body; + { +- int flags = get_access_flags_from_decl (current_function_decl); ++ int flags; ++ ++ if (!current_function_decl) ++ return; ++ ++ flags = get_access_flags_from_decl (current_function_decl); + + /* 8.4.5 Method Body */ + if ((flags & ACC_ABSTRACT || flags & ACC_NATIVE) && method_body) +@@ -4335,7 +4359,9 @@ + + /* Resolve and layout if necessary */ + layout_class_methods (TREE_TYPE (decl)); +- if (CLASS_FROM_SOURCE_P (TREE_TYPE (decl))) ++ /* Check methods, but only once */ ++ if (CLASS_FROM_SOURCE_P (TREE_TYPE (decl)) ++ && !CLASS_LOADED_P (TREE_TYPE (decl))) + CHECK_METHODS (decl); + if (TREE_TYPE (decl) != current_class && !CLASS_LOADED_P (TREE_TYPE (decl))) + safe_layout_class (TREE_TYPE (decl)); +@@ -4516,7 +4542,7 @@ + + /* Track method being redefined inside the same class. As a side + effect, set DECL_NAME to an IDENTIFIER (prior entering this +- function it's a FWL, so we can track errors more accurately */ ++ function it's a FWL, so we can track errors more accurately.) */ + + static int + check_method_redefinition (class, method) +@@ -4552,9 +4578,126 @@ + return 0; + } + +-/* Check all the methods of CLASS. Methods are first completed then +- checked according to regular method existance rules. +- If no constructor were encountered, then build its declaration. */ ++static void ++check_abstract_method_definitions (do_interface, class_decl, type) ++ int do_interface; ++ tree class_decl, type; ++{ ++ tree class = TREE_TYPE (class_decl); ++ tree method, end_type; ++ ++ end_type = (do_interface ? object_type_node : type); ++ for (method = TYPE_METHODS (type); method; method = TREE_CHAIN (method)) ++ { ++ tree other_super, other_method, method_sig, method_name; ++ int found = 0; ++ ++ if (!METHOD_ABSTRACT (method) || METHOD_FINAL (method)) ++ continue; ++ ++ /* Now verify that somewhere in between TYPE and CLASS, ++ abstract method METHOD gets a non abstract definition ++ that is inherited by CLASS. */ ++ ++ method_sig = build_java_signature (TREE_TYPE (method)); ++ method_name = DECL_NAME (method); ++ if (TREE_CODE (method_name) == EXPR_WITH_FILE_LOCATION) ++ method_name = EXPR_WFL_NODE (method_name); ++ ++ for (other_super = class; other_super != end_type; ++ other_super = CLASSTYPE_SUPER (other_super)) ++ { ++ for (other_method = TYPE_METHODS (other_super); other_method; ++ other_method = TREE_CHAIN (other_method)) ++ { ++ tree s = build_java_signature (TREE_TYPE (other_method)); ++ tree other_name = DECL_NAME (other_method); ++ ++ if (TREE_CODE (other_name) == EXPR_WITH_FILE_LOCATION) ++ other_name = EXPR_WFL_NODE (other_name); ++ if (!IS_CLINIT (other_method) ++ && !DECL_CONSTRUCTOR_P (other_method) ++ && method_name == other_name && method_sig == s) ++ { ++ found = 1; ++ break; ++ } ++ } ++ } ++ ++ /* Report that abstract METHOD didn't find an implementation ++ that CLASS can use. */ ++ if (!found) ++ { ++ char *t = strdup (lang_printable_name ++ (TREE_TYPE (TREE_TYPE (method)), 0)); ++ tree ccn = DECL_NAME (TYPE_NAME (DECL_CONTEXT (method))); ++ tree saved_wfl = NULL_TREE; ++ ++ if (TREE_CODE (DECL_NAME (method)) == EXPR_WITH_FILE_LOCATION) ++ { ++ saved_wfl = DECL_NAME (method); ++ DECL_NAME (method) = EXPR_WFL_NODE (DECL_NAME (method)); ++ } ++ ++ parse_error_context ++ (lookup_cl (class_decl), ++ "Class `%s' doesn't define the abstract method `%s %s' from " ++ "%s `%s'. This method must be defined or %s `%s' must be " ++ "declared abstract", ++ IDENTIFIER_POINTER (DECL_NAME (class_decl)), ++ t, lang_printable_name (method, 0), ++ (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method))) ? ++ "interface" : "class"), ++ IDENTIFIER_POINTER (ccn), ++ (CLASS_INTERFACE (class_decl) ? "interface" : "class"), ++ IDENTIFIER_POINTER (DECL_NAME (class_decl))); ++ ++ free (t); ++ ++ if (saved_wfl) ++ DECL_NAME (method) = saved_wfl; ++ } ++ } ++} ++ ++/* Check that CLASS_DECL somehoow implements all inherited abstract ++ methods. */ ++ ++static void ++java_check_abstract_method_definitions (class_decl) ++ tree class_decl; ++{ ++ tree class = TREE_TYPE (class_decl); ++ tree super, vector; ++ int i; ++ ++ if (CLASS_ABSTRACT (class_decl)) ++ return; ++ ++ /* Check for inherited types */ ++ for (super = CLASSTYPE_SUPER (class); super != object_type_node; ++ super = CLASSTYPE_SUPER (super)) ++ { ++ if (!CLASS_ABSTRACT (TYPE_NAME (super))) ++ continue; ++ ++ check_abstract_method_definitions (0, class_decl, super); ++ } ++ ++ /* Check for implemented interfaces. */ ++ vector = TYPE_BINFO_BASETYPES (class); ++ for (i = 1; i < TREE_VEC_LENGTH (vector); i++) ++ { ++ super = BINFO_TYPE (TREE_VEC_ELT (vector, i)); ++ check_abstract_method_definitions (1, class_decl, super); ++ } ++} ++ ++/* Check all the methods of CLASS_DECL. Methods are first completed ++ then checked according to regular method existance rules. If no ++ constructor for CLASS_DECL were encountered, then build its ++ declaration. */ + + static void + java_check_regular_methods (class_decl) +@@ -4730,7 +4873,7 @@ + + /* Don't forget eventual pending found and saved_found_wfl. Take + into account that we might have exited because we saw an +- aritifical method as the last entry. */ ++ artificial method as the last entry. */ + + if (found && !DECL_ARTIFICIAL (found) && saved_found_wfl) + DECL_NAME (found) = saved_found_wfl; +@@ -4738,6 +4881,10 @@ + if (!TYPE_NVIRTUALS (class)) + TYPE_METHODS (class) = nreverse (TYPE_METHODS (class)); + ++ /* Search for inherited abstract method not yet implemented in this ++ class. */ ++ java_check_abstract_method_definitions (class_decl); ++ + if (!saw_constructor) + { + /* No constructor seen, we craft one, at line 0. Since this +@@ -4943,14 +5090,15 @@ + return NULL_TREE; + } + +-/* Return the line that matches DECL line number. Used during error +- report */ ++/* Return the line that matches DECL line number, and try its best to ++ position the column number. Used during error reports. */ + + static tree + lookup_cl (decl) + tree decl; + { + static tree cl = NULL_TREE; ++ char *line, *found; + + if (!decl) + return NULL_TREE; +@@ -4961,6 +5109,14 @@ + EXPR_WFL_FILENAME_NODE (cl) = get_identifier (DECL_SOURCE_FILE (decl)); + EXPR_WFL_SET_LINECOL (cl, DECL_SOURCE_LINE_FIRST (decl), -1); + ++ line = java_get_line_col (IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE (cl)), ++ EXPR_WFL_LINENO (cl), EXPR_WFL_COLNO (cl)); ++ ++ found = strstr ((const char *)line, ++ (const char *)IDENTIFIER_POINTER (DECL_NAME (decl))); ++ if (found) ++ EXPR_WFL_SET_LINECOL (cl, EXPR_WFL_LINENO (cl), found - line); ++ + return cl; + } + +@@ -5495,6 +5651,9 @@ + tree parm_decl; + int i; + ++ if (!fndecl) ++ return; ++ + current_function_decl = fndecl; + + /* New scope for the function */ +@@ -5614,6 +5773,9 @@ + tree fndecl = current_function_decl; + int flag_asynchronous_exceptions = asynchronous_exceptions; + ++ if (!fndecl) ++ return; ++ + java_parser_context_save_global (); + lineno = ctxp->last_ccb_indent1; + +@@ -5669,6 +5831,8 @@ + java_method_add_stmt (fndecl, expr) + tree fndecl, expr; + { ++ if (!GET_CURRENT_BLOCK (fndecl)) ++ return NULL_TREE; + return add_stmt_to_block (GET_CURRENT_BLOCK (fndecl), NULL_TREE, expr); + } + +@@ -6067,7 +6231,8 @@ + for (mdecl = TYPE_METHODS (class); mdecl; mdecl = TREE_CHAIN (mdecl)) + { + if (DECL_CONSTRUCTOR_P (mdecl) +- && TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (mdecl))) == end_params_node) ++ && TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (mdecl))) ++ == end_params_node) + return 0; + } + } +@@ -6410,6 +6575,8 @@ + == soft_initclass_node) + return TREE_OPERAND (op1, 1); + } ++ else if (JDECL_P (op1)) ++ return op1; + } + return node; + } +@@ -6431,6 +6598,8 @@ + for (q = EXPR_WFL_QUALIFICATION (wfl); q; q = TREE_CHAIN (q)) + { + tree qual_wfl = QUAL_WFL (q); ++ tree ret_decl; /* for EH checking */ ++ int location; /* for EH checking */ + + /* 15.10.1 Field Access Using a Primary */ + switch (TREE_CODE (qual_wfl)) +@@ -6449,14 +6618,21 @@ + /* And code for the function call */ + if (complete_function_arguments (qual_wfl)) + return 1; ++ + if (from_super && TREE_CODE (qual_wfl) == CALL_EXPR) + CALL_USING_SUPER (qual_wfl) = 1; +- *where_found = +- patch_method_invocation (qual_wfl, decl, type, &is_static, NULL); ++ location = (TREE_CODE (qual_wfl) == CALL_EXPR ? ++ EXPR_WFL_LINECOL (TREE_OPERAND (qual_wfl, 0)) : 0); ++ *where_found = patch_method_invocation (qual_wfl, decl, type, ++ &is_static, &ret_decl); + if (*where_found == error_mark_node) + return 1; + *type_found = type = QUAL_DECL_TYPE (*where_found); + ++ /* EH check */ ++ if (location) ++ check_thrown_exceptions (location, ret_decl); ++ + /* If the previous call was static and this one is too, + build a compound expression to hold the two (because in + that case, previous function calls aren't transported as +@@ -6491,6 +6667,7 @@ + + case CONDITIONAL_EXPR: + case STRING_CST: ++ case MODIFY_EXPR: + *where_found = decl = java_complete_tree (qual_wfl); + if (decl == error_mark_node) + return 1; +@@ -7228,6 +7405,11 @@ + if (JPRIMITIVE_TYPE_P (TREE_TYPE (TREE_VALUE (ta))) && + TREE_TYPE (TREE_VALUE (ta)) != TREE_VALUE (t)) + TREE_VALUE (ta) = convert (TREE_VALUE (t), TREE_VALUE (ta)); ++ ++ /* Resolve unresolved returned type isses */ ++ t = TREE_TYPE (TREE_TYPE (method)); ++ if (TREE_CODE (t) == POINTER_TYPE && !CLASS_LOADED_P (TREE_TYPE (t))) ++ resolve_and_layout (TREE_TYPE (t), NULL); + + if (flag_emit_class_files || flag_emit_xref) + func = method; +@@ -7388,7 +7570,7 @@ + parse_error_context (cl, "Can't find %s `%s(%s)' in class `%s'%s", + (lc ? "constructor" : "method"), + (lc ? +- IDENTIFIER_POINTER(DECL_NAME (TYPE_NAME (class))) : ++ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class))) : + IDENTIFIER_POINTER (name)), + IDENTIFIER_POINTER (signature), + IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class))), +@@ -7407,7 +7589,8 @@ + tree list = NULL_TREE, all_list = NULL_TREE; + + /* Search interfaces */ +- if (CLASS_INTERFACE (TYPE_NAME (class))) ++ if (CLASS_INTERFACE (TYPE_NAME (class)) ++ || CLASS_ABSTRACT (TYPE_NAME (class))) + { + static tree searched_interfaces = NULL_TREE; + static int search_not_done = 0; +@@ -7638,7 +7821,7 @@ + break; + case NEW_ARRAY_EXPR: + qual = TREE_CHAIN (qual); +- new_array_found = 1; ++ again = new_array_found = 1; + continue; + case NEW_CLASS_EXPR: + case CONVERT_EXPR: +@@ -7666,12 +7849,8 @@ + && TREE_CODE (TREE_TYPE (qual_wfl)) == EXPR_WITH_FILE_LOCATION) + name = EXPR_WFL_NODE (TREE_TYPE (qual_wfl)); + +- else if (code == ARRAY_REF && +- TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION) +- name = EXPR_WFL_NODE (TREE_OPERAND (qual_wfl, 0)); +- +- else if (code == CALL_EXPR && +- TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION) ++ else if ((code == ARRAY_REF || code == CALL_EXPR || code == MODIFY_EXPR) && ++ TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION) + name = EXPR_WFL_NODE (TREE_OPERAND (qual_wfl, 0)); + + else if (code == STRING_CST || code == CONDITIONAL_EXPR) +@@ -7681,8 +7860,15 @@ + again = 1; + } + else +- name = EXPR_WFL_NODE (qual_wfl); +- ++ { ++ name = EXPR_WFL_NODE (qual_wfl); ++ if (!name) ++ { ++ qual = EXPR_WFL_QUALIFICATION (qual_wfl); ++ again = 1; ++ } ++ } ++ + /* If we have a THIS (from a primary), we set the context accordingly */ + if (name == this_identifier_node) + { +@@ -7716,7 +7902,8 @@ + declaration or parameter declaration, then it is an expression + name. We don't carry this test out if we're in the context of the + use of SUPER or THIS */ +- if (!this_found && !super_found && (decl = IDENTIFIER_LOCAL_VALUE (name))) ++ if (!this_found && !super_found && ++ TREE_CODE (name) != STRING_CST && (decl = IDENTIFIER_LOCAL_VALUE (name))) + { + RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1; + QUAL_RESOLUTION (qual) = decl; +@@ -7733,15 +7920,17 @@ + QUAL_RESOLUTION (qual) = (new_array_found ? NULL_TREE : decl); + } + +- /* We reclassify NAME as a type name if: ++ /* We reclassify NAME as yielding to a type name resolution if: + - NAME is a class/interface declared within the compilation + unit containing NAME, + - NAME is imported via a single-type-import declaration, + - NAME is declared in an another compilation unit of the package + of the compilation unit containing NAME, + - NAME is declared by exactly on type-import-on-demand declaration +- of the compilation unit containing NAME. */ +- else if ((decl = resolve_and_layout (name, NULL_TREE))) ++ of the compilation unit containing NAME. ++ - NAME is actually a STRING_CST. */ ++ else if (TREE_CODE (name) == STRING_CST || ++ (decl = resolve_and_layout (name, NULL_TREE))) + { + RESOLVE_TYPE_NAME_P (qual_wfl) = 1; + QUAL_RESOLUTION (qual) = decl; +@@ -7826,7 +8015,9 @@ + { + tree value = DECL_INITIAL (node); + DECL_INITIAL (node) = NULL_TREE; ++ push_obstacks (&permanent_obstack, &permanent_obstack); + value = fold_constant_for_init (value, node); ++ pop_obstacks (); + DECL_INITIAL (node) = value; + if (value != NULL_TREE) + return value; +@@ -7846,8 +8037,7 @@ + TREE_OPERAND (node, 1) = java_stabilize_reference (op1); + return node; + } +- else +- return stabilize_reference (node); ++ return stabilize_reference (node); + } + + /* Patch tree nodes in a function body. When a BLOCK is found, push +@@ -8029,8 +8219,12 @@ + && JDECL_P (TREE_OPERAND (cn, 1)) + && FIELD_FINAL (TREE_OPERAND (cn, 1)) + && DECL_INITIAL (TREE_OPERAND (cn, 1))) +- cn = fold_constant_for_init (DECL_INITIAL (TREE_OPERAND (cn, 1)), +- TREE_OPERAND (cn, 1)); ++ { ++ push_obstacks (&permanent_obstack, &permanent_obstack); ++ cn = fold_constant_for_init (DECL_INITIAL (TREE_OPERAND (cn, 1)), ++ TREE_OPERAND (cn, 1)); ++ pop_obstacks (); ++ } + + if (!TREE_CONSTANT (cn) && !flag_emit_xref) + { +@@ -8283,7 +8477,11 @@ + && TREE_CODE (nn) == VAR_DECL && TREE_STATIC (nn) + && DECL_INITIAL (nn) != NULL_TREE) + { +- tree value = fold_constant_for_init (nn, nn); ++ tree value; ++ ++ push_obstacks (&permanent_obstack, &permanent_obstack); ++ value = fold_constant_for_init (nn, nn); ++ pop_obstacks (); + if (value != NULL_TREE) + { + tree type = TREE_TYPE (value); +@@ -8297,14 +8495,17 @@ + if (TREE_OPERAND (node, 0) == error_mark_node) + return error_mark_node; + +- if (COMPOUND_ASSIGN_P (wfl_op2)) ++ flag = COMPOUND_ASSIGN_P (wfl_op2); ++ if (flag) + { + tree lvalue = java_stabilize_reference (TREE_OPERAND (node, 0)); + + /* Hand stablize the lhs on both places */ + TREE_OPERAND (node, 0) = lvalue; +- TREE_OPERAND (TREE_OPERAND (node, 1), 0) = lvalue; ++ TREE_OPERAND (TREE_OPERAND (node, 1), 0) = ++ (flag_emit_class_files ? lvalue : save_expr (lvalue)); + ++ /* 15.25.2.a: Left hand is not an array access. FIXME */ + /* Now complete the RHS. We write it back later on. */ + nn = java_complete_tree (TREE_OPERAND (node, 1)); + +@@ -8315,6 +8516,8 @@ + E1 = (T)(E1 op E2), with T being the type of E1. */ + nn = java_complete_tree (build_cast (EXPR_WFL_LINECOL (wfl_op2), + TREE_TYPE (lvalue), nn)); ++ ++ /* 15.25.2.b: Left hand is an array access. FIXME */ + } + + /* If we're about to patch a NEW_ARRAY_INIT, we call a special +@@ -8338,6 +8541,10 @@ + if ((nn = patch_string (TREE_OPERAND (node, 1)))) + TREE_OPERAND (node, 1) = nn; + node = patch_assignment (node, wfl_op1, wfl_op2); ++ /* Reorganize the tree if necessary. */ ++ if (flag && (!JREFERENCE_TYPE_P (TREE_TYPE (node)) ++ || JSTRING_P (TREE_TYPE (node)))) ++ node = java_refold (node); + CAN_COMPLETE_NORMALLY (node) = 1; + return node; + +@@ -9346,6 +9553,81 @@ + #undef BUILD_OPERATOR_STRING + } + ++/* Return 1 if VAR_ACCESS1 is equivalent to VAR_ACCESS2. */ ++ ++static int ++java_decl_equiv (var_acc1, var_acc2) ++ tree var_acc1, var_acc2; ++{ ++ if (JDECL_P (var_acc1)) ++ return (var_acc1 == var_acc2); ++ ++ return (TREE_CODE (var_acc1) == COMPONENT_REF ++ && TREE_CODE (var_acc2) == COMPONENT_REF ++ && TREE_OPERAND (TREE_OPERAND (var_acc1, 0), 0) ++ == TREE_OPERAND (TREE_OPERAND (var_acc2, 0), 0) ++ && TREE_OPERAND (var_acc1, 1) == TREE_OPERAND (var_acc2, 1)); ++} ++ ++/* Return a non zero value if CODE is one of the operators that can be ++ used in conjunction with the `=' operator in a compound assignment. */ ++ ++static int ++binop_compound_p (code) ++ enum tree_code code; ++{ ++ int i; ++ for (i = 0; i < BINOP_COMPOUND_CANDIDATES; i++) ++ if (binop_lookup [i] == code) ++ break; ++ ++ return i < BINOP_COMPOUND_CANDIDATES; ++} ++ ++/* Reorganize after a fold to get SAVE_EXPR to generate what we want. */ ++ ++static tree ++java_refold (t) ++ tree t; ++{ ++ tree c, b, ns, decl; ++ ++ if (TREE_CODE (t) != MODIFY_EXPR) ++ return t; ++ ++ c = TREE_OPERAND (t, 1); ++ if (! (c && TREE_CODE (c) == COMPOUND_EXPR ++ && TREE_CODE (TREE_OPERAND (c, 0)) == MODIFY_EXPR ++ && binop_compound_p (TREE_CODE (TREE_OPERAND (c, 1))))) ++ return t; ++ ++ /* Now the left branch of the binary operator. */ ++ b = TREE_OPERAND (TREE_OPERAND (c, 1), 0); ++ if (! (b && TREE_CODE (b) == NOP_EXPR ++ && TREE_CODE (TREE_OPERAND (b, 0)) == SAVE_EXPR)) ++ return t; ++ ++ ns = TREE_OPERAND (TREE_OPERAND (b, 0), 0); ++ if (! (ns && TREE_CODE (ns) == NOP_EXPR ++ && TREE_CODE (TREE_OPERAND (ns, 0)) == SAVE_EXPR)) ++ return t; ++ ++ decl = TREE_OPERAND (TREE_OPERAND (ns, 0), 0); ++ if ((JDECL_P (decl) || TREE_CODE (decl) == COMPONENT_REF) ++ /* It's got to be the an equivalent decl */ ++ && java_decl_equiv (decl, TREE_OPERAND (TREE_OPERAND (c, 0), 0))) ++ { ++ /* Shorten the NOP_EXPR/SAVE_EXPR path. */ ++ TREE_OPERAND (TREE_OPERAND (c, 1), 0) = TREE_OPERAND (ns, 0); ++ /* Substitute the COMPOUND_EXPR by the BINOP_EXPR */ ++ TREE_OPERAND (t, 1) = TREE_OPERAND (c, 1); ++ /* Change the right part of the BINOP_EXPR */ ++ TREE_OPERAND (TREE_OPERAND (t, 1), 1) = TREE_OPERAND (c, 0); ++ } ++ ++ return t; ++} ++ + /* Binary operators (15.16 up to 15.18). We return error_mark_node on + errors but we modify NODE so that it contains the type computed + according to the expression, when it's fixed. Otherwise, we write +@@ -9392,6 +9674,12 @@ + if (code == RDIV_EXPR && TREE_CODE (prom_type) == INTEGER_TYPE) + TREE_SET_CODE (node, TRUNC_DIV_EXPR); + ++ if (TREE_CODE (prom_type) == INTEGER_TYPE ++ && flag_use_divide_subroutine ++ && ! flag_emit_class_files ++ && (code == RDIV_EXPR || code == TRUNC_MOD_EXPR)) ++ return build_java_soft_divmod (TREE_CODE (node), prom_type, op1, op2); ++ + /* This one is more complicated. FLOATs are processed by a + function call to soft_fmod. Duplicate the value of the + COMPOUND_ASSIGN_P flag. */ +@@ -10004,7 +10292,7 @@ + case PREINCREMENT_EXPR: + /* 15.14.2 Prefix Decrement Operator -- */ + case PREDECREMENT_EXPR: +- decl = strip_out_static_field_access_decl (op); ++ op = decl = strip_out_static_field_access_decl (op); + /* We really should have a JAVA_ARRAY_EXPR to avoid this */ + if (!JDECL_P (decl) + && TREE_CODE (decl) != COMPONENT_REF +@@ -10043,15 +10331,28 @@ + else + { + /* Before the addition, binary numeric promotion is performed on +- both operands */ +- value = build_int_2 (1, 0); +- TREE_TYPE (node) = +- binary_numeric_promotion (op_type, TREE_TYPE (value), &op, &value); +- /* And write the promoted incremented and increment */ ++ both operands, if really necessary */ ++ if (JINTEGRAL_TYPE_P (op_type)) ++ { ++ value = build_int_2 (1, 0); ++ TREE_TYPE (value) = TREE_TYPE (node) = op_type; ++ } ++ else ++ { ++ value = build_int_2 (1, 0); ++ TREE_TYPE (node) = ++ binary_numeric_promotion (op_type, ++ TREE_TYPE (value), &op, &value); ++ } ++ /* And write back into the node. */ + TREE_OPERAND (node, 0) = op; + TREE_OPERAND (node, 1) = value; +- /* Convert the overall back into its original type. */ +- return fold (convert (op_type, node)); ++ /* Convert the overall back into its original type, if ++ necessary, and return */ ++ if (JINTEGRAL_TYPE_P (op_type)) ++ return fold (node); ++ else ++ return fold (convert (op_type, node)); + } + break; + +@@ -10556,6 +10857,7 @@ + new_value = NULL_TREE; + wfl_value = TREE_VALUE (entry); + ++ push_obstacks (&permanent_obstack, &permanent_obstack); + value = java_complete_tree (TREE_VALUE (entry)); + /* patch_string return error_mark_node if arg is error_mark_node */ + if ((patched = patch_string (value))) +@@ -10571,7 +10873,8 @@ + new_value = try_builtin_assignconv (wfl_operator, type, value); + if (!new_value && (new_value = try_reference_assignconv (type, value))) + type_value = promote_type (type); +- ++ ++ pop_obstacks (); + /* Check and report errors */ + if (!new_value) + { +@@ -10910,6 +11213,54 @@ + return loop; + } + ++/* Try to find the loop a block might be related to. This comprises ++ the case where the LOOP_EXPR is found as the second operand of a ++ COMPOUND_EXPR, because the loop happens to have an initialization ++ part, then expressed as the first operand of the COMPOUND_EXPR. If ++ the search finds something, 1 is returned. Otherwise, 0 is ++ returned. The search is assumed to start from a ++ LABELED_BLOCK_EXPR's block. */ ++ ++static tree ++search_loop (statement) ++ tree statement; ++{ ++ if (TREE_CODE (statement) == LOOP_EXPR) ++ return statement; ++ ++ if (TREE_CODE (statement) == BLOCK) ++ statement = BLOCK_SUBBLOCKS (statement); ++ else ++ return NULL_TREE; ++ ++ if (statement && TREE_CODE (statement) == COMPOUND_EXPR) ++ while (statement && TREE_CODE (statement) == COMPOUND_EXPR) ++ statement = TREE_OPERAND (statement, 1); ++ ++ return (TREE_CODE (statement) == LOOP_EXPR ++ && IS_FOR_LOOP_P (statement) ? statement : NULL_TREE); ++} ++ ++/* Return 1 if LOOP can be found in the labeled block BLOCK. 0 is ++ returned otherwise. */ ++ ++static int ++labeled_block_contains_loop_p (block, loop) ++ tree block, loop; ++{ ++ if (!block) ++ return 0; ++ ++ if (LABELED_BLOCK_BODY (block) == loop) ++ return 1; ++ ++ if (IS_FOR_LOOP_P (loop) ++ && search_loop (LABELED_BLOCK_BODY (block)) == loop) ++ return 1; ++ ++ return 0; ++} ++ + /* If the loop isn't surrounded by a labeled statement, create one and + insert LOOP as its body. */ + +@@ -10918,33 +11269,17 @@ + tree loop; + { + tree loop_label; +- tree block = ctxp->current_labeled_block; ++ + TREE_TYPE (loop) = void_type_node; +- if (block != NULL_TREE) +- { +- tree block_body = LABELED_BLOCK_BODY (block); +- if (IS_FOR_LOOP_P (loop)) +- { +- if (TREE_CODE (block_body) == BLOCK) +- { +- block_body = BLOCK_EXPR_BODY (block_body); +- if (block_body == loop +- || (TREE_CODE (block_body) == COMPOUND_EXPR +- && TREE_OPERAND (block_body, 1) == loop)) +- return loop; +- } +- } +- else +- { +- if (block_body == loop) +- return loop; +- } +- } ++ if (labeled_block_contains_loop_p (ctxp->current_labeled_block, loop)) ++ return loop; ++ + loop_label = build_labeled_block (0, NULL_TREE); ++ /* LOOP is an EXPR node, so it should have a valid EXPR_WFL_LINECOL ++ that LOOP_LABEL could enquire about, for a better accuracy. FIXME */ + LABELED_BLOCK_BODY (loop_label) = loop; + PUSH_LABELED_BLOCK (loop_label); +- loop = loop_label; +- return loop; ++ return loop_label; + } + + /* 14.13, 14.14: break and continue Statements */ +@@ -11036,7 +11371,7 @@ + } + target_stmt = LABELED_BLOCK_BODY (labeled_block); + if (TREE_CODE (target_stmt) == SWITCH_EXPR +- || TREE_CODE (target_stmt) == LOOP_EXPR) ++ || search_loop (target_stmt)) + { + bc_label = labeled_block; + break; +@@ -11050,7 +11385,7 @@ + /* Our break/continue don't return values. */ + TREE_TYPE (node) = void_type_node; + /* Encapsulate the break within a compound statement so that it's +- expanded all the times by expand_expr (and not clobered ++ expanded all the times by expand_expr (and not clobbered + sometimes, like after a if statement) */ + node = add_stmt_to_compound (NULL_TREE, void_type_node, node); + TREE_SIDE_EFFECTS (node) = 1; +@@ -11445,11 +11780,20 @@ + continue; + #endif + EXPR_WFL_LINECOL (wfl_operator) = location; +- parse_error_context +- (wfl_operator, "Exception `%s' must be caught, or it must be " +- "declared in the `throws' clause of `%s'", +- lang_printable_name (TREE_VALUE (throws), 0), +- IDENTIFIER_POINTER (DECL_NAME (current_function_decl))); ++ if (DECL_NAME (current_function_decl) == finit_identifier_node) ++ parse_error_context ++ (wfl_operator, "Exception `%s' can't be thrown in initializer", ++ lang_printable_name (TREE_VALUE (throws), 0)); ++ else ++ { ++ parse_error_context ++ (wfl_operator, "Exception `%s' must be caught, or it must be " ++ "declared in the `throws' clause of `%s'", ++ lang_printable_name (TREE_VALUE (throws), 0), ++ (DECL_NAME (current_function_decl) == init_identifier_node ? ++ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))) : ++ IDENTIFIER_POINTER (DECL_NAME (current_function_decl)))); ++ } + } + } + +Only in gcc-2.95.2/gcc/java: parse.y.orig +Only in gcc-2.95.2/gcc/java: parse.y.rej +Only in gcc-2.95.2/gcc/java: super.patch +diff -u -r gcc-2.95.2-orig/gcc/java/typeck.c gcc-2.95.2/gcc/java/typeck.c +--- gcc-2.95.2-orig/gcc/java/typeck.c Fri May 14 02:33:34 1999 ++++ gcc-2.95.2/gcc/java/typeck.c Sat Oct 30 19:45:50 1999 +@@ -55,23 +55,43 @@ + + /* Convert an IEEE real to an integer type. The result of such a + conversion when the source operand is a NaN isn't defined by +- IEEE754, but by the Java language standard: it must be zero. This +- conversion produces something like: +- +- ({ double tmp = expr; (tmp != tmp) ? 0 : (int)tmp; }) +- +- */ ++ IEEE754, but by the Java language standard: it must be zero. Also, ++ overflows must be clipped to within range. This conversion ++ produces something like: ++ ++ ((expr >= (float)MAX_INT) ++ ? MAX_INT ++ : ((expr <= (float)MIN_INT) ++ ? MIN_INT ++ : ((expr != expr) ++ ? 0 ++ : (int)expr))) */ + + static tree + convert_ieee_real_to_integer (type, expr) + tree type, expr; + { ++ tree result; + expr = save_expr (expr); + +- return build (COND_EXPR, type, +- build (NE_EXPR, boolean_type_node, expr, expr), +- convert (type, integer_zero_node), +- convert_to_integer (type, expr)); ++ result = build (COND_EXPR, type, ++ build (NE_EXPR, boolean_type_node, expr, expr), ++ convert (type, integer_zero_node), ++ convert_to_integer (type, expr)); ++ ++ result = build (COND_EXPR, type, ++ build (LE_EXPR, boolean_type_node, expr, ++ convert (TREE_TYPE (expr), TYPE_MIN_VALUE (type))), ++ TYPE_MIN_VALUE (type), ++ result); ++ ++ result = build (COND_EXPR, type, ++ build (GE_EXPR, boolean_type_node, expr, ++ convert (TREE_TYPE (expr), TYPE_MAX_VALUE (type))), ++ TYPE_MAX_VALUE (type), ++ result); ++ ++ return result; + } + + /* Create an expression whose value is that of EXPR, +@@ -100,12 +120,9 @@ + return fold (convert_to_boolean (type, expr)); + if (code == INTEGER_TYPE) + { +- if (TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE +-#ifdef TARGET_SOFT_FLOAT +- && !TARGET_SOFT_FLOAT +-#endif +- && !flag_emit_class_files +- && !flag_fast_math ++ if (! flag_fast_math ++ && ! flag_emit_class_files ++ && TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE + && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT) + return fold (convert_ieee_real_to_integer (type, expr)); + else +Only in gcc-2.95.2/gcc/java: typeck.c.orig +diff -u -r gcc-2.95.2-orig/gcc/java/verify.c gcc-2.95.2/gcc/java/verify.c +--- gcc-2.95.2-orig/gcc/java/verify.c Wed Jun 23 11:33:10 1999 ++++ gcc-2.95.2/gcc/java/verify.c Sun Oct 31 14:53:38 1999 +@@ -397,7 +397,8 @@ + || handler_pc < 0 || handler_pc >= length + || (handler_pc >= start_pc && handler_pc < end_pc) + || ! (instruction_bits [start_pc] & BCODE_INSTRUCTION_START) +- || ! (instruction_bits [end_pc] & BCODE_INSTRUCTION_START) ++ || (end_pc < length && ++ ! (instruction_bits [end_pc] & BCODE_INSTRUCTION_START)) + || ! (instruction_bits [handler_pc] & BCODE_INSTRUCTION_START)) + { + error ("bad pc in exception_table"); diff --git a/gcc-gpc.patch b/gcc-gpc.patch new file mode 100644 index 0000000..5a1e904 --- /dev/null +++ b/gcc-gpc.patch @@ -0,0 +1,361 @@ +Changes for GCC version 2.95.1 for GNU Pascal 2.1 + +Before applying these diffs, go to the directory gcc-2.95.1 +and use the command + + patch -p1 + +feeding it the following diffs as input. + +*** gcc-2.95.1/gcc/expr.c.orig Thu Jul 1 00:59:55 1999 +--- gcc-2.95.1/gcc/expr.c Sun Oct 24 14:01:38 1999 +*************** store_constructor (exp, target, cleared) +*** 4430,4435 **** +--- 4430,4444 ---- + + domain_min = convert (sizetype, TYPE_MIN_VALUE (domain)); + domain_max = convert (sizetype, TYPE_MAX_VALUE (domain)); ++ ++ #ifdef GPC ++ /* Align the set. */ ++ if (set_alignment) ++ domain_min = size_binop (MINUS_EXPR, domain_min, ++ size_binop (TRUNC_MOD_EXPR, domain_min, ++ size_int (set_alignment))); ++ #endif /* GPC */ ++ + bitlength = size_binop (PLUS_EXPR, + size_binop (MINUS_EXPR, domain_max, domain_min), + size_one_node); +*************** store_constructor (exp, target, cleared) +*** 4444,4450 **** +--- 4453,4461 ---- + if (GET_MODE (target) != BLKmode || nbits <= 2 * BITS_PER_WORD + || (nbytes <= 32 && TREE_CHAIN (elt) != NULL_TREE)) + { ++ #ifndef GPC + int set_word_size = TYPE_ALIGN (TREE_TYPE (exp)); ++ #endif /* not GPC */ + enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1); + char *bit_buffer = (char *) alloca (nbits); + HOST_WIDE_INT word = 0; +*************** store_constructor (exp, target, cleared) +*** 4456,4462 **** +--- 4467,4477 ---- + { + if (bit_buffer[ibit]) + { ++ #ifdef GPC ++ if (set_words_big_endian) ++ #else /* not GPC */ + if (BYTES_BIG_ENDIAN) ++ #endif /* not GPC */ + word |= (1 << (set_word_size - 1 - bit_pos)); + else + word |= 1 << bit_pos; +*************** store_constructor (exp, target, cleared) +*** 4570,4575 **** +--- 4585,4596 ---- + else + #endif + { ++ #ifdef GPC ++ /* The language-specific run time library must provide ++ a suitable `__setbits()' function whose action coincides ++ with the values of `set_word_size', `set_alignment', and ++ `set_words_big_endian'. */ ++ #endif /* GPC */ + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__setbits"), + 0, VOIDmode, 4, XEXP (targetx, 0), Pmode, + bitlength_rtx, TYPE_MODE (sizetype), +*** gcc-2.95.1/gcc/stor-layout.c.orig Thu Mar 11 14:56:20 1999 +--- gcc-2.95.1/gcc/stor-layout.c Wed Oct 27 16:39:10 1999 +*************** int maximum_field_alignment; +*** 53,58 **** +--- 53,69 ---- + May be overridden by front-ends. */ + int set_alignment = 0; + ++ #ifdef GPC ++ /* The word size of a bitstring or (power-)set value, in bits. ++ Must be non-zero. ++ May be overridden by front-ends. */ ++ int set_word_size = BITS_PER_UNIT; ++ ++ /* If non-zero, bits in (power-)sets start with the highest bit. ++ May be overridden by front-ends. */ ++ int set_words_big_endian /*= BYTES_BIG_ENDIAN*/; /* @@@ Needn't be a constant! */ ++ #endif /* GPC */ ++ + static tree layout_record PROTO((tree)); + static void layout_union PROTO((tree)); + +*************** static tree pending_sizes; +*** 65,70 **** +--- 76,88 ---- + + int immediate_size_expand; + ++ #ifdef GPC ++ /* Nonzero means that the size of a type may vary ++ within one function context. */ ++ ++ int size_volatile = 0; ++ #endif /* GPC */ ++ + tree + get_pending_sizes () + { +*************** variable_size (size) +*** 102,108 **** +--- 120,131 ---- + || global_bindings_p () < 0 || contains_placeholder_p (size)) + return size; + ++ #ifdef GPC ++ if (! size_volatile) ++ size = save_expr (size); ++ #else /* not GPC */ + size = save_expr (size); ++ #endif + + if (global_bindings_p ()) + { +*************** variable_size (size) +*** 119,125 **** +--- 142,152 ---- + Also, we would like to pass const0_rtx here, but don't have it. */ + expand_expr (size, expand_expr (integer_zero_node, NULL_PTR, VOIDmode, 0), + VOIDmode, 0); ++ #ifdef GPC ++ else if (! size_volatile) ++ #else /* not GPC */ + else ++ #endif + pending_sizes = tree_cons (NULL_TREE, size, pending_sizes); + + return size; +*************** layout_type (type) +*** 1040,1045 **** +--- 1067,1086 ---- + abort(); + else + { ++ #ifdef GPC ++ int alignment = set_alignment ? set_alignment : set_word_size; ++ int lower_bound = TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type))); ++ int upper_bound = TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type))); ++ int size_in_bits, rounded_size; ++ if (set_alignment) ++ size_in_bits = upper_bound - (lower_bound / alignment) * alignment + 1; ++ else ++ size_in_bits ++ = (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) ++ - TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) + 1); ++ rounded_size ++ = ((size_in_bits + alignment - 1) / alignment) * alignment; ++ #else /* not GPC */ + #ifndef SET_WORD_SIZE + #define SET_WORD_SIZE BITS_PER_WORD + #endif +*************** layout_type (type) +*** 1049,1054 **** +--- 1090,1096 ---- + - TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) + 1); + int rounded_size + = ((size_in_bits + alignment - 1) / alignment) * alignment; ++ #endif /* not GPC */ + if (rounded_size > alignment) + TYPE_MODE (type) = BLKmode; + else +*** gcc-2.95.1/gcc/tree.c.orig Wed Sep 29 19:41:05 1999 +--- gcc-2.95.1/gcc/tree.c Tue Oct 19 00:04:25 1999 +*************** get_set_constructor_bits (init, buffer, +*** 4986,4991 **** +--- 4986,4998 ---- + HOST_WIDE_INT domain_min + = TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (init)))); + tree non_const_bits = NULL_TREE; ++ ++ #ifdef GPC ++ /* Align the set. */ ++ if (set_alignment) ++ domain_min -= domain_min % set_alignment; ++ #endif /* GPC */ ++ + for (i = 0; i < bit_size; i++) + buffer[i] = 0; + +*************** get_set_constructor_bytes (init, buffer, +*** 5038,5045 **** +--- 5045,5056 ---- + int wd_size; + { + int i; ++ #ifdef GPC ++ int bit_size = wd_size * BITS_PER_UNIT; ++ #else /* not GPC */ + int set_word_size = BITS_PER_UNIT; + int bit_size = wd_size * set_word_size; ++ #endif /* not GPC */ + int bit_pos = 0; + unsigned char *bytep = buffer; + char *bit_buffer = (char *) alloca(bit_size); +*************** get_set_constructor_bytes (init, buffer, +*** 5050,5055 **** +--- 5061,5084 ---- + + for (i = 0; i < bit_size; i++) + { ++ #ifdef GPC ++ if (bit_buffer[i]) ++ { ++ int k = bit_pos / BITS_PER_UNIT; ++ if (WORDS_BIG_ENDIAN) ++ k = set_word_size / BITS_PER_UNIT - 1 - k; ++ if (set_words_big_endian) ++ bytep[k] |= (1 << (BITS_PER_UNIT - 1 - bit_pos % BITS_PER_UNIT)); ++ else ++ bytep[k] |= 1 << (bit_pos % BITS_PER_UNIT); ++ } ++ bit_pos++; ++ if (bit_pos >= set_word_size) ++ { ++ bit_pos = 0; ++ bytep += set_word_size / BITS_PER_UNIT; ++ } ++ #else /* not GPC */ + if (bit_buffer[i]) + { + if (BYTES_BIG_ENDIAN) +*************** get_set_constructor_bytes (init, buffer, +*** 5060,5065 **** +--- 5089,5095 ---- + bit_pos++; + if (bit_pos >= set_word_size) + bit_pos = 0, bytep++; ++ #endif /* not GPC */ + } + return non_const_bits; + } +*** gcc-2.95.1/gcc/tree.h.orig Mon Oct 18 12:19:46 1999 +--- gcc-2.95.1/gcc/tree.h Mon Oct 18 12:36:04 1999 +*************** extern int maximum_field_alignment; +*** 1630,1635 **** +--- 1630,1643 ---- + /* If non-zero, the alignment of a bitstring or (power-)set value, in bits. */ + extern int set_alignment; + ++ #ifdef GPC ++ /* The word size of a bitstring or (power-)set value, in bits. */ ++ extern int set_word_size; ++ ++ /* If non-zero, bits in (power-)sets start with the highest bit. */ ++ extern int set_words_big_endian; ++ #endif /* GPC */ ++ + /* Concatenate two lists (chains of TREE_LIST nodes) X and Y + by making the last node in X point to Y. + Returns X, except if X is 0 returns Y. */ +*** gcc-2.95.1/gcc/tree.def.orig Mon May 17 09:21:12 1999 +--- gcc-2.95.1/gcc/tree.def Tue Oct 26 04:16:43 1999 +*************** DEFTREECODE (WITH_CLEANUP_EXPR, "with_cl +*** 490,528 **** + DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1) + + /* The following two codes are used in languages that have types where +! the position and/or sizes of fields vary from object to object of the +! same type, i.e., where some other field in the object contains a value +! that is used in the computation of another field's offset or size. +! +! For example, a record type with a discriminant in Ada is such a type. +! This mechanism is also used to create "fat pointers" for unconstrained +! array types in Ada; the fat pointer is a structure one of whose fields is +! a pointer to the actual array type and the other field is a pointer to a +! template, which is a structure containing the bounds of the array. The +! bounds in the type pointed to by the first field in the fat pointer refer +! to the values in the template. +! +! These "self-references" are doing using a PLACEHOLDER_EXPR. This is a +! node that will later be replaced with the object being referenced. Its type +! is that of the object and selects which object to use from a chain of +! references (see below). +! +! When we wish to evaluate a size or offset, we check it is contains a +! placeholder. If it does, we construct a WITH_RECORD_EXPR that contains +! both the expression we wish to evaluate and an expression within which the +! object may be found. The latter expression is the object itself in +! the simple case of an Ada record with discriminant, but it can be the +! array in the case of an unconstrained array. +! +! In the latter case, we need the fat pointer, because the bounds of the +! array can only be accessed from it. However, we rely here on the fact that +! the expression for the array contains the dereference of the fat pointer +! that obtained the array pointer. + + Accordingly, when looking for the object to substitute in place of + a PLACEHOLDER_EXPR, we look down the first operand of the expression +! passed as the second operand to WITH_RECORD_EXPR until we find something +! of the desired type or reach a constant. */ + + /* Denotes a record to later be supplied with a WITH_RECORD_EXPR when + evaluating this expression. The type of this expression is used to +--- 490,547 ---- + DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1) + + /* The following two codes are used in languages that have types where +! some field in an object of the type contains a value that is used in +! the computation of another field's offset or size and/or the size of +! the type. The positions and/or sizes of fields can vary from object +! to object of the same type or even for one and the same object within +! its scope. +! +! Record types with discriminants in Ada or schema types in Pascal are +! examples of such types. This mechanism is also used to create "fat +! pointers" for unconstrained array types in Ada; the fat pointer is a +! structure one of whose fields is a pointer to the actual array type +! and the other field is a pointer to a template, which is a structure +! containing the bounds of the array. The bounds in the type pointed +! to by the first field in the fat pointer refer to the values in the +! template. +! +! When you wish to construct such a type you need "self-references" +! that allow you to reference the object having this type from the +! TYPE node, i.e. without having a variable instantiating this type. +! +! Such a "self-references" is done using a PLACEHOLDER_EXPR. This is +! a node that will later be replaced with the object being referenced. +! Its type is that of the object and selects which object to use from +! a chain of references (see below). No other slots are used in the +! PLACEHOLDER_EXPR. +! +! For example, if your type FOO is a RECORD_TYPE with a field BAR, +! and you need the value of .BAR to calculate TYPE_SIZE +! (FOO), just substitute above with a PLACEHOLDER_EXPR +! whose TREE_TYPE is FOO. Then construct your COMPONENT_REF with +! the PLACEHOLDER_EXPR as the first operand (which has the correct +! type). Later, when the size is needed in the program, the back-end +! will find this PLACEHOLDER_EXPR and generate code to calculate the +! actual size at run-time. In the following, we describe how this +! calculation is done. +! +! When we wish to evaluate a size or offset, we check whether it +! contains a PLACEHOLDER_EXPR. If it does, we construct a +! WITH_RECORD_EXPR that contains both the expression we wish to +! evaluate and an expression within which the object may be found. +! The latter expression is the object itself in the simple case of an +! Ada record with discriminant, but it can be the array in the case of +! an unconstrained array. +! +! In the latter case, we need the fat pointer, because the bounds of +! the array can only be accessed from it. However, we rely here on the +! fact that the expression for the array contains the dereference of +! the fat pointer that obtained the array pointer. + + Accordingly, when looking for the object to substitute in place of + a PLACEHOLDER_EXPR, we look down the first operand of the expression +! passed as the second operand to WITH_RECORD_EXPR until we find +! something of the desired type or reach a constant. */ + + /* Denotes a record to later be supplied with a WITH_RECORD_EXPR when + evaluating this expression. The type of this expression is used to diff --git a/gcc-libstdc++-bastring.patch b/gcc-libstdc++-bastring.patch new file mode 100644 index 0000000..6aae8da --- /dev/null +++ b/gcc-libstdc++-bastring.patch @@ -0,0 +1,46 @@ +/* +From: Richard Kettlewell +To: submit@bugs.debian.org +Subject: Bug#46550: basic_string can't be instantiated +Date: Sun, 3 Oct 1999 22:49:50 +0100 + +Package: libstdc++2.9-dev +Version: 2.91.60-5 + +Hi, + +This ought to work, but it doesn't: + +------------------------------------------------------------------------ +lyonesse$ cat t.cc +*/ + +#include + +template basic_string; + +/* +lyonesse$ c++ -c t.cc +/usr/include/g++-2/std/bastring.h: In method `const __wchar_t * basic_string<__wchar_t,string_char_traits<__wchar_t>,__default_alloc_template >::c_str<__wchar_t, string_char_traits<__wchar_t>, alloc>() const': +t.cc:3: instantiated from here +/usr/include/g++-2/std/bastring.h:301: return to `const __wchar_t *' from `char *' +lyonesse$ +------------------------------------------------------------------------ + +# DP: Here is a patch to /usr/include/g++-2/std/bastring.h which makes it +# DP: work for me (though note that I have not tested the c_str() method as +# DP: such): + +------------------------------------------------------------------------ +--- libstdc++/std/bastring.h.orig Sun Oct 3 22:32:06 1999 ++++ libstdc++/std/bastring.h Sun Oct 3 22:36:17 1999 +@@ -332,7 +332,8 @@ + + public: + const charT* c_str () const +- { if (length () == 0) return ""; terminate (); return data (); } ++ { const charT* null_str = ""; ++ if (length () == 0) return null_str; terminate (); return data (); } + void resize (size_type n, charT c); + void resize (size_type n) + { resize (n, eos ()); } diff --git a/gcc-libstdc++-out-of-mem.patch b/gcc-libstdc++-out-of-mem.patch new file mode 100644 index 0000000..a3d6b71 --- /dev/null +++ b/gcc-libstdc++-out-of-mem.patch @@ -0,0 +1,57 @@ +# DP: Throw exception instead of aborting when out of memory + +From: inaky@peloncho.fis.ucm.es +To: submit@bugs.debian.org +Subject: Bug#42622: libstdc++2.10-dev: stl_alloc.h: malloc_alloc out of memory handling abort()s instead of using exceptions +Date: Sat, 7 Aug 1999 04:31:58 +0200 + +Package: libstdc++2.10-dev +Version: 1:2.95-2 +Severity: important + + Hi + + While coding some proof-of-concepts I've come around using a +vector<> of a big lot of elements. Wanted to push the limits and try +to recover possible failures. No way. The program was aborting on the +library's own. + + That should not do. You want exceptions to be able to dictate +how the program should behave on error situations. The thing is at +stl_alloc.h, instead of throwing an exception on OOM, it was printing +the message "out of memory" to stderr and aborting. It is also +prepared for doing it via exceptions, so I think it should be the +default way. + + I think that behaviour should be made extensible to the whole +libstdc++ library, as as far as I know, exception support in GCC is +mature enough as to handle it [and I hope so :)]. That's the only way +to fully control a program's flow. Libraries should not dictate what +to do on error [I'm sure I'm not telling you anything new]. + + The changes to make stl_alloc work ok with exceptions are: + +--- libstdc++/stl/stl_alloc.h~ Fri May 7 12:13:28 1999 ++++ libstdc++/stl/stl_alloc.h Sat Aug 7 04:16:22 1999 +@@ -38,7 +38,7 @@ + // The allocation primitives are intended to allocate individual objects, + // not larger arenas as with the original STL allocators. + +-#if 0 ++#ifdef __STL_USE_EXCEPTIONS + # include + # define __THROW_BAD_ALLOC throw bad_alloc() + #elif !defined(__THROW_BAD_ALLOC) + + Thanks, anyway, for such nice packages for GCC & Co. + + Your happy Debian user, + +-- System Information +Debian Release: potato +Kernel Version: Linux jovian 2.2.7 #1 mar ago 3 02:24:40 CEST 1999 i586 unknown + +Versions of the packages libstdc++2.10-dev depends on: +ii g++ 2.95-2 The GNU C++ compiler. +ii libc6-dev 2.1.2-0pre4 GNU C Library: Development libraries and hea +ii libstdc++2.10 2.95-2 The GNU stdc++ library diff --git a/gcc-libstdc++-wall3.patch b/gcc-libstdc++-wall3.patch new file mode 100644 index 0000000..67fd293 --- /dev/null +++ b/gcc-libstdc++-wall3.patch @@ -0,0 +1,153 @@ +# DP: 1999-11-10 Benjamin Kosnik +# DP: Matthias Klose +# DP: +# DP: * stl_rope.h: Fix initialization order. +# DP: * stl_deque.h: Use static_casts(signed_type). + + +1999-11-10 Benjamin Kosnik + Matthias Klose + + * stl_rope.h: Fix initialization order. + * stl_deque.h: Use static_casts(signed_type). + +--- libstdc++/stl/stl_deque.h~ Wed Sep 2 19:24:47 1998 ++++ libstdc++/stl/stl_deque.h Wed Nov 10 23:10:27 1999 +@@ -815,7 +815,7 @@ + iterator __next = __pos; + ++__next; + difference_type __index = __pos - _M_start; +- if (__index < (size() >> 1)) { ++ if (static_cast(__index) < (size() >> 1)) { + copy_backward(_M_start, __pos, __next); + pop_front(); + } +@@ -1048,7 +1048,7 @@ + else { + difference_type __n = __last - __first; + difference_type __elems_before = __first - _M_start; +- if (__elems_before < (size() - __n) / 2) { ++ if (static_cast(__elems_before) < (size() - __n) / 2) { + copy_backward(_M_start, __first, __last); + iterator __new_start = _M_start + __n; + destroy(_M_start, __new_start); +@@ -1282,7 +1282,7 @@ + { + difference_type __index = __pos - _M_start; + value_type __x_copy = __x; +- if (__index < size() / 2) { ++ if (static_cast(__index) < size() / 2) { + push_front(front()); + iterator __front1 = _M_start; + ++__front1; +@@ -1311,7 +1311,7 @@ + deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos) + { + difference_type __index = __pos - _M_start; +- if (__index < size() / 2) { ++ if (static_cast(__index) < size() / 2) { + push_front(front()); + iterator __front1 = _M_start; + ++__front1; +@@ -1344,7 +1344,7 @@ + const difference_type __elems_before = __pos - _M_start; + size_type __length = size(); + value_type __x_copy = __x; +- if (__elems_before < __length / 2) { ++ if (static_cast(__elems_before) < __length / 2) { + iterator __new_start = _M_reserve_elements_at_front(__n); + iterator __old_start = _M_start; + __pos = _M_start + __elems_before; +@@ -1403,7 +1403,7 @@ + { + const difference_type __elemsbefore = __pos - _M_start; + size_type __length = size(); +- if (__elemsbefore < __length / 2) { ++ if (static_cast(__elemsbefore) < __length / 2) { + iterator __new_start = _M_reserve_elements_at_front(__n); + iterator __old_start = _M_start; + __pos = _M_start + __elemsbefore; +--- libstdc++/stl/stl_rope.h.old Wed Sep 2 19:25:05 1998 ++++ libstdc++/stl/stl_rope.h Wed Nov 10 23:25:36 1999 +@@ -386,8 +386,8 @@ + typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type; + _Rope_RopeRep(_Tag __t, int __d, bool __b, size_t __size, + allocator_type __a) +- : _M_tag(__t), _M_depth(__d), _M_is_balanced(__b), _M_c_string(0), +- _Rope_rep_base<_CharT,_Alloc>(__size, __a) ++ : _Rope_rep_base<_CharT,_Alloc>(__size, __a), ++ _M_tag(__t), _M_depth(__d), _M_is_balanced(__b), _M_c_string(0) + { + # ifndef __GC + _M_refcount = 1; +@@ -562,8 +562,8 @@ + /* doesn't matter. */ + typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type; + _Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size, allocator_type __a) +- : _M_data(__d) +- , _Rope_RopeRep<_CharT,_Alloc>(_S_leaf, 0, true, __size, __a) ++ : _Rope_RopeRep<_CharT,_Alloc>(_S_leaf, 0, true, __size, __a), ++ _M_data(__d) + { + __stl_assert(__size > 0); + if (_S_is_basic_char_type((_CharT *)0)) { +@@ -593,10 +593,10 @@ + _Rope_RopeConcatenation(_Rope_RopeRep<_CharT,_Alloc>* __l, + _Rope_RopeRep<_CharT,_Alloc>* __r, + allocator_type __a) +- : _M_left(__l), _M_right(__r) +- , _Rope_RopeRep<_CharT,_Alloc>( ++ : _Rope_RopeRep<_CharT,_Alloc>( + _S_concat, max(__l->_M_depth, __r->_M_depth) + 1, false, +- __l->_M_size + __r->_M_size, __a) ++ __l->_M_size + __r->_M_size, __a), ++ _M_left(__l), _M_right(__r) + {} + # ifndef __GC + ~_Rope_RopeConcatenation() { +@@ -629,11 +629,12 @@ + typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type; + _Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size, + bool __d, allocator_type __a) +- : _M_fn(__f) ++ :_Rope_RopeRep<_CharT,_Alloc>(_S_function, 0, true, __size, __a), ++ _M_fn(__f) + # ifndef __GC + , _M_delete_when_done(__d) + # endif +- , _Rope_RopeRep<_CharT,_Alloc>(_S_function, 0, true, __size, __a) { ++ { + __stl_assert(__size > 0); + # ifdef __GC + if (__d) { +@@ -693,9 +694,8 @@ + typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type; + _Rope_RopeSubstring(_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s, + size_t __l, allocator_type __a) +- : _M_base(__b) ++ : _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a), _M_base(__b) + , _M_start(__s) +- , _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a) + { + __stl_assert(__l > 0); + __stl_assert(__s + __l <= __b->_M_size); +@@ -766,16 +766,16 @@ + _My_rope* _M_root; // The whole rope. + public: + _Rope_char_ref_proxy(_My_rope* __r, size_t __p) : +- _M_pos(__p), _M_root(__r), _M_current_valid(false) {} ++ _M_pos(__p), _M_current_valid(false), _M_root(__r) {} + _Rope_char_ref_proxy(const _Rope_char_ref_proxy& __x) : +- _M_pos(__x._M_pos), _M_root(__x._M_root), _M_current_valid(false) {} ++ _M_pos(__x._M_pos), _M_current_valid(false), _M_root(__x._M_root) {} + // Don't preserve cache if the reference can outlive the + // expression. We claim that's not possible without calling + // a copy constructor or generating reference to a proxy + // reference. We declare the latter to have undefined semantics. + _Rope_char_ref_proxy(_My_rope* __r, size_t __p, + _CharT __c) : +- _M_pos(__p), _M_root(__r), _M_current(__c), _M_current_valid(true) {} ++ _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) {} + inline operator _CharT () const; + _Rope_char_ref_proxy& operator= (_CharT __c); + _Rope_char_ptr_proxy<_CharT,_Alloc> operator& () const; diff --git a/gcc-libstdc++-wstring.patch b/gcc-libstdc++-wstring.patch new file mode 100644 index 0000000..6210f88 --- /dev/null +++ b/gcc-libstdc++-wstring.patch @@ -0,0 +1,15 @@ +# DP: enable definition of wstring type, if __ENABLE_WSTRING is defined. + +--- libstdc++/string~ Sat Feb 20 13:21:49 1999 ++++ libstdc++/string Sun Dec 5 16:35:27 1999 +@@ -7,7 +7,9 @@ + + extern "C++" { + typedef basic_string string; +-// typedef basic_string wstring; ++#ifdef __ENABLE_WSTRING ++typedef basic_string wstring; ++#endif + } // extern "C++" + + #endif diff --git a/gcc-m68k-pic.patch b/gcc-m68k-pic.patch new file mode 100644 index 0000000..6ff7224 --- /dev/null +++ b/gcc-m68k-pic.patch @@ -0,0 +1,64 @@ +# DP: Two patches by Andreas Schwab to fix -fpic and loop optimization. +# DP: Another patch by Andreas Schwab to fix %a5 restauration in some cases. + +------------------------------------------------------------------------------ +--- gcc/config/m68k/m68k.c~ Mon Aug 2 06:51:08 1999 ++++ gcc/config/m68k/m68k.c Fri Oct 22 11:47:09 1999 +@@ -356,7 +356,7 @@ + mask &= ~ (1 << (15 - FRAME_POINTER_REGNUM)); + num_saved_regs--; + } +- if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) ++ if (flag_pic && current_function_uses_pic_offset_table) + { + mask |= 1 << (15 - PIC_OFFSET_TABLE_REGNUM); + num_saved_regs++; +@@ -493,7 +493,10 @@ + for (regno = 0 ; regno < FIRST_PSEUDO_REGISTER ; regno++) + if (regs_ever_live[regno] && ! call_used_regs[regno]) + return 0; +- ++ ++ if (flag_pic && current_function_uses_pic_offset_table) ++ return 0; ++ + return 1; + } + +@@ -568,7 +571,7 @@ + nregs++; + mask |= 1 << regno; + } +- if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) ++ if (flag_pic && current_function_uses_pic_offset_table) + { + nregs++; + mask |= 1 << PIC_OFFSET_TABLE_REGNUM; +@@ -1334,8 +1337,6 @@ + gen_rtx_PLUS (Pmode, + pic_offset_table_rtx, orig)); + current_function_uses_pic_offset_table = 1; +- if (reload_in_progress) +- regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1; + RTX_UNCHANGING_P (pic_ref) = 1; + emit_move_insn (reg, pic_ref); + return reg; +--- gcc/loop.c~ Fri Jun 25 06:38:11 1999 ++++ gcc/loop.c Fri Oct 22 11:45:16 1999 +@@ -4046,11 +4046,11 @@ + in-between when biv_toal_increment returns nonzero both times + but we test it here in case some day some real cfg analysis + gets used to set always_computable. */ +- && ((loop_insn_first_p (bl2->biv->insn, bl->biv->insn) +- && no_labels_between_p (bl2->biv->insn, bl->biv->insn)) +- || (! reg_used_between_p (bl->biv->src_reg, bl->biv->insn, +- bl2->biv->insn) +- && no_jumps_between_p (bl->biv->insn, bl2->biv->insn))) ++ && (loop_insn_first_p (bl2->biv->insn, bl->biv->insn) ++ ? no_labels_between_p (bl2->biv->insn, bl->biv->insn) ++ : (! reg_used_between_p (bl->biv->src_reg, bl->biv->insn, ++ bl2->biv->insn) ++ && no_jumps_between_p (bl->biv->insn, bl2->biv->insn))) + && validate_change (bl->biv->insn, + &SET_SRC (single_set (bl->biv->insn)), + copy_rtx (src), 0)) diff --git a/gcc-manpage.patch b/gcc-manpage.patch new file mode 100644 index 0000000..9aaee1b --- /dev/null +++ b/gcc-manpage.patch @@ -0,0 +1,20 @@ +# DP: Document exit codes. + +Wed Oct 20 22:55:23 1999 Matthias Klose + + * gcc.1: Document exit codes. + +--- gcc/gcc.1.orig Thu Oct 21 12:52:54 1999 ++++ gcc/gcc.1 Thu Oct 21 12:53:15 1999 +@@ -4141,6 +4141,11 @@ + if available, else + .B /tmp\c + \&). ++.SH "EXIT STATUS" ++Normally the exit status is 0, if compilation or link edit are successful, ++and nonzero else. The option ++.B -Werror ++treats each warning as an error. + .SH "SEE ALSO" + cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1). + .br diff --git a/gcc-ppc-andrew-dwarf-eh.patch b/gcc-ppc-andrew-dwarf-eh.patch new file mode 100644 index 0000000..173c897 --- /dev/null +++ b/gcc-ppc-andrew-dwarf-eh.patch @@ -0,0 +1,622 @@ +# DP: The Dwarf EH patch for powerpc, from Andrew Macleod, via Franz Sirl +# DP: (Revised for gcc 2.95) + +Index: gcc/collect2.c +--- collect2.c 1999/05/17 22:56:24 1.72 ++++ gcc/collect2.c 1999/06/12 18:55:22 +@@ -2955,6 +2955,21 @@ scan_prog_file (prog_name, which_pass) + add_to_list (&destructors, name); + break; + #endif ++ case 5: ++ add_to_list (&frame_tables, name); ++#ifdef COLLECT_EXPORT_LIST ++ if (which_pass == PASS_OBJ) ++ add_to_list (&exports, name); ++ /* If this symbol was undefined and we are building ++ an import list, we should add a symbol to this ++ list. */ ++ else ++ if (import_flag ++ && is_in_list (name, undefined.first)) ++ add_to_list (&imports, name); ++#endif ++ break; ++ + + default: /* not a constructor or destructor */ + #ifdef COLLECT_EXPORT_LIST +Index: gcc/dwarf2.h +--- dwarf2.h 1999/01/11 13:43:21 1.11 ++++ gcc/dwarf2.h 1999/06/12 18:55:25 +@@ -501,7 +501,8 @@ enum dwarf_call_frame_info + + /* GNU extensions */ + DW_CFA_GNU_window_save = 0x2d, +- DW_CFA_GNU_args_size = 0x2e ++ DW_CFA_GNU_args_size = 0x2e, ++ DW_CFA_GNU_negative_offset_extended = 0x2f + }; + + #define DW_CIE_ID 0xffffffff +Index: gcc/dwarf2out.c +--- dwarf2out.c 1999/06/03 02:30:03 1.91.4.2 ++++ gcc/dwarf2out.c 1999/06/12 18:55:27 +@@ -415,38 +415,54 @@ static void dwarf2out_stack_adjust PROTO + /* We don't have unaligned support, let's hope the normal output works for + .debug_frame. */ + ++#ifndef ASM_OUTPUT_DWARF_ADDR + #define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \ + assemble_integer (gen_rtx_SYMBOL_REF (Pmode, LABEL), PTR_SIZE, 1) ++#endif + ++#ifndef ASM_OUTPUT_DWARF_OFFSET4 + #define ASM_OUTPUT_DWARF_OFFSET4(FILE,LABEL) \ + assemble_integer (gen_rtx_SYMBOL_REF (SImode, LABEL), 4, 1) ++#endif + ++#ifndef ASM_OUTPUT_DWARF_OFFSET + #define ASM_OUTPUT_DWARF_OFFSET(FILE,LABEL) \ + assemble_integer (gen_rtx_SYMBOL_REF (SImode, LABEL), 4, 1) ++#endif + ++#ifndef ASM_OUTPUT_DWARF_DELTA2 + #define ASM_OUTPUT_DWARF_DELTA2(FILE,LABEL1,LABEL2) \ + assemble_integer (gen_rtx_MINUS (HImode, \ + gen_rtx_SYMBOL_REF (Pmode, LABEL1), \ + gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \ + 2, 1) ++#endif + ++#ifndef ASM_OUTPUT_DWARF_DELTA4 + #define ASM_OUTPUT_DWARF_DELTA4(FILE,LABEL1,LABEL2) \ + assemble_integer (gen_rtx_MINUS (SImode, \ + gen_rtx_SYMBOL_REF (Pmode, LABEL1), \ + gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \ + 4, 1) ++#endif + ++#ifndef ASM_OUTPUT_DWARF_ADDR_DELTA + #define ASM_OUTPUT_DWARF_ADDR_DELTA(FILE,LABEL1,LABEL2) \ + assemble_integer (gen_rtx_MINUS (Pmode, \ + gen_rtx_SYMBOL_REF (Pmode, LABEL1), \ + gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \ + PTR_SIZE, 1) ++#endif + ++#ifndef ASM_OUTPUT_DWARF_DELTA + #define ASM_OUTPUT_DWARF_DELTA(FILE,LABEL1,LABEL2) \ + ASM_OUTPUT_DWARF_DELTA4 (FILE,LABEL1,LABEL2) ++#endif + ++#ifndef ASM_OUTPUT_DWARF_DATA4 + #define ASM_OUTPUT_DWARF_DATA4(FILE,VALUE) \ + assemble_integer (GEN_INT (VALUE), 4, 1) ++#endif + + #endif /* UNALIGNED_INT_ASM_OP */ + +@@ -719,6 +735,8 @@ dwarf_cfi_name (cfi_opc) + return "DW_CFA_GNU_window_save"; + case DW_CFA_GNU_args_size: + return "DW_CFA_GNU_args_size"; ++ case DW_CFA_GNU_negative_offset_extended: ++ return "DW_CFA_GNU_negative_offset_extended"; + + default: + return "DW_CFA_"; +@@ -948,7 +966,10 @@ reg_save (label, reg, sreg, offset) + + offset /= DWARF_CIE_DATA_ALIGNMENT; + if (offset < 0) +- abort (); ++ { ++ cfi->dw_cfi_opc = DW_CFA_GNU_negative_offset_extended; ++ offset = -offset; ++ } + cfi->dw_cfi_oprnd2.dw_cfi_offset = offset; + } + else +@@ -1421,6 +1442,10 @@ dwarf2out_frame_debug (insn) + char *label; + rtx src; + ++ /* A temporary register used in adjusting SP or setting up the store_reg. */ ++ static unsigned cfa_temp_reg; ++ static long cfa_temp_value; ++ + if (insn == NULL_RTX) + { + /* Set up state for generating call frame debug info. */ +@@ -1635,6 +1660,7 @@ output_cfi (cfi, fde) + break; + #endif + case DW_CFA_offset_extended: ++ case DW_CFA_GNU_negative_offset_extended: + case DW_CFA_def_cfa: + output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num); + fputc ('\n', asm_out_file); +@@ -5862,6 +5888,14 @@ output_line_info () + /* We used to set the address register to the first location in the text + section here, but that didn't accomplish anything since we already + have a line note for the opening brace of the first function. */ ++ ++ fputc ('\n', asm_out_file); ++ output_uleb128 (1 + PTR_SIZE); ++ fputc ('\n', asm_out_file); ++ ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_set_address); ++ fputc ('\n', asm_out_file); ++ ASM_OUTPUT_DWARF_ADDR (asm_out_file, text_section_label); ++ fputc ('\n', asm_out_file); + + /* Generate the line number to PC correspondence table, encoded as + a series of state machine operations. */ +Index: gcc/dwarfout.c +--- dwarfout.c 1999/04/18 13:09:27 1.35 ++++ gcc/dwarfout.c 1999/06/12 18:55:29 +@@ -864,7 +864,7 @@ static int is_redundant_typedef PROTO(( + ASM_OUTPUT_ASCII ((FILE), P, strlen (P)+1) + #else + #define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \ +- ASM_OUTPUT_DWARF_STRING (FILE,P), ASM_OUTPUT_DWARF_STRING (FILE,"\n") ++ do { ASM_OUTPUT_DWARF_STRING (FILE,P); ASM_OUTPUT_DWARF_STRING (FILE,"\n"); } while (0) + #endif + + +Index: gcc/except.c +--- except.c 1999/04/15 19:54:09 1.82 ++++ gcc/except.c 1999/06/12 18:55:30 +@@ -2706,7 +2706,7 @@ eh_regs (pcontext, psp, pra, outgoing) + rtx *pcontext, *psp, *pra; + int outgoing; + { +- rtx rcontext, rsp, rra; ++ rtx rcontext, rsp, rra = NULL_RTX; + int i; + + #ifdef FUNCTION_OUTGOING_VALUE +@@ -2718,6 +2718,16 @@ eh_regs (pcontext, psp, pra, outgoing) + rcontext = FUNCTION_VALUE (build_pointer_type (void_type_node), + current_function_decl); + ++/* If we've specified the register to communicate the stack offset or ++ return address, use it instead of picking one */ ++ ++#ifdef DWARF2_EH_RA_REG ++ rra = gen_rtx_REG (Pmode, DWARF2_EH_RA_REG); ++#endif ++ ++#ifdef DWARF2_EH_SP_REG ++ rsp = gen_rtx_REG (Pmode, DWARF2_EH_SP_REG); ++#else + #ifdef STATIC_CHAIN_REGNUM + if (outgoing) + rsp = static_chain_incoming_rtx; +@@ -2726,6 +2736,7 @@ eh_regs (pcontext, psp, pra, outgoing) + if (REGNO (rsp) == REGNO (rcontext)) + #endif /* STATIC_CHAIN_REGNUM */ + rsp = NULL_RTX; ++#endif + + if (rsp == NULL_RTX) + { +@@ -2738,14 +2749,16 @@ eh_regs (pcontext, psp, pra, outgoing) + rsp = gen_rtx_REG (Pmode, i); + } + +- for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i) +- if (call_used_regs[i] && ! fixed_regs[i] +- && i != REGNO (rcontext) && i != REGNO (rsp)) +- break; +- if (i == FIRST_PSEUDO_REGISTER) +- abort(); +- +- rra = gen_rtx_REG (Pmode, i); ++ if (rra == NULL_RTX) ++ { ++ for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i) ++ if (call_used_regs[i] && ! fixed_regs[i] ++ && i != REGNO (rcontext) && i != REGNO (rsp)) ++ break; ++ if (i == FIRST_PSEUDO_REGISTER) ++ abort(); ++ rra = gen_rtx_REG (Pmode, i); ++ } + + *pcontext = rcontext; + *psp = rsp; +@@ -2808,7 +2821,8 @@ expand_eh_return () + #ifdef HAVE_eh_epilogue + if (HAVE_eh_epilogue) + { +- emit_insn (gen_eh_epilogue (reg1, reg2, reg3)); ++ emit_insn (gen_eh_epilogue (eh_return_context, eh_return_stack_adjust, ++ eh_return_handler)); + return; + } + #endif +@@ -2833,6 +2847,12 @@ expand_eh_return () + if (tmp != ra) + emit_move_insn (ra, tmp); + ++ eh_regs (®1, ®2, ®3, 1); ++ ++ emit_move_insn (reg1, eh_return_context); ++ emit_move_insn (reg2, eh_return_stack_adjust); ++ emit_move_insn (reg3, eh_return_handler); ++ + /* Indicate that the registers are in fact used. */ + emit_insn (gen_rtx_USE (VOIDmode, reg1)); + emit_insn (gen_rtx_USE (VOIDmode, reg2)); +Index: gcc/frame.c +--- frame.c 1998/12/16 20:55:48 1.25 ++++ gcc/frame.c 1999/06/12 18:55:30 +@@ -714,6 +714,14 @@ execute_cfa_insn (void *p, struct frame_ + state->s.args_size = offset; + break; + ++ case DW_CFA_GNU_negative_offset_extended: ++ p = decode_uleb128 (p, ®); ++ p = decode_uleb128 (p, &offset); ++ offset *= info->data_align; ++ state->s.saved[reg] = REG_SAVED_OFFSET; ++ state->s.reg_or_offset[reg] = -offset; ++ break; ++ + default: + abort (); + } +Index: gcc/config/rs6000/aix31.h +--- aix31.h 1998/12/16 21:11:43 1.2 ++++ gcc/config/rs6000/aix31.h 1999/06/12 18:55:33 +@@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. */ + + + #include "rs6000/rs6000.h" ++#include "aix-dwarf.h" + + /* AIX 3.2 defined _AIX32, but older versions do not. */ + #undef CPP_PREDEFINES +Index: gcc/config/rs6000/aix3newas.h +--- aix3newas.h 1998/12/16 21:11:44 1.2 ++++ gcc/config/rs6000/aix3newas.h 1999/06/12 18:55:33 +@@ -30,6 +30,7 @@ Boston, MA 02111-1307, USA. */ + {"no-xl-call", - MASK_XL_CALL}, + + #include "rs6000/rs6000.h" ++#include "aix-dwarf.h" + + /* Tell the assembler to assume that all undefined names are external. */ + +Index: gcc/config/rs6000/aix41.h +--- aix41.h 1999/03/27 18:21:29 1.6 ++++ gcc/config/rs6000/aix41.h 1999/06/12 18:55:33 +@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */ + {"pe", 0}, + + #include "rs6000/rs6000.h" ++#include "aix-dwarf.h" + + #undef ASM_SPEC + #define ASM_SPEC "-u %(asm_cpu)" +Index: gcc/config/rs6000/aix43.h +--- aix43.h 1999/05/03 20:10:05 1.5 ++++ gcc/config/rs6000/aix43.h 1999/06/12 18:55:33 +@@ -58,6 +58,7 @@ do { \ + } while (0); + + #include "rs6000/rs6000.h" ++#include "aix-dwarf.h" + + #undef ASM_SPEC + #define ASM_SPEC "-u %{maix64:-a64 -mppc64} %(asm_cpu)" +Index: gcc/config/rs6000/eabi-ci.asm +--- eabi-ci.asm 1998/12/16 21:11:50 1.2 ++++ gcc/config/rs6000/eabi-ci.asm 1999/06/12 18:55:33 +@@ -102,6 +102,11 @@ __SBSS2_START__: + .type __EXCEPT_START__,@object + __EXCEPT_START__: + ++ .section ".eh_frame","aw" ++ .globl __EH_FRAME_BEGIN__ ++ .type __EH_FRAME_BEGIN__,@object ++__EH_FRAME_BEGIN__: ++ + # Head of __init function used for static constructors in Solaris + .section ".init","ax" + .align 2 +Index: gcc/config/rs6000/eabi-cn.asm +--- eabi-cn.asm 1998/12/16 21:11:51 1.2 ++++ gcc/config/rs6000/eabi-cn.asm 1999/06/12 18:55:33 +@@ -94,6 +94,12 @@ __SBSS2_END__: + .type __EXCEPT_END__,@object + __EXCEPT_END__: + ++ .section ".eh_frame","aw" ++ .globl __EH_FRAME_END__ ++ .type __EH_FRAME_END__,@object ++__EH_FRAME_END__: ++ .long 0 ++ + # Tail of __init used for static constructors in Solaris + .section ".init","ax" + lwz 0,12(1) +Index: gcc/config/rs6000/eabi-ctors.c +--- eabi-ctors.c 1998/12/16 21:11:52 1.2 ++++ gcc/config/rs6000/eabi-ctors.c 1999/06/12 18:55:33 +@@ -40,7 +40,24 @@ extern func_ptr __CTOR_LIST__[]; + extern func_ptr __CTOR_END__ []; + extern func_ptr __DTOR_LIST__[]; + extern func_ptr __DTOR_END__ []; ++extern char __EH_FRAME_BEGIN__ []; + ++struct object { ++ void *pc_begin; ++ void *pc_end; ++ struct dwarf_fde *fde_begin; ++ struct dwarf_fde **fde_array; ++ long count; ++ struct object *next; ++}; ++ ++extern void __register_frame_info (void *, struct object *); ++extern void __register_frame_info_table (void *, struct object *); ++extern void __deregister_frame_info (void *); ++ ++ ++#define EH_FRAME_SECTION_ASM_OP ".section\t.eh_frame,\"aw\"" ++ + extern void __do_global_ctors (void); + extern void __do_global_dtors (void); + +@@ -61,6 +78,11 @@ __do_global_ctors (void) + func_ptr *ptr = &__CTOR_LIST__[0]; + func_ptr *end = &__CTOR_END__[0]; + ++#ifdef EH_FRAME_SECTION_ASM_OP ++ static struct object object; ++ __register_frame_info (__EH_FRAME_BEGIN__, &object); ++#endif ++ + if (__atexit) + __atexit (__do_global_dtors); + +@@ -88,5 +110,8 @@ __do_global_dtors (void) + for ( ; ptr >= start; ptr--) + if (*ptr) + (*ptr)(); +-} + ++#ifdef EH_FRAME_SECTION_ASM_OP ++ __deregister_frame_info (__EH_FRAME_BEGIN__); ++#endif ++} +Index: gcc/config/rs6000/rs6000.c +--- rs6000.c 1999/06/09 15:59:36 1.70.4.2 ++++ gcc/config/rs6000/rs6000.c 1999/06/12 18:55:34 +@@ -77,6 +77,11 @@ static int common_mode_defined; + rtx rs6000_compare_op0, rs6000_compare_op1; + int rs6000_compare_fp_p; + ++/* If we've defined this, we need a counter for the fixup labels */ ++#ifdef ASM_OUTPUT_DWARF_ADDR ++int dwarflabelno = 0; ++#endif ++ + #ifdef USING_SVR4_H + /* Label number of label created for -mrelocatable, to call to so we can + get the address of the GOT section */ +@@ -3860,6 +3874,9 @@ rs6000_allocate_stack_space (file, size, + } + } + ++#define SET_DWARF_LABEL(X) (X = ((X == NULL) ? \ ++ (char *) dwarf2out_cfi_label () : X )) ++ + + /* Write function prologue. */ + void +@@ -3873,6 +3890,7 @@ output_prolog (file, size) + const char *load_reg; + int sp_reg = 1; + int sp_offset = 0; ++ char *dw2_label = NULL; + + if (TARGET_32BIT) + { +@@ -3948,6 +3966,19 @@ output_prolog (file, size) + asm_fprintf (file, "\tbl %s%d%s\n", SAVE_FP_PREFIX, + info->first_fp_reg_save - 32, SAVE_FP_SUFFIX); + ++ /* Regardless of whether its inlined or not, the net effect at this point ++ is that the FPRs have been saved from first to the end.*/ ++ if (dwarf2out_do_frame () && info->first_fp_reg_save != 64) ++ { ++ int regno = info->first_fp_reg_save; ++ int loc = info->fp_save_offset; ++ SET_DWARF_LABEL (dw2_label); ++ for ( ; regno < 64; regno++, loc += 8) ++ { ++ dwarf2out_reg_save (dw2_label, regno, loc); ++ } ++ } ++ + /* Now save gpr's. */ + if (! TARGET_MULTIPLE || info->first_gp_reg_save == 31 || TARGET_64BIT) + { +@@ -3964,6 +3995,19 @@ output_prolog (file, size) + info->gp_save_offset + sp_offset, + reg_names[sp_reg]); + ++ /* Regardless of whether its inlined or not, the net effect at this point ++ is that the GPRs have been saved from first to the end.*/ ++ if (dwarf2out_do_frame () && info->first_gp_reg_save != 32) ++ { ++ int regno = info->first_gp_reg_save; ++ int loc = info->gp_save_offset; ++ SET_DWARF_LABEL (dw2_label); ++ for ( ; regno < 32; regno++, loc += reg_size) ++ { ++ dwarf2out_reg_save (dw2_label, regno, loc); ++ } ++ } ++ + /* Save main's arguments if we need to call a function */ + #ifdef NAME__MAIN + if (info->main_save_p) +@@ -3982,6 +4026,11 @@ output_prolog (file, size) + asm_fprintf (file, store_reg, reg_names[0], info->lr_save_offset + sp_offset, + reg_names[sp_reg]); + ++ if (dwarf2out_do_frame () && info->lr_save_p) ++ { ++ SET_DWARF_LABEL (dw2_label); ++ dwarf2out_return_save (dw2_label, info->lr_save_offset); ++ } + /* Save CR if we use any that must be preserved. */ + if (info->cr_save_p) + { +@@ -3995,6 +4044,13 @@ output_prolog (file, size) + else + asm_fprintf (file, store_reg, reg_names[12], info->cr_save_offset + sp_offset, + reg_names[sp_reg]); ++ /* we save all the condition registers as if they are a single ++ register. The are physically, so this should work fine. */ ++ if (dwarf2out_do_frame ()) ++ { ++ SET_DWARF_LABEL (dw2_label); ++ dwarf2out_reg_save (dw2_label, 70, info->cr_save_offset); ++ } + } + + /* If we need PIC_OFFSET_TABLE_REGNUM, initialize it now */ +@@ -4054,6 +4110,14 @@ output_prolog (file, size) + if (info->push_p && DEFAULT_ABI != ABI_V4 && DEFAULT_ABI != ABI_SOLARIS) + rs6000_allocate_stack_space (file, info->total_size, FALSE); + ++ /* Update the stack frame by size, We update it for all targets here ++ at the end since we saved everything relative to the incoming value. */ ++ ++ if (dwarf2out_do_frame () && info->push_p) ++ { ++ SET_DWARF_LABEL (dw2_label); ++ dwarf2out_def_cfa (dw2_label, 1 , info->total_size); ++ } + /* Set frame pointer, if needed. */ + if (frame_pointer_needed) + asm_fprintf (file, "\tmr %s,%s\n", reg_names[31], reg_names[1]); +Index: gcc/config/rs6000/rs6000.h +--- rs6000.h 1999/06/09 15:59:37 1.49.4.1 ++++ gcc/config/rs6000/rs6000.h 1999/06/12 18:55:36 +@@ -3139,6 +3175,54 @@ do { \ + + #define ASM_OPEN_PAREN "(" + #define ASM_CLOSE_PAREN ")" ++ ++#define ASM_OUTPUT_DWARF_STRING(FILE,P) \ ++ do { \ ++ register int slen = strlen(P); \ ++ register char *p = (P); \ ++ register int i; \ ++ fprintf (FILE, "\t.asciz \""); \ ++ for (i = 0; i < slen; i++) \ ++ { \ ++ register int c = p[i]; \ ++ if (c == '\"' || c == '\\') \ ++ putc ('\\', FILE); \ ++ if (c >= ' ' && c < 0177) \ ++ putc (c, FILE); \ ++ else \ ++ { \ ++ fprintf (FILE, "\\%o", c); \ ++ } \ ++ } \ ++ fprintf (FILE, "\""); \ ++ } \ ++ while (0) ++ ++ ++/* We can't communicate with the epilogue directly via the eh_epilogue ++ pattern, because we need to adjust the stack pointer JUST before ++ returning. If the floating point registers are restored via a ++ function call (instead of being inlined), we can't adjust the stack ++ before the callor the floating point registers will be restored from ++ the wrong address (its based of the SP.) Control never returns ++ from these routines since the return address is adjusted such that ++ when they return, they go to the target location. We leave the stub ++ mechanism in place, let the function or FP routines return to the stub ++ and do things the normal way. We have to tell the stub mechanism ++ whiuch registers to use however, since the general mechanism ++ in eh_regs (except.c) will end up choosing r0 (which is overwritten ++ by the epilogue, and R11, which is used by the epilogue for system V ++ targets. We'll just always use R4 and R5. Thats good for all targets. */ ++ ++#define DWARF2_EH_SP_REG 4 ++#define DWARF2_EH_RA_REG 5 ++ ++ ++/* Pick up the return address upon entry to a procedure. Used for ++ dwarf2 unwind information. This also enables the table driven mechanism. */ ++ ++#define INCOMING_RETURN_ADDR_RTX gen_rtx (REG, Pmode, 65) ++ + + /* Define results of standard character escape sequences. */ + #define TARGET_BELL 007 +Index: gcc/config/rs6000/rs6000.md +--- rs6000.md 1999/06/09 15:59:39 1.55.4.1 ++++ gcc/config/rs6000/rs6000.md 1999/06/12 18:55:37 +@@ -7738,7 +7738,7 @@ + + (define_insn "nonlocal_goto_receiver" + [(unspec_volatile [(const_int 0)] 1)] +- "TARGET_TOC && TARGET_MINIMAL_TOC" ++ "TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0" + "* + { + rs6000_output_load_toc_table (asm_out_file, 30); +Index: gcc/config/rs6000/sysv4.h +--- sysv4.h 1999/05/28 02:46:56 1.19.4.1 ++++ gcc/config/rs6000/sysv4.h 1999/06/12 18:55:38 +@@ -803,6 +803,40 @@ do { \ + fprintf (FILE, "\t.long "); \ + output_addr_const (FILE, (VALUE)); \ + fprintf (FILE, "\n"); \ ++ } \ ++} while (0) ++ ++ ++/* This is how to output an assembler line defining an address ++ constant for the dwarf call unwinding information. ++ For -mrelocatable, we mark all addresses that need to be fixed up ++ in the .fixup section. */ ++ ++extern int dwarflabelno; ++ ++#undef ASM_OUTPUT_DWARF_ADDR ++#define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \ ++do { \ ++ if ((TARGET_RELOCATABLE || flag_pic)) \ ++ { \ ++ char buf[256], *p; \ ++ \ ++ ASM_GENERATE_INTERNAL_LABEL (buf, "LCDW", dwarflabelno++); \ ++ STRIP_NAME_ENCODING (p, buf); \ ++ fprintf (FILE, "%s:\n", p); \ ++ fprintf (FILE, "\t.4byte\t"); \ ++ assemble_name (FILE, LABEL); \ ++ fprintf (FILE, "\n"); \ ++ fprintf (FILE, "\t.section \".fixup\",\"aw\"\n"); \ ++ ASM_OUTPUT_ALIGN (FILE, 2); \ ++ fprintf (FILE, "\t.long\t%s\n", p); \ ++ fprintf (FILE, "\t.previous\n"); \ ++ } \ ++ else \ ++ { \ ++ fprintf (FILE, "\t.4byte\t"); \ ++ assemble_name (FILE, LABEL); \ ++ fprintf (FILE, "\n"); \ + } \ + } while (0) + diff --git a/gcc-ppc-descriptions.patch b/gcc-ppc-descriptions.patch new file mode 100644 index 0000000..bf8913c --- /dev/null +++ b/gcc-ppc-descriptions.patch @@ -0,0 +1,231 @@ +# DP: Add descriptions to rs6000.h and sysv4.h to quench warnings. +# DP: by Franz Sirl + +Index: gcc/config/rs6000/rs6000.h +--- rs6000.h 1999/06/09 15:59:37 1.49.4.1 ++++ gcc/config/rs6000/rs6000.h 1999/06/12 18:55:36 +@@ -352,46 +352,81 @@ extern int target_flags; + #endif + + #define TARGET_SWITCHES \ +- {{"power", MASK_POWER | MASK_MULTIPLE | MASK_STRING}, \ ++ {{"power", MASK_POWER | MASK_MULTIPLE | MASK_STRING, \ ++ "Use POWER instruction set"}, \ + {"power2", (MASK_POWER | MASK_MULTIPLE | MASK_STRING \ +- | MASK_POWER2)}, \ +- {"no-power2", - MASK_POWER2}, \ ++ | MASK_POWER2), \ ++ "Use POWER2 instruction set"}, \ ++ {"no-power2", - MASK_POWER2, \ ++ "Do not use POWER2 instruction set"}, \ + {"no-power", - (MASK_POWER | MASK_POWER2 | MASK_MULTIPLE \ +- | MASK_STRING)}, \ +- {"powerpc", MASK_POWERPC}, \ ++ | MASK_STRING), \ ++ "Do not use POWER instruction set"}, \ ++ {"powerpc", MASK_POWERPC, \ ++ "Use PowerPC instruction set"}, \ + {"no-powerpc", - (MASK_POWERPC | MASK_PPC_GPOPT \ +- | MASK_PPC_GFXOPT | MASK_POWERPC64)}, \ +- {"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT}, \ +- {"no-powerpc-gpopt", - MASK_PPC_GPOPT}, \ +- {"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT}, \ +- {"no-powerpc-gfxopt", - MASK_PPC_GFXOPT}, \ +- {"powerpc64", MASK_POWERPC64}, \ +- {"no-powerpc64", - MASK_POWERPC64}, \ +- {"new-mnemonics", MASK_NEW_MNEMONICS}, \ +- {"old-mnemonics", -MASK_NEW_MNEMONICS}, \ ++ | MASK_PPC_GFXOPT | MASK_POWERPC64), \ ++ "Do not use PowerPC instruction set"}, \ ++ {"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT, \ ++ "Use PowerPC General Purpose group optional instructions"},\ ++ {"no-powerpc-gpopt", - MASK_PPC_GPOPT, \ ++ "Don't use PowerPC General Purpose group optional instructions"},\ ++ {"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT, \ ++ "Use PowerPC Graphics group optional instructions"},\ ++ {"no-powerpc-gfxopt", - MASK_PPC_GFXOPT, \ ++ "Don't use PowerPC Graphics group optional instructions"},\ ++ {"powerpc64", MASK_POWERPC64, \ ++ "Use PowerPC-64 instruction set"}, \ ++ {"no-powerpc64", - MASK_POWERPC64, \ ++ "Don't use PowerPC-64 instruction set"}, \ ++ {"new-mnemonics", MASK_NEW_MNEMONICS, \ ++ "Use new mnemonics for PowerPC architecture"}, \ ++ {"old-mnemonics", -MASK_NEW_MNEMONICS, \ ++ "Use old mnemonics for PowerPC architecture"}, \ + {"full-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC \ +- | MASK_MINIMAL_TOC)}, \ +- {"fp-in-toc", - MASK_NO_FP_IN_TOC}, \ +- {"no-fp-in-toc", MASK_NO_FP_IN_TOC}, \ +- {"sum-in-toc", - MASK_NO_SUM_IN_TOC}, \ +- {"no-sum-in-toc", MASK_NO_SUM_IN_TOC}, \ +- {"minimal-toc", MASK_MINIMAL_TOC}, \ +- {"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC)}, \ +- {"no-minimal-toc", - MASK_MINIMAL_TOC}, \ +- {"hard-float", - MASK_SOFT_FLOAT}, \ +- {"soft-float", MASK_SOFT_FLOAT}, \ +- {"multiple", MASK_MULTIPLE | MASK_MULTIPLE_SET}, \ +- {"no-multiple", - MASK_MULTIPLE}, \ +- {"no-multiple", MASK_MULTIPLE_SET}, \ +- {"string", MASK_STRING | MASK_STRING_SET}, \ +- {"no-string", - MASK_STRING}, \ +- {"no-string", MASK_STRING_SET}, \ +- {"update", - MASK_NO_UPDATE}, \ +- {"no-update", MASK_NO_UPDATE}, \ +- {"fused-madd", - MASK_NO_FUSED_MADD}, \ +- {"no-fused-madd", MASK_NO_FUSED_MADD}, \ ++ | MASK_MINIMAL_TOC), \ ++ "no description yet"}, \ ++ {"fp-in-toc", - MASK_NO_FP_IN_TOC, \ ++ "Place floating point constants in TOC"}, \ ++ {"no-fp-in-toc", MASK_NO_FP_IN_TOC, \ ++ "Don't place floating point constants in TOC"}, \ ++ {"sum-in-toc", - MASK_NO_SUM_IN_TOC, \ ++ "Place symbol+offset constants in TOC"}, \ ++ {"no-sum-in-toc", MASK_NO_SUM_IN_TOC, \ ++ "Don't place symbol+offset constants in TOC"}, \ ++ {"minimal-toc", MASK_MINIMAL_TOC, \ ++ "no description yet"}, \ ++ {"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC), \ ++ "no description yet"}, \ ++ {"no-minimal-toc", - MASK_MINIMAL_TOC, \ ++ "no description yet"}, \ ++ {"hard-float", - MASK_SOFT_FLOAT, \ ++ "Use hardware fp"}, \ ++ {"soft-float", MASK_SOFT_FLOAT, \ ++ "Do not use hardware fp"}, \ ++ {"multiple", MASK_MULTIPLE | MASK_MULTIPLE_SET, \ ++ "Generate load/store multiple instructions"}, \ ++ {"no-multiple", - MASK_MULTIPLE, \ ++ "Do not generate load/store multiple instructions"},\ ++ {"no-multiple", MASK_MULTIPLE_SET, \ ++ "Do not generate load/store multiple instructions"},\ ++ {"string", MASK_STRING | MASK_STRING_SET, \ ++ "Generate string instructions for block moves"},\ ++ {"no-string", - MASK_STRING, \ ++ "Do not generate string instructions for block moves"},\ ++ {"no-string", MASK_STRING_SET, \ ++ "Do not generate string instructions for block moves"},\ ++ {"update", - MASK_NO_UPDATE, \ ++ "Generate load/store with update instructions"},\ ++ {"no-update", MASK_NO_UPDATE, \ ++ "Do not generate load/store with update instructions"},\ ++ {"fused-madd", - MASK_NO_FUSED_MADD, \ ++ "Generate fused multiply/add instructions"}, \ ++ {"no-fused-madd", MASK_NO_FUSED_MADD, \ ++ "Don't generate fused multiply/add instructions"},\ + SUBTARGET_SWITCHES \ +- {"", TARGET_DEFAULT}} ++ {"", TARGET_DEFAULT, \ ++ ""}} + + #define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING) + +@@ -449,13 +484,13 @@ extern enum processor_type rs6000_cpu; + #define SUBTARGET_OPTIONS + #endif + +-#define TARGET_OPTIONS \ +-{ \ +- {"cpu=", &rs6000_select[1].string}, \ +- {"tune=", &rs6000_select[2].string}, \ +- {"debug-", &rs6000_debug_name}, \ +- {"debug=", &rs6000_debug_name}, \ +- SUBTARGET_OPTIONS \ ++#define TARGET_OPTIONS \ ++{ \ ++ {"cpu=", &rs6000_select[1].string, "Use features of and schedule code for given CPU" },\ ++ {"tune=", &rs6000_select[2].string, "Schedule code for given CPU" }, \ ++ {"debug-", &rs6000_debug_name, "Enable debug output" }, \ ++ {"debug=", &rs6000_debug_name, "Enable debug output" }, \ ++ SUBTARGET_OPTIONS \ + } + + /* rs6000_select[0] is reserved for the default cpu defined via --with-cpu */ +Index: gcc/config/rs6000/sysv4.h +--- sysv4.h 1999/05/28 02:46:56 1.19.4.1 ++++ gcc/config/rs6000/sysv4.h 1999/06/12 18:55:38 +@@ -66,39 +66,39 @@ extern enum rs6000_sdata_type rs6000_sda + the same as -mminimal-toc. */ + #undef SUBTARGET_SWITCHES + #define SUBTARGET_SWITCHES \ +- { "bit-align", -MASK_NO_BITFIELD_TYPE }, \ +- { "no-bit-align", MASK_NO_BITFIELD_TYPE }, \ +- { "strict-align", MASK_STRICT_ALIGN }, \ +- { "no-strict-align", -MASK_STRICT_ALIGN }, \ +- { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \ +- { "no-relocatable", -MASK_RELOCATABLE }, \ +- { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \ +- { "no-relocatable-lib", -MASK_RELOCATABLE }, \ +- { "little-endian", MASK_LITTLE_ENDIAN }, \ +- { "little", MASK_LITTLE_ENDIAN }, \ +- { "big-endian", -MASK_LITTLE_ENDIAN }, \ +- { "big", -MASK_LITTLE_ENDIAN }, \ +- { "no-toc", 0 }, \ +- { "toc", MASK_MINIMAL_TOC }, \ +- { "full-toc", MASK_MINIMAL_TOC }, \ +- { "prototype", MASK_PROTOTYPE }, \ +- { "no-prototype", -MASK_PROTOTYPE }, \ +- { "no-traceback", 0 }, \ +- { "eabi", MASK_EABI }, \ +- { "no-eabi", -MASK_EABI }, \ +- { "regnames", MASK_REGNAMES }, \ +- { "no-regnames", -MASK_REGNAMES }, \ +- { "sdata", 0 }, \ +- { "no-sdata", 0 }, \ +- { "sim", 0 }, \ +- { "ads", 0 }, \ +- { "yellowknife", 0 }, \ +- { "mvme", 0 }, \ +- { "emb", 0 }, \ +- { "solaris-cclib", 0 }, \ +- { "shlib", 0 }, \ +- EXTRA_SUBTARGET_SWITCHES \ +- { "newlib", 0 }, ++ { "bit-align", -MASK_NO_BITFIELD_TYPE, "Align to the base type of the bitfield." },\ ++ { "no-bit-align", MASK_NO_BITFIELD_TYPE, "Don't align to the base type of the bitfield." },\ ++ { "strict-align", MASK_STRICT_ALIGN, "Don't assume that unaligned accesses are handled by the system" },\ ++ { "no-strict-align", -MASK_STRICT_ALIGN, "Assume that unaligned accesses are handled by the system" },\ ++ { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, "Produce code relocatable at runtime." },\ ++ { "no-relocatable", -MASK_RELOCATABLE, "Don't produce code relocatable at runtime." },\ ++ { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, "Produce code relocatable at runtime." },\ ++ { "no-relocatable-lib", -MASK_RELOCATABLE, "Don't produce code relocatable at runtime." },\ ++ { "little-endian", MASK_LITTLE_ENDIAN, "Produce little endian code." }, \ ++ { "little", MASK_LITTLE_ENDIAN, "Produce little endian code." }, \ ++ { "big-endian", -MASK_LITTLE_ENDIAN, "Produce big endian code." }, \ ++ { "big", -MASK_LITTLE_ENDIAN, "Produce big endian code." }, \ ++ { "no-toc", 0, "no description yet" }, \ ++ { "toc", MASK_MINIMAL_TOC, "no description yet" }, \ ++ { "full-toc", MASK_MINIMAL_TOC, "no description yet" }, \ ++ { "prototype", MASK_PROTOTYPE, "no description yet" }, \ ++ { "no-prototype", -MASK_PROTOTYPE, "no description yet" }, \ ++ { "no-traceback", 0, "no description yet" }, \ ++ { "eabi", MASK_EABI, "Use EABI." }, \ ++ { "no-eabi", -MASK_EABI, "Don't use EABI." }, \ ++ { "regnames", MASK_REGNAMES, "Use alternate register names." }, \ ++ { "no-regnames", -MASK_REGNAMES, "Don't use alternate register names." },\ ++ { "sdata", 0, "no description yet" }, \ ++ { "no-sdata", 0, "no description yet" }, \ ++ { "sim", 0, "Link with libsim.a, libc.a and sim-crt0.o." }, \ ++ { "ads", 0, "Link with libads.a, libc.a and crt0.o." }, \ ++ { "yellowknife", 0, "Link with libyk.a, libc.a and crt0.o." }, \ ++ { "mvme", 0, "Link with libmvme.a, libc.a and crt0.o." }, \ ++ { "emb", 0, "Set the PPC_EMB bit in the ELF flags header" }, \ ++ { "solaris-cclib", 0, "no description yet" }, \ ++ { "shlib", 0, "no description yet" }, \ ++ EXTRA_SUBTARGET_SWITCHES \ ++ { "newlib", 0, "no description yet" }, + + /* This is meant to be redefined in the host dependent files */ + #define EXTRA_SUBTARGET_SWITCHES +@@ -111,8 +111,8 @@ extern const char *rs6000_abi_name; + extern const char *rs6000_sdata_name; + + #define SUBTARGET_OPTIONS \ +- { "call-", &rs6000_abi_name}, \ +- { "sdata=", &rs6000_sdata_name} ++ { "call-", &rs6000_abi_name, "Select ABI calling convention." }, \ ++ { "sdata=", &rs6000_sdata_name, "Select method for sdata handling." } + + /* Max # of bytes for variables to automatically be put into the .sdata + or .sdata2 sections. */ diff --git a/gcc-ppc-ice.patch b/gcc-ppc-ice.patch new file mode 100644 index 0000000..206e902 --- /dev/null +++ b/gcc-ppc-ice.patch @@ -0,0 +1,24 @@ +# DP: Add "Internal compiler error:" before some errors +# DP: by Franz Sirl + +Index: gcc/toplev.c +--- toplev.c 1999/05/20 10:40:05 1.185.4.1 ++++ gcc/toplev.c 1999/06/12 18:55:32 +@@ -1467,6 +1467,8 @@ fatal_insn VPROTO((const char *msgid, rt + #endif + va_list ap; + ++ error ("Internal compiler error:"); ++ + VA_START (ap, insn); + + #ifndef ANSI_PROTOTYPES +@@ -1943,6 +1945,8 @@ fatal VPROTO((const char *msgid, ...)) + const char *msgid; + #endif + va_list ap; ++ ++ error ("Internal compiler error:"); + + VA_START (ap, msgid); + diff --git a/gcc-sparc32-rfi.patch b/gcc-sparc32-rfi.patch new file mode 100644 index 0000000..2d0118e --- /dev/null +++ b/gcc-sparc32-rfi.patch @@ -0,0 +1,21 @@ +# DP: Makes it so sparc32 remains binary compatible with older releases + +--- gcc/crtstuff.c.orig Mon Apr 26 20:11:08 1999 ++++ gcc/crtstuff.c Mon Apr 26 20:12:28 1999 +@@ -89,11 +89,12 @@ + + /* References to __register_frame_info and __deregister_frame_info should + be weak in this file if at all possible. */ +-extern void __register_frame_info (void *, struct object *) +- TARGET_ATTRIBUTE_WEAK; ++extern void __register_frame_info (void *, struct object *); + +-extern void *__deregister_frame_info (void *) +- TARGET_ATTRIBUTE_WEAK; ++extern void *__deregister_frame_info (void *); ++/* DEBIAN/SPARC - Changed the references to the ++ * previous for binary compatibility reasons ++ */ + + /* Provide default definitions for the pseudo-ops used to switch to the + .ctors and .dtors sections. -- 2.44.0