diff options
author | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-04 08:16:35 +0000 |
---|---|---|
committer | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-04 08:16:35 +0000 |
commit | dc592072a380ece5b981d15449764c07a63ae9a8 (patch) | |
tree | 79522e278e93b1706236cb2e765444f74bc88979 | |
parent | 1373952868cb7ac8a23bc9f8f292cb61ef65c652 (diff) |
This commit was manufactured by cvs2svn to create tagx86-64-merge-2002-03-04
'x86-64-merge-2002-03-04'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/x86-64-merge-2002-03-04@50273 138bc75d-0d04-0410-961f-82ee72b054a4
111 files changed, 1856 insertions, 1267 deletions
diff --git a/ChangeLog b/ChangeLog index 9de6dc7939c..462eb3e36bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-02-28 Alexandre Oliva <aoliva@redhat.com> + + * configure.in (libstdcxx_flags): Don't add libstdc++-v3 flags for + libjava. + (CXX_FOR_TARGET): Explain why -shared-libgcc here. + 2002-02-23 Alexandre Oliva <aoliva@redhat.com> * Makefile.in (MAKEINFO): Don't assume makeinfo will be built just diff --git a/configure.in b/configure.in index 0c148079776..8c37ac9bef3 100644 --- a/configure.in +++ b/configure.in @@ -50,7 +50,7 @@ fi libstdcxx_version="target-libstdc++-v3" # Don't use libstdc++-v3's flags to configure/build itself. -libstdcxx_flags='`case $$dir in libstdc++-v3) ;; *) test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' +libstdcxx_flags='`case $$dir in libstdc++-v3 | libjava) ;; *) test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to @@ -1548,6 +1548,9 @@ fi if test "x${CXX_FOR_TARGET+set}" = xset; then : elif test -d ${topsrcdir}/gcc; then + # We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead + # of g++ for linking C++ or Java, because g++ has -shared-libgcc by + # default whereas gcc does not. CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3 | libjava) echo xgcc -shared-libgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags elif test "$host" = "$target"; then CXX_FOR_TARGET='$(CXX)' diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8925413080d..faf88a4eeea 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,178 @@ +2002-03-02 Per Bothner <per@bothner.com> + + * gcc.c (option_map): Suport new --bootclasspath option. + --CLASSPATH is now just an alias for --classpath. + +Sat Mar 2 06:30:14 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * config/sparc/sparc.c (sparc_initialize_trampoline): Use + trunc_int_for_mode. + + * emit-rtl.c (offset_address): Call update_temp_slot_address. + +2002-03-01 Richard Henderson <rth@redhat.com> + + * config/ia64/ia64.c (ia64_initial_elimination_offset): Do not + adjust argument_pointer by pretend_args_size. + (ia64_va_start): Adjust va_start address by -pretend_args_size. + +2002-03-01 Zack Weinberg <zack@codesourcery.com> + + * doc/cpp.texi: Clarify documentation of relationship between + #line and #include. + +2002-02-28 Richard Henderson <rth@redhat.com> + + * expmed.c (store_bit_field): Prevent generation of CONCATs; + pun complex values as integers; use gen_lowpart instead of + gen_rtx_SUBREG. + (extract_bit_field): Likewise. + +2002-02-28 David O'Brien <obrien@FreeBSD.org> + + * config.gcc (sparc64-*-freebsd): Explicitly accept a cpu specification + of "ultrasparc". + * config/sparc/freebsd.h: Do not use MASK_FASTER_STRUCTS. It appears + to be broken. + +2002-02-28 Alexandre Oliva <aoliva@redhat.com> + + * gcc.c (init_gcc_specs): Get -static and -static-libgcc to + override -shared and -shared-libgcc. + +2002-02-28 Andrew MacLeod <amacleod@redhat.com> + + * dwarf2out.c (stack_adjust_offset): Add support for POST_INC, + POST_DEC, and POST_MODIFY. + +2002-02-28 Joseph S. Myers <jsm28@cam.ac.uk> + + * doc/invoke.texi, doc/standards.texi: Link to + gcc-3.1/c99status.html. + +2002-02-28 Richard Henderson <rth@redhat.com> + + * config/ia64/ia64.c (ia64_adjust_cost): All non-MM consumers have + 4 cycle latency from MM producers. + (ia64_internal_sched_reorder): Likewise with pipeline flush. + +2002-02-28 Jakub Jelinek <jakub@redhat.com> + + * mklibgcc.in: Don't use GNU make extension. + +2002-02-28 Richard Henderson <rth@redhat.com> + + * haifa-sched.c (sched_emit_insn): New. + (schedule_block): Use last_scheduled_insn to track last insn. + * sched-int.h (sched_emit_insn): Prototype. + * config/ia64/ia64.c (last_issued): Remove. + (ia64_variable_issue): Don't set it. + (nop_cycles_until): Use sched_emit_insn. + +2002-02-28 Bo Thorsen <bo@suse.de> + + * config/i386/linux64.h (LINK_SPEC): Fix 32/64 bit compilation. + (STARTFILE_SPEC): Add 64 bit files. + (ENDFILE_SPEC): Likewise. + +Don Feb 28 16:41:19 CET 2002 Jan Hubicka <jh@suse.cz> + + * cfgrtl.c (purge_dead_edges): Fix handling of EH edges. + + * i386.h (CONDITIONAL_REGISTER_USAGE): Do not write to + PIC_OFFSET_TABLE_REGNUM when it is INVALID_REGNUM + + * x86-64.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Always define. + +2002-02-28 David Edelsohn <edelsohn@gnu.org> + + * config/rs6000/aix43.h (THREAD_MODEL_SPEC): Delete. + * config/rs6000/aix51.h (THREAD_MODEL_SPEC): Delete. + +2002-02-28 Alan Modra <amodra@bigpond.net.au> + + * config/rs6000/rs6000.md (load_toc_aix_di): Handle TARGET_RELOCATABLE. + +2002-02-28 Jason Merrill <jason@redhat.com> + + * c-decl.c (finish_function): Only warn about missing return + statement with -Wreturn-type. + +2002-02-27 Zack Weinberg <zack@codesourcery.com> + + * mklibgcc.in: Don't use \n in a line subject to + interpretation by echo. + +2002-02-27 Ulrich Weigand <uweigand@de.ibm.com> + + * config/s390/s390.c (s390_chunkify_pool): Do not confuse + insn UIDs with insn addresses. + +2002-02-27 Graham Stott <grahams@redhat.com> + + * config/rs6000/rs6000.h (ASM_OUTPUT_DEF_FROM_DECL): + Constify NAME. + + * loop.c (prescan_loop): Handle PARALLEL. + + * unroll.c (loop_iterations): Return 0 if the add_val for + a BIV is REG. + + * final.c (output_operand_lossage): Constify PFX_STR. + + * df.c (df_insn_refs_record): Use XEXP (x, 0) for USE. + +2002-02-26 Richard Henderson <rth@redhat.com> + + * config/alpha/alpha.md (ashldi_se): Re-enable. + +2002-02-26 Kelley Cook <kelleycook@comcast.net> + + * config/i386/i386.c (print_operand): Don't append ATT-style + length suffixs to x87 opcodes when in Intel mode. + +2002-02-26 Ryan T. Sammartino <ryants@shaw.ca> + + * emit-rtl.c (gen_const_vector_0): Remove TYPE argument. + (init_emit_once): Update calls. + * fixinc/gnu-regex.c (_GNU_SOURCE): Remove. + (init_syntax_once): Prototype. + +2002-02-26 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * pa-linux.h (LIB_SPEC): Update definition. + * pa32-linux.h (LINK_COMMAND_SPEC): Delete. + +2002-02-26 Alexandre Oliva <aoliva@redhat.com> + + * dwarf2out.c (gen_inlined_subroutine_die): If block is abstract, + generate a die for the lexical block. + +2002-02-26 Richard Henderson <rth@redhat.com> + + * expr.c (expand_expr) [MULT_EXPR]: Do not apply distributive law + in EXPAND_SUM case. Use host_integerp/tree_low_cst. + +2002-02-26 Richard Henderson <rth@redhat.com> + + * config/ia64/ia64.c (nop_cycles_until): Do init_insn_group_barriers + if we emitted a stop bit. + +2002-02-26 Jakub Jelinek <jakub@redhat.com> + + * configure.in (libgcc_visibility): Substitute. + * configure: Rebuilt. + * mklibgcc.in: If libgcc_visibility = yes, make libgcc.a global + defined symbols .hidden. + +2002-02-26 Jakub Jelinek <jakub@redhat.com> + + PR debug/5770 + * dwarf2out.c (rtl_for_decl_location): Return CONST_STRING for + STRING_CST initializer spanning the whole variable without + embedded zeros. + If expand_expr returned MEM, don't use it. + 2002-02-25 Jakub Jelinek <jakub@redhat.com> PR target/5755 @@ -17,7 +192,7 @@ 2002-02-25 Aldy Hernandez <aldyh@redhat.com> - * c-typeck.c (push_init_level): Handle vectors. + * c-typeck.c (push_init_level): Handle vectors. 2002-02-25 Alexandre Oliva <aoliva@redhat.com> @@ -35,11 +210,11 @@ 2002-02-25 Aldy Hernandez <aldyh@redhat.com> - * config/rs6000/rs6000.md ("get_vrsave_internal"): New. - ("*set_vrsave_internal"): use mfspr for Darwin. + * config/rs6000/rs6000.md ("get_vrsave_internal"): New. + ("*set_vrsave_internal"): use mfspr for Darwin. - * config/rs6000/rs6000.c (rs6000_emit_prologue): Call - gen_get_vrsave_internal. + * config/rs6000/rs6000.c (rs6000_emit_prologue): Call + gen_get_vrsave_internal. Sun Feb 24 16:38:56 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> @@ -133,7 +308,7 @@ Sat Feb 23 08:42:47 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> 2002-02-23 Aldy Hernandez <aldyh@redhat.com> - * config/rs6000/altivec.h: Add extra level of parentheses on casts. + * config/rs6000/altivec.h: Add extra level of parentheses on casts. 2002-02-22 David Edelsohn <edelsohn@gnu.org> @@ -283,7 +458,7 @@ Thu Feb 21 21:17:21 2002 J"orn Rennecke <joern.rennecke@superh.com> 2002-02-20 Torbjorn Granlund <tege@swox.com> * config/avr/avr.md: Add more patterns for mized-mode add and subtract - (addsi3_zero_extend, subhi3_zero_extend1, subsi3_zero_extend). + (addsi3_zero_extend, subhi3_zero_extend1, subsi3_zero_extend). Thu Feb 21 16:20:46 2002 Alexandre Oliva <aoliva@redhat.com> @@ -955,20 +1130,20 @@ Sat Feb 16 13:39:09 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> 2002-02-14 Aldy Hernandez <aldyh@redhat.com> - * config/rs6000/darwin.h (ROUND_TYPE_ALIGN): Adjust for vectors. + * config/rs6000/darwin.h (ROUND_TYPE_ALIGN): Adjust for vectors. - * config/rs6000/sysv4.h (ROUND_TYPE_ALIGN): Add MAX. + * config/rs6000/sysv4.h (ROUND_TYPE_ALIGN): Add MAX. 2002-02-14 Aldy Hernandez <aldyh@redhat.com> - * config/rs6000/rs6000.md ("*movv4si_internal"): Add m<-r and r<-r - alternatives. - ("*movv8hi_internal1"): Same. - ("*movv16qi_internal1"): Same. - ("*movv4sf_internal1"): Same. + * config/rs6000/rs6000.md ("*movv4si_internal"): Add m<-r and r<-r + alternatives. + ("*movv8hi_internal1"): Same. + ("*movv16qi_internal1"): Same. + ("*movv4sf_internal1"): Same. - * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Do - not push_reload for altivec modes. + * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Do + not push_reload for altivec modes. 2002-02-13 Joel Sherrill <joel@OARcorp.com> @@ -1081,17 +1256,17 @@ Wed Feb 13 10:35:56 CET 2002 Jan Hubicka <jh@suse.cz> 2002-02-12 Aldy Hernandez <aldyh@redhat.com> - * config/rs6000/rs6000.md: Use predicate altivec_register_operand - for altivec_lvx* and altivec_stvx*. - ("*movv4si_internal"): Add constraint for loading from GPRs. - ("*movv8hi_internal1"): Same. - ("*movv16qi_internal1"): Same. - ("*movv4sf_internal1"): Same. + * config/rs6000/rs6000.md: Use predicate altivec_register_operand + for altivec_lvx* and altivec_stvx*. + ("*movv4si_internal"): Add constraint for loading from GPRs. + ("*movv8hi_internal1"): Same. + ("*movv16qi_internal1"): Same. + ("*movv4sf_internal1"): Same. - * config/rs6000/rs6000.c (altivec_register_operand): New. + * config/rs6000/rs6000.c (altivec_register_operand): New. - * config/rs6000/rs6000.h (PREDICATE_CODES): Add - altivec_register_operand. + * config/rs6000/rs6000.h (PREDICATE_CODES): Add + altivec_register_operand. 2002-02-13 Hans-Peter Nilsson <hp@bitrange.com> @@ -1100,15 +1275,15 @@ Wed Feb 13 10:35:56 CET 2002 Jan Hubicka <jh@suse.cz> 2002-02-13 Stan Shebs <shebs@apple.com> - * c-typeck.c (digest_init): Handle vectors. - (really_start_incremental_init): Same. - (pop_init_level): Same. - (process_init_element): Same. + * c-typeck.c (digest_init): Handle vectors. + (really_start_incremental_init): Same. + (pop_init_level): Same. + (process_init_element): Same. - * varasm.c (output_constant): Same. + * varasm.c (output_constant): Same. - * expr.c (clear_storage): Same. - (store_constructor): Same. + * expr.c (clear_storage): Same. + (store_constructor): Same. 2002-02-12 Eric Christopher <echristo@redhat.com> @@ -2177,9 +2352,9 @@ Sat Feb 9 18:28:02 CET 2002 Jan Hubicka <jh@suse.cz> 2002-02-08 Chris Demetriou <cgd@broadcom.com> - * config/mips/mips.md (casesi_internal, casesi_internal_di): - Protect jump delay slot instructions with .set noreorder and - .set nomacro. + * config/mips/mips.md (casesi_internal, casesi_internal_di): + Protect jump delay slot instructions with .set noreorder and + .set nomacro. 2002-02-08 Chris Demetriou <cgd@broadcom.com> @@ -2415,7 +2590,7 @@ Thu Feb 7 12:14:17 CET 2002 Jan Hubicka <jh@suse.cz> 2002-02-06 Aldy Hernandez <aldyh@redhat.com> - * config/rs6000/altivec.h: Change elem to _S_elem. + * config/rs6000/altivec.h: Change elem to _S_elem. 2002-02-05 Jason Thorpe <thorpej@wasabisystems.com> @@ -2565,10 +2740,10 @@ Mon Feb 4 19:23:19 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * config/arm/arm.h (machine_function): Add uses_anonymous_args field. - (SETUP_INCOMING_VARARGS): Set uses_anonymous_args. + (SETUP_INCOMING_VARARGS): Set uses_anonymous_args. * config/arm/arm.c (current_function_anonymous_args): Delete, - replace uses with cfun->machine->uses_anonymous_args. - (arm_reorg): Do not reset uses_anonymous_args. + replace uses with cfun->machine->uses_anonymous_args. + (arm_reorg): Do not reset uses_anonymous_args. * config/arm/arm.c (arm_hard_regno_mode_ok): Allow any value in any geenral register. @@ -2675,8 +2850,8 @@ Mon Feb 4 09:05:58 2002 Jeffrey A Law (law@redhat.com) 2002-02-04 Hartmut Penner <hpenner@de.ibm.com> - * varasm.c (decode_rtx_const): Allow unspec (symbol_ref) in - constant pool to be identical by string address and index. + * varasm.c (decode_rtx_const): Allow unspec (symbol_ref) in + constant pool to be identical by string address and index. 2002-02-04 Anthony Green <green@redhat.com> @@ -2831,18 +3006,18 @@ doc: 2002-01-30 Andrew Haley <aph@cambridge.redhat.com> - * config/stormy16/stormy16.md (pushqi): New. - (popqi): New. - (pushhi): New. - (pophi): New. - (movhi): Remove stack operands. - (movqi): Likewise. - * config/stormy16/stormy16.h (PREDICATE_CODES): Add - nonimmediate_nonstack_operand. - * config/stormy16/stormy16.c (nonimmediate_nonstack_operand): - New. - * config/stormy16/stormy16-protos.h (nonimmediate_nonstack_operand) - New. + * config/stormy16/stormy16.md (pushqi): New. + (popqi): New. + (pushhi): New. + (pophi): New. + (movhi): Remove stack operands. + (movqi): Likewise. + * config/stormy16/stormy16.h (PREDICATE_CODES): Add + nonimmediate_nonstack_operand. + * config/stormy16/stormy16.c (nonimmediate_nonstack_operand): + New. + * config/stormy16/stormy16-protos.h (nonimmediate_nonstack_operand) + New. 2002-01-31 Jason Merrill <jason@redhat.com> diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 23c37ef8d93..c70354bd42e 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6938,7 +6938,8 @@ finish_function (nested) finish_stmt_tree (&DECL_SAVED_TREE (fndecl)); /* Complain if there's just no return statement. */ - if (TREE_CODE (TREE_TYPE (TREE_TYPE (fndecl))) != VOID_TYPE + if (warn_return_type + && TREE_CODE (TREE_TYPE (TREE_TYPE (fndecl))) != VOID_TYPE && !current_function_returns_value && !current_function_returns_null /* Don't complain if we abort. */ && !current_function_returns_abnormally @@ -6946,9 +6947,9 @@ finish_function (nested) && !MAIN_NAME_P (DECL_NAME (fndecl)) /* Or if they didn't actually specify a return type. */ && !C_FUNCTION_IMPLICIT_INT (fndecl) - /* If we have -Wreturn-type, let flow complain. Unless we're an + /* Normally, with -Wreturn-type, flow will complain. Unless we're an inline function, as we might never be compiled separately. */ - && (!warn_return_type || DECL_INLINE (fndecl))) + && DECL_INLINE (fndecl)) warning ("no return statement in function returning non-void"); /* Clear out memory we no longer need. */ diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 5b99ab237e2..f548b3f93ea 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -1897,9 +1897,30 @@ purge_dead_edges (bb) rtx insn = bb->end, note; bool purged = false; - /* ??? This makes no sense since the later test includes more cases. */ - if (GET_CODE (insn) == JUMP_INSN && !simplejump_p (insn)) - return false; + /* If this instruction cannot trap, remove REG_EH_REGION notes. */ + if (GET_CODE (insn) == INSN + && (note = find_reg_note (insn, REG_EH_REGION, NULL))) + { + rtx eqnote; + + if (! may_trap_p (PATTERN (insn)) + || ((eqnote = find_reg_equal_equiv_note (insn)) + && ! may_trap_p (XEXP (eqnote, 0)))) + remove_note (insn, note); + } + + /* Cleanup abnormal edges caused by throwing insns that have been + eliminated. */ + if (! can_throw_internal (bb->end)) + for (e = bb->succ; e; e = next) + { + next = e->succ_next; + if (e->flags & EDGE_EH) + { + remove_edge (e); + purged = true; + } + } if (GET_CODE (insn) == JUMP_INSN) { @@ -1968,31 +1989,6 @@ purge_dead_edges (bb) return purged; } - /* If this instruction cannot trap, remove REG_EH_REGION notes. */ - if (GET_CODE (insn) == INSN - && (note = find_reg_note (insn, REG_EH_REGION, NULL))) - { - rtx eqnote; - - if (! may_trap_p (PATTERN (insn)) - || ((eqnote = find_reg_equal_equiv_note (insn)) - && ! may_trap_p (XEXP (eqnote, 0)))) - remove_note (insn, note); - } - - /* Cleanup abnormal edges caused by throwing insns that have been - eliminated. */ - if (! can_throw_internal (bb->end)) - for (e = bb->succ; e; e = next) - { - next = e->succ_next; - if (e->flags & EDGE_EH) - { - remove_edge (e); - purged = true; - } - } - /* If we don't see a jump insn, we don't know exactly why the block would have been broken at this point. Look for a simple, non-fallthru edge, as these are only created by conditional branches. If we find such an diff --git a/gcc/config.gcc b/gcc/config.gcc index a7a9922905e..597e1f8fe26 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -3229,6 +3229,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*) tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h" xmake_file=none case "x$with_cpu" in + xultrasparc) ;; x) with_cpu=ultrasparc ;; *) echo "$with_cpu not supported for freebsd target"; exit 1 ;; esac diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index fbbac9eac7a..fdbdf089b0c 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -1597,23 +1597,20 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi" } [(set_attr "type" "iadd,shift")]) -;; ??? The following pattern is made by combine, but earlier phases -;; (specifically flow) can't handle it. This occurs in jump.c. Deal -;; with this in a better way at some point. -;;(define_insn "" -;; [(set (match_operand:DI 0 "register_operand" "=r") -;; (sign_extend:DI -;; (subreg:SI (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") -;; (match_operand:DI 2 "const_int_operand" "P")) -;; 0)))] -;; "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3" -;;{ -;; if (operands[2] == const1_rtx) -;; return "addl %r1,%r1,%0"; -;; else -;; return "s%P2addl %r1,0,%0"; -;;} -;; [(set_attr "type" "iadd")]) +(define_insn "*ashldi_se" + [(set (match_operand:DI 0 "register_operand" "=r") + (sign_extend:DI + (subreg:SI (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") + (match_operand:DI 2 "const_int_operand" "P")) + 0)))] + "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3" +{ + if (operands[2] == const1_rtx) + return "addl %r1,%r1,%0"; + else + return "s%P2addl %r1,0,%0"; +} + [(set_attr "type" "iadd")]) (define_insn "lshrdi3" [(set (match_operand:DI 0 "register_operand" "=r") diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index fc78c57ec5c..0a354d66677 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5731,11 +5731,14 @@ print_operand (file, x, code) case 'z': /* 387 opcodes don't get size suffixes if the operands are registers. */ - if (STACK_REG_P (x)) return; - /* this is the size of op from size of operand */ + /* Likewise if using Intel opcodes. */ + if (ASSEMBLER_DIALECT == ASM_INTEL) + return; + + /* This is the size of op from size of operand. */ switch (GET_MODE_SIZE (GET_MODE (x))) { case 2: diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index ceacd6c6041..a99204c76ce 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -957,7 +957,7 @@ do { \ call_used_regs[i] = (call_used_regs[i] \ & (TARGET_64BIT ? 2 : 1)) != 0; \ } \ - if (flag_pic) \ + if (flag_pic && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) \ { \ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h index 8d70972638c..925cc20d1e8 100644 --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -39,10 +39,29 @@ Boston, MA 02111-1307, USA. */ done. */ #undef LINK_SPEC -#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} %{shared:-shared} \ +#define LINK_SPEC "%{!m32:-m elf_x86_64 -Y P,/usr/lib64} %{m32:-m elf_i386} \ + %{shared:-shared} \ %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}} \ - %{static:-static}}" + %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ + %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \ + %{static:-static}}" +#undef STARTFILE_SPEC +#define STARTFILE_SPEC \ + "%{m32:%{!shared: \ + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ + %{!p:%{profile:gcrt1.o%s} %{!profile:crt1.o%s}}}} \ + crti.o%s %{static:crtbeginT.o%s}\ + %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}} \ + %{!m32:%{!shared: \ + %{pg:/usr/lib64/gcrt1.o%s} %{!pg:%{p:/usr/lib64/gcrt1.o%s} \ + %{!p:%{profile:/usr/lib64/gcrt1.o%s} %{!profile:/usr/lib64/crt1.o%s}}}}\ + /usr/lib64/crti.o%s %{static:crtbeginT.o%s} \ + %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}}" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "\ + %{m32:%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s} \ + %{!m32:%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib64/crtn.o%s}" diff --git a/gcc/config/i386/scodbx.h b/gcc/config/i386/scodbx.h deleted file mode 100644 index 7da93053256..00000000000 --- a/gcc/config/i386/scodbx.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Definitions for Intel 386 running SCO Unix System V, - using dbx-in-coff encapsulation. - Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "i386/svr3dbx.h" - -/* Overridden defines for SCO systems from sco.h. */ - -/* By default, target has a 80387, uses IEEE compatible arithmetic, - and returns float values in the 387, ie, - (TARGET_80387 | TARGET_FLOAT_RETURNS_IN_80387) - - SCO's software emulation of a 387 fails to handle the `fucomp' - opcode. fucomp is only used when generating IEEE compliant code. - So don't make TARGET_IEEE_FP default for SCO. */ - -#undef TARGET_SUBTARGET_DEFAULT -#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_FLOAT_RETURNS) - -/* Use crt1.o as a startup file and crtn.o as a closing file. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\ - %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}" - -/* Library spec, including SCO international language support. */ - -#undef LIB_SPEC -#define LIB_SPEC \ - "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} %{scointl:libintl.a%s} -lc" - -/* Specify predefined symbols in preprocessor. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -DM_UNIX -DM_I386 -DM_COFF -DM_WORDSWAP -Asystem=svr3" - -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{scointl:-DM_INTERNAT}" - -/* This spec is used for telling cpp whether char is signed or not. */ - -#undef SIGNED_CHAR_SPEC -#if DEFAULT_SIGNED_CHAR -#define SIGNED_CHAR_SPEC \ - "%{funsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" -#else -#define SIGNED_CHAR_SPEC \ - "%{!fsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" -#endif - -/* caller has to pop the extra argument passed to functions that return - structures. */ - -#undef RETURN_POPS_ARGS -#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ - : (TARGET_RTD \ - && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ - || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ - == void_type_node))) ? (SIZE) \ - : 0) -/* On other 386 systems, the last line looks like this: - : (aggregate_value_p (TREE_TYPE (FUNTYPE))) ? GET_MODE_SIZE (Pmode) : 0) */ - -/* Handle #pragma pack. */ -#define HANDLE_SYSV_PRAGMA diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h index c6a83761c98..56e46841729 100644 --- a/gcc/config/i386/x86-64.h +++ b/gcc/config/i386/x86-64.h @@ -73,7 +73,6 @@ Boston, MA 02111-1307, USA. */ This is used to align code labels according to Intel recommendations. */ -#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ do { \ if ((LOG) != 0) { \ @@ -81,7 +80,6 @@ Boston, MA 02111-1307, USA. */ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ } \ } while (0) -#endif /* i386 System V Release 4 uses DWARF debugging info. diff --git a/gcc/config/i386/xm-dgux.h b/gcc/config/i386/xm-dgux.h deleted file mode 100644 index 881c5c7be9d..00000000000 --- a/gcc/config/i386/xm-dgux.h +++ /dev/null @@ -1,4 +0,0 @@ -/* Configuration for GCC for Intel i386 running DG/ux */ - -/* looks just like sysv4 for now */ -#include "xm-svr4.h" diff --git a/gcc/config/i386/xm-sun.h b/gcc/config/i386/xm-sun.h deleted file mode 100644 index 6c0f0a25630..00000000000 --- a/gcc/config/i386/xm-sun.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Configuration for GNU C-compiler for Intel 80386 running SunOS 4.0. - Copyright (C) 1988, 1997 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#define USG diff --git a/gcc/config/i386/xm-sysv3.h b/gcc/config/i386/xm-sysv3.h deleted file mode 100644 index 9a655443ff5..00000000000 --- a/gcc/config/i386/xm-sysv3.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Configuration for GCC for Intel i386 running System V Release 3. */ - -#include "xm-svr3.h" diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 7ca060b68e7..5b8ac6634ed 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -1664,10 +1664,9 @@ ia64_initial_elimination_offset (from, to) /* Arguments start above the 16 byte save area, unless stdarg in which case we store through the 16 byte save area. */ if (to == HARD_FRAME_POINTER_REGNUM) - offset = 16 - current_function_pretend_args_size; + offset = 16; else if (to == STACK_POINTER_REGNUM) - offset = (current_frame_info.total_size - + 16 - current_function_pretend_args_size); + offset = current_frame_info.total_size + 16; else abort (); break; @@ -3220,7 +3219,7 @@ ia64_va_start (stdarg_p, valist, nextarg) else ofs = (arg_words >= MAX_ARGUMENT_SLOTS ? -UNITS_PER_WORD : 0); - nextarg = plus_constant (nextarg, ofs); + nextarg = plus_constant (nextarg, ofs - current_function_pretend_args_size); std_expand_builtin_va_start (1, valist, nextarg); } @@ -5348,6 +5347,7 @@ ia64_adjust_cost (insn, link, dep_insn, cost) if (reg_overlap_mentioned_p (SET_DEST (set), addr)) return cost + 1; } + if ((dep_class == ITANIUM_CLASS_IALU || dep_class == ITANIUM_CLASS_ILOG || dep_class == ITANIUM_CLASS_LD) @@ -5355,25 +5355,28 @@ ia64_adjust_cost (insn, link, dep_insn, cost) || insn_class == ITANIUM_CLASS_MMSHF || insn_class == ITANIUM_CLASS_MMSHFI)) return 3; + if (dep_class == ITANIUM_CLASS_FMAC && (insn_class == ITANIUM_CLASS_FMISC || insn_class == ITANIUM_CLASS_FCVTFX || insn_class == ITANIUM_CLASS_XMPY)) return 7; + if ((dep_class == ITANIUM_CLASS_FMAC || dep_class == ITANIUM_CLASS_FMISC || dep_class == ITANIUM_CLASS_FCVTFX || dep_class == ITANIUM_CLASS_XMPY) && insn_class == ITANIUM_CLASS_STF) return 8; + + /* Intel docs say only LD, ST, IALU, ILOG, ISHF consumers have latency 4, + but HP engineers say any non-MM operation. */ if ((dep_class == ITANIUM_CLASS_MMMUL || dep_class == ITANIUM_CLASS_MMSHF || dep_class == ITANIUM_CLASS_MMSHFI) - && (insn_class == ITANIUM_CLASS_LD - || insn_class == ITANIUM_CLASS_ST - || insn_class == ITANIUM_CLASS_IALU - || insn_class == ITANIUM_CLASS_ILOG - || insn_class == ITANIUM_CLASS_ISHF)) + && insn_class != ITANIUM_CLASS_MMMUL + && insn_class != ITANIUM_CLASS_MMSHF + && insn_class != ITANIUM_CLASS_MMSHFI) return 4; return cost; @@ -6074,12 +6077,6 @@ static int prev_cycle; value of sched_data.first_slot. */ static int prev_first; -/* The last insn that has been scheduled. At the start of a new cycle - we know that we can emit new insns after it; the main scheduling code - has already emitted a cycle_display insn after it and is using that - as its current last insn. */ -static rtx last_issued; - /* Emit NOPs to fill the delay between PREV_CYCLE and CLOCK_VAR. Used to pad out the delay between MM (shifts, etc.) and integer operations. */ @@ -6090,12 +6087,13 @@ nop_cycles_until (clock_var, dump) { int prev_clock = prev_cycle; int cycles_left = clock_var - prev_clock; + bool did_stop = false; /* Finish the previous cycle; pad it out with NOPs. */ if (sched_data.cur == 3) { - rtx t = gen_insn_group_barrier (GEN_INT (3)); - last_issued = emit_insn_after (t, last_issued); + sched_emit_insn (gen_insn_group_barrier (GEN_INT (3))); + did_stop = true; maybe_rotate (dump); } else if (sched_data.cur > 0) @@ -6114,12 +6112,9 @@ nop_cycles_until (clock_var, dump) int i; for (i = sched_data.cur; i < split; i++) { - rtx t; - - t = gen_nop_type (sched_data.packet->t[i]); - last_issued = emit_insn_after (t, last_issued); + rtx t = sched_emit_insn (gen_nop_type (sched_data.packet->t[i])); sched_data.types[i] = sched_data.packet->t[sched_data.cur]; - sched_data.insns[i] = last_issued; + sched_data.insns[i] = t; sched_data.stopbit[i] = 0; } sched_data.cur = split; @@ -6131,12 +6126,9 @@ nop_cycles_until (clock_var, dump) int i; for (i = sched_data.cur; i < 6; i++) { - rtx t; - - t = gen_nop_type (sched_data.packet->t[i]); - last_issued = emit_insn_after (t, last_issued); + rtx t = sched_emit_insn (gen_nop_type (sched_data.packet->t[i])); sched_data.types[i] = sched_data.packet->t[sched_data.cur]; - sched_data.insns[i] = last_issued; + sched_data.insns[i] = t; sched_data.stopbit[i] = 0; } sched_data.cur = 6; @@ -6146,8 +6138,8 @@ nop_cycles_until (clock_var, dump) if (need_stop || sched_data.cur == 6) { - rtx t = gen_insn_group_barrier (GEN_INT (3)); - last_issued = emit_insn_after (t, last_issued); + sched_emit_insn (gen_insn_group_barrier (GEN_INT (3))); + did_stop = true; } maybe_rotate (dump); } @@ -6155,24 +6147,22 @@ nop_cycles_until (clock_var, dump) cycles_left--; while (cycles_left > 0) { - rtx t = gen_bundle_selector (GEN_INT (0)); - last_issued = emit_insn_after (t, last_issued); - t = gen_nop_type (TYPE_M); - last_issued = emit_insn_after (t, last_issued); - t = gen_nop_type (TYPE_I); - last_issued = emit_insn_after (t, last_issued); + sched_emit_insn (gen_bundle_selector (GEN_INT (0))); + sched_emit_insn (gen_nop_type (TYPE_M)); + sched_emit_insn (gen_nop_type (TYPE_I)); if (cycles_left > 1) { - t = gen_insn_group_barrier (GEN_INT (2)); - last_issued = emit_insn_after (t, last_issued); + sched_emit_insn (gen_insn_group_barrier (GEN_INT (2))); cycles_left--; } - t = gen_nop_type (TYPE_I); - last_issued = emit_insn_after (t, last_issued); - t = gen_insn_group_barrier (GEN_INT (3)); - last_issued = emit_insn_after (t, last_issued); + sched_emit_insn (gen_nop_type (TYPE_I)); + sched_emit_insn (gen_insn_group_barrier (GEN_INT (3))); + did_stop = true; cycles_left--; } + + if (did_stop) + init_insn_group_barriers (); } /* We are about to being issuing insns for this clock cycle. @@ -6198,31 +6188,34 @@ ia64_internal_sched_reorder (dump, sched_verbose, ready, pn_ready, dump_current_packet (dump); } + /* Work around the pipeline flush that will occurr if the results of + an MM instruction are accessed before the result is ready. Intel + documentation says this only happens with IALU, ISHF, ILOG, LD, + and ST consumers, but experimental evidence shows that *any* non-MM + type instruction will incurr the flush. */ if (reorder_type == 0 && clock_var > 0 && ia64_final_schedule) { for (insnp = ready; insnp < e_ready; insnp++) { - rtx insn = *insnp; + rtx insn = *insnp, link; enum attr_itanium_class t = ia64_safe_itanium_class (insn); - if (t == ITANIUM_CLASS_IALU || t == ITANIUM_CLASS_ISHF - || t == ITANIUM_CLASS_ILOG - || t == ITANIUM_CLASS_LD || t == ITANIUM_CLASS_ST) - { - rtx link; - for (link = LOG_LINKS (insn); link; link = XEXP (link, 1)) - if (REG_NOTE_KIND (link) != REG_DEP_OUTPUT - && REG_NOTE_KIND (link) != REG_DEP_ANTI) + + if (t == ITANIUM_CLASS_MMMUL + || t == ITANIUM_CLASS_MMSHF + || t == ITANIUM_CLASS_MMSHFI) + continue; + + for (link = LOG_LINKS (insn); link; link = XEXP (link, 1)) + if (REG_NOTE_KIND (link) == 0) + { + rtx other = XEXP (link, 0); + enum attr_itanium_class t0 = ia64_safe_itanium_class (other); + if (t0 == ITANIUM_CLASS_MMSHF || t0 == ITANIUM_CLASS_MMMUL) { - rtx other = XEXP (link, 0); - enum attr_itanium_class t0 = ia64_safe_itanium_class (other); - if (t0 == ITANIUM_CLASS_MMSHF - || t0 == ITANIUM_CLASS_MMMUL) - { - nop_cycles_until (clock_var, sched_verbose ? dump : NULL); - goto out; - } + nop_cycles_until (clock_var, sched_verbose ? dump : NULL); + goto out; } - } + } } } out: @@ -6486,8 +6479,6 @@ ia64_variable_issue (dump, sched_verbose, insn, can_issue_more) { enum attr_type t = ia64_safe_type (insn); - last_issued = insn; - if (sched_data.last_was_stop) { int t = sched_data.first_slot; diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h index 7138e755d25..2f0ee02db3b 100644 --- a/gcc/config/pa/pa-linux.h +++ b/gcc/config/pa/pa-linux.h @@ -28,7 +28,10 @@ Boston, MA 02111-1307, USA. */ #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__hppa__ -Dlinux -Asystem=unix -Asystem=posix -Acpu=hppa -Amachine=hppa -Amachine=bigendian" #undef LIB_SPEC -#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" +#define LIB_SPEC \ + "%{shared: -lgcc -lc} \ + %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \ + %{shared-libgcc: -lgcc} %{profile:-lc_p} %{!profile: -lc}}" #undef ASM_SPEC #define ASM_SPEC \ diff --git a/gcc/config/pa/pa32-linux.h b/gcc/config/pa/pa32-linux.h index 09bd44d8965..81f64529a3a 100644 --- a/gcc/config/pa/pa32-linux.h +++ b/gcc/config/pa/pa32-linux.h @@ -24,14 +24,3 @@ Boston, MA 02111-1307, USA. */ #undef CPP_SPEC #define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{mhppa:-D__hppa__} %{posix:-D_POSIX_SOURCE} -D_PA_RISC1_1" - -/* We need to link against libgcc.a to resolve millicode references. */ -#undef LINK_COMMAND_SPEC -#define LINK_COMMAND_SPEC "\ -%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ - %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}\ - %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ - %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%G %L %G}}\ - %{!A:%{!nostdlib:%{!nostartfiles:%E}}}\ - %{!nostdlib:%{!nodefaultlibs:%{!static:%{!static-libgcc:-lgcc}}}}\ - %{T*} }}}}}}" diff --git a/gcc/config/rs6000/aix43.h b/gcc/config/rs6000/aix43.h index 93e186ca2a0..7aa8707cdab 100644 --- a/gcc/config/rs6000/aix43.h +++ b/gcc/config/rs6000/aix43.h @@ -199,10 +199,6 @@ do { \ %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\ %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}" -/* Since there are separate multilibs for pthreads, determine the - thread model based on the command-line arguments. */ -#define THREAD_MODEL_SPEC "%{pthread:posix}%{!pthread:single}" - /* AIX 4.3 typedefs ptrdiff_t as "long" while earlier releases used "int". */ #undef PTRDIFF_TYPE diff --git a/gcc/config/rs6000/aix51.h b/gcc/config/rs6000/aix51.h index ae01440f5d3..8dc0b86ba4f 100644 --- a/gcc/config/rs6000/aix51.h +++ b/gcc/config/rs6000/aix51.h @@ -202,10 +202,6 @@ do { \ %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\ %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}" -/* Since there are separate multilibs for pthreads, determine the - thread model based on the command-line arguments. */ -#define THREAD_MODEL_SPEC "%{pthread:posix}%{!pthread:single}" - /* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int". */ #undef PTRDIFF_TYPE diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 9056cd625f2..3c509c6b6a1 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -2426,7 +2426,7 @@ extern int toc_initialized; #define ASM_OUTPUT_DEF_FROM_DECLS(FILE,decl,target) \ do { \ const char * alias = XSTR (XEXP (DECL_RTL (decl), 0), 0); \ - char * name = IDENTIFIER_POINTER (target); \ + const char * name = IDENTIFIER_POINTER (target); \ if (TREE_CODE (decl) == FUNCTION_DECL \ && DEFAULT_ABI == ABI_AIX) \ { \ diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index baf96534802..900ca757b9f 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -9566,7 +9566,12 @@ "* { char buf[30]; +#ifdef TARGET_RELOCATABLE + ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\", + !TARGET_MINIMAL_TOC || TARGET_RELOCATABLE); +#else ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\", 1); +#endif if (TARGET_ELF) strcat (buf, \"@toc\"); operands[1] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index dcccb00b920..38c6f59b11f 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -2459,7 +2459,7 @@ s390_split_branches (void) static void s390_chunkify_pool (void) { - int *ltorg_uids, max_ltorg, chunk, last_addr; + int *ltorg_uids, max_ltorg, chunk, last_addr, next_addr; rtx insn; /* Do we need to chunkify the literal pool? */ @@ -2498,12 +2498,15 @@ s390_chunkify_pool (void) } } - ltorg_uids[max_ltorg] = insn_current_address + 1; + ltorg_uids[max_ltorg] = -1; /* Find and mark all labels that are branched into from an insn belonging to a different chunk. */ chunk = last_addr = 0; + next_addr = ltorg_uids[chunk] == -1 ? insn_current_address + 1 + : INSN_ADDRESSES (ltorg_uids[chunk]); + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { if (GET_CODE (insn) == JUMP_INSN) @@ -2528,8 +2531,8 @@ s390_chunkify_pool (void) if (label) { if (INSN_ADDRESSES (INSN_UID (label)) <= last_addr - || INSN_ADDRESSES (INSN_UID (label)) > ltorg_uids[chunk]) - SYMBOL_REF_USED (label) = 1; + || INSN_ADDRESSES (INSN_UID (label)) > next_addr) + SYMBOL_REF_USED (label) = 1; } } else if (GET_CODE (pat) == ADDR_VEC @@ -2542,7 +2545,7 @@ s390_chunkify_pool (void) rtx label = XEXP (XVECEXP (pat, diff_p, i), 0); if (INSN_ADDRESSES (INSN_UID (label)) <= last_addr - || INSN_ADDRESSES (INSN_UID (label)) > ltorg_uids[chunk]) + || INSN_ADDRESSES (INSN_UID (label)) > next_addr) SYMBOL_REF_USED (label) = 1; } } @@ -2550,7 +2553,9 @@ s390_chunkify_pool (void) if (INSN_UID (insn) == ltorg_uids[chunk]) { - last_addr = ltorg_uids[chunk++]; + last_addr = INSN_ADDRESSES (ltorg_uids[chunk++]); + next_addr = ltorg_uids[chunk] == -1 ? insn_current_address + 1 + : INSN_ADDRESSES (ltorg_uids[chunk]); } } diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h index b0992fab025..61a61d40d3e 100644 --- a/gcc/config/sparc/freebsd.h +++ b/gcc/config/sparc/freebsd.h @@ -91,7 +91,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ - (MASK_V9 + MASK_64BIT + MASK_PTR64 + MASK_FASTER_STRUCTS \ + (MASK_V9 + MASK_64BIT + MASK_PTR64 /* + MASK_FASTER_STRUCTS */ \ + MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU \ + MASK_LONG_DOUBLE_128 /* + MASK_HARD_QUAD */) diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index d661d30cdb3..e101fa7a0ac 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -6263,37 +6263,39 @@ sparc_initialize_trampoline (tramp, fnaddr, cxt) 0, VOIDmode, 1, tramp, Pmode); #endif - emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 0)), - expand_binop (SImode, ior_optab, - expand_shift (RSHIFT_EXPR, SImode, fnaddr, - size_int (10), 0, 1), - GEN_INT (0x03000000), - NULL_RTX, 1, OPTAB_DIRECT)); + emit_move_insn + (gen_rtx_MEM (SImode, plus_constant (tramp, 0)), + expand_binop (SImode, ior_optab, + expand_shift (RSHIFT_EXPR, SImode, fnaddr, + size_int (10), 0, 1), + GEN_INT (trunc_int_for_mode (0x03000000, SImode)), + NULL_RTX, 1, OPTAB_DIRECT)); + + emit_move_insn + (gen_rtx_MEM (SImode, plus_constant (tramp, 4)), + expand_binop (SImode, ior_optab, + expand_shift (RSHIFT_EXPR, SImode, cxt, + size_int (10), 0, 1), + GEN_INT (trunc_int_for_mode (0x05000000, SImode)), + NULL_RTX, 1, OPTAB_DIRECT)); + + emit_move_insn + (gen_rtx_MEM (SImode, plus_constant (tramp, 8)), + expand_binop (SImode, ior_optab, + expand_and (SImode, fnaddr, GEN_INT (0x3ff), NULL_RTX), + GEN_INT (trunc_int_for_mode (0x81c06000, SImode)), + NULL_RTX, 1, OPTAB_DIRECT)); + + emit_move_insn + (gen_rtx_MEM (SImode, plus_constant (tramp, 12)), + expand_binop (SImode, ior_optab, + expand_and (SImode, cxt, GEN_INT (0x3ff), NULL_RTX), + GEN_INT (trunc_int_for_mode (0x8410a000, SImode)), + NULL_RTX, 1, OPTAB_DIRECT)); - emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 4)), - expand_binop (SImode, ior_optab, - expand_shift (RSHIFT_EXPR, SImode, cxt, - size_int (10), 0, 1), - GEN_INT (0x05000000), - NULL_RTX, 1, OPTAB_DIRECT)); - - emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 8)), - expand_binop (SImode, ior_optab, - expand_and (SImode, fnaddr, GEN_INT (0x3ff), - NULL_RTX), - GEN_INT (0x81c06000), - NULL_RTX, 1, OPTAB_DIRECT)); - - emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 12)), - expand_binop (SImode, ior_optab, - expand_and (SImode, cxt, GEN_INT (0x3ff), - NULL_RTX), - GEN_INT (0x8410a000), - NULL_RTX, 1, OPTAB_DIRECT)); - - emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode, tramp)))); /* On UltraSPARC a flush flushes an entire cache line. The trampoline is aligned on a 16 byte boundary so one flush clears it all. */ + emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode, tramp)))); if (sparc_cpu != PROCESSOR_ULTRASPARC) emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode, plus_constant (tramp, 8))))); @@ -6321,13 +6323,13 @@ sparc64_initialize_trampoline (tramp, fnaddr, cxt) */ emit_move_insn (gen_rtx_MEM (SImode, tramp), - GEN_INT (0x83414000)); + GEN_INT (trunc_int_for_mode (0x83414000, SImode))); emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 4)), - GEN_INT (0xca586018)); + GEN_INT (trunc_int_for_mode (0xca586018, SImode))); emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 8)), - GEN_INT (0x81c14000)); + GEN_INT (trunc_int_for_mode (0x81c14000, SImode))); emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 12)), - GEN_INT (0xca586010)); + GEN_INT (trunc_int_for_mode (0xca586010, SImode))); emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 16)), cxt); emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 24)), fnaddr); emit_insn (gen_flushdi (validize_mem (gen_rtx_MEM (DImode, tramp)))); diff --git a/gcc/configure b/gcc/configure index 99d1f337c64..10fed033979 100755 --- a/gcc/configure +++ b/gcc/configure @@ -7147,6 +7147,8 @@ EOF fi echo "$ac_t""$gcc_cv_as_hidden" 1>&6 +libgcc_visibility=$gcc_cv_as_hidden + echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6 echo "configure:7153: checking assembler leb128 support" >&5 @@ -8394,6 +8396,7 @@ s%@HOST_CC@%$HOST_CC%g s%@HOST_CFLAGS@%$HOST_CFLAGS%g s%@STMP_FIXINC@%$STMP_FIXINC%g s%@STMP_FIXPROTO@%$STMP_FIXPROTO%g +s%@libgcc_visibility@%$libgcc_visibility%g s%@gthread_flags@%$gthread_flags%g s%@GGC@%$GGC%g s%@zlibdir@%$zlibdir%g diff --git a/gcc/configure.in b/gcc/configure.in index 0c7e333f191..6e6fb6bfb40 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -1484,6 +1484,8 @@ if test x"$gcc_cv_as_hidden" = xyes; then [Define if your assembler supports .hidden.]) fi AC_MSG_RESULT($gcc_cv_as_hidden) +libgcc_visibility=$gcc_cv_as_hidden +AC_SUBST(libgcc_visibility) AC_MSG_CHECKING(assembler leb128 support) gcc_cv_as_leb128=no diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9cd1487b173..c4e91e4c58a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,33 @@ +2002-03-02 Nathan Sidwell <nathan@codesourcery.com> + + PR c++/775 + * decl.c (lookup_tag): Only reject enum/class mismatch, not + class/union mismatch. + * parse.y (check_class_key): New function. + (structsp): Call it. + +2002-03-01 Michael Matz <matz@suse.de> + + * typeck.c (cp_pointer_int_sum): Complete inner type which is + used later by size_in_bytes(). + +2002-03-01 Phil Edwards <pme@gcc.gnu.org> + + * cp-tree.h (build_init): Remove prototype. + +2002-03-01 Phil Edwards <pme@gcc.gnu.org> + + * cp-tree.h: Require __GNUC__ to be #defined. + (build_init): Add missing prototype. + +2002-02-28 Jason Merrill <jason@redhat.com> + + * search.c (lookup_base_r): Don't clear is_non_public just because + we found a friendly scope. + + * decl.c (finish_function): Only warn about missing return + statement with -Wreturn-type. + 2002-02-24 Craig Rodrigues <rodrigc@gcc.gnu.org> PR c++/4093 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 65811323751..a80f320486f 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -28,6 +28,10 @@ Boston, MA 02111-1307, USA. */ #ifndef GCC_CP_TREE_H #define GCC_CP_TREE_H +#ifndef __GNUC__ +#error "You should be using 'make bootstrap' -- see installation instructions" +#endif + #include "c-common.h" /* Usage of TREE_LANG_FLAG_?: diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 4d912cdf897..854a2c2a9fa 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5345,7 +5345,7 @@ lookup_tag (form, name, binding_level, thislevel_only) if (old && DECL_ORIGINAL_TYPE (TYPE_NAME (old))) old = NULL_TREE; if (old && TREE_CODE (old) != form - && !(form != ENUMERAL_TYPE && TREE_CODE (old) == TEMPLATE_DECL)) + && (form == ENUMERAL_TYPE || TREE_CODE (old) == ENUMERAL_TYPE)) { error ("`%#D' redeclared as %C", old, form); return NULL_TREE; @@ -5361,14 +5361,12 @@ lookup_tag (form, name, binding_level, thislevel_only) if (TREE_PURPOSE (tail) == name) { enum tree_code code = TREE_CODE (TREE_VALUE (tail)); - /* Should tighten this up; it'll probably permit - UNION_TYPE and a struct template, for example. */ + if (code != form - && !(form != ENUMERAL_TYPE && code == TEMPLATE_DECL)) + && (form == ENUMERAL_TYPE || code == ENUMERAL_TYPE)) { /* Definition isn't the kind we were looking for. */ - error ("`%#D' redeclared as %C", TREE_VALUE (tail), - form); + error ("`%#D' redeclared as %C", TREE_VALUE (tail), form); return NULL_TREE; } return TREE_VALUE (tail); @@ -14224,15 +14222,16 @@ finish_function (flags) DECL_UNINLINABLE (fndecl) = 1; /* Complain if there's just no return statement. */ - if (!processing_template_decl + if (warn_return_type + && !processing_template_decl && TREE_CODE (TREE_TYPE (fntype)) != VOID_TYPE && !current_function_returns_value && !current_function_returns_null - && !DECL_NAME (DECL_RESULT (fndecl)) /* Don't complain if we abort or throw. */ && !current_function_returns_abnormally - /* If we have -Wreturn-type, let flow complain. Unless we're an + && !DECL_NAME (DECL_RESULT (fndecl)) + /* Normally, with -Wreturn-type, flow will complain. Unless we're an inline function, as we might never be compiled separately. */ - && (!warn_return_type || DECL_INLINE (fndecl))) + && DECL_INLINE (fndecl)) warning ("no return statement in function returning non-void"); /* Clear out memory we no longer need. */ diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index e6bdc9a1f2e..fd53a850cb2 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -87,7 +87,8 @@ static tree parse_field PARAMS ((tree, tree, tree, tree)); static tree parse_bitfield0 PARAMS ((tree, tree, tree, tree, tree)); static tree parse_bitfield PARAMS ((tree, tree, tree)); static tree parse_method PARAMS ((tree, tree, tree)); -static void frob_specs PARAMS ((tree, tree)); +static void frob_specs PARAMS ((tree, tree)); +static void check_class_key PARAMS ((tree, tree)); /* Cons up an empty parameter list. */ static inline tree @@ -208,6 +209,17 @@ parse_method (declarator, specs_attrs, lookups) return d; } +static void +check_class_key (key, aggr) + tree key; + tree aggr; +{ + if ((key == union_type_node) != (TREE_CODE (aggr) == UNION_TYPE)) + pedwarn ("`%s' tag used in naming `%#T'", + key == union_type_node ? "union" + : key == record_type_node ? "struct" : "class", aggr); +} + void cp_parse_init () { @@ -2292,6 +2304,7 @@ structsp: xref_basetypes (current_aggr, $1.t, type, $2); } $1.t = begin_class_definition (TREE_TYPE ($1.t)); + check_class_key (current_aggr, $1.t); current_aggr = NULL_TREE; } opt.component_decl_list '}' maybe_attribute { @@ -2326,6 +2339,7 @@ structsp: { $$.t = TREE_TYPE ($1.t); $$.new_type_flag = $1.new_type_flag; + check_class_key (current_aggr, $$.t); } ; diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 10ebc739f07..018dfaaec57 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -201,8 +201,9 @@ lookup_base_r (binfo, base, access, within_current_scope, && !within_current_scope && is_friend (BINFO_TYPE (binfo), current_scope ())) { + /* Do not clear is_non_public here. If A is a private base of B, A + is not allowed to convert a B* to an A*. */ within_current_scope = 1; - is_non_public = 0; } if (same_type_p (BINFO_TYPE (binfo), base)) diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 6ca524233d8..e5f643c72d8 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4076,8 +4076,14 @@ cp_pointer_int_sum (resultcode, ptrop, intop) enum tree_code resultcode; register tree ptrop, intop; { - if (!complete_type_or_else (TREE_TYPE (ptrop), ptrop)) - return error_mark_node; + tree res_type = TREE_TYPE (ptrop); + + /* pointer_int_sum() uses size_in_bytes() on the TREE_TYPE(res_type) + in certain circumstance (when it's valid to do so). So we need + to make sure it's complete. We don't need to check here, if we + can actually complete it at all, as those checks will be done in + pointer_int_sum() anyway. */ + complete_type (TREE_TYPE (res_type)); return pointer_int_sum (resultcode, ptrop, fold (intop)); } @@ -1242,7 +1242,7 @@ df_insn_refs_record (df, bb, insn) /* The stack ptr is used (honorarily) by a CALL insn. */ x = df_reg_use_gen (STACK_POINTER_REGNUM); - df_uses_record (df, &SET_DEST (x), DF_REF_REG_USE, bb, insn, 0); + df_uses_record (df, &XEXP (x, 0), DF_REF_REG_USE, bb, insn, 0); if (df->flags & DF_HARD_REGS) { diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 1e8fd030c8f..d672e575cf5 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -3044,7 +3044,35 @@ The result should match one of the above two forms. @samp{#line} directives alter the results of the @code{__FILE__} and @code{__LINE__} predefined macros from that point on. @xref{Standard Predefined Macros}. They do not have any effect on @samp{#include}'s -idea of the directory containing the current file. +idea of the directory containing the current file. This is a change +from GCC 2.95. Previously, a file reading + +@smallexample +#line 1 "../src/gram.y" +#include "gram.h" +@end smallexample + +would search for @file{gram.h} in @file{../src}, then the @option{-I} +chain; the directory containing the physical source file would not be +searched. In GCC 3.0 and later, the @samp{#include} is not affected by +the presence of a @samp{#line} referring to a different directory. + +We made this change because the old behavior caused problems when +generated source files were transported between machines. For instance, +it is common practice to ship generated parsers with a source release, +so that people building the distribution do not need to have yacc or +Bison installed. These files frequently have @samp{#line} directives +referring to the directory tree of the system where the distribution was +created. If GCC tries to search for headers in those directories, the +build is likely to fail. + +The new behavior can cause failures too, if the generated file is not +in the same directory as its source and it attempts to include a header +which would be visible searching from the directory containing the +source file. However, this problem is easily solved with an additional +@option{-I} switch on the command line. The failures caused by the old +semantics could sometimes be corrected only by editing the generated +files, which is difficult and error-prone. @node Pragmas @chapter Pragmas @@ -3780,6 +3808,14 @@ were still available in traditional mode. It is now a separate program and does not implement any of the GNU extensions, except for a partial implementation of assertions. Even those may be removed in a future release. + +@item @samp{#line} and @samp{#include} + +The @samp{#line} directive used to change GCC's notion of the +``directory containing the current file,'' used by @samp{#include} with +a double-quoted header file name. In 3.0 and later, it does not. +@xref{Line Control}, for further explanation. + @end itemize @node Invocation diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 760c1952018..52ed891a215 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1017,7 +1017,7 @@ ISO C89 as modified in amendment 1. @itemx iso9899:1999 @itemx iso9899:199x ISO C99. Note that this standard is not yet fully supported; see -@w{@uref{http://gcc.gnu.org/c99status.html}} for more information. The +@w{@uref{http://gcc.gnu.org/gcc-3.1/c99status.html}} for more information. The names @samp{c9x} and @samp{iso9899:199x} are deprecated. @item gnu89 diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi index eead5c2f616..a2217969ae5 100644 --- a/gcc/doc/standards.texi +++ b/gcc/doc/standards.texi @@ -80,7 +80,7 @@ as @dfn{AMD1}; the amended standard is sometimes known as @dfn{C94} or A new edition of the ISO C standard was published in 1999 as ISO/IEC 9899:1999, and is commonly known as @dfn{C99}. GCC has incomplete support for this standard version; see -@uref{http://gcc.gnu.org/c99status.html} for details. To select this +@uref{http://gcc.gnu.org/gcc-3.1/c99status.html} for details. To select this standard, use @option{-std=c99} or @option{-std=iso9899:1999}. (While in development, drafts of this standard version were referred to as @dfn{C9X}.) diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 8d7d48b39bb..048178de536 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -8897,8 +8897,38 @@ rtl_for_decl_location (decl) and will have been substituted directly into all expressions that use it. C does not have such a concept, but C++ and other languages do. */ else if (TREE_CODE (decl) == VAR_DECL && DECL_INITIAL (decl)) - rtl = expand_expr (DECL_INITIAL (decl), NULL_RTX, VOIDmode, - EXPAND_INITIALIZER); + { + /* If a variable is initialized with a string constant without embedded + zeros, build CONST_STRING. */ + if (TREE_CODE (DECL_INITIAL (decl)) == STRING_CST + && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE) + { + tree arrtype = TREE_TYPE (decl); + tree enttype = TREE_TYPE (arrtype); + tree domain = TYPE_DOMAIN (arrtype); + tree init = DECL_INITIAL (decl); + enum machine_mode mode = TYPE_MODE (enttype); + + if (GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_SIZE (mode) == 1 + && domain + && integer_zerop (TYPE_MIN_VALUE (domain)) + && compare_tree_int (TYPE_MAX_VALUE (domain), + TREE_STRING_LENGTH (init) - 1) == 0 + && ((size_t) TREE_STRING_LENGTH (init) + == strlen (TREE_STRING_POINTER (init)) + 1)) + rtl = gen_rtx_CONST_STRING (VOIDmode, TREE_STRING_POINTER (init)); + } + + if (rtl == NULL) + { + rtl = expand_expr (DECL_INITIAL (decl), NULL_RTX, VOIDmode, + EXPAND_INITIALIZER); + /* If expand_expr returned a MEM, we cannot use it, since + it won't be output, leading to unresolved symbol. */ + if (rtl && GET_CODE (rtl) == MEM) + rtl = NULL; + } + } return rtl; } @@ -10574,6 +10604,20 @@ gen_inlined_subroutine_die (stmt, context_die, depth) decls_for_scope (stmt, subr_die, depth); current_function_has_inlines = 1; } + else + /* We may get here if we're the outer block of function A that was + inlined into function B that was inlined into function C. When + generating debugging info for C, dwarf2out_abstract_function(B) + would mark all inlined blocks as abstract, including this one. + So, we wouldn't (and shouldn't) expect labels to be generated + for this one. Instead, just emit debugging info for + declarations within the block. This is particularly important + in the case of initializers of arguments passed from B to us: + if they're statement expressions containing declarations, we + wouldn't generate dies for their abstract variables, and then, + when generating dies for the real variables, we'd die (pun + intended :-) */ + gen_lexical_block_die (stmt, context_die, depth); } /* Generate a DIE for a field in a record, or structure. */ diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 836fbf5385a..613ebf4524b 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -196,7 +196,7 @@ static mem_attrs *get_mem_attrs PARAMS ((HOST_WIDE_INT, tree, rtx, rtx, unsigned int, enum machine_mode)); static tree component_ref_for_mem_expr PARAMS ((tree)); -static rtx gen_const_vector_0 PARAMS ((enum mode_class, enum machine_mode)); +static rtx gen_const_vector_0 PARAMS ((enum machine_mode)); /* Probability of the conditional branch currently proceeded by try_split. Set to -1 otherwise. */ @@ -2066,6 +2066,7 @@ offset_address (memref, offset, pow2) new = simplify_gen_binary (PLUS, Pmode, addr, offset); } + update_temp_slot_address (XEXP (memref, 0), new); new = change_address_1 (memref, VOIDmode, new, 1); /* Update the alignment to reflect the offset. Reset the offset, which @@ -4800,12 +4801,10 @@ mark_emit_status (es) ggc_mark_rtx (es->x_first_insn); } -/* Generate the constant 0. The first argument is MODE_VECTOR_INT for - integers or MODE_VECTOR_FLOAT for floats. */ +/* Generate the constant 0. */ static rtx -gen_const_vector_0 (type, mode) - enum mode_class type; +gen_const_vector_0 (mode) enum machine_mode mode; { rtx tem; @@ -4973,14 +4972,12 @@ init_emit_once (line_numbers) for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) - const_tiny_rtx[0][(int) mode] - = gen_const_vector_0 (MODE_VECTOR_INT, mode); + const_tiny_rtx[0][(int) mode] = gen_const_vector_0 (mode); for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) - const_tiny_rtx[0][(int) mode] - = gen_const_vector_0 (MODE_VECTOR_FLOAT, mode); + const_tiny_rtx[0][(int) mode] = gen_const_vector_0 (mode); for (i = (int) CCmode; i < (int) MAX_MACHINE_MODE; ++i) if (GET_MODE_CLASS ((enum machine_mode) i) == MODE_CC) diff --git a/gcc/expmed.c b/gcc/expmed.c index b3d94c2376f..05a28f66580 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -325,7 +325,12 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size) value = protect_from_queue (value, 0); if (flag_force_mem) - value = force_not_mem (value); + { + int old_generating_concat_p = generating_concat_p; + generating_concat_p = 0; + value = force_not_mem (value); + generating_concat_p = old_generating_concat_p; + } /* If the target is a register, overwriting the entire object, or storing a full-word or multi-word field can be done with just a SUBREG. @@ -519,12 +524,9 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size) corresponding size. This can occur on a machine with 64 bit registers that uses SFmode for float. This can also occur for unaligned float structure fields. */ - if (GET_MODE_CLASS (GET_MODE (value)) == MODE_FLOAT) - { - if (GET_CODE (value) != REG) - value = copy_to_reg (value); - value = gen_rtx_SUBREG (word_mode, value, 0); - } + if (GET_MODE_CLASS (GET_MODE (value)) != MODE_INT + && GET_MODE_CLASS (GET_MODE (value)) != MODE_PARTIAL_INT) + value = gen_lowpart (word_mode, value); /* Now OFFSET is nonzero only if OP0 is memory and is therefore always measured in bytes. */ @@ -1516,14 +1518,13 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp, /* If the target mode is floating-point, first convert to the integer mode of that size and then access it as a floating-point value via a SUBREG. */ - if (GET_MODE_CLASS (tmode) == MODE_FLOAT) + if (GET_MODE_CLASS (tmode) != MODE_INT + && GET_MODE_CLASS (tmode) != MODE_PARTIAL_INT) { target = convert_to_mode (mode_for_size (GET_MODE_BITSIZE (tmode), MODE_INT, 0), target, unsignedp); - if (GET_CODE (target) != REG) - target = copy_to_reg (target); - return gen_rtx_SUBREG (tmode, target, 0); + return gen_lowpart (tmode, target); } else return convert_to_mode (tmode, target, unsignedp); diff --git a/gcc/expr.c b/gcc/expr.c index bcc76bc2604..7d0f12a864a 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -7610,23 +7610,20 @@ expand_expr (exp, target, tmode, modifier) indexed address, for machines that support that. */ if (modifier == EXPAND_SUM && mode == ptr_mode - && TREE_CODE (TREE_OPERAND (exp, 1)) == INTEGER_CST - && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) + && host_integerp (TREE_OPERAND (exp, 1), 0)) { op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, EXPAND_SUM); - /* Apply distributive law if OP0 is x+c. */ - if (GET_CODE (op0) == PLUS - && GET_CODE (XEXP (op0, 1)) == CONST_INT) - return - gen_rtx_PLUS - (mode, - gen_rtx_MULT - (mode, XEXP (op0, 0), - GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))), - GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)) - * INTVAL (XEXP (op0, 1)))); + /* If we knew for certain that this is arithmetic for an array + reference, and we knew the bounds of the array, then we could + apply the distributive law across (PLUS X C) for constant C. + Without such knowledge, we risk overflowing the computation + when both X and C are large, but X+C isn't. */ + /* ??? Could perhaps special-case EXP being unsigned and C being + positive. In that case we are certain that X+C is no smaller + than X and so the transformed expression will overflow iff the + original would have. */ if (GET_CODE (op0) != REG) op0 = force_operand (op0, NULL_RTX); @@ -7635,7 +7632,7 @@ expand_expr (exp, target, tmode, modifier) return gen_rtx_MULT (mode, op0, - GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))); + GEN_INT (tree_low_cst (TREE_OPERAND (exp, 1), 0))); } if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1)) diff --git a/gcc/f/root.texi b/gcc/f/root.texi index 2ea699e856e..985b285dc79 100644 --- a/gcc/f/root.texi +++ b/gcc/f/root.texi @@ -2,7 +2,7 @@ @c as compared to a release version. When making a release @c (e.g. a release branch in the CVS repository for gcc), @c clear this and set the version information correctly. -@set DEVELOPMENT +@clear DEVELOPMENT @set version-g77 0.5.27 @set version-gcc 3.1 diff --git a/gcc/f/version.c b/gcc/f/version.c index 438e51192a7..06282506a4b 100644 --- a/gcc/f/version.c +++ b/gcc/f/version.c @@ -1,4 +1,4 @@ -#include "ansidecl.h" + #include "ansidecl.h" #include "f/version.h" -const char *const ffe_version_string = "0.5.27 20020225 (experimental)"; +const char *const ffe_version_string = "3.1 20020304 (prerelease)"; diff --git a/gcc/final.c b/gcc/final.c index e8edf198543..5b9f0f0358a 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -2969,7 +2969,7 @@ output_operand_lossage VPARAMS ((const char *msgid, ...)) { char *fmt_string; char *new_message; - char *pfx_str; + const char *pfx_str; VA_OPEN (ap, msgid); VA_FIXEDARG (ap, const char *, msgid); diff --git a/gcc/fixinc/gnu-regex.c b/gcc/fixinc/gnu-regex.c index c4a8244696e..7468cad5269 100644 --- a/gcc/fixinc/gnu-regex.c +++ b/gcc/fixinc/gnu-regex.c @@ -22,9 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#undef _GNU_SOURCE -#define _GNU_SOURCE - #ifdef HAVE_CONFIG_H # include <config.h> #endif @@ -156,6 +153,8 @@ extern char *re_syntax_table; static char re_syntax_table[CHAR_SET_SIZE]; +static void init_syntax_once PARAMS ((void)); + static void init_syntax_once () { diff --git a/gcc/gcc.c b/gcc/gcc.c index 267bfa31957..bf1f02f6003 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -908,7 +908,8 @@ static const struct option_map option_map[] = {"--assemble", "-S", 0}, {"--assert", "-A", "a"}, {"--classpath", "-fclasspath=", "aj"}, - {"--CLASSPATH", "-fCLASSPATH=", "aj"}, + {"--bootclasspath", "-fbootclasspath=", "aj"}, + {"--CLASSPATH", "-fclasspath=", "aj"}, {"--comments", "-C", 0}, {"--compile", "-c", 0}, {"--debug", "-g", "oj"}, @@ -1416,18 +1417,18 @@ init_gcc_specs (obstack, shared_name, static_name, eh_name) { char *buf; - buf = concat ("%{!shared:%{!shared-libgcc:", static_name, " ", + buf = concat ("%{static|static-libgcc:", static_name, " ", eh_name, + "}%{!static:%{!static-libgcc:", + "%{!shared:%{!shared-libgcc:", static_name, " ", eh_name, "}%{shared-libgcc:", shared_name, " ", - static_name, "}}", - "%{shared:%{static-libgcc:", static_name, " ", - eh_name, "}%{!static-libgcc:", + static_name, "}}%{shared:", #ifdef LINK_EH_SPEC "%{shared-libgcc:", shared_name, "}%{!shared-libgcc:", static_name, "}", #else shared_name, #endif - "}}", NULL); + "}}}", NULL); obstack_grow (obstack, buf, strlen (buf)); free (buf); diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 150cb093e1c..686369d418f 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -1617,6 +1617,18 @@ move_insn (insn, last) return retval; } +/* Called from backends from targetm.sched.reorder to emit stuff into + the instruction stream. */ + +rtx +sched_emit_insn (pat) + rtx pat; +{ + rtx insn = emit_insn_after (pat, last_scheduled_insn); + last_scheduled_insn = insn; + return insn; +} + /* Use forward list scheduling to rearrange insns of block B in region RGN, possibly bringing insns from subsequent blocks in the same region. */ @@ -1625,7 +1637,6 @@ schedule_block (b, rgn_n_insns) int b; int rgn_n_insns; { - rtx last; struct ready_list ready; int can_issue_more; @@ -1673,8 +1684,8 @@ schedule_block (b, rgn_n_insns) if (targetm.sched.md_init) (*targetm.sched.md_init) (sched_dump, sched_verbose, ready.veclen); - /* No insns scheduled in this block yet. */ - last_scheduled_insn = 0; + /* We start inserting insns after PREV_HEAD. */ + last_scheduled_insn = prev_head; /* Initialize INSN_QUEUE. Q_SIZE is the total number of insns in the queue. */ @@ -1686,9 +1697,6 @@ schedule_block (b, rgn_n_insns) /* Start just before the beginning of time. */ clock_var = -1; - /* We start inserting insns after PREV_HEAD. */ - last = prev_head; - /* Loop until all the insns in BB are scheduled. */ while ((*current_sched_info->schedule_more_p) ()) { @@ -1700,9 +1708,6 @@ schedule_block (b, rgn_n_insns) list. */ queue_to_ready (&ready); - if (sched_verbose && targetm.sched.cycle_display) - last = (*targetm.sched.cycle_display) (clock_var, last); - if (ready.n_ready == 0) abort (); @@ -1725,6 +1730,10 @@ schedule_block (b, rgn_n_insns) else can_issue_more = issue_rate; + if (sched_verbose && targetm.sched.cycle_display) + last_scheduled_insn + = (*targetm.sched.cycle_display) (clock_var, last_scheduled_insn); + if (sched_verbose) { fprintf (sched_dump, "\n;;\tReady list (t =%3d): ", clock_var); @@ -1749,8 +1758,7 @@ schedule_block (b, rgn_n_insns) if (! (*current_sched_info->can_schedule_ready_p) (insn)) goto next; - last_scheduled_insn = insn; - last = move_insn (insn, last); + last_scheduled_insn = move_insn (insn, last_scheduled_insn); if (targetm.sched.variable_issue) can_issue_more = @@ -1798,7 +1806,7 @@ schedule_block (b, rgn_n_insns) /* Update head/tail boundaries. */ head = NEXT_INSN (prev_head); - tail = last; + tail = last_scheduled_insn; /* Restore-other-notes: NOTE_LIST is the end of a chain of notes previously found among the insns. Insert them at the beginning diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index ffd0b6ba961..a4895e3917f 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,65 @@ +2002-03-02 Per Bothner <per@bothner.com> + + Make --CLASSPATH by a synonym for --classpath and -classpath. + Implement --bootclasspath. + * jcf-path.c (classpath_u): Rename static variable to classpath_user. + (classpath_l): Remove. + (jcf_path_CLASSPATH_arg): Remove. + (jcf_path_bootclasspath_arg): New function. + (jcf_path_seal): Simplify accordingly. + + * jcf.h (jcf_path_bootclasspath_arg): New declarations. + (jcf_path_CLASSPATH): Remove declaration. + * jvspec.c (jvgenmain_spec): Also accept -fbootclasspath*. + (lang_specific_driver): Translate -bootclasspath. + * lang-options.h: Add --bootclasspath. Update --CLASSPATH. + * lang.c (decode_lang_options): Do jcf_path_init first. + Handle -fCLASSPATH same as -fclasspath. Also process -fbootclasspath. + * gjavah.c: Also handle --bootclasspath. + Handle --CLASSPATH as a synonum for --classpath. + * jcf-dump.c: Likewise. + + "." is not part of system path, but is the default for --classpath. + * jcf-path.c (jcf_path_init): Don't add "." to sys_dirs. + (jcf_path_seal): Add "." if no CLASSPATH specified. + + * gcj.texi: Document changes. + +2002-03-01 Bryce McKinlay <bryce@waitaki.otago.ac.nz> + + * expr.c (build_java_arraystore_check): Fix formatting. + +2002-02-28 Alexandre Petit-Bianco <apbianco@redhat.com> + + Fix for PR java/5758, java/5632: + * jcf-parse.c (load_class): Renamed local variable, consider `.' an + inner-class separator too. + * parse.y (do_resolve_class): New local `decl_result.' + Progressively build a name for what can have been loaded. + +2002-02-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz> + + * expr.c (java_array_data_offset): Removed function. + (JAVA_ARRAY_LENGTH_OFFSET): Removed macro. + (build_java_array_length_access): Obtain "length" value using a + COMPONENT_REF, instead of INDIRECT_REF and arithmetic. + (build_java_arrayaccess): Correct comment. Access "data" using a + COMPONENT_REF, and return an ARRAY_REF instead of an INDIRECT_REF. + (build_java_arraystore_check): New function. + (expand_java_arraystore): Use build_java_arraystore_check. + * parse.y (patch_assignment): Simplify code to insert a store check + when lvalue is an ARRAY_REF. Use build_java_arraystore_check. + * check-init.c (check_init): Update to reflect that an array length + access is now a COMPONENT_REF. + * gcj.texi (Code Generation): Improve documentation of + -fno-bounds-check. Add documentation for -fno-store-check. + * java-tree.h (flag_store_check): Declare. + (build_java_arraystore_check): Declare. + * lang.c (flag_store_check): Initialize to 1. + (lang_f_options): Add store-check option. + * jvspec.c: Don't pass store-check option to jvgenmain. + * lang-options.h: Add help string for -fno-store-check. + 2002-02-22 Tom Tromey <tromey@redhat.com> Fix for PR java/2369: @@ -8,7 +70,7 @@ 2002-02-22 Per Bothner <per@bothner.com> - * class.c: Change vtable to be more compatible with g++ v3 abi. + * class.c: Change vtable to be more compatible with g++ v3 abi. (get_dispatch_table): Prepend offset-to-top (always 0) and type_info pointer (currently unimplemented hence NULL) to vtable. Specifically, prepend offset-to-top and typeinfo ptr (currently null). diff --git a/gcc/java/check-init.c b/gcc/java/check-init.c index 2a4e3c377ac..679353355c8 100644 --- a/gcc/java/check-init.c +++ b/gcc/java/check-init.c @@ -558,7 +558,7 @@ check_init (exp, before) final_assign_error (DECL_NAME (decl)); break; } - else if (TREE_CODE (tmp) == INDIRECT_REF && IS_ARRAY_LENGTH_ACCESS (tmp)) + else if (TREE_CODE (tmp) == COMPONENT_REF && IS_ARRAY_LENGTH_ACCESS (tmp)) { /* We can't emit a more specific message here, because when compiling to bytecodes we don't get here. */ diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 045931079f2..ecfabe5339a 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -79,7 +79,6 @@ static void java_push_constant_from_pool PARAMS ((struct JCF *, int)); static void java_stack_pop PARAMS ((int)); static tree build_java_throw_out_of_bounds_exception PARAMS ((tree)); static tree build_java_check_indexed_type PARAMS ((tree, tree)); -static tree java_array_data_offset PARAMS ((tree)); static tree case_identity PARAMS ((tree, tree)); static unsigned char peek_opcode_at_pc PARAMS ((struct JCF *, int, int)); static bool emit_init_test_initialization PARAMS ((struct hash_entry *, @@ -628,11 +627,6 @@ build_java_ret (location) /* Implementation of operations on array: new, load, store, length */ -/* Array core info access macros */ - -#define JAVA_ARRAY_LENGTH_OFFSET(A) \ - byte_position (TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (TREE_TYPE (A))))) - tree decode_newarray_type (atype) int atype; @@ -699,6 +693,7 @@ build_java_array_length_access (node) tree node; { tree type = TREE_TYPE (node); + tree array_type = TREE_TYPE (type); HOST_WIDE_INT length; if (!is_array_type_p (type)) @@ -707,13 +702,13 @@ build_java_array_length_access (node) length = java_array_type_length (type); if (length >= 0) return build_int_2 (length, 0); - node = build1 (INDIRECT_REF, int_type_node, - fold (build (PLUS_EXPR, ptr_type_node, - java_check_reference (node, - flag_check_references), - JAVA_ARRAY_LENGTH_OFFSET(node)))); + + node = build (COMPONENT_REF, int_type_node, + build_java_indirect_ref (array_type, node, + flag_check_references), + lookup_field (&array_type, get_identifier ("length"))); IS_ARRAY_LENGTH_ACCESS (node) = 1; - return fold (node); + return node; } /* Optionally checks a reference against the NULL pointer. ARG1: the @@ -752,19 +747,6 @@ build_java_indirect_ref (type, expr, check) return build1 (INDIRECT_REF, type, java_check_reference (expr, check)); } -static tree -java_array_data_offset (array) - tree array; -{ - tree array_type = TREE_TYPE (TREE_TYPE (array)); - tree data_fld = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (array_type))); - - if (data_fld == NULL_TREE) - return size_in_bytes (array_type); - else - return byte_position (data_fld); -} - /* Implement array indexing (either as l-value or r-value). Returns a tree for ARRAY[INDEX], assume TYPE is the element type. Optionally performs bounds checking and/or test to NULL. @@ -774,12 +756,10 @@ tree build_java_arrayaccess (array, type, index) tree array, type, index; { - tree arith, node, throw = NULL_TREE; - - arith = fold (build (PLUS_EXPR, int_type_node, - java_array_data_offset (array), - fold (build (MULT_EXPR, int_type_node, - index, size_in_bytes(type))))); + tree node, throw = NULL_TREE; + tree data_field; + tree ref; + tree array_type = TREE_TYPE (TREE_TYPE (array)); if (flag_bounds_check) { @@ -803,23 +783,86 @@ build_java_arrayaccess (array, type, index) } } - /* The SAVE_EXPR is for correct evaluation order. It would be - cleaner to use force_evaluation_order (see comment there), but - that is difficult when we also have to deal with bounds - checking. The SAVE_EXPR is not necessary to do that when we're - not checking for array bounds. */ - if (TREE_SIDE_EFFECTS (index) && throw) - throw = build (COMPOUND_EXPR, int_type_node, save_expr (array), throw); - - node = build1 (INDIRECT_REF, type, - fold (build (PLUS_EXPR, ptr_type_node, - java_check_reference (array, - flag_check_references), - (throw ? build (COMPOUND_EXPR, int_type_node, - throw, arith ) : arith)))); + /* If checking bounds, wrap the index expr with a COMPOUND_EXPR in order + to have the bounds check evaluated first. */ + if (throw != NULL_TREE) + index = build (COMPOUND_EXPR, int_type_node, throw, index); + + data_field = lookup_field (&array_type, get_identifier ("data")); + + ref = build (COMPONENT_REF, TREE_TYPE (data_field), + build_java_indirect_ref (array_type, array, + flag_check_references), + data_field); + + node = build (ARRAY_REF, type, ref, index); return node; } +/* Generate code to throw an ArrayStoreException if OBJECT is not assignable + (at runtime) to an element of ARRAY. A NOP_EXPR is returned if it can + determine that no check is required. */ + +tree +build_java_arraystore_check (array, object) + tree array; + tree object; +{ + tree check, element_type; + tree array_type_p = TREE_TYPE (array); + tree object_type = TYPE_NAME (TREE_TYPE (TREE_TYPE (object))); + + if (! is_array_type_p (array_type_p)) + abort (); + + /* Get the TYPE_DECL for ARRAY's element type. */ + element_type = TYPE_NAME (TREE_TYPE (TREE_TYPE (TREE_TYPE (array_type_p)))); + + if (TREE_CODE (element_type) != TYPE_DECL + || TREE_CODE (object_type) != TYPE_DECL) + abort (); + + if (!flag_store_check) + return build1 (NOP_EXPR, array_type_p, array); + + /* No check is needed if the element type is final or is itself an array. + Also check that element_type matches object_type, since in the bytecode + compilation case element_type may be the actual element type of the arra + rather than its declared type. */ + if (element_type == object_type + && (TYPE_ARRAY_P (TREE_TYPE (element_type)) + || CLASS_FINAL (element_type))) + return build1 (NOP_EXPR, array_type_p, array); + + /* Avoid the check if OBJECT was just loaded from the same array. */ + if (TREE_CODE (object) == ARRAY_REF) + { + tree target; + tree source = TREE_OPERAND (object, 0); /* COMPONENT_REF. */ + source = TREE_OPERAND (source, 0); /* INDIRECT_REF. */ + source = TREE_OPERAND (source, 0); /* Source array's DECL or SAVE_EXPR. */ + if (TREE_CODE (source) == SAVE_EXPR) + source = TREE_OPERAND (source, 0); + + target = array; + if (TREE_CODE (target) == SAVE_EXPR) + target = TREE_OPERAND (target, 0); + + if (source == target) + return build1 (NOP_EXPR, array_type_p, array); + } + + /* Build an invocation of _Jv_CheckArrayStore */ + check = build (CALL_EXPR, void_type_node, + build_address_of (soft_checkarraystore_node), + tree_cons (NULL_TREE, array, + build_tree_list (NULL_TREE, object)), + NULL_TREE); + TREE_SIDE_EFFECTS (check) = 1; + + return check; +} + /* Makes sure that INDEXED_TYPE is appropriate. If not, make it from ARRAY_NODE. This function is used to retrieve something less vague than a pointer type when indexing the first dimension of something like [[<t>. @@ -973,12 +1016,7 @@ expand_java_arraystore (rhs_type_node) if (TREE_CODE (rhs_type_node) == POINTER_TYPE) { - tree check = build (CALL_EXPR, void_type_node, - build_address_of (soft_checkarraystore_node), - tree_cons (NULL_TREE, array, - build_tree_list (NULL_TREE, rhs_node)), - NULL_TREE); - TREE_SIDE_EFFECTS (check) = 1; + tree check = build_java_arraystore_check (array, rhs_node); expand_expr_stmt (check); } diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi index e7b97d26df7..271a4e756cd 100644 --- a/gcc/java/gcj.texi +++ b/gcc/java/gcj.texi @@ -240,16 +240,16 @@ compatibility with tools like @code{javac} is imported, we recommend always using @code{-I} instead of the other options for manipulating the class path. -@item --CLASSPATH=@var{path} -This sets the class path to @var{path}, a colon-separated list of paths -(on Windows-based systems, a semicolon-separate list of paths). Using -this option causes the built in path to be suppressed. - @item --classpath=@var{path} This sets the class path to @var{path}, a colon-separated list of paths -(on Windows-based systems, a semicolon-separate list of paths). This -differs from the @code{--classpath} option in that it does not suppress -the built-in system path. +(on Windows-based systems, a semicolon-separate list of paths). +This does not override the builtin (``boot'') search path. + +@item --CLASSPATH=@var{path} +Deprecated synonym for @code{--classpath}. + +@item --bootclasspath=@var{path} +Where to find the standard builtin classes, such as @code{java.lang.String}. @item CLASSPATH This is an environment variable which holds a list of paths. @@ -262,21 +262,14 @@ The final class path is constructed like so: First come all directories specified via @code{-I}. @item -If @option{--CLASSPATH} is specified, its value is appended and processing -stops. That is, @option{--CLASSPATH} suppresses all the options mentioned -later in this list. - -@item -If @option{--classpath} is specified, its value is appended and the -@code{CLASSPATH} environment variable is suppressed. - -@item -If the @code{CLASSPATH} environment variable is specified (and was not -suppressed by @option{--classpath} or @option{--CLASSPATH}), then its -value is appended. +If @option{--classpath} is specified, its value is appended. +Otherwise, if the @code{CLASSPATH} environment variable is specified, +then its value is appended. +Otherwise, the current directory (@code{"."}) is appended. @item -Finally, the built-in system directory, @file{libgcj.jar}, is appended. +Finally, if @code{--bootclasspath} was specified, append its value. +Otherwise, append the built-in system directory, @file{libgcj.jar}. @end itemize The classfile built by @code{gcj} for the class @code{java.lang.Object} @@ -392,9 +385,20 @@ directory. @item -fno-bounds-check By default, @code{gcj} generates code which checks the bounds of all -array indexing operations. With this option, these checks are omitted. -Note that this can result in unpredictable behavior if the code in -question actually does violate array bounds constraints. +array indexing operations. With this option, these checks are omitted, which +can improve performance for code that uses arrays extensively. Note that this +can result in unpredictable behavior if the code in question actually does +violate array bounds constraints. It is safe to use this option if you are +sure that your code will never throw an @code{ArrayIndexOutOfBoundsException}. + +@item -fno-store-check +Don't generate array store checks. When storing objects into arrays, a runtime +check is normally generated in order to ensure that the object is assignment +compatible with the component type of the array (which may not be known +at compile-time). With this option, these checks are omitted. This can +improve performance for code which stores objects into arrays frequently. +It is safe to use this option if you are sure your code will never throw an +@code{ArrayStoreException}. @item -fjni With @code{gcj} there are two options for writing native methods: CNI diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 7034e58e553..b88ca8c118b 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -2102,7 +2102,8 @@ DEFUN(process_file, (jcf, out), #define LONG_OPT(Num) ((Num) + 128) #define OPT_classpath LONG_OPT (0) -#define OPT_CLASSPATH LONG_OPT (1) +#define OPT_CLASSPATH OPT_classpath +#define OPT_bootclasspath LONG_OPT (1) #define OPT_HELP LONG_OPT (2) #define OPT_TEMP LONG_OPT (3) #define OPT_VERSION LONG_OPT (4) @@ -2119,6 +2120,7 @@ DEFUN(process_file, (jcf, out), static const struct option options[] = { { "classpath", required_argument, NULL, OPT_classpath }, + { "bootclasspath", required_argument, NULL, OPT_bootclasspath }, { "CLASSPATH", required_argument, NULL, OPT_CLASSPATH }, { "help", no_argument, NULL, OPT_HELP }, { "stubs", no_argument, &stubs, 1 }, @@ -2158,10 +2160,9 @@ help () printf (" -friend TEXT Insert TEXT as `friend' declaration\n"); printf (" -prepend TEXT Insert TEXT before start of class\n"); printf ("\n"); - printf (" --CLASSPATH PATH Set path to find .class files, overriding\n\ - built-in class path\n"); printf (" --classpath PATH Set path to find .class files\n"); printf (" -IDIR Append directory to class path\n"); + printf (" --bootclasspath PATH Override built-in class path\n"); printf (" -d DIRECTORY Set output directory name\n"); printf (" -o FILE Set output file name\n"); printf (" -td DIRECTORY Set temporary directory name\n"); @@ -2241,8 +2242,8 @@ DEFUN(main, (argc, argv), jcf_path_classpath_arg (optarg); break; - case OPT_CLASSPATH: - jcf_path_CLASSPATH_arg (optarg); + case OPT_bootclasspath: + jcf_path_bootclasspath_arg (optarg); break; case OPT_HELP: diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 8f64ef2e9a4..1b9e362a4db 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -213,6 +213,9 @@ extern int flag_optimize_sci; in order to improve binary compatibility. */ extern int flag_indirect_dispatch; +/* When zero, don't generate runtime array store checks. */ +extern int flag_store_check; + /* Encoding used for source files. */ extern const char *current_encoding; @@ -1106,6 +1109,7 @@ extern tree build_java_binop PARAMS ((enum tree_code, tree, tree, tree)); extern tree build_java_soft_divmod PARAMS ((enum tree_code, tree, tree, tree)); extern tree binary_numeric_promotion PARAMS ((tree, tree, tree *, tree *)); extern tree build_java_arrayaccess PARAMS ((tree, tree, tree)); +extern tree build_java_arraystore_check PARAMS ((tree, tree)); extern tree build_newarray PARAMS ((int, tree)); extern tree build_anewarray PARAMS ((tree, tree)); extern tree build_new_array PARAMS ((tree, tree)); diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c index c845067e686..cf063ac747d 100644 --- a/gcc/java/jcf-dump.c +++ b/gcc/java/jcf-dump.c @@ -774,7 +774,8 @@ DEFUN(process_class, (jcf), #define LONG_OPT(Num) ((Num) + 128) #define OPT_classpath LONG_OPT (0) -#define OPT_CLASSPATH LONG_OPT (1) +#define OPT_CLASSPATH OPT_classpath +#define OPT_bootclasspath LONG_OPT (1) #define OPT_HELP LONG_OPT (2) #define OPT_VERSION LONG_OPT (3) #define OPT_JAVAP LONG_OPT (4) @@ -782,6 +783,7 @@ DEFUN(process_class, (jcf), static const struct option options[] = { { "classpath", required_argument, NULL, OPT_classpath }, + { "bootclasspath", required_argument, NULL, OPT_bootclasspath }, { "CLASSPATH", required_argument, NULL, OPT_CLASSPATH }, { "help", no_argument, NULL, OPT_HELP }, { "verbose", no_argument, NULL, 'v' }, @@ -806,10 +808,9 @@ help () printf (" -c Disassemble method bodies\n"); printf (" --javap Generate output in `javap' format\n"); printf ("\n"); - printf (" --CLASSPATH PATH Set path to find .class files, overriding\n\ - built-in class path\n"); printf (" --classpath PATH Set path to find .class files\n"); printf (" -IDIR Append directory to class path\n"); + printf (" --bootclasspath PATH Override built-in class path\n"); printf (" -o FILE Set output file name\n"); printf ("\n"); printf (" --help Print this help, then exit\n"); @@ -876,8 +877,8 @@ DEFUN(main, (argc, argv), jcf_path_classpath_arg (optarg); break; - case OPT_CLASSPATH: - jcf_path_CLASSPATH_arg (optarg); + case OPT_bootclasspath: + jcf_path_bootclasspath_arg (optarg); break; case OPT_HELP: diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index e85b5781f83..aaa6536ada1 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -669,20 +669,20 @@ load_class (class_or_name, verbose) saved = name; while (1) { - char *dollar; + char *separator; if ((class_loaded = read_class (name))) break; /* We failed loading name. Now consider that we might be looking - for a inner class but it's only available in source for in - its enclosing context. */ - if ((dollar = strrchr (IDENTIFIER_POINTER (name), '$'))) + for a inner class. */ + if ((separator = strrchr (IDENTIFIER_POINTER (name), '$')) + || (separator = strrchr (IDENTIFIER_POINTER (name), '.'))) { - int c = *dollar; - *dollar = '\0'; + int c = *separator; + *separator = '\0'; name = get_identifier (IDENTIFIER_POINTER (name)); - *dollar = c; + *separator = c; } /* Otherwise, we failed, we bail. */ else diff --git a/gcc/java/jcf-path.c b/gcc/java/jcf-path.c index efdd8433302..0976705532b 100644 --- a/gcc/java/jcf-path.c +++ b/gcc/java/jcf-path.c @@ -1,6 +1,6 @@ /* Handle CLASSPATH, -classpath, and path searching. - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -72,7 +72,8 @@ static void add_path PARAMS ((struct entry **, const char *, int)); built-in system directory (only libgcj.jar) CLASSPATH environment variable -classpath option overrides $CLASSPATH - -CLASSPATH option overrides $CLASSPATH, -classpath, and built-in + -CLASSPATH option is a synonym for -classpath (for compatibility) + -bootclasspath overrides built-in -I prepends path to list We implement this by keeping several path lists, and then simply @@ -85,10 +86,7 @@ static struct entry *include_dirs; static struct entry *classpath_env; /* This holds the -classpath command-line option. */ -static struct entry *classpath_u; - -/* This holds the -CLASSPATH command-line option. */ -static struct entry *classpath_l; +static struct entry *classpath_user; /* This holds the default directories. Some of these will have the "system" flag set. */ @@ -222,6 +220,8 @@ add_path (entp, cp, is_system) } } +static int init_done = 0; + /* Initialize the path module. */ void jcf_path_init () @@ -231,7 +231,9 @@ jcf_path_init () struct stat stat_b; int found = 0, len; - add_entry (&sys_dirs, ".", 0); + if (init_done) + return; + init_done = 1; sep[0] = DIR_SEPARATOR; sep[1] = '\0'; @@ -284,27 +286,25 @@ jcf_path_init () add_path (&classpath_env, cp, 0); } -/* Call this when -CLASSPATH is seen on the command line. - This is the override-all switch, even the built in classes - are overridden. +/* Call this when -classpath is seen on the command line. + This overrides only the $CLASSPATH environment variable. */ void -jcf_path_CLASSPATH_arg (path) +jcf_path_classpath_arg (path) const char *path; { - free_entry (&classpath_l); - add_path (&classpath_l, path, 0); + free_entry (&classpath_user); + add_path (&classpath_user, path, 0); } -/* Call this when -classpath is seen on the command line. - This overrides only the $CLASSPATH environment variable. +/* Call this when -bootclasspath is seen on the command line. */ void -jcf_path_classpath_arg (path) +jcf_path_bootclasspath_arg (path) const char *path; { - free_entry (&classpath_u); - add_path (&classpath_u, path, 0); + free_entry (&sys_dirs); + add_path (&sys_dirs, path, 1); } /* Call this when -I is seen on the command line. */ @@ -322,42 +322,32 @@ void jcf_path_seal (print) int print; { - int do_system = 1; struct entry *secondary; sealed = include_dirs; include_dirs = NULL; - if (classpath_l) + if (classpath_user) { - secondary = classpath_l; - classpath_l = NULL; - do_system = 0; - } - else if (classpath_u) - { - secondary = classpath_u; - classpath_u = NULL; + secondary = classpath_user; + classpath_user = NULL; } else { + if (! classpath_env) + add_entry (&classpath_env, ".", 0); + secondary = classpath_env; classpath_env = NULL; } - free_entry (&classpath_l); - free_entry (&classpath_u); + + free_entry (&classpath_user); free_entry (&classpath_env); append_entry (&sealed, secondary); - - if (do_system) - { - append_entry (&sealed, sys_dirs); - sys_dirs = NULL; - } - else - free_entry (&sys_dirs); + append_entry (&sealed, sys_dirs); + sys_dirs = NULL; if (print) { diff --git a/gcc/java/jcf.h b/gcc/java/jcf.h index 86a0c55ff29..ea096395b1c 100644 --- a/gcc/java/jcf.h +++ b/gcc/java/jcf.h @@ -271,8 +271,8 @@ extern void jcf_dependency_print_dummies PARAMS ((void)); /* Declarations for path handling code. */ extern void jcf_path_init PARAMS ((void)); -extern void jcf_path_CLASSPATH_arg PARAMS ((const char *)); extern void jcf_path_classpath_arg PARAMS ((const char *)); +extern void jcf_path_bootclasspath_arg PARAMS ((const char *)); extern void jcf_path_include_arg PARAMS ((const char *)); extern void jcf_path_seal PARAMS ((int)); extern void *jcf_path_start PARAMS ((void)); diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c index 5bb3e9d164b..58aa1c6fc78 100644 --- a/gcc/java/jvspec.c +++ b/gcc/java/jvspec.c @@ -1,6 +1,6 @@ /* Specific flags and argument handling of the front-end of the GNU compiler for the Java(TM) language. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -66,7 +66,8 @@ static const char jvgenmain_spec[] = %{<femit-class-file} %{<femit-class-files} %{<fencoding*}\ %{<fuse-boehm-gc} %{<fhash-synchronization} %{<fjni}\ %{<findirect-dispatch} \ - %{<fclasspath*} %{<fCLASSPATH*} %{<foutput-class-dir}\ + %{<fno-store-check} %{<foutput-class-dir}\ + %{<fclasspath*} %{<fCLASSPATH*} %{<fbootclasspath*}\ %{<fuse-divide-subroutine} %{<fno-use-divide-subroutine}\ %{<fcheck-references} %{<fno-check-references}\ %{<ffilelist-file}\ @@ -328,6 +329,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) quote = argv[i]; } else if (strcmp(argv[i], "-classpath") == 0 + || strcmp(argv[i], "-bootclasspath") == 0 || strcmp(argv[i], "-CLASSPATH") == 0) { quote = argv[i]; @@ -521,6 +523,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) } if (strcmp (argv[i], "-classpath") == 0 + || strcmp (argv[i], "-bootclasspath") == 0 || strcmp (argv[i], "-CLASSPATH") == 0) { arglist[j] = concat ("-f", argv[i]+1, "=", argv[i+1], NULL); diff --git a/gcc/java/lang-options.h b/gcc/java/lang-options.h index 130060c59e4..90e3190871d 100644 --- a/gcc/java/lang-options.h +++ b/gcc/java/lang-options.h @@ -30,12 +30,16 @@ DEFINE_LANG_NAME ("Java") { "-fbounds-check", "" }, { "-fno-bounds-check", N_("Disable automatic array bounds checking") }, + { "-fno-store-check", + N_("Disable assignability checks for stores into object arrays") }, { "-fjni", N_("Assume native functions are implemented using JNI") }, - { "--CLASSPATH", - N_("Set class path and suppress system path") }, + { "--bootclasspath", + N_("Replace system path") }, { "--classpath", N_("Set class path") }, + { "--CLASSPATH", + N_("Set class path (deprecated: use --classpath instead)") }, { "--main", N_("Choose class whose main method should be used") }, { "--encoding", @@ -54,3 +58,5 @@ DEFINE_LANG_NAME ("Java") N_("Always check for non gcj generated classes archives") }, { "-fno-optimize-static-class-initialization", N_("Never optimize static class initialization code") }, + { "-findirect-dispatch", + N_("Use offset tables for virtual method calls") }, diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 15203902166..c70d59a79bd 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -157,6 +157,9 @@ int flag_optimize_sci = 1; in order to improve binary compatibility. */ int flag_indirect_dispatch = 0; +/* When zero, don't generate runtime array store checks. */ +int flag_store_check = 1; + /* When non zero, print extra version information. */ static int version_flag = 0; @@ -179,7 +182,8 @@ lang_f_options[] = {"check-references", &flag_check_references, 1}, {"force-classes-archive-check", &flag_force_classes_archive_check, 1}, {"optimize-static-class-initialization", &flag_optimize_sci, 1 }, - {"indirect-dispatch", &flag_indirect_dispatch, 1} + {"indirect-dispatch", &flag_indirect_dispatch, 1}, + {"store-check", &flag_store_check, 1} }; static const struct string_option @@ -257,6 +261,8 @@ java_decode_option (argc, argv) { char *p = argv[0]; + jcf_path_init (); + if (strcmp (p, "-version") == 0) { version_flag = 1; @@ -302,7 +308,7 @@ java_decode_option (argc, argv) #define CLARG "-fCLASSPATH=" if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0) { - jcf_path_CLASSPATH_arg (p + sizeof (CLARG) - 1); + jcf_path_classpath_arg (p + sizeof (CLARG) - 1); return 1; } #undef CLARG @@ -313,6 +319,13 @@ java_decode_option (argc, argv) return 1; } #undef CLARG +#define CLARG "-fbootclasspath=" + if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0) + { + jcf_path_bootclasspath_arg (p + sizeof (CLARG) - 1); + return 1; + } +#undef CLARG else if (strncmp (p, "-I", 2) == 0) { jcf_path_include_arg (p + 2); diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 9f14076f1ee..0b5be0921ea 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -5745,6 +5745,7 @@ do_resolve_class (enclosing, class_type, decl, cl) { tree new_class_decl = NULL_TREE, super = NULL_TREE; tree saved_enclosing_type = enclosing ? TREE_TYPE (enclosing) : NULL_TREE; + tree decl_result; struct hash_table _ht, *circularity_hash = &_ht; /* This hash table is used to register the classes we're going @@ -5841,9 +5842,32 @@ do_resolve_class (enclosing, class_type, decl, cl) if (check_pkg_class_access (TYPE_NAME (class_type), cl, true)) return NULL_TREE; } - + /* 6- Last call for a resolution */ - return IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type)); + decl_result = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type)); + + /* The final lookup might have registered a.b.c into a.b$c If we + failed at the first lookup, progressively change the name if + applicable and use the matching DECL instead. */ + if (!decl_result && QUALIFIED_P (TYPE_NAME (class_type))) + { + tree name = TYPE_NAME (class_type); + char *separator; + do { + + /* Reach the last '.', and if applicable, replace it by a `$' and + see if this exists as a type. */ + if ((separator = strrchr (IDENTIFIER_POINTER (name), '.'))) + { + int c = *separator; + *separator = '$'; + name = get_identifier (IDENTIFIER_POINTER (name)); + *separator = c; + decl_result = IDENTIFIER_CLASS_VALUE (name); + } + } while (!decl_result && separator); + } + return decl_result; } static tree @@ -12585,9 +12609,8 @@ patch_assignment (node, wfl_op1) { lhs_type = TREE_TYPE (lvalue); } - /* Or Lhs can be a array access. Should that be lvalue ? FIXME + - comment on reason why */ - else if (TREE_CODE (wfl_op1) == ARRAY_REF) + /* Or Lhs can be an array access. */ + else if (TREE_CODE (lvalue) == ARRAY_REF) { lhs_type = TREE_TYPE (lvalue); lvalue_from_array = 1; @@ -12689,80 +12712,29 @@ patch_assignment (node, wfl_op1) && lvalue_from_array && JREFERENCE_TYPE_P (TYPE_ARRAY_ELEMENT (lhs_type))) { - tree check; - tree base = lvalue; + tree array, store_check, base, index_expr; - /* We need to retrieve the right argument for - _Jv_CheckArrayStore. This is somewhat complicated by bounds - and null pointer checks, both of which wrap the operand in - one layer of COMPOUND_EXPR. */ - if (TREE_CODE (lvalue) == COMPOUND_EXPR) - base = TREE_OPERAND (lvalue, 0); - else + /* Get the INDIRECT_REF. */ + array = TREE_OPERAND (TREE_OPERAND (lvalue, 0), 0); + /* Get the array pointer expr. */ + array = TREE_OPERAND (array, 0); + store_check = build_java_arraystore_check (array, new_rhs); + + index_expr = TREE_OPERAND (lvalue, 1); + + if (TREE_CODE (index_expr) == COMPOUND_EXPR) { - tree op = TREE_OPERAND (base, 0); - - /* We can have a SAVE_EXPR here when doing String +=. */ - if (TREE_CODE (op) == SAVE_EXPR) - op = TREE_OPERAND (op, 0); - /* We can have a COMPOUND_EXPR here when doing bounds check. */ - if (TREE_CODE (op) == COMPOUND_EXPR) - op = TREE_OPERAND (op, 1); - base = TREE_OPERAND (op, 0); - /* Strip the last PLUS_EXPR to obtain the base. */ - if (TREE_CODE (base) == PLUS_EXPR) - base = TREE_OPERAND (base, 0); - } - - /* Build the invocation of _Jv_CheckArrayStore */ - new_rhs = save_expr (new_rhs); - check = build (CALL_EXPR, void_type_node, - build_address_of (soft_checkarraystore_node), - tree_cons (NULL_TREE, base, - build_tree_list (NULL_TREE, new_rhs)), - NULL_TREE); - TREE_SIDE_EFFECTS (check) = 1; - - /* We have to decide on an insertion point */ - if (TREE_CODE (lvalue) == COMPOUND_EXPR) - { - tree t; - if (flag_bounds_check) - { - t = TREE_OPERAND (TREE_OPERAND (TREE_OPERAND (lvalue, 1), 0), 0); - TREE_OPERAND (TREE_OPERAND (TREE_OPERAND (lvalue, 1), 0), 0) = - build (COMPOUND_EXPR, void_type_node, t, check); - } - else - TREE_OPERAND (lvalue, 1) = build (COMPOUND_EXPR, lhs_type, - check, TREE_OPERAND (lvalue, 1)); + /* A COMPOUND_EXPR here is a bounds check. The bounds check must + happen before the store check, so prepare to insert the store + check within the second operand of the existing COMPOUND_EXPR. */ + base = index_expr; } - else if (flag_bounds_check) - { - tree hook = lvalue; - tree compound = TREE_OPERAND (lvalue, 0); - tree bound_check, new_compound; - - if (TREE_CODE (compound) == SAVE_EXPR) - { - compound = TREE_OPERAND (compound, 0); - hook = TREE_OPERAND (hook, 0); - } - - /* Find the array bound check, hook the original array access. */ - bound_check = TREE_OPERAND (compound, 0); - TREE_OPERAND (hook, 0) = TREE_OPERAND (compound, 1); - - /* Make sure the bound check will happen before the store check */ - new_compound = - build (COMPOUND_EXPR, void_type_node, bound_check, check); - - /* Re-assemble the augmented array access. */ - lvalue = build (COMPOUND_EXPR, TREE_TYPE (lvalue), - new_compound, lvalue); - } else - lvalue = build (COMPOUND_EXPR, TREE_TYPE (lvalue), check, lvalue); + base = lvalue; + + index_expr = TREE_OPERAND (base, 1); + TREE_OPERAND (base, 1) = build (COMPOUND_EXPR, TREE_TYPE (index_expr), + store_check, index_expr); } /* Final locals can be used as case values in switch diff --git a/gcc/loop.c b/gcc/loop.c index 2bd19445ae0..506984beaaf 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -2504,16 +2504,17 @@ prescan_loop (loop) if (set) { + rtx src = SET_SRC (set); rtx label1, label2; - if (GET_CODE (SET_SRC (set)) == IF_THEN_ELSE) + if (GET_CODE (src) == IF_THEN_ELSE) { - label1 = XEXP (SET_SRC (set), 1); - label2 = XEXP (SET_SRC (set), 2); + label1 = XEXP (src, 1); + label2 = XEXP (src, 2); } else { - label1 = SET_SRC (PATTERN (insn)); + label1 = src; label2 = NULL_RTX; } diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in index bcc03e26c3b..77bdf00f16e 100644 --- a/gcc/mklibgcc.in +++ b/gcc/mklibgcc.in @@ -270,10 +270,24 @@ for ml in $MULTILIBS; do shlib_deps="$shlib_deps $dir/$f" done + libgcc_a_objs="$libgcc_objs $libgcc_st_objs" + + if [ "@libgcc_visibility@" = yes ]; then + libgcc_a_objs= + echo "" + for o in $libgcc_objs $libgcc_st_objs; do + # .oS objects will have all non-local symbol definitions .hidden + oS=`echo ${o} | sed s~${objext}'$~.oS~g'` + echo "${oS}: stmp-dirs ${o}" + echo ' @$(NM_FOR_TARGET) '${SHLIB_NM_FLAGS} ${o}' | $(AWK) '\''NF == 3 { print ".hidden", $$3 }'\'' | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -r -nostdinc -nostdlib -o $@ '${o}' -xassembler -' + libgcc_a_objs="${libgcc_a_objs} ${oS}" + done + fi + echo "" - echo "${dir}/libgcc.a: $libgcc_objs $libgcc_st_objs" + echo "${dir}/libgcc.a: $libgcc_a_objs" echo " -rm -rf ${dir}/libgcc.a" - echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc.a $libgcc_objs $libgcc_st_objs + echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc.a $libgcc_a_objs echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\ echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a ';' \\ echo ' else true; fi;' diff --git a/gcc/sched-int.h b/gcc/sched-int.h index 47910a0c2d5..f5a880809c8 100644 --- a/gcc/sched-int.h +++ b/gcc/sched-int.h @@ -294,6 +294,7 @@ extern void rm_other_notes PARAMS ((rtx, rtx)); extern int insn_issue_delay PARAMS ((rtx)); extern int set_priorities PARAMS ((rtx, rtx)); +extern rtx sched_emit_insn PARAMS ((rtx)); extern void schedule_block PARAMS ((int, int)); extern void sched_init PARAMS ((FILE *)); extern void sched_finish PARAMS ((void)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d0790f59710..b809da6d51d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,24 @@ +2002-03-02 Nathan Sidwell <nathan@codesourcery.com> + + * g++.dg/other/classkey1.C: New test. + +2002-03-01 Richard Henderson <rth@redhat.com> + + * gcc.c-torture/compile/981223-1.x: New. + * gcc.c-torture/compile/920625-1.x: New. + +2002-02-28 Richard Henderson <rth@redhat.com> + + * g++.dg/opt/vtgc1.C: Adjust patterns for ia64. + +2002-02-26 Alexandre Oliva <aoliva@redhat.com> + + * gcc.dg/debug/20020224-1.c: New. + +2002-02-26 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/debug/debug4.C: New test. + 2002-02-25 Kazu Hirata <kazu@hxi.com> * gcc.c-torture/execute/960416-1.x: New. diff --git a/gcc/testsuite/g++.dg/debug/debug4.C b/gcc/testsuite/g++.dg/debug/debug4.C new file mode 100644 index 00000000000..8dceb0875bf --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/debug4.C @@ -0,0 +1,17 @@ +/* PR debug/5770 + This testcase failed at -O -g because the following constants + were optimized away since they were never referenced, but + since they are variables with initializers, rtl_for_decl_location + run expand_expr on their initializers and returned it. + This lead to references to constants which were deferred and thus + never emitted. */ +/* { dg-do link } */ + +static const char foo[] = "foo string"; +static const char bar[30] = "bar string"; +static const wchar_t baz[] = L"baz string"; + +int +main () +{ +} diff --git a/gcc/testsuite/g++.dg/opt/vtgc1.C b/gcc/testsuite/g++.dg/opt/vtgc1.C index c50855529bb..511d45b36e7 100644 --- a/gcc/testsuite/g++.dg/opt/vtgc1.C +++ b/gcc/testsuite/g++.dg/opt/vtgc1.C @@ -118,16 +118,19 @@ void x3 (Multivs1 *ii) { ii->f2();} void x4 (Multiss2 *ii) { ii->f2();} void x5 (Multivv3 *ii) { ii->f2();} -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multivv3, 0" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multivv3, 0" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multiss2, vtable for Base2" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multivs1, vtable for Base2" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multivs1, vtable for Base2" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multisv0, vtable for Side0" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multisv0, vtable for Side0" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Side0, 0" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for VbasedA, 0" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for VbasedA, 0" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base2, vtable for Base1" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base1, vtable for Base0" } } -// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base0, 0" } } +// Use .* because of ia64's convention of marking symbols with "#", which +// makes it through the c++filt. + +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multivv3.*0" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multivv3.*0" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multiss2.*vtable for Base2" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multivs1.*vtable for Base2" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multivs1.*vtable for Base2" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multisv0.*vtable for Side0" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multisv0.*vtable for Side0" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Side0.*0" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for VbasedA.*0" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for VbasedA.*0" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base2.*vtable for Base1" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base1.*vtable for Base0" } } +// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base0.*0" } } diff --git a/gcc/testsuite/g++.dg/other/classkey1.C b/gcc/testsuite/g++.dg/other/classkey1.C new file mode 100644 index 00000000000..17fb54065d0 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/classkey1.C @@ -0,0 +1,17 @@ +// { dg-do compile } + +// Copyright (C) 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 28 Feb 2002 <nathan@codesourcery.com> + +// PR 775. Some mismatches which were broken. + +template <class T> struct A {}; +union A<int> a; // { dg-error "`union' tag" "" } + +template <> union A<float> {}; // { dg-error "`union' tag" "" } + +struct B {}; +union B b; // { dg-error "`union' tag" "" } + +union C {}; +class C c; // { dg-error "`class' tag" "" } diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash25.C b/gcc/testsuite/g++.old-deja/g++.other/crash25.C index 0c39be8b0bd..2f471fb866f 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/crash25.C +++ b/gcc/testsuite/g++.old-deja/g++.other/crash25.C @@ -9,7 +9,7 @@ public: X::x() { // ERROR - -} // WARNING - no return +} X::~x() { // ERROR - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C deleted file mode 100644 index c27aa8d2df7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C +++ /dev/null @@ -1,19 +0,0 @@ -//Build don't link: -#include <vector> -#include <algorithm> - -template <class T> class Expr -{ -public : -Expr(){}; -Expr(const T&){}; -}; - -template <class T > -inline bool compare(const Expr<T> a, const Expr<T> b){ return true; }; - -int main() -{ - std::vector<int> a(3); - std::sort( a.begin(), a.end(), compare ); // ERROR - no matching function -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920625-1.x b/gcc/testsuite/gcc.c-torture/compile/920625-1.x new file mode 100644 index 00000000000..c88a02e9086 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/920625-1.x @@ -0,0 +1,25 @@ +# The problem on IA-64 is that if-conversion creates a sequence +# +# (p17) cmp.geu p6, p7 = r48, r15 +# (p16) cmp.gtu p6, p7 = r48, r15 +# +# where p16 and p17 are complemenary, but the assembler DV validation +# code doesn't recognize that p6 and p7 are complimentary, and so +# we end up warning for a later use +# +# (p6) addl r14 = 1, r0 +# (p7) mov r14 = r0 +# +# that appears to be a WAW violation. + +set torture_eval_before_compile { + + set compiler_conditional_xfail_data { + "missing .pred.rel.mutex directive" \ + "ia64-*-*" \ + { "-O2" "-O3" "-Os" } \ + { "" } + } +} + +return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/981223-1.x b/gcc/testsuite/gcc.c-torture/compile/981223-1.x new file mode 100644 index 00000000000..f8d2aa6f938 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/981223-1.x @@ -0,0 +1,20 @@ +# The problem on IA-64 is that the assembler emits +# +# Warning: Additional NOP may be necessary to workaround Itanium +# processor A/B step errata +# +# This can be fixed by adding "-mb-step" to the command line, which +# does in fact add the extra nop, if someone can tell me how to do +# that for a c-torture compile test. + +set torture_eval_before_compile { + + set compiler_conditional_xfail_data { + "need -mb-step" \ + "ia64-*-*" \ + { "-O2" "-O3" "-Os" } \ + { "" } + } +} + +return 0 diff --git a/gcc/testsuite/gcc.dg/debug/20020224-1.c b/gcc/testsuite/gcc.dg/debug/20020224-1.c new file mode 100644 index 00000000000..c61a17aed10 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/20020224-1.c @@ -0,0 +1,60 @@ +/* { dg-do compile } */ + +/* Here's the deal: f3 is not inlined because it's too big, but f2 and + f1 are inlined into it. We used to fail to emit debugging info for + t1, because it was moved inside the (inlined) block of f1, marked + as abstract, then we'd crash. */ + +#define UNUSED __attribute__((unused)) +#define EXT __extension__ + +int undef(void); + +inline static void +f1 (int i UNUSED) +{ +} + +inline static void +f2 (void) +{ + f1 (EXT ({ int t1 UNUSED; undef (); })); +} + +inline static void +f3 (void) +{ + int v1 UNUSED; + int v2 UNUSED; + + EXT ({ int t2 UNUSED; if (0) undef (); 0; }) + && EXT ({ int t3 UNUSED; if (0) undef (); 0; }); + + if (1) + { + undef (); + if (1) + f2 (); + } + + { + undef (); + } +} + +inline static void +f4 (void) +{ + EXT ({ undef (); 1; }) && EXT ({ int t4 UNUSED = ({ 1; }); 1; }); + + { } + + EXT ({ int t5 UNUSED; if (0) undef (); 0; }); + + f4 (); + + undef (); + f3 (); + + return; +} diff --git a/gcc/unroll.c b/gcc/unroll.c index 9a0cfcf6871..2b941470ecd 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -3744,7 +3744,18 @@ loop_iterations (loop) for (biv_inc = bl->biv; biv_inc; biv_inc = biv_inc->next_iv) { if (loop_insn_first_p (v->insn, biv_inc->insn)) - offset -= INTVAL (biv_inc->add_val); + { + if (REG_P (biv_inc->add_val)) + { + if (loop_dump_stream) + fprintf (loop_dump_stream, + "Loop iterations: Basic induction var add_val is REG %d.\n", + REGNO (biv_inc->add_val)); + return 0; + } + + offset -= INTVAL (biv_inc->add_val); + } } } if (loop_dump_stream) diff --git a/gcc/version.c b/gcc/version.c index 1cfc40b5a0b..320558736f5 100644 --- a/gcc/version.c +++ b/gcc/version.c @@ -1,4 +1,4 @@ -#include "ansidecl.h" + #include "ansidecl.h" #include "version.h" -const char *const version_string = "3.1 20020225 (experimental)"; +const char *const version_string = "3.1 20020304 (prerelease)"; diff --git a/libf2c/libF77/Version.c b/libf2c/libF77/Version.c index d4db5ff4d89..ef0970432b4 100644 --- a/libf2c/libF77/Version.c +++ b/libf2c/libF77/Version.c @@ -1,9 +1,9 @@ -static char junk[] = "\n@(#)LIBF77 VERSION 20000929\n"; + static char junk[] = "\n@(#)LIBF77 VERSION 20000929\n"; /* */ -char __G77_LIBF77_VERSION__[] = "0.5.27 20020225 (experimental)"; +char __G77_LIBF77_VERSION__[] = "3.1 20020304 (prerelease)"; /* 2.00 11 June 1980. File version.c added to library. diff --git a/libf2c/libI77/Version.c b/libf2c/libI77/Version.c index 22f96ebc1d2..adec6b29de1 100644 --- a/libf2c/libI77/Version.c +++ b/libf2c/libI77/Version.c @@ -1,9 +1,9 @@ -static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 20001205\n"; + static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 20001205\n"; /* */ -char __G77_LIBI77_VERSION__[] = "0.5.27 20020225 (experimental)"; +char __G77_LIBI77_VERSION__[] = "3.1 20020304 (prerelease)"; /* 2.01 $ format added diff --git a/libf2c/libU77/Version.c b/libf2c/libU77/Version.c index 3b754da7207..f879754268a 100644 --- a/libf2c/libU77/Version.c +++ b/libf2c/libU77/Version.c @@ -1,6 +1,6 @@ -static char junk[] = "\n@(#) LIBU77 VERSION 19980709\n"; + static char junk[] = "\n@(#) LIBU77 VERSION 19980709\n"; -char __G77_LIBU77_VERSION__[] = "0.5.27 20020225 (experimental)"; +char __G77_LIBU77_VERSION__[] = "3.1 20020304 (prerelease)"; #include <stdio.h> diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 4701a7d8bb2..8f1edc3a96b 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,38 @@ +2002-03-03 Bryce McKinlay <bryce@waitaki.otago.ac.nz> + + * Makefile.am: Use -bootclasspath, not -CLASSPATH. + * Makefile.in: Rebuilt. + +2002-03-03 Mark Wielaard <mark@klomp.org> + + * java/util/Timer (TaskQueue.stop): set elements to zero. + +2002-02-28 Anthony Green <green@redhat.com> + + * java/lang/reflect/natMethod.cc (result): Add void* element. + (_Jv_CallAnyMethodA): Handle FFI_TYPE_POINTER arguments. Move + constructor test. + +2002-02-26 Tom Tromey <tromey@redhat.com> + + * java/lang/natSystem.cc (init_properties): Use __VERSION__. + * gij.cc (version): Use __VERSION__. + * include/config.h.in: Rebuilt. + * acconfig.h (GCJVERSION): Removed. + * configure: Rebuilt. + * configure.in (GCJVERSION): Removed. + +2002-02-26 Andreas Schwab <schwab@suse.de> + + * acinclude.m4 (LIB_AC_PROG_CXX): Use glibjava_CXX instead of + glibcpp_CXX, since libjava uses even another CXX. + * aclocal.m4, configure: Regenerated. + +2002-02-26 Tom Tromey <tromey@redhat.com> + + * java/lang/natPosixProcess.cc (startProcess): Use FD_CLOEXEC, not + `1'. + 2002-02-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz> * Makefile.am (GCJCOMPILE): Use -fCLASSPATH not -fclasspath. Fixes diff --git a/libjava/Makefile.am b/libjava/Makefile.am index 3bbd943e5fa..bceb907421a 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -69,7 +69,7 @@ endif # CANADIAN ## compiles. GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ_WITH_FLAGS) -fCLASSPATH=$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c +GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ_WITH_FLAGS) -fbootclasspath=$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@ LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@ @@ -186,8 +186,8 @@ libgcj.jar: $(built_java_source_files) $(java_source_files) $(x_java_source_file @set fnord $(MAKEFLAGS); amf=$$2; fail=no; \ javac="$(JAVAC)"; \ cat tmp-list | (while read f; do \ - echo $$javac $(JCFLAGS) -CLASSPATH $(here):$(srcdir) -d $(here) $$f; \ - $$javac $(JCFLAGS) -CLASSPATH $(here):$(srcdir) -d $(here) $$f \ + echo $$javac $(JCFLAGS) -bootclasspath $(here):$(srcdir) -d $(here) $$f; \ + $$javac $(JCFLAGS) -bootclasspath $(here):$(srcdir) -d $(here) $$f \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes ;; *) exit 1;; esac; \ done; \ test "$$fail" = no) @@ -256,7 +256,7 @@ libgcjx.la: $(libgcjx_la_OBJECTS) $(libgcjx_la_DEPENDENCIES) .class.h: ## FIXME: GNU make specific. - $(GCJH) -CLASSPATH $(top_builddir) $(basename $<) + $(GCJH) -bootclasspath $(top_builddir) $(basename $<) ## Header files used when compiling some of the nat* files. ordinary_nat_headers = $(ordinary_java_source_files:.java=.h) \ @@ -272,13 +272,13 @@ x_nat_headers = $(x_java_source_files:.java=.h) $(ordinary_nat_headers) $(x_nat_headers): %.h: %.class java/lang/ClassLoader.h: java/lang/ClassLoader.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \ -friend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \ $(basename $<) java/lang/Thread.h: java/lang/Thread.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -prepend 'class _Jv_JNIEnv;' \ -prepend '#define _JV_NOT_OWNER 1' \ -prepend '#define _JV_INTERRUPTED 2' \ @@ -291,7 +291,7 @@ java/lang/Thread.h: java/lang/Thread.class $(basename $<) java/lang/String.h: java/lang/String.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'jchar* _Jv_GetStringChars (jstring str);' \ -friend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \ -friend 'jstring* _Jv_StringGetSlot (jstring);' \ @@ -301,21 +301,21 @@ java/lang/String.h: java/lang/String.class $(basename $<) java/lang/reflect/Constructor.h: java/lang/reflect/Constructor.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \ -friend 'class java::lang::Class;' \ -friend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \ $(basename $<) java/lang/reflect/Field.h: java/lang/reflect/Field.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \ -friend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \ -friend 'class java::lang::Class;' \ $(basename $<) java/lang/reflect/Method.h: java/lang/reflect/Method.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \ -friend 'class java::lang::Class;' \ -friend 'class java::io::ObjectInputStream;' \ @@ -323,16 +323,16 @@ java/lang/reflect/Method.h: java/lang/reflect/Method.class $(basename $<) gnu/gcj/runtime/VMClassLoader.h: gnu/gcj/runtime/VMClassLoader.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'class ::java::lang::ClassLoader;' \ $(basename $<) java/io/ObjectInputStream$$GetField.h: java/io/ObjectInputStream.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ 'java/io/ObjectInputStream$$GetField' java/io/ObjectOutputStream$$PutField.h: java/io/ObjectOutputStream.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ 'java/io/ObjectOutputStream$$PutField' ## Headers we maintain by hand and which we want to install. diff --git a/libjava/Makefile.in b/libjava/Makefile.in index fea2f5b625c..a87668f9afc 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -79,7 +79,6 @@ GCDEPS = @GCDEPS@ GCINCS = @GCINCS@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ -GCJVERSION = @GCJVERSION@ GCLIBS = @GCLIBS@ GCOBJS = @GCOBJS@ GCSPEC = @GCSPEC@ @@ -119,6 +118,7 @@ ZINCS = @ZINCS@ ZLIBS = @ZLIBS@ ZLIBSPEC = @ZLIBSPEC@ ZLIBTESTSPEC = @ZLIBTESTSPEC@ +glibjava_CXX = @glibjava_CXX@ here = @here@ libgcj_basedir = @libgcj_basedir@ mkinstalldirs = @mkinstalldirs@ @@ -149,7 +149,7 @@ bin_SCRIPTS = addr2name.awk GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ_WITH_FLAGS) -fCLASSPATH=$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c +GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ_WITH_FLAGS) -fbootclasspath=$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@ LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@ @@ -3212,8 +3212,8 @@ libgcj.jar: $(built_java_source_files) $(java_source_files) $(x_java_source_file @set fnord $(MAKEFLAGS); amf=$$2; fail=no; \ javac="$(JAVAC)"; \ cat tmp-list | (while read f; do \ - echo $$javac $(JCFLAGS) -CLASSPATH $(here):$(srcdir) -d $(here) $$f; \ - $$javac $(JCFLAGS) -CLASSPATH $(here):$(srcdir) -d $(here) $$f \ + echo $$javac $(JCFLAGS) -bootclasspath $(here):$(srcdir) -d $(here) $$f; \ + $$javac $(JCFLAGS) -bootclasspath $(here):$(srcdir) -d $(here) $$f \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes ;; *) exit 1;; esac; \ done; \ test "$$fail" = no) @@ -3260,18 +3260,18 @@ libgcjx.la: $(libgcjx_la_OBJECTS) $(libgcjx_la_DEPENDENCIES) -rpath $(toolexeclibdir) $(libgcjx_la_LDFLAGS) $(LIBS) .class.h: - $(GCJH) -CLASSPATH $(top_builddir) $(basename $<) + $(GCJH) -bootclasspath $(top_builddir) $(basename $<) $(ordinary_nat_headers) $(x_nat_headers): %.h: %.class java/lang/ClassLoader.h: java/lang/ClassLoader.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \ -friend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \ $(basename $<) java/lang/Thread.h: java/lang/Thread.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -prepend 'class _Jv_JNIEnv;' \ -prepend '#define _JV_NOT_OWNER 1' \ -prepend '#define _JV_INTERRUPTED 2' \ @@ -3284,7 +3284,7 @@ java/lang/Thread.h: java/lang/Thread.class $(basename $<) java/lang/String.h: java/lang/String.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'jchar* _Jv_GetStringChars (jstring str);' \ -friend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \ -friend 'jstring* _Jv_StringGetSlot (jstring);' \ @@ -3294,21 +3294,21 @@ java/lang/String.h: java/lang/String.class $(basename $<) java/lang/reflect/Constructor.h: java/lang/reflect/Constructor.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \ -friend 'class java::lang::Class;' \ -friend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \ $(basename $<) java/lang/reflect/Field.h: java/lang/reflect/Field.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \ -friend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \ -friend 'class java::lang::Class;' \ $(basename $<) java/lang/reflect/Method.h: java/lang/reflect/Method.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \ -friend 'class java::lang::Class;' \ -friend 'class java::io::ObjectInputStream;' \ @@ -3316,16 +3316,16 @@ java/lang/reflect/Method.h: java/lang/reflect/Method.class $(basename $<) gnu/gcj/runtime/VMClassLoader.h: gnu/gcj/runtime/VMClassLoader.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ -friend 'class ::java::lang::ClassLoader;' \ $(basename $<) java/io/ObjectInputStream$$GetField.h: java/io/ObjectInputStream.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ 'java/io/ObjectInputStream$$GetField' java/io/ObjectOutputStream$$PutField.h: java/io/ObjectOutputStream.class - $(GCJH) -CLASSPATH $(top_builddir) \ + $(GCJH) -bootclasspath $(top_builddir) \ 'java/io/ObjectOutputStream$$PutField' $(extra_headers): diff --git a/libjava/acconfig.h b/libjava/acconfig.h index de9be6861bc..400710dd5eb 100644 --- a/libjava/acconfig.h +++ b/libjava/acconfig.h @@ -89,9 +89,6 @@ /* Define if global `timezone' exists. */ #undef HAVE_TIMEZONE -/* Define to version of GCJ in use. */ -#undef GCJVERSION - /* Define if you have the appropriate function. */ #undef HAVE_ACCESS #undef HAVE_STAT diff --git a/libjava/acinclude.m4 b/libjava/acinclude.m4 index 2dcf74458ce..11ed671fc08 100644 --- a/libjava/acinclude.m4 +++ b/libjava/acinclude.m4 @@ -81,23 +81,23 @@ define([AC_PROG_CXX_WORKS],[]) AC_PROG_CC -# We use the libstdc++-v3 version of LIB_AC_PROG_CXX, that gets -# glibcpp_CXX cached instead of CXX. That's because we're passed a +# We use the libstdc++-v3 version of LIB_AC_PROG_CXX, but use +# glibjava_CXX instead of glibcpp_CXX. That's because we're passed a # different definition of CXX than other directories, since we don't # depend on libstdc++-v3 having already been built. AC_DEFUN(LIB_AC_PROG_CXX, [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl dnl Fool anybody using AC_PROG_CXX. AC_PROVIDE([AC_PROG_CXX]) -# Use glibcpp_CXX so that we do not cause CXX to be cached with the -# flags that come in CXX while configuring libstdc++. They're different +# Use glibjava_CXX so that we do not cause CXX to be cached with the +# flags that come in CXX while configuring libjava. They're different # from those used for all other target libraries. If CXX is set in # the environment, respect that here. -glibcpp_CXX=$CXX -AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) +glibjava_CXX=$CXX +AC_CHECK_PROGS(glibjava_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) AC_SUBST(CXX) -CXX=$glibcpp_CXX -test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) +CXX=$glibjava_CXX +test -z "$glibjava_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) AC_PROG_CXX_GNU diff --git a/libjava/aclocal.m4 b/libjava/aclocal.m4 index 9004008dbd5..0ec14daaadd 100644 --- a/libjava/aclocal.m4 +++ b/libjava/aclocal.m4 @@ -93,23 +93,23 @@ define([AC_PROG_CXX_WORKS],[]) AC_PROG_CC -# We use the libstdc++-v3 version of LIB_AC_PROG_CXX, that gets -# glibcpp_CXX cached instead of CXX. That's because we're passed a +# We use the libstdc++-v3 version of LIB_AC_PROG_CXX, but use +# glibjava_CXX instead of glibcpp_CXX. That's because we're passed a # different definition of CXX than other directories, since we don't # depend on libstdc++-v3 having already been built. AC_DEFUN(LIB_AC_PROG_CXX, [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl dnl Fool anybody using AC_PROG_CXX. AC_PROVIDE([AC_PROG_CXX]) -# Use glibcpp_CXX so that we do not cause CXX to be cached with the -# flags that come in CXX while configuring libstdc++. They're different +# Use glibjava_CXX so that we do not cause CXX to be cached with the +# flags that come in CXX while configuring libjava. They're different # from those used for all other target libraries. If CXX is set in # the environment, respect that here. -glibcpp_CXX=$CXX -AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) +glibjava_CXX=$CXX +AC_CHECK_PROGS(glibjava_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) AC_SUBST(CXX) -CXX=$glibcpp_CXX -test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) +CXX=$glibjava_CXX +test -z "$glibjava_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) AC_PROG_CXX_GNU diff --git a/libjava/configure b/libjava/configure index c28bb1cd2a4..39f78945999 100755 --- a/libjava/configure +++ b/libjava/configure @@ -1191,56 +1191,56 @@ else fi -# We use the libstdc++-v3 version of LIB_AC_PROG_CXX, that gets -# glibcpp_CXX cached instead of CXX. That's because we're passed a +# We use the libstdc++-v3 version of LIB_AC_PROG_CXX, but use +# glibjava_CXX instead of glibcpp_CXX. That's because we're passed a # different definition of CXX than other directories, since we don't # depend on libstdc++-v3 having already been built. -# Use glibcpp_CXX so that we do not cause CXX to be cached with the -# flags that come in CXX while configuring libstdc++. They're different +# Use glibjava_CXX so that we do not cause CXX to be cached with the +# flags that come in CXX while configuring libjava. They're different # from those used for all other target libraries. If CXX is set in # the environment, respect that here. -glibcpp_CXX=$CXX +glibjava_CXX=$CXX for ac_prog in $CCC c++ g++ gcc CC cxx cc++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1212: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_glibcpp_CXX'+set}'`\" = set"; then +if eval "test \"`echo '$''{'ac_cv_prog_glibjava_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$glibcpp_CXX"; then - ac_cv_prog_glibcpp_CXX="$glibcpp_CXX" # Let the user override the test. + if test -n "$glibjava_CXX"; then + ac_cv_prog_glibjava_CXX="$glibjava_CXX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_prog_glibcpp_CXX="$ac_prog" + ac_cv_prog_glibjava_CXX="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi -glibcpp_CXX="$ac_cv_prog_glibcpp_CXX" -if test -n "$glibcpp_CXX"; then - echo "$ac_t""$glibcpp_CXX" 1>&6 +glibjava_CXX="$ac_cv_prog_glibjava_CXX" +if test -n "$glibjava_CXX"; then + echo "$ac_t""$glibjava_CXX" 1>&6 else echo "$ac_t""no" 1>&6 fi -test -n "$glibcpp_CXX" && break +test -n "$glibjava_CXX" && break done -test -n "$glibcpp_CXX" || glibcpp_CXX="gcc" +test -n "$glibjava_CXX" || glibjava_CXX="gcc" -CXX=$glibcpp_CXX -test -z "$glibcpp_CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } +CXX=$glibjava_CXX +test -z "$glibjava_CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 echo "configure:1247: checking whether we are using GNU C++" >&5 @@ -5584,31 +5584,21 @@ else fi -# Determine gcj version number. - -gcjvers="`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`" - -cat >> confdefs.h <<EOF -#define GCJVERSION "$gcjvers" -EOF - - - echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6 -echo "configure:5601: checking for g++ -ffloat-store bug" >&5 +echo "configure:5591: checking for g++ -ffloat-store bug" >&5 save_CFLAGS="$CFLAGS" CFLAGS="-x c++ -O2 -ffloat-store" cat > conftest.$ac_ext <<EOF -#line 5605 "configure" +#line 5595 "configure" #include "confdefs.h" #include <math.h> int main() { ; return 0; } EOF -if { (eval echo configure:5612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""no" 1>&6 else @@ -5628,17 +5618,17 @@ for ac_hdr in unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5632: checking for $ac_hdr" >&5 +echo "configure:5622: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5637 "configure" +#line 5627 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5632: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5668,17 +5658,17 @@ for ac_hdr in dirent.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5672: checking for $ac_hdr" >&5 +echo "configure:5662: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5677 "configure" +#line 5667 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5708,17 +5698,17 @@ for ac_hdr in inttypes.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5712: checking for $ac_hdr" >&5 +echo "configure:5702: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5717 "configure" +#line 5707 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5754,12 +5744,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:5758: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:5748: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5763 "configure" +#line 5753 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -5775,7 +5765,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:5779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -5797,12 +5787,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:5801: checking for ANSI C header files" >&5 +echo "configure:5791: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5806 "configure" +#line 5796 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -5810,7 +5800,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5827,7 +5817,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 5831 "configure" +#line 5821 "configure" #include "confdefs.h" #include <string.h> EOF @@ -5845,7 +5835,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 5849 "configure" +#line 5839 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -5866,7 +5856,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 5870 "configure" +#line 5860 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -5877,7 +5867,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:5881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -5901,12 +5891,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:5905: checking for ssize_t" >&5 +echo "configure:5895: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5910 "configure" +#line 5900 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -5935,9 +5925,9 @@ fi echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6 -echo "configure:5939: checking for in_addr_t" >&5 +echo "configure:5929: checking for in_addr_t" >&5 cat > conftest.$ac_ext <<EOF -#line 5941 "configure" +#line 5931 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -5951,7 +5941,7 @@ int main() { in_addr_t foo; ; return 0; } EOF -if { (eval echo configure:5955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_IN_ADDR_T 1 @@ -5967,16 +5957,16 @@ fi rm -f conftest* echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6 -echo "configure:5971: checking whether struct ip_mreq is in netinet/in.h" >&5 +echo "configure:5961: checking whether struct ip_mreq is in netinet/in.h" >&5 cat > conftest.$ac_ext <<EOF -#line 5973 "configure" +#line 5963 "configure" #include "confdefs.h" #include <netinet/in.h> int main() { struct ip_mreq mreq; ; return 0; } EOF -if { (eval echo configure:5980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_STRUCT_IP_MREQ 1 @@ -5992,16 +5982,16 @@ fi rm -f conftest* echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6 -echo "configure:5996: checking whether struct ipv6_mreq is in netinet/in.h" >&5 +echo "configure:5986: checking whether struct ipv6_mreq is in netinet/in.h" >&5 cat > conftest.$ac_ext <<EOF -#line 5998 "configure" +#line 5988 "configure" #include "confdefs.h" #include <netinet/in.h> int main() { struct ipv6_mreq mreq6; ; return 0; } EOF -if { (eval echo configure:6005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_STRUCT_IPV6_MREQ 1 @@ -6017,16 +6007,16 @@ fi rm -f conftest* echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6 -echo "configure:6021: checking whether struct sockaddr_in6 is in netinet/in.h" >&5 +echo "configure:6011: checking whether struct sockaddr_in6 is in netinet/in.h" >&5 cat > conftest.$ac_ext <<EOF -#line 6023 "configure" +#line 6013 "configure" #include "confdefs.h" #include <netinet/in.h> int main() { struct sockaddr_in6 addr6; ; return 0; } EOF -if { (eval echo configure:6030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_INET6 1 @@ -6042,9 +6032,9 @@ fi rm -f conftest* echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6 -echo "configure:6046: checking for socklen_t in sys/socket.h" >&5 +echo "configure:6036: checking for socklen_t in sys/socket.h" >&5 cat > conftest.$ac_ext <<EOF -#line 6048 "configure" +#line 6038 "configure" #include "confdefs.h" #define _POSIX_PII_SOCKET #include <sys/types.h> @@ -6053,7 +6043,7 @@ int main() { socklen_t x = 5; ; return 0; } EOF -if { (eval echo configure:6057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_SOCKLEN_T 1 @@ -6069,16 +6059,16 @@ fi rm -f conftest* echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6 -echo "configure:6073: checking for tm_gmtoff in struct tm" >&5 +echo "configure:6063: checking for tm_gmtoff in struct tm" >&5 cat > conftest.$ac_ext <<EOF -#line 6075 "configure" +#line 6065 "configure" #include "confdefs.h" #include <time.h> int main() { struct tm tim; tim.tm_gmtoff = 0; ; return 0; } EOF -if { (eval echo configure:6082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define STRUCT_TM_HAS_GMTOFF 1 @@ -6091,16 +6081,16 @@ else rm -rf conftest* echo "$ac_t""no" 1>&6 echo $ac_n "checking for global timezone variable""... $ac_c" 1>&6 -echo "configure:6095: checking for global timezone variable" >&5 +echo "configure:6085: checking for global timezone variable" >&5 cat > conftest.$ac_ext <<EOF -#line 6097 "configure" +#line 6087 "configure" #include "confdefs.h" #include <time.h> int main() { long z2 = timezone; ; return 0; } EOF -if { (eval echo configure:6104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_TIMEZONE 1 @@ -6120,19 +6110,19 @@ rm -f conftest* # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:6124: checking for working alloca.h" >&5 +echo "configure:6114: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6129 "configure" +#line 6119 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:6136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -6153,12 +6143,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:6157: checking for alloca" >&5 +echo "configure:6147: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6162 "configure" +#line 6152 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -6186,7 +6176,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:6190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -6218,12 +6208,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:6222: checking whether alloca needs Cray hooks" >&5 +echo "configure:6212: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6227 "configure" +#line 6217 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -6248,12 +6238,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6252: checking for $ac_func" >&5 +echo "configure:6242: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6257 "configure" +#line 6247 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6276,7 +6266,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6303,7 +6293,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:6307: checking stack direction for C alloca" >&5 +echo "configure:6297: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6311,7 +6301,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 6315 "configure" +#line 6305 "configure" #include "confdefs.h" find_stack_direction () { @@ -6330,7 +6320,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:6334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -6357,7 +6347,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6361: checking for $ac_word" >&5 +echo "configure:6351: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6435,7 +6425,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:6439: checking for X" >&5 +echo "configure:6429: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -6497,12 +6487,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF -#line 6501 "configure" +#line 6491 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6571,14 +6561,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF -#line 6575 "configure" +#line 6565 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF -if { (eval echo configure:6582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -6684,17 +6674,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:6688: checking whether -R must be followed by a space" >&5 +echo "configure:6678: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <<EOF -#line 6691 "configure" +#line 6681 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:6698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -6710,14 +6700,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <<EOF -#line 6714 "configure" +#line 6704 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:6721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -6749,7 +6739,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:6753: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:6743: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6757,7 +6747,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <<EOF -#line 6761 "configure" +#line 6751 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6768,7 +6758,7 @@ int main() { dnet_ntoa() ; return 0; } EOF -if { (eval echo configure:6772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6790,7 +6780,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:6794: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:6784: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6798,7 +6788,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <<EOF -#line 6802 "configure" +#line 6792 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6809,7 +6799,7 @@ int main() { dnet_ntoa() ; return 0; } EOF -if { (eval echo configure:6813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6838,12 +6828,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:6842: checking for gethostbyname" >&5 +echo "configure:6832: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6847 "configure" +#line 6837 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname(); below. */ @@ -6866,7 +6856,7 @@ gethostbyname(); ; return 0; } EOF -if { (eval echo configure:6870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -6887,7 +6877,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:6891: checking for gethostbyname in -lnsl" >&5 +echo "configure:6881: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6895,7 +6885,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF -#line 6899 "configure" +#line 6889 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6906,7 +6896,7 @@ int main() { gethostbyname() ; return 0; } EOF -if { (eval echo configure:6910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6936,12 +6926,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:6940: checking for connect" >&5 +echo "configure:6930: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6945 "configure" +#line 6935 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect(); below. */ @@ -6964,7 +6954,7 @@ connect(); ; return 0; } EOF -if { (eval echo configure:6968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -6985,7 +6975,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:6989: checking for connect in -lsocket" >&5 +echo "configure:6979: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6993,7 +6983,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <<EOF -#line 6997 "configure" +#line 6987 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7004,7 +6994,7 @@ int main() { connect() ; return 0; } EOF -if { (eval echo configure:7008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7028,12 +7018,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:7032: checking for remove" >&5 +echo "configure:7022: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7037 "configure" +#line 7027 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove(); below. */ @@ -7056,7 +7046,7 @@ remove(); ; return 0; } EOF -if { (eval echo configure:7060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -7077,7 +7067,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:7081: checking for remove in -lposix" >&5 +echo "configure:7071: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7085,7 +7075,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <<EOF -#line 7089 "configure" +#line 7079 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7096,7 +7086,7 @@ int main() { remove() ; return 0; } EOF -if { (eval echo configure:7100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7120,12 +7110,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:7124: checking for shmat" >&5 +echo "configure:7114: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7129 "configure" +#line 7119 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat(); below. */ @@ -7148,7 +7138,7 @@ shmat(); ; return 0; } EOF -if { (eval echo configure:7152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -7169,7 +7159,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:7173: checking for shmat in -lipc" >&5 +echo "configure:7163: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7177,7 +7167,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <<EOF -#line 7181 "configure" +#line 7171 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7188,7 +7178,7 @@ int main() { shmat() ; return 0; } EOF -if { (eval echo configure:7192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7221,7 +7211,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:7225: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:7215: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7229,7 +7219,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <<EOF -#line 7233 "configure" +#line 7223 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7240,7 +7230,7 @@ int main() { IceConnectionNumber() ; return 0; } EOF -if { (eval echo configure:7244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7478,7 +7468,7 @@ s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g s%@CC@%$CC%g -s%@glibcpp_CXX@%$glibcpp_CXX%g +s%@glibjava_CXX@%$glibjava_CXX%g s%@CXX@%$CXX%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g @@ -7555,7 +7545,6 @@ s%@USE_LIBDIR_FALSE@%$USE_LIBDIR_FALSE%g s%@NEEDS_DATA_START_TRUE@%$NEEDS_DATA_START_TRUE%g s%@NEEDS_DATA_START_FALSE@%$NEEDS_DATA_START_FALSE%g s%@GCC_UNWIND_INCLUDE@%$GCC_UNWIND_INCLUDE%g -s%@GCJVERSION@%$GCJVERSION%g s%@AM_RUNTESTFLAGS@%$AM_RUNTESTFLAGS%g s%@ALLOCA@%$ALLOCA%g s%@PERL@%$PERL%g diff --git a/libjava/configure.in b/libjava/configure.in index 5872f32eb9e..684a5b7f8f3 100644 --- a/libjava/configure.in +++ b/libjava/configure.in @@ -743,13 +743,6 @@ AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host") AM_CONDITIONAL(NEEDS_DATA_START, test "$NEEDS_DATA_START" = yes && test "$NATIVE" = yes) AC_SUBST(GCC_UNWIND_INCLUDE) -# Determine gcj version number. -changequote(<<,>>) -gcjvers="`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`" -changequote([,]) -AC_DEFINE_UNQUOTED(GCJVERSION, "$gcjvers") -AC_SUBST(GCJVERSION) - AC_SUBST(AM_RUNTESTFLAGS) dnl Work around a g++ bug. Reported to gcc-bugs@gcc.gnu.org on Jan 22, 2000. diff --git a/libjava/gcj/Makefile.in b/libjava/gcj/Makefile.in index 5674ad37576..df256bcd4db 100644 --- a/libjava/gcj/Makefile.in +++ b/libjava/gcj/Makefile.in @@ -80,7 +80,6 @@ GCDEPS = @GCDEPS@ GCINCS = @GCINCS@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ -GCJVERSION = @GCJVERSION@ GCLIBS = @GCLIBS@ GCOBJS = @GCOBJS@ GCSPEC = @GCSPEC@ @@ -121,7 +120,7 @@ ZINCS = @ZINCS@ ZLIBS = @ZLIBS@ ZLIBSPEC = @ZLIBSPEC@ ZLIBTESTSPEC = @ZLIBTESTSPEC@ -glibcpp_CXX = @glibcpp_CXX@ +glibjava_CXX = @glibjava_CXX@ here = @here@ libgcj_basedir = @libgcj_basedir@ mkinstalldirs = @mkinstalldirs@ @@ -139,7 +138,7 @@ DIST_COMMON = ./stamp-h2.in Makefile.am Makefile.in libgcj-config.h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gtar +TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: @@ -236,7 +235,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ + cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/libjava/gij.cc b/libjava/gij.cc index e4a8ca3d975..bb56b112b6d 100644 --- a/libjava/gij.cc +++ b/libjava/gij.cc @@ -40,7 +40,7 @@ help () static void version () { - printf ("gij (GNU libgcj) version %s\n\n", GCJVERSION); + printf ("gij (GNU libgcj) version %s\n\n", __VERSION__); printf ("Copyright (C) 2002 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"); diff --git a/libjava/include/Makefile.in b/libjava/include/Makefile.in index 85bc3560f82..3039c8c2b87 100644 --- a/libjava/include/Makefile.in +++ b/libjava/include/Makefile.in @@ -80,7 +80,6 @@ GCDEPS = @GCDEPS@ GCINCS = @GCINCS@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ -GCJVERSION = @GCJVERSION@ GCLIBS = @GCLIBS@ GCOBJS = @GCOBJS@ GCSPEC = @GCSPEC@ @@ -121,7 +120,7 @@ ZINCS = @ZINCS@ ZLIBS = @ZLIBS@ ZLIBSPEC = @ZLIBSPEC@ ZLIBTESTSPEC = @ZLIBTESTSPEC@ -glibcpp_CXX = @glibcpp_CXX@ +glibjava_CXX = @glibjava_CXX@ here = @here@ libgcj_basedir = @libgcj_basedir@ mkinstalldirs = @mkinstalldirs@ @@ -138,7 +137,7 @@ DIST_COMMON = ./stamp-h1.in Makefile.am Makefile.in config.h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gtar +TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: @@ -235,7 +234,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ + cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in index 94d3b60a180..049297416de 100644 --- a/libjava/include/config.h.in +++ b/libjava/include/config.h.in @@ -120,9 +120,6 @@ /* Define if global `timezone' exists. */ #undef HAVE_TIMEZONE -/* Define to version of GCJ in use. */ -#undef GCJVERSION - /* Define if you have the appropriate function. */ #undef HAVE_ACCESS #undef HAVE_STAT diff --git a/libjava/java/lang/natPosixProcess.cc b/libjava/java/lang/natPosixProcess.cc index c7dffe90345..5ff49e3e382 100644 --- a/libjava/java/lang/natPosixProcess.cc +++ b/libjava/java/lang/natPosixProcess.cc @@ -284,7 +284,7 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray, myclose (msgp[0]); cleanup (args, env); - fcntl (outp[1], F_SETFD, 1); - fcntl (inp[0], F_SETFD, 1); - fcntl (errp[0], F_SETFD, 1); + fcntl (outp[1], F_SETFD, FD_CLOEXEC); + fcntl (inp[0], F_SETFD, FD_CLOEXEC); + fcntl (errp[0], F_SETFD, FD_CLOEXEC); } diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc index 86b7c60e97c..c87168d98f8 100644 --- a/libjava/java/lang/natSystem.cc +++ b/libjava/java/lang/natSystem.cc @@ -306,11 +306,11 @@ java::lang::System::init_properties (void) SET ("java.version", VERSION); SET ("java.vendor", "Free Software Foundation, Inc."); SET ("java.vendor.url", "http://gcc.gnu.org/java/"); - SET ("java.class.version", GCJVERSION); + SET ("java.class.version", __VERSION__); SET ("java.vm.specification.version", "1.1"); SET ("java.vm.specification.name", "Java(tm) Virtual Machine Specification"); SET ("java.vm.specification.vendor", "Sun Microsystems Inc."); - SET ("java.vm.version", GCJVERSION); + SET ("java.vm.version", __VERSION__); SET ("java.vm.vendor", "Free Software Foundation, Inc."); SET ("java.vm.name", "libgcj"); SET ("java.specification.version", "1.1"); diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc index e11e5c3677c..d4cbb72ed96 100644 --- a/libjava/java/lang/reflect/natMethod.cc +++ b/libjava/java/lang/reflect/natMethod.cc @@ -426,6 +426,7 @@ _Jv_CallAnyMethodA (jobject obj, union { ffi_arg i; + jobject o; jlong l; jfloat f; jdouble d; @@ -448,37 +449,43 @@ _Jv_CallAnyMethodA (jobject obj, // a narrowing conversion for jbyte, jchar, etc. results. // Note that boolean is handled either by the FFI_TYPE_SINT8 or // FFI_TYPE_SINT32 case. - switch (rtype->type) - { - case FFI_TYPE_VOID: - break; - case FFI_TYPE_SINT8: - result->b = (jbyte)ffi_result.i; - break; - case FFI_TYPE_SINT16: - result->s = (jshort)ffi_result.i; - break; - case FFI_TYPE_UINT16: - result->c = (jchar)ffi_result.i; - break; - case FFI_TYPE_SINT32: - result->i = (jint)ffi_result.i; - break; - case FFI_TYPE_SINT64: - result->j = (jlong)ffi_result.l; - break; - case FFI_TYPE_FLOAT: - result->f = (jfloat)ffi_result.f; - break; - case FFI_TYPE_DOUBLE: - result->d = (jdouble)ffi_result.d; - break; - default: - JvFail ("Unknown ffi_call return type"); - break; - } if (is_constructor) result->l = obj; + else + { + switch (rtype->type) + { + case FFI_TYPE_VOID: + break; + case FFI_TYPE_SINT8: + result->b = (jbyte)ffi_result.i; + break; + case FFI_TYPE_SINT16: + result->s = (jshort)ffi_result.i; + break; + case FFI_TYPE_UINT16: + result->c = (jchar)ffi_result.i; + break; + case FFI_TYPE_SINT32: + result->i = (jint)ffi_result.i; + break; + case FFI_TYPE_SINT64: + result->j = (jlong)ffi_result.l; + break; + case FFI_TYPE_FLOAT: + result->f = (jfloat)ffi_result.f; + break; + case FFI_TYPE_DOUBLE: + result->d = (jdouble)ffi_result.d; + break; + case FFI_TYPE_POINTER: + result->l = (jobject)ffi_result.o; + break; + default: + JvFail ("Unknown ffi_call return type"); + break; + } + } return ex; #else diff --git a/libjava/java/util/Timer.java b/libjava/java/util/Timer.java index 03ec937d606..38c4dc09f57 100644 --- a/libjava/java/util/Timer.java +++ b/libjava/java/util/Timer.java @@ -293,6 +293,7 @@ public class Timer public synchronized void stop() { this.heap = null; + this.elements = 0; this.notify(); } diff --git a/libjava/testsuite/Makefile.in b/libjava/testsuite/Makefile.in index d9192167f08..15bbdaa8e59 100644 --- a/libjava/testsuite/Makefile.in +++ b/libjava/testsuite/Makefile.in @@ -80,7 +80,6 @@ GCDEPS = @GCDEPS@ GCINCS = @GCINCS@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ -GCJVERSION = @GCJVERSION@ GCLIBS = @GCLIBS@ GCOBJS = @GCOBJS@ GCSPEC = @GCSPEC@ @@ -121,7 +120,7 @@ ZINCS = @ZINCS@ ZLIBS = @ZLIBS@ ZLIBSPEC = @ZLIBSPEC@ ZLIBTESTSPEC = @ZLIBTESTSPEC@ -glibcpp_CXX = @glibcpp_CXX@ +glibjava_CXX = @glibjava_CXX@ here = @here@ libgcj_basedir = @libgcj_basedir@ mkinstalldirs = @mkinstalldirs@ @@ -147,7 +146,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gtar +TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: @@ -175,7 +174,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ + cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index eceef8983ca..accb9cc305d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,67 @@ +2002-03-03 Phil Edwards <pme@gcc.gnu.org> + + PR libstdc++/2955 + * include/std/std_sstream.h: Remove trailing spaces. + (basic_stringbuf::_M_stringbuf_init): Also check for ios_base::app. + * testsuite/27_io/stringbuf.cc (test05, test06): New tests. + +2002-03-03 Paolo Carlini <pcarlini@unitus.it> + + * testsuite/22_locale/num_get_members_char.cc (test04): + Use a named locale expecting grouping (de_DE). + * testsuite/22_locale/num_get_members_wchar_t.cc (test04): + Ditto. + * testsuite/27_io/ios_manip_basefield.cc (test01): + Extend coverage, uniform treatment of hexs and octs. + +2002-03-01 Paolo Carlini <pcarlini@unitus.it> + + * include/bits/locale_facets.tcc (num_get::_M_extract_int): + Admit grouping for octals and hexadecimals too. + * testsuite/22_locale/num_get_members_char.cc: Add test04. + (test01): Tweak "." -> "," in void* test. + * testsuite/22_locale/num_get_members_wchar_t.cc: Ditto. + + * testsuite/27_io/ios_manip_basefield.cc: Remove static keyword. + * testsuite/27_io/ios_manip_fmtflags.cc: Remove two of them. + + * testsuite/27_io/ios_manip_basefield.cc (test01): + Fix for 64 bit machines. + +2002-02-28 Richard Henderson <rth@redhat.com> + + * config/linker-map.gnu: Export operator new with unsigned long, + and with std::nothrow_t. Likewise operator delete. + +2002-02-26 Benjamin Kosnik <bkoz@redhat.com> + + * include/bits/basic_ios.tcc (basic_ios::init): Set _M_fill to zero. + Adjust comment. + * include/bits/basic_ios.h (basic_ios::_M_fill): Make mutable. + (basic_ios::_M_fill_init): New. + (basic_ios::fill()): Delay dealing with _M_fill. + Adjust comment. + * ios.cc (ios_base::ios_base()): Initialize _M_callbacks, _M_words. + (ios_base::_M_call_callbacks): Adjust. + * testsuite/27_io/ios_init.cc (test02): Adjust testcase. + +2002-02-28 Loren Rittle <ljrittle@acm.org> + + * include/Makefile.am (thread_target_headers): Unconditionally + stage and install gthr-posix.h. + (${target_builddir}/gthr-posix.h): New rule cloned off + ${target_builddir}/gthr-default.h. + (${target_builddir}/gthr-default.h): Support chained inclusion + of gthr support headers. + * include/Makefile.in: Rebuilt. + +2002-02-26 Paolo Carlini <pcarlini@unitus.it> + + * include/bits/locale_facets.tcc (num_put::_M_widen_int): + Group all the integral types, not only decs. + * testsuite/27_io/ios_manip_basefield.cc (test01): Tweak existing + tests, add a few more. + 2002-02-25 Phil Edwards <pme@gcc.gnu.org> * docs/html/faq/index.html: Update. diff --git a/libstdc++-v3/config/linker-map.gnu b/libstdc++-v3/config/linker-map.gnu index 46702a4c82d..e0f3f8800af 100644 --- a/libstdc++-v3/config/linker-map.gnu +++ b/libstdc++-v3/config/linker-map.gnu @@ -37,17 +37,34 @@ GLIBCPP_3.1 { }; # Names not in an 'extern' block are mangled names. + # operator new(unsigned) _Znwj; + # operator new(unsigned, std::nothrow_t const&) + _ZnwjRKSt9nothrow_t; + # operator new(unsigned long) + _Znwm; + # operator new(unsigned long, std::nothrow_t const&) + _ZnwmRKSt9nothrow_t; # operator delete(void*) _ZdlPv; + # operator delete(void*, std::nothrow_t const&) + _ZdlPvRKSt9nothrow_t; # operator new[](unsigned) _Znaj; + # operator new[](unsigned, std::nothrow_t const&) + _ZnajRKSt9nothrow_t; + # operator new[](unsigned long) + _Znam; + # operator new[](unsigned long, std::nothrow_t const&) + _ZnamRKSt9nothrow_t; # operator delete[](void*) _ZdaPv; + # operator delete[](void*, std::nothrow_t const&) + _ZdaPvRKSt9nothrow_t; # vtable _ZTV*; diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 25dc17679a6..953dbdb4314 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -287,6 +287,7 @@ extra_target_headers = \ thread_target_headers = \ ${target_builddir}/gthr.h \ ${target_builddir}/gthr-single.h \ + ${target_builddir}/gthr-posix.h \ ${target_builddir}/gthr-default.h # List of all timestamp files. By keeping only one copy of this list, both @@ -388,11 +389,19 @@ ${target_builddir}/gthr-single.h: ${toplevel_srcdir}/gcc/gthr-single.h \ -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \ < ${toplevel_srcdir}/gcc/gthr-single.h > $@ +${target_builddir}/gthr-posix.h: ${toplevel_srcdir}/gcc/gthr-posix.h \ + stamp-${target_alias} + sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \ + -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \ + -e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \ + < ${toplevel_srcdir}/gcc/gthr-posix.h > $@ + ${target_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcpp_thread_h} \ stamp-${target_alias} sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \ -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \ -e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \ + -e 's,^#include "\(.*\)",#include <bits/\1>,g' \ < ${toplevel_srcdir}/gcc/${glibcpp_thread_h} > $@ # For robustness sake (in light of junk files or in-source diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 51be549528e..9043a929e5e 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -68,7 +68,6 @@ AS = @AS@ ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@ AWK = @AWK@ BASIC_FILE_H = @BASIC_FILE_H@ -BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ @@ -90,17 +89,17 @@ EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ GENCAT = @GENCAT@ -GLIBC21 = @GLIBC21@ GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@ GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INSTOBJEXT = @INSTOBJEXT@ -INTLBISON = @INTLBISON@ +INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ -INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIBICONV = @LIBICONV@ LIBIO_INCLUDES = @LIBIO_INCLUDES@ LIBMATHOBJS = @LIBMATHOBJS@ LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ @@ -142,6 +141,7 @@ glibcpp_prefixdir = @glibcpp_prefixdir@ glibcpp_toolexecdir = @glibcpp_toolexecdir@ glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@ ifGNUmake = @ifGNUmake@ +l = @l@ libio_la = @libio_la@ libtool_VERSION = @libtool_VERSION@ release_VERSION = @release_VERSION@ @@ -159,277 +159,52 @@ glibcpp_builddir = @glibcpp_builddir@ bits_srcdir = ${glibcpp_srcdir}/include/bits bits_builddir = ./bits -bits_headers = \ - ${bits_srcdir}/basic_ios.h \ - ${bits_srcdir}/basic_ios.tcc \ - ${bits_srcdir}/basic_string.h \ - ${bits_srcdir}/basic_string.tcc \ - ${bits_srcdir}/boost_concept_check.h \ - ${bits_srcdir}/char_traits.h \ - ${bits_srcdir}/codecvt.h \ - ${bits_srcdir}/concept_check.h \ - ${bits_srcdir}/cpp_type_traits.h \ - ${bits_srcdir}/fpos.h \ - ${bits_srcdir}/fstream.tcc \ - ${bits_srcdir}/functexcept.h \ - ${bits_srcdir}/generic_shadow.h \ - ${bits_srcdir}/gslice.h \ - ${bits_srcdir}/gslice_array.h \ - ${bits_srcdir}/indirect_array.h \ - ${bits_srcdir}/ios_base.h \ - ${bits_srcdir}/istream.tcc \ - ${bits_srcdir}/locale_facets.h \ - ${bits_srcdir}/locale_facets.tcc \ - ${bits_srcdir}/localefwd.h \ - ${bits_srcdir}/mask_array.h \ - ${bits_srcdir}/ostream.tcc \ - ${bits_srcdir}/pthread_allocimpl.h \ - ${bits_srcdir}/stream_iterator.h \ - ${bits_srcdir}/streambuf_iterator.h \ - ${bits_srcdir}/slice.h \ - ${bits_srcdir}/slice_array.h \ - ${bits_srcdir}/sstream.tcc \ - ${bits_srcdir}/stl_algo.h \ - ${bits_srcdir}/stl_algobase.h \ - ${bits_srcdir}/stl_alloc.h \ - ${bits_srcdir}/stl_bvector.h \ - ${bits_srcdir}/stl_construct.h \ - ${bits_srcdir}/stl_deque.h \ - ${bits_srcdir}/stl_function.h \ - ${bits_srcdir}/stl_heap.h \ - ${bits_srcdir}/stl_iterator.h \ - ${bits_srcdir}/stl_iterator_base_funcs.h \ - ${bits_srcdir}/stl_iterator_base_types.h \ - ${bits_srcdir}/stl_list.h \ - ${bits_srcdir}/stl_map.h \ - ${bits_srcdir}/stl_multimap.h \ - ${bits_srcdir}/stl_multiset.h \ - ${bits_srcdir}/stl_numeric.h \ - ${bits_srcdir}/stl_pair.h \ - ${bits_srcdir}/stl_pthread_alloc.h \ - ${bits_srcdir}/stl_queue.h \ - ${bits_srcdir}/stl_raw_storage_iter.h \ - ${bits_srcdir}/stl_relops.h \ - ${bits_srcdir}/stl_set.h \ - ${bits_srcdir}/stl_stack.h \ - ${bits_srcdir}/stl_tempbuf.h \ - ${bits_srcdir}/stl_threads.h \ - ${bits_srcdir}/stl_tree.h \ - ${bits_srcdir}/stl_uninitialized.h \ - ${bits_srcdir}/stl_vector.h \ - ${bits_srcdir}/streambuf.tcc \ - ${bits_srcdir}/stringfwd.h \ - ${bits_srcdir}/type_traits.h \ - ${bits_srcdir}/valarray_array.h \ - ${bits_srcdir}/valarray_array.tcc \ - ${bits_srcdir}/valarray_meta.h +bits_headers = ${bits_srcdir}/basic_ios.h ${bits_srcdir}/basic_ios.tcc ${bits_srcdir}/basic_string.h ${bits_srcdir}/basic_string.tcc ${bits_srcdir}/boost_concept_check.h ${bits_srcdir}/char_traits.h ${bits_srcdir}/codecvt.h ${bits_srcdir}/concept_check.h ${bits_srcdir}/cpp_type_traits.h ${bits_srcdir}/fpos.h ${bits_srcdir}/fstream.tcc ${bits_srcdir}/functexcept.h ${bits_srcdir}/generic_shadow.h ${bits_srcdir}/gslice.h ${bits_srcdir}/gslice_array.h ${bits_srcdir}/indirect_array.h ${bits_srcdir}/ios_base.h ${bits_srcdir}/istream.tcc ${bits_srcdir}/locale_facets.h ${bits_srcdir}/locale_facets.tcc ${bits_srcdir}/localefwd.h ${bits_srcdir}/mask_array.h ${bits_srcdir}/ostream.tcc ${bits_srcdir}/pthread_allocimpl.h ${bits_srcdir}/stream_iterator.h ${bits_srcdir}/streambuf_iterator.h ${bits_srcdir}/slice.h ${bits_srcdir}/slice_array.h ${bits_srcdir}/sstream.tcc ${bits_srcdir}/stl_algo.h ${bits_srcdir}/stl_algobase.h ${bits_srcdir}/stl_alloc.h ${bits_srcdir}/stl_bvector.h ${bits_srcdir}/stl_construct.h ${bits_srcdir}/stl_deque.h ${bits_srcdir}/stl_function.h ${bits_srcdir}/stl_heap.h ${bits_srcdir}/stl_iterator.h ${bits_srcdir}/stl_iterator_base_funcs.h ${bits_srcdir}/stl_iterator_base_types.h ${bits_srcdir}/stl_list.h ${bits_srcdir}/stl_map.h ${bits_srcdir}/stl_multimap.h ${bits_srcdir}/stl_multiset.h ${bits_srcdir}/stl_numeric.h ${bits_srcdir}/stl_pair.h ${bits_srcdir}/stl_pthread_alloc.h ${bits_srcdir}/stl_queue.h ${bits_srcdir}/stl_raw_storage_iter.h ${bits_srcdir}/stl_relops.h ${bits_srcdir}/stl_set.h ${bits_srcdir}/stl_stack.h ${bits_srcdir}/stl_tempbuf.h ${bits_srcdir}/stl_threads.h ${bits_srcdir}/stl_tree.h ${bits_srcdir}/stl_uninitialized.h ${bits_srcdir}/stl_vector.h ${bits_srcdir}/streambuf.tcc ${bits_srcdir}/stringfwd.h ${bits_srcdir}/type_traits.h ${bits_srcdir}/valarray_array.h ${bits_srcdir}/valarray_array.tcc ${bits_srcdir}/valarray_meta.h backward_srcdir = ${glibcpp_srcdir}/include/backward backward_builddir = ./backward -backward_headers = \ - ${backward_srcdir}/complex.h \ - ${backward_srcdir}/iomanip.h \ - ${backward_srcdir}/istream.h \ - ${backward_srcdir}/ostream.h \ - ${backward_srcdir}/stream.h \ - ${backward_srcdir}/streambuf.h \ - ${backward_srcdir}/algo.h \ - ${backward_srcdir}/algobase.h \ - ${backward_srcdir}/alloc.h \ - ${backward_srcdir}/bvector.h \ - ${backward_srcdir}/defalloc.h \ - ${backward_srcdir}/deque.h \ - ${backward_srcdir}/function.h \ - ${backward_srcdir}/hash_map.h \ - ${backward_srcdir}/hash_set.h \ - ${backward_srcdir}/hashtable.h \ - ${backward_srcdir}/heap.h \ - ${backward_srcdir}/iostream.h \ - ${backward_srcdir}/iterator.h \ - ${backward_srcdir}/list.h \ - ${backward_srcdir}/map.h \ - ${backward_srcdir}/multimap.h \ - ${backward_srcdir}/new.h \ - ${backward_srcdir}/multiset.h \ - ${backward_srcdir}/pair.h \ - ${backward_srcdir}/queue.h \ - ${backward_srcdir}/rope.h \ - ${backward_srcdir}/set.h \ - ${backward_srcdir}/slist.h \ - ${backward_srcdir}/stack.h \ - ${backward_srcdir}/tempbuf.h \ - ${backward_srcdir}/tree.h \ - ${backward_srcdir}/vector.h \ - ${backward_srcdir}/fstream.h \ - ${backward_srcdir}/strstream.h \ - ${backward_srcdir}/strstream \ - ${backward_srcdir}/backward_warning.h +backward_headers = ${backward_srcdir}/complex.h ${backward_srcdir}/iomanip.h ${backward_srcdir}/istream.h ${backward_srcdir}/ostream.h ${backward_srcdir}/stream.h ${backward_srcdir}/streambuf.h ${backward_srcdir}/algo.h ${backward_srcdir}/algobase.h ${backward_srcdir}/alloc.h ${backward_srcdir}/bvector.h ${backward_srcdir}/defalloc.h ${backward_srcdir}/deque.h ${backward_srcdir}/function.h ${backward_srcdir}/hash_map.h ${backward_srcdir}/hash_set.h ${backward_srcdir}/hashtable.h ${backward_srcdir}/heap.h ${backward_srcdir}/iostream.h ${backward_srcdir}/iterator.h ${backward_srcdir}/list.h ${backward_srcdir}/map.h ${backward_srcdir}/multimap.h ${backward_srcdir}/new.h ${backward_srcdir}/multiset.h ${backward_srcdir}/pair.h ${backward_srcdir}/queue.h ${backward_srcdir}/rope.h ${backward_srcdir}/set.h ${backward_srcdir}/slist.h ${backward_srcdir}/stack.h ${backward_srcdir}/tempbuf.h ${backward_srcdir}/tree.h ${backward_srcdir}/vector.h ${backward_srcdir}/fstream.h ${backward_srcdir}/strstream.h ${backward_srcdir}/strstream ${backward_srcdir}/backward_warning.h ext_srcdir = ${glibcpp_srcdir}/include/ext ext_builddir = ./ext -ext_headers = \ - ${ext_srcdir}/algorithm \ - ${ext_srcdir}/functional \ - ${ext_srcdir}/hash_map \ - ${ext_srcdir}/hash_set \ - ${ext_srcdir}/iterator \ - ${ext_srcdir}/memory \ - ${ext_srcdir}/numeric \ - ${ext_srcdir}/rb_tree \ - ${ext_srcdir}/rope \ - ${ext_srcdir}/ropeimpl.h \ - ${ext_srcdir}/slist \ - ${ext_srcdir}/stl_hash_fun.h \ - ${ext_srcdir}/stl_hashtable.h \ - ${ext_srcdir}/stl_rope.h +ext_headers = ${ext_srcdir}/algorithm ${ext_srcdir}/functional ${ext_srcdir}/hash_map ${ext_srcdir}/hash_set ${ext_srcdir}/iterator ${ext_srcdir}/memory ${ext_srcdir}/numeric ${ext_srcdir}/rb_tree ${ext_srcdir}/rope ${ext_srcdir}/ropeimpl.h ${ext_srcdir}/slist ${ext_srcdir}/stl_hash_fun.h ${ext_srcdir}/stl_hashtable.h ${ext_srcdir}/stl_rope.h # This is the common subset of files that all three "C" header models use. c_base_srcdir = @C_INCLUDE_DIR@ c_base_builddir = . -c_base_headers = \ - ${c_base_srcdir}/std_cassert.h \ - ${c_base_srcdir}/std_cctype.h \ - ${c_base_srcdir}/std_cerrno.h \ - ${c_base_srcdir}/std_cfloat.h \ - ${c_base_srcdir}/std_ciso646.h \ - ${c_base_srcdir}/std_climits.h \ - ${c_base_srcdir}/std_clocale.h \ - ${c_base_srcdir}/std_cmath.h \ - ${c_base_srcdir}/std_csetjmp.h \ - ${c_base_srcdir}/std_csignal.h \ - ${c_base_srcdir}/std_cstdarg.h \ - ${c_base_srcdir}/std_cstddef.h \ - ${c_base_srcdir}/std_cstdio.h \ - ${c_base_srcdir}/std_cstdlib.h \ - ${c_base_srcdir}/std_cstring.h \ - ${c_base_srcdir}/std_ctime.h \ - ${c_base_srcdir}/std_cwchar.h \ - ${c_base_srcdir}/std_cwctype.h +c_base_headers = ${c_base_srcdir}/std_cassert.h ${c_base_srcdir}/std_cctype.h ${c_base_srcdir}/std_cerrno.h ${c_base_srcdir}/std_cfloat.h ${c_base_srcdir}/std_ciso646.h ${c_base_srcdir}/std_climits.h ${c_base_srcdir}/std_clocale.h ${c_base_srcdir}/std_cmath.h ${c_base_srcdir}/std_csetjmp.h ${c_base_srcdir}/std_csignal.h ${c_base_srcdir}/std_cstdarg.h ${c_base_srcdir}/std_cstddef.h ${c_base_srcdir}/std_cstdio.h ${c_base_srcdir}/std_cstdlib.h ${c_base_srcdir}/std_cstring.h ${c_base_srcdir}/std_ctime.h ${c_base_srcdir}/std_cwchar.h ${c_base_srcdir}/std_cwctype.h # Some of the "C" headers need extra files. -c_base_headers_extra = \ - ${c_base_srcdir}/cmath.tcc - -c_base_headers_rename = \ - cassert \ - cctype \ - cerrno \ - cfloat \ - ciso646 \ - climits \ - clocale \ - cmath \ - csetjmp \ - csignal \ - cstdarg \ - cstddef \ - cstdio \ - cstdlib \ - cstring \ - ctime \ - cwchar \ - cwctype +c_base_headers_extra = ${c_base_srcdir}/cmath.tcc + +c_base_headers_rename = cassert cctype cerrno cfloat ciso646 climits clocale cmath csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime cwchar cwctype std_srcdir = ${glibcpp_srcdir}/include/std std_builddir = . -std_headers = \ - ${std_srcdir}/std_algorithm.h \ - ${std_srcdir}/std_bitset.h \ - ${std_srcdir}/std_complex.h \ - ${std_srcdir}/std_deque.h \ - ${std_srcdir}/std_fstream.h \ - ${std_srcdir}/std_functional.h \ - ${std_srcdir}/std_iomanip.h \ - ${std_srcdir}/std_ios.h \ - ${std_srcdir}/std_iosfwd.h \ - ${std_srcdir}/std_iostream.h \ - ${std_srcdir}/std_istream.h \ - ${std_srcdir}/std_iterator.h \ - ${std_srcdir}/std_limits.h \ - ${std_srcdir}/std_list.h \ - ${std_srcdir}/std_locale.h \ - ${std_srcdir}/std_map.h \ - ${std_srcdir}/std_memory.h \ - ${std_srcdir}/std_numeric.h \ - ${std_srcdir}/std_ostream.h \ - ${std_srcdir}/std_queue.h \ - ${std_srcdir}/std_set.h \ - ${std_srcdir}/std_sstream.h \ - ${std_srcdir}/std_stack.h \ - ${std_srcdir}/std_stdexcept.h \ - ${std_srcdir}/std_streambuf.h \ - ${std_srcdir}/std_string.h \ - ${std_srcdir}/std_utility.h \ - ${std_srcdir}/std_valarray.h \ - ${std_srcdir}/std_vector.h +std_headers = ${std_srcdir}/std_algorithm.h ${std_srcdir}/std_bitset.h ${std_srcdir}/std_complex.h ${std_srcdir}/std_deque.h ${std_srcdir}/std_fstream.h ${std_srcdir}/std_functional.h ${std_srcdir}/std_iomanip.h ${std_srcdir}/std_ios.h ${std_srcdir}/std_iosfwd.h ${std_srcdir}/std_iostream.h ${std_srcdir}/std_istream.h ${std_srcdir}/std_iterator.h ${std_srcdir}/std_limits.h ${std_srcdir}/std_list.h ${std_srcdir}/std_locale.h ${std_srcdir}/std_map.h ${std_srcdir}/std_memory.h ${std_srcdir}/std_numeric.h ${std_srcdir}/std_ostream.h ${std_srcdir}/std_queue.h ${std_srcdir}/std_set.h ${std_srcdir}/std_sstream.h ${std_srcdir}/std_stack.h ${std_srcdir}/std_stdexcept.h ${std_srcdir}/std_streambuf.h ${std_srcdir}/std_string.h ${std_srcdir}/std_utility.h ${std_srcdir}/std_valarray.h ${std_srcdir}/std_vector.h # Renamed at build time. -std_headers_rename = \ - algorithm \ - bitset \ - complex \ - deque \ - fstream \ - functional \ - iomanip \ - ios \ - iosfwd \ - iostream \ - istream \ - iterator \ - limits \ - list \ - locale \ - map \ - memory \ - numeric \ - ostream \ - queue \ - set \ - sstream \ - stack \ - stdexcept \ - streambuf \ - string \ - utility \ - valarray \ - vector +std_headers_rename = algorithm bitset complex deque fstream functional iomanip ios iosfwd iostream istream iterator limits list locale map memory numeric ostream queue set sstream stack stdexcept streambuf string utility valarray vector target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@ target_builddir = ./${target_alias}/bits -target_headers = \ - ${target_srcdir}/ctype_base.h \ - ${target_srcdir}/ctype_inline.h \ - ${target_srcdir}/ctype_noninline.h \ - ${target_srcdir}/os_defines.h \ - ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \ - ${glibcpp_srcdir}/@CPU_LIMITS_INC_SRCDIR@/cpu_limits.h +target_headers = ${target_srcdir}/ctype_base.h ${target_srcdir}/ctype_inline.h ${target_srcdir}/ctype_noninline.h ${target_srcdir}/os_defines.h ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h ${glibcpp_srcdir}/@CPU_LIMITS_INC_SRCDIR@/cpu_limits.h # These extra_target_headers files are all built with ad hoc naming rules. -extra_target_headers = \ - ${target_builddir}/basic_file.h \ - ${target_builddir}/c++config.h \ - ${target_builddir}/c++io.h \ - ${target_builddir}/c++locale.h \ - ${target_builddir}/messages_members.h \ - ${target_builddir}/codecvt_specializations.h +extra_target_headers = ${target_builddir}/basic_file.h ${target_builddir}/c++config.h ${target_builddir}/c++io.h ${target_builddir}/c++locale.h ${target_builddir}/messages_members.h ${target_builddir}/codecvt_specializations.h -thread_target_headers = \ - ${target_builddir}/gthr.h \ - ${target_builddir}/gthr-single.h \ - ${target_builddir}/gthr-default.h +thread_target_headers = ${target_builddir}/gthr.h ${target_builddir}/gthr-single.h ${target_builddir}/gthr-posix.h ${target_builddir}/gthr-default.h # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. -allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext \ - ${target_builddir}/stamp-target +allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext ${target_builddir}/stamp-target # Target includes for threads @@ -452,7 +227,7 @@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gtar +TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: @@ -636,11 +411,19 @@ ${target_builddir}/gthr-single.h: ${toplevel_srcdir}/gcc/gthr-single.h \ -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \ < ${toplevel_srcdir}/gcc/gthr-single.h > $@ +${target_builddir}/gthr-posix.h: ${toplevel_srcdir}/gcc/gthr-posix.h \ + stamp-${target_alias} + sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \ + -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \ + -e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \ + < ${toplevel_srcdir}/gcc/gthr-posix.h > $@ + ${target_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcpp_thread_h} \ stamp-${target_alias} sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \ -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \ -e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \ + -e 's,^#include "\(.*\)",#include <bits/\1>,g' \ < ${toplevel_srcdir}/gcc/${glibcpp_thread_h} > $@ install-data-local: $(INSTALL) -d ${gxx_include_dir} diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h index f91719582f1..dea2fdb3857 100644 --- a/libstdc++-v3/include/bits/basic_ios.h +++ b/libstdc++-v3/include/bits/basic_ios.h @@ -64,7 +64,8 @@ namespace std // Data members: protected: basic_ostream<_CharT, _Traits>* _M_tie; - char_type _M_fill; + mutable char_type _M_fill; + mutable bool _M_fill_init; iostate _M_exception; basic_streambuf<_CharT, _Traits>* _M_streambuf; @@ -160,7 +161,14 @@ namespace std char_type fill() const - { return _M_fill; } + { + if (!_M_fill_init) + { + _M_fill = this->widen(' '); + _M_fill_init = true; + } + return _M_fill; + } char_type fill(char_type __ch) diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc index 4db4a82d5ac..63a439747b7 100644 --- a/libstdc++-v3/include/bits/basic_ios.tcc +++ b/libstdc++-v3/include/bits/basic_ios.tcc @@ -144,17 +144,20 @@ namespace std _M_cache_facets(_M_ios_locale); _M_tie = 0; - // NB: The 27.4.4.1 Postconditions Table only specifies - // requirements after basic_ios::init() has been called. As part - // of this, fill() must return widen(' '), which needs an imbued - // ctype facet of char_type to return without throwing an - // exception. This is not a required facet, so streams with - // char_type != [char, wchar_t] will not have it by - // default. However, because fill()'s signature is const, this - // data member cannot be lazily initialized. Thus, thoughts of - // using a non-const helper function in ostream inserters is - // really besides the point. - _M_fill = this->widen(' '); + // NB: The 27.4.4.1 Postconditions Table specifies requirements + // after basic_ios::init() has been called. As part of this, + // fill() must return widen(' ') any time after init() has been + // called, which needs an imbued ctype facet of char_type to + // return without throwing an exception. Unfortunately, + // ctype<char_type> is not necessarily a required facet, so + // streams with char_type != [char, wchar_t] will not have it by + // default. Because of this, the correct value for _M_fill is + // constructed on the first call of fill(). That way, + // unformatted input and output with non-required basic_ios + // instantiations is possible even without imbuing the expected + // ctype<char_type> facet. + _M_fill = 0; + _M_fill_init = false; _M_exception = goodbit; _M_streambuf = __sb; diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 4e88d9f2e3f..b145ec9922c 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -1,4 +1,4 @@ -// Predefined symbols and macros -*- C++ -*- + // Predefined symbols and macros -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. // @@ -34,7 +34,7 @@ #include <bits/os_defines.h> // The current version of the C++ library in compressed ISO date format. -#define __GLIBCPP__ 20020225 +#define __GLIBCPP__ 20020304 // This is necessary until GCC supports separate template // compilation. diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index 02ae96eeb51..4f31bd6e0c9 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -310,7 +310,7 @@ namespace std __ctype.widen(_S_atoms, _S_atoms + __len, __watoms); string __found_grouping; const string __grouping = __np.grouping(); - bool __check_grouping = __grouping.size() && __base == 10; + bool __check_grouping = __grouping.size(); int __sep_pos = 0; const char_type __sep = __np.thousands_sep(); while (__beg != __end) @@ -726,18 +726,32 @@ namespace std * __len * 2)); __ctype.widen(__cs, __cs + __len, __ws); - // Add grouping, if necessary. + // Add grouping, if necessary. const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc); const string __grouping = __np.grouping(); - ios_base::fmtflags __basefield = __io.flags() & ios_base::basefield; - bool __dec = __basefield != ios_base::oct - && __basefield != ios_base::hex; - if (__grouping.size() && __dec) + const ios_base::fmtflags __basefield = __io.flags() & ios_base::basefield; + if (__grouping.size()) { + // By itself __add_grouping cannot deal correctly with __ws when + // ios::showbase is set and ios_base::oct || ios_base::hex. + // Therefore we take care "by hand" of the initial 0, 0x or 0X. + streamsize __off = 0; + if (__io.flags() & ios_base::showbase) + if (__basefield == ios_base::oct) + { + __off = 1; + *__ws2 = *__ws; + } + else if (__basefield == ios_base::hex) + { + __off = 2; + *__ws2 = *__ws; + *(__ws2 + 1) = *(__ws + 1); + } _CharT* __p; - __p = __add_grouping(__ws2, __np.thousands_sep(), __grouping.c_str(), + __p = __add_grouping(__ws2 + __off, __np.thousands_sep(), __grouping.c_str(), __grouping.c_str() + __grouping.size(), - __ws, __ws + __len); + __ws + __off, __ws + __len); __len = __p - __ws2; // Switch strings. __ws = __ws2; diff --git a/libstdc++-v3/include/std/std_sstream.h b/libstdc++-v3/include/std/std_sstream.h index bbd6dc60b75..bb1dfcdb0d6 100644 --- a/libstdc++-v3/include/std/std_sstream.h +++ b/libstdc++-v3/include/std/std_sstream.h @@ -69,23 +69,23 @@ namespace std protected: // Data Members: __string_type _M_string; - + public: // Constructors: - explicit + explicit basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out) : __streambuf_type(), _M_string() { _M_stringbuf_init(__mode); } - explicit + explicit basic_stringbuf(const __string_type& __str, ios_base::openmode __mode = ios_base::in | ios_base::out) : __streambuf_type(), _M_string(__str.data(), __str.size()) { _M_stringbuf_init(__mode); } // Get and set: - __string_type - str() const + __string_type + str() const { if (_M_mode & ios_base::out) { @@ -102,7 +102,7 @@ namespace std return _M_string; } - void + void str(const __string_type& __s) { _M_string = __s; @@ -127,14 +127,14 @@ namespace std // suite particular needs. _M_buf_size_opt = 512; _M_mode = __mode; - if (_M_mode & ios_base::ate) - _M_really_sync(0, _M_buf_size); - else + if (_M_mode & (ios_base::ate | ios_base::app)) + _M_really_sync(0, _M_buf_size); + else _M_really_sync(0, 0); } // Overridden virtual functions: - virtual int_type + virtual int_type underflow() { if (_M_in_cur && _M_in_cur < _M_in_end) @@ -143,38 +143,38 @@ namespace std return traits_type::eof(); } - virtual int_type + virtual int_type pbackfail(int_type __c = traits_type::eof()); - virtual int_type + virtual int_type overflow(int_type __c = traits_type::eof()); - virtual __streambuf_type* + virtual __streambuf_type* setbuf(char_type* __s, streamsize __n) - { - if (__s && __n) + { + if (__s && __n) { _M_string = __string_type(__s, __n); _M_really_sync(0, 0); } - return this; - } + return this; + } - virtual pos_type + virtual pos_type seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode = ios_base::in | ios_base::out); - virtual pos_type - seekpos(pos_type __sp, + virtual pos_type + seekpos(pos_type __sp, ios_base::openmode __mode = ios_base::in | ios_base::out); // Internal function for correctly updating the internal buffer // for a particular _M_string, due to initialization or // re-sizing of an existing _M_string. // Assumes: contents of _M_string and internal buffer match exactly. - // __i == _M_in_cur - _M_in_beg + // __i == _M_in_cur - _M_in_beg // __o == _M_out_cur - _M_out_beg - virtual int + virtual int _M_really_sync(__size_type __i, __size_type __o) { char_type* __base = const_cast<char_type*>(_M_string.data()); @@ -221,12 +221,12 @@ namespace std public: // Constructors: - explicit + explicit basic_istringstream(ios_base::openmode __mode = ios_base::in) : __istream_type(NULL), _M_stringbuf(__mode | ios_base::in) { this->init(&_M_stringbuf); } - explicit + explicit basic_istringstream(const __string_type& __str, ios_base::openmode __mode = ios_base::in) : __istream_type(NULL), _M_stringbuf(__str, __mode | ios_base::in) @@ -236,15 +236,15 @@ namespace std { } // Members: - __stringbuf_type* + __stringbuf_type* rdbuf() const { return const_cast<__stringbuf_type*>(&_M_stringbuf); } __string_type str() const { return _M_stringbuf.str(); } - - void + + void str(const __string_type& __s) { _M_stringbuf.str(__s); } }; @@ -276,12 +276,12 @@ namespace std public: // Constructors/destructor: - explicit + explicit basic_ostringstream(ios_base::openmode __mode = ios_base::out) : __ostream_type(NULL), _M_stringbuf(__mode | ios_base::out) { this->init(&_M_stringbuf); } - explicit + explicit basic_ostringstream(const __string_type& __str, ios_base::openmode __mode = ios_base::out) : __ostream_type(NULL), _M_stringbuf(__str, __mode | ios_base::out) @@ -291,20 +291,20 @@ namespace std { } // Members: - __stringbuf_type* + __stringbuf_type* rdbuf() const { return const_cast<__stringbuf_type*>(&_M_stringbuf); } __string_type str() const { return _M_stringbuf.str(); } - - void + + void str(const __string_type& __s) { _M_stringbuf.str(__s); } }; - - + + // 27.7.4 Template class basic_stringstream template <typename _CharT, typename _Traits, typename _Alloc> class basic_stringstream : public basic_iostream<_CharT, _Traits> @@ -331,12 +331,12 @@ namespace std public: // Constructors/destructors - explicit + explicit basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in) : __iostream_type(NULL), _M_stringbuf(__m) { this->init(&_M_stringbuf); } - explicit + explicit basic_stringstream(const __string_type& __str, ios_base::openmode __m = ios_base::out | ios_base::in) : __iostream_type(NULL), _M_stringbuf(__str, __m) @@ -346,7 +346,7 @@ namespace std { } // Members: - __stringbuf_type* + __stringbuf_type* rdbuf() const { return const_cast<__stringbuf_type*>(&_M_stringbuf); } @@ -354,7 +354,7 @@ namespace std str() const { return _M_stringbuf.str(); } - void + void str(const __string_type& __s) { _M_stringbuf.str(__s); } }; diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc index e8122bb2b77..9824b10223a 100644 --- a/libstdc++-v3/src/ios.cc +++ b/libstdc++-v3/src/ios.cc @@ -257,7 +257,7 @@ namespace std } for (; i < _M_word_limit; i++) words[i] = _M_words[i]; - if (_M_words != _M_word_array) + if (_M_words && _M_words != _M_word_array) delete [] _M_words; } @@ -294,7 +294,11 @@ namespace std ios_base::ios_base() { - // Do nothing; init() does it. Static init to 0 makes everything sane. + // Do nothing: basic_ios::init() does it. + // NB: _M_callbacks and _M_words must be zero for non-initialized + // ios_base to go through ~ios_base gracefully. + _M_callbacks = 0; + _M_words = 0; } // 27.4.2.7 ios_base constructors/destructors @@ -302,9 +306,8 @@ namespace std { _M_call_callbacks(erase_event); _M_dispose_callbacks(); - if (_M_words != _M_word_array) + if (_M_words && _M_words != _M_word_array) delete [] _M_words; - // XXX done? } void @@ -314,13 +317,14 @@ namespace std void ios_base::_M_call_callbacks(event __e) throw() { - for (_Callback_list* __p = _M_callbacks; __p; __p = __p->_M_next) + _Callback_list* __p = _M_callbacks; + while (__p) { - try { - (*__p->_M_fn) (__e, *this, __p->_M_index); - } - catch (...) { - } + try + { (*__p->_M_fn) (__e, *this, __p->_M_index); } + catch (...) + { } + __p = __p->_M_next; } } diff --git a/libstdc++-v3/testsuite/22_locale/num_get_members_char.cc b/libstdc++-v3/testsuite/22_locale/num_get_members_char.cc index 1c9d8f08996..e8f2219543c 100644 --- a/libstdc++-v3/testsuite/22_locale/num_get_members_char.cc +++ b/libstdc++-v3/testsuite/22_locale/num_get_members_char.cc @@ -213,7 +213,7 @@ void test01() VERIFY( err == goodbit ); // const void - iss.str("0xbffff74c."); + iss.str("0xbffff74c,"); iss.clear(); err = goodbit; ng.get(iss.rdbuf(), 0, iss, err, v); @@ -332,11 +332,70 @@ void test03() #endif } +// Testing the correct parsing of grouped hexadecimals and octals. +void test04() +{ + using namespace std; + + bool test = true; + + unsigned long ul; + + istringstream iss; + + // A locale that expects grouping + locale loc_de("de_DE"); + iss.imbue(loc_de); + + const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc()); + const ios_base::iostate goodbit = ios_base::goodbit; + ios_base::iostate err = ios_base::goodbit; + + iss.setf(ios::hex, ios::basefield); + iss.str("0xbf.fff.74c "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 0xbffff74c ); + + iss.str("0Xf.fff "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 0xffff ); + + iss.str("ffe "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 0xffe ); + + iss.setf(ios::oct, ios::basefield); + iss.str("07.654.321 "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 07654321 ); + + iss.str("07.777 "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 07777 ); + + iss.str("776 "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 0776 ); +} + int main() { test01(); test02(); test03(); + test04(); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/num_get_members_wchar_t.cc b/libstdc++-v3/testsuite/22_locale/num_get_members_wchar_t.cc index 53fb9c9df77..807fb5b1474 100644 --- a/libstdc++-v3/testsuite/22_locale/num_get_members_wchar_t.cc +++ b/libstdc++-v3/testsuite/22_locale/num_get_members_wchar_t.cc @@ -214,7 +214,7 @@ void test01() VERIFY( err == goodbit ); // const void - iss.str(L"0xbffff74c."); + iss.str(L"0xbffff74c,"); iss.clear(); err = goodbit; ng.get(iss.rdbuf(), 0, iss, err, v); @@ -333,6 +333,64 @@ void test03() } #endif } + +// Testing the correct parsing of grouped hexadecimals and octals. +void test04() +{ + using namespace std; + + bool test = true; + + unsigned long ul; + + wistringstream iss; + + // A locale that expects grouping + locale loc_de("de_DE"); + iss.imbue(loc_de); + + const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc()); + const ios_base::iostate goodbit = ios_base::goodbit; + ios_base::iostate err = ios_base::goodbit; + + iss.setf(ios::hex, ios::basefield); + iss.str(L"0xbf.fff.74c "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 0xbffff74c ); + + iss.str(L"0Xf.fff "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 0xffff ); + + iss.str(L"ffe "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 0xffe ); + + iss.setf(ios::oct, ios::basefield); + iss.str(L"07.654.321 "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 07654321 ); + + iss.str(L"07.777 "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 07777 ); + + iss.str(L"776 "); + err = goodbit; + ng.get(iss.rdbuf(), 0, iss, err, ul); + VERIFY( err == goodbit ); + VERIFY( ul == 0776 ); +} #endif int main() @@ -341,6 +399,7 @@ int main() test01(); test02(); test03(); + test04(); #endif return 0; } diff --git a/libstdc++-v3/testsuite/27_io/ios_init.cc b/libstdc++-v3/testsuite/27_io/ios_init.cc index 626439bdb8b..7cef9cce683 100644 --- a/libstdc++-v3/testsuite/27_io/ios_init.cc +++ b/libstdc++-v3/testsuite/27_io/ios_init.cc @@ -83,32 +83,31 @@ void test01() } // Non-required instantiations don't have the required facets inbued, -// by default, into the locale object. As such, basic_ios::init is -// required to return a bad_cast for the first use of fill() call. +// by default, into the locale object. // See 27.4.4.1 +class gnu_ios: public std::basic_ios<char> { }; + void test02() { bool test = true; // 01: Doesn't call basic_ios::init, which uses ctype<char_type>.. + // This should be unambiguously correct. try { - std::basic_ostringstream<unsigned short> oss; + gnu_ios gios; } catch(...) { test = false; } - // 02: Calls basic_ios::init, which uses ctype<char_type>.. + // 02: Calls basic_ios::init, which may call ctype<char_type>... try { std::basic_string<unsigned short> str; std::basic_ostringstream<unsigned short> oss(str); - // Shouldn't get this far. - test = false; - // Try each member functions for unformatted io. // put oss.put(324); @@ -122,7 +121,9 @@ void test02() } catch(const std::bad_cast& obj) { - test = true; + // Should be able to do the above without calling fill() and + // forcing a call to widen... + test = false; } catch(...) { diff --git a/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc b/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc index e84d2e6705c..82aeeaa0c74 100644 --- a/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc +++ b/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc @@ -38,39 +38,67 @@ struct MyNP : std::numpunct<char> char do_thousands_sep() const; }; -std::string MyNP::do_grouping() const { static std::string s("\3"); return s; } +std::string MyNP::do_grouping() const { std::string s("\3"); return s; } char MyNP::do_thousands_sep() const { return ' '; } int test01() { bool test = true; - const char lit[] = "-0 123 456\n:-01 234 567:\n:-0 123 456 :" - "\n: -012 345:\n:- 01 234:\n0x000012 345 678"; + + const char lit[] = "0123 456\n: 01 234 567:\n:0123 456 :\n" + ": 012 345:\n: 01 234:\n:0726 746 425:\n" + ":04 553 207 :\n: 0361 100:\n: 0173:\n" + "0x12 345 678\n|0x000012 345 678|\n|0x12 345 6780000|\n" + "|00000x12 345 678|\n|0x000012 345 678|\n"; + std::ostringstream oss; oss.imbue(std::locale(std::locale(), new MyNP)); + + // Octals oss << std::oct << std::showbase; - oss << -0123456l << std::endl; + oss << 0123456l << std::endl; + + oss << ":" << std::setw(11); + oss << 01234567l << ":" << std::endl; + + oss << ":" << std::setw(11) << std::left; + oss << 0123456l << ":" << std::endl; + + oss << ":" << std::setw(11) << std::right; + oss << 012345l << ":" << std::endl; + + oss << ":" << std::setw(11) << std::internal; + oss << 01234l << ":" << std::endl; oss << ":" << std::setw(11); - oss << -01234567l << ":" << std::endl; + oss << 123456789l << ":" << std::endl; oss << ":" << std::setw(11) << std::left; - oss << -0123456l << ":" << std::endl; + oss << 1234567l << ":" << std::endl; oss << ":" << std::setw(11) << std::right; - oss << -012345l << ":" << std::endl; + oss << 123456l << ":" << std::endl; oss << ":" << std::setw(11) << std::internal; - oss << -01234l << ":" << std::endl; + oss << 123l << ":" << std::endl; - oss << std::hex; - oss << std::setfill('0'); - oss << std::internal; - oss << std::showbase; - oss << std::setw(16); + // Hexadecimals + oss << std::hex << std::setfill('0'); oss << 0x12345678l << std::endl; + oss << "|" << std::setw(16); + oss << 0x12345678l << "|" << std::endl; + + oss << "|" << std::setw(16) << std::left; + oss << 0x12345678l << "|" << std::endl; + + oss << "|" << std::setw(16) << std::right; + oss << 0x12345678l << "|" << std::endl; + + oss << "|" << std::setw(16) << std::internal; + oss << 0x12345678l << "|" << std::endl; + VERIFY( oss.good() ); VERIFY( oss.str() == lit ); @@ -112,11 +140,18 @@ main() // Projected output: /* --0 123 456 -:-01 234 567: -:-0 123 456 : -: -012 345: -:- 01 234: -0x000012 345 678 +0123 456 +: 01 234 567: +:0123 456 : +: 012 345: +: 01 234: +:0726 746 425: +:04 553 207 : +: 0361 100: +: 0173: +0x12 345 678 +|0x000012 345 678| +|0x12 345 6780000| +|00000x12 345 678| +|0x000012 345 678| */ - diff --git a/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc b/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc index 64b1b85f6d2..3173dc3a54c 100644 --- a/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc +++ b/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc @@ -41,13 +41,13 @@ struct MyNP : std::numpunct<char> std::string MyNP::do_truename() const { - static std::string s("yea"); + std::string s("yea"); return s; } std::string MyNP::do_falsename() const { - static std::string s("nay"); + std::string s("nay"); return s; } diff --git a/libstdc++-v3/testsuite/27_io/stringbuf.cc b/libstdc++-v3/testsuite/27_io/stringbuf.cc index 13d73a4c2c6..bc0bbb4dd8e 100644 --- a/libstdc++-v3/testsuite/27_io/stringbuf.cc +++ b/libstdc++-v3/testsuite/27_io/stringbuf.cc @@ -1,6 +1,7 @@ // 981208 bkoz test functionality of basic_stringbuf for char_type == char -// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -439,12 +440,47 @@ bool test04() { } -int main() { +// libstdc++/3955 -- ios_base::app overwrites from the beginning +bool test05() +{ + bool test = true; + + std::ostringstream os ("foo"); + os << "bar"; + + test = os.str() == "bar"; + +#ifdef DEBUG_ASSERT + assert(test); +#endif + + return test; +} + +bool test06() +{ + bool test = true; + + std::ostringstream os ("foo", std::ios_base::app); + os << "bar"; + + test = os.str() == "foobar"; + +#ifdef DEBUG_ASSERT + assert(test); +#endif + + return test; +} +int main() +{ test01(); test02(); test03(); test04(); + test05(); + test06(); return 0; } |