Merge in gcc2 snapshot 19980929. See gcc/ChangeLog and gcc/FSFChangeLog for

details.

From-SVN: r24879
This commit is contained in:
Jeffrey A Law 1999-01-27 01:43:17 +00:00 committed by Jeff Law
parent 01b4cf2b7a
commit ab87f8c8d1
75 changed files with 6034 additions and 2277 deletions

View File

@ -1,3 +1,25 @@
Wed Jan 27 02:20:48 1999 Jeffrey A Law (law@cygnus.com)
* Merge gcc2 snapshot 19980929.
* cccp.c (PRINTF_PROTO): Remove.
(PRINTF_PROTO_{1,2,3,4}: Likewise.
* cexp.y: Likewise.
* system.h: Add PRINTF_PROTO and PRINTF_PROTO_{1,2,3,4}.
* fix-header.c (cpp_file_lin_for_message): Delete. In libcpp.
(cpp_print_containing_files, v_cpp_message, cpp_message): Likewise.
(cpp_fatal, cpp-Pfatal_with_name): Likewise.
* gen-protos.c (hashf): Delete in cpphash.o
* gen-protos.c (hashf): Delete in cpphash.o
* expr.c: Do not merge SAVE_STACKAREA_MODE changes.
* expmed.c: Likewise.
* rs6000.md: Likewise.
* rs6000.c, rs6000.md: Do not merge formatting changes yet.
Wed Jan 27 01:13:42 1999 Richard Henderson <rth@cygnus.com>
* rs6000.c (input_operand): Don't expect CONST around CONSTANT_P_RTX.

View File

@ -1,5 +1,652 @@
Tue Sep 29 09:57:26 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (get_inner_reference): Fix typo in last change.
Mon Sep 27 21:34:00 1998 Paul Eggert <eggert@twinsun.com>
* po/en_UK.po (Project-Id-Version): Set to cc 2.8.1.19980813 for now.
(PO-Revision-Date): Set to the current date.
Sun Sep 27 07:33:18 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* m68k/vxm68k.h (LINK_SPEC): Always use -r.
(WIDEST_HARDWARE_FP_SIZE): Define.
* reload.c (push_reload): If in STRICT_LOW_PART, always reload
inside even if SUBREG_WORD is not zero.
* flow.c (print_rtl_with_bb): Don't say not in basic block if we
aren't making basic blocks.8
Sat Sep 26 10:57:09 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* function.c (optimize_bit_field): Don't remove SUBREG from dest
if SUBREG_REG is multi-word.
Wed Sep 23 05:43:23 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads_address): Deal with address which is
an AND; clean up return values some more.
Fri Sep 11 13:02:26 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* function.c (purge_addressof_1): Properly copy flags when making MEM.
Mon Sep 7 18:33:06 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (get_inner_reference): If not COMPONENT_REF or BITFIELD_REF
and mode is BLKmode, set size_tree.
* expr.c (expand_builtin, case BUILT_IN_LONGJMP): Fix typo in
last change.
Wed Sep 2 15:38:01 1998 Paul Eggert <eggert@twinsun.com>
* libgcc2.c (__floatdisf): Use signed comparison to test
whether u is close to zero; unsigned comparison is not what's
wanted here.
Mon Aug 17 02:19:30 1998 David Edelsohn <edelsohn@mhpcc.edu>
* xcoffout.c (UNKNOWN_STAB): Fix typo in previous change; missing
backslash before newline.
Mon Aug 17 00:12:42 1998 Paul Eggert <eggert@twinsun.com>
* reorg.c (check_annul_list_true_false): Fix typo in Jul 17 change.
Sun Aug 2 01:10:15 1998 Paul Eggert <eggert@twinsun.com>
Add Native Language Support.
* intl/, ABOUT-NLS, mkinstalldirs, po/Makefile.in.in: New
subdirectory and files. They should be kept identical to the
corresponding items from the GNU gettext distribution.
* ABOUT-GCC-NLS, exgettext, intl.c, intl.h, po/POTFILES.in,
po/en_UK.po: New files.
* Makefile.in (AWK, datadir, localedir, top_builddir, USE_NLS,
INTLLIBS, POSUB, INTL_SUBDIRS, HOST_INTLLIBS,
PREPEND_DOTDOT_TO_RELATIVE_PATHS, SUBDIR_FLAGS_TO_PASS, GCC_OBJS,
COLLECT2_OBJS, CCCP_OBJS, CPPMAIN_OBJS, PROTO_OBJS, GCOV_OBJS,
INTL_DISTCLEAN, GEN_PROTOS_OBJS): New vars.
(LIBDEPS, LIBS): Add $(INTLLIBS).
(HOST_LIBDEPS, HOST_LIBS): Add $(HOST_INTLLIBS).
(LIBS): Add @LIBS@.
(ORDINARY_FLAGS_TO_PASS): New var, containing all the old values
from FLAGS_TO_PASS, except for CC.
(FLAGS_TO_PASS): Pass datadir, distdir, localedir.
(OBJS): Add intl.o.
(GEN): Add gencheck.
(STAGESTUFF): Add tree-check.h, gencheck$(exeext).
(native): Depend on intl.all.
(xgcc, collect2, cccp, cppmain, protoize, unprotoize, gcov): Link
intl.o.
(c-typeck.o, c-lex.o, collect2.o, gcc.o, toplev.o, integrate.o,
final.o, cccp.o, cppmain.o, cpplib.o, cpperror.o, s-proto,
gcov.o): Depend on intl.h.
(gencheck): Depend on $(HOST_LIBDEPS) instead of tree.h and
tree.def.
(gencheck.o, intl.o, $(top_builddir)/intl/libintl.a,
$(srcdir)/cp/parse.c, intl.all, intl.install, intl.uninstall,
intl.distdir, intl.mostlyclean, intl.clean, intl.distclean,
intl.maintainer-clean, intl.distdir-fixup, distdir-check): New
rules.
(gen-protos): Link cpperror.o, cppexp.o, cpphash.o, cpplib.o,
prefix.o, version.o; needed for `cpp_notice'.
(mostlyclean): Depend on intl.mostlyclean.
(clean): Depend on intl.clean.
(distclean): Depend on intl.disclean, unless the invoker defines
INTL_DISTCLEAN to be empty. Remove intl/libintl.h and libintl.h
(created by configure).
(maintainer-clean): Make intl.maintainer-clean, but define
INTL_DISTCLEAN to be empty.
(install-normal): Depend on intl.install.
(uninstall): Depend on intl.uninstall.
(distdir-start): Make sure invoker configured with --enable-nls.
Use $(AWK), not awk. Make tmp/intl and tmp/po directories.
(distdir-finish): Make distdir-check at the end.
(distdir): Depend on intl.distdir, intl.distdir-fixup.
(compare, compare3, gnucompare, gnucompare3, stage1-start,
stage2-start, stage3-start, stage4-start): Handle intl
subdirectory.
* acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
HAVE_LC_MESSAGES, HAVE_STPCPY, PACKAGE, VERSION): New macros.
* aclocal.m4 (AC_ISC_POSIX, AM_WITH_NLS, AM_GNU_GETTEXT,
AM_LC_MESSAGES, AM_PATH_PROG_WITH_TEST): New functions; taken from
gettext distribution.
* bi-arity.c, bi-opcode.c, bi-opname.c: Include config file first.
* c-common.c: Don't include <ctype.h>.
(tfaff): Now a function, not a string. All users changed.
(check_format_info): Use is_C_digit, not isdigit.
Reword messages to ease localization.
* c-decl.c (redeclaration_error_message): Now returns int, not
message.
(poplevel, duplicate_decls, pushdecl): Revamp to pass explicit
strings to diagnostic generators.
(duplicate_decls, parmlist_tags_warning, finish_struct): Reword
messages to ease localization.
* c-iterate.c (prdecl): Reword messages so that they do not require
localization.
* c-lex.c: Include limits.h if available.
Include intl.h.
Include ctype.h only if MAP_CHARACTER is defined.
(UCHAR_MAX): Define if limits.h doesn't.
(C_alnum_array): New var.
(init_lex): Initialize it.
(yyerror): Localize msgid arg.
(yylex): Use is_C_alnum and is_C_digit, not isalnum and isdigit.
* c-lex.h (C_alnum_array): New decl.
(is_C_alnum, is_C_digit): New macros.
* c-typeck.c: Include intl.h.
(warning_init): Now takes just one arg.
(incomplete_type_error, build_unary_op, lvalue_or_else,
readonly_warning, build_modify_expr): Reword messages to ease
localization.
(build_unary_op, readonly_warning): Revamp to pass explicit
strings to diagnostic generators.
(build_modify_expr, warn_for_assignment, c_expand_return):
Translate strings passed to functions expecting translated
strings.
(get_spelling): Remove; it was a no-op. All callers changed.
(error_init, pedwarn_init): Now takes just one arg. All callers
and decls changed. This makes it easier to localize.
* cccp.c: Include intl.h.
(char_name): Remove.
(check_macro_name): Now takes int 2nd arg, not char *. All
callers changed.
(macarg): Now returns int, not char *. All callers changed.
(notice, vnotice, pedwarn_strange_white_space): New functions.
(verror): Now extern; used by cexp.y.
(main): Set message locale, and defer memory allocation until
after.
(main, do_include, print_containing_files): Invoke `notice' to
localize notices.
(handle_directive): Invoke pedwarn_strange_white_space instead of
using char_name.
(do_include, check_macro_name): Reword messages to ease
localization.
(my_strerror): Reword message so that it does not require
localization.
(verror, vwarning, verror_with_line, vwarning_with_line,
pedwarn_with_file_and_line, fatal): Invoke vnotice to localize
msgid.
(initialize_char_syntax): No need to initialize char_name.
* cexp.y (yyerror): Now takes msgid format and args, not just string.
(verror): New decl.
(parse_number, yylex): Reword messages to ease
localization.
(verror): New test function.
(pedwarn, warning): Translate msgid arg.
* collect2.c: Include intl.h.
(my_strerror, main, collect_execute, scan_prog_file,
scan_libraries, read_file, end_file): Reword messages so that they
do not require localization.
(notice): Nwe function.
(fatal, error, main, collect_execute, maybe_unlink,
write_c_file_stat, locatelib, scan_libraries, scan_prog_file,
add_func_table): Use it to translate msgid strings.
(main): Set message locale, and defer memory allocation until
after.
(collect_wait): Reword messages to ease localization.
(bad_header): Revamp to pass explicit strings to diagnostic
generators.
* combine.c (dump_combine_stats, dump_combine_total_stats):
Use fnotice to translate diagnostic messages.
* config/1750a/1750a.c (memop_valid): Don't use `valid' as an
identifier; it runs afoul of SunOS 4.1.4 <locale.h>.
* config/arc/initfini.c (__do_global_dtors): Put backslash before
newline in strings, to pacify xgettext.
* config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h
(dsp16xx_invalid_register_for_compare): New function.
* config/dsp16xx/dsp16xx.md: Use it to report invalid registers.
* config/i370/i370.h: Include <ctype.h>.
* config/i386/i386.c: Include config.h first.
* config/m32r/initfini.c (__do_global_dtors): Put backslash before
newline in strings, to pacify xgettext.
* config/m88k/dguxbcs.h (CPP_SPEC): Likewise.
* config/rs6000/rs6000.c: Include config.h first.
* config/rs6000/rs6000.c, config/rs6000/rs6000.h
(rs6000_fatal_bad_address): New function.
* config/rs6000/rs6000.md: Use it to report bad addresses.
* config/v850/v850.c: Include config.h first.
* configure.in: When generating config.h and mentioning a file
taken from the config directory, surround it with #ifdef IN_GCC,
so that programs compiled without IN_GCC -- notably in the intl
subdirectory -- don't need to be compiled with -Iconfig.
(PACKAGE, VERSION, ALL_LINGUAS): New vars.
(AC_ARG_ENABLE): Add --enable-nls.
(AM_GNU_GETTEXT): Add. Override XGETTEXT so that we use exgettext
instead of xgettext to extract strings.
(all_outputs): Add intl/Makefile, po/Makefile.in.
Do not use the shell variable 'l'; it runs afoul of gettext's
aclocal mechanism!
If libintl.h is created, echo '#include "intl/libintl.h"'
>libintl.h so that we don't have to futz with our include paths.
* cp/Make-lang.in (g++.o): Depend on gansidecl.h, intl.h, Makefile;
do not depend on config.status.
(GXX_OBJS): New var.
(g++$(exeext)): Link intl.o.
* cp/Makefile.in (top_builddir, INTLLIBS): New vars.
(LIBS): Add $(INTLLIBS).
* cppalloc.c (memory_full): Use `cpp_notice' to print diagnostic.
* cpperror.c: Include intl.h.
(cpp_print_containing_files): Use cpp_notice to translate messages.
(cpp_message): is_error is -1 for notices. Translate "warning:".
(cpp_fatal): Translate msgid arg.
* cppexp.c (cpp_lex): Revamp to pass explicit strings to
diagnostic generators.
(cpp_parse_expr): Use cpp_error, not fprintf, to report
unimplemented operators.
* cpplib.c: Include intl.h.
(check_macro_name): Now takes int 2nd arg, not char *. All
callers changed.
(check_macro_name, do_define): Reword messages to ease
localization.
(do_define): Revamp to pass explicit strings to diagnostic
generators.
(do_define, cpp_start_read, cpp_handle_options): Use cpp_notice to
translate messages.
(cpp_error, cpp_warning, cpp_warning_with_line,
cpp_pedwarn_with_file_and_line): Translate msgid arg.
(cpp_notice): New function.
(my_strerror): Reword message so that it does not require
localization.
* cpplib.h (cpp_notice): New decl.
* cppmain.c: Include intl.h.
(main): Set message locale.
* cse.c (cse_main): Use fnotice to print diagnostic.
* final.c: Include intl.h; do not include ctype.h.
(output_operand_lossage): Translate msgid arg.
* fold-const.c (optimize_bit_field_compare, fold_truthop): Reword
messages to ease localization.
* gcc.c: Include intl.h.
(my_strerror, snapshot_warning): Reword messages so that they do
not require localization.
(init_spec, set_spec, read_specs, execute, do_spec_1, main,
snapshot_warning): Invoke `notice' to localize notices.
(struct switchstr): Don't use `valid' as an identifier; it runs
afoul of SunOS 4.1.4 <locale.h>. All uses changed.
(do_spec_1): Treat %e string as msgid format, which needs
translation.
(main): Set message locale.
(pfatal_with_name): Invoke perror_with_name, not fatal, so that we
don't have to translate "%s: %s".
(perror_with_name): Invoke printf, not error, so that we don't
have to translate "%s: %s".
(pfatal_pexecute): Invoke pfatal_with_name, not fatal, so that we
don't have to translate "%s: %s".
(fatal, error): Translate msgid arg.
(notice): New function.
* gcov.c: Include intl.h; include stdarg.h if __STDC__ is defined.
(main): Set message locale.
(fnotice): New function.
(xmalloc, fancy_abort, print_usage, open_files, read_files,
function_summary, output_data): Use it to to print diagnostics.
* install.texi: Explain new configure options --enable-nls,
--with-included-gettext, --with-catgets.
* integrate.c: Include intl.h.
(function_cannot_inline_p): Mark msgids with N_.
* invoke.texi: Describe environment variables affecting locale.
* pexecute.c: Include libintl.h if ENABLE_NLS, otherwise define
gettext to be a noop.
(_, N_): New macros.
(install_error_msg): Wrap inside N_.
(pexecute): Translate diagnostics.
* protoize.c: Include intl.h.
(__attribute__): New macro.
(notice): New function.
(my_strerror): Reword message so that it does not require
localization.
(xmalloc, xrealloc, fancy_abort, safe_write, usage,
file_normally_convertible, abspath, find_file, aux_info_corrupted,
save_def_or_dec, gen_aux_info_file, process_aux_info_file,
rename_c_file, find_extern_def, find_static_definition,
declare_source_confusing, edit_fn_declaration, edit_formals_lists,
add_local_decl, add_global_decls, edit_fn_definition,
scan_for_missed_items, edit_file, main): Use `notice' to print
diagnostic.
(main): Set message locale.
* real.c (NMSGS, ermsg): Remove.
(mtherr): Revamp to pass explicit strings to diagnostic
generators. Abort on invalid operations.
* regclass.c (fix_register): Reword messages to ease localization.
* toplev.c: Include intl.h; do not include ctype.h.
(v_really_sorry, really_sorry): Remove unused functions.
(count_error, fatal_io_error): Translate strings.
(default_print_error_function, report_error_function, main,
print_version): Reword messages to ease localization. Use
`notice' to translate diagnostics.
(vnotice, notice, fnotice): New functions.
(vmessage): Remove.
(v_message_with_file_and_line, vsorry): Translate msgid with
vnotice.
(v_message_with_file_and_line, v_message_with_decl): Use
report_file_and_line. Now takes int warning flag, not prefix;
this is easier to localize. All callers changed.
(v_message_with_decl): Abort if first format spec is neither %%
nor %s. Translate "((anonymous))".
(main): Set message locale.
(set_target_switch): Don't use `valid' as an identifier; it runs
afoul of SunOS 4.1.4 <locale.h>.
(__VERSION__): Reword message so that it does not require
localization.
(print_switch_values): Translate "options passed" and "options
enabled".
* tree.c (valid_machine_attribute): Don't use `valid' as an
identifier; it runs afoul of SunOS 4.1.4 <locale.h>.
* xcoffout.c (xcoff_output_standard_types): Use `error' to
output diagnostic, so that it gets translated.
* patch-apollo-includes: Remove; this is part of README.APOLLO.
Mon Jul 27 18:28:58 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): If no_input_reloads, abort if
reloads were made for addresses.
* m68k.md (sxx): Operand 0 cannot be memory.
Fri Jul 17 07:31:04 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* m68k.c (output_move_simode_const): Use subl to move 0 into addr reg.
(output_move_[hq]imode): Likewise.
* m68k.md (extend[sd]fxf2): Accept constants and general reg as
source operand if the destination is a floating point register.
Fri Jul 17 07:23:49 1998 Herman ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* reorg.c (check_annul_list_true_false): New function.
(steal_delay_list_from_{target,fallthrough}): Call it and also
refine tests for when we may annul if already filled a slot.
(fill_slots_from_thread): Likewise.
(delete_from_delay_slot): Return newly-created thread.
(try_merge_delay_isns): Use its new return value.
Sat Jul 4 11:07:33 1998 Eberhard Mattes <mattes@azu.informatik.uni-stuttgart.de>
* function.c (assign_parms): Handle PARALLEL which include stack.
Sat Jul 4 09:44:29 1998 Paul Edwards <avon@matra.com.au>
* tree.c, print-tree.c, c-lang.c: Include stdio.h before tree.h.
* expr.c (bc_expand_component_address): Correct args to
bc_push_offset_and_size.
* reload1.c (reload_cse_simplify_operands): Add missing return value.
Fri Jul 3 07:17:19 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* alpha.c (normal_memory_operand): Handle case when REG will be
eliminated by reload.
Thu Jul 2 18:43:53 1998 James Carlson <carlson@ironbridgenetworks.com>
* floatlib.c (HIDDEND_LL, MANTD_LL, PACKD_LL): New macros.
(__addsf3): Fixed cases returning wrong type and causing unintended
conversions and data corruption.
(__mulsf3): Fixed rounding flaws caused wrong scaling.
(__float{didf,sisf,disf},__fix{,uns}dfdi): New functions.
(__{gt,ge,lt,le,eq,ne}df2): Likewise.
(__truncdfsf2): Fixed normalization problems
(__fixunsdfsi): Fixed compiler warning
(__{add,sub,mul}df3): Rewrite to do real DP math.
(__divdf3): Removed previous version by Barrett Richardson.
Thu Jul 2 17:57:20 1998 Douglas B. Rupp <rupp@gnat.com>
* cpperror.c: Include errno.h.
Thu Jul 2 16:46:36 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* c-decl.c (grokdeclarator): Don't warn about implicit int in
`typedef foo = bar'.
Tue Jun 30 18:32:49 1998 Geert Bosch <bosch@gnat.com>
* alpha/vxworks.h (LINK_SPEC): Add -taso -T 0.
Tue Jun 30 09:39:32 1998 David Edelsohn <edelsohn@mhpcc.edu>
* expr.c (expand_builtin_{set,long}jmp): If STACK_SAVEAREA_MODE
defined, override sa_mode using its value.
* explow.c (emit_stack_save): Likewise.
* rs6000/aix41.h (ASM_CPU_SPEC): Define relative to ASM_DEFAULT_SPEC.
(CPP_CPU_SPEC): Define relative to CPU_DEFAULT_SPEC.
* rs6000.c (processor_target_table, 620): Don't affect MASK_POWERPC64.
(rs6000_override_options): Ignore flag_pic for AIX.
(rs6000_immed_double_const): Delete.
({reg_or_u_short,u_short_cint}_operand): Don't assume 32-bit CONST_INT.
({non_logical_cint,logical}_operand): Likewise.
(num_insns_constant): mask64_operand is 2 insns.
(easy_fp_constant): Any CONST_DOUBLE_HIGH is okay for 64-bit.
(mask_constant): HOST_WIDE_INT parameter.
(non_and_cint_operand): Delete.
({mask,and}64_operand): New functions.
(function_arg{,_advance}): DImode arguments don't need special
alignment when 64-bit.
(setup_incoming_varargs): Reverse reg_size assignment.
(print_operand): HOST_WIDE_INT second parameter.
(print_operand, case 'B', 'S'): New cases.
(print_operand, case 'M'): Fix typo in lossage string.
(rs6000_stack_info): Reverse reg_size assignment. Use total_raw_size
to compute AIX push_p. Use reg_size to compute {cr,lr}_save_offset.
(rs6000_output_load_toc_table): Reverse init_ptr assignment. Use
TARGET_64BIT not TARGET_POWERPC64. Convert fprintf to fputs.
Load GOT highpart, don't add it. Add lowpart with {cal|la}.
(rs6000_allocate_stack_space): Use {cal|la}.
(output_epilog): Use {cal|la}
(output_function_profiler): Add call glue to mcount call.
Load GOT highpart, don't add it. Add lowpart with {cal|la}.
Use asm_fprintf and convert fprintf to fputs.
* rs6000.h (TARGET_SWITCHES): Add powerpc64.
(STACK_BOUNDARY): Depend on TARGET_32BIT.
(ADJUST_FIELD_ALIGN): Calculate array alignment using innermost type.
(CONST_OK_FOR_LETTER_P): Don't assume 32-bit CONST_INT.
(EXTRA_CONSTRAINTS): Remove 'S' and 'T'. Replace 'S' with
64-bit mask operand.
(RS6000_SAVE_TOC): Depend on TARGET_32BIT.
(STACK_SAVEAREA_MODE): New macro.
(LEGITIMATE_CONSTANT_P): DImode okay for 64bit.
(RTX_COSTS, AND/IOR/XOR): Reflect current machine description.
(ASM_FILE_START): Emit 64-bit ABI directive.
(ASM_DECLARE_FUNCTION_NAME): Align CSECT on doubleword in 64-bit mode.
(ASM_OUTPUT_SPECIAL_POOL_ENTRY): DImode okay for 64-bit.
(PREDICATE_CODES): Add "and64_operand" and "mask64_operand".
Delete "non_and_cint_operand". "input_operand" includes CONST_DOUBLE.
* rs6000.md (iorsi3, xorsi3): Use HOST_WIDE_INT for mask.
Restore define_split.
(floatsidf2, floatunssidf2): Remove !TARGET_POWERPC64 final constraint.
(floatsidf2_internal, floatunssidf2_internal2): Likewise.
Do not specify base register operand mode.
(floatsidf2_loadaddr): Don't specify base register operand mode.
(floatsidf2_store1, floatsidf2_store2): Operand 1 must be base
register; do not specify mode. Remove !TARGET_POWERPC64 final
constraint.
(floatsidf2_load): Don't specify base register operand mode.
Remove !TARGET_POWERPC64 final constraint.
(fix_truncdfsi2_internal, fix_truncdfsi2_{store,load}): Don't specify
base register operand mode.
(mulsidi3): Add !TARGET_POWERPC64 constraint.
(adddi3): Split large constants early.
(absdi3): Shift by 63, not 31.
(rotldi3): Add masking combiner patterns.
(anddi3): Add rldic{r,l} masking. Remove split of large constants.
(iordi3, xordi3): Split large constants early.
(movsi matcher): Remove S and T constraints.
(movsf const_double): create SImode constant from TARGET_DOUBLE.
(movdf_hardfloat32): Add default abort case.
(movdf easy_fp_const): create DImode constant from TARGET_DOUBLE.
(movdi): Remove 64-bit constant generator. Try to convert
CONST_DOUBLE to CONST_INT. Handle TOC memory constants.
(movdi_32): Add default abort case.
(movdi_64): Add numerous ways to split 64-bit constants.
Make catch-all define_split more optimal and never FAIL.
(movti_ppc64): Add default abort case.
(allocate_stack): Remove operand modes; use Pmode.
(restore_stack_block): Remove operand modes. Generate Pmode
temporary. Generate MEM and specify mode.
(save_stack_nonlocal, restore_stack_nonlocal): Generate Pmode
temporary. Save area is double Pmode.
(call_indirect_aix64, call_value_indirect_aix64): New patterns.
(call, call_value): Do not specify address operand mode. Choose
appropriate AIX ABI.
(*call_local64, *ret_call_local64): New patterns.
(*call_nonlocal_aix64, *ret_call_nonlocal_aix64): New patterns.
(*ret_call_nonlocal_aix32): Use call_value_indirect for REG.
(compare): Materialize DImode truthvalues.
Tue Jun 30 06:31:40 1998 Richard Henderson <rth@dot.cygnus.com>
* alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Add '`'.
* alpha.c (print_operand): Handle it.
* alpha.md (fix_truncdfsi2, fix_truncsfsi2): New patterns and
related define_splits.
Tue Jun 30 06:02:07 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* calls.c (emit_library_call{,_value}): Pass null
to REG_PARM_STACK_SPACE.
* alpha.c (normal_memory_operand): New function.
* alpha.h (EXTRA_CONSTRAINT, case 'Q'): Call it.
* fold-const.c (count_cond): New function.
(fold): Don't try to build COND_EXPR from binary op when both sides
are COND_EXPR unless not nested too deeply.
Thu Jun 25 09:54:55 1998 Nick Clifton <nickc@cygnus.com>
* arm.h (REG_ALLOC_ORDER): Add ARG_POINTER_REGNUM, noticed by
grahams@rcp.co.uk.
Mon Jun 15 17:41:33 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload1.c (reload): Issue guidance message on stack frame too large
for reliable stack check.
* fold-const.c (fold_range_test): Prevent falling through with no ret.
Sat Jun 13 15:49:53 1998 Carol LePage <carolo@kemah.hal.com>
* configure.in (sparc-hal-solaris2*): New target.
* sparc/hal.h, sparc/t-halos: New files.
Sat Jun 13 14:30:25 1998 David W. Schuler <schuld@btv.ibm.com>
* i386/aix386ng.h (CPP_SPEC): Remove bogus quote.
Sat Jun 13 14:16:34 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* regmove.c (try_auto_increment): Fix typo.
* c-common.c (truthvalue_conversion): Protect side effects in the
expression when splitting a complex value.
* fold-const.c (fold): Likewise.
* expr.c (do_jump, case EQ_EXPR, NE_EXPR): When comparing complex
prevent operands from being evaluated twice.
Sat Jun 13 12:53:22 1998 Richard Earnshaw (rearnsha@arm.com)
* unroll.c (verify_addresses): Use validate_replace_rtx to undo
changes; abort if undo fails.
Sat Jun 13 11:46:38 1998 Anders Blomdell <anders.blomdell@control.lth.se>
* flags.h (flag_volatile_static): Declare.
* toplev.c (flag_volatile_static): Define.
(f_options): Include -fvolatile-static.
* varasm.c (make_decl_rtl): Support -fvolatile-static.
Sat Jun 13 08:26:21 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload1.c (reload_cse_regno_equal_p): If -ffloat-store, don't
consider a MEM in FP mode as equal.
* varasm.c (assemble_variable): Never put decl with specified section
name into bss.
* output.h (current_function_addresses_labels): Declare.
* function.h (struct function): New field `addresses_labels'.
* function.c (current_function_addresses_labels): Define.
({push,pop}_function_context): Save/restore it.
(init_function_start): Initialize it.
* rtl.h (FUNCTION_FLAGS_ADDRESSES_LABELS): New flag.
* expr.c (expand_expr, case LABEL_DECL): Show addresses labels.
* integrate.c (function_cannot_inline_p): Can't if addresses labels.
(initialize_for_inline): Save current_function_addresses_labels.
(output_inline_function): Restore it.
* reload.c (find_reloads, case 'o'): All reloaded addresses
are offsettable.
(find_reloads_address): If replacing address, don't return 1.
* profile.c (output_func_start_profiler): Add missing steps in
defining function.
Fri Jun 12 17:10:16 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* m68k.md (extendqidi2): Operand 1 must be in data register.
Tue Jun 9 07:24:01 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* cccp.c (handle_directive): If -dM, also include #undef.
* cpplib.c (handle_directive): Likewise.
* calls.c (expand_call): Allow function pointer to be a REFERENCE_TYPE.
* function.c (assign_parms): Use proper mode for location of arg
on stack when promotions are occurring.
* regmove.c ({next,prev}_insn_for_regmove): Properly handle end of
function.

View File

@ -4259,7 +4259,7 @@ Wed Nov 29 14:06:13 1995 Jim Wilson <wilson@cygnus.com>
Wed Nov 29 13:59:58 1995 J"orn Rennecke (amylaar@meolyon.hanse.de)
* c-decl.c (duplicate_decls): Add new parameter different_binding_level.
* c-decl.c (duplicate_decls): Add new paramter different_binding_level.
Lots of changes to use new new parameter.
(pushdecl): Delete variable declared_global. New variable
different_binding_level and code to set it. Move extern/static
@ -5226,7 +5226,7 @@ Thu Sep 14 14:15:16 1995 Stan Cox (coxs@dg-rtp.dg.com)
* m88k.h (VERSION_INFO1): Removed BCS reference.
* m88k/dgux.h (ASM_SPEC, *_LEGEND):
Added -mno-legend option. -mstandard no longer implies that
Added -mno-legend option. -mstandard no longer implies that legend
legend information not be produced.
(LINK_SPEC): Removed -z text
@ -5422,7 +5422,7 @@ Thu Aug 31 08:31:40 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
* va-alpha.h (__gnuc_va_list): Make __offset an int.
* alpha.c (alpha_builtin_saveregs): Properly compute address
of __offset both OSF and WINNT.
of __offset both both OSF and WINNT.
* xm-alpha.h (sbrk): Don't define here.
* gmon.c (sbrk): Define here for __alpha.

View File

@ -6291,7 +6291,7 @@ Sun Apr 20 10:45:35 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
(based_loc_descr): Likewise.
(add_bound_info): Delete default case.
Add cases for CONVERT_EXPR and NON_LVALUE_EXPR; treat like NOP_EXPR.
Change NOP_EXPR to recursive call.
Change NOP_EXPR to to recursive call.
(add_type_attribute): Ignore unnamed subtype of integral or FP.
(gen_subprogram_die): Use reg_loc_descriptor.
(dwarf2out_decl): Ignore nested functions.
@ -11751,7 +11751,7 @@ Mon Jul 8 18:00:33 1996 Jim Wilson <wilson@cygnus.com>
enclose it in a PARALLEL and set the PARALLEL mode correctly.
* mips.md (call_value): Call gen_call_value_multiple_internal0
only if there are multiple return values. Strip the PARALLEL off
if there is only one return value.
if there there is only one return value.
Mon Jul 8 16:27:33 1996 Jeffrey A. Law <law@cygnus.com>

View File

@ -73,6 +73,7 @@ T_CFLAGS =
X_CPPFLAGS =
T_CPPFLAGS =
AWK = @AWK@
CC = @CC@
# srcdir might be a relative pathname which won't be valid in a subdirectory,
# so we must use objdir/srcdir instead to make it safe. objdir is always
@ -293,6 +294,9 @@ includedir = $(local_prefix)/include
assertdir = $(gcc_tooldir)/include
# where the info files go
infodir = @infodir@
# where the locale files go
datadir = $(prefix)/@DATADIRNAME@
localedir = $(datadir)/locale
# Extension (if any) to put in installed man-page filename.
manext = .1
objext = .o
@ -305,6 +309,19 @@ man1dir = $(mandir)/man1
# Dir for temp files.
tmpdir = /tmp
# Top build directory, relative to here.
top_builddir = .
# Whether we were configured with NLS.
USE_NLS = @USE_NLS@
# Internationalization library.
INTLLIBS = @INTLLIBS@
# List of internationalization subdirectories.
POSUB = @POSUB@
INTL_SUBDIRS = intl $(POSUB)
# Additional system libraries to link with.
CLIB=
@ -454,6 +471,7 @@ HOST_PREFIX_1=loser-
HOST_CC=$(CC)
HOST_CFLAGS=$(ALL_CFLAGS)
HOST_CLIB=$(CLIB)
HOST_INTLLIBS=$(INTLLIBS)
HOST_LDFLAGS=$(LDFLAGS)
HOST_CPPFLAGS=$(ALL_CPPFLAGS)
HOST_ALLOCA=$(ALLOCA)
@ -553,22 +571,22 @@ USE_HOST_DOPRINT= ` case "${HOST_DOPRINT}" in ?*) echo ${HOST_PREFIX}${HOST_DOPR
# Dependency on obstack, alloca, malloc or whatever library facilities
# are not installed in the system libraries.
# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT)
LIBDEPS= $(INTLLIBS) $(OBSTACK) $(ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT)
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC) $(HOST_PREFIX)$(HOST_VFPRINTF) $(HOST_PREFIX)$(HOST_DOPRINT)
HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_INTLLIBS) $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC) $(HOST_PREFIX)$(HOST_VFPRINTF) $(HOST_PREFIX)$(HOST_DOPRINT)
# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT) $(CLIB) \
../libiberty/libiberty.a
LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(INTLLIBS) @LIBS@ $(VFPRINTF) $(DOPRINT) $(CLIB) ../libiberty/libiberty.a
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
$(USE_HOST_VFPRINTF) $(USE_HOST_DOPRINT) $(HOST_CLIB)
$(HOST_INTLLIBS) $(USE_HOST_VFPRINTF) $(USE_HOST_DOPRINT) \
$(HOST_CLIB)
HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o
HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
@ -633,7 +651,19 @@ FLAGS_TO_PASS = \
"tooldir=$(tooldir)" \
"gcc_tooldir=$(gcc_tooldir)" \
"bindir=$(bindir)" \
"libsubdir=$(libsubdir)"
"libsubdir=$(libsubdir)" \
"datadir=$(datadir)" \
"distdir=../tmp/\$$(subdir)" \
"localedir=$(localedir)"
PREPEND_DOTDOT_TO_RELATIVE_PATHS = sed \
-e 's|^ *[^ /][^ /]*/|%&|' \
-e 's| -B| -B%|g' \
-e 's|% *[^- /]|%&|g' \
-e 's|%% *|../|g' \
-e 's|%||g'
SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \
"CC=`echo @cc_set_by_configure@ | $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`"
#
# Lists of files for various purposes.
@ -650,10 +680,10 @@ SCHED_CFLAGS = @sched_cflags@
# Language-independent object files.
OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o \
varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o real.o regmove.o \
dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o \
intl.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o real.o \
dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o gcse.o \
integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o varray.o \
regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o gcse.o \
regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o \
insn-peep.o reorg.o $(SCHED_PREFIX)sched.o final.o recog.o reg-stack.o \
insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \
profile.o insn-attrtab.o $(out_object_file) getpwd.o $(EXTRA_OBJS) convert.o \
@ -670,7 +700,7 @@ CCCP=@cpp_main@
# Files to be copied away after each stage in building.
STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
insn-attr.h insn-attrtab.c insn-opinit.c genrtl.c genrtl.h tree-check.h \
insn-attr.h insn-attrtab.c insn-opinit.c tree-check.h \
s-flags s-config s-codes s-mlib s-under\
s-output s-recog s-emit s-extract s-peep s-check \
s-attr s-attrtab s-opinit s-crt s-crtS s-crt0 \
@ -822,7 +852,7 @@ start.encap: native xgcc$(exeext) specs $(LIBGCC1) xlimits.h lang.start.encap
rest.encap: stmp-headers $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap
# This is what is made with the host's compiler
# whether making a cross compiler or not.
native: config.status auto-host.h cpp$(exeext) $(LANGUAGES) \
native: config.status auto-host.h cpp$(exeext) intl.all $(LANGUAGES) \
$(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
# Define the names for selecting languages in LANGUAGES.
@ -857,8 +887,8 @@ stamp-objlist: $(OBJS)
# We call this executable `xgcc' rather than `gcc'
# to avoid confusion if the current directory is in the path
# and CC is `gcc'. It is renamed to `gcc' when it is installed.
xgcc$(exeext): gcc.o version.o choose-temp.o pexecute.o prefix.o version.o \
mkstemp.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
xgcc$(exeext): gcc.o version.o choose-temp.o intl.o pexecute.o prefix.o \
version.o mkstemp.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o prefix.o version.o \
choose-temp.o pexecute.o mkstemp.o $(EXTRA_GCC_OBJS) $(LIBS)
@ -1286,11 +1316,11 @@ $(srcdir)/c-gperf.h: c-parse.gperf
c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h flags.h \
output.h toplev.h
c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h \
output.h $(EXPR_H) $(RTL_H) toplev.h
intl.h output.h $(EXPR_H) $(RTL_H) toplev.h
c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h toplev.h \
output.h
c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h c-tree.h \
$(srcdir)/c-parse.h input.h flags.h $(srcdir)/c-gperf.h c-pragma.h \
$(srcdir)/c-parse.h input.h intl.h flags.h $(srcdir)/c-gperf.h c-pragma.h \
toplev.h output.h mbchar.h
c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h
c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h
@ -1305,12 +1335,15 @@ sbitmap.o: sbitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H)
collect2$(exeext): collect2.o tlink.o hash.o cplus-dem.o underscore.o \
version.o choose-temp.o mkstemp.o $(LIBDEPS)
COLLECT2_OBJS = collect2.o tlink.o hash.o choose-temp.o cplus-dem.o \
intl.o underscore.o version.o mkstemp.o
collect2 : $(COLLECT2_OBJS) $(LIBDEPS)
# Don't try modifying collect2 (aka ld) in place--it might be linking this.
-rm -f collect2$(exeext)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ collect2.o tlink.o hash.o \
cplus-dem.o underscore.o version.o choose-temp.o mkstemp.o $(LIBS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(COLLECT2_OBJS) $(LIBS)
collect2.o : collect2.c $(CONFIG_H) system.h gstab.h \
collect2.o : collect2.c $(CONFIG_H) system.h gstab.h intl.h \
$(srcdir)/../include/obstack.h $(DEMANGLE_H) collect2.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \
@ -1368,8 +1401,8 @@ DRIVER_DEFINES = \
-DDEFAULT_TARGET_VERSION=\"$(version)\" \
-DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
-DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\"
gcc.o: gcc.c $(CONFIG_H) system.h multilib.h Makefile prefix.h \
$(lang_specs_files)
gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \
Makefile $(lang_specs_files) prefix.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(DRIVER_DEFINES) \
-c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
@ -1380,12 +1413,13 @@ s-check : gencheck $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-check.h tree-check.h
touch s-check
gencheck : gencheck.o tree.def $(lang_tree_files) $(HOST_LIBDEPS)
gencheck : gencheck.o $(lang_tree_files) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
gencheck.o $(HOST_LIBS)
gencheck.o : gencheck.c hconfig.h system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencheck.c
gencheck.o : gencheck.c tree.def $(CONFIG_H) hconfig.h system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
$(srcdir)/gencheck.c
dumpvers: dumpvers.c
@ -1420,7 +1454,7 @@ fold-const.o : fold-const.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h \
$(RTL_H)
toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) \
flags.h input.h insn-attr.h xcoffout.h defaults.h output.h \
insn-codes.h insn-config.h $(RECOG_H) Makefile toplev.h dwarfout.h \
insn-codes.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h dwarfout.h \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \
$(lang_options_files)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \
@ -1477,7 +1511,7 @@ getpwd.o : getpwd.c $(CONFIG_H) system.h
integrate.o : integrate.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
integrate.h insn-flags.h insn-config.h $(EXPR_H) real.h $(REGS_H) \
function.h output.h $(RECOG_H) except.h toplev.h
intl.h function.h output.h $(RECOG_H) except.h toplev.h
jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h \
@ -1533,10 +1567,10 @@ regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
$(SCHED_PREFIX)sched.o : $(SCHED_PREFIX)sched.c $(CONFIG_H) system.h $(RTL_H) \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h \
insn-attr.h toplev.h recog.h
final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h $(REGS_H) \
$(RECOG_H) conditions.h insn-config.h insn-attr.h except.h real.h output.h \
hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h \
toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h dbxout.h
final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \
$(REGS_H) $(RECOG_H) conditions.h insn-config.h insn-attr.h except.h real.h \
output.h hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h \
defaults.h toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h dbxout.h
recog.o : recog.c $(CONFIG_H) system.h $(RTL_H) \
$(REGS_H) $(RECOG_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \
insn-flags.h insn-codes.h real.h toplev.h
@ -1867,6 +1901,50 @@ $(HOST_PREFIX_1)malloc.o: malloc.c
$(HOST_PREFIX_1):
touch $(HOST_PREFIX_1)
#
# Remake internationalization support.
intl.o: intl.c intl.h gansidecl.h Makefile
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DLOCALEDIR=\"$(localedir)\" \
-c `echo $(srcdir)/intl.c | sed 's,^\./,,'`
# This is needed to when doing a partial build after a `make clean'.
# libintl.a does not depend on intl.all,
# as that would force a lot of recompiling.
$(top_builddir)/intl/libintl.a:
@echo "$(MAKE) intl.all"
@$(MAKE) $(FLAGS_TO_PASS) intl.all
# Make sure all the headers are there for xgettext to scan.
# FIXME: extend the language interface
# so that we needn't jump into language build internals like this.
intl.all intl.install intl.distdir: \
$(srcdir)/c-gperf.h \
$(srcdir)/c-parse.c $(srcdir)/c-parse.h $(srcdir)/cexp.c \
$(srcdir)/cp/parse.c $(srcdir)/objc/objc-parse.c
$(srcdir)/cp/parse.c:
@cp_srcdir=`sed -n 's/^srcdir[ ]*=[ ]*//p' cp/Makefile` && \
echo "cd cp && $(MAKE) $$cp_srcdir/parse.c" && \
cd cp && \
$(MAKE) $(SUBDIR_FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) \
$$cp_srcdir/parse.c
intl.all intl.install intl.uninstall intl.distdir \
intl.mostlyclean intl.clean intl.distclean intl.maintainer-clean:
@for d in $(INTL_SUBDIRS); do \
target=`expr $@ : 'intl.\(.*\)'` && \
echo "(cd $$d && $(MAKE) $$target)" && \
(cd $$d && AWK='$(AWK)' $(MAKE) $(SUBDIR_FLAGS_TO_PASS) $$target); \
done
# intl.distdir doesn't copy the intl makefiles (since they aren't distributed),
# but we need them for the `make extraclean' in distdir-finish.
intl.distdir-fixup:
for d in $(INTL_SUBDIRS); do \
ln $$d/Makefile tmp/$$d || cp $$d/Makefile tmp/$$d || exit; \
done
#
# Remake cpp and protoize.
@ -1874,9 +1952,9 @@ $(HOST_PREFIX_1):
cpp$(exeext): $(CCCP)$(exeext)
-rm -f cpp$(exeext)
$(LN) $(CCCP)$(exeext) cpp$(exeext)
cccp$(exeext): cccp.o cexp.o version.o prefix.o mbchar.o @extra_cpp_objs@ $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cccp.o cexp.o prefix.o mbchar.o \
version.o @extra_cpp_objs@ $(LIBS)
CCCP_OBJS = cccp.o cexp.o intl.o prefix.o version.o @extra_cpp_objs@ mbchar.o
cccp$(exeext): $(CCCP_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(CCCP_OBJS) $(LIBS)
cexp.o: $(srcdir)/cexp.c $(CONFIG_H) system.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
$(srcdir)/cexp.c: $(srcdir)/cexp.y
@ -1884,8 +1962,8 @@ $(srcdir)/cexp.c: $(srcdir)/cexp.y
# We use $(libsubdir)/$(unlibsubdir) to match the
# -iprefix argument which gcc will pass if GCC_EXEC_PREFIX is used.
cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status system.h \
mbchar.h prefix.h Makefile
cccp.o: cccp.c $(CONFIG_H) intl.h pcp.h version.c config.status system.h \
mbchar.h prefix.h Makefile.in
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
@ -1895,7 +1973,7 @@ cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status system.h \
-c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
LIBCPP_OBJS = cpplib.o cpphash.o cppalloc.o cpperror.o cppexp.o cppfiles.o \
cppulp.o prefix.o version.o mbchar.o @extra_cpp_objs@
cppulp.o prefix.o version.o mbchar.o @extra_cpp_objs@ intl.o
# All the other archives built/used by this makefile are for targets. This
# one is strictly for the host.
@ -1911,10 +1989,10 @@ cppmain$(exeext): cppmain.o libcpp.a $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cppmain$(exeext) cppmain.o \
libcpp.a $(LIBS)
cppmain.o: cppmain.c $(CONFIG_H) cpplib.h machmode.h system.h
cppmain.o: cppmain.c $(CONFIG_H) cpplib.h intl.h machmode.h system.h
cpplib.o: cpplib.c $(CONFIG_H) cpplib.h machmode.h cpphash.h config.status \
system.h prefix.h Makefile
cpplib.o: cpplib.c $(CONFIG_H) cpplib.h machmode.h cpphash.h intl.h \
config.status system.h prefix.h Makefile
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
@ -1923,11 +2001,11 @@ cpplib.o: cpplib.c $(CONFIG_H) cpplib.h machmode.h cpphash.h config.status \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-c `echo $(srcdir)/cpplib.c | sed 's,^\./,,'`
cpperror.o: cpperror.c $(CONFIG_H) cpplib.h machmode.h system.h
cpperror.o: cpperror.c $(CONFIG_H) cpplib.h intl.h machmode.h system.h
cppulp.o: cppulp.c $(CONFIG_H) system.h output.h
cppexp.o: cppexp.c $(CONFIG_H) cpplib.h machmode.h system.h
cppexp.o: cppexp.c $(CONFIG_H) cpplib.h intl machmode.h system.h
cppfiles.o: cppfiles.c $(CONFIG_H) cpplib.h machmode.h system.h
@ -1940,17 +2018,14 @@ cppalloc.o: cppalloc.c $(CONFIG_H) cpplib.h machmode.h system.h
proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X
protoize$(exeext): protoize.o getopt.o getopt1.o getpwd.o version.o \
pexecute.o choose-temp.o mkstemp.o $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
protoize.o getopt.o getopt1.o getpwd.o version.o \
pexecute.o choose-temp.o mkstemp.o $(LIBS)
PROTO_OBJS = choose-temp.o getopt.o getopt1.o getpwd.o \
intl.o pexecute.o version.o mkstemp.o
unprotoize$(exeext): unprotoize.o getopt.o getopt1.o getpwd.o version.o \
pexecute.o choose-temp.o mkstemp.o $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
unprotoize.o getopt.o getopt1.o getpwd.o version.o \
pexecute.o choose-temp.o mkstemp.o $(LIBS)
protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS)
unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS)
protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) system.h \
Makefile
@ -2019,12 +2094,13 @@ test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
diff $(srcdir)/protoize.c tmp-proto.c | cat
-rm -f tmp-proto.[cs] tmp-proto$(objext)
gcov.o: gcov.c gcov-io.h system.h
gcov.o: gcov.c gcov-io.h intl.h system.h
# Only one of 'gcov' or 'gcov.exe' is actually built, depending
# upon whether $(exeext) is empty or not.
gcov$(exeext): gcov.o $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) gcov.o $(LIBS) -o $@
GCOV_OBJS = gcov.o intl.o
gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
#
# Build the include directory. The stamp files are stmp-* rather than
# s-* so that mostlyclean does not force the include directory to
@ -2127,9 +2203,11 @@ deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
touch deduced.h; \
fi
gen-protos: gen-protos.o scan.o cppalloc.o $(HOST_LIBDEPS)
GEN_PROTOS_OBJS = gen-protos.o cppalloc.o cpperror.o cppexp.o \
cpphash.o cpplib.o prefix.o scan.o version.o cppfiles.o cppulp.o
gen-protos: $(GEN_PROTOS_OBJS) $(HOST_LIBDEPS)
${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
gen-protos.o scan.o cppalloc.o $(HOST_LIBS)
$(GEN_PROTOS_OBJS) $(HOST_LIBS)
gen-protos.o: gen-protos.c scan.h $(build_xm_file) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c
@ -2233,7 +2311,7 @@ INSTALL: $(srcdir)/install1.texi $(srcdir)/install.texi
# (less duplicated code).
mostlyclean: lang.mostlyclean
mostlyclean: intl.mostlyclean lang.mostlyclean
-rm -f $(STAGESTUFF)
# Delete the temporary source copies for cross compilation.
-rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
@ -2271,7 +2349,7 @@ mostlyclean: lang.mostlyclean
# Delete all files made by compilation
# that don't exist in the distribution.
clean: mostlyclean lang.clean
clean: mostlyclean intl.clean lang.clean
# It may not be quite desirable to delete unprotoize.c here,
# but the spec for `make clean' requires it.
# Using unprotoize.c is not quite right in the first place,
@ -2296,7 +2374,8 @@ clean: mostlyclean lang.clean
# Delete all files that users would normally create
# while building and installing GCC.
distclean: clean lang.distclean
INTL_DISTCLEAN = intl.distclean
distclean: clean $(INTL_DISTCLEAN) lang.distclean
-rm -f tm.h config.h auto-host.h auto-build.h tconfig.h hconfig.h
-rm -f md cstamp-h
-rm -f config.status config.run config.cache config.bak
@ -2309,6 +2388,7 @@ distclean: clean lang.distclean
-rm -f float.h
-rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
-rm -f testsuite/{gcc,g++}.{log,sum}
-rm -f intl/libintl.h libintl.h
# Delete anything likely to be found in the source directory
# that shouldn't be in the distribution.
@ -2321,6 +2401,7 @@ extraclean: distclean lang.extraclean
-rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
-rm -f *lose config/*lose config/*/*lose
-rm -f *.s *.s[0-9] *.i config/ChangeLog
-rm -f y.tab.c yacc.*
-rm -f */=* */"#"* */*~*
-rm -f */patch* */*.orig */*.rej
-rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz
@ -2329,10 +2410,13 @@ extraclean: distclean lang.extraclean
# Get rid of every file that's generated from some other file, except for `configure'.
# Most of these files ARE PRESENT in the GCC distribution.
# We define INTL_DISTCLEAN to be empty in the submake, so that
# we don't descend into intl after its makefile has been removed.
maintainer-clean:
@echo 'This command is intended for maintainers to use; it'
@echo 'deletes files that may need special tools to rebuild.'
$(MAKE) distclean lang.maintainer-clean
$(MAKE) INTL_DISTCLEAN= distclean \
intl.maintainer-clean lang.maintainer-clean
-rm -f c-parse.y c-gperf.h
-rm -f c-parse.c c-parse.h c-parse.output
-rm -f cexp.c cexp.output TAGS
@ -2351,7 +2435,7 @@ install: $(INSTALL_TARGET) ; @true
# Install the driver last so that the window when things are
# broken is small.
install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
install-man install-info lang.install-normal install-driver
install-man install-info intl.install lang.install-normal install-driver
# Do nothing while making gcc with a cross-compiler. The person who
# makes gcc for the target machine has to know how to put a complete
@ -2592,7 +2676,7 @@ install-collect2: collect2 installdirs
$(INSTALL_PROGRAM) xgcc$(exeext) $(libsubdir)/gcc$(exeext)
# Cancel installation by deleting the installed files.
uninstall: lang.uninstall
uninstall: intl.uninstall lang.uninstall
-rm -rf $(libsubdir)
-rm -rf $(bindir)/$(GCC_INSTALL_NAME)$(exeext)
-rm -rf $(bindir)/$(GCC_CROSS_NAME)$(exeext)
@ -2741,12 +2825,17 @@ distdir-cvs: force
distdir-start: doc $(srcdir)/INSTALL $(srcdir)/c-parse.y $(srcdir)/c-gperf.h \
$(srcdir)/c-parse.c $(srcdir)/cexp.c $(srcdir)/config.in \
$(srcdir)/version.c TAGS
@case '$(USE_NLS)' in \
yes) ;; \
*) echo "configure with --enable-nls before making a distribution"; \
exit 1;; \
esac
@if grep -s "for version ${mainversion}" gcc.texi > /dev/null; \
then true; \
else echo "You must update the version number in \`gcc.texi'"; sleep 10;\
fi
# Update the version number in README
awk '$$1 " " $$2 " " $$3 == "This directory contains" \
$(AWK) '$$1 " " $$2 " " $$3 == "This directory contains" \
{ $$6 = version; print $$0 } \
$$1 " " $$2 " " $$3 != "This directory contains"' \
version=$(version) $(srcdir)/README > tmp.README
@ -2758,6 +2847,8 @@ distdir-start: doc $(srcdir)/INSTALL $(srcdir)/c-parse.y $(srcdir)/c-gperf.h \
mkdir tmp/config
mkdir tmp/ginclude
mkdir tmp/objc
mkdir tmp/intl
mkdir tmp/po
for file in `(cd $(srcdir) && echo *[0-9a-zA-Z+])`; do \
test -f $(srcdir)/$$file && $(LN_S) $(srcdir)/$$file tmp; \
done
@ -2791,9 +2882,21 @@ distdir-finish:
# Get rid of everything we don't want in the distribution. We'd want
# this to use Makefile.in, but it doesn't have the `lang.foo' targets
# expanded.
cd gcc-$(version); make extraclean VERSION_DEP=
cd gcc-$(version); make extraclean distdir-check VERSION_DEP=
distdir: distdir-cvs distdir-start lang.distdir distdir-finish
distdir-check:
($(AWK) '/^[^#]/{print} /^#[A-Za-z]/{print substr($$1, 2)}' | sort) \
< po/POTFILES.in > tmp.POTFILES
ls [A-Za-z]*.[ch] [a-z]*/[A-Za-z]*.[ch] \
[a-z]*/[a-z]*/[A-Za-z]*.[ch] | sort > tmp.src
diff tmp.POTFILES tmp.src || { \
echo "po/POTFILES.in and sources do not match -- please fix"; \
exit 1; \
}
rm -f tmp.*
distdir: distdir-cvs distdir-start intl.distdir intl.distdir-fixup \
lang.distdir distdir-finish
# make diff oldversion=M.N
# creates a diff file between an older distribution and this one.
@ -2848,7 +2951,7 @@ compare compare3 compare4 compare-lean compare3-lean compare4-lean: force
&& (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
done
case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
for dir in tmp-foo $(SUBDIRS); do \
for dir in tmp-foo intl $(SUBDIRS); do \
if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
for file in $$dir/*$(objext); do \
tail +16c ./$$file > tmp-foo1; \
@ -2881,7 +2984,7 @@ gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-
(cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
done
case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
for dir in tmp-foo $(SUBDIRS); do \
for dir in tmp-foo intl $(SUBDIRS); do \
if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
for file in $$dir/*$(objext); do \
(cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
@ -2902,11 +3005,12 @@ gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-
# Copy the object files from a particular stage into a subdirectory.
stage1-start:
-if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
-for dir in . $(SUBDIRS) ; \
-for dir in intl $(SUBDIRS) ; \
do \
if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \
done
-mv $(STAGESTUFF) stage1
-mv intl/*$(objext) stage1/intl
# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
# dir will work properly.
-if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage1 ; else true ; fi
@ -2923,11 +3027,12 @@ stage1: force stage1-start lang.stage1
stage2-start:
-if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
-for dir in . $(SUBDIRS) ; \
-for dir in intl $(SUBDIRS) ; \
do \
if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
done
-mv $(STAGESTUFF) stage2
-mv intl/*$(objext) stage2/intl
# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
# dir will work properly.
-if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage2 ; else true ; fi
@ -2944,11 +3049,12 @@ stage2: force stage2-start lang.stage2
stage3-start:
-if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
-for dir in . $(SUBDIRS) ; \
-for dir in intl $(SUBDIRS) ; \
do \
if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
done
-mv $(STAGESTUFF) stage3
-mv intl/*$(objext) stage3/intl
# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
# dir will work properly.
-if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage3 ; else true ; fi
@ -2965,11 +3071,12 @@ stage3: force stage3-start lang.stage3
stage4-start:
-if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
-for dir in . $(SUBDIRS) ; \
-for dir in intl $(SUBDIRS) ; \
do \
if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
done
-mv $(STAGESTUFF) stage4
-mv intl/*$(objext) stage4/intl
# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
# dir will work properly.
-if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage4 ; else true ; fi

View File

@ -7,6 +7,15 @@
/* Define if you want expensive run-time checks. */
#undef ENABLE_CHECKING
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
#undef HAVE_CATGETS
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Define if your cpp understands the stringify operator. */
#undef HAVE_CPP_STRINGIFY
@ -27,6 +36,12 @@
/* Define if you have a working <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Whether malloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_MALLOC
@ -93,4 +108,9 @@
/* Define to enable the use of a default linker. */
#undef DEFAULT_LINKER
/* Define to the name of the distribution. */
#undef PACKAGE
/* Define to the version of the distribution. */
#undef VERSION
@TOP@

401
gcc/aclocal.m4 vendored
View File

@ -235,3 +235,404 @@ AC_SUBST(INSTALL_PROGRAM)dnl
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
AC_SUBST(INSTALL_DATA)dnl
])
#serial 1
dnl This test replaces the one in autoconf.
dnl Currently this macro should have the same name as the autoconf macro
dnl because gettext's gettext.m4 (distributed in the automake package)
dnl still uses it. Otherwise, the use in gettext.m4 makes autoheader
dnl give these diagnostics:
dnl configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
dnl configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
undefine([AC_ISC_POSIX])
AC_DEFUN(AC_ISC_POSIX,
[
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
]
)
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 5
AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
USE_INCLUDED_LIBINTL=no
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS)
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If gettext or catgets are available (in this order) we
dnl use this. Else we have to fall back to GNU NLS library.
dnl catgets is only used if permitted by option --with-catgets.
nls_cv_header_intl=
nls_cv_header_libgt=
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl,
[AC_CHECK_LIB(intl, gettext,
gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)],
gt_cv_func_gettext_libintl=no)])
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
AC_CHECK_FUNCS(dcgettext)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[CATOBJEXT=.mo
DATADIRNAME=lib])
INSTOBJEXT=.mo
fi
fi
])
if test "$CATOBJEXT" = "NONE"; then
AC_MSG_CHECKING([whether catgets can be used])
AC_ARG_WITH(catgets,
[ --with-catgets use catgets functions if available],
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
AC_MSG_RESULT($nls_cv_use_catgets)
if test "$nls_cv_use_catgets" = "yes"; then
dnl No gettext in C library. Try catgets next.
AC_CHECK_LIB(i, main)
AC_CHECK_FUNC(catgets,
[AC_DEFINE(HAVE_CATGETS)
INTLOBJS="\$(CATOBJS)"
AC_PATH_PROG(GENCAT, gencat, no)dnl
if test "$GENCAT" != "no"; then
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
if test "$GMSGFMT" = "no"; then
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
fi
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.cat
INSTOBJEXT=.cat
DATADIRNAME=lib
INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi])
fi
fi
if test "$CATOBJEXT" = "NONE"; then
dnl Neither gettext nor catgets in included in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_SUBST(MSGFMT)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INSTOBJEXT=.mo
DATADIRNAME=share
INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
# We need to process the po/ directory.
POSUB=po
else
DATADIRNAME=share
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT_COMMANDS(
[case "$CONFIG_FILES" in *po/Makefile.in*)
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
esac])
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
if test "$PACKAGE" = gettext; then
USE_NLS=yes
USE_INCLUDED_LIBINTL=yes
fi
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.in.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(DATADIRNAME)
AC_SUBST(GMOFILES)
AC_SUBST(INSTOBJEXT)
AC_SUBST(INTLDEPS)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
])
AC_DEFUN(AM_GNU_GETTEXT,
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h sys/param.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
strdup __argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy)
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
AC_DEFINE(HAVE_STPCPY)
fi
AM_LC_MESSAGES
AM_WITH_NLS
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl The reference to <locale.h> in the installed <libintl.h> file
dnl must be resolved because we cannot expect the users of this
dnl to define HAVE_LOCALE_H.
if test $ac_cv_header_locale_h = yes; then
INCLUDE_LOCALE_H="#include <locale.h>"
else
INCLUDE_LOCALE_H="\
/* The system does not provide the header <locale.h>. Take care yourself. */"
fi
AC_SUBST(INCLUDE_LOCALE_H)
dnl Determine which catalog format we have (if any is needed)
dnl For now we know about two different formats:
dnl Linux libc-5 and the normal X/Open format
test -d intl || mkdir intl
if test "$CATOBJEXT" = ".cat"; then
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
dnl Transform the SED scripts while copying because some dumb SEDs
dnl cannot handle comments.
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
fi
dnl po2tbl.sed is always needed.
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
dnl In the intl/Makefile.in we have a special dependency which makes
dnl only sense for gettext. We comment this out for non-gettext
dnl packages.
if test "$PACKAGE" = "gettext"; then
GT_NO="#NO#"
GT_YES=
else
GT_NO=
GT_YES="#YES#"
fi
AC_SUBST(GT_NO)
AC_SUBST(GT_YES)
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl *** For now the libtool support in intl/Makefile is not for real.
l=
AC_SUBST(l)
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
else
posrcprefix="../"
fi
rm -f po/POTFILES
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
])
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
AC_DEFUN(AM_LC_MESSAGES,
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES)
fi
fi])
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])

View File

@ -81,6 +81,7 @@ typedef struct
char *file;
int needs_warning;
} if_elt;
static void tfaff PROTO((void));
static if_elt *if_stack;
@ -1327,7 +1328,11 @@ record_international_format (name, assembler_name, format_num)
info->format_num = format_num;
}
static char tfaff[] = "too few arguments for format";
static void
tfaff ()
{
warning ("too few arguments for format");
}
/* Check the argument list of a call to printf, scanf, etc.
NAME is the function identifier.
@ -1594,7 +1599,7 @@ check_format_info (info, params)
++format_chars;
if (params == 0)
{
warning (tfaff);
tfaff ();
return;
}
if (info->first_arg_num != 0)
@ -1637,7 +1642,7 @@ check_format_info (info, params)
++format_chars;
if (params == 0)
{
warning (tfaff);
tfaff ();
return;
}
cur_param = TREE_VALUE (params);
@ -1832,7 +1837,7 @@ check_format_info (info, params)
continue;
if (params == 0)
{
warning (tfaff);
tfaff ();
return;
}
cur_param = TREE_VALUE (params);
@ -1858,9 +1863,9 @@ check_format_info (info, params)
continue;
}
if (TREE_CODE (cur_type) != ERROR_MARK)
warning ("format argument is not a %s (arg %d)",
((fci->pointer_count + aflag == 1)
? "pointer" : "pointer to a pointer"),
warning ((fci->pointer_count + aflag == 1
? "format argument is not a pointer (arg %d)"
: "format argument is not a pointer to a pointer (arg %d)"),
arg_num);
break;
}

View File

@ -426,7 +426,7 @@ tree static_ctors, static_dtors;
static struct binding_level * make_binding_level PROTO((void));
static void clear_limbo_values PROTO((tree));
static int duplicate_decls PROTO((tree, tree, int));
static char *redeclaration_error_message PROTO((tree, tree));
static int redeclaration_error_message PROTO((tree, tree));
static void storedecls PROTO((tree));
static void storetags PROTO((tree));
static tree lookup_tag PROTO((enum tree_code, tree,
@ -1123,24 +1123,22 @@ poplevel (keep, reverse, functionbody)
if (TYPE_SIZE (TREE_VALUE (link)) == 0)
{
tree type = TREE_VALUE (link);
char *errmsg;
tree type_name = TYPE_NAME (type);
char *id = IDENTIFIER_POINTER (TREE_CODE (type_name) == IDENTIFIER_NODE
? type_name
: DECL_NAME (type_name));
switch (TREE_CODE (type))
{
case RECORD_TYPE:
errmsg = "`struct %s' incomplete in scope ending here";
error ("`struct %s' incomplete in scope ending here", id);
break;
case UNION_TYPE:
errmsg = "`union %s' incomplete in scope ending here";
error ("`union %s' incomplete in scope ending here", id);
break;
case ENUMERAL_TYPE:
errmsg = "`enum %s' incomplete in scope ending here";
error ("`enum %s' incomplete in scope ending here", id);
break;
}
if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
error (errmsg, IDENTIFIER_POINTER (TYPE_NAME (type)));
else
/* If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL. */
error (errmsg, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
}
#endif /* 0 */
@ -1520,7 +1518,7 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
&& DECL_INITIAL (newdecl) != 0);
tree oldtype = TREE_TYPE (olddecl);
tree newtype = TREE_TYPE (newdecl);
char *errmsg = 0;
int errmsg = 0;
if (TREE_CODE_CLASS (TREE_CODE (olddecl)) == 'd')
DECL_MACHINE_ATTRIBUTES (newdecl)
@ -1747,16 +1745,14 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
if (TREE_CHAIN (t) == 0
&& TYPE_MAIN_VARIANT (type) != void_type_node)
{
error ("A parameter list with an ellipsis can't match");
error ("an empty parameter name list declaration.");
error ("A parameter list with an ellipsis can't match an empty parameter name list declaration.");
break;
}
if (TYPE_MAIN_VARIANT (type) == float_type_node
|| C_PROMOTING_INTEGER_TYPE_P (type))
{
error ("An argument type that has a default promotion");
error ("can't match an empty parameter name list declaration.");
error ("An argument type that has a default promotion can't match an empty parameter name list declaration.");
break;
}
}
@ -1768,7 +1764,21 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
errmsg = redeclaration_error_message (newdecl, olddecl);
if (errmsg)
{
error_with_decl (newdecl, errmsg);
switch (errmsg)
{
case 1:
error_with_decl (newdecl, "redefinition of `%s'");
break;
case 2:
error_with_decl (newdecl, "redeclaration of `%s'");
break;
case 3:
error_with_decl (newdecl, "conflicting declarations of `%s'");
break;
default:
abort ();
}
error_with_decl (olddecl,
((DECL_INITIAL (olddecl)
&& current_binding_level == global_binding_level)
@ -1800,14 +1810,22 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
for (parm = TYPE_ACTUAL_ARG_TYPES (oldtype),
type = TYPE_ARG_TYPES (newtype),
nargs = 1;
(TYPE_MAIN_VARIANT (TREE_VALUE (parm)) != void_type_node
|| TYPE_MAIN_VARIANT (TREE_VALUE (type)) != void_type_node);
;
parm = TREE_CHAIN (parm), type = TREE_CHAIN (type), nargs++)
{
if (TYPE_MAIN_VARIANT (TREE_VALUE (parm)) == void_type_node
&& TYPE_MAIN_VARIANT (TREE_VALUE (type)) == void_type_node)
{
warning_with_decl (newdecl, "prototype for `%s' follows");
warning_with_decl (olddecl, "non-prototype definition here");
break;
}
if (TYPE_MAIN_VARIANT (TREE_VALUE (parm)) == void_type_node
|| TYPE_MAIN_VARIANT (TREE_VALUE (type)) == void_type_node)
{
errmsg = "prototype for `%s' follows and number of arguments";
error_with_decl (newdecl, "prototype for `%s' follows and number of arguments doesn't match");
error_with_decl (olddecl, "non-prototype definition here");
errmsg = 1;
break;
}
/* Type for passing arg must be consistent
@ -1819,21 +1837,14 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
&& TYPE_MAIN_VARIANT (TREE_VALUE (parm)) == integer_type_node
&& TYPE_MAIN_VARIANT (TREE_VALUE (type)) == unsigned_type_node)))
{
errmsg = "prototype for `%s' follows and argument %d";
error_with_decl (newdecl,
"prototype for `%s' follows and argument %d doesn't match",
nargs);
error_with_decl (olddecl, "non-prototype definition here");
errmsg = 1;
break;
}
}
if (errmsg)
{
error_with_decl (newdecl, errmsg, nargs);
error_with_decl (olddecl,
"doesn't match non-prototype definition here");
}
else
{
warning_with_decl (newdecl, "prototype for `%s' follows");
warning_with_decl (olddecl, "non-prototype definition here");
}
}
/* Warn about mismatches in various flags. */
else
@ -2531,7 +2542,7 @@ pushdecl (x)
/* No shadow warnings for vars made for inlining. */
&& ! DECL_FROM_INLINE (x))
{
char *warnstring = 0;
char *id = IDENTIFIER_POINTER (name);
if (TREE_CODE (x) == PARM_DECL
&& current_binding_level->level_chain->parm_flag)
@ -2542,15 +2553,12 @@ pushdecl (x)
but there is no way to tell it's not a definition. */
;
else if (oldlocal != 0 && TREE_CODE (oldlocal) == PARM_DECL)
warnstring = "declaration of `%s' shadows a parameter";
warning ("declaration of `%s' shadows a parameter", id);
else if (oldlocal != 0)
warnstring = "declaration of `%s' shadows previous local";
warning ("declaration of `%s' shadows previous local", id);
else if (IDENTIFIER_GLOBAL_VALUE (name) != 0
&& IDENTIFIER_GLOBAL_VALUE (name) != error_mark_node)
warnstring = "declaration of `%s' shadows global declaration";
if (warnstring)
warning (warnstring, IDENTIFIER_POINTER (name));
warning ("declaration of `%s' shadows global declaration", id);
}
/* If storing a local value, there may already be one (inherited).
@ -2661,10 +2669,10 @@ implicitly_declare (functionid)
/* Return zero if the declaration NEWDECL is valid
when the declaration OLDDECL (assumed to be for the same name)
has already been seen.
Otherwise return an error message format string with a %s
where the identifier should go. */
Otherwise return 1 if NEWDECL is a redefinition, 2 if it is a redeclaration,
and 3 if it is a conflicting declaration. */
static char *
static int
redeclaration_error_message (newdecl, olddecl)
tree newdecl, olddecl;
{
@ -2683,7 +2691,7 @@ redeclaration_error_message (newdecl, olddecl)
return 0;
if (DECL_IN_SYSTEM_HEADER (olddecl) || DECL_IN_SYSTEM_HEADER (newdecl))
return 0;
return "redefinition of `%s'";
return 1;
}
else if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
@ -2696,7 +2704,7 @@ redeclaration_error_message (newdecl, olddecl)
time in another way is ok. */
&& !(DECL_INLINE (olddecl) && DECL_EXTERNAL (olddecl)
&& !(DECL_INLINE (newdecl) && DECL_EXTERNAL (newdecl))))
return "redefinition of `%s'";
return 1;
return 0;
}
else if (current_binding_level == global_binding_level)
@ -2707,11 +2715,11 @@ redeclaration_error_message (newdecl, olddecl)
return 0;
/* Reject two definitions. */
if (DECL_INITIAL (olddecl) != 0 && DECL_INITIAL (newdecl) != 0)
return "redefinition of `%s'";
return 1;
/* Now we have two tentative defs, or one tentative and one real def. */
/* Insist that the linkage match. */
if (TREE_PUBLIC (olddecl) != TREE_PUBLIC (newdecl))
return "conflicting declarations of `%s'";
return 3;
return 0;
}
else if (current_binding_level->parm_flag
@ -2725,7 +2733,7 @@ redeclaration_error_message (newdecl, olddecl)
be an extern reference to olddecl. */
if (!(DECL_EXTERNAL (newdecl) && DECL_EXTERNAL (olddecl))
&& DECL_CONTEXT (newdecl) == DECL_CONTEXT (olddecl))
return "redeclaration of `%s'";
return 2;
return 0;
}
}
@ -5656,8 +5664,7 @@ parmlist_tags_warning ()
if (! already)
{
warning ("its scope is only this definition or declaration,");
warning ("which is probably not what you want.");
warning ("its scope is only this definition or declaration, which is probably not what you want.");
already = 1;
}
}
@ -5854,9 +5861,10 @@ finish_struct (t, fieldlist, attributes)
break;
if (x == 0)
pedwarn ("%s has no %smembers",
(TREE_CODE (t) == UNION_TYPE ? "union" : "structure"),
(fieldlist ? "named " : ""));
pedwarn ((fieldlist
? "%s has no named members"
: "%s has no members"),
TREE_CODE (t) == UNION_TYPE ? "union" : "struct");
}
/* Install struct as DECL_CONTEXT of each field decl.

View File

@ -539,10 +539,10 @@ prdecl (d)
fprintf (stderr, dname);
}
else
fprintf (stderr, "<<Not a Decl!!!>>");
fprintf (stderr, "<<?>>");
}
else
fprintf (stderr, "<<NULL!!>>");
fprintf (stderr, "<<0>>");
}
/* Print Iterator List -- names only */

View File

@ -22,6 +22,10 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include <setjmp.h>
#if HAVE_LIMITS_H
# include <limits.h>
#endif
#include "rtl.h"
#include "tree.h"
#include "input.h"
@ -32,6 +36,18 @@ Boston, MA 02111-1307, USA. */
#include "c-parse.h"
#include "c-pragma.h"
#include "toplev.h"
#include "intl.h"
#ifdef MAP_CHARACTER
#include <ctype.h>
#endif
/* MULTIBYTE_CHARS support only works for native compilers.
??? Ideally what we want is to model widechar support after
the current floating point support. */
#ifdef CROSS_COMPILE
#undef MULTIBYTE_CHARS
#endif
#ifdef MULTIBYTE_CHARS
#include "mbchar.h"
@ -221,6 +237,8 @@ finish_parse ()
void
init_lex ()
{
char *p;
/* Make identifier nodes long enough for the language-specific slots. */
set_identifier_size (sizeof (struct lang_identifier));
@ -1040,30 +1058,25 @@ readescape (ignore_ptr)
}
void
yyerror (string)
char *string;
yyerror (msgid)
char *msgid;
{
char buf[200];
strcpy (buf, string);
char *string = _(msgid);
/* We can't print string and character constants well
because the token_buffer contains the result of processing escapes. */
if (end_of_file)
strcat (buf, " at end of input");
error ("%s at end of input", string);
else if (token_buffer[0] == 0)
strcat (buf, " at null character");
error ("%s at null character", string);
else if (token_buffer[0] == '"')
strcat (buf, " before string constant");
error ("%s before string constant", string);
else if (token_buffer[0] == '\'')
strcat (buf, " before character constant");
error ("%s before character constant", string);
else if (token_buffer[0] < 040 || (unsigned char) token_buffer[0] >= 0177)
sprintf (buf + strlen (buf), " before character 0%o",
(unsigned char) token_buffer[0]);
error ("%s before character 0%o", string, (unsigned char) token_buffer[0]);
else
strcat (buf, " before `%s'");
error (buf, token_buffer);
error ("%s before `%s'", string, token_buffer);
}
#if 0
@ -1197,8 +1210,6 @@ yylex ()
while (ISALNUM (c) || c == '_' || c == '$' || c == '@')
{
/* Make sure this char really belongs in an identifier. */
if (c == '@' && ! doing_objc_thang)
break;
if (c == '$')
{
if (! dollars_in_ident)

View File

@ -1,5 +1,5 @@
/* Definitions for C parsing and type checking.
Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1987, 93, 94, 95, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@ -385,10 +385,8 @@ extern tree build_modify_expr PROTO((tree, enum tree_code,
tree));
extern tree initializer_constant_valid_p PROTO((tree, tree));
extern void store_init_value PROTO((tree, tree));
extern void error_init PROTO((char *, char *,
char *));
extern void pedwarn_init PROTO((char *, char *,
char *));
extern void error_init PROTO((char *));
extern void pedwarn_init PROTO((char *));
extern void start_init PROTO((tree, tree, int));
extern void finish_init PROTO((void));
extern void really_start_incremental_init PROTO((tree));

View File

@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#include "rtl.h"
#include "expr.h"
#include "toplev.h"
#include "intl.h"
/* Nonzero if we've already printed a "missing braces around initializer"
message within this initializer. */
@ -64,9 +65,7 @@ static void push_member_name PROTO((tree));
static void push_array_bounds PROTO((int));
static int spelling_length PROTO((void));
static char *print_spelling PROTO((char *));
static char *get_spelling PROTO((char *));
static void warning_init PROTO((char *, char *,
char *));
static void warning_init PROTO((char *));
static tree digest_init PROTO((tree, tree, int, int));
static void check_init_type_bitfields PROTO((tree));
static void output_init_element PROTO((tree, tree, tree, int));
@ -101,7 +100,7 @@ incomplete_type_error (value, type)
tree value;
tree type;
{
char *errmsg;
char *type_code_string;
/* Avoid duplicate error message. */
if (TREE_CODE (type) == ERROR_MARK)
@ -119,15 +118,15 @@ incomplete_type_error (value, type)
switch (TREE_CODE (type))
{
case RECORD_TYPE:
errmsg = "invalid use of undefined type `struct %s'";
type_code_string = "struct";
break;
case UNION_TYPE:
errmsg = "invalid use of undefined type `union %s'";
type_code_string = "union";
break;
case ENUMERAL_TYPE:
errmsg = "invalid use of undefined type `enum %s'";
type_code_string = "enum";
break;
case VOID_TYPE:
@ -148,7 +147,8 @@ incomplete_type_error (value, type)
}
if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
error (errmsg, IDENTIFIER_POINTER (TYPE_NAME (type)));
error ("invalid use of undefined type `%s %s'",
type_code_string, IDENTIFIER_POINTER (TYPE_NAME (type)));
else
/* If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL. */
error ("invalid use of incomplete typedef `%s'",
@ -2790,7 +2790,6 @@ build_unary_op (code, xarg, noconvert)
register tree arg = xarg;
register tree argtype = 0;
register enum tree_code typecode = TREE_CODE (TREE_TYPE (arg));
char *errstring = NULL;
tree val;
if (typecode == ERROR_MARK)
@ -2806,7 +2805,10 @@ build_unary_op (code, xarg, noconvert)
associativity, but won't generate any code. */
if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
|| typecode == COMPLEX_TYPE))
errstring = "wrong type argument to unary plus";
{
error ("wrong type argument to unary plus");
return error_mark_node;
}
else if (!noconvert)
arg = default_conversion (arg);
break;
@ -2814,7 +2816,10 @@ build_unary_op (code, xarg, noconvert)
case NEGATE_EXPR:
if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
|| typecode == COMPLEX_TYPE))
errstring = "wrong type argument to unary minus";
{
error ("wrong type argument to unary minus");
return error_mark_node;
}
else if (!noconvert)
arg = default_conversion (arg);
break;
@ -2827,7 +2832,10 @@ build_unary_op (code, xarg, noconvert)
arg = default_conversion (arg);
}
else if (typecode != INTEGER_TYPE)
errstring = "wrong type argument to bit-complement";
{
error ("wrong type argument to bit-complement");
return error_mark_node;
}
else if (!noconvert)
arg = default_conversion (arg);
break;
@ -2835,7 +2843,10 @@ build_unary_op (code, xarg, noconvert)
case ABS_EXPR:
if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
|| typecode == COMPLEX_TYPE))
errstring = "wrong type argument to abs";
{
error ("wrong type argument to abs");
return error_mark_node;
}
else if (!noconvert)
arg = default_conversion (arg);
break;
@ -2844,7 +2855,10 @@ build_unary_op (code, xarg, noconvert)
/* Conjugating a real value is a no-op, but allow it anyway. */
if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
|| typecode == COMPLEX_TYPE))
errstring = "wrong type argument to conjugation";
{
error ("wrong type argument to conjugation");
return error_mark_node;
}
else if (!noconvert)
arg = default_conversion (arg);
break;
@ -2856,8 +2870,8 @@ build_unary_op (code, xarg, noconvert)
/* These will convert to a pointer. */
&& typecode != ARRAY_TYPE && typecode != FUNCTION_TYPE)
{
errstring = "wrong type argument to unary exclamation mark";
break;
error ("wrong type argument to unary exclamation mark");
return error_mark_node;
}
arg = truthvalue_conversion (arg);
return invert_truthvalue (arg);
@ -2910,11 +2924,10 @@ build_unary_op (code, xarg, noconvert)
if (typecode != POINTER_TYPE
&& typecode != INTEGER_TYPE && typecode != REAL_TYPE)
{
if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
errstring ="wrong type argument to increment";
else
errstring ="wrong type argument to decrement";
break;
error (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR
? "wrong type argument to increment"
: "wrong type argument to decrement");
return error_mark_node;
}
{
@ -2931,17 +2944,15 @@ build_unary_op (code, xarg, noconvert)
/* If pointer target is an undefined struct,
we just cannot know how to do the arithmetic. */
if (TYPE_SIZE (TREE_TYPE (result_type)) == 0)
error ("%s of pointer to unknown structure",
((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
? "increment" : "decrement"));
error (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR
? "increment of pointer to unknown structure"
: "decrement of pointer to unknown structure");
else if ((pedantic || warn_pointer_arith)
&& (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE
|| TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE))
pedwarn ("wrong type argument to %s",
((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
? "increment" : "decrement"));
pedwarn (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR
? "wrong type argument to increment"
: "wrong type argument to decrement");
inc = c_size_in_bytes (TREE_TYPE (result_type));
}
else
@ -2998,7 +3009,8 @@ build_unary_op (code, xarg, noconvert)
/* Complain about anything else that is not a true lvalue. */
if (!lvalue_or_else (arg, ((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
? "increment" : "decrement")))
? "invalid lvalue in increment"
: "invalid lvalue in decrement")))
return error_mark_node;
/* Report a read-only lvalue. */
@ -3072,7 +3084,8 @@ build_unary_op (code, xarg, noconvert)
;
/* Anything not already handled and not a true memory reference
is an error. */
else if (typecode != FUNCTION_TYPE && !lvalue_or_else (arg, "unary `&'"))
else if (typecode != FUNCTION_TYPE
&& !lvalue_or_else (arg, "invalid lvalue in unary `&'"))
return error_mark_node;
/* Ordinary case; arg is a COMPONENT_REF or a decl. */
@ -3140,15 +3153,9 @@ build_unary_op (code, xarg, noconvert)
break;
}
if (!errstring)
{
if (argtype == 0)
argtype = TREE_TYPE (arg);
return fold (build1 (code, argtype, arg));
}
error (errstring);
return error_mark_node;
if (argtype == 0)
argtype = TREE_TYPE (arg);
return fold (build1 (code, argtype, arg));
}
#if 0
@ -3222,13 +3229,13 @@ lvalue_p (ref)
otherwise, print an error message and return zero. */
int
lvalue_or_else (ref, string)
lvalue_or_else (ref, msgid)
tree ref;
char *string;
char *msgid;
{
int win = lvalue_p (ref);
if (! win)
error ("invalid lvalue in %s", string);
error (msgid);
return win;
}
@ -3281,47 +3288,38 @@ pedantic_lvalue_warning (code)
enum tree_code code;
{
if (pedantic)
pedwarn ("ANSI C forbids use of %s expressions as lvalues",
code == COND_EXPR ? "conditional"
: code == COMPOUND_EXPR ? "compound" : "cast");
pedwarn (code == COND_EXPR
? "ANSI C forbids use of conditional expressions as lvalues"
: code == COMPOUND_EXPR
? "ANSI C forbids use of compound expressions as lvalues"
: "ANSI C forbids use of cast expressions as lvalues");
}
/* Warn about storing in something that is `const'. */
void
readonly_warning (arg, string)
readonly_warning (arg, msgid)
tree arg;
char *string;
char *msgid;
{
char buf[80];
strcpy (buf, string);
/* Forbid assignments to iterators. */
if (TREE_CODE (arg) == VAR_DECL && ITERATOR_P (arg))
{
strcat (buf, " of iterator `%s'");
pedwarn (buf, IDENTIFIER_POINTER (DECL_NAME (arg)));
}
pedwarn ("%s of iterator `%s'", _(msgid),
IDENTIFIER_POINTER (DECL_NAME (arg)));
if (TREE_CODE (arg) == COMPONENT_REF)
{
if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0))))
readonly_warning (TREE_OPERAND (arg, 0), string);
readonly_warning (TREE_OPERAND (arg, 0), msgid);
else
{
strcat (buf, " of read-only member `%s'");
pedwarn (buf, IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (arg, 1))));
}
pedwarn ("%s of read-only member `%s'", _(msgid),
IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (arg, 1))));
}
else if (TREE_CODE (arg) == VAR_DECL)
{
strcat (buf, " of read-only variable `%s'");
pedwarn (buf, IDENTIFIER_POINTER (DECL_NAME (arg)));
}
pedwarn ("%s of read-only variable `%s'", _(msgid),
IDENTIFIER_POINTER (DECL_NAME (arg)));
else
{
pedwarn ("%s of read-only location", buf);
}
pedwarn ("%s of read-only location", _(msgid));
}
/* Mark EXP saying that we need to be able to take the
@ -3963,7 +3961,7 @@ build_modify_expr (lhs, modifycode, rhs)
/* Now we have handled acceptable kinds of LHS that are not truly lvalues.
Reject anything strange now. */
if (!lvalue_or_else (lhs, "assignment"))
if (!lvalue_or_else (lhs, "invalid lvalue in assignment"))
return error_mark_node;
/* Warn about storing in something that is `const'. */
@ -3996,7 +3994,7 @@ build_modify_expr (lhs, modifycode, rhs)
/* Convert new value to destination type. */
newrhs = convert_for_assignment (lhstype, newrhs, "assignment",
newrhs = convert_for_assignment (lhstype, newrhs, _("assignment"),
NULL_TREE, NULL_TREE, 0);
if (TREE_CODE (newrhs) == ERROR_MARK)
return error_mark_node;
@ -4011,7 +4009,7 @@ build_modify_expr (lhs, modifycode, rhs)
if (olhstype == TREE_TYPE (result))
return result;
return convert_for_assignment (olhstype, result, "assignment",
return convert_for_assignment (olhstype, result, _("assignment"),
NULL_TREE, NULL_TREE, 0);
}
@ -4022,9 +4020,7 @@ build_modify_expr (lhs, modifycode, rhs)
for assignments that are not allowed in C.
ERRTYPE is a string to use in error messages:
"assignment", "return", etc. If it is null, this is parameter passing
for a function call (and different error messages are output). Otherwise,
it may be a name stored in the spelling stack and interpreted by
get_spelling.
for a function call (and different error messages are output).
FUNNAME is the name of the function being called,
as an IDENTIFIER_NODE, or null.
@ -4159,12 +4155,11 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
vice-versa. */
if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr))
warn_for_assignment ("%s makes qualified function pointer from unqualified",
get_spelling (errtype), funname,
parmnum);
errtype, funname, parmnum);
}
else if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl))
warn_for_assignment ("%s discards qualifiers from pointer target type",
get_spelling (errtype), funname,
errtype, funname,
parmnum);
}
@ -4200,7 +4195,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
&& (!integer_zerop (rhs) || TREE_CODE (rhs) == NOP_EXPR)
&& TREE_CODE (ttl) == FUNCTION_TYPE)))
warn_for_assignment ("ANSI forbids %s between function pointer and `void *'",
get_spelling (errtype), funname, parmnum);
errtype, funname, parmnum);
/* Const and volatile mean something different for function types,
so the usual warnings are not appropriate. */
else if (TREE_CODE (ttr) != FUNCTION_TYPE
@ -4208,7 +4203,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
{
if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl))
warn_for_assignment ("%s discards qualifiers from pointer target type",
get_spelling (errtype), funname, parmnum);
errtype, funname, parmnum);
/* If this is not a case of ignoring a mismatch in signedness,
no warning. */
else if (TYPE_MAIN_VARIANT (ttl) == void_type_node
@ -4218,7 +4213,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
/* If there is a mismatch, do warn. */
else if (pedantic)
warn_for_assignment ("pointer targets in %s differ in signedness",
get_spelling (errtype), funname, parmnum);
errtype, funname, parmnum);
}
else if (TREE_CODE (ttl) == FUNCTION_TYPE
&& TREE_CODE (ttr) == FUNCTION_TYPE)
@ -4229,12 +4224,12 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
where an ordinary one is wanted, but not vice-versa. */
if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr))
warn_for_assignment ("%s makes qualified function pointer from unqualified",
get_spelling (errtype), funname, parmnum);
errtype, funname, parmnum);
}
}
else
warn_for_assignment ("%s from incompatible pointer type",
get_spelling (errtype), funname, parmnum);
errtype, funname, parmnum);
return convert (type, rhs);
}
else if (codel == POINTER_TYPE && coder == INTEGER_TYPE)
@ -4250,7 +4245,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
&& integer_zerop (TREE_OPERAND (rhs, 0))))
{
warn_for_assignment ("%s makes pointer from integer without a cast",
get_spelling (errtype), funname, parmnum);
errtype, funname, parmnum);
return convert (type, rhs);
}
return null_pointer_node;
@ -4258,7 +4253,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
else if (codel == INTEGER_TYPE && coder == POINTER_TYPE)
{
warn_for_assignment ("%s makes integer from pointer without a cast",
get_spelling (errtype), funname, parmnum);
errtype, funname, parmnum);
return convert (type, rhs);
}
@ -4280,27 +4275,24 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
parmnum);
}
else
error ("incompatible types in %s", get_spelling (errtype));
error ("incompatible types in %s", errtype);
return error_mark_node;
}
/* Print a warning using MSG.
/* Print a warning using MSGID.
It gets OPNAME as its one parameter.
If OPNAME is null, it is replaced by "passing arg ARGNUM of `FUNCTION'".
FUNCTION and ARGNUM are handled specially if we are building an
Objective-C selector. */
static void
warn_for_assignment (msg, opname, function, argnum)
char *msg;
warn_for_assignment (msgid, opname, function, argnum)
char *msgid;
char *opname;
tree function;
int argnum;
{
static char argstring[] = "passing arg %d of `%s'";
static char argnofun[] = "passing arg %d";
if (opname == 0)
{
tree selector = maybe_building_objc_message_expr ();
@ -4313,18 +4305,20 @@ warn_for_assignment (msg, opname, function, argnum)
if (function)
{
/* Function name is known; supply it. */
char *argstring = _("passing arg %d of `%s'");
opname = (char *) alloca (IDENTIFIER_LENGTH (function)
+ sizeof (argstring) + 25 /*%d*/ + 1);
+ strlen (argstring) + 1 + 25 /*%d*/ + 1);
sprintf (opname, argstring, argnum, IDENTIFIER_POINTER (function));
}
else
{
/* Function name unknown (call through ptr); just give arg number. */
opname = (char *) alloca (sizeof (argnofun) + 25 /*%d*/ + 1);
char *argnofun = _("passing arg %d of pointer to function");
opname = (char *) alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
sprintf (opname, argnofun, argnum);
}
}
pedwarn (msg, opname);
pedwarn (msgid, opname);
}
/* Return nonzero if VALUE is a valid constant-valued expression
@ -4691,115 +4685,52 @@ print_spelling (buffer)
return buffer;
}
/* Provide a means to pass component names derived from the spelling stack. */
char initialization_message;
/* Interpret the spelling of the given ERRTYPE message. */
static char *
get_spelling (errtype)
char *errtype;
{
static char *buffer;
static int size = -1;
if (errtype == &initialization_message)
{
/* Avoid counting chars */
static char message[] = "initialization of `%s'";
register int needed = sizeof (message) + spelling_length () + 1;
char *temp;
if (size < 0)
buffer = (char *) xmalloc (size = needed);
if (needed > size)
buffer = (char *) xrealloc (buffer, size = needed);
temp = (char *) alloca (needed);
sprintf (buffer, message, print_spelling (temp));
return buffer;
}
return errtype;
}
/* Issue an error message for a bad initializer component.
FORMAT describes the message. OFWHAT is the name for the component.
LOCAL is a format string for formatting the insertion of the name
into the message.
If OFWHAT is null, the component name is stored on the spelling stack.
If the component name is a null string, then LOCAL is omitted entirely. */
MSGID identifies the message.
The component name is taken from the spelling stack. */
void
error_init (format, local, ofwhat)
char *format, *local, *ofwhat;
error_init (msgid)
char *msgid;
{
char *buffer;
if (ofwhat == 0)
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
buffer = (char *) alloca (strlen (local) + strlen (ofwhat) + 2);
char *ofwhat;
error (msgid);
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
sprintf (buffer, local, ofwhat);
else
buffer[0] = 0;
error (format, buffer);
error ("(near initialization for `%s')", ofwhat);
}
/* Issue a pedantic warning for a bad initializer component.
FORMAT describes the message. OFWHAT is the name for the component.
LOCAL is a format string for formatting the insertion of the name
into the message.
If OFWHAT is null, the component name is stored on the spelling stack.
If the component name is a null string, then LOCAL is omitted entirely. */
MSGID identifies the message.
The component name is taken from the spelling stack. */
void
pedwarn_init (format, local, ofwhat)
char *format, *local, *ofwhat;
pedwarn_init (msgid)
char *msgid;
{
char *buffer;
if (ofwhat == 0)
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
buffer = (char *) alloca (strlen (local) + strlen (ofwhat) + 2);
char *ofwhat;
pedwarn (msgid);
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
sprintf (buffer, local, ofwhat);
else
buffer[0] = 0;
pedwarn (format, buffer);
pedwarn ("(near initialization for `%s')", ofwhat);
}
/* Issue a warning for a bad initializer component.
FORMAT describes the message. OFWHAT is the name for the component.
LOCAL is a format string for formatting the insertion of the name
into the message.
If OFWHAT is null, the component name is stored on the spelling stack.
If the component name is a null string, then LOCAL is omitted entirely. */
MSGID identifies the message.
The component name is taken from the spelling stack. */
static void
warning_init (format, local, ofwhat)
char *format, *local, *ofwhat;
warning_init (msgid)
char *msgid;
{
char *buffer;
if (ofwhat == 0)
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
buffer = (char *) alloca (strlen (local) + strlen (ofwhat) + 2);
char *ofwhat;
warning (msgid);
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
sprintf (buffer, local, ofwhat);
else
buffer[0] = 0;
warning (format, buffer);
warning ("(near initialization for `%s')", ofwhat);
}
/* Digest the parser output INIT as an initializer for type TYPE.
@ -4847,16 +4778,14 @@ digest_init (type, init, require_constant, constructor_constant)
!= char_type_node)
&& TYPE_PRECISION (typ1) == TYPE_PRECISION (char_type_node))
{
error_init ("char-array%s initialized from wide string",
" `%s'", NULL);
error_init ("char-array initialized from wide string");
return error_mark_node;
}
if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (inside_init)))
== char_type_node)
&& TYPE_PRECISION (typ1) != TYPE_PRECISION (char_type_node))
{
error_init ("int-array%s initialized from non-wide string",
" `%s'", NULL);
error_init ("int-array initialized from non-wide string");
return error_mark_node;
}
@ -4873,9 +4802,7 @@ digest_init (type, init, require_constant, constructor_constant)
- (TYPE_PRECISION (typ1) != TYPE_PRECISION (char_type_node)
? TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT
: 1))
pedwarn_init (
"initializer-string for array of chars%s is too long",
" `%s'", NULL);
pedwarn_init ("initializer-string for array of chars is too long");
}
return inside_init;
}
@ -4902,8 +4829,7 @@ digest_init (type, init, require_constant, constructor_constant)
else if (code == ARRAY_TYPE && TREE_CODE (inside_init) != STRING_CST
&& TREE_CODE (inside_init) != CONSTRUCTOR)
{
error_init ("array%s initialized from non-constant array expression",
" `%s'", NULL);
error_init ("array initialized from non-constant array expression");
return error_mark_node;
}
@ -4920,25 +4846,21 @@ digest_init (type, init, require_constant, constructor_constant)
= valid_compound_expr_initializer (inside_init,
TREE_TYPE (inside_init));
if (inside_init == error_mark_node)
error_init ("initializer element%s is not constant",
" for `%s'", NULL);
error_init ("initializer element is not constant");
else
pedwarn_init ("initializer element%s is not constant",
" for `%s'", NULL);
pedwarn_init ("initializer element is not constant");
if (flag_pedantic_errors)
inside_init = error_mark_node;
}
else if (require_constant && ! TREE_CONSTANT (inside_init))
{
error_init ("initializer element%s is not constant",
" for `%s'", NULL);
error_init ("initializer element is not constant");
inside_init = error_mark_node;
}
else if (require_constant
&& initializer_constant_valid_p (inside_init, TREE_TYPE (inside_init)) == 0)
{
error_init ("initializer element%s is not computable at load time",
" for `%s'", NULL);
error_init ("initializer element is not computable at load time");
inside_init = error_mark_node;
}
@ -4954,20 +4876,18 @@ digest_init (type, init, require_constant, constructor_constant)
for arrays and functions. We must not call it in the
case where inside_init is a null pointer constant. */
inside_init
= convert_for_assignment (type, init, "initialization",
= convert_for_assignment (type, init, _("initialization"),
NULL_TREE, NULL_TREE, 0);
if (require_constant && ! TREE_CONSTANT (inside_init))
{
error_init ("initializer element%s is not constant",
" for `%s'", NULL);
error_init ("initializer element is not constant");
inside_init = error_mark_node;
}
else if (require_constant
&& initializer_constant_valid_p (inside_init, TREE_TYPE (inside_init)) == 0)
{
error_init ("initializer element%s is not computable at load time",
" for `%s'", NULL);
error_init ("initializer element is not computable at load time");
inside_init = error_mark_node;
}
@ -4978,8 +4898,7 @@ digest_init (type, init, require_constant, constructor_constant)
if (TYPE_SIZE (type) && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
{
error_init ("variable-sized object%s may not be initialized",
" `%s'", NULL);
error_init ("variable-sized object may not be initialized");
return error_mark_node;
}
@ -5005,7 +4924,7 @@ digest_init (type, init, require_constant, constructor_constant)
type = TREE_TYPE (TYPE_FIELDS (type));
else
{
error_init ("invalid initializer%s", " for `%s'", NULL);
error_init ("invalid initializer");
return error_mark_node;
}
}
@ -5021,7 +4940,7 @@ digest_init (type, init, require_constant, constructor_constant)
else
return error_mark_node;
}
error_init ("invalid initializer%s", " for `%s'", NULL);
error_init ("invalid initializer");
return error_mark_node;
}
@ -5498,8 +5417,7 @@ push_init_level (implicit)
if (constructor_type == 0)
{
error_init ("extra brace group at end of initializer%s",
" for `%s'", NULL);
error_init ("extra brace group at end of initializer");
constructor_fields = 0;
constructor_unfilled_fields = 0;
return;
@ -5511,7 +5429,7 @@ push_init_level (implicit)
if (implicit && warn_missing_braces && !missing_braces_mentioned)
{
missing_braces_mentioned = 1;
warning_init ("missing braces around initializer%s", " for `%s'", NULL);
warning_init ("missing braces around initializer");
}
if (TREE_CODE (constructor_type) == RECORD_TYPE
@ -5542,7 +5460,7 @@ push_init_level (implicit)
}
else
{
warning_init ("braces around scalar initializer%s", " for `%s'", NULL);
warning_init ("braces around scalar initializer");
constructor_fields = constructor_type;
constructor_unfilled_fields = constructor_type;
}
@ -5614,7 +5532,7 @@ pop_init_level (implicit)
&& constructor_unfilled_fields)
{
push_member_name (constructor_unfilled_fields);
warning_init ("missing initializer%s", " for `%s'", NULL);
warning_init ("missing initializer");
RESTORE_SPELLING_DEPTH (constructor_depth);
}
@ -5627,7 +5545,7 @@ pop_init_level (implicit)
&& (TREE_CODE (constructor_type) == ARRAY_TYPE
? integer_zerop (constructor_unfilled_index)
: constructor_unfilled_fields == TYPE_FIELDS (constructor_type)))
pedwarn_init ("empty braces in initializer%s", " for `%s'", NULL);
pedwarn_init ("empty braces in initializer");
#endif
/* Pad out the end of the structure. */
@ -5691,14 +5609,12 @@ pop_init_level (implicit)
the element, after verifying there is just one. */
if (constructor_elements == 0)
{
error_init ("empty scalar initializer%s",
" for `%s'", NULL);
error_init ("empty scalar initializer");
constructor = error_mark_node;
}
else if (TREE_CHAIN (constructor_elements) != 0)
{
error_init ("extra elements in scalar initializer%s",
" for `%s'", NULL);
error_init ("extra elements in scalar initializer");
constructor = TREE_VALUE (constructor_elements);
}
else
@ -5832,20 +5748,20 @@ set_init_index (first, last)
(last) = TREE_OPERAND (last, 0);
if (TREE_CODE (first) != INTEGER_CST)
error_init ("nonconstant array index in initializer%s", " for `%s'", NULL);
error_init ("nonconstant array index in initializer");
else if (last != 0 && TREE_CODE (last) != INTEGER_CST)
error_init ("nonconstant array index in initializer%s", " for `%s'", NULL);
error_init ("nonconstant array index in initializer");
else if (! constructor_unfilled_index)
error_init ("array index in non-array initializer%s", " for `%s'", NULL);
error_init ("array index in non-array initializer");
else if (tree_int_cst_lt (first, constructor_unfilled_index))
error_init ("duplicate array index in initializer%s", " for `%s'", NULL);
error_init ("duplicate array index in initializer");
else
{
TREE_INT_CST_LOW (constructor_index) = TREE_INT_CST_LOW (first);
TREE_INT_CST_HIGH (constructor_index) = TREE_INT_CST_HIGH (first);
if (last != 0 && tree_int_cst_lt (last, first))
error_init ("empty index range in initializer%s", " for `%s'", NULL);
error_init ("empty index range in initializer");
else
{
if (pedantic)
@ -6176,15 +6092,13 @@ output_init_element (value, type, field, pending)
if (require_constant_value && ! TREE_CONSTANT (value))
{
error_init ("initializer element%s is not constant",
" for `%s'", NULL);
error_init ("initializer element is not constant");
value = error_mark_node;
}
else if (require_constant_elements
&& initializer_constant_valid_p (value, TREE_TYPE (value)) == 0)
{
error_init ("initializer element%s is not computable at load time",
" for `%s'", NULL);
error_init ("initializer element is not computable at load time");
value = error_mark_node;
}
@ -6200,7 +6114,7 @@ output_init_element (value, type, field, pending)
{
if (pending_init_member (field))
{
error_init ("duplicate initializer%s", " for `%s'", NULL);
error_init ("duplicate initializer");
duplicate = 1;
}
}
@ -6553,8 +6467,7 @@ process_init_element (value)
if (constructor_stack->replacement_value != 0)
{
error_init ("excess elements in struct initializer%s",
" after `%s'", NULL_PTR);
error_init ("excess elements in struct initializer");
return;
}
@ -6589,8 +6502,7 @@ process_init_element (value)
if (constructor_fields == 0)
{
pedwarn_init ("excess elements in struct initializer%s",
" after `%s'", NULL_PTR);
pedwarn_init ("excess elements in struct initializer");
break;
}
@ -6654,8 +6566,7 @@ process_init_element (value)
if (constructor_fields == 0)
{
pedwarn_init ("excess elements in union initializer%s",
" after `%s'", NULL_PTR);
pedwarn_init ("excess elements in union initializer");
break;
}
@ -6729,8 +6640,7 @@ process_init_element (value)
if (constructor_max_index != 0
&& tree_int_cst_lt (constructor_max_index, constructor_index))
{
pedwarn_init ("excess elements in array initializer%s",
" after `%s'", NULL_PTR);
pedwarn_init ("excess elements in array initializer");
break;
}
@ -6741,8 +6651,7 @@ process_init_element (value)
&& tree_int_cst_lt (constructor_max_index,
constructor_range_end))
{
pedwarn_init ("excess elements in array initializer%s",
" after `%s'", NULL_PTR);
pedwarn_init ("excess elements in array initializer");
TREE_INT_CST_HIGH (constructor_range_end)
= TREE_INT_CST_HIGH (constructor_max_index);
TREE_INT_CST_LOW (constructor_range_end)
@ -6793,8 +6702,7 @@ process_init_element (value)
for a scalar variable. */
if (constructor_fields == 0)
{
pedwarn_init ("excess elements in scalar initializer%s",
" after `%s'", NULL_PTR);
pedwarn_init ("excess elements in scalar initializer");
break;
}
@ -6911,7 +6819,7 @@ c_expand_return (retval)
}
else
{
tree t = convert_for_assignment (valtype, retval, "return",
tree t = convert_for_assignment (valtype, retval, _("return"),
NULL_TREE, NULL_TREE, 0);
tree res = DECL_RESULT (current_function_decl);
tree inner;

View File

@ -1192,8 +1192,9 @@ expand_call (exp, target, ignore)
/* Operand 0 is a pointer-to-function; get the type of the function. */
funtype = TREE_TYPE (TREE_OPERAND (exp, 0));
if (TREE_CODE (funtype) != POINTER_TYPE)
if (! POINTER_TYPE_P (funtype))
abort ();
funtype = TREE_TYPE (funtype);
/* Push the temporary stack slot level so that we can free any temporaries
@ -2393,7 +2394,7 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
#ifdef MAYBE_REG_PARM_STACK_SPACE
reg_parm_stack_space = MAYBE_REG_PARM_STACK_SPACE;
#else
reg_parm_stack_space = REG_PARM_STACK_SPACE (fndecl);
reg_parm_stack_space = REG_PARM_STACK_SPACE ((tree) 0);
#endif
#endif
@ -2891,7 +2892,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
#ifdef MAYBE_REG_PARM_STACK_SPACE
reg_parm_stack_space = MAYBE_REG_PARM_STACK_SPACE;
#else
reg_parm_stack_space = REG_PARM_STACK_SPACE (fndecl);
reg_parm_stack_space = REG_PARM_STACK_SPACE ((tree) 0);
#endif
#endif

View File

@ -20,13 +20,6 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#define PRINTF_PROTO(ARGS, m, n) PVPROTO (ARGS) ATTRIBUTE_PRINTF(m, n)
#define PRINTF_PROTO_1(ARGS) PRINTF_PROTO(ARGS, 1, 2)
#define PRINTF_PROTO_2(ARGS) PRINTF_PROTO(ARGS, 2, 3)
#define PRINTF_PROTO_3(ARGS) PRINTF_PROTO(ARGS, 3, 4)
#define PRINTF_PROTO_4(ARGS) PRINTF_PROTO(ARGS, 4, 5)
#include "system.h"
#include <signal.h>
@ -37,6 +30,7 @@ Boston, MA 02111-1307, USA. */
typedef unsigned char U_CHAR;
#include "pcp.h"
#include "intl.h"
#include "prefix.h"
#ifdef MULTIBYTE_CHARS
@ -851,8 +845,6 @@ U_CHAR is_idstart[256];
static U_CHAR is_hor_space[256];
/* table to tell if c is horizontal or vertical space. */
U_CHAR is_space[256];
/* names of some characters */
static char *char_name[256];
#define SKIP_WHITE_SPACE(p) do { while (is_hor_space[*p]) p++; } while (0)
#define SKIP_ALL_WHITE_SPACE(p) do { while (is_space[*p]) p++; } while (0)
@ -949,7 +941,7 @@ static void pass_thru_directive PROTO((U_CHAR *, U_CHAR *, FILE_BUF *, struct di
static MACRODEF create_definition PROTO((U_CHAR *, U_CHAR *, FILE_BUF *));
static int check_macro_name PROTO((U_CHAR *, char *));
static int check_macro_name PROTO((U_CHAR *, int));
static int compare_defs PROTO((DEFINITION *, DEFINITION *));
static int comp_def_part PROTO((int, U_CHAR *, int, U_CHAR *, int, int));
@ -984,7 +976,7 @@ static void output_line_directive PROTO((FILE_BUF *, FILE_BUF *, int, enum file_
static void macroexpand PROTO((HASHNODE *, FILE_BUF *));
struct argdata;
static char *macarg PROTO((struct argdata *, int));
static int macarg PROTO((struct argdata *, int));
static U_CHAR *macarg1 PROTO((U_CHAR *, U_CHAR *, struct hashnode *, int *, int *, int *, int));
@ -993,18 +985,21 @@ static int discard_comments PROTO((U_CHAR *, int, int));
static int change_newlines PROTO((U_CHAR *, int));
static char *my_strerror PROTO((int));
void error PRINTF_PROTO_1((char *, ...));
static void verror PROTO((char *, va_list));
static void notice VPROTO((char *, ...));
static void vnotice PROTO((char *, va_list));
void error VPROTO((char *, ...));
void verror PROTO((char *, va_list));
static void error_from_errno PROTO((char *));
void warning PRINTF_PROTO_1((char *, ...));
void warning VPROTO((char *, ...));
static void vwarning PROTO((char *, va_list));
static void error_with_line PRINTF_PROTO_2((int, char *, ...));
static void error_with_line VPROTO((int, char *, ...));
static void verror_with_line PROTO((int, char *, va_list));
static void vwarning_with_line PROTO((int, char *, va_list));
static void warning_with_line PRINTF_PROTO_2((int, char *, ...));
void pedwarn PRINTF_PROTO_1((char *, ...));
void pedwarn_with_line PRINTF_PROTO_2((int, char *, ...));
static void pedwarn_with_file_and_line PRINTF_PROTO_4((char *, size_t, int, char *, ...));
static void warning_with_line VPROTO((int, char *, ...));
void pedwarn VPROTO((char *, ...));
void pedwarn_with_line VPROTO((int, char *, ...));
static void pedwarn_with_file_and_line VPROTO((char *, size_t, int, char *, ...));
static void pedwarn_strange_white_space PROTO((int));
static void print_containing_files PROTO((void));
@ -1035,7 +1030,7 @@ static void append_include_chain PROTO((struct file_name_list *, struct file_nam
static int quote_string_for_make PROTO((char *, char *));
static void deps_output PROTO((char *, int));
static void fatal PRINTF_PROTO_1((char *, ...)) __attribute__ ((noreturn));
static void fatal VPROTO((char *, ...)) __attribute__ ((noreturn));
void fancy_abort PROTO((void)) __attribute__ ((noreturn));
static void perror_with_name PROTO((char *));
static void pfatal_with_name PROTO((char *)) __attribute__ ((noreturn));
@ -1222,16 +1217,17 @@ main (argc, argv)
char *cp;
int f, i;
FILE_BUF *fp;
char **pend_files = (char **) xmalloc (argc * sizeof (char *));
char **pend_defs = (char **) xmalloc (argc * sizeof (char *));
char **pend_undefs = (char **) xmalloc (argc * sizeof (char *));
char **pend_assertions = (char **) xmalloc (argc * sizeof (char *));
char **pend_includes = (char **) xmalloc (argc * sizeof (char *));
char **pend_files;
char **pend_defs;
char **pend_undefs;
char **pend_assertions;
char **pend_includes;
/* Record the option used with each element of pend_assertions.
This is preparation for supporting more than one option for making
an assertion. */
char **pend_assertion_options = (char **) xmalloc (argc * sizeof (char *));
char **pend_assertion_options;
int inhibit_predefs = 0;
int no_standard_includes = 0;
int no_standard_cplusplus_includes = 0;
@ -1269,6 +1265,10 @@ main (argc, argv)
signal (SIGPIPE, pipe_closed);
#endif
setlocale (LC_MESSAGES, "");
bindtextdomain (PACKAGE, localedir);
textdomain (PACKAGE);
progname = base_name (argv[0]);
#ifdef VMS
@ -1287,6 +1287,16 @@ main (argc, argv)
}
#endif
/* Do not invoke xmalloc before this point, since locale and
progname need to be set first, in case a diagnostic is issued. */
pend_files = (char **) xmalloc (argc * sizeof (char *));
pend_defs = (char **) xmalloc (argc * sizeof (char *));
pend_undefs = (char **) xmalloc (argc * sizeof (char *));
pend_assertions = (char **) xmalloc (argc * sizeof (char *));
pend_includes = (char **) xmalloc (argc * sizeof (char *));
pend_assertion_options = (char **) xmalloc (argc * sizeof (char *));
in_fname = NULL;
out_fname = NULL;
@ -1627,7 +1637,7 @@ main (argc, argv)
break;
case 'v':
fprintf (stderr, "GNU CPP version %s", version_string);
notice ("GNU CPP version %s", version_string);
#ifdef TARGET_VERSION
TARGET_VERSION;
#endif
@ -2054,10 +2064,10 @@ main (argc, argv)
/* With -v, print the list of dirs to search. */
if (verbose) {
struct file_name_list *p;
fprintf (stderr, "#include \"...\" search starts here:\n");
notice ("#include \"...\" search starts here:\n");
for (p = include; p; p = p->next) {
if (p == first_bracket_include)
fprintf (stderr, "#include <...> search starts here:\n");
notice ("#include <...> search starts here:\n");
if (!p->fname[0])
fprintf (stderr, " .\n");
else if (!strcmp (p->fname, "/") || !strcmp (p->fname, "//"))
@ -2066,7 +2076,7 @@ main (argc, argv)
/* Omit trailing '/'. */
fprintf (stderr, " %.*s\n", (int) strlen (p->fname) - 1, p->fname);
}
fprintf (stderr, "End of search list.\n");
notice ("End of search list.\n");
}
/* -MG doesn't select the form of output and must be specified with one of
@ -3810,7 +3820,7 @@ handle_directive (ip, op)
while (1) {
if (is_hor_space[*bp]) {
if (*bp != ' ' && *bp != '\t' && pedantic)
pedwarn ("%s in preprocessing directive", char_name[*bp]);
pedwarn_strange_white_space (*bp);
bp++;
} else if (*bp == '/') {
if (bp[1] == '\\' && bp[2] == '\n')
@ -4013,7 +4023,7 @@ handle_directive (ip, op)
case '\r':
case '\v':
if (pedantic)
pedwarn ("%s in preprocessing directive", char_name[c]);
pedwarn_strange_white_space (c);
break;
case '\n':
@ -4033,7 +4043,8 @@ handle_directive (ip, op)
/* If a directive should be copied through, and -C was given,
pass it through before removing comments. */
if (!no_output && put_out_comments
&& (kt->type == T_DEFINE ? dump_macros == dump_definitions
&& ((kt->type == T_DEFINE || kt->type == T_UNDEF)
? dump_macros == dump_definitions
: IS_INCLUDE_DIRECTIVE_TYPE (kt->type) ? dump_includes
: kt->type == T_PRAGMA)) {
int len;
@ -4454,16 +4465,18 @@ do_include (buf, limit, op, keyword)
&& !instack[indepth].system_header_p && !import_warning) {
import_warning = 1;
warning ("using `#import' is not recommended");
fprintf (stderr, "The fact that a certain header file need not be processed more than once\n");
fprintf (stderr, "should be indicated in the header file, not where it is used.\n");
fprintf (stderr, "The best way to do this is with a conditional of this form:\n\n");
fprintf (stderr, " #ifndef _FOO_H_INCLUDED\n");
fprintf (stderr, " #define _FOO_H_INCLUDED\n");
fprintf (stderr, " ... <real contents of file> ...\n");
fprintf (stderr, " #endif /* Not _FOO_H_INCLUDED */\n\n");
fprintf (stderr, "Then users can use `#include' any number of times.\n");
fprintf (stderr, "GNU C automatically avoids processing the file more than once\n");
fprintf (stderr, "when it is equipped with such a conditional.\n");
notice ("The fact that a certain header file need not be processed more than once\n\
should be indicated in the header file, not where it is used.\n\
The best way to do this is with a conditional of this form:\n\
\n\
#ifndef _FOO_H_INCLUDED\n\
#define _FOO_H_INCLUDED\n\
... <real contents of file> ...\n\
#endif /* Not _FOO_H_INCLUDED */\n\
\n\
Then users can use `#include' any number of times.\n\
GNU C automatically avoids processing the file more than once\n\
when it is equipped with such a conditional.\n");
}
get_filename:
@ -5794,7 +5807,7 @@ create_definition (buf, limit, op)
bp++;
symname = bp; /* remember where it starts */
sym_length = check_macro_name (bp, "macro");
sym_length = check_macro_name (bp, 0);
bp += sym_length;
/* Lossage will occur if identifiers or control keywords are broken
@ -6045,12 +6058,12 @@ nope:
}
/* Check a purported macro name SYMNAME, and yield its length.
USAGE is the kind of name this is intended for. */
ASSERTION is nonzero if this is really for an assertion name. */
static int
check_macro_name (symname, usage)
check_macro_name (symname, assertion)
U_CHAR *symname;
char *usage;
int assertion;
{
U_CHAR *p;
int sym_length;
@ -6060,10 +6073,13 @@ check_macro_name (symname, usage)
sym_length = p - symname;
if (sym_length == 0
|| (sym_length == 1 && *symname == 'L' && (*p == '\'' || *p == '"')))
error ("invalid %s name", usage);
error (assertion ? "invalid assertion name" : "invalid macro name");
else if (!is_idstart[*symname]
|| (sym_length == 7 && ! bcmp (symname, "defined", 7)))
error ("invalid %s name `%.*s'", usage, sym_length, symname);
error ((assertion
? "invalid assertion name `%.*s'"
: "invalid macro name `%.*s'"),
sym_length, symname);
return sym_length;
}
@ -6489,7 +6505,7 @@ do_assert (buf, limit, op, keyword)
bp++;
symname = bp; /* remember where it starts */
sym_length = check_macro_name (bp, "assertion");
sym_length = check_macro_name (bp, 1);
bp += sym_length;
/* #define doesn't do this, but we should. */
SKIP_WHITE_SPACE (bp);
@ -6568,7 +6584,7 @@ do_unassert (buf, limit, op, keyword)
bp++;
symname = bp; /* remember where it starts */
sym_length = check_macro_name (bp, "assertion");
sym_length = check_macro_name (bp, 1);
bp += sym_length;
/* #define doesn't do this, but we should. */
SKIP_WHITE_SPACE (bp);
@ -7043,7 +7059,7 @@ do_undef (buf, limit, op, keyword)
pass_thru_directive (buf, limit, op, keyword);
SKIP_WHITE_SPACE (buf);
sym_length = check_macro_name (buf, "macro");
sym_length = check_macro_name (buf, 0);
while ((hp = lookup (buf, sym_length, -1)) != NULL) {
/* If we are generating additional info for debugging (with -g) we
@ -8441,7 +8457,7 @@ macroexpand (hp, op)
if (nargs >= 0) {
register int i;
struct argdata *args;
char *parse_error = 0;
int parse_error = 0;
args = (struct argdata *) alloca ((nargs + 1) * sizeof (struct argdata));
@ -8475,7 +8491,8 @@ macroexpand (hp, op)
else
parse_error = macarg (NULL_PTR, 0);
if (parse_error) {
error_with_line (line_for_error (start_line), parse_error);
error_with_line (line_for_error (start_line),
"unterminated macro call");
break;
}
i++;
@ -8820,7 +8837,7 @@ macroexpand (hp, op)
REST_ARGS is passed to macarg1 to make it absorb the rest of the args.
Return nonzero to indicate a syntax error. */
static char *
static int
macarg (argptr, rest_args)
register struct argdata *argptr;
int rest_args;
@ -8829,7 +8846,7 @@ macarg (argptr, rest_args)
int paren = 0;
int newlines = 0;
int comments = 0;
char *result = 0;
int result = 0;
/* Try to parse as much of the argument as exists at this
input stack level. */
@ -8862,7 +8879,7 @@ macarg (argptr, rest_args)
while (bp == ip->buf + ip->length) {
if (instack[indepth].macro == 0) {
result = "unterminated macro call";
result = 1;
break;
}
ip->macro->type = T_MACRO;
@ -9344,34 +9361,62 @@ my_strerror (errnum)
#endif
if (!result)
result = "undocumented I/O error";
result = "errno = ?";
return result;
}
/* notice - output message to stderr */
static void
notice VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msgid;
#endif
va_list args;
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msgid = va_arg (args, char *);
#endif
vnotice (msgid, args);
va_end (args);
}
static void
vnotice (msgid, args)
char *msgid;
va_list args;
{
vfprintf (stderr, _(msgid), args);
}
/* error - print error message and increment count of errors. */
void
error VPROTO ((char * msg, ...))
error VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
verror (msg, args);
verror (msgid, args);
va_end (args);
}
static void
verror (msg, args)
char *msg;
void
verror (msgid, args)
char *msgid;
va_list args;
{
int i;
@ -9389,7 +9434,7 @@ verror (msg, args)
eprint_string (ip->nominal_fname, ip->nominal_fname_len);
fprintf (stderr, ":%d: ", ip->lineno);
}
vfprintf (stderr, msg, args);
vnotice (msgid, args);
fprintf (stderr, "\n");
errors++;
}
@ -9425,26 +9470,26 @@ error_from_errno (name)
/* Print error message but don't count it. */
void
warning VPROTO ((char * msg, ...))
warning VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
vwarning (msg, args);
vwarning (msgid, args);
va_end (args);
}
static void
vwarning (msg, args)
char *msg;
vwarning (msgid, args)
char *msgid;
va_list args;
{
int i;
@ -9468,35 +9513,36 @@ vwarning (msg, args)
eprint_string (ip->nominal_fname, ip->nominal_fname_len);
fprintf (stderr, ":%d: ", ip->lineno);
}
fprintf (stderr, "warning: ");
vfprintf (stderr, msg, args);
notice ("warning: ");
vnotice (msgid, args);
fprintf (stderr, "\n");
}
static void
error_with_line VPROTO ((int line, char * msg, ...))
error_with_line VPROTO ((int line, char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
int line;
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
line = va_arg (args, int);
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
verror_with_line (line, msg, args);
verror_with_line (line, msgid, args);
va_end (args);
}
static void
verror_with_line (line, msg, args)
verror_with_line (line, msgid, args)
int line;
char *msg;
char *msgid;
va_list args;
{
int i;
@ -9514,35 +9560,35 @@ verror_with_line (line, msg, args)
eprint_string (ip->nominal_fname, ip->nominal_fname_len);
fprintf (stderr, ":%d: ", line);
}
vfprintf (stderr, msg, args);
vnotice (msgid, args);
fprintf (stderr, "\n");
errors++;
}
static void
warning_with_line VPROTO ((int line, char * msg, ...))
warning_with_line VPROTO ((int line, char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
int line;
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
line = va_arg (args, int);
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
vwarning_with_line (line, msg, args);
vwarning_with_line (line, msgid, args);
va_end (args);
}
static void
vwarning_with_line (line, msg, args)
vwarning_with_line (line, msgid, args)
int line;
char *msg;
char *msgid;
va_list args;
{
int i;
@ -9566,54 +9612,54 @@ vwarning_with_line (line, msg, args)
eprint_string (ip->nominal_fname, ip->nominal_fname_len);
fprintf (stderr, line ? ":%d: " : ": ", line);
}
fprintf (stderr, "warning: ");
vfprintf (stderr, msg, args);
notice ("warning: ");
vnotice (msgid, args);
fprintf (stderr, "\n");
}
/* Print an error message and maybe count it. */
void
pedwarn VPROTO ((char * msg, ...))
pedwarn VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
if (pedantic_errors)
verror (msg, args);
verror (msgid, args);
else
vwarning (msg, args);
vwarning (msgid, args);
va_end (args);
}
void
pedwarn_with_line VPROTO ((int line, char * msg, ...))
pedwarn_with_line VPROTO ((int line, char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
int line;
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
line = va_arg (args, int);
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
if (pedantic_errors)
verror_with_line (line, msg, args);
verror_with_line (line, msgid, args);
else
vwarning_with_line (line, msg, args);
vwarning_with_line (line, msgid, args);
va_end (args);
}
@ -9622,7 +9668,7 @@ pedwarn_with_line VPROTO ((int line, char * msg, ...))
static void
pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line,
char * msg, ...))
char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char *file;
@ -9635,13 +9681,13 @@ pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line,
if (!pedantic_errors && inhibit_warnings)
return;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
file = va_arg (args, char *);
file_len = va_arg (args, size_t);
line = va_arg (args, int);
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
if (file) {
@ -9651,12 +9697,24 @@ pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line,
if (pedantic_errors)
errors++;
if (!pedantic_errors)
fprintf (stderr, "warning: ");
vfprintf (stderr, msg, args);
notice ("warning: ");
vnotice (msgid, args);
va_end (args);
fprintf (stderr, "\n");
}
static void
pedwarn_strange_white_space (ch)
int ch;
{
switch (ch)
{
case '\f': pedwarn ("formfeed in preprocessing directive"); break;
case '\r': pedwarn ("carriage return in preprocessing directive"); break;
case '\v': pedwarn ("vertical tab in preprocessing directive"); break;
default: abort ();
}
}
/* Print the file names and line numbers of the #include
directives which led to the current file. */
@ -9689,12 +9747,11 @@ print_containing_files ()
ip = &instack[i];
if (first) {
first = 0;
fprintf (stderr, "In file included");
notice ( "In file included from ");
} else {
fprintf (stderr, ",\n ");
notice (",\n from ");
}
fprintf (stderr, " from ");
eprint_string (ip->nominal_fname, ip->nominal_fname_len);
fprintf (stderr, ":%d", ip->lineno);
}
@ -10132,10 +10189,6 @@ initialize_char_syntax ()
is_space['\f'] = 1;
is_space['\n'] = 1;
is_space['\r'] = 1;
char_name['\v'] = "vertical tab";
char_name['\f'] = "formfeed";
char_name['\r'] = "carriage return";
}
/* Initialize the built-in macros. */
@ -10663,21 +10716,20 @@ deps_output (string, spacer)
}
static void
fatal VPROTO ((char * msg, ...))
fatal VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msg;
char * msgid;
#endif
va_list args;
fprintf (stderr, "%s: ", progname);
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
vfprintf (stderr, msg, args);
vnotice (msgid, args);
va_end (args);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);

View File

@ -23,10 +23,6 @@
#include "config.h"
#define PRINTF_PROTO(ARGS, m, n) PVPROTO (ARGS) ATTRIBUTE_PRINTF(m, n)
#define PRINTF_PROTO_1(ARGS) PRINTF_PROTO(ARGS, 1, 2)
#include "system.h"
#include <setjmp.h>
/* #define YYDEBUG 1 */
@ -82,7 +78,7 @@ struct arglist {
HOST_WIDE_INT parse_c_expression PROTO((char *, int));
static int yylex PROTO((void));
static void yyerror PROTO((char *)) __attribute__ ((noreturn));
static void yyerror PRINTF_PROTO_1((char *, ...)) __attribute__ ((noreturn));
static HOST_WIDE_INT expression_value;
#ifdef TEST_EXP_READER
static int expression_signedp;
@ -180,7 +176,7 @@ static void integer_overflow PROTO((void));
#define SIGNED (~0)
#define UNSIGNED 0
#line 188 "cexp.y"
#line 184 "cexp.y"
typedef union {
struct constant {HOST_WIDE_INT value; int signedp;} integer;
struct name {U_CHAR *address; int length;} name;
@ -261,10 +257,10 @@ static const short yyrhs[] = { 35,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
218, 228, 229, 236, 241, 244, 246, 249, 253, 255,
260, 265, 278, 295, 308, 314, 320, 326, 332, 335,
338, 345, 352, 359, 366, 369, 372, 375, 378, 381,
384, 387, 389, 392, 395, 397, 399, 407, 409, 422
214, 224, 225, 232, 237, 240, 242, 245, 249, 251,
256, 261, 274, 291, 304, 310, 316, 322, 328, 331,
334, 341, 348, 355, 362, 365, 368, 371, 374, 377,
380, 383, 385, 388, 391, 393, 395, 403, 405, 418
};
#endif
@ -370,7 +366,7 @@ static const short yycheck[] = { 4,
26, 27, 23, 24, 25, 26, 27, 0, 9
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/cygnus/gnupro-98r1/share/bison.simple"
#line 3 "/usr/lib/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@ -387,8 +383,7 @@ static const short yycheck[] = { 4,
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
@ -564,7 +559,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
#line 196 "/usr/cygnus/gnupro-98r1/share/bison.simple"
#line 196 "/usr/lib/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@ -869,7 +864,7 @@ yyreduce:
switch (yyn) {
case 1:
#line 219 "cexp.y"
#line 215 "cexp.y"
{
expression_value = yyvsp[0].integer.value;
#ifdef TEST_EXP_READER
@ -878,55 +873,55 @@ case 1:
;
break;}
case 3:
#line 230 "cexp.y"
#line 226 "cexp.y"
{ if (pedantic)
pedwarn ("comma operator in operand of `#if'");
yyval.integer = yyvsp[0].integer; ;
break;}
case 4:
#line 237 "cexp.y"
#line 233 "cexp.y"
{ yyval.integer.value = - yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[0].integer.signedp;
if ((yyval.integer.value & yyvsp[0].integer.value & yyval.integer.signedp) < 0)
integer_overflow (); ;
break;}
case 5:
#line 242 "cexp.y"
#line 238 "cexp.y"
{ yyval.integer.value = ! yyvsp[0].integer.value;
yyval.integer.signedp = SIGNED; ;
break;}
case 6:
#line 245 "cexp.y"
#line 241 "cexp.y"
{ yyval.integer = yyvsp[0].integer; ;
break;}
case 7:
#line 247 "cexp.y"
#line 243 "cexp.y"
{ yyval.integer.value = ~ yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[0].integer.signedp; ;
break;}
case 8:
#line 250 "cexp.y"
#line 246 "cexp.y"
{ yyval.integer.value = check_assertion (yyvsp[0].name.address, yyvsp[0].name.length,
0, NULL_PTR);
yyval.integer.signedp = SIGNED; ;
break;}
case 9:
#line 254 "cexp.y"
#line 250 "cexp.y"
{ keyword_parsing = 1; ;
break;}
case 10:
#line 256 "cexp.y"
#line 252 "cexp.y"
{ yyval.integer.value = check_assertion (yyvsp[-4].name.address, yyvsp[-4].name.length,
1, yyvsp[-1].keywords);
keyword_parsing = 0;
yyval.integer.signedp = SIGNED; ;
break;}
case 11:
#line 261 "cexp.y"
#line 257 "cexp.y"
{ yyval.integer = yyvsp[-1].integer; ;
break;}
case 12:
#line 266 "cexp.y"
#line 262 "cexp.y"
{ yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
if (yyval.integer.signedp)
{
@ -941,7 +936,7 @@ case 12:
* yyvsp[0].integer.value); ;
break;}
case 13:
#line 279 "cexp.y"
#line 275 "cexp.y"
{ if (yyvsp[0].integer.value == 0)
{
if (!skip_evaluation)
@ -960,7 +955,7 @@ case 13:
/ yyvsp[0].integer.value); ;
break;}
case 14:
#line 296 "cexp.y"
#line 292 "cexp.y"
{ if (yyvsp[0].integer.value == 0)
{
if (!skip_evaluation)
@ -975,7 +970,7 @@ case 14:
% yyvsp[0].integer.value); ;
break;}
case 15:
#line 309 "cexp.y"
#line 305 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value + yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
if (overflow_sum_sign (yyvsp[-2].integer.value, yyvsp[0].integer.value,
@ -983,7 +978,7 @@ case 15:
integer_overflow (); ;
break;}
case 16:
#line 315 "cexp.y"
#line 311 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value - yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
if (overflow_sum_sign (yyval.integer.value, yyvsp[0].integer.value,
@ -991,7 +986,7 @@ case 16:
integer_overflow (); ;
break;}
case 17:
#line 321 "cexp.y"
#line 317 "cexp.y"
{ yyval.integer.signedp = yyvsp[-2].integer.signedp;
if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0)
yyval.integer.value = right_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value);
@ -999,7 +994,7 @@ case 17:
yyval.integer.value = left_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ;
break;}
case 18:
#line 327 "cexp.y"
#line 323 "cexp.y"
{ yyval.integer.signedp = yyvsp[-2].integer.signedp;
if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0)
yyval.integer.value = left_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value);
@ -1007,17 +1002,17 @@ case 18:
yyval.integer.value = right_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ;
break;}
case 19:
#line 333 "cexp.y"
#line 329 "cexp.y"
{ yyval.integer.value = (yyvsp[-2].integer.value == yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 20:
#line 336 "cexp.y"
#line 332 "cexp.y"
{ yyval.integer.value = (yyvsp[-2].integer.value != yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 21:
#line 339 "cexp.y"
#line 335 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value <= yyvsp[0].integer.value;
@ -1026,7 +1021,7 @@ case 21:
<= yyvsp[0].integer.value); ;
break;}
case 22:
#line 346 "cexp.y"
#line 342 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value >= yyvsp[0].integer.value;
@ -1035,7 +1030,7 @@ case 22:
>= yyvsp[0].integer.value); ;
break;}
case 23:
#line 353 "cexp.y"
#line 349 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value < yyvsp[0].integer.value;
@ -1044,7 +1039,7 @@ case 23:
< yyvsp[0].integer.value); ;
break;}
case 24:
#line 360 "cexp.y"
#line 356 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value > yyvsp[0].integer.value;
@ -1053,64 +1048,64 @@ case 24:
> yyvsp[0].integer.value); ;
break;}
case 25:
#line 367 "cexp.y"
#line 363 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value & yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 26:
#line 370 "cexp.y"
#line 366 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value ^ yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 27:
#line 373 "cexp.y"
#line 369 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value | yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 28:
#line 376 "cexp.y"
#line 372 "cexp.y"
{ skip_evaluation += !yyvsp[-1].integer.value; ;
break;}
case 29:
#line 378 "cexp.y"
#line 374 "cexp.y"
{ skip_evaluation -= !yyvsp[-3].integer.value;
yyval.integer.value = (yyvsp[-3].integer.value && yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 30:
#line 382 "cexp.y"
#line 378 "cexp.y"
{ skip_evaluation += !!yyvsp[-1].integer.value; ;
break;}
case 31:
#line 384 "cexp.y"
#line 380 "cexp.y"
{ skip_evaluation -= !!yyvsp[-3].integer.value;
yyval.integer.value = (yyvsp[-3].integer.value || yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 32:
#line 388 "cexp.y"
#line 384 "cexp.y"
{ skip_evaluation += !yyvsp[-1].integer.value; ;
break;}
case 33:
#line 390 "cexp.y"
#line 386 "cexp.y"
{ skip_evaluation += !!yyvsp[-4].integer.value - !yyvsp[-4].integer.value; ;
break;}
case 34:
#line 392 "cexp.y"
#line 388 "cexp.y"
{ skip_evaluation -= !!yyvsp[-6].integer.value;
yyval.integer.value = yyvsp[-6].integer.value ? yyvsp[-3].integer.value : yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-3].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 35:
#line 396 "cexp.y"
#line 392 "cexp.y"
{ yyval.integer = yylval.integer; ;
break;}
case 36:
#line 398 "cexp.y"
#line 394 "cexp.y"
{ yyval.integer = yylval.integer; ;
break;}
case 37:
#line 400 "cexp.y"
#line 396 "cexp.y"
{ if (warn_undef && !skip_evaluation)
warning ("`%.*s' is not defined",
yyvsp[0].name.length, yyvsp[0].name.address);
@ -1118,11 +1113,11 @@ case 37:
yyval.integer.signedp = SIGNED; ;
break;}
case 38:
#line 408 "cexp.y"
#line 404 "cexp.y"
{ yyval.keywords = 0; ;
break;}
case 39:
#line 410 "cexp.y"
#line 406 "cexp.y"
{ struct arglist *temp;
yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist));
yyval.keywords->next = yyvsp[-2].keywords;
@ -1137,7 +1132,7 @@ case 39:
temp->next->length = 1; ;
break;}
case 40:
#line 423 "cexp.y"
#line 419 "cexp.y"
{ yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist));
yyval.keywords->name = yyvsp[-1].name.address;
yyval.keywords->length = yyvsp[-1].name.length;
@ -1145,7 +1140,7 @@ case 40:
break;}
}
/* the action file gets copied in in place of this dollarsign */
#line 498 "/usr/cygnus/gnupro-98r1/share/bison.simple"
#line 498 "/usr/lib/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@ -1341,7 +1336,7 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
#line 428 "cexp.y"
#line 424 "cexp.y"
/* During parsing of a C expression, the pointer to the next character
@ -1408,12 +1403,9 @@ parse_number (olen)
else {
if (c == '.' || c == 'e' || c == 'E' || c == 'p' || c == 'P')
yyerror ("Floating point numbers not allowed in #if expressions");
else {
char *buf = (char *) alloca (p - lexptr + 40);
sprintf (buf, "missing white space after number `%.*s'",
else
yyerror ("missing white space after number `%.*s'",
(int) (p - lexptr - 1), lexptr);
yyerror (buf);
}
}
if (--len == 0)
@ -1490,11 +1482,7 @@ yylex ()
if (c == *toktab->operator && tokstart[1] == toktab->operator[1]) {
lexptr += 2;
if (toktab->token == ERROR)
{
char *buf = (char *) alloca (40);
sprintf (buf, "`%s' not allowed in operand of `#if'", toktab->operator);
yyerror (buf);
}
yyerror ("`%s' not allowed in operand of `#if'", toktab->operator);
return toktab->token;
}
@ -1893,15 +1881,6 @@ parse_escape (string_ptr, result_mask)
}
}
static void
yyerror (s)
char *s;
{
error ("%s", s);
skip_evaluation = 0;
longjmp (parse_return_error, 1);
}
static void
integer_overflow ()
{
@ -1968,6 +1947,29 @@ parse_c_expression (string, warn_undefined)
return expression_value; /* set by yyparse () */
}
static void
yyerror VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msgid;
#endif
va_list args;
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msgid = va_arg (args, char *);
#endif
fprintf (stderr, "error: ");
vfprintf (stderr, _(msgid), args);
fprintf (stderr, "\n");
va_end (args);
skip_evaluation = 0;
longjmp (parse_return_error, 1);
}
#ifdef TEST_EXP_READER
@ -2078,65 +2080,66 @@ initialize_random_junk ()
}
void
error VPROTO ((char * msg, ...))
error VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
fprintf (stderr, "error: ");
vfprintf (stderr, msg, args);
vfprintf (stderr, _(msgid), args);
fprintf (stderr, "\n");
va_end (args);
}
void
pedwarn VPROTO ((char * msg, ...))
pedwarn VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
fprintf (stderr, "pedwarn: ");
vfprintf (stderr, msg, args);
vfprintf (stderr, _(msgid), args);
fprintf (stderr, "\n");
va_end (args);
}
void
warning VPROTO ((char * msg, ...))
warning VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
fprintf (stderr, "warning: ");
vfprintf (stderr, msg, args);
vfprintf (stderr, _(msgid), args);
fprintf (stderr, "\n");
va_end (args);
}
int
check_assertion (name, sym_length, tokens_specified, tokens)
U_CHAR *name;

View File

@ -1,5 +1,5 @@
/* Parse C expressions for CCCP.
Copyright (C) 1987, 1992, 94 - 97, 1998 Free Software Foundation.
Copyright (C) 1987, 92, 94, 95, 96, 97, 1998 Free Software Foundation.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@ -27,10 +27,6 @@ Boston, MA 02111-1307, USA.
%{
#include "config.h"
#define PRINTF_PROTO(ARGS, m, n) PVPROTO (ARGS) ATTRIBUTE_PRINTF(m, n)
#define PRINTF_PROTO_1(ARGS) PRINTF_PROTO(ARGS, 1, 2)
#include "system.h"
#include <setjmp.h>
/* #define YYDEBUG 1 */
@ -86,7 +82,7 @@ struct arglist {
HOST_WIDE_INT parse_c_expression PROTO((char *, int));
static int yylex PROTO((void));
static void yyerror PROTO((char *)) __attribute__ ((noreturn));
static void yyerror PRINTF_PROTO_1((char *, ...)) __attribute__ ((noreturn));
static HOST_WIDE_INT expression_value;
#ifdef TEST_EXP_READER
static int expression_signedp;
@ -491,12 +487,9 @@ parse_number (olen)
else {
if (c == '.' || c == 'e' || c == 'E' || c == 'p' || c == 'P')
yyerror ("Floating point numbers not allowed in #if expressions");
else {
char *buf = (char *) alloca (p - lexptr + 40);
sprintf (buf, "missing white space after number `%.*s'",
else
yyerror ("missing white space after number `%.*s'",
(int) (p - lexptr - 1), lexptr);
yyerror (buf);
}
}
if (--len == 0)
@ -573,11 +566,7 @@ yylex ()
if (c == *toktab->operator && tokstart[1] == toktab->operator[1]) {
lexptr += 2;
if (toktab->token == ERROR)
{
char *buf = (char *) alloca (40);
sprintf (buf, "`%s' not allowed in operand of `#if'", toktab->operator);
yyerror (buf);
}
yyerror ("`%s' not allowed in operand of `#if'", toktab->operator);
return toktab->token;
}
@ -976,15 +965,6 @@ parse_escape (string_ptr, result_mask)
}
}
static void
yyerror (s)
char *s;
{
error ("%s", s);
skip_evaluation = 0;
longjmp (parse_return_error, 1);
}
static void
integer_overflow ()
{
@ -1051,6 +1031,29 @@ parse_c_expression (string, warn_undefined)
return expression_value; /* set by yyparse () */
}
static void
yyerror VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msgid;
#endif
va_list args;
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msgid = va_arg (args, char *);
#endif
fprintf (stderr, "error: ");
vfprintf (stderr, _(msgid), args);
fprintf (stderr, "\n");
va_end (args);
skip_evaluation = 0;
longjmp (parse_return_error, 1);
}
#ifdef TEST_EXP_READER
@ -1161,65 +1164,66 @@ initialize_random_junk ()
}
void
error VPROTO ((char * msg, ...))
error VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
fprintf (stderr, "error: ");
vfprintf (stderr, msg, args);
vfprintf (stderr, _(msgid), args);
fprintf (stderr, "\n");
va_end (args);
}
void
pedwarn VPROTO ((char * msg, ...))
pedwarn VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
fprintf (stderr, "pedwarn: ");
vfprintf (stderr, msg, args);
vfprintf (stderr, _(msgid), args);
fprintf (stderr, "\n");
va_end (args);
}
void
warning VPROTO ((char * msg, ...))
warning VPROTO ((char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char * msg;
char * msgid;
#endif
va_list args;
VA_START (args, msg);
VA_START (args, msgid);
#ifndef ANSI_PROTOTYPES
msg = va_arg (args, char *);
msgid = va_arg (args, char *);
#endif
fprintf (stderr, "warning: ");
vfprintf (stderr, msg, args);
vfprintf (stderr, _(msgid), args);
fprintf (stderr, "\n");
va_end (args);
}
int
check_assertion (name, sym_length, tokens_specified, tokens)
U_CHAR *name;

View File

@ -47,6 +47,7 @@ Boston, MA 02111-1307, USA. */
#include "collect2.h"
#include "demangle.h"
#include "obstack.h"
#include "intl.h"
#ifdef __CYGWIN__
#include <process.h>
#endif
@ -335,15 +336,13 @@ my_strerror (e)
#else
static char buffer[30];
if (!e)
return "";
if (e > 0 && e < sys_nerr)
return sys_errlist[e];
sprintf (buffer, "Unknown error %d", e);
return buffer;
return "errno = ?";
#endif
}
@ -403,25 +402,44 @@ collect_exit (status)
}
/* Notify user of a non-error. */
void
notice VPROTO((char *msgid, ...))
{
#ifndef __STDC__
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
#ifndef __STDC__
msgid = va_arg (ap, char *);
#endif
vfprintf (stderr, _(msgid), ap);
va_end (ap);
}
/* Die when sys call fails. */
void
fatal_perror VPROTO((const char * string, ...))
fatal_perror VPROTO((const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *string;
const char *msgid;
#endif
int e = errno;
va_list ap;
VA_START (ap, string);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
string = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
fprintf (stderr, "collect2: ");
vfprintf (stderr, string, ap);
vfprintf (stderr, _(msgid), ap);
fprintf (stderr, ": %s\n", my_strerror (e));
va_end (ap);
@ -431,21 +449,21 @@ fatal_perror VPROTO((const char * string, ...))
/* Just die. */
void
fatal VPROTO((const char * string, ...))
fatal VPROTO((const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *string;
const char *msgid;
#endif
va_list ap;
VA_START (ap, string);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
string = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
fprintf (stderr, "collect2: ");
vfprintf (stderr, string, ap);
vfprintf (stderr, _(msgid), ap);
fprintf (stderr, "\n");
va_end (ap);
@ -455,21 +473,21 @@ fatal VPROTO((const char * string, ...))
/* Write error message. */
void
error VPROTO((const char * string, ...))
error VPROTO((const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char * string;
#endif
va_list ap;
VA_START (ap, string);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
string = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
fprintf (stderr, "collect2: ");
vfprintf (stderr, string, ap);
vfprintf (stderr, _(msgid), ap);
fprintf (stderr, "\n");
va_end(ap);
}
@ -482,7 +500,6 @@ fancy_abort ()
{
fatal ("internal error");
}
static void
handler (signo)
@ -976,15 +993,26 @@ main (argc, argv)
char *p;
char **c_argv;
char **c_ptr;
char **ld1_argv = (char **) xcalloc (sizeof (char *), argc+3);
char **ld1 = ld1_argv;
char **ld2_argv = (char **) xcalloc (sizeof (char *), argc+6);
char **ld2 = ld2_argv;
char **object_lst = (char **) xcalloc (sizeof (char *), argc);
char **object = object_lst;
char **ld1_argv;
char **ld1;
char **ld2_argv;
char **ld2;
char **object_lst;
char **object;
int first_file;
int num_c_args = argc+9;
setlocale (LC_MESSAGES, "");
bindtextdomain (PACKAGE, localedir);
textdomain (PACKAGE);
/* Do not invoke xcalloc before this point, since locale needs to be
set first, in case a diagnostic is issued. */
ld1 = ld1_argv = (char **) xcalloc (sizeof (char *), argc+3);
ld2 = ld2_argv = (char **) xcalloc (sizeof (char *), argc+6);
object = object_lst = (char **) xcalloc (sizeof (char *), argc);
#ifdef DEBUG
debug = 1;
#endif
@ -1402,16 +1430,16 @@ main (argc, argv)
*ld2++ = buf2;
exportf = fopen (export_file, "w");
if (exportf == (FILE *) 0)
fatal_perror ("%s", export_file);
fatal_perror ("fopen %s", export_file);
write_export_file (exportf);
if (fclose (exportf))
fatal_perror ("closing %s", export_file);
fatal_perror ("fclose %s", export_file);
importf = fopen (import_file, "w");
if (importf == (FILE *) 0)
fatal_perror ("%s", import_file);
write_import_file (importf);
if (fclose (importf))
fatal_perror ("closing %s", import_file);
fatal_perror ("fclose %s", import_file);
}
#endif
@ -1420,7 +1448,7 @@ main (argc, argv)
if (vflag)
{
fprintf (stderr, "collect2 version %s", version_string);
notice ("collect2 version %s", version_string);
#ifdef TARGET_VERSION
TARGET_VERSION;
#endif
@ -1509,8 +1537,8 @@ main (argc, argv)
if (debug)
{
fprintf (stderr, "%d constructor(s) found\n", constructors.number);
fprintf (stderr, "%d destructor(s) found\n", destructors.number);
notice ("%d constructor(s) found\n", constructors.number);
notice ("%d destructor(s) found\n", destructors.number);
}
if (constructors.number == 0 && destructors.number == 0
@ -1553,12 +1581,12 @@ main (argc, argv)
maybe_unlink(output_file);
outf = fopen (c_file, "w");
if (outf == (FILE *) 0)
fatal_perror ("%s", c_file);
fatal_perror ("fopen %s", c_file);
write_c_file (outf, c_file);
if (fclose (outf))
fatal_perror ("closing %s", c_file);
fatal_perror ("fclose %s", c_file);
/* Tell the linker that we have initializer and finalizer functions. */
#ifdef LD_INIT_SWITCH
@ -1578,10 +1606,10 @@ main (argc, argv)
add_to_list (&exports, "_GLOBAL__DD");
exportf = fopen (export_file, "w");
if (exportf == (FILE *) 0)
fatal_perror ("%s", export_file);
fatal_perror ("fopen %s", export_file);
write_export_file (exportf);
if (fclose (exportf))
fatal_perror ("closing %s", export_file);
fatal_perror ("fclose %s", export_file);
}
#endif
@ -1640,12 +1668,12 @@ collect_wait (prog)
if (WIFSIGNALED (status))
{
int sig = WTERMSIG (status);
error ("%s terminated with signal %d [%s]%s",
error ((status & 0200
? "%s terminated with signal %d [%s]"
: "%s terminated with signal %d [%s], core dumped"),
prog,
sig,
my_strsignal(sig),
(status & 0200) ? ", core dumped" : "");
my_strsignal(sig));
collect_exit (FATAL_EXIT_CODE);
}
@ -1686,7 +1714,7 @@ collect_execute (prog, argv, redir)
if (argv[0])
fprintf (stderr, "%s", argv[0]);
else
fprintf (stderr, "[cannot find %s]", prog);
notice ("[cannot find %s]", prog);
for (p_argv = &argv[1]; (str = *p_argv) != (char *) 0; p_argv++)
fprintf (stderr, " %s", str);
@ -1714,13 +1742,13 @@ collect_execute (prog, argv, redir)
{
unlink (redir);
if (freopen (redir, "a", stdout) == NULL)
fatal_perror ("redirecting stdout: %s", redir);
fatal_perror ("freopen stdout %s", redir);
if (freopen (redir, "a", stderr) == NULL)
fatal_perror ("redirecting stderr: %s", redir);
fatal_perror ("freopen stderr %s", redir);
}
execvp (argv[0], argv);
fatal_perror ("executing %s", prog);
fatal_perror ("execvp %s", prog);
}
#else
pid = _spawnvp (_P_NOWAIT, argv[0], argv);
@ -1747,7 +1775,7 @@ maybe_unlink (file)
if (!debug)
unlink (file);
else
fprintf (stderr, "[Leaving %s]\n", file);
notice ("[Leaving %s]\n", file);
}
@ -1969,8 +1997,8 @@ write_c_file_stat (stream, name)
if (!ISALNUM ((unsigned char)*q))
*q = '_';
if (debug)
fprintf (stderr, "\nwrite_c_file - output name is %s, prefix is %s\n",
output_file, prefix);
notice ("\nwrite_c_file - output name is %s, prefix is %s\n",
output_file, prefix);
#define INIT_NAME_FORMAT "_GLOBAL__FI_%s"
initname = xmalloc (strlen (prefix) + sizeof (INIT_NAME_FORMAT) - 2);
@ -2233,16 +2261,16 @@ scan_prog_file (prog_name, which_pass)
{
/* setup stdout */
if (dup2 (pipe_fd[1], 1) < 0)
fatal_perror ("dup2 (%d, 1)", pipe_fd[1]);
fatal_perror ("dup2 %d 1", pipe_fd[1]);
if (close (pipe_fd[0]) < 0)
fatal_perror ("close (%d)", pipe_fd[0]);
fatal_perror ("close %d", pipe_fd[0]);
if (close (pipe_fd[1]) < 0)
fatal_perror ("close (%d)", pipe_fd[1]);
fatal_perror ("close %d", pipe_fd[1]);
execv (nm_file_name, nm_argv);
fatal_perror ("executing %s", nm_file_name);
fatal_perror ("execvp %s", nm_file_name);
}
/* Parent context from here on. */
@ -2252,7 +2280,7 @@ scan_prog_file (prog_name, which_pass)
#endif
if (close (pipe_fd[1]) < 0)
fatal_perror ("close (%d)", pipe_fd[1]);
fatal_perror ("close %d", pipe_fd[1]);
if (debug)
fprintf (stderr, "\nnm output with constructors/destructors.\n");
@ -2326,7 +2354,7 @@ scan_prog_file (prog_name, which_pass)
fprintf (stderr, "\n");
if (fclose (inf) != 0)
fatal_perror ("fclose of pipe");
fatal_perror ("fclose");
do_wait (nm_file_name);
@ -2528,7 +2556,7 @@ locatelib (name)
if (*pp == 0)
{
if (debug)
fprintf (stderr, "not found\n");
notice ("not found\n");
else
fatal ("dynamic dependency %s not found", name);
}
@ -2572,7 +2600,7 @@ scan_libraries (prog_name)
}
if (debug)
fprintf (stderr, "dynamic dependencies.\n");
notice ("dynamic dependencies.\n");
ld_2 = (struct link_dynamic_2 *) ((long) ld->ld_un.ld_2 + (long)base);
for (lo = (struct link_object *) ld_2->ld_need; lo;
@ -2669,16 +2697,16 @@ scan_libraries (prog_name)
{
/* setup stdout */
if (dup2 (pipe_fd[1], 1) < 0)
fatal_perror ("dup2 (%d, 1)", pipe_fd[1]);
fatal_perror ("dup2 %d 1", pipe_fd[1]);
if (close (pipe_fd[0]) < 0)
fatal_perror ("close (%d)", pipe_fd[0]);
fatal_perror ("close %d", pipe_fd[0]);
if (close (pipe_fd[1]) < 0)
fatal_perror ("close (%d)", pipe_fd[1]);
fatal_perror ("close %d", pipe_fd[1]);
execv (ldd_file_name, ldd_argv);
fatal_perror ("executing %s", ldd_file_name);
fatal_perror ("execv %s", ldd_file_name);
}
/* Parent context from here on. */
@ -2688,10 +2716,10 @@ scan_libraries (prog_name)
#endif
if (close (pipe_fd[1]) < 0)
fatal_perror ("close (%d)", pipe_fd[1]);
fatal_perror ("close %d", pipe_fd[1]);
if (debug)
fprintf (stderr, "\nldd output with constructors/destructors.\n");
notice ("\nldd output with constructors/destructors.\n");
/* Read each line of ldd output. */
while (fgets (buf, sizeof buf, inf) != (char *) 0)
@ -2727,7 +2755,7 @@ scan_libraries (prog_name)
fprintf (stderr, "\n");
if (fclose (inf) != 0)
fatal_perror ("fclose of pipe");
fatal_perror ("fclose");
do_wait (ldd_file_name);
@ -3160,7 +3188,7 @@ scan_prog_file (prog_name, which_pass)
prog_fd = open (prog_name, (rw) ? O_RDWR : O_RDONLY);
if (prog_fd < 0)
fatal_perror ("cannot read %s", prog_name);
fatal_perror ("open %s", prog_name);
obj_file = read_file (prog_name, prog_fd, rw);
obj = obj_file->start;
@ -3256,8 +3284,8 @@ scan_prog_file (prog_name, which_pass)
case SYMC_STABS: kind = "stabs"; break;
}
fprintf (stderr, "\nProcessing symbol table #%d, offset = 0x%.8lx, kind = %s\n",
symbol_load_cmds, load_hdr->hdr.ldci_section_off, kind);
notice ("\nProcessing symbol table #%d, offset = 0x%.8lx, kind = %s\n",
symbol_load_cmds, load_hdr->hdr.ldci_section_off, kind);
}
if (load_hdr->sym.symc_kind != SYMC_DEFINED_SYMBOLS)
@ -3341,15 +3369,15 @@ scan_prog_file (prog_name, which_pass)
add_func_table (&hdr, load_array, main_sym, FNTC_INITIALIZATION);
if (debug)
fprintf (stderr, "\nUpdating header and load commands.\n\n");
notice ("\nUpdating header and load commands.\n\n");
hdr.moh_n_load_cmds++;
size = sizeof (load_cmd_map_command_t) + (sizeof (mo_offset_t) * (hdr.moh_n_load_cmds - 1));
/* Create new load command map. */
if (debug)
fprintf (stderr, "load command map, %d cmds, new size %ld.\n",
(int)hdr.moh_n_load_cmds, (long)size);
notice ("load command map, %d cmds, new size %ld.\n",
(int) hdr.moh_n_load_cmds, (long) size);
load_map = (load_union_t *) xcalloc (1, size);
load_map->map.ldc_header.ldci_cmd_type = LDC_CMD_MAP;
@ -3379,7 +3407,7 @@ scan_prog_file (prog_name, which_pass)
bad_header (status);
if (debug)
fprintf (stderr, "writing load commands.\n\n");
notice ("writing load commands.\n\n");
/* Write load commands */
offset = hdr.moh_first_cmd_off;
@ -3399,7 +3427,7 @@ scan_prog_file (prog_name, which_pass)
end_file (obj_file);
if (close (prog_fd))
fatal_perror ("closing %s", prog_name);
fatal_perror ("close %s", prog_name);
if (debug)
fprintf (stderr, "\n");
@ -3477,12 +3505,11 @@ add_func_table (hdr_p, load_array, sym, type)
}
if (debug)
fprintf (stderr,
"%s function, region %d, offset = %ld (0x%.8lx)\n",
(type == FNTC_INITIALIZATION) ? "init" : "term",
(int)ptr->func.fntc_entry_loc[i].adr_lcid,
(long)ptr->func.fntc_entry_loc[i].adr_sctoff,
(long)ptr->func.fntc_entry_loc[i].adr_sctoff);
notice ("%s function, region %d, offset = %ld (0x%.8lx)\n",
type == FNTC_INITIALIZATION ? "init" : "term",
(int) ptr->func.fntc_entry_loc[i].adr_lcid,
(long) ptr->func.fntc_entry_loc[i].adr_sctoff,
(long) ptr->func.fntc_entry_loc[i].adr_sctoff);
}
@ -3603,22 +3630,17 @@ static void
bad_header (status)
int status;
{
char *msg = (char *) 0;
switch (status)
{
case MO_ERROR_BAD_MAGIC: msg = "bad magic number"; break;
case MO_ERROR_BAD_HDR_VERS: msg = "bad header version"; break;
case MO_ERROR_BAD_RAW_HDR_VERS: msg = "bad raw header version"; break;
case MO_ERROR_BUF2SML: msg = "raw header buffer too small"; break;
case MO_ERROR_OLD_RAW_HDR_FILE: msg = "old raw header file"; break;
case MO_ERROR_UNSUPPORTED_VERS: msg = "unsupported version"; break;
case MO_ERROR_BAD_MAGIC: fatal ("bad magic number");
case MO_ERROR_BAD_HDR_VERS: fatal ("bad header version");
case MO_ERROR_BAD_RAW_HDR_VERS: fatal ("bad raw header version");
case MO_ERROR_BUF2SML: fatal ("raw header buffer too small");
case MO_ERROR_OLD_RAW_HDR_FILE: fatal ("old raw header file");
case MO_ERROR_UNSUPPORTED_VERS: fatal ("unsupported version");
default:
fatal ("unknown {de,en}code_mach_o_hdr return value %d", status);
}
if (msg == (char *) 0)
fatal ("unknown {de,en}code_mach_o_hdr return value %d", status);
else
fatal ("%s", msg);
}
@ -3674,7 +3696,7 @@ read_file (name, fd, rw)
p->use_mmap = 0;
p->start = xmalloc (p->size);
if (lseek (fd, 0L, SEEK_SET) < 0)
fatal_perror ("lseek to 0 on %s", name);
fatal_perror ("lseek %s 0", name);
len = read (fd, p->start, p->size);
if (len < 0)
@ -3722,7 +3744,7 @@ end_file (ptr)
fprintf (stderr, "write %s\n", ptr->name);
if (lseek (ptr->fd, 0L, SEEK_SET) < 0)
fatal_perror ("lseek to 0 on %s", ptr->name);
fatal_perror ("lseek %s 0", ptr->name);
len = write (ptr->fd, ptr->start, ptr->size);
if (len < 0)

View File

@ -11984,7 +11984,7 @@ void
dump_combine_stats (file)
FILE *file;
{
fprintf
fnotice
(file,
";; Combiner statistics: %d attempts, %d substitutions (%d requiring new space),\n;; %d successes.\n\n",
combine_attempts, combine_merges, combine_extras, combine_successes);
@ -11994,7 +11994,7 @@ void
dump_combine_total_stats (file)
FILE *file;
{
fprintf
fnotice
(file,
"\n;; Combiner totals: %d attempts, %d substitutions (%d requiring new space),\n;; %d successes.\n",
total_attempts, total_merges, total_extras, total_successes);

View File

@ -8,6 +8,15 @@
/* Define if you want expensive run-time checks. */
#undef ENABLE_CHECKING
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
#undef HAVE_CATGETS
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Define if your cpp understands the stringify operator. */
#undef HAVE_CPP_STRINGIFY
@ -28,6 +37,12 @@
/* Define if you have a working <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Whether malloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_MALLOC
@ -94,10 +109,34 @@
/* Define to enable the use of a default linker. */
#undef DEFAULT_LINKER
/* Define to the name of the distribution. */
#undef PACKAGE
/* Define to the version of the distribution. */
#undef VERSION
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
@ -107,9 +146,27 @@
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
@ -122,6 +179,15 @@
/* Define vfork as fork if vfork does not work. */
#undef vfork
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
/* Define if you have the __argz_next function. */
#undef HAVE___ARGZ_NEXT
/* Define if you have the __argz_stringify function. */
#undef HAVE___ARGZ_STRINGIFY
/* Define if you have the atoll function. */
#undef HAVE_ATOLL
@ -140,12 +206,21 @@
/* Define if you have the bzero function. */
#undef HAVE_BZERO
/* Define if you have the dcgettext function. */
#undef HAVE_DCGETTEXT
/* Define if you have the fputc_unlocked function. */
#undef HAVE_FPUTC_UNLOCKED
/* Define if you have the fputs_unlocked function. */
#undef HAVE_FPUTS_UNLOCKED
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the getrlimit function. */
#undef HAVE_GETRLIMIT
@ -161,6 +236,9 @@
/* Define if you have the kill function. */
#undef HAVE_KILL
/* Define if you have the munmap function. */
#undef HAVE_MUNMAP
/* Define if you have the popen function. */
#undef HAVE_POPEN
@ -173,12 +251,27 @@
/* Define if you have the rindex function. */
#undef HAVE_RINDEX
/* Define if you have the setenv function. */
#undef HAVE_SETENV
/* Define if you have the setlocale function. */
#undef HAVE_SETLOCALE
/* Define if you have the setrlimit function. */
#undef HAVE_SETRLIMIT
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define if you have the strchr function. */
#undef HAVE_STRCHR
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
@ -194,12 +287,24 @@
/* Define if you have the sysconf function. */
#undef HAVE_SYSCONF
/* Define if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
/* Define if you have the <stab.h> header file. */
#undef HAVE_STAB_H
@ -238,3 +343,6 @@
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the i library (-li). */
#undef HAVE_LIBI

View File

@ -1,5 +1,5 @@
/* Subroutines for insn-output.c for MIL-STD-1750.
Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by O.M.Kellogg, DASA (kellogg@space.otn.dasa.de)
This file is part of GNU CC.
@ -222,7 +222,7 @@ memop_valid (op)
rtx op;
{
static int recurred = 0;
int valid;
int valid_operand;
if (GET_MODE (op) != Pmode && GET_MODE (op) != VOIDmode
&& GET_MODE (op) != QImode)
@ -238,11 +238,11 @@ memop_valid (op)
return 0;
case PLUS:
recurred = 1;
valid = memop_valid (XEXP (op, 0));
if (valid)
valid = memop_valid (XEXP (op, 1));
valid_operand = memop_valid (XEXP (op, 0));
if (valid_operand)
valid_operand = memop_valid (XEXP (op, 1));
recurred = 0;
return valid;
return valid_operand;
case REG:
if (REGNO (op) > 0)
return 1;

View File

@ -860,6 +860,29 @@ direct_return ()
&& current_function_pretend_args_size == 0);
}
/* Return 1 is OP is a memory location that is not an reference (using
an AND) to an unaligned location. Take into account what reload
will do. */
int
normal_memory_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
if (reload_in_progress && GET_CODE (op) == REG
&& REGNO (op) >= FIRST_PSEUDO_REGISTER)
{
op = reg_equiv_mem[REGNO (op)];
/* This may not have been assigned an equivalent address if it will
be eliminated. In that case, it doesn't matter what we do. */
if (op == 0)
return 1;
}
return GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) != AND;
}
/* REF is an alignable memory location. Place an aligned SImode
reference into *PALIGNED_MEM and the number of bits to shift into
*PBITNUM. */

View File

@ -778,7 +778,7 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, ALL_REGS,
'S' is a 6-bit constant (valid for a shift insn). */
#define EXTRA_CONSTRAINT(OP, C) \
((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) != AND \
((C) == 'Q' ? normal_memory_operand (OP, VOIDmode) \
: (C) == 'R' ? current_file_function_operand (OP, Pmode) \
: (C) == 'S' ? (GET_CODE (OP) == CONST_INT \
&& (unsigned HOST_WIDE_INT) INTVAL (OP) < 64) \

View File

@ -36,11 +36,11 @@ Boston, MA 02111-1307, USA. */
#undef LIB_SPEC
#define LIB_SPEC ""
/* VxWorks uses object files, not loadable images. make linker just
combine objects. */
/* VxWorks uses object files, not loadable images. Make linker just combine
objects. Also show using 32 bit mode and set start of text to 0. */
#undef LINK_SPEC
#define LINK_SPEC "-r"
#define LINK_SPEC "-r -taso -T 0"
/* VxWorks provides the functionality of crt0.o and friends itself. */

View File

@ -1,7 +1,7 @@
/* .init/.fini section handling + C++ global constructor/destructor handling.
This file is based on crtstuff.c, sol2-crti.asm, sol2-crtn.asm.
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@ -77,30 +77,30 @@ __do_global_dtors ()
/* .init section start.
This must appear at the start of the .init section. */
asm ("
.section .init\n
.global init\n
.word 0\n
init:\n
st blink,[sp,4]\n
st fp,[sp]\n
mov fp,sp\n
sub sp,sp,16\n
asm ("\n\
.section .init\n\
.global init\n\
.word 0\n\
init:\n\
st blink,[sp,4]\n\
st fp,[sp]\n\
mov fp,sp\n\
sub sp,sp,16\n\
");
/* .fini section start.
This must appear at the start of the .init section. */
asm ("
.section .fini\n
.global fini\n
.word 0\n
fini:\n
st blink,[sp,4]\n
st fp,[sp]\n
mov fp,sp\n
sub sp,sp,16\n
bl.nd __do_global_dtors
asm ("\n\
.section .fini\n\
.global fini\n\
.word 0\n\
fini:\n\
st blink,[sp,4]\n\
st fp,[sp]\n\
mov fp,sp\n\
sub sp,sp,16\n\
bl.nd __do_global_dtors\n\
");
#endif /* CRT_INIT */
@ -136,22 +136,22 @@ __do_global_ctors ()
/* .init section end.
This must live at the end of the .init section. */
asm ("
.section .init\n
bl.nd __do_global_ctors
ld blink,[fp,4]\n
j.d blink\n
ld.a fp,[sp,16]\n
asm ("\n\
.section .init\n\
bl.nd __do_global_ctors\
ld blink,[fp,4]\n\
j.d blink\n\
ld.a fp,[sp,16]\n\
");
/* .fini section end.
This must live at the end of the .fini section. */
asm ("
.section .fini\n
ld blink,[fp,4]\n
j.d blink\n
ld.a fp,[sp,16]\n
asm ("\n\
.section .fini\n\
ld blink,[fp,4]\n\
j.d blink\n\
ld.a fp,[sp,16]\n\
");
#endif /* CRT_FINI */

View File

@ -1,5 +1,5 @@
/* Subroutines for assembler code output on the DSP1610.
Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
Copyright (C) 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
Contributed by Michael Collison (collison@world.std.com).
This file is part of GNU CC.
@ -2239,3 +2239,9 @@ output_block_move (operands)
fprintf (asm_out_file, "\t}\n");
return "";
}
void
dsp16xx_invalid_register_for_compare ()
{
fatal ("Invalid register for compare");
}

View File

@ -1970,3 +1970,5 @@ const_section () \
/* Define this so gcc does not output a call to __main, since we
are not currently supporting c++. */
#define INIT_SECTION_ASM_OP 1
void dsp16xx_invalid_register_for_compare ();

View File

@ -1,5 +1,5 @@
;;- Machine description for the AT&T DSP1600 for GNU C compiler
;; Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
;; Copyright (C) 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
;; Contributed by Michael Collison (collison@world.std.com).
;; This file is part of GNU CC.
@ -178,7 +178,7 @@
output_asm_insn (\"a0=%u0\;a0l=%w0\", operands);
}
else
fatal (\"Invalid register for compare\");
dsp16xx_invalid_register_for_compare ();
}
else if (GET_CODE(operands[0]) == CONST_INT)
{
@ -205,7 +205,7 @@
output_asm_insn (\"a1=%u1\;a1l=%w1\", operands);
}
else
fatal (\"Invalid register for compare\");
dsp16xx_invalid_register_for_compare ();
}
else if (GET_CODE (operands[1]) == MEM)
{

View File

@ -1,7 +1,7 @@
/* .init/.fini section handling + C++ global constructor/destructor handling.
This file is based on crtstuff.c, sol2-crti.asm, sol2-crtn.asm.
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@ -80,32 +80,32 @@ __do_global_dtors ()
/* .init section start.
This must appear at the start of the .init section. */
asm ("
.section .init,\"ax\",@progbits
.balign 4
.global __init
__init:
push fp
push lr
mv fp,sp
ld24 r0,#__fini
bl atexit
.fillinsn
asm ("\n\
.section .init,\"ax\",@progbits\n\
.balign 4\n\
.global __init\n\
__init:\n\
push fp\n\
push lr\n\
mv fp,sp\n\
ld24 r0,#__fini\n\
bl atexit\n\
.fillinsn\n\
");
/* .fini section start.
This must appear at the start of the .init section. */
asm ("
.section .fini,\"ax\",@progbits
.balign 4
.global __fini
__fini:
push fp
push lr
mv fp,sp
bl __do_global_dtors
.fillinsn
asm ("\n\
.section .fini,\"ax\",@progbits\n\
.balign 4\n\
.global __fini\n\
__fini:\n\
push fp\n\
push lr\n\
mv fp,sp\n\
bl __do_global_dtors\n\
.fillinsn\n\
");
#endif /* CRT_INIT */
@ -144,26 +144,26 @@ __do_global_ctors ()
/* .init section end.
This must live at the end of the .init section. */
asm ("
.section .init,\"ax\",@progbits
bl __do_global_ctors
mv sp,fp
pop lr
pop fp
jmp lr
.fillinsn
asm ("\n\
.section .init,\"ax\",@progbits\n\
bl __do_global_ctors\n\
mv sp,fp\n\
pop lr\n\
pop fp\n\
jmp lr\n\
.fillinsn\n\
");
/* .fini section end.
This must live at the end of the .fini section. */
asm ("
.section .fini,\"ax\",@progbits
mv sp,fp
pop lr
pop fp
jmp lr
.fillinsn
asm ("\n\
.section .fini,\"ax\",@progbits\n\
mv sp,fp\n\
pop lr\n\
pop fp\n\
jmp lr\n\
.fillinsn\n\
");
#endif /* CRT_FINI */

View File

@ -1675,8 +1675,7 @@
(define_insn "extendqidi2"
[(set (match_operand:DI 0 "general_operand" "=d")
(sign_extend:DI
(match_operand:QI 1 "general_operand" "rm")))]
(sign_extend:DI (match_operand:QI 1 "general_operand" "dm")))]
""
"*
{
@ -5675,8 +5674,12 @@
return output_scc_di (operands[1], operands[2], operands[3], operands[0]);
} ")
;; Note that operand 0 of an SCC insn is supported in the hardware as
;; memory, but we cannot allow it to be in memory in case the address
;; needs to be reloaded.
(define_expand "seq"
[(set (match_operand:QI 0 "general_operand" "")
[(set (match_operand:QI 0 "register_operand" "")
(eq:QI (cc0) (const_int 0)))]
""
"
@ -5689,25 +5692,16 @@
}")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=dm")
[(set (match_operand:QI 0 "register_operand" "=d")
(eq:QI (cc0) (const_int 0)))]
"! TARGET_5200"
"*
cc_status = cc_prev_status;
OUTPUT_JUMP (\"seq %0\", \"fseq %0\", \"seq %0\");
")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=d")
(eq:QI (cc0) (const_int 0)))]
"TARGET_5200"
""
"*
cc_status = cc_prev_status;
OUTPUT_JUMP (\"seq %0\", \"fseq %0\", \"seq %0\");
")
(define_expand "sne"
[(set (match_operand:QI 0 "general_operand" "")
[(set (match_operand:QI 0 "register_operand" "")
(ne:QI (cc0) (const_int 0)))]
""
"
@ -5720,25 +5714,16 @@
}")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=dm")
[(set (match_operand:QI 0 "register_operand" "=d")
(ne:QI (cc0) (const_int 0)))]
"! TARGET_5200"
"*
cc_status = cc_prev_status;
OUTPUT_JUMP (\"sne %0\", \"fsne %0\", \"sne %0\");
")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=d")
(ne:QI (cc0) (const_int 0)))]
"TARGET_5200"
""
"*
cc_status = cc_prev_status;
OUTPUT_JUMP (\"sne %0\", \"fsne %0\", \"sne %0\");
")
(define_expand "sgt"
[(set (match_operand:QI 0 "general_operand" "")
[(set (match_operand:QI 0 "register_operand" "")
(gt:QI (cc0) (const_int 0)))]
""
"
@ -5751,45 +5736,30 @@
}")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=dm")
[(set (match_operand:QI 0 "register_operand" "=d")
(gt:QI (cc0) (const_int 0)))]
"! TARGET_5200"
"*
cc_status = cc_prev_status;
OUTPUT_JUMP (\"sgt %0\", \"fsgt %0\", 0);
")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=d")
(gt:QI (cc0) (const_int 0)))]
"TARGET_5200"
""
"*
cc_status = cc_prev_status;
OUTPUT_JUMP (\"sgt %0\", \"fsgt %0\", 0);
")
(define_expand "sgtu"
[(set (match_operand:QI 0 "general_operand" "")
[(set (match_operand:QI 0 "register_operand" "")
(gtu:QI (cc0) (const_int 0)))]
""
"")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=dm")
[(set (match_operand:QI 0 "register_operand" "=d")
(gtu:QI (cc0) (const_int 0)))]
"! TARGET_5200"
"* cc_status = cc_prev_status;
return \"shi %0\"; ")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=d")
(gtu:QI (cc0) (const_int 0)))]
"TARGET_5200"
"* cc_status = cc_prev_status;
return \"shi %0\"; ")
""
"*
cc_status = cc_prev_status;
return \"shi %0\"; ")
(define_expand "slt"
[(set (match_operand:QI 0 "general_operand" "")
[(set (match_operand:QI 0 "register_operand" "")
(lt:QI (cc0) (const_int 0)))]
""
"
@ -5802,41 +5772,29 @@
}")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=dm")
[(set (match_operand:QI 0 "register_operand" "=d")
(lt:QI (cc0) (const_int 0)))]
"! TARGET_5200"
"* cc_status = cc_prev_status;
OUTPUT_JUMP (\"slt %0\", \"fslt %0\", \"smi %0\"); ")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=d")
(lt:QI (cc0) (const_int 0)))]
"TARGET_5200"
"* cc_status = cc_prev_status;
OUTPUT_JUMP (\"slt %0\", \"fslt %0\", \"smi %0\"); ")
""
"*
cc_status = cc_prev_status;
OUTPUT_JUMP (\"slt %0\", \"fslt %0\", \"smi %0\"); ")
(define_expand "sltu"
[(set (match_operand:QI 0 "general_operand" "")
[(set (match_operand:QI 0 "register_operand" "")
(ltu:QI (cc0) (const_int 0)))]
""
"")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=dm")
[(set (match_operand:QI 0 "register_operand" "=d")
(ltu:QI (cc0) (const_int 0)))]
"! TARGET_5200"
"* cc_status = cc_prev_status;
return \"scs %0\"; ")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=d")
(ltu:QI (cc0) (const_int 0)))]
"TARGET_5200"
"* cc_status = cc_prev_status;
return \"scs %0\"; ")
""
"*
cc_status = cc_prev_status;
return \"scs %0\"; ")
(define_expand "sge"
[(set (match_operand:QI 0 "general_operand" "")
[(set (match_operand:QI 0 "register_operand" "")
(ge:QI (cc0) (const_int 0)))]
""
"
@ -5849,41 +5807,29 @@
}")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=dm")
[(set (match_operand:QI 0 "register_operand" "=d")
(ge:QI (cc0) (const_int 0)))]
"! TARGET_5200"
"* cc_status = cc_prev_status;
OUTPUT_JUMP (\"sge %0\", \"fsge %0\", \"spl %0\"); ")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=d")
(ge:QI (cc0) (const_int 0)))]
"TARGET_5200"
"* cc_status = cc_prev_status;
OUTPUT_JUMP (\"sge %0\", \"fsge %0\", \"spl %0\"); ")
""
"*
cc_status = cc_prev_status;
OUTPUT_JUMP (\"sge %0\", \"fsge %0\", \"spl %0\"); ")
(define_expand "sgeu"
[(set (match_operand:QI 0 "general_operand" "")
[(set (match_operand:QI 0 "register_operand" "")
(geu:QI (cc0) (const_int 0)))]
""
"")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=dm")
[(set (match_operand:QI 0 "register_operand" "=d")
(geu:QI (cc0) (const_int 0)))]
"! TARGET_5200"
"* cc_status = cc_prev_status;
return \"scc %0\"; ")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=d")
(geu:QI (cc0) (const_int 0)))]
"TARGET_5200"
"* cc_status = cc_prev_status;
return \"scc %0\"; ")
""
"*
cc_status = cc_prev_status;
return \"scc %0\"; ")
(define_expand "sle"
[(set (match_operand:QI 0 "general_operand" "")
[(set (match_operand:QI 0 "register_operand" "")
(le:QI (cc0) (const_int 0)))]
""
"
@ -5896,42 +5842,27 @@
}")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=dm")
[(set (match_operand:QI 0 "register_operand" "=d")
(le:QI (cc0) (const_int 0)))]
"! TARGET_5200"
"*
cc_status = cc_prev_status;
OUTPUT_JUMP (\"sle %0\", \"fsle %0\", 0);
")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=d")
(le:QI (cc0) (const_int 0)))]
"TARGET_5200"
""
"*
cc_status = cc_prev_status;
OUTPUT_JUMP (\"sle %0\", \"fsle %0\", 0);
")
(define_expand "sleu"
[(set (match_operand:QI 0 "general_operand" "")
[(set (match_operand:QI 0 "register_operand" "")
(leu:QI (cc0) (const_int 0)))]
""
"")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=dm")
[(set (match_operand:QI 0 "register_operand" "=d")
(leu:QI (cc0) (const_int 0)))]
"! TARGET_5200"
"* cc_status = cc_prev_status;
return \"sls %0\"; ")
(define_insn ""
[(set (match_operand:QI 0 "general_operand" "=d")
(leu:QI (cc0) (const_int 0)))]
"TARGET_5200"
"* cc_status = cc_prev_status;
return \"sls %0\"; ")
""
"*
cc_status = cc_prev_status;
return \"sls %0\"; ")
;; Basic conditional jump instructions.
@ -7504,7 +7435,7 @@
(define_insn "extendsfxf2"
[(set (match_operand:XF 0 "general_operand" "=fm,f")
(float_extend:XF (match_operand:SF 1 "general_operand" "f,m")))]
(float_extend:XF (match_operand:SF 1 "general_operand" "f,rmF")))]
"TARGET_68881"
"*
{
@ -7521,7 +7452,15 @@
return \"f%$move%.x %1,%0\";
}
if (FP_REG_P (operands[0]))
return \"f%$move%.s %f1,%0\";
{
if (FP_REG_P (operands[1]))
return \"f%$move%.x %1,%0\";
else if (ADDRESS_REG_P (operands[1]))
return \"move%.l %1,%-\;f%$move%.s %+,%0\";
else if (GET_CODE (operands[1]) == CONST_DOUBLE)
return output_move_const_single (operands);
return \"f%$move%.s %f1,%0\";
}
return \"fmove%.x %f1,%0\";
}")
@ -7529,7 +7468,7 @@
(define_insn "extenddfxf2"
[(set (match_operand:XF 0 "general_operand" "=fm,f")
(float_extend:XF
(match_operand:DF 1 "general_operand" "f,m")))]
(match_operand:DF 1 "general_operand" "f,rmE")))]
"TARGET_68881"
"*
{
@ -7546,7 +7485,19 @@
return \"fmove%.x %1,%0\";
}
if (FP_REG_P (operands[0]))
return \"f%&move%.d %f1,%0\";
{
if (REG_P (operands[1]))
{
rtx xoperands[2];
xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
output_asm_insn (\"move%.l %1,%-\", xoperands);
output_asm_insn (\"move%.l %1,%-\", operands);
return \"f%&move%.d %+,%0\";
}
if (GET_CODE (operands[1]) == CONST_DOUBLE)
return output_move_const_double (operands);
return \"f%&move%.d %f1,%0\";
}
return \"fmove%.x %f1,%0\";
}")

View File

@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. Vxworks m68k version.
Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@ -82,9 +82,9 @@ Unrecognized value in TARGET_CPU_DEFAULT.
#define LIB_SPEC ""
/* Provide required defaults for linker -e. */
/* Provide required defaults for linker. */
#define LINK_SPEC "%{!nostdlib:%{!r*:%{!e*:-e start}}}"
#define LINK_SPEC "-r"
/* VxWorks provides the functionality of crt0.o and friends itself. */
@ -99,3 +99,8 @@ Unrecognized value in TARGET_CPU_DEFAULT.
/* GCC is the primary compiler for VxWorks, so we don't need this. */
#undef PCC_STATIC_STRUCT_RETURN
/* Restrict use of 128 bit floating-point by default since VxWorks doesn't
have the proper accuracy routines for that size; this is not done because
the hardware doesn't support it, despite the name. */
#define WIDEST_HARDWARE_FP_SIZE 64

View File

@ -19,9 +19,9 @@ 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 "config.h"
#include <stdio.h>
#include <ctype.h>
#include "config.h"
#include "tree.h"
#include "rtl.h"
#include "regs.h"

2179
gcc/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -3037,6 +3037,15 @@ changequote([,])dnl
fi
fi
;;
sparc-hal-solaris2*)
xm_file=sparc/xm-sol2.h
tm_file="sparc/sol2.h sparc/hal.h"
tmake_file="sparc/t-halos sparc/t-sol2"
xmake_file=sparc/x-sysv4
extra_parts="crt1.o crti.o crtn.o gmon.o crtbegin.o crtend.o"
fixincludes=fixinc.svr4
broken_install=yes
;;
sparc-*-solaris2*)
if test x$gnu_ld = xyes
then
@ -3574,7 +3583,21 @@ do
fi
for file in `eval echo '$'$var`; do
case $file in
auto-config.h)
;;
*)
echo '#ifdef IN_GCC' >>$link
;;
esac
echo "#include \"$file\"" >>$link
case $file in
auto-config.h)
;;
*)
echo '#endif' >>$link
;;
esac
done
for def in `eval echo '$'$define`; do
@ -3599,6 +3622,24 @@ changequote(,)dnl
gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${gcc_version_trigger}`
changequote([,])dnl
# Internationalization
PACKAGE=gcc
VERSION="$gcc_version"
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
ALL_LINGUAS="en_UK"
# NLS support is still experimental, so disable it by default for now.
AC_ARG_ENABLE(nls,
[ --enable-nls use Native Language Support (disabled by default)],
, enable_nls=no)
AM_GNU_GETTEXT
XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
# Get an absolute path to the GCC top-level source directory
holddir=`pwd`
cd $srcdir
@ -3960,7 +4001,7 @@ all_boot_languages=
all_compilers=
all_stagestuff=
all_diff_excludes=
all_outputs=Makefile
all_outputs='Makefile intl/Makefile po/Makefile.in'
# List of language makefile fragments.
all_lang_makefiles=
all_headers=
@ -4028,10 +4069,10 @@ target_list="all.build all.cross start.encap rest.encap \
for t in $target_list
do
x=
for l in .. $all_languages
for lang in .. $all_languages
do
if test $l != ".."; then
x="$x $l.$t"
if test $lang != ".."; then
x="$x $lang.$t"
fi
done
echo "lang.$t: $x" >> Make-hooks
@ -4246,6 +4287,11 @@ if test "$symbolic_link" = "ln -s"; then
fi
done
else true ; fi
# Avoid having to add intl to our include paths.
if test -f intl/libintl.h; then
echo creating libintl.h
echo '#include "intl/libintl.h"' >libintl.h
fi
],
[
host='${host}'

View File

@ -86,17 +86,19 @@ g++spec.o: $(srcdir)/cp/g++spec.c
# It'd be nice if we could find an easier way to do this---rather than have
# to track changes to the toplevel gcc Makefile as well.
# We depend on g++.c last, to make it obvious where it came from.
g++.o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) g++.c \
system.h prefix.h
g++.o: $(CONFIG_H) intl.h multilib.h config.status system.h \
Makefile $(lang_specs_files) g++.c prefix.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(DRIVER_DEFINES) \
-DLANG_SPECIFIC_DRIVER \
-c g++.c
# Create the compiler driver for g++.
g++$(exeext): g++.o g++spec.o version.o choose-temp.o pexecute.o prefix.o mkstemp.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ g++.o g++spec.o prefix.o \
version.o choose-temp.o pexecute.o mkstemp.o $(EXTRA_GCC_OBJS) $(LIBS)
GXX_OBJS = g++.o g++spec.o choose-temp.o intl.o pexecute.o prefix.o version.o \
mkstemp.o
g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
$(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
# Create a version of the g++ driver which calls the cross-compiler.
g++-cross$(exeext): g++$(exeext)

View File

@ -1,5 +1,5 @@
# Makefile for GNU C++ compiler.
# Copyright (C) 1987, 88, 90-5, 1998 Free Software Foundation, Inc.
# Copyright (C) 1987, 88, 90-4, 1995, 1998 Free Software Foundation, Inc.
#This file is part of GNU CC.
@ -105,6 +105,12 @@ VPATH = @srcdir@
# Additional system libraries to link with.
CLIB=
# Top build directory, relative to here.
top_builddir = ..
# Internationalization library.
INTLLIBS = @INTLLIBS@
# Change this to a null string if obstacks are installed in the
# system library.
@ -154,7 +160,8 @@ SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) \
$(INTLLIBS) $(CLIB)
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,

View File

@ -1,5 +1,5 @@
/* Part of CPP library. (memory allocation - xmalloc etc)
Copyright (C) 1986, 87, 89, 92 - 95, 1998 Free Software Foundation, Inc.
Copyright (C) 1986, 87, 89, 92, 93, 94, 1995, 1998 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@ -31,7 +31,7 @@ static void memory_full PROTO ((void)) ATTRIBUTE_NORETURN;
static void
memory_full ()
{
fprintf (stderr, "%s: Memory exhausted.\n", progname);
cpp_notice ("%s: Memory exhausted.\n", progname);
exit (FATAL_EXIT_CODE);
}

View File

@ -1,5 +1,5 @@
/* Default error handlers for CPP Library.
Copyright (C) 1986, 87, 89, 92 - 95, 1998 Free Software Foundation, Inc.
Copyright (C) 1986, 87, 89, 92-95, 1998 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@ -30,6 +30,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif /* not EMACS */
#include "cpplib.h"
#include "intl.h"
/* Print the file names and line numbers of the #include
commands which led to the current file. */
@ -62,10 +63,10 @@ cpp_print_containing_files (pfile)
if (first)
{
first = 0;
fprintf (stderr, "In file included");
cpp_notice ("In file included from ");
}
else
fprintf (stderr, ",\n ");
cpp_notice (",\n from ");
}
fprintf (stderr, " from %s:%ld", ip->nominal_fname, line);
@ -89,27 +90,41 @@ cpp_file_line_for_message (pfile, filename, line, column)
fprintf (stderr, "%s:%d: ", filename, line);
}
/* IS_ERROR is 2 for "fatal" error, 1 for error, 0 for warning */
/* IS_ERROR is 2 for "fatal" error, 1 for error, 0 for warning, -1 for notice */
void
v_cpp_message (pfile, is_error, msg, ap)
v_cpp_message (pfile, is_error, msgid, ap)
cpp_reader * pfile;
int is_error;
const char *msg;
const char *msgid;
va_list ap;
{
if (!is_error)
fprintf (stderr, "warning: ");
else if (is_error == 2)
pfile->errors = CPP_FATAL_LIMIT;
else if (pfile->errors < CPP_FATAL_LIMIT)
pfile->errors++;
vfprintf (stderr, msg, ap);
fprintf (stderr, "\n");
switch (is_error)
{
case -1:
break;
case 0:
fprintf (stderr, _("warning: "));
break;
case 1:
if (pfile->errors < CPP_FATAL_LIMIT)
pfile->errors++;
break;
case 2:
pfile->errors = CPP_FATAL_LIMIT;
break;
default:
abort ();
}
vfprintf (stderr, _(msgid), ap);
if (0 <= is_error)
fprintf (stderr, "\n");
}
void
cpp_message VPROTO ((cpp_reader *pfile, int is_error, const char *msg, ...))
cpp_message VPROTO ((cpp_reader *pfile, int is_error, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader *pfile;
@ -118,15 +133,15 @@ cpp_message VPROTO ((cpp_reader *pfile, int is_error, const char *msg, ...))
#endif
va_list ap;
VA_START (ap, msg);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
is_error = va_arg (ap, int);
msg = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_cpp_message(pfile, is_error, msg, ap);
v_cpp_message(pfile, is_error, msgid, ap);
va_end(ap);
}
@ -137,23 +152,23 @@ cpp_message VPROTO ((cpp_reader *pfile, int is_error, const char *msg, ...))
CPP_FATAL_ERRORS. */
void
cpp_fatal VPROTO ((cpp_reader *pfile, const char *str, ...))
cpp_fatal VPROTO ((cpp_reader *pfile, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader *pfile;
const char *str;
const char *msgid;
#endif
va_list ap;
VA_START (ap, str);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
str = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
fprintf (stderr, "%s: ", progname);
v_cpp_message (pfile, 2, str, ap);
v_cpp_message (pfile, 2, msgid, ap);
va_end(ap);
}
@ -169,3 +184,25 @@ cpp_pfatal_with_name (pfile, name)
exit (FATAL_EXIT_CODE);
#endif
}
/* Print an error message. */
void
cpp_notice VPROTO ((const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, const char *);
#endif
fprintf (stderr, "%s: ", progname);
v_cpp_message ((cpp_reader *) 0, -1, msgid, ap);
va_end(ap);
}

View File

@ -452,11 +452,8 @@ cpp_lex (pfile, skip_evaluation)
&& tok_start[1] == toktab->operator[1])
break;
if (toktab->token == ERROR)
{
char *buf = (char *) alloca (40);
sprintf (buf, "`%s' not allowed in operand of `#if'", tok_start);
cpp_error (pfile, buf);
}
cpp_error (pfile, "`%s' not allowed in operand of `#if'",
tok_start);
op.op = toktab->token;
return op;
}
@ -968,11 +965,11 @@ cpp_parse_expr (pfile)
}
break;
default:
fprintf (stderr,
top[1].op >= ' ' && top[1].op <= '~'
? "unimplemented operator '%c'\n"
: "unimplemented operator '\\%03o'\n",
top[1].op);
cpp_error (pfile,
(top[1].op >= ' ' && top[1].op <= '~'
? "unimplemented operator '%c'\n"
: "unimplemented operator '\\%03o'\n"),
top[1].op);
}
}
if (op.op == 0)

View File

@ -28,6 +28,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "cpplib.h"
#include "cpphash.h"
#include "output.h"
#include "intl.h"
#include "prefix.h"
#ifndef GET_ENV_PATH_LIST
@ -136,7 +137,7 @@ static int comp_def_part PROTO ((int, U_CHAR *, int, U_CHAR *,
#ifdef abort
extern void fancy_abort ();
#endif
static int check_macro_name PROTO ((cpp_reader *, U_CHAR *, char *));
static int check_macro_name PROTO ((cpp_reader *, U_CHAR *, int));
static int compare_defs PROTO ((cpp_reader *,
DEFINITION *, DEFINITION *));
static HOST_WIDE_INT eval_if_expression PROTO ((cpp_reader *));
@ -853,7 +854,7 @@ handle_directive (pfile)
break;
}
/* We may want to pass through #define, #pragma, and #include.
/* We may want to pass through #define, #undef, #pragma, and #include.
Other directives may create output, but we don't want the directive
itself out, so we pop it now. For example conditionals may emit
#failed ... #endfailed stuff. */
@ -1259,7 +1260,7 @@ create_definition (buf, limit, pfile, predefinition)
symname = bp; /* remember where it starts */
sym_length = check_macro_name (pfile, bp, "macro");
sym_length = check_macro_name (pfile, bp, 0);
bp += sym_length;
/* Lossage will occur if identifiers or control keywords are broken
@ -1407,13 +1408,13 @@ create_definition (buf, limit, pfile, predefinition)
}
/* Check a purported macro name SYMNAME, and yield its length.
USAGE is the kind of name this is intended for. */
ASSERTION is nonzero if this is really for an assertion name. */
static int
check_macro_name (pfile, symname, usage)
check_macro_name (pfile, symname, assertion)
cpp_reader *pfile;
U_CHAR *symname;
char *usage;
int assertion;
{
U_CHAR *p;
int sym_length;
@ -1423,16 +1424,19 @@ check_macro_name (pfile, symname, usage)
sym_length = p - symname;
if (sym_length == 0
|| (sym_length == 1 && *symname == 'L' && (*p == '\'' || *p == '"')))
cpp_error (pfile, "invalid %s name", usage);
else if (!is_idstart[*symname]) {
cpp_error (pfile,
assertion ? "invalid assertion name" : "invalid macro name");
else if (!is_idstart[*symname]
|| (! strncmp (symname, "defined", 7) && sym_length == 7)) {
U_CHAR *msg; /* what pain... */
msg = (U_CHAR *) alloca (sym_length + 1);
bcopy (symname, msg, sym_length);
msg[sym_length] = 0;
cpp_error (pfile, "invalid %s name `%s'", usage, msg);
} else {
if (! strncmp (symname, "defined", 7) && sym_length == 7)
cpp_error (pfile, "invalid %s name `defined'", usage);
cpp_error (pfile,
(assertion
? "invalid assertion name `%s'"
: "invalid macro name `%s'"),
msg);
}
return sym_length;
}
@ -1571,18 +1575,12 @@ do_define (pfile, keyword)
/* Print the warning if it's not ok. */
if (!ok)
{
U_CHAR *msg; /* what pain... */
/* If we are passing through #define and #undef directives, do
that for this re-definition now. */
if (CPP_OPTIONS (pfile)->debug_output && keyword)
pass_thru_directive (macro, end, pfile, keyword);
msg = (U_CHAR *) alloca (mdef.symlen + 22);
*msg = '`';
bcopy (mdef.symnam, msg + 1, mdef.symlen);
strcpy ((char *) (msg + mdef.symlen + 1), "' redefined");
cpp_pedwarn (pfile, msg);
cpp_pedwarn (pfile, "`%.*s' redefined", mdef.symlen, mdef.symnam);
if (hp->type == T_MACRO)
cpp_pedwarn_with_file_and_line (pfile, hp->value.defn->file, hp->value.defn->line,
"this is the location of the previous definition");
@ -2934,7 +2932,19 @@ do_include (pfile, keyword)
&& !CPP_BUFFER (pfile)->system_header_p && !pfile->import_warning)
{
pfile->import_warning = 1;
cpp_warning (pfile, "`#import' is obsolete, use an #ifdef wrapper in the header file");
cpp_warning (pfile, "using `#import' is not recommended");
cpp_notice ("The fact that a certain header file need not be processed more than once\n\
should be indicated in the header file, not where it is used.\n\
The best way to do this is with a conditional of this form:\n\
\n\
#ifndef _FOO_H_INCLUDED\n\
#define _FOO_H_INCLUDED\n\
... <real contents of file> ...\n\
#endif /* Not _FOO_H_INCLUDED */\n\
\n\
Then users can use `#include' any number of times.\n\
GNU C automatically avoids processing the file more than once\n\
when it is equipped with such a conditional.\n");
}
pfile->parsing_include_directive++;
@ -3356,7 +3366,7 @@ do_undef (pfile, keyword)
pass_thru_directive (buf, limit, pfile, keyword);
#endif
sym_length = check_macro_name (pfile, name, "macro");
sym_length = check_macro_name (pfile, buf, 0);
while ((hp = cpp_lookup (pfile, name, sym_length, -1)) != NULL)
{
@ -4954,13 +4964,13 @@ cpp_start_read (pfile, fname)
/* With -v, print the list of dirs to search. */
if (opts->verbose) {
struct file_name_list *p;
fprintf (stderr, "#include \"...\" search starts here:\n");
cpp_notice ("#include \"...\" search starts here:\n");
for (p = opts->quote_include; p; p = p->next) {
if (p == opts->bracket_include)
fprintf (stderr, "#include <...> search starts here:\n");
cpp_notice ("#include <...> search starts here:\n");
fprintf (stderr, " %s\n", p->name);
}
fprintf (stderr, "End of search list.\n");
cpp_notice ("End of search list.\n");
}
/* Copy the entire contents of the main input file into
@ -5654,7 +5664,7 @@ cpp_handle_option (pfile, argc, argv)
break;
case 'v':
fprintf (stderr, "GNU CPP version %s", version_string);
cpp_notice ("GNU CPP version %s", version_string);
#ifdef TARGET_VERSION
TARGET_VERSION;
#endif
@ -6213,42 +6223,42 @@ cpp_print_file_and_line (pfile)
}
static void
v_cpp_error (pfile, msg, ap)
v_cpp_error (pfile, msgid, ap)
cpp_reader *pfile;
const char *msg;
const char *msgid;
va_list ap;
{
cpp_print_containing_files (pfile);
cpp_print_file_and_line (pfile);
v_cpp_message (pfile, 1, msg, ap);
v_cpp_message (pfile, 1, msgid, ap);
}
void
cpp_error VPROTO ((cpp_reader * pfile, const char *msg, ...))
cpp_error VPROTO ((cpp_reader * pfile, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader *pfile;
const char *msg;
const char *msgid;
#endif
va_list ap;
VA_START(ap, msg);
VA_START(ap, msgid);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
msg = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_cpp_error (pfile, msg, ap);
v_cpp_error (pfile, msgid, ap);
va_end(ap);
}
/* Print error message but don't count it. */
static void
v_cpp_warning (pfile, msg, ap)
v_cpp_warning (pfile, msgid, ap)
cpp_reader *pfile;
const char *msg;
const char *msgid;
va_list ap;
{
if (CPP_OPTIONS (pfile)->inhibit_warnings)
@ -6259,11 +6269,11 @@ v_cpp_warning (pfile, msg, ap)
cpp_print_containing_files (pfile);
cpp_print_file_and_line (pfile);
v_cpp_message (pfile, 0, msg, ap);
v_cpp_message (pfile, 0, msgid, ap);
}
void
cpp_warning VPROTO ((cpp_reader * pfile, const char *msg, ...))
cpp_warning VPROTO ((cpp_reader * pfile, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader *pfile;
@ -6271,48 +6281,48 @@ cpp_warning VPROTO ((cpp_reader * pfile, const char *msg, ...))
#endif
va_list ap;
VA_START (ap, msg);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
msg = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_cpp_warning (pfile, msg, ap);
v_cpp_warning (pfile, msgid, ap);
va_end(ap);
}
/* Print an error message and maybe count it. */
void
cpp_pedwarn VPROTO ((cpp_reader * pfile, const char *msg, ...))
cpp_pedwarn VPROTO ((cpp_reader * pfile, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader *pfile;
const char *msg;
const char *msgid;
#endif
va_list ap;
VA_START (ap, msg);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
msg = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
if (CPP_OPTIONS (pfile)->pedantic_errors)
v_cpp_error (pfile, msg, ap);
v_cpp_error (pfile, msgid, ap);
else
v_cpp_warning (pfile, msg, ap);
v_cpp_warning (pfile, msgid, ap);
va_end(ap);
}
static void
v_cpp_error_with_line (pfile, line, column, msg, ap)
v_cpp_error_with_line (pfile, line, column, msgid, ap)
cpp_reader * pfile;
int line;
int column;
const char * msg;
const char * msgid;
va_list ap;
{
cpp_buffer *ip = cpp_file_buffer (pfile);
@ -6322,39 +6332,40 @@ v_cpp_error_with_line (pfile, line, column, msg, ap)
if (ip != NULL)
cpp_file_line_for_message (pfile, ip->nominal_fname, line, column);
v_cpp_message (pfile, 1, msg, ap);
v_cpp_message (pfile, 1, msgid, ap);
}
void
cpp_error_with_line VPROTO ((cpp_reader * pfile, int line, int column, const char *msg, ...))
cpp_error_with_line VPROTO ((cpp_reader * pfile, int line, int column,
const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader *pfile;
int line;
int column;
const char *msg;
const char *msgid;
#endif
va_list ap;
VA_START (ap, msg);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
line = va_arg (ap, int);
column = va_arg (ap, int);
msg = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_cpp_error_with_line(pfile, line, column, msg, ap);
v_cpp_error_with_line(pfile, line, column, msgid, ap);
va_end(ap);
}
static void
v_cpp_warning_with_line (pfile, line, column, msg, ap)
v_cpp_warning_with_line (pfile, line, column, msgid, ap)
cpp_reader * pfile;
int line;
int column;
const char *msg;
const char *msgid;
va_list ap;
{
cpp_buffer *ip;
@ -6372,57 +6383,59 @@ v_cpp_warning_with_line (pfile, line, column, msg, ap)
if (ip != NULL)
cpp_file_line_for_message (pfile, ip->nominal_fname, line, column);
v_cpp_message (pfile, 0, msg, ap);
v_cpp_message (pfile, 0, msgid, ap);
}
void
cpp_warning_with_line VPROTO ((cpp_reader * pfile, int line, int column, const char *msg, ...))
cpp_warning_with_line VPROTO ((cpp_reader * pfile, int line, int column,
const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader *pfile;
int line;
int column;
const char *msg;
const char *msgid;
#endif
va_list ap;
VA_START (ap, msg);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
line = va_arg (ap, int);
column = va_arg (ap, int);
msg = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_cpp_warning_with_line (pfile, line, column, msg, ap);
v_cpp_warning_with_line (pfile, line, column, msgid, ap);
va_end(ap);
}
void
cpp_pedwarn_with_line VPROTO ((cpp_reader * pfile, int line, int column, const char *msg, ...))
cpp_pedwarn_with_line VPROTO ((cpp_reader * pfile, int line, int column,
const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader *pfile;
int line;
int column;
const char *msg;
const char *msgid;
#endif
va_list ap;
VA_START (ap, msg);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
line = va_arg (ap, int);
column = va_arg (ap, int);
msg = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
if (CPP_OPTIONS (pfile)->pedantic_errors)
v_cpp_error_with_line (pfile, column, line, msg, ap);
v_cpp_error_with_line (pfile, column, line, msgid, ap);
else
v_cpp_warning_with_line (pfile, line, column, msg, ap);
v_cpp_warning_with_line (pfile, line, column, msgid, ap);
va_end(ap);
}
@ -6430,23 +6443,24 @@ cpp_pedwarn_with_line VPROTO ((cpp_reader * pfile, int line, int column, const c
giving specified file name and line number, not current. */
void
cpp_pedwarn_with_file_and_line VPROTO ((cpp_reader *pfile, char *file, int line, const char *msg, ...))
cpp_pedwarn_with_file_and_line VPROTO ((cpp_reader *pfile, char *file, int line,
const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader *pfile;
char *file;
int line;
const char *msg;
const char *msgid;
#endif
va_list ap;
VA_START (ap, msg);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
file = va_arg (ap, char *);
line = va_arg (ap, int);
msg = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
if (!CPP_OPTIONS (pfile)->pedantic_errors
@ -6454,7 +6468,7 @@ cpp_pedwarn_with_file_and_line VPROTO ((cpp_reader *pfile, char *file, int line,
return;
if (file != NULL)
cpp_file_line_for_message (pfile, file, line, -1);
v_cpp_message (pfile, CPP_OPTIONS (pfile)->pedantic_errors, msg, ap);
v_cpp_message (pfile, CPP_OPTIONS (pfile)->pedantic_errors, msgid, ap);
va_end(ap);
}
@ -6485,7 +6499,7 @@ my_strerror (errnum)
#endif
if (!result)
result = "undocumented I/O error";
result = "errno = ?";
return result;
}

View File

@ -30,6 +30,7 @@ extern char *getenv ();
#endif /* not EMACS */
#include "cpplib.h"
#include "intl.h"
char *progname;
@ -68,6 +69,10 @@ main (argc, argv)
while (p != argv[0] && p[-1] != '/') --p;
progname = p;
setlocale (LC_MESSAGES, "");
bindtextdomain (PACKAGE, localedir);
textdomain (PACKAGE);
cpp_reader_init (&parse_in);
parse_in.opts = opts;

View File

@ -8621,7 +8621,7 @@ cse_main (f, nregs, after_loop, file)
max_qty = val.nsets * 2;
if (file)
fprintf (file, ";; Processing block from %d to %d, %d sets.\n",
fnotice (file, ";; Processing block from %d to %d, %d sets.\n",
INSN_UID (insn), val.last ? INSN_UID (val.last) : 0,
val.nsets);

View File

@ -4771,6 +4771,9 @@ get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode,
else
{
mode = TYPE_MODE (TREE_TYPE (exp));
if (mode == BLKmode)
size_tree = TYPE_SIZE (TREE_TYPE (exp));
*pbitsize = GET_MODE_BITSIZE (mode);
*punsignedp = TREE_UNSIGNED (TREE_TYPE (exp));
}
@ -5600,11 +5603,17 @@ expand_expr (exp, target, tmode, modifier)
p->forced_labels = gen_rtx_EXPR_LIST (VOIDmode,
label_rtx (exp),
p->forced_labels);
p->addresses_labels = 1;
pop_obstacks ();
}
else if (modifier == EXPAND_INITIALIZER)
forced_labels = gen_rtx_EXPR_LIST (VOIDmode,
label_rtx (exp), forced_labels);
else
{
current_function_addresses_labels = 1;
if (modifier == EXPAND_INITIALIZER)
forced_labels = gen_rtx_EXPR_LIST (VOIDmode,
label_rtx (exp),
forced_labels);
}
temp = gen_rtx_MEM (FUNCTION_MODE,
gen_rtx_LABEL_REF (Pmode, label_rtx (exp)));
if (function != current_function_decl
@ -6012,7 +6021,7 @@ expand_expr (exp, target, tmode, modifier)
case EXIT_BLOCK_EXPR:
if (EXIT_BLOCK_RETURN (exp))
really_sorry ("returned value in block_exit_expr");
sorry ("returned value in block_exit_expr");
expand_goto (LABELED_BLOCK_LABEL (EXIT_BLOCK_LABELED_BLOCK (exp)));
return const0_rtx;

View File

@ -64,6 +64,7 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "toplev.h"
#include "reload.h"
#include "intl.h"
/* Get N_SLINE and N_SOL from stab.h if we can expect the file to exist. */
#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
@ -3298,13 +3299,13 @@ alter_cond (cond)
In an `asm', it's the user's fault; otherwise, the compiler's fault. */
void
output_operand_lossage (str)
const char *str;
output_operand_lossage (msgid)
const char *msgid;
{
if (this_is_asm_operands)
error_for_asm (this_is_asm_operands, "invalid `asm': %s", str);
error_for_asm (this_is_asm_operands, "invalid `asm': %s", _(msgid));
else
fatal ("Internal compiler error, output_operand_lossage `%s'", str);
fatal ("Internal compiler error, output_operand_lossage `%s'", _(msgid));
}
/* Output of assembler code from a template, and its subroutines. */

View File

@ -1311,71 +1311,6 @@ main (argc, argv)
return 0;
}
/* Stub error functions. These replace cpperror.c,
because we want to suppress error messages. */
void
cpp_file_line_for_message (pfile, filename, line, column)
cpp_reader * pfile ATTRIBUTE_UNUSED;
char *filename;
int line, column;
{
if (!verbose)
return;
if (column > 0)
fprintf (stderr, "%s:%d:%d: ", filename, line, column);
else
fprintf (stderr, "%s:%d: ", filename, line);
}
void
cpp_print_containing_files (pfile)
cpp_reader *pfile ATTRIBUTE_UNUSED;
{
}
/* IS_ERROR is 2 for fatal error, 1 for error, 0 for warning */
void
v_cpp_message (pfile, is_error, msg, ap)
cpp_reader *pfile;
int is_error;
const char *msg;
va_list ap;
{
if (is_error == 1)
pfile->errors++;
else if (is_error > 1)
pfile->errors = CPP_FATAL_LIMIT;
if (!verbose)
return;
if (!is_error)
fprintf (stderr, "warning: ");
vfprintf (stderr, msg, ap);
fprintf (stderr, "\n");
}
void
cpp_message VPROTO ((cpp_reader *pfile, int is_error, const char *msg, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader *pfile;
int is_error;
const char *msg;
#endif
va_list ap;
VA_START (ap, msg);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
is_error = va_arg (ap, const int);
msg = va_arg (ap, const char *);
#endif
v_cpp_message(pfile, is_error, msg, ap);
va_end(ap);
}
static void
v_fatal (str, ap)
@ -1406,32 +1341,3 @@ fatal VPROTO ((const char *str, ...))
v_fatal(str, ap);
va_end(ap);
}
void
cpp_fatal VPROTO ((cpp_reader * pfile ATTRIBUTE_UNUSED, const char *str, ...))
{
#ifndef ANSI_PROTOTYPES
cpp_reader * pfile;
const char *str;
#endif
va_list ap;
VA_START(ap, str);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
str = va_arg (ap, const char *);
#endif
v_fatal(str, ap);
va_end(ap);
}
void
cpp_pfatal_with_name (pfile, name)
cpp_reader *pfile;
const char *name;
{
cpp_perror_with_name (pfile, name);
exit (FATAL_EXIT_CODE);
}

View File

@ -276,10 +276,14 @@ extern int flag_no_peephole;
extern int flag_volatile;
/* Nonzero means treat all global and extern variables as global. */
/* Nonzero means treat all global and extern variables as volatile. */
extern int flag_volatile_global;
/* Nonzero means treat all static variables as volatile. */
extern int flag_volatile_static;
/* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
operations in the interest of optimization. For example it allows
GCC to assume arguments to sqrt are nonnegative numbers, allowing

View File

@ -17,6 +17,7 @@ host such as a VAX.
If you'd like to work on completing this, please talk to rms@gnu.ai.mit.edu.
--> Double precision floating support added by James Carlson on 20 April 1998.
**
** Pat Wood
@ -54,7 +55,6 @@ If you'd like to work on completing this, please talk to rms@gnu.ai.mit.edu.
*/
/* the following deal with IEEE single-precision numbers */
#define D_PHANTOM_BIT 0x00100000
#define EXCESS 126
#define SIGNBIT 0x80000000
#define HIDDEN (1 << 23)
@ -70,10 +70,12 @@ If you'd like to work on completing this, please talk to rms@gnu.ai.mit.edu.
#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
#define MANTD(fp) (((((fp.l.upper) & 0xFFFFF) | HIDDEND) << 10) | \
(fp.l.lower >> 22))
#define HIDDEND_LL ((long long)1 << 52)
#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
#define PACKD_LL(s,e,m) (((long long)((s)+((e)<<20))<<32)|(m))
/* define SWAP for 386/960 reverse-byte-order brain-damaged CPUs */
union double_long
{
union double_long {
double d;
#ifdef SWAP
struct {
@ -86,7 +88,8 @@ union double_long
unsigned long lower;
} l;
#endif
};
long long ll;
};
union float_long
{
@ -94,38 +97,7 @@ union float_long
long l;
};
struct _ieee {
#ifdef SWAP
unsigned mantissa2 : 32;
unsigned mantissa1 : 20;
unsigned exponent : 11;
unsigned sign : 1;
#else
unsigned exponent : 11;
unsigned sign : 1;
unsigned mantissa2 : 32;
unsigned mantissa1 : 20;
#endif
};
union _doubleu {
double d;
struct _ieee ieee;
#ifdef SWAP
struct {
unsigned long lower;
long upper;
} l;
#else
struct {
long upper;
unsigned long lower;
} l;
#endif
};
/* add two floats */
float
__addsf3 (float a1, float a2)
{
@ -138,18 +110,22 @@ __addsf3 (float a1, float a2)
fl2.f = a2;
/* check for zero args */
if (!fl1.l)
return (fl2.f);
if (!fl1.l) {
fl1.f = fl2.f;
goto test_done;
}
if (!fl2.l)
return (fl1.f);
goto test_done;
exp1 = EXP (fl1.l);
exp2 = EXP (fl2.l);
if (exp1 > exp2 + 25)
return (fl1.l);
if (exp2 > exp1 + 25)
return (fl2.l);
goto test_done;
if (exp2 > exp1 + 25) {
fl1.f = fl2.f;
goto test_done;
}
/* do everything in excess precision so's we can round later */
mant1 = MANT (fl1.l) << 6;
@ -176,8 +152,10 @@ __addsf3 (float a1, float a2)
mant1 = -mant1;
sign = SIGNBIT;
}
else if (!mant1)
return (0);
else if (!mant1) {
fl1.f = 0;
goto test_done;
}
/* normalize up */
while (!(mant1 & 0xE0000000))
@ -211,11 +189,11 @@ __addsf3 (float a1, float a2)
/* pack up and go home */
fl1.l = PACK (sign, exp1, mant1);
test_done:
return (fl1.f);
}
/* subtract two floats */
float
__subsf3 (float a1, float a2)
{
@ -236,7 +214,6 @@ __subsf3 (float a1, float a2)
}
/* compare two floats */
long
__cmpsf2 (float a1, float a2)
{
@ -258,7 +235,6 @@ __cmpsf2 (float a1, float a2)
}
/* multiply two floats */
float
__mulsf3 (float a1, float a2)
{
@ -270,8 +246,10 @@ __mulsf3 (float a1, float a2)
fl1.f = a1;
fl2.f = a2;
if (!fl1.l || !fl2.l)
return (0);
if (!fl1.l || !fl2.l) {
fl1.f = 0;
goto test_done;
}
/* compute sign and exponent */
sign = SIGN (fl1.l) ^ SIGN (fl2.l);
@ -286,29 +264,34 @@ __mulsf3 (float a1, float a2)
result += ((fl1.l & 0xFF) * (fl2.l >> 8)) >> 8;
result += ((fl2.l & 0xFF) * (fl1.l >> 8)) >> 8;
if (result & 0x80000000)
result >>= 2;
if (result & 0x20000000)
{
/* round */
result += 0x80;
result >>= 8;
result += 0x20;
result >>= 6;
}
else
{
/* round */
result += 0x40;
result >>= 7;
result += 0x10;
result >>= 5;
exp--;
}
if (result & (HIDDEN<<1)) {
result >>= 1;
exp++;
}
result &= ~HIDDEN;
/* pack up and go home */
fl1.l = PACK (sign, exp, result);
test_done:
return (fl1.f);
}
/* divide two floats */
float
__divsf3 (float a1, float a2)
{
@ -375,7 +358,6 @@ __divsf3 (float a1, float a2)
}
/* convert int to double */
double
__floatsidf (register long a1)
{
@ -415,8 +397,50 @@ __floatsidf (register long a1)
return (dl.d);
}
/* negate a float */
double
__floatdidf (register long long a1)
{
register int exp = 63 + EXCESSD;
union double_long dl;
dl.l.upper = dl.l.lower = 0;
if (a1 == 0)
return (dl.d);
if (a1 < 0) {
dl.l.upper = SIGNBIT;
a1 = -a1;
}
while (a1 < (long long)1<<54) {
a1 <<= 8;
exp -= 8;
}
while (a1 < (long long)1<<62) {
a1 <<= 1;
exp -= 1;
}
/* pack up and go home */
dl.ll |= (a1 >> 10) & ~HIDDEND_LL;
dl.l.upper |= exp << 20;
return (dl.d);
}
float
__floatsisf (register long a1)
{
(float)__floatsidf(a1);
}
float
__floatdisf (register long long a1)
{
(float)__floatdidf(a1);
}
/* negate a float */
float
__negsf2 (float a1)
{
@ -431,7 +455,6 @@ __negsf2 (float a1)
}
/* negate a double */
double
__negdf2 (double a1)
{
@ -447,7 +470,6 @@ __negdf2 (double a1)
}
/* convert float to double */
double
__extendsfdf2 (float a1)
{
@ -473,7 +495,6 @@ __extendsfdf2 (float a1)
}
/* convert double to float */
float
__truncdfsf2 (double a1)
{
@ -485,7 +506,7 @@ __truncdfsf2 (double a1)
dl1.d = a1;
if (!dl1.l.upper && !dl1.l.lower)
return (0);
return (float)(0);
exp = EXPD (dl1) - EXCESSD + EXCESS;
@ -497,7 +518,7 @@ __truncdfsf2 (double a1)
mant >>= 1;
/* did the round overflow? */
if (mant & 0xFF000000)
if (mant & 0xFE000000)
{
mant >>= 1;
exp++;
@ -511,7 +532,6 @@ __truncdfsf2 (double a1)
}
/* compare two doubles */
long
__cmpdf2 (double a1, double a2)
{
@ -537,7 +557,6 @@ __cmpdf2 (double a1, double a2)
}
/* convert double to int */
long
__fixdfsi (double a1)
{
@ -554,7 +573,7 @@ __fixdfsi (double a1)
l = MANTD (dl1);
if (exp > 0)
return (0x7FFFFFFF | SIGND (dl1)); /* largest integer */
return SIGND(dl1) ? (1<<31) : ((1ul<<31)-1);
/* shift down until exp = 0 or l = 0 */
if (exp < 0 && exp > -32 && l)
@ -565,10 +584,41 @@ __fixdfsi (double a1)
return (SIGND (dl1) ? -l : l);
}
/* convert double to unsigned int */
/* convert double to int */
long long
__fixdfdi (double a1)
{
register union double_long dl1;
register int exp;
register long long l;
unsigned
long __fixunsdfsi (double a1)
dl1.d = a1;
if (!dl1.l.upper && !dl1.l.lower)
return (0);
exp = EXPD (dl1) - EXCESSD - 64;
l = MANTD_LL(dl1);
if (exp > 0) {
l = (long long)1<<63;
if (!SIGND(dl1))
l--;
return l;
}
/* shift down until exp = 0 or l = 0 */
if (exp < 0 && exp > -64 && l)
l >>= -exp;
else
return (0);
return (SIGND (dl1) ? -l : l);
}
/* convert double to unsigned int */
unsigned long
__fixunsdfsi (double a1)
{
register union double_long dl1;
register int exp;
@ -583,7 +633,7 @@ long __fixunsdfsi (double a1)
l = (((((dl1.l.upper) & 0xFFFFF) | HIDDEND) << 11) | (dl1.l.lower >> 21));
if (exp > 0)
return (0xFFFFFFFF); /* largest integer */
return (0xFFFFFFFFul); /* largest integer */
/* shift down until exp = 0 or l = 0 */
if (exp < 0 && exp > -32 && l)
@ -594,245 +644,302 @@ long __fixunsdfsi (double a1)
return (l);
}
/* For now, the hard double-precision routines simply
punt and do it in single */
/* addtwo doubles */
/* convert double to unsigned int */
unsigned long long
__fixunsdfdi (double a1)
{
register union double_long dl1;
register int exp;
register unsigned long long l;
dl1.d = a1;
if (dl1.ll == 0)
return (0);
exp = EXPD (dl1) - EXCESSD - 64;
l = dl1.ll;
if (exp > 0)
return (unsigned long long)-1;
/* shift down until exp = 0 or l = 0 */
if (exp < 0 && exp > -64 && l)
l >>= -exp;
else
return (0);
return (l);
}
/* addtwo doubles */
double
__adddf3 (double a1, double a2)
{
return ((float) a1 + (float) a2);
register long long mant1, mant2;
register union double_long fl1, fl2;
register int exp1, exp2;
int sign = 0;
fl1.d = a1;
fl2.d = a2;
/* check for zero args */
if (!fl2.ll)
goto test_done;
if (!fl1.ll) {
fl1.d = fl2.d;
goto test_done;
}
exp1 = EXPD(fl1);
exp2 = EXPD(fl2);
if (exp1 > exp2 + 54)
goto test_done;
if (exp2 > exp1 + 54) {
fl1.d = fl2.d;
goto test_done;
}
/* do everything in excess precision so's we can round later */
mant1 = MANTD_LL(fl1) << 9;
mant2 = MANTD_LL(fl2) << 9;
if (SIGND(fl1))
mant1 = -mant1;
if (SIGND(fl2))
mant2 = -mant2;
if (exp1 > exp2)
mant2 >>= exp1 - exp2;
else {
mant1 >>= exp2 - exp1;
exp1 = exp2;
}
mant1 += mant2;
if (mant1 < 0) {
mant1 = -mant1;
sign = SIGNBIT;
} else if (!mant1) {
fl1.d = 0;
goto test_done;
}
/* normalize up */
while (!(mant1 & ((long long)7<<61))) {
mant1 <<= 1;
exp1--;
}
/* normalize down? */
if (mant1 & ((long long)3<<62)) {
mant1 >>= 1;
exp1++;
}
/* round to even */
mant1 += (mant1 & (1<<9)) ? (1<<8) : ((1<<8)-1);
/* normalize down? */
if (mant1 & ((long long)3<<62)) {
mant1 >>= 1;
exp1++;
}
/* lose extra precision */
mant1 >>= 9;
/* turn off hidden bit */
mant1 &= ~HIDDEND_LL;
/* pack up and go home */
fl1.ll = PACKD_LL(sign,exp1,mant1);
test_done:
return (fl1.d);
}
/* subtract two doubles */
double
__subdf3 (double a1, double a2)
{
return ((float) a1 - (float) a2);
register union double_long fl1, fl2;
fl1.d = a1;
fl2.d = a2;
/* check for zero args */
if (!fl2.ll)
return (fl1.d);
/* twiddle sign bit and add */
fl2.l.upper ^= SIGNBIT;
if (!fl1.ll)
return (fl2.d);
return __adddf3 (a1, fl2.d);
}
/* multiply two doubles */
double
__muldf3 (double a1, double a2)
{
return ((float) a1 * (float) a2);
register union double_long fl1, fl2;
register unsigned long long result;
register int exp;
int sign;
fl1.d = a1;
fl2.d = a2;
if (!fl1.ll || !fl2.ll) {
fl1.d = 0;
goto test_done;
}
/* compute sign and exponent */
sign = SIGND(fl1) ^ SIGND(fl2);
exp = EXPD(fl1) - EXCESSD;
exp += EXPD(fl2);
fl1.ll = MANTD_LL(fl1);
fl2.ll = MANTD_LL(fl2);
/* the multiply is done as one 31x31 multiply and two 31x21 multiples */
result = (fl1.ll >> 21) * (fl2.ll >> 21);
result += ((fl1.ll & 0x1FFFFF) * (fl2.ll >> 21)) >> 21;
result += ((fl2.ll & 0x1FFFFF) * (fl1.ll >> 21)) >> 21;
result >>= 2;
if (result & ((long long)1<<61)) {
/* round */
result += 1<<8;
result >>= 9;
} else {
/* round */
result += 1<<7;
result >>= 8;
exp--;
}
if (result & (HIDDEND_LL<<1)) {
result >>= 1;
exp++;
}
result &= ~HIDDEND_LL;
/* pack up and go home */
fl1.ll = PACKD_LL(sign,exp,result);
test_done:
return (fl1.d);
}
/*
*
* Name: Barrett Richardson
* E-mail: barrett@iglou.com
* When: Thu Dec 15 10:31:11 EST 1994
*
* callable function:
*
* double __divdf3(double a1, double a2);
*
* Does software divide of a1 / a2.
*
* Based largely on __divsf3() in floatlib.c in the gcc
* distribution.
*
* Purpose: To be used in conjunction with the -msoft-float
* option of gcc. You should be able to tack it to the
* end of floatlib.c included in the gcc distribution,
* and delete the __divdf3() already there which just
* calls the single precision function (or may just
* use the floating point processor with some configurations).
*
* You may use this code for whatever your heart desires.
*/
/*
* Compare the mantissas of two doubles.
* Each mantissa is in two longs.
*
* return 1 if x1's mantissa is greater than x2's
* -1 if x1's mantissa is less than x2's
* 0 if the two mantissa's are equal.
*
* The Mantissas won't fit into a 4 byte word, so they are
* broken up into two parts.
*
* This function is used internally by __divdf3()
*/
int
__dcmp (long x1m1, long x1m2, long x2m1, long x2m2)
{
if (x1m1 > x2m1)
return 1;
if (x1m1 < x2m1)
return -1;
/* If the first word in the two mantissas were equal check the second word */
if (x1m2 > x2m2)
return 1;
if (x1m2 < x2m2)
return -1;
return 0;
}
/* divide two doubles */
double
__divdf3 (double a1, double a2)
{
register union double_long fl1, fl2;
register long long mask,result;
register int exp, sign;
int sign,
exponent,
bit_bucket;
fl1.d = a1;
fl2.d = a2;
register unsigned long mantissa1,
mantissa2,
x1m1,
x1m2,
x2m1,
x2m2,
mask;
/* subtract exponents */
exp = EXPD(fl1) - EXPD(fl2) + EXCESSD;
union _doubleu x1,
x2,
result;
/* compute sign */
sign = SIGND(fl1) ^ SIGND(fl2);
/* numerator zero??? */
if (fl1.ll == 0) {
/* divide by zero??? */
if (fl2.ll == 0)
fl1.ll = ((unsigned long long)1<<63)-1; /* NaN */
else
fl1.ll = 0;
goto test_done;
}
/* return +Inf or -Inf */
if (fl2.ll == 0) {
fl1.ll = PACKD_LL(SIGND(fl1),2047,0);
goto test_done;
}
x1.d = a1;
x2.d = a2;
/* now get mantissas */
fl1.ll = MANTD_LL(fl1);
fl2.ll = MANTD_LL(fl2);
exponent = x1.ieee.exponent - x2.ieee.exponent + EXCESSD;
/* this assures we have 54 bits of precision in the end */
if (fl1.ll < fl2.ll) {
fl1.ll <<= 1;
exp--;
}
sign = x1.ieee.sign ^ x2.ieee.sign;
/* now we perform repeated subtraction of fl2.ll from fl1.ll */
mask = (long long)1<<53;
result = 0;
while (mask) {
if (fl1.ll >= fl2.ll)
{
result |= mask;
fl1.ll -= fl2.ll;
}
fl1.ll <<= 1;
mask >>= 1;
}
x2.ieee.sign = 0; /* don't want the sign bit to affect any zero */
/* comparisons when checking for zero divide */
/* round */
result += 1;
if (!x2.l.lower && !x2.l.upper) { /* check for zero divide */
result.l.lower = 0x0;
if (sign)
result.l.upper = 0xFFF00000; /* negative infinity */
else
result.l.upper = 0x7FF00000; /* positive infinity */
return result.d;
}
/* normalize down */
exp++;
result >>= 1;
if (!x1.l.upper && !x1.l.lower) /* check for 0.0 numerator */
return (0.0);
result &= ~HIDDEND_LL;
x1m1 = x1.ieee.mantissa1 | D_PHANTOM_BIT; /* turn on phantom bit */
x1m2 = x1.ieee.mantissa2;
/* pack up and go home */
fl1.ll = PACKD_LL(sign, exp, result);
x2m1 = x2.ieee.mantissa1 | D_PHANTOM_BIT; /* turn on phantom bit */
x2m2 = x2.ieee.mantissa2;
if (__dcmp(x1m1,x1m2,x2m1,x2m2) < 0) {
/* if x1's mantissa is less than x2's shift it left one and decrement */
/* the exponent to accommodate the change in the mantissa */
x1m1 <<= 1; /* */
bit_bucket = x1m2 >> 31; /* Shift mantissa left one */
x1m1 |= bit_bucket; /* */
x1m2 <<= 1; /* */
exponent--;
}
mantissa1 = 0;
mantissa2 = 0;
/* Get the first part of the results mantissa using successive */
/* subtraction. */
mask = 0x00200000;
while (mask) {
if (__dcmp(x1m1,x1m2,x2m1,x2m2) >= 0) {
/* subtract x2's mantissa from x1's */
mantissa1 |= mask; /* turn on a bit in the result */
if (x2m2 > x1m2)
x1m1--;
x1m2 -= x2m2;
x1m1 -= x2m1;
}
x1m1 <<= 1; /* */
bit_bucket = x1m2 >> 31; /* Shift mantissa left one */
x1m1 |= bit_bucket; /* */
x1m2 <<= 1; /* */
mask >>= 1;
}
/* Get the second part of the results mantissa using successive */
/* subtraction. */
mask = 0x80000000;
while (mask) {
if (__dcmp(x1m1,x1m2,x2m1,x2m2) >= 0) {
/* subtract x2's mantissa from x1's */
mantissa2 |= mask; /* turn on a bit in the result */
if (x2m2 > x1m2)
x1m1--;
x1m2 -= x2m2;
x1m1 -= x2m1;
}
x1m1 <<= 1; /* */
bit_bucket = x1m2 >> 31; /* Shift mantissa left one */
x1m1 |= bit_bucket; /* */
x1m2 <<= 1; /* */
mask >>= 1;
}
/* round up by adding 1 to mantissa */
if (mantissa2 == 0xFFFFFFFF) { /* check for over flow */
/* spill if overflow */
mantissa2 = 0;
mantissa1++;
}
else
mantissa2++;
exponent++; /* increment exponent (mantissa must be shifted right */
/* also) */
/* shift mantissa right one and assume a phantom bit (which really gives */
/* 53 bits of precision in the mantissa) */
mantissa2 >>= 1;
bit_bucket = mantissa1 & 1;
mantissa2 |= (bit_bucket << 31);
mantissa1 >>= 1;
/* put all the info into the result */
result.ieee.exponent = exponent;
result.ieee.sign = sign;
result.ieee.mantissa1 = mantissa1;
result.ieee.mantissa2 = mantissa2;
return result.d;
test_done:
return (fl1.d);
}
int
__gtdf2 (double a1, double a2)
{
return __cmpdf2 ((float) a1, (float) a2) > 0;
}
int
__gedf2 (double a1, double a2)
{
return (__cmpdf2 ((float) a1, (float) a2) >= 0) - 1;
}
int
__ltdf2 (double a1, double a2)
{
return - (__cmpdf2 ((float) a1, (float) a2) < 0);
}
int
__ledf2 (double a1, double a2)
{
return __cmpdf2 ((float) a1, (float) a2) > 0;
}
int
__eqdf2 (double a1, double a2)
{
return *(long long *) &a1 == *(long long *) &a2;
}
int
__nedf2 (double a1, double a2)
{
return *(long long *) &a1 != *(long long *) &a2;
}

View File

@ -3400,9 +3400,10 @@ print_rtl_with_bb (outf, rtx_first)
putc ('\n', outf);
}
if (in_bb_p[ INSN_UID(tmp_rtx)] == NOT_IN_BB
if (in_bb_p[INSN_UID(tmp_rtx)] == NOT_IN_BB
&& GET_CODE (tmp_rtx) != NOTE
&& GET_CODE (tmp_rtx) != BARRIER)
&& GET_CODE (tmp_rtx) != BARRIER
&& ! obey_regdecls)
fprintf (outf, ";; Insn is not within a basic block\n");
else if (in_bb_p[ INSN_UID(tmp_rtx)] == IN_MULTIPLE_BB)
fprintf (outf, ";; Insn is in multiple basic blocks\n");

View File

@ -96,6 +96,7 @@ static tree fold_truthop PROTO((enum tree_code, tree, tree, tree));
static tree strip_compound_expr PROTO((tree, tree));
static int multiple_of_p PROTO((tree, tree, tree));
static tree constant_boolean_node PROTO((int, tree));
static int count_cond PROTO((tree, int));
#ifndef BRANCH_COST
#define BRANCH_COST 1
@ -2760,8 +2761,8 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs)
convert (unsigned_type, rhs),
size_int (lbitsize), 0)))
{
warning ("comparison is always %s due to width of bitfield",
code == NE_EXPR ? "one" : "zero");
warning ("comparison is always %d due to width of bitfield",
code == NE_EXPR);
return convert (compare_type,
(code == NE_EXPR
? integer_one_node : integer_zero_node));
@ -2773,8 +2774,8 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs)
size_int (lbitsize - 1), 0);
if (! integer_zerop (tem) && ! integer_all_onesp (tem))
{
warning ("comparison is always %s due to width of bitfield",
code == NE_EXPR ? "one" : "zero");
warning ("comparison is always %d due to width of bitfield",
code == NE_EXPR);
return convert (compare_type,
(code == NE_EXPR
? integer_one_node : integer_zero_node));
@ -3541,7 +3542,6 @@ fold_range_test (exp)
}
}
return 0;
}
@ -3804,8 +3804,7 @@ fold_truthop (code, truth_type, lhs, rhs)
type, ll_mask)),
0)))
{
warning ("comparison is always %s",
wanted_code == NE_EXPR ? "one" : "zero");
warning ("comparison is always %d", wanted_code == NE_EXPR);
return convert (truth_type,
wanted_code == NE_EXPR
@ -3822,9 +3821,8 @@ fold_truthop (code, truth_type, lhs, rhs)
type, rl_mask)),
0)))
{
warning ("comparison is always %s",
wanted_code == NE_EXPR ? "one" : "zero");
warning ("comparison is always %d", wanted_code == NE_EXPR);
return convert (truth_type,
wanted_code == NE_EXPR
? integer_one_node : integer_zero_node);
@ -3922,7 +3920,7 @@ fold_truthop (code, truth_type, lhs, rhs)
}
else
{
warning ("`and' of mutually exclusive equal-tests is always zero");
warning ("`and' of mutually exclusive equal-tests is always 0");
return convert (truth_type, integer_zero_node);
}
}
@ -3999,6 +3997,27 @@ constant_boolean_node (value, type)
}
}
/* Utility function for the following routine, to see how complex a nesting of
COND_EXPRs can be. EXPR is the expression and LIMIT is a count beyond which
we don't care (to avoid spending too much time on complex expressions.). */
static int
count_cond (expr, lim)
tree expr;
int lim;
{
int true, false;
if (TREE_CODE (expr) != COND_EXPR)
return 0;
else if (lim <= 0)
return 0;
true = count_cond (TREE_OPERAND (expr, 1), lim - 1);
false = count_cond (TREE_OPERAND (expr, 2), lim - 1 - true);
return MIN (lim, 1 + true + false);
}
/* Perform constant folding and related simplification of EXPR.
The related simplifications include x*1 => x, x*0 => 0, etc.,
and application of the associative law.
@ -4222,6 +4241,8 @@ fold (expr)
else if ((TREE_CODE (arg1) == COND_EXPR
|| (TREE_CODE_CLASS (TREE_CODE (arg1)) == '<'
&& TREE_CODE_CLASS (code) != '<'))
&& (TREE_CODE (arg0) != COND_EXPR
|| count_cond (arg0, 25) + count_cond (arg1, 25) <= 25)
&& (! TREE_SIDE_EFFECTS (arg0)
|| (current_function_decl != 0
&& ! contains_placeholder_p (arg0))))
@ -4295,6 +4316,8 @@ fold (expr)
else if ((TREE_CODE (arg0) == COND_EXPR
|| (TREE_CODE_CLASS (TREE_CODE (arg0)) == '<'
&& TREE_CODE_CLASS (code) != '<'))
&& (TREE_CODE (arg1) != COND_EXPR
|| count_cond (arg0, 25) + count_cond (arg1, 25) <= 25)
&& (! TREE_SIDE_EFFECTS (arg1)
|| (current_function_decl != 0
&& ! contains_placeholder_p (arg1))))

View File

@ -148,6 +148,11 @@ int current_function_contains_functions;
int current_function_sp_is_unchanging;
/* Nonzero if the function being compiled has the address of its
labels taken. */
int current_function_addresses_labels;
/* Nonzero if the current function is a thunk (a lightweight function that
just adjusts one of its arguments and forwards to another function), so
we should try to cut corners where we can. */
@ -520,6 +525,7 @@ push_function_context_to (context)
p->has_nonlocal_label = current_function_has_nonlocal_label;
p->has_nonlocal_goto = current_function_has_nonlocal_goto;
p->contains_functions = current_function_contains_functions;
p->addresses_labels = current_function_addresses_labels;
p->is_thunk = current_function_is_thunk;
p->args_size = current_function_args_size;
p->pretend_args_size = current_function_pretend_args_size;
@ -592,6 +598,7 @@ pop_function_context_from (context)
current_function_contains_functions
= p->contains_functions || p->inline_obstacks
|| context == current_function_decl;
current_function_addresses_labels = p->addresses_labels;
current_function_name = p->name;
current_function_decl = p->decl;
current_function_pops_args = p->pops_args;
@ -2670,7 +2677,9 @@ optimize_bit_field (body, insn, equiv_mem)
while (GET_CODE (dest) == SUBREG
&& SUBREG_WORD (dest) == 0
&& (GET_MODE_CLASS (GET_MODE (dest))
== GET_MODE_CLASS (GET_MODE (SUBREG_REG (dest)))))
== GET_MODE_CLASS (GET_MODE (SUBREG_REG (dest))))
&& (GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest)))
<= UNITS_PER_WORD))
dest = SUBREG_REG (dest);
validate_change (insn, &SET_DEST (body), dest, 1);
@ -2860,13 +2869,14 @@ purge_addressof_1 (loc, insn, force, store)
overwriting a REG rtx which is always shared. */
rtx sub = copy_rtx (XEXP (XEXP (x, 0), 0));
if (validate_change (insn, loc, sub, 0))
if (validate_change (insn, loc, sub, 0)
|| validate_replace_rtx (x, sub, insn))
return;
start_sequence ();
if (! validate_change (insn, loc,
force_operand (sub, NULL_RTX),
0))
sub = force_operand (sub, NULL_RTX);
if (! validate_change (insn, loc, sub, 0)
&& ! validate_replace_rtx (x, sub, insn))
abort ();
insns = gen_sequence ();
@ -2877,9 +2887,15 @@ purge_addressof_1 (loc, insn, force, store)
else if (code == MEM && GET_CODE (XEXP (x, 0)) == ADDRESSOF && ! force)
{
rtx sub = XEXP (XEXP (x, 0), 0);
rtx sub2;
if (GET_CODE (sub) == MEM)
sub = gen_rtx_MEM (GET_MODE (x), copy_rtx (XEXP (sub, 0)));
{
sub2 = gen_rtx_MEM (GET_MODE (x), copy_rtx (XEXP (sub, 0)));
MEM_COPY_ATTRIBUTES (sub2, sub);
RTX_UNCHANGING_P (sub2) = RTX_UNCHANGING_P (sub);
sub = sub2;
}
if (GET_CODE (sub) == REG
&& (MEM_VOLATILE_P (x) || GET_MODE (x) == BLKmode))
@ -4083,7 +4099,7 @@ assign_parms (fndecl, second_time)
In this case, we call FUNCTION_ARG with NAMED set to 1 instead of
0 as it was the previous time. */
locate_and_pad_parm (promoted_mode, passed_type,
locate_and_pad_parm (nominal_mode, passed_type,
#ifdef STACK_PARMS_IN_REG_PARM_AREA
1,
#else
@ -4105,9 +4121,9 @@ assign_parms (fndecl, second_time)
rtx offset_rtx = ARGS_SIZE_RTX (stack_offset);
if (offset_rtx == const0_rtx)
stack_parm = gen_rtx_MEM (promoted_mode, internal_arg_pointer);
stack_parm = gen_rtx_MEM (nominal_mode, internal_arg_pointer);
else
stack_parm = gen_rtx_MEM (promoted_mode,
stack_parm = gen_rtx_MEM (nominal_mode,
gen_rtx_PLUS (Pmode,
internal_arg_pointer,
offset_rtx));
@ -4179,6 +4195,8 @@ assign_parms (fndecl, second_time)
to indicate there is no preallocated stack slot for the parm. */
if (entry_parm == stack_parm
|| (GET_CODE (entry_parm) == PARALLEL
&& XEXP (XVECEXP (entry_parm, 0, 0), 0) == NULL_RTX)
#if defined (REG_PARM_STACK_SPACE) && ! defined (MAYBE_REG_PARM_STACK_SPACE)
/* On some machines, even if a parm value arrives in a register
there is still an (uninitialized) stack slot allocated for it.
@ -5546,6 +5564,7 @@ init_function_start (subr, filename, line)
current_function_has_nonlocal_goto = 0;
current_function_contains_functions = 0;
current_function_sp_is_unchanging = 0;
current_function_addresses_labels = 0;
current_function_is_thunk = 0;
current_function_returns_pcc_struct = 0;

View File

@ -80,6 +80,7 @@ struct function
int has_nonlocal_label;
int has_nonlocal_goto;
int contains_functions;
int addresses_labels;
int is_thunk;
rtx nonlocal_goto_handler_slots;
rtx nonlocal_goto_stack_level;

123
gcc/gcc.c
View File

@ -36,6 +36,7 @@ compilation is specified by a string called a "spec". */
#include <signal.h>
#include "obstack.h"
#include "intl.h"
#include "prefix.h"
#ifdef VMS
@ -194,9 +195,12 @@ static void print_multilib_info PROTO((void));
static void pfatal_with_name PROTO((char *)) ATTRIBUTE_NORETURN;
static void perror_with_name PROTO((char *));
static void pfatal_pexecute PROTO((char *, char *)) ATTRIBUTE_NORETURN;
static void fatal PVPROTO((char *, ...)) ATTRIBUTE_NORETURN;
static void error PVPROTO((char *, ...));
static void fatal PVPROTO((char *, ...))
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1;
static void error PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1;
static void notice PVPROTO((char *, ...));
static void display_help PROTO((void));
void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
@ -1039,15 +1043,13 @@ xstrerror(e)
#else
static char buffer[30];
if (!e)
return "cannot access";
return "errno = 0";
if (e > 0 && e < sys_nerr)
return sys_errlist[e];
sprintf (buffer, "Unknown error %d", e);
return buffer;
return "errno = ?";
#endif
}
@ -1152,7 +1154,7 @@ init_spec ()
return; /* already initialized */
if (verbose_flag)
fprintf (stderr, "Using builtin specs.\n");
notice ("Using builtin specs.\n");
#ifdef EXTRA_SPECS
extra_specs = (struct spec_list *)
@ -1237,7 +1239,7 @@ set_spec (name, spec)
#ifdef DEBUG_SPECS
if (verbose_flag)
fprintf (stderr, "Setting spec %s to '%s'\n\n", name, *(sl->ptr_spec));
notice ("Setting spec %s to '%s'\n\n", name, *(sl->ptr_spec));
#endif
/* Free the old spec */
@ -1435,7 +1437,7 @@ read_specs (filename, main_p)
register char *p;
if (verbose_flag)
fprintf (stderr, "Reading specs from %s\n", filename);
notice ("Reading specs from %s\n", filename);
/* Open and stat the file. */
desc = open (filename, O_RDONLY, 0);
@ -1513,7 +1515,7 @@ read_specs (filename, main_p)
if (new_filename)
read_specs (new_filename, FALSE);
else if (verbose_flag)
fprintf (stderr, "Could not find specs file %s\n", p1);
notice ("Could not find specs file %s\n", p1);
continue;
}
else if (!strncmp (p1, "%rename", sizeof "%rename" - 1)
@ -1571,9 +1573,9 @@ read_specs (filename, main_p)
if (verbose_flag)
{
fprintf (stderr, "rename spec %s to %s\n", p1, p2);
notice ("rename spec %s to %s\n", p1, p2);
#ifdef DEBUG_SPECS
fprintf (stderr, "spec is '%s'\n\n", *(sl->ptr_spec));
notice ("spec is '%s'\n\n", *(sl->ptr_spec));
#endif
}
@ -2246,7 +2248,7 @@ execute ()
}
fflush (stderr);
#ifdef DEBUG
fprintf (stderr, "\nGo ahead? (y or n) ");
notice ("\nGo ahead? (y or n) ");
fflush (stderr);
i = getchar ();
if (i != '\n')
@ -2334,7 +2336,7 @@ execute ()
is a null-terminated vector containing the following arguments.
The `live_cond' field is 1 if the switch is true in a conditional spec,
-1 if false (overridden by a later switch), and is initialized to zero.
The `valid' field is nonzero if any spec has looked at this switch;
The `validated' field is nonzero if any spec has looked at this switch;
if it remains zero at the end of the run, it must be meaningless. */
struct switchstr
@ -2342,7 +2344,7 @@ struct switchstr
char *part1;
char **args;
int live_cond;
int valid;
int validated;
};
static struct switchstr *switches;
@ -3129,7 +3131,7 @@ process_command (argc, argv)
switches[n_switches].part1 = "--help";
switches[n_switches].args = 0;
switches[n_switches].live_cond = 0;
switches[n_switches].valid = 0;
switches[n_switches].validated = 0;
n_switches++;
}
@ -3144,7 +3146,7 @@ process_command (argc, argv)
switches[n_switches].part1 = &argv[i][0];
switches[n_switches].args = 0;
switches[n_switches].live_cond = 0;
switches[n_switches].valid = 0;
switches[n_switches].validated = 0;
n_switches++;
}
else if (strncmp (argv[i], "-Wl,", 4) == 0)
@ -3243,15 +3245,15 @@ process_command (argc, argv)
switches[n_switches].args = 0;
switches[n_switches].live_cond = 0;
switches[n_switches].valid = 0;
switches[n_switches].validated = 0;
/* This is always valid, since gcc.c itself understands it. */
if (!strcmp (p, "save-temps"))
switches[n_switches].valid = 1;
switches[n_switches].validated = 1;
else
{
char ch = switches[n_switches].part1[0];
if (ch == 'V' || ch == 'b' || ch == 'B')
switches[n_switches].valid = 1;
switches[n_switches].validated = 1;
}
n_switches++;
}
@ -3407,7 +3409,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
if (i < n_switches)
{
input_from_pipe = 1;
switches[i].valid = 1;
switches[i].validated = 1;
break;
}
else
@ -3593,7 +3595,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
break;
case 'e':
/* {...:%efoo} means report an error with `foo' as error message
/* %efoo means report an error with `foo' as error message
and don't execute any more commands for this file. */
{
char *q = p;
@ -3602,7 +3604,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
buf = (char *) alloca (p - q + 1);
strncpy (buf, q, p - q);
buf[p - q] = 0;
error ("%s", buf);
error (buf);
return -1;
}
break;
@ -4072,8 +4074,8 @@ do_spec_1 (spec, inswitch, soft_matched_part)
{
name = *(sl->ptr_spec);
#ifdef DEBUG_SPECS
fprintf (stderr, "Processing spec %c%s%c, which is '%s'\n",
c, sl->name, (c == '(') ? ')' : ']', name);
notice ("Processing spec %c%s%c, which is '%s'\n",
c, sl->name, (c == '(') ? ')' : ']', name);
#endif
break;
}
@ -4434,7 +4436,7 @@ check_live_switch (switchnum, prefix_length)
for (i = switchnum + 1; i < n_switches; i++)
if (switches[i].part1[0] == 'O')
{
switches[switchnum].valid = 1;
switches[switchnum].validated = 1;
switches[switchnum].live_cond = -1;
return 0;
}
@ -4448,7 +4450,7 @@ check_live_switch (switchnum, prefix_length)
if (switches[i].part1[0] == name[0]
&& ! strcmp (&switches[i].part1[1], &name[4]))
{
switches[switchnum].valid = 1;
switches[switchnum].validated = 1;
switches[switchnum].live_cond = -1;
return 0;
}
@ -4463,7 +4465,7 @@ check_live_switch (switchnum, prefix_length)
&& switches[i].part1[3] == '-'
&& !strcmp (&switches[i].part1[4], &name[1]))
{
switches[switchnum].valid = 1;
switches[switchnum].validated = 1;
switches[switchnum].live_cond = -1;
return 0;
}
@ -4511,7 +4513,7 @@ give_switch (switchnum, omit_first_word, include_blanks)
}
do_spec_1 (" ", 0, NULL_PTR);
switches[switchnum].valid = 1;
switches[switchnum].validated = 1;
}
/* Search for a file named NAME trying various prefixes including the
@ -4625,6 +4627,10 @@ main (argc, argv)
while (p != argv[0] && p[-1] != '/' && p[-1] != DIR_SEPARATOR) --p;
programname = p;
setlocale (LC_MESSAGES, "");
bindtextdomain (PACKAGE, localedir);
textdomain (PACKAGE);
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
signal (SIGINT, fatal_error);
#ifdef SIGHUP
@ -4887,7 +4893,7 @@ main (argc, argv)
/* Warn about any switches that no pass was interested in. */
for (i = 0; (int)i < n_switches; i++)
if (! switches[i].valid)
if (! switches[i].validated)
error ("unrecognized option `-%s'", switches[i].part1);
/* Obey some of the options. */
@ -4958,10 +4964,10 @@ main (argc, argv)
if (! strncmp (version_string, compiler_version, n)
&& compiler_version[n] == 0)
fprintf (stderr, "gcc version %s\n", version_string);
notice ("gcc version %s\n", version_string);
else
fprintf (stderr, "gcc driver version %s executing gcc version %s\n",
version_string, compiler_version);
notice ("gcc driver version %s executing gcc version %s\n",
version_string, compiler_version);
if (n_infiles == 0)
exit (0);
@ -5249,7 +5255,9 @@ static void
pfatal_with_name (name)
char *name;
{
fatal ("%s: %s", name, xstrerror (errno));
perror_with_name (name);
delete_temp_files ();
exit (1);
}
static void
@ -5264,17 +5272,19 @@ pfatal_pexecute (errmsg_fmt, errmsg_arg)
char *errmsg_fmt;
char *errmsg_arg;
{
int save_errno = errno;
if (errmsg_arg)
{
int save_errno = errno;
/* Space for trailing '\0' is in %s. */
char *msg = xmalloc (strlen (errmsg_fmt) + strlen (errmsg_arg));
sprintf (msg, errmsg_fmt, errmsg_arg);
errmsg_fmt = msg;
errno = save_errno;
}
fatal ("%s: %s", errmsg_fmt, xstrerror (save_errno));
pfatal_with_name (errmsg_fmt);
}
/* More 'friendly' abort that prints the line and file.
@ -5289,21 +5299,21 @@ fancy_abort ()
/* Output an error message and exit */
static void
fatal VPROTO((char *format, ...))
fatal VPROTO((char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char *format;
char *msgid;
#endif
va_list ap;
VA_START (ap, format);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
msgid = va_arg (ap, char *);
#endif
fprintf (stderr, "%s: ", programname);
vfprintf (stderr, format, ap);
vfprintf (stderr, _(msgid), ap);
va_end (ap);
fprintf (stderr, "\n");
delete_temp_files ();
@ -5311,25 +5321,44 @@ fatal VPROTO((char *format, ...))
}
static void
error VPROTO((char *format, ...))
error VPROTO((char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char *format;
char *msgid;
#endif
va_list ap;
VA_START (ap, format);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
msgid = va_arg (ap, char *);
#endif
fprintf (stderr, "%s: ", programname);
vfprintf (stderr, format, ap);
vfprintf (stderr, _(msgid), ap);
va_end (ap);
fprintf (stderr, "\n");
}
static void
notice VPROTO((char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, char *);
#endif
vfprintf (stderr, _(msgid), ap);
va_end (ap);
}
static void
validate_all_switches ()
@ -5401,7 +5430,7 @@ validate_switches (start)
--p;
for (i = 0; i < n_switches; i++)
if (!strncmp (switches[i].part1, filter, p - filter))
switches[i].valid = 1;
switches[i].validated = 1;
}
else
{
@ -5410,7 +5439,7 @@ validate_switches (start)
{
if (!strncmp (switches[i].part1, filter, p - filter)
&& switches[i].part1[p - filter] == 0)
switches[i].valid = 1;
switches[i].validated = 1;
}
}
}

View File

@ -1,6 +1,6 @@
/* Gcov.c: prepend line execution counts and branch probabilities to a
source file.
Copyright (C) 1990, 91, 92, 93, 94, 96, 97, 1998 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 96, 1997, 1998 Free Software Foundation, Inc.
Contributed by James E. Wilson of Cygnus Support.
Mangled by Bob Manson of Cygnus Support.
@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "intl.h"
#include "gcov-io.h"
@ -224,6 +225,10 @@ main (argc, argv)
int argc;
char **argv;
{
setlocale (LC_MESSAGES, "");
bindtextdomain (PACKAGE, localedir);
textdomain (PACKAGE);
process_args (argc, argv);
open_files ();
@ -237,6 +242,26 @@ main (argc, argv)
return 0;
}
static void fnotice PVPROTO ((const char *, ...)) ATTRIBUTE_PRINTF_1;
static void
fnotice VPROTO ((const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, const char *);
#endif
vfprintf (stderr, _(msgid), ap);
va_end (ap);
}
PTR
xmalloc (size)
size_t size;
@ -244,7 +269,7 @@ xmalloc (size)
register PTR value = (PTR) malloc (size);
if (value == 0)
{
fprintf (stderr, "error: virtual memory exhausted");
fnotice (stderr, "error: virtual memory exhausted");
exit (FATAL_EXIT_CODE);
}
return value;
@ -256,7 +281,7 @@ xmalloc (size)
void
fancy_abort ()
{
fprintf (stderr, "Internal gcc abort.\n");
fnotice (stderr, "Internal gcc abort.\n");
exit (FATAL_EXIT_CODE);
}
@ -265,7 +290,7 @@ fancy_abort ()
static void
print_usage ()
{
fprintf (stderr, "gcov [-b] [-v] [-n] [-l] [-f] [-o OBJDIR] file\n");
fnotice (stderr, "gcov [-b] [-v] [-n] [-l] [-f] [-o OBJDIR] file\n");
exit (FATAL_EXIT_CODE);
}
@ -383,7 +408,7 @@ open_files ()
bb_file = fopen (bb_file_name, "r");
if (bb_file == NULL)
{
fprintf (stderr, "Could not open basic block file %s.\n", bb_file_name);
fnotice (stderr, "Could not open basic block file %s.\n", bb_file_name);
exit (FATAL_EXIT_CODE);
}
@ -392,14 +417,14 @@ open_files ()
da_file = fopen (da_file_name, "r");
if (da_file == NULL)
{
fprintf (stderr, "Could not open data file %s.\n", da_file_name);
fprintf (stderr, "Assuming that all execution counts are zero.\n");
fnotice (stderr, "Could not open data file %s.\n", da_file_name);
fnotice (stderr, "Assuming that all execution counts are zero.\n");
}
bbg_file = fopen (bbg_file_name, "r");
if (bbg_file == NULL)
{
fprintf (stderr, "Could not open program flow graph file %s.\n",
fnotice (stderr, "Could not open program flow graph file %s.\n",
bbg_file_name);
exit (FATAL_EXIT_CODE);
}
@ -410,7 +435,7 @@ open_files ()
ungetc (getc (bbg_file), bbg_file);
if (feof (bbg_file))
{
fprintf (stderr, "No executable code associated with file %s.\n",
fnotice (stderr, "No executable code associated with file %s.\n",
input_file_name);
exit (FATAL_EXIT_CODE);
}
@ -711,10 +736,10 @@ read_files ()
if (da_file)
{
if (feof (da_file))
fprintf (stderr, ".da file contents exhausted too early\n");
fnotice (stderr, ".da file contents exhausted too early\n");
/* Should be at end of file now. */
if (__read_long (&total, da_file, 8) == 0)
fprintf (stderr, ".da file contents not exhausted\n");
fnotice (stderr, ".da file contents not exhausted\n");
}
/* Calculate all of the basic block execution counts and branch
@ -895,33 +920,33 @@ static void
function_summary ()
{
if (function_source_lines)
fprintf (stdout, "%6.2f%% of %d source lines executed in function %s\n",
fnotice (stdout, "%6.2lf%% of %d source lines executed in function %s\n",
(((double) function_source_lines_executed / function_source_lines)
* 100), function_source_lines, function_name);
else
fprintf (stdout, "No executable source lines in function %s\n",
fnotice (stdout, "No executable source lines in function %s\n",
function_name);
if (output_branch_probs)
{
if (function_branches)
{
fprintf (stdout, "%6.2f%% of %d branches executed in function %s\n",
fnotice (stdout, "%6.2lf%% of %d branches executed in function %s\n",
(((double) function_branches_executed / function_branches)
* 100), function_branches, function_name);
fprintf (stdout,
"%6.2f%% of %d branches taken at least once in function %s\n",
fnotice (stdout,
"%6.2lf%% of %d branches taken at least once in function %s\n",
(((double) function_branches_taken / function_branches)
* 100), function_branches, function_name);
}
else
fprintf (stdout, "No branches in function %s\n", function_name);
fnotice (stdout, "No branches in function %s\n", function_name);
if (function_calls)
fprintf (stdout, "%6.2f%% of %d calls executed in function %s\n",
fnotice (stdout, "%6.2lf%% of %d calls executed in function %s\n",
(((double) function_calls_executed / function_calls)
* 100), function_calls, function_name);
else
fprintf (stdout, "No calls in function %s\n", function_name);
fnotice (stdout, "No calls in function %s\n", function_name);
}
}
@ -1052,10 +1077,10 @@ output_data ()
}
else
{
fprintf (stderr,
fnotice (stderr,
"didn't use all bb entries of graph, function %s\n",
function_name);
fprintf (stderr, "block_num = %ld, num_blocks = %d\n",
fnotice (stderr, "block_num = %d, num_blocks = %d\n",
block_num, current_graph->num_blocks);
}
@ -1093,7 +1118,7 @@ output_data ()
if (block_num >= current_graph->num_blocks)
{
fprintf (stderr, "ERROR: too many basic blocks in .bb file %s\n",
fnotice (stderr, "ERROR: too many basic blocks in .bb file %s\n",
function_name);
abort ();
}
@ -1169,34 +1194,34 @@ output_data ()
}
if (total_source_lines)
fprintf (stdout,
"%6.2f%% of %d source lines executed in file %s\n",
fnotice (stdout,
"%6.2lf%% of %d source lines executed in file %s\n",
(((double) total_source_lines_executed / total_source_lines)
* 100), total_source_lines, source_file_name);
else
fprintf (stdout, "No executable source lines in file %s\n",
fnotice (stdout, "No executable source lines in file %s\n",
source_file_name);
if (output_branch_probs)
{
if (total_branches)
{
fprintf (stdout, "%6.2f%% of %d branches executed in file %s\n",
fnotice (stdout, "%6.2lf%% of %d branches executed in file %s\n",
(((double) total_branches_executed / total_branches)
* 100), total_branches, source_file_name);
fprintf (stdout,
"%6.2f%% of %d branches taken at least once in file %s\n",
fnotice (stdout,
"%6.2lf%% of %d branches taken at least once in file %s\n",
(((double) total_branches_taken / total_branches)
* 100), total_branches, source_file_name);
}
else
fprintf (stdout, "No branches in file %s\n", source_file_name);
fnotice (stdout, "No branches in file %s\n", source_file_name);
if (total_calls)
fprintf (stdout, "%6.2f%% of %d calls executed in file %s\n",
fnotice (stdout, "%6.2lf%% of %d calls executed in file %s\n",
(((double) total_calls_executed / total_calls)
* 100), total_calls, source_file_name);
else
fprintf (stdout, "No calls in file %s\n", source_file_name);
fnotice (stdout, "No calls in file %s\n", source_file_name);
}
if (output_gcov_file)
@ -1208,7 +1233,7 @@ output_data ()
source_file = fopen (source_file_name, "r");
if (source_file == NULL)
{
fprintf (stderr, "Could not open source file %s.\n",
fnotice (stderr, "Could not open source file %s.\n",
source_file_name);
free (line_counts);
free (line_exists);
@ -1258,7 +1283,7 @@ output_data ()
if (gcov_file == NULL)
{
fprintf (stderr, "Could not open output file %s.\n",
fnotice (stderr, "Could not open output file %s.\n",
gcov_file_name);
fclose (source_file);
free (line_counts);
@ -1266,7 +1291,7 @@ output_data ()
continue;
}
fprintf (stdout, "Creating %s.\n", gcov_file_name);
fnotice (stdout, "Creating %s.\n", gcov_file_name);
for (count = 1; count < s_ptr->maxlineno; count++)
{
@ -1310,19 +1335,19 @@ output_data ()
if (a_ptr->call_insn)
{
if (a_ptr->prob == -1)
fprintf (gcov_file, "call %d never executed\n", i);
fnotice (gcov_file, "call %d never executed\n", i);
else
fprintf (gcov_file,
fnotice (gcov_file,
"call %d returns = %d%%\n",
i, 100 - a_ptr->prob);
}
else
{
if (a_ptr->prob == -1)
fprintf (gcov_file, "branch %d never executed\n",
fnotice (gcov_file, "branch %d never executed\n",
i);
else
fprintf (gcov_file, "branch %d taken = %d%%\n", i,
fnotice (gcov_file, "branch %d taken = %d%%\n", i,
a_ptr->prob);
}
}
@ -1331,7 +1356,7 @@ output_data ()
/* Gracefully handle errors while reading the source file. */
if (retval == NULL)
{
fprintf (stderr,
fnotice (stderr,
"Unexpected EOF while reading source file %s.\n",
source_file_name);
break;

View File

@ -28,20 +28,6 @@ char *progname;
int hash_tab[HASH_SIZE];
int next_index;
int
hashf (name, len, hashsize)
register const U_CHAR *name;
register int len;
int hashsize;
{
register int r = 0;
while (len--)
r = HASHSTEP (r, *name++);
return MAKE_POS (r) % hashsize;
}
static void
add_hash (fname)
char *fname;

View File

@ -15,6 +15,7 @@ install procedures. It is provided for historical reference only.
@cindex installing GNU CC
@menu
* Configuration Files:: Files created by running @code{configure}.
* Configurations:: Configurations Supported by GNU CC.
* Other Dir:: Compiling in a separate directory (not where the source is).
* Cross-Compiler:: Building and installing a cross-compiler.
@ -24,11 +25,11 @@ install procedures. It is provided for historical reference only.
* Header Dirs:: Understanding the standard header file directories.
@end menu
Here is the procedure for installing GNU CC on a Unix system. See
@ref{VMS Install}, for VMS systems. In this section we assume you
Here is the procedure for installing GNU CC on a GNU or Unix system.
See @ref{VMS Install}, for VMS systems. In this section we assume you
compile in the same directory that contains the source files; see
@ref{Other Dir}, to find out how to compile in a separate directory on Unix
systems.
@ref{Other Dir}, to find out how to compile in a separate directory on
Unix systems.
You cannot install GNU C by itself on MSDOS; it will not compile under
any MSDOS compiler except itself. You need to get the complete
@ -49,9 +50,32 @@ On a System V release 4 system, make sure @file{/usr/bin} precedes
@file{/usr/ucb} in @code{PATH}. The @code{cc} command in
@file{/usr/ucb} uses libraries which have bugs.
@cindex Bison parser generator
@cindex parser generator, Bison
@item
Make sure the Bison parser generator is installed. (This is
unnecessary if the Bison output files @file{c-parse.c} and
@file{cexp.c} are more recent than @file{c-parse.y} and @file{cexp.y}
and you do not plan to change the @samp{.y} files.)
Bison versions older than Sept 8, 1988 will produce incorrect output
for @file{c-parse.c}.
@item
If you have chosen a configuration for GNU CC which requires other GNU
tools (such as GAS or the GNU linker) instead of the standard system
tools, install the required tools in the build directory under the names
@file{as}, @file{ld} or whatever is appropriate. This will enable the
compiler to find the proper tools for compilation of the program
@file{enquire}.
Alternatively, you can do subsequent compilation using a value of the
@code{PATH} environment variable such that the necessary GNU tools come
before the standard system tools.
@item
Specify the host, build and target machine configurations. You do this
by running the file @file{configure}.
when you run the @file{configure} script.
The @dfn{build} machine is the system which you are using, the
@dfn{host} machine is the system where you want to run the resulting
@ -100,10 +124,11 @@ See @ref{Configurations}, for a list of supported configuration names and
notes on many of the configurations. You should check the notes in that
section before proceeding any further with the installation of GNU CC.
There are four additional options you can specify independently to
describe variant hardware and software configurations. These are
@samp{--with-gnu-as}, @samp{--with-gnu-ld}, @samp{--with-stabs} and
@samp{--nfp}.
@item
When running @code{configure}, you may also need to specify certain
additional options that describe variant hardware and software
configurations. These are @samp{--with-gnu-as}, @samp{--with-gnu-ld},
@samp{--with-stabs} and @samp{--nfp}.
@table @samp
@item --with-gnu-as
@ -253,15 +278,40 @@ machine-description macro file for your target machine. It should be in
the subdirectory @file{config} and its name is often
@file{@var{machine}.h}.
@item
The command file @file{configure} also constructs the file
@file{Makefile} by adding some text to the template file
@file{Makefile.in}. The additional text comes from files in the
@file{config} directory, named @file{t-@var{target}} and
@file{x-@var{host}}. If these files do not exist, it means nothing
needs to be added for a given target or host.
@end itemize
@cindex Native Language Support
@cindex NLS
@item --enable-nls
@itemx --disable-nls
The @samp{--enable-nls} option enables Native Language Support (NLS),
which lets GCC output diagnostics in languages other than American
English. No translations are available yet, so the main users of this
option now are those translating GCC's diagnostics who want to test
their work. Once translations become available, Native Language Support
will become enabled by default. The @samp{--disable-nls} option
disables NLS.
@cindex @code{gettext}
@item --with-included-gettext
If NLS is enabled, the GCC build procedure normally attempts to use the
host's @code{gettext} libraries, and falls back on GCC's copy of the GNU
@code{gettext} library only if the host libraries do not suffice. The
@samp{--with-included-gettext} option causes the build procedure to
prefer its copy of GNU @code{gettext}.
@cindex @code{catgets}
@item --with-catgets
If NLS is enabled, and if the host lacks @code{gettext} but has the
inferior @code{catgets} interface, the GCC build procedure normally
ignores @code{catgets} and instead uses GCC's copy of the GNU
@code{gettext} library. The @samp{--with-catgets} option causes the
build procedure to use the host's @code{catgets} in this situation.
@end table
@item
In certain cases, you should specify certain other options when you run
@code{configure}.
@itemize @bullet
@item
The standard directory for installing GNU CC is @file{/usr/local/lib}.
If you want to install its files somewhere else, specify
@ -303,29 +353,7 @@ Indications are that people who use this option use it based on
mistaken ideas of what it is for. People use it as if it specified
where to install part of GNU CC. Perhaps they make this assumption
because installing GNU CC creates the directory.
@cindex Bison parser generator
@cindex parser generator, Bison
@item
Make sure the Bison parser generator is installed. (This is
unnecessary if the Bison output files @file{c-parse.c} and
@file{cexp.c} are more recent than @file{c-parse.y} and @file{cexp.y}
and you do not plan to change the @samp{.y} files.)
Bison versions older than Sept 8, 1988 will produce incorrect output
for @file{c-parse.c}.
@item
If you have chosen a configuration for GNU CC which requires other GNU
tools (such as GAS or the GNU linker) instead of the standard system
tools, install the required tools in the build directory under the names
@file{as}, @file{ld} or whatever is appropriate. This will enable the
compiler to find the proper tools for compilation of the program
@file{enquire}.
Alternatively, you can do subsequent compilation using a value of the
@code{PATH} environment variable such that the necessary GNU tools come
before the standard system tools.
@end itemize
@item
Build the compiler. Just type @samp{make LANGUAGES=c} in the compiler
@ -360,9 +388,9 @@ should be investigated and reported (@pxref{Bugs}).
should be investigated and reported.
@end ifset
Some commercial compilers fail to compile GNU CC because they have bugs
or limitations. For example, the Microsoft compiler is said to run out
of macro space. Some Ultrix compilers run out of expression space; then
Some compilers fail to compile GNU CC because they have bugs or
limitations. For example, the Microsoft compiler is said to run out of
macro space. Some Ultrix compilers run out of expression space; then
you need to break up the statement where the problem happens.
@item
@ -457,8 +485,8 @@ instead of making @file{stage1}, @file{stage2}, and performing
the two compiler builds.
@item
Then compare the latest object files with the stage 2 object
files---they ought to be identical, aside from time stamps (if any).
Compare the latest object files with the stage 2 object files---they
ought to be identical, aside from time stamps (if any).
On some systems, meaningful comparison of object files is impossible;
they always appear ``different.'' This is currently true on Solaris and
@ -546,11 +574,8 @@ compiler.)
@item
@cindex C++ runtime library
@cindex @code{libstdc++}
If you're going to use C++, it's likely that you need to also install
a C++ runtime library. Just as GNU C does not
distribute a C runtime library, it also does not include a C++ runtime
library. All I/O functionality, special class libraries, etc., are
provided by the C++ runtime library.
If you're going to use C++, you need to install the C++ runtime library.
This includes all I/O functionality, special class libraries, etc.
The standard C++ runtime library for GNU CC is called @samp{libstdc++}.
An obsolescent library @samp{libg++} may also be available, but it's
@ -643,6 +668,56 @@ Microsoft Win32 API thread support.
@end itemize
@end enumerate
@node Configuration Files
@section Files Created by @code{configure}
Here we spell out what files will be set up by @code{configure}. Normally
you need not be concerned with these files.
@itemize @bullet
@item
@ifset INTERNALS
A file named @file{config.h} is created that contains a @samp{#include}
of the top-level config file for the machine you will run the compiler
on (@pxref{Config}). This file is responsible for defining information
about the host machine. It includes @file{tm.h}.
@end ifset
@ifclear INTERNALS
A file named @file{config.h} is created that contains a @samp{#include}
of the top-level config file for the machine you will run the compiler
on (@pxref{Config,,The Configuration File, gcc.info, Using and Porting
GCC}). This file is responsible for defining information about the host
machine. It includes @file{tm.h}.
@end ifclear
The top-level config file is located in the subdirectory @file{config}.
Its name is always @file{xm-@var{something}.h}; usually
@file{xm-@var{machine}.h}, but there are some exceptions.
If your system does not support symbolic links, you might want to
set up @file{config.h} to contain a @samp{#include} command which
refers to the appropriate file.
@item
A file named @file{tconfig.h} is created which includes the top-level config
file for your target machine. This is used for compiling certain
programs to run on that machine.
@item
A file named @file{tm.h} is created which includes the
machine-description macro file for your target machine. It should be in
the subdirectory @file{config} and its name is often
@file{@var{machine}.h}.
@item
The command file @file{configure} also constructs the file
@file{Makefile} by adding some text to the template file
@file{Makefile.in}. The additional text comes from files in the
@file{config} directory, named @file{t-@var{target}} and
@file{x-@var{host}}. If these files do not exist, it means nothing
needs to be added for a given target or host.
@end itemize
@node Configurations
@section Configurations Supported by GNU CC
@cindex configurations supported by GNU CC

View File

@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "function.h"
#include "toplev.h"
#include "intl.h"
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
@ -106,7 +107,7 @@ get_label_from_map (map, i)
/* Zero if the current function (whose FUNCTION_DECL is FNDECL)
is safe and reasonable to integrate into other functions.
Nonzero means value is a warning message with a single %s
Nonzero means value is a warning msgid with a single %s
for the function's name. */
char *
@ -123,20 +124,20 @@ function_cannot_inline_p (fndecl)
/* No inlines with varargs. */
if ((last && TREE_VALUE (last) != void_type_node)
|| current_function_varargs)
return "varargs function cannot be inline";
return N_("varargs function cannot be inline");
if (current_function_calls_alloca)
return "function using alloca cannot be inline";
return N_("function using alloca cannot be inline");
if (current_function_contains_functions)
return "function with nested functions cannot be inline";
return N_("function with nested functions cannot be inline");
if (current_function_cannot_inline)
return current_function_cannot_inline;
/* If its not even close, don't even look. */
if (!DECL_INLINE (fndecl) && get_max_uid () > 3 * max_insns)
return "function too large to be inline";
return N_("function too large to be inline");
#if 0
/* Don't inline functions which do not specify a function prototype and
@ -146,27 +147,27 @@ function_cannot_inline_p (fndecl)
if (TYPE_MODE (TREE_TYPE (parms)) == BLKmode)
TREE_ADDRESSABLE (parms) = 1;
if (last == NULL_TREE && TREE_ADDRESSABLE (parms))
return "no prototype, and parameter address used; cannot be inline";
return N_("no prototype, and parameter address used; cannot be inline");
}
#endif
/* We can't inline functions that return structures
the old-fashioned PCC way, copying into a static block. */
if (current_function_returns_pcc_struct)
return "inline functions not supported for this return value type";
return N_("inline functions not supported for this return value type");
/* We can't inline functions that return structures of varying size. */
if (int_size_in_bytes (TREE_TYPE (TREE_TYPE (fndecl))) < 0)
return "function with varying-size return value cannot be inline";
return N_("function with varying-size return value cannot be inline");
/* Cannot inline a function with a varying size argument or one that
receives a transparent union. */
for (parms = DECL_ARGUMENTS (fndecl); parms; parms = TREE_CHAIN (parms))
{
if (int_size_in_bytes (TREE_TYPE (parms)) < 0)
return "function with varying-size parameter cannot be inline";
return N_("function with varying-size parameter cannot be inline");
else if (TYPE_TRANSPARENT_UNION (TREE_TYPE (parms)))
return "function with transparent unit parameter cannot be inline";
return N_("function with transparent unit parameter cannot be inline");
}
if (!DECL_INLINE (fndecl) && get_max_uid () > max_insns)
@ -178,22 +179,23 @@ function_cannot_inline_p (fndecl)
ninsns++;
if (ninsns >= max_insns)
return "function too large to be inline";
return N_("function too large to be inline");
}
/* We cannot inline this function if forced_labels is non-zero. This
implies that a label in this function was used as an initializer.
Because labels can not be duplicated, all labels in the function
will be renamed when it is inlined. However, there is no way to find
and fix all variables initialized with addresses of labels in this
/* We cannot inline this function it has the addresses of its labels
taken. This can mean that a label in this function was used as an
initializer either statically or dynamically or stored outside the
function. Because labels can not be duplicated, all labels in the
function will be renamed when it is inlined. However, there is no way
to find and fix all variables initialized with addresses of labels in this
function, hence inlining is impossible. */
if (forced_labels)
return "function with label addresses used in initializers cannot inline";
if (current_function_addresses_labels)
return N_("function with label addresses taken cannot inline");
/* We cannot inline a nested function that jumps to a nonlocal label. */
if (current_function_has_nonlocal_goto)
return "function with nonlocal goto cannot be inline";
return N_("function with nonlocal goto cannot be inline");
/* This is a hack, until the inliner is taught about eh regions at
the start of the function. */
@ -205,13 +207,13 @@ function_cannot_inline_p (fndecl)
{
if (insn && GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
return "function with complex parameters cannot be inline";
return N_("function with complex parameters cannot be inline");
}
/* We can't inline functions that return a PARALLEL rtx. */
result = DECL_RTL (DECL_RESULT (fndecl));
if (result && GET_CODE (result) == PARALLEL)
return "inline functions not supported for this return value type";
return N_("inline functions not supported for this return value type");
return 0;
}
@ -292,12 +294,16 @@ initialize_for_inline (fndecl, min_labelno, max_labelno, max_reg, copy)
+ current_function_calls_setjmp * FUNCTION_FLAGS_CALLS_SETJMP
+ current_function_calls_longjmp * FUNCTION_FLAGS_CALLS_LONGJMP
+ current_function_returns_struct * FUNCTION_FLAGS_RETURNS_STRUCT
+ current_function_returns_pcc_struct * FUNCTION_FLAGS_RETURNS_PCC_STRUCT
+ (current_function_returns_pcc_struct
* FUNCTION_FLAGS_RETURNS_PCC_STRUCT)
+ current_function_needs_context * FUNCTION_FLAGS_NEEDS_CONTEXT
+ current_function_has_nonlocal_label * FUNCTION_FLAGS_HAS_NONLOCAL_LABEL
+ (current_function_has_nonlocal_label
* FUNCTION_FLAGS_HAS_NONLOCAL_LABEL)
+ current_function_returns_pointer * FUNCTION_FLAGS_RETURNS_POINTER
+ current_function_uses_const_pool * FUNCTION_FLAGS_USES_CONST_POOL
+ current_function_uses_pic_offset_table * FUNCTION_FLAGS_USES_PIC_OFFSET_TABLE);
+ (current_function_uses_pic_offset_table
* FUNCTION_FLAGS_USES_PIC_OFFSET_TABLE)
+ current_function_addresses_labels * FUNCTION_FLAGS_ADDRESSES_LABELS);
/* Clear out PARMDECL_MAP. It was allocated in the caller's frame. */
bzero ((char *) parmdecl_map, max_parm_reg * sizeof (tree));
@ -3403,6 +3409,9 @@ output_inline_function (fndecl)
stack_slot_list = STACK_SLOT_LIST (head);
forced_labels = FORCED_LABELS (head);
if (FUNCTION_FLAGS (head) & FUNCTION_FLAGS_ADDRESSES_LABELS)
current_function_addresses_labels = 1;
if (FUNCTION_FLAGS (head) & FUNCTION_FLAGS_CALLS_ALLOCA)
current_function_calls_alloca = 1;

View File

@ -409,7 +409,7 @@ in the following sections.
-fno-common -fno-ident -fno-gnu-linker
-fpcc-struct-return -fpic -fPIC
-freg-struct-return -fshared-data -fshort-enums
-fshort-double -fvolatile -fvolatile-global
-fshort-double -fvolatile -fvolatile-global -fvolatile-static
-fverbose-asm -fpack-struct -fstack-check
-fargument-alias -fargument-noalias
-fargument-noalias-global
@ -696,7 +696,7 @@ other, C++-specific, extension keywords such as @code{headof}.
@findex strcmp
@findex strcpy
@findex strlen
Don't recognize builtin functions that do not begin with `__builtin_'
Don't recognize builtin functions that do not begin with @samp{__builtin_}
as prefix. Currently, the functions affected include @code{abort},
@code{abs}, @code{alloca}, @code{cos}, @code{exit}, @code{fabs},
@code{ffs}, @code{labs}, @code{memcmp}, @code{memcpy}, @code{sin},
@ -5938,7 +5938,11 @@ Consider all memory references through pointers to be volatile.
@item -fvolatile-global
Consider all memory references to extern and global data items to
be volatile.
be volatile. GNU CC does not consider static data items to be volatile
because of this switch.
@item -fvolatile-static
Consider all memory references to static data to be volatile.
@item -fpic
@cindex global offset table
@ -6173,6 +6177,46 @@ CC. @xref{Driver}.
@end ifset
@table @code
@item LANG
@itemx LC_CTYPE
@c @itemx LC_COLLATE
@itemx LC_MESSAGES
@c @itemx LC_MONETARY
@c @itemx LC_NUMERIC
@c @itemx LC_TIME
@itemx LC_ALL
@findex LANG
@findex LC_CTYPE
@c @findex LC_COLLATE
@findex LC_MESSAGES
@c @findex LC_MONETARY
@c @findex LC_NUMERIC
@c @findex LC_TIME
@findex LC_ALL
@cindex locale
These environment variables control the way that GNU CC uses
localization information that allow GNU CC to work with different
national conventions. GNU CC inspects the locale categories
@code{LC_CTYPE} and @code{LC_MESSAGES} if it has been configured to do
so. These locale categories can be set to any value supported by your
installation. A typical value is @samp{en_UK} for English in the United
Kingdom.
The @code{LC_CTYPE} environment variable specifies character
classification. GNU CC uses it to determine the character boundaries in
a string; this is needed for some multibyte encodings that contain quote
and escape characters that would otherwise be interpreted as a string
end or escape.
The @code{LC_MESSAGES} environment variable specifies the language to
use in diagnostic messages.
If the @code{LC_ALL} environment variable is set, it overrides the value
of @code{LC_CTYPE} and @code{LC_MESSAGES}; otherwise, @code{LC_CTYPE}
and @code{LC_MESSAGES} default to the value of the @code{LANG}
environment variable. If none of these variables are set, GNU CC
defaults to traditional C English behavior.
@item TMPDIR
@findex TMPDIR
If @code{TMPDIR} is set, it specifies the directory to use for temporary

View File

@ -1657,7 +1657,7 @@ static const short yycheck[] = { 56,
47, 48, 49, 50, 51, 52
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/local/gnu/share/bison.simple"
#line 3 "/usr/lib/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@ -1674,8 +1674,7 @@ static const short yycheck[] = { 56,
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
@ -1851,7 +1850,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
#line 196 "/usr/local/gnu/share/bison.simple"
#line 196 "/usr/lib/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@ -4965,7 +4964,7 @@ case 566:
break;}
}
/* the action file gets copied in in place of this dollarsign */
#line 498 "/usr/local/gnu/share/bison.simple"
#line 498 "/usr/lib/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;

View File

@ -389,6 +389,11 @@ extern int current_function_contains_functions;
extern int current_function_sp_is_unchanging;
/* Nonzero if the function being compiled has the address of its
labels taken. */
extern int current_function_addresses_labels;
/* Nonzero if the current function returns a pointer type */
extern int current_function_returns_pointer;

View File

@ -1667,7 +1667,13 @@ output_func_start_profiler ()
TREE_PUBLIC (fndecl) = 1;
DECL_ASSEMBLER_NAME (fndecl) = fnname;
DECL_RESULT (fndecl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
fndecl = pushdecl (fndecl);
rest_of_decl_compilation (fndecl, 0, 1, 0);
announce_function (fndecl);
current_function_decl = fndecl;
DECL_INITIAL (fndecl) = error_mark_node;
temporary_allocation ();
pushlevel (0);
make_function_rtl (fndecl);
init_function_start (fndecl, input_filename, lineno);

View File

@ -39,6 +39,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "intl.h"
#if 0
/* Users are not supposed to use _POSIX_SOURCE to say the
system is a POSIX system. That is not what _POSIX_SOURCE means! -- rms */
@ -562,6 +564,28 @@ static char * saved_repl_write_ptr;
/* Forward declaration. */
static const char *shortpath ();
/* Translate and output an error message. */
static void notice PVPROTO ((const char *, ...))
ATTRIBUTE_PRINTF_1;
static void
notice VPROTO ((const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, const char *);
#endif
vfprintf (stderr, _(msgid), ap);
va_end (ap);
}
char *
xstrerror(e)
@ -572,16 +596,13 @@ xstrerror(e)
return strerror(e);
#else
static char buffer[30];
if (!e)
return "";
if (e > 0 && e < sys_nerr)
return sys_errlist[e];
sprintf (buffer, "Unknown error %d", e);
return buffer;
return "errno = ?";
#endif
}
@ -595,7 +616,7 @@ xmalloc (byte_count)
register pointer_type rv = (pointer_type) malloc (byte_count);
if (rv == NULL)
{
fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);
notice ("\n%s: virtual memory exceeded\n", pname);
exit (FATAL_EXIT_CODE);
}
return rv;
@ -615,7 +636,7 @@ xrealloc (old_space, byte_count)
rv = (pointer_type) malloc (byte_count);
if (rv == NULL)
{
fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);
notice ("\n%s: virtual memory exceeded\n", pname);
exit (FATAL_EXIT_CODE);
}
return rv;
@ -666,7 +687,7 @@ savestring2 (input1, size1, input2, size2)
void
fancy_abort ()
{
fprintf (stderr, "%s: internal abort\n", pname);
notice ("%s: internal abort\n", pname);
exit (FATAL_EXIT_CODE);
}
@ -756,8 +777,8 @@ safe_write (desc, ptr, len, out_fname)
if (errno_val == EINTR)
continue;
#endif
fprintf (stderr, "%s: error writing file `%s': %s\n",
pname, shortpath (NULL, out_fname), xstrerror (errno_val));
notice ("%s: error writing file `%s': %s\n",
pname, shortpath (NULL, out_fname), xstrerror (errno_val));
return;
}
ptr += written;
@ -800,11 +821,11 @@ static void
usage ()
{
#ifdef UNPROTOIZE
fprintf (stderr, "%s: usage '%s [ -VqfnkN ] [ -i <istring> ] [ filename ... ]'\n",
pname, pname);
notice ("%s: usage '%s [ -VqfnkN ] [ -i <istring> ] [ filename ... ]'\n",
pname, pname);
#else /* !defined (UNPROTOIZE) */
fprintf (stderr, "%s: usage '%s [ -VqfnkNlgC ] [ -B <dirname> ] [ filename ... ]'\n",
pname, pname);
notice ("%s: usage '%s [ -VqfnkNlgC ] [ -B <dirname> ] [ filename ... ]'\n",
pname, pname);
#endif /* !defined (UNPROTOIZE) */
exit (FATAL_EXIT_CODE);
}
@ -890,24 +911,24 @@ file_normally_convertible (const char *path)
if (my_access (path, R_OK))
{
if (!quiet_flag)
fprintf (stderr, "%s: warning: no read access for file `%s'\n",
pname, shortpath (NULL, path));
notice ("%s: warning: no read access for file `%s'\n",
pname, shortpath (NULL, path));
return 0;
}
if (my_access (path, W_OK))
{
if (!quiet_flag)
fprintf (stderr, "%s: warning: no write access for file `%s'\n",
pname, shortpath (NULL, path));
notice ("%s: warning: no write access for file `%s'\n",
pname, shortpath (NULL, path));
return 0;
}
if (my_access (dir_name, W_OK))
{
if (!quiet_flag)
fprintf (stderr, "%s: warning: no write access for dir containing `%s'\n",
pname, shortpath (NULL, path));
notice ("%s: warning: no write access for dir containing `%s'\n",
pname, shortpath (NULL, path));
return 0;
}
@ -1298,8 +1319,8 @@ abspath (cwd, rel_filename)
point above the absolute root of the logical file
system. */
fprintf (stderr, "%s: invalid file name: %s\n",
pname, rel_filename);
notice ("%s: invalid file name: %s\n",
pname, rel_filename);
exit (FATAL_EXIT_CODE);
}
*++outp = '\0';
@ -1449,9 +1470,9 @@ find_file (filename, do_not_stat)
if (my_stat (filename, &stat_buf) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: %s: can't get status: %s\n",
pname, shortpath (NULL, filename),
xstrerror (errno_val));
notice ("%s: %s: can't get status: %s\n",
pname, shortpath (NULL, filename),
xstrerror (errno_val));
stat_buf.st_mtime = (time_t) -1;
}
}
@ -1470,8 +1491,8 @@ find_file (filename, do_not_stat)
static void
aux_info_corrupted ()
{
fprintf (stderr, "\n%s: fatal error: aux info file corrupted at line %d\n",
pname, current_aux_info_lineno);
notice ("\n%s: fatal error: aux info file corrupted at line %d\n",
pname, current_aux_info_lineno);
exit (FATAL_EXIT_CODE);
}
@ -1794,10 +1815,10 @@ save_def_or_dec (l, is_syscalls)
{
if (strcmp (def_dec_p->ansi_decl, other->ansi_decl))
{
fprintf (stderr, "%s:%d: declaration of function `%s' takes different forms\n",
def_dec_p->file->hash_entry->symbol,
def_dec_p->line,
def_dec_p->hash_entry->symbol);
notice ("%s:%d: declaration of function `%s' takes different forms\n",
def_dec_p->file->hash_entry->symbol,
def_dec_p->line,
def_dec_p->hash_entry->symbol);
exit (FATAL_EXIT_CODE);
}
free_def_dec (def_dec_p);
@ -2045,8 +2066,8 @@ gen_aux_info_file (base_filename)
2);
if (!quiet_flag)
fprintf (stderr, "%s: compiling `%s'\n",
pname, compile_params[input_file_name_index]);
notice ("%s: compiling `%s'\n",
pname, compile_params[input_file_name_index]);
{
char *errmsg_fmt, *errmsg_arg;
@ -2069,21 +2090,21 @@ gen_aux_info_file (base_filename)
pid = pwait (pid, &wait_status, 0);
if (pid == -1)
{
fprintf (stderr, "%s: wait: %s\n", pname, xstrerror (errno));
notice ("%s: wait: %s\n", pname, xstrerror (errno));
return 0;
}
if (WIFSIGNALED (wait_status))
{
fprintf (stderr, "%s: subprocess got fatal signal %d\n",
pname, WTERMSIG (wait_status));
notice ("%s: subprocess got fatal signal %d\n",
pname, WTERMSIG (wait_status));
return 0;
}
if (WIFEXITED (wait_status))
{
if (WEXITSTATUS (wait_status) != 0)
{
fprintf (stderr, "%s: %s exited with status %d\n",
pname, compile_params[0], WEXITSTATUS (wait_status));
notice ("%s: %s exited with status %d\n",
pname, compile_params[0], WEXITSTATUS (wait_status));
return 0;
}
return 1;
@ -2134,8 +2155,8 @@ start_over: ;
{
if (is_syscalls)
{
fprintf (stderr, "%s: warning: missing SYSCALLS file `%s'\n",
pname, aux_info_filename);
notice ("%s: warning: missing SYSCALLS file `%s'\n",
pname, aux_info_filename);
return;
}
must_create = 1;
@ -2143,9 +2164,9 @@ start_over: ;
else
{
int errno_val = errno;
fprintf (stderr, "%s: can't read aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
notice ("%s: can't read aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
errors++;
return;
}
@ -2172,9 +2193,9 @@ start_over: ;
if (my_access (aux_info_filename, R_OK) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't read aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
notice ("%s: can't read aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
errors++;
return;
}
@ -2188,9 +2209,9 @@ start_over: ;
if (my_stat (aux_info_filename, &stat_buf) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't get status of aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
notice ("%s: can't get status of aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
errors++;
return;
}
@ -2216,9 +2237,9 @@ start_over: ;
if (my_stat (base_source_filename, &stat_buf) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't get status of aux info file `%s': %s\n",
pname, shortpath (NULL, base_source_filename),
xstrerror (errno_val));
notice ("%s: can't get status of aux info file `%s': %s\n",
pname, shortpath (NULL, base_source_filename),
xstrerror (errno_val));
errors++;
return;
}
@ -2238,9 +2259,9 @@ start_over: ;
if ((aux_info_file = my_open (aux_info_filename, O_RDONLY, 0444 )) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't open aux info file `%s' for reading: %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
notice ("%s: can't open aux info file `%s' for reading: %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
return;
}
@ -2256,9 +2277,9 @@ start_over: ;
(int) aux_info_size)
{
int errno_val = errno;
fprintf (stderr, "%s: error reading aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
notice ("%s: error reading aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
free (aux_info_base);
close (aux_info_file);
return;
@ -2269,9 +2290,9 @@ start_over: ;
if (close (aux_info_file))
{
int errno_val = errno;
fprintf (stderr, "%s: error closing aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
notice ("%s: error closing aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
free (aux_info_base);
close (aux_info_file);
return;
@ -2285,9 +2306,9 @@ start_over: ;
if (my_unlink (aux_info_filename) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't delete aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
notice ("%s: can't delete aux info file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
}
/* Save a pointer into the first line of the aux_info file which
@ -2353,9 +2374,9 @@ start_over: ;
if (keep_it && my_unlink (aux_info_filename) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't delete file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
notice ("%s: can't delete file `%s': %s\n",
pname, shortpath (NULL, aux_info_filename),
xstrerror (errno_val));
return;
}
must_create = 1;
@ -2430,9 +2451,9 @@ rename_c_file (hp)
if (my_link (filename, new_filename) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: warning: can't link file `%s' to `%s': %s\n",
pname, shortpath (NULL, filename),
shortpath (NULL, new_filename), xstrerror (errno_val));
notice ("%s: warning: can't link file `%s' to `%s': %s\n",
pname, shortpath (NULL, filename),
shortpath (NULL, new_filename), xstrerror (errno_val));
errors++;
return;
}
@ -2440,8 +2461,8 @@ rename_c_file (hp)
if (my_unlink (filename) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: warning: can't delete file `%s': %s\n",
pname, shortpath (NULL, filename), xstrerror (errno_val));
notice ("%s: warning: can't delete file `%s': %s\n",
pname, shortpath (NULL, filename), xstrerror (errno_val));
errors++;
return;
}
@ -2564,14 +2585,14 @@ find_extern_def (head, user)
if (!conflict_noted) /* first time we noticed? */
{
conflict_noted = 1;
fprintf (stderr, "%s: conflicting extern definitions of '%s'\n",
pname, head->hash_entry->symbol);
notice ("%s: conflicting extern definitions of '%s'\n",
pname, head->hash_entry->symbol);
if (!quiet_flag)
{
fprintf (stderr, "%s: declarations of '%s' will not be converted\n",
pname, head->hash_entry->symbol);
fprintf (stderr, "%s: conflict list for '%s' follows:\n",
pname, head->hash_entry->symbol);
notice ("%s: declarations of '%s' will not be converted\n",
pname, head->hash_entry->symbol);
notice ("%s: conflict list for '%s' follows:\n",
pname, head->hash_entry->symbol);
fprintf (stderr, "%s: %s(%d): %s\n",
pname,
shortpath (NULL, extern_def_p->file->hash_entry->symbol),
@ -2603,10 +2624,10 @@ find_extern_def (head, user)
{
extern_def_p = dd_p; /* save a pointer to the definition */
if (!quiet_flag)
fprintf (stderr, "%s: warning: using formals list from %s(%d) for function `%s'\n",
pname,
shortpath (NULL, dd_p->file->hash_entry->symbol),
dd_p->line, dd_p->hash_entry->symbol);
notice ("%s: warning: using formals list from %s(%d) for function `%s'\n",
pname,
shortpath (NULL, dd_p->file->hash_entry->symbol),
dd_p->line, dd_p->hash_entry->symbol);
break;
}
@ -2643,15 +2664,15 @@ find_extern_def (head, user)
*p++ = '?';
strcpy (p, ");");
fprintf (stderr, "%s: %d: `%s' used but missing from SYSCALLS\n",
shortpath (NULL, file), user->line,
needed+7); /* Don't print "extern " */
notice ("%s: %d: `%s' used but missing from SYSCALLS\n",
shortpath (NULL, file), user->line,
needed+7); /* Don't print "extern " */
}
#if 0
else
fprintf (stderr, "%s: %d: warning: no extern definition for `%s'\n",
shortpath (NULL, file), user->line,
user->hash_entry->symbol);
notice ("%s: %d: warning: no extern definition for `%s'\n",
shortpath (NULL, file), user->line,
user->hash_entry->symbol);
#endif
}
}
@ -2680,15 +2701,15 @@ find_static_definition (user)
if (num_static_defs == 0)
{
if (!quiet_flag)
fprintf (stderr, "%s: warning: no static definition for `%s' in file `%s'\n",
pname, head->hash_entry->symbol,
shortpath (NULL, user->file->hash_entry->symbol));
notice ("%s: warning: no static definition for `%s' in file `%s'\n",
pname, head->hash_entry->symbol,
shortpath (NULL, user->file->hash_entry->symbol));
}
else if (num_static_defs > 1)
{
fprintf (stderr, "%s: multiple static defs of `%s' in file `%s'\n",
pname, head->hash_entry->symbol,
shortpath (NULL, user->file->hash_entry->symbol));
notice ("%s: multiple static defs of `%s' in file `%s'\n",
pname, head->hash_entry->symbol,
shortpath (NULL, user->file->hash_entry->symbol));
return NULL;
}
return static_def_p;
@ -2859,12 +2880,12 @@ declare_source_confusing (clean_p)
if (!quiet_flag)
{
if (clean_p == 0)
fprintf (stderr, "%s: %d: warning: source too confusing\n",
shortpath (NULL, convert_filename), last_known_line_number);
notice ("%s: %d: warning: source too confusing\n",
shortpath (NULL, convert_filename), last_known_line_number);
else
fprintf (stderr, "%s: %d: warning: source too confusing\n",
shortpath (NULL, convert_filename),
identify_lineno (clean_p));
notice ("%s: %d: warning: source too confusing\n",
shortpath (NULL, convert_filename),
identify_lineno (clean_p));
}
longjmp (source_confusion_recovery, 1);
}
@ -3068,9 +3089,9 @@ edit_fn_declaration (def_dec_p, clean_text_p)
if (other_variable_style_function (definition->ansi_decl))
{
if (!quiet_flag)
fprintf (stderr, "%s: %d: warning: varargs function declaration not converted\n",
shortpath (NULL, def_dec_p->file->hash_entry->symbol),
def_dec_p->line);
notice ("%s: %d: warning: varargs function declaration not converted\n",
shortpath (NULL, def_dec_p->file->hash_entry->symbol),
def_dec_p->line);
return;
}
@ -3083,8 +3104,8 @@ edit_fn_declaration (def_dec_p, clean_text_p)
if (setjmp (source_confusion_recovery))
{
restore_pointers ();
fprintf (stderr, "%s: declaration of function `%s' not converted\n",
pname, function_to_edit);
notice ("%s: declaration of function `%s' not converted\n",
pname, function_to_edit);
return;
}
@ -3206,8 +3227,8 @@ edit_fn_declaration (def_dec_p, clean_text_p)
else
{
if (!quiet_flag)
fprintf (stderr, "%s: warning: too many parameter lists in declaration of `%s'\n",
pname, def_dec_p->hash_entry->symbol);
notice ("%s: warning: too many parameter lists in declaration of `%s'\n",
pname, def_dec_p->hash_entry->symbol);
check_source (0, end_formals); /* leave the declaration intact */
}
#endif /* !defined (UNPROTOIZE) */
@ -3227,8 +3248,8 @@ edit_fn_declaration (def_dec_p, clean_text_p)
if (this_f_list_chain_item)
{
if (!quiet_flag)
fprintf (stderr, "\n%s: warning: too few parameter lists in declaration of `%s'\n",
pname, def_dec_p->hash_entry->symbol);
notice ("\n%s: warning: too few parameter lists in declaration of `%s'\n",
pname, def_dec_p->hash_entry->symbol);
check_source (0, start_formals); /* leave the decl intact */
}
#endif /* !defined (UNPROTOIZE) */
@ -3325,11 +3346,11 @@ edit_formals_lists (end_formals, f_list_count, def_dec_p)
if (func_name_len != strlen (expected)
|| strncmp (func_name_start, expected, func_name_len))
{
fprintf (stderr, "%s: %d: warning: found `%s' but expected `%s'\n",
shortpath (NULL, def_dec_p->file->hash_entry->symbol),
identify_lineno (func_name_start),
dupnstr (func_name_start, func_name_len),
expected);
notice ("%s: %d: warning: found `%s' but expected `%s'\n",
shortpath (NULL, def_dec_p->file->hash_entry->symbol),
identify_lineno (func_name_start),
dupnstr (func_name_start, func_name_len),
expected);
return 1;
}
}
@ -3503,8 +3524,8 @@ add_local_decl (def_dec_p, clean_text_p)
if (setjmp (source_confusion_recovery))
{
restore_pointers ();
fprintf (stderr, "%s: local declaration for function `%s' not inserted\n",
pname, function_to_edit);
notice ("%s: local declaration for function `%s' not inserted\n",
pname, function_to_edit);
return;
}
@ -3530,8 +3551,7 @@ add_local_decl (def_dec_p, clean_text_p)
if (*start_of_block != '{')
{
if (!quiet_flag)
fprintf (stderr,
"\n%s: %d: warning: can't add declaration of `%s' into macro call\n",
notice ("\n%s: %d: warning: can't add declaration of `%s' into macro call\n",
def_dec_p->file->hash_entry->symbol, def_dec_p->line,
def_dec_p->hash_entry->symbol);
return;
@ -3605,8 +3625,8 @@ add_global_decls (file_p, clean_text_p)
if (setjmp (source_confusion_recovery))
{
restore_pointers ();
fprintf (stderr, "%s: global declarations for file `%s' not inserted\n",
pname, shortpath (NULL, file_p->hash_entry->symbol));
notice ("%s: global declarations for file `%s' not inserted\n",
pname, shortpath (NULL, file_p->hash_entry->symbol));
return;
}
@ -3696,8 +3716,8 @@ edit_fn_definition (def_dec_p, clean_text_p)
if (setjmp (source_confusion_recovery))
{
restore_pointers ();
fprintf (stderr, "%s: definition of function `%s' not converted\n",
pname, function_to_edit);
notice ("%s: definition of function `%s' not converted\n",
pname, function_to_edit);
return;
}
@ -3715,10 +3735,10 @@ edit_fn_definition (def_dec_p, clean_text_p)
if (other_variable_style_function (def_dec_p->ansi_decl))
{
if (!quiet_flag)
fprintf (stderr, "%s: %d: warning: definition of %s not converted\n",
shortpath (NULL, def_dec_p->file->hash_entry->symbol),
identify_lineno (end_formals),
other_var_style);
notice ("%s: %d: warning: definition of %s not converted\n",
shortpath (NULL, def_dec_p->file->hash_entry->symbol),
identify_lineno (end_formals),
other_var_style);
output_up_to (end_formals);
return;
}
@ -3726,8 +3746,8 @@ edit_fn_definition (def_dec_p, clean_text_p)
if (edit_formals_lists (end_formals, def_dec_p->f_list_count, def_dec_p))
{
restore_pointers ();
fprintf (stderr, "%s: definition of function `%s' not converted\n",
pname, function_to_edit);
notice ("%s: definition of function `%s' not converted\n",
pname, function_to_edit);
return;
}
@ -4045,11 +4065,11 @@ scan_for_missed_items (file_p)
goto not_missed;
#if 0
fprintf (stderr, "%s: found definition of `%s' at %s(%d)\n",
pname,
func_name,
shortpath (NULL, file_p->hash_entry->symbol),
identify_lineno (id_start));
notice ("%s: found definition of `%s' at %s(%d)\n",
pname,
func_name,
shortpath (NULL, file_p->hash_entry->symbol),
identify_lineno (id_start));
#endif /* 0 */
/* We really should check for a match of the function name
here also, but why bother. */
@ -4061,11 +4081,11 @@ scan_for_missed_items (file_p)
/* If we make it here, then we did not know about this
function definition. */
fprintf (stderr, "%s: %d: warning: `%s' excluded by preprocessing\n",
shortpath (NULL, file_p->hash_entry->symbol),
identify_lineno (id_start), func_name);
fprintf (stderr, "%s: function definition not converted\n",
pname);
notice ("%s: %d: warning: `%s' excluded by preprocessing\n",
shortpath (NULL, file_p->hash_entry->symbol),
identify_lineno (id_start), func_name);
notice ("%s: function definition not converted\n",
pname);
}
not_missed: ;
}
@ -4123,19 +4143,19 @@ edit_file (hp)
&& !in_system_include_dir (convert_filename)
#endif /* defined (UNPROTOIZE) */
)
fprintf (stderr, "%s: `%s' not converted\n",
pname, shortpath (NULL, convert_filename));
notice ("%s: `%s' not converted\n",
pname, shortpath (NULL, convert_filename));
return;
}
/* Let the user know what we are up to. */
if (nochange_flag)
fprintf (stderr, "%s: would convert file `%s'\n",
pname, shortpath (NULL, convert_filename));
notice ("%s: would convert file `%s'\n",
pname, shortpath (NULL, convert_filename));
else
fprintf (stderr, "%s: converting file `%s'\n",
pname, shortpath (NULL, convert_filename));
notice ("%s: converting file `%s'\n",
pname, shortpath (NULL, convert_filename));
fflush (stderr);
/* Find out the size (in bytes) of the original file. */
@ -4144,9 +4164,9 @@ edit_file (hp)
if (my_stat ((char *)convert_filename, &stat_buf) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't get status for file `%s': %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
notice ("%s: can't get status for file `%s': %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
return;
}
orig_size = stat_buf.st_size;
@ -4180,9 +4200,9 @@ edit_file (hp)
if ((input_file = my_open (convert_filename, O_RDONLY, 0444)) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't open file `%s' for reading: %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
notice ("%s: can't open file `%s' for reading: %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
return;
}
@ -4195,9 +4215,9 @@ edit_file (hp)
{
int errno_val = errno;
close (input_file);
fprintf (stderr, "\n%s: error reading input file `%s': %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
notice ("\n%s: error reading input file `%s': %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
return;
}
@ -4229,9 +4249,9 @@ edit_file (hp)
if ((clean_file = creat (clean_filename, 0666)) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't create/open clean file `%s': %s\n",
pname, shortpath (NULL, clean_filename),
xstrerror (errno_val));
notice ("%s: can't create/open clean file `%s': %s\n",
pname, shortpath (NULL, clean_filename),
xstrerror (errno_val));
return;
}
@ -4330,18 +4350,18 @@ edit_file (hp)
if (errno_val == EEXIST)
{
if (!quiet_flag)
fprintf (stderr, "%s: warning: file `%s' already saved in `%s'\n",
pname,
shortpath (NULL, convert_filename),
shortpath (NULL, new_filename));
notice ("%s: warning: file `%s' already saved in `%s'\n",
pname,
shortpath (NULL, convert_filename),
shortpath (NULL, new_filename));
}
else
{
fprintf (stderr, "%s: can't link file `%s' to `%s': %s\n",
pname,
shortpath (NULL, convert_filename),
shortpath (NULL, new_filename),
xstrerror (errno_val));
notice ("%s: can't link file `%s' to `%s': %s\n",
pname,
shortpath (NULL, convert_filename),
shortpath (NULL, new_filename),
xstrerror (errno_val));
return;
}
}
@ -4350,9 +4370,9 @@ edit_file (hp)
if (my_unlink (convert_filename) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't delete file `%s': %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
notice ("%s: can't delete file `%s': %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
return;
}
@ -4364,9 +4384,9 @@ edit_file (hp)
if ((output_file = creat (convert_filename, 0666)) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't create/open output file `%s': %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
notice ("%s: can't create/open output file `%s': %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
return;
}
@ -4393,9 +4413,9 @@ edit_file (hp)
if (my_chmod ((char *)convert_filename, stat_buf.st_mode) == -1)
{
int errno_val = errno;
fprintf (stderr, "%s: can't change mode of file `%s': %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
notice ("%s: can't change mode of file `%s': %s\n",
pname, shortpath (NULL, convert_filename),
xstrerror (errno_val));
}
/* Note: We would try to change the owner and group of the output file
@ -4535,11 +4555,15 @@ main (argc, argv)
pname = strrchr (argv[0], '/');
pname = pname ? pname+1 : argv[0];
setlocale (LC_MESSAGES, "");
bindtextdomain (PACKAGE, localedir);
textdomain (PACKAGE);
cwd_buffer = getpwd ();
if (!cwd_buffer)
{
fprintf (stderr, "%s: cannot get working directory: %s\n",
pname, xstrerror(errno));
notice ("%s: cannot get working directory: %s\n",
pname, xstrerror(errno));
exit (FATAL_EXIT_CODE);
}
@ -4636,8 +4660,8 @@ main (argc, argv)
base_source_filenames[n_base_source_files++] = path;
else
{
fprintf (stderr, "%s: input file names must have .c suffixes: %s\n",
pname, shortpath (NULL, path));
notice ("%s: input file names must have .c suffixes: %s\n",
pname, shortpath (NULL, path));
errors++;
}
}

View File

@ -5655,7 +5655,6 @@ eiremain (den, num)
}
/* Report an error condition CODE encountered in function NAME.
CODE is one of the following:
Mnemonic Value Significance
@ -5672,19 +5671,6 @@ eiremain (den, num)
The order of appearance of the following messages is bound to the
error codes defined above. */
#define NMSGS 8
static char *ermsg[NMSGS] =
{
"unknown", /* error code 0 */
"domain error", /* error code 1 */
"singularity", /* et seq. */
"overflow",
"underflow",
"total loss of precision",
"partial loss of precision",
"`not-a-number' produced"
};
int merror = 0;
extern int merror;
@ -5693,14 +5679,10 @@ mtherr (name, code)
char *name;
int code;
{
char errstr[80];
/* The string passed by the calling program is supposed to be the
name of the function in which the error occurred.
The code argument selects which error message string will be printed. */
if ((code <= 0) || (code >= NMSGS))
code = 0;
if (strcmp (name, "esub") == 0)
name = "subtraction";
else if (strcmp (name, "ediv") == 0)
@ -5717,9 +5699,21 @@ mtherr (name, code)
name = "modulus";
else if (strcmp (name, "esqrt") == 0)
name = "square root";
sprintf (errstr, "%s during real %s", ermsg[code], name);
if (extra_warnings)
warning (errstr);
{
switch (code)
{
case DOMAIN: warning ("%s: argument domain error" , name); break;
case SING: warning ("%s: function singularity" , name); break;
case OVERFLOW: warning ("%s: overflow range error" , name); break;
case UNDERFLOW: warning ("%s: underflow range error" , name); break;
case TLOSS: warning ("%s: total loss of precision" , name); break;
case PLOSS: warning ("%s: partial loss of precision", name); break;
case INVALID: warning ("%s: NaN - producing operation", name); break;
default: abort ();
}
}
/* Set global error message word */
merror = code + 1;
}

View File

@ -869,9 +869,11 @@ push_reload (in, out, inloc, outloc, class,
the class whose registers cannot be referenced in a different size
and M1 is not the same size as M2. If SUBREG_WORD is nonzero, we
cannot reload just the inside since we might end up with the wrong
register class. */
register class. But if it is inside a STRICT_LOW_PART, we have
no choice, so we hope we do get the right register class there. */
if (in != 0 && GET_CODE (in) == SUBREG && SUBREG_WORD (in) == 0
if (in != 0 && GET_CODE (in) == SUBREG
&& (SUBREG_WORD (in) == 0 || strict_low)
#ifdef CLASS_CANNOT_CHANGE_SIZE
&& class != CLASS_CANNOT_CHANGE_SIZE
#endif
@ -988,7 +990,8 @@ push_reload (in, out, inloc, outloc, class,
storing in a subreg is entitled to clobber it all
(except in the case of STRICT_LOW_PART,
and in that case the constraint should label it input-output.) */
if (out != 0 && GET_CODE (out) == SUBREG && SUBREG_WORD (out) == 0
if (out != 0 && GET_CODE (out) == SUBREG
&& (SUBREG_WORD (out) == 0 || strict_low)
#ifdef CLASS_CANNOT_CHANGE_SIZE
&& class != CLASS_CANNOT_CHANGE_SIZE
#endif
@ -2602,12 +2605,12 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
}
else if (code == MEM)
{
if (find_reloads_address (GET_MODE (recog_operand[i]),
address_reloaded[i]
= find_reloads_address (GET_MODE (recog_operand[i]),
recog_operand_loc[i],
XEXP (recog_operand[i], 0),
&XEXP (recog_operand[i], 0),
i, address_type[i], ind_levels, insn))
address_reloaded[i] = 1;
i, address_type[i], ind_levels, insn);
substed_operand[i] = recog_operand[i] = *recog_operand_loc[i];
}
else if (code == SUBREG)
@ -2683,6 +2686,15 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
&& reg_alternate_class (REGNO (recog_operand[i])) == NO_REGS);
}
#ifdef HAVE_cc0
/* If we made any reloads for addresses, see if they violate a
"no input reloads" requirement for this insn. */
if (no_input_reloads)
for (i = 0; i < n_reloads; i++)
if (reload_in[i] != 0)
abort ();
#endif
/* If this is simply a copy from operand 1 to operand 0, merge the
preferred classes for the operands. */
if (set != 0 && noperands >= 2 && recog_operand[0] == SET_DEST (set)
@ -3020,24 +3032,11 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
/* If IND_LEVELS, find_reloads_address won't reload a
pseudo that didn't get a hard reg, so we have to
reject that case. */
&& (ind_levels ? offsettable_memref_p (operand)
: offsettable_nonstrict_memref_p (operand)))
/* A reloaded auto-increment address is offsettable,
because it is now just a simple register indirect. */
|| (GET_CODE (operand) == MEM
&& address_reloaded[i]
&& (GET_CODE (XEXP (operand, 0)) == PRE_INC
|| GET_CODE (XEXP (operand, 0)) == PRE_DEC
|| GET_CODE (XEXP (operand, 0)) == POST_INC
|| GET_CODE (XEXP (operand, 0)) == POST_DEC))
/* Certain mem addresses will become offsettable
after they themselves are reloaded. This is important;
we don't want our own handling of unoffsettables
to override the handling of reg_equiv_address. */
|| (GET_CODE (operand) == MEM
&& GET_CODE (XEXP (operand, 0)) == REG
&& (ind_levels == 0
|| reg_equiv_address[REGNO (XEXP (operand, 0))] != 0))
&& ((ind_levels ? offsettable_memref_p (operand)
: offsettable_nonstrict_memref_p (operand))
/* A reloaded address is offsettable because it is now
just a simple register indirect. */
|| address_reloaded[i]))
|| (GET_CODE (operand) == REG
&& REGNO (operand) >= FIRST_PSEUDO_REGISTER
&& reg_renumber[REGNO (operand)] < 0
@ -4552,6 +4551,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
rtx insn;
{
register int regno;
int removed_and = 0;
rtx tem;
/* If the address is a register, see if it is a legitimate address and
@ -4566,7 +4566,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
&& strict_memory_address_p (mode, reg_equiv_constant[regno]))
{
*loc = ad = reg_equiv_constant[regno];
return 1;
return 0;
}
tem = reg_equiv_memory_loc[regno];
@ -4671,12 +4671,22 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
while (0);
#endif
/* The address is not valid. We have to figure out why. One possibility
is that it is itself a MEM. This can happen when the frame pointer is
being eliminated, a pseudo is not allocated to a hard register, and the
offset between the frame and stack pointers is not its initial value.
In that case the pseudo will have been replaced by a MEM referring to
the stack pointer. */
/* The address is not valid. We have to figure out why. First see if
we have an outer AND and remove it if so. Then analyze what's inside. */
if (GET_CODE (ad) == AND)
{
removed_and = 1;
loc = &XEXP (ad, 0);
ad = *loc;
}
/* One possibility for why the address is invalid is that it is itself
a MEM. This can happen when the frame pointer is being eliminated, a
pseudo is not allocated to a hard register, and the offset between the
frame and stack pointers is not its initial value. In that case the
pseudo will have been replaced by a MEM referring to the
stack pointer. */
if (GET_CODE (ad) == MEM)
{
/* First ensure that the address in this MEM is valid. Then, unless
@ -4693,6 +4703,8 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
*memrefloc = copy_rtx (*memrefloc);
copy_replacements (tem, XEXP (*memrefloc, 0));
loc = &XEXP (*memrefloc, 0);
if (removed_and)
loc = &XEXP (*loc, 0);
}
/* Check similar cases as for indirect addresses as above except
@ -4713,7 +4725,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
BASE_REG_CLASS, GET_MODE (tem),
VOIDmode, 0,
0, opnum, type);
return 1;
return ! removed_and;
}
else
return 0;
@ -4735,16 +4747,21 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
{
*memrefloc = copy_rtx (*memrefloc);
loc = &XEXP (*memrefloc, 0);
if (removed_and)
loc = &XEXP (*loc, 0);
}
if (double_reg_address_ok)
{
/* Unshare the sum as well. */
*loc = ad = copy_rtx (ad);
/* Reload the displacement into an index reg.
We assume the frame pointer or arg pointer is a base reg. */
find_reloads_address_part (XEXP (ad, 1), &XEXP (ad, 1),
INDEX_REG_CLASS, GET_MODE (ad), opnum,
type, ind_levels);
return 0;
}
else
{
@ -4754,7 +4771,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
find_reloads_address_part (ad, loc, BASE_REG_CLASS,
Pmode, opnum, type, ind_levels);
}
return 1;
return ! removed_and;
}
/* If we have an indexed stack slot, there are three possible reasons why
@ -4807,7 +4824,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
find_reloads_address_1 (mode, XEXP (ad, 1), 1, &XEXP (ad, 1), opnum,
type, 0, insn);
return 1;
return 0;
}
else if (GET_CODE (ad) == PLUS && GET_CODE (XEXP (ad, 1)) == CONST_INT
@ -4831,7 +4848,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
find_reloads_address_1 (mode, XEXP (ad, 0), 1, &XEXP (ad, 0), opnum,
type, 0, insn);
return 1;
return 0;
}
/* See if address becomes valid when an eliminable register
@ -4868,11 +4885,13 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
{
*memrefloc = copy_rtx (*memrefloc);
loc = &XEXP (*memrefloc, 0);
if (removed_and)
loc = &XEXP (*loc, 0);
}
find_reloads_address_part (ad, loc, BASE_REG_CLASS, Pmode, opnum, type,
ind_levels);
return 1;
return ! removed_and;
}
return find_reloads_address_1 (mode, ad, 0, loc, opnum, type, ind_levels,

View File

@ -1175,6 +1175,28 @@ reload (first, global, dumpfile)
warning ("frame size too large for reliable stack checking");
}
/* If we are doing stack checking, give a warning if this function's
frame size is larger than we expect. */
if (flag_stack_check && ! STACK_CHECK_BUILTIN)
{
HOST_WIDE_INT size = get_frame_size () + STACK_CHECK_FIXED_FRAME_SIZE;
static int verbose_warned = 0;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (regs_ever_live[i] && ! fixed_regs[i] && call_used_regs[i])
size += UNITS_PER_WORD;
if (size > STACK_CHECK_MAX_FRAME_SIZE)
{
warning ("frame size too large for reliable stack checking");
if (! verbose_warned)
{
warning ("try reducing the number of local variables");
verbose_warned = 1;
}
}
}
/* Indicate that we no longer have known memory locations or constants. */
if (reg_equiv_constant)
free (reg_equiv_constant);

View File

@ -222,25 +222,26 @@ static int *uid_to_ruid;
/* Highest valid index in `uid_to_ruid'. */
static int max_uid;
static void mark_referenced_resources PROTO((rtx, struct resources *, int));
static void mark_set_resources PROTO((rtx, struct resources *, int, int));
static int stop_search_p PROTO((rtx, int));
static int resource_conflicts_p PROTO((struct resources *,
struct resources *));
static int insn_references_resource_p PROTO((rtx, struct resources *, int));
static int insn_sets_resource_p PROTO((rtx, struct resources *, int));
static rtx find_end_label PROTO((void));
static rtx emit_delay_sequence PROTO((rtx, rtx, int));
static rtx add_to_delay_list PROTO((rtx, rtx));
static rtx delete_from_delay_slot PROTO((rtx));
static void delete_scheduled_jump PROTO((rtx));
static void note_delay_statistics PROTO((int, int));
static rtx optimize_skip PROTO((rtx));
static int get_jump_flags PROTO((rtx, rtx));
static int rare_destination PROTO((rtx));
static int mostly_true_jump PROTO((rtx, rtx));
static rtx get_branch_condition PROTO((rtx, rtx));
static int condition_dominates_p PROTO((rtx, rtx));
static void mark_referenced_resources PROTO((rtx, struct resources *, int));
static void mark_set_resources PROTO((rtx, struct resources *,
int, int));
static int stop_search_p PROTO((rtx, int));
static int resource_conflicts_p PROTO((struct resources *,
struct resources *));
static int insn_references_resource_p PROTO((rtx, struct resources *, int));
static int insn_sets_resource_p PROTO((rtx, struct resources *, int));
static rtx find_end_label PROTO((void));
static rtx emit_delay_sequence PROTO((rtx, rtx, int));
static rtx add_to_delay_list PROTO((rtx, rtx));
static rtx delete_from_delay_slot PROTO((rtx));
static void delete_scheduled_jump PROTO((rtx));
static void note_delay_statistics PROTO((int, int));
static rtx optimize_skip PROTO((rtx));
static int get_jump_flags PROTO((rtx, rtx));
static int rare_destination PROTO((rtx));
static int mostly_true_jump PROTO((rtx, rtx));
static rtx get_branch_condition PROTO((rtx, rtx));
static int condition_dominates_p PROTO((rtx, rtx));
static rtx steal_delay_list_from_target PROTO((rtx, rtx, rtx, rtx,
struct resources *,
struct resources *,
@ -251,29 +252,30 @@ static rtx steal_delay_list_from_fallthrough PROTO((rtx, rtx, rtx, rtx,
struct resources *,
struct resources *,
int, int *, int *));
static void try_merge_delay_insns PROTO((rtx, rtx));
static rtx redundant_insn PROTO((rtx, rtx, rtx));
static int own_thread_p PROTO((rtx, rtx, int));
static int find_basic_block PROTO((rtx));
static void update_block PROTO((rtx, rtx));
static int reorg_redirect_jump PROTO((rtx, rtx));
static void update_reg_dead_notes PROTO((rtx, rtx));
static void fix_reg_dead_note PROTO((rtx, rtx));
static void update_reg_unused_notes PROTO((rtx, rtx));
static void update_live_status PROTO((rtx, rtx));
static rtx next_insn_no_annul PROTO((rtx));
static rtx find_dead_or_set_registers PROTO ((rtx, struct resources *, rtx *,
int, struct resources,
struct resources));
static void mark_target_live_regs PROTO((rtx, struct resources *));
static void fill_simple_delay_slots PROTO((int));
static rtx fill_slots_from_thread PROTO((rtx, rtx, rtx, rtx, int, int,
int, int, int *, rtx));
static void fill_eager_delay_slots PROTO((void));
static void relax_delay_slots PROTO((rtx));
static void make_return_insns PROTO((rtx));
static void try_merge_delay_insns PROTO((rtx, rtx));
static rtx redundant_insn PROTO((rtx, rtx, rtx));
static int own_thread_p PROTO((rtx, rtx, int));
static int find_basic_block PROTO((rtx));
static void update_block PROTO((rtx, rtx));
static int reorg_redirect_jump PROTO((rtx, rtx));
static void update_reg_dead_notes PROTO((rtx, rtx));
static void fix_reg_dead_note PROTO((rtx, rtx));
static void update_reg_unused_notes PROTO((rtx, rtx));
static void update_live_status PROTO((rtx, rtx));
static rtx next_insn_no_annul PROTO((rtx));
static void mark_target_live_regs PROTO((rtx, struct resources *));
static void fill_simple_delay_slots PROTO((int));
static rtx fill_slots_from_thread PROTO((rtx, rtx, rtx, rtx, int, int,
int, int, int *, rtx));
static void fill_eager_delay_slots PROTO((void));
static void relax_delay_slots PROTO((rtx));
static void make_return_insns PROTO((rtx));
static int redirect_with_delay_slots_safe_p PROTO ((rtx, rtx, rtx));
static int redirect_with_delay_list_safe_p PROTO ((rtx, rtx, rtx));
static int check_annul_list_true_false PROTO ((int, rtx));
/* Given X, some rtl, and RES, a pointer to a `struct resource', mark
which resources are references by the insn. If INCLUDE_DELAYED_EFFECTS
@ -1006,8 +1008,8 @@ add_to_delay_list (insn, delay_list)
return delay_list;
}
/* Delete INSN from the delay slot of the insn that it is in. This may
produce an insn without anything in its delay slots. */
/* Delete INSN from the delay slot of the insn that it is in, which may
produce an insn with no delay slots. Return the new insn. */
static rtx
delete_from_delay_slot (insn)
@ -1646,6 +1648,7 @@ check_annul_list_true_false (annul_true_p, delay_list)
return 0;
}
}
return 1;
}
@ -1689,8 +1692,8 @@ steal_delay_list_from_target (insn, condition, seq, delay_list,
int total_slots_filled = *pslots_filled;
rtx new_delay_list = 0;
int must_annul = *pannul_p;
int i;
int used_annul = 0;
int i;
struct resources cc_set;
/* We can't do anything if there are more delay slots in SEQ than we

View File

@ -715,6 +715,7 @@ extern char *note_insn_name[];
#define FUNCTION_FLAGS_USES_CONST_POOL 0200
#define FUNCTION_FLAGS_CALLS_LONGJMP 0400
#define FUNCTION_FLAGS_USES_PIC_OFFSET_TABLE 01000
#define FUNCTION_FLAGS_ADDRESSES_LABELS 02000
/* Define a macro to look for REG_INC notes,
but save time on machines where they never exist. */

View File

@ -414,4 +414,15 @@ extern void abort ();
/* Get libiberty declarations. */
#include "libiberty.h"
#if defined (ANSI_PROTOTYPES)
# define PRINTF_PROTO(ARGS, m, n) PVPROTO (ARGS) ATTRIBUTE_PRINTF(m, n)
#else
# define PRINTF_PROTO(ARGS, m, n) () ATTRIBUTE_PRINTF(m, n)
#endif
#define PRINTF_PROTO_1(ARGS) PRINTF_PROTO(ARGS, 1, 2)
#define PRINTF_PROTO_2(ARGS) PRINTF_PROTO(ARGS, 2, 3)
#define PRINTF_PROTO_3(ARGS) PRINTF_PROTO(ARGS, 3, 4)
#define PRINTF_PROTO_4(ARGS) PRINTF_PROTO(ARGS, 4, 5)
#endif /* __GCC_SYSTEM_H__ */

View File

@ -2639,7 +2639,8 @@ allocated for arguments even when their values are passed in
registers.
The value of this macro is the size, in bytes, of the area reserved for
arguments passed in registers for the function represented by @var{fndecl}.
arguments passed in registers for the function represented by @var{fndecl},
which can be zero if GNU CC is calling a library function.
This space can be allocated by the caller, or be a part of the
machine-dependent stack frame: @code{OUTGOING_REG_PARM_STACK_SPACE} says

View File

@ -51,6 +51,7 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "toplev.h"
#include "expr.h"
#include "intl.h"
#ifdef DWARF_DEBUGGING_INFO
#include "dwarfout.h"
@ -162,14 +163,28 @@ extern void print_rtl ();
extern void print_rtl_with_bb ();
void rest_of_decl_compilation ();
void error_with_file_and_line PVPROTO((const char *file,
int line, const char *s, ...));
void error_with_decl PVPROTO((tree decl, const char *s, ...));
void error_for_asm PVPROTO((rtx insn, const char *s, ...));
void notice PVPROTO((const char *s, ...));
void error PVPROTO((const char *s, ...));
void fatal PVPROTO((const char *s, ...));
void warning_with_file_and_line PVPROTO((const char *file,
int line, const char *s, ...));
void warning_with_decl PVPROTO((tree decl, const char *s, ...));
void warning PVPROTO((const char *s, ...));
void pedwarn PVPROTO((const char *s, ...));
void pedwarn_with_decl PVPROTO((tree decl, const char *s, ...));
void pedwarn_with_file_and_line PVPROTO((const char *file,
int line, const char *s, ...));
void sorry PVPROTO((const char *s, ...));
static void set_target_switch PROTO((const char *));
static char *decl_name PROTO((tree, int));
static void vmessage PROTO((const char *, const char *, va_list));
static void v_message_with_file_and_line PROTO((const char *, int,
const char *, const char *,
va_list));
static void v_message_with_decl PROTO((tree, const char *,
const char *, va_list));
static void v_message_with_file_and_line PROTO((const char *, int, int,
const char *, va_list));
static void v_message_with_decl PROTO((tree, int, const char *, va_list));
static void file_and_line_for_asm PROTO((rtx, char **, int *));
static void v_error_with_file_and_line PROTO((const char *, int,
const char *, va_list));
@ -187,7 +202,6 @@ static void v_pedwarn_with_decl PROTO((tree, const char *, va_list));
static void v_pedwarn_with_file_and_line PROTO((const char *, int,
const char *, va_list));
static void vsorry PROTO((const char *, va_list));
static void v_really_sorry PROTO((const char *, va_list)) ATTRIBUTE_NORETURN;
static void float_signal PROTO((int)) ATTRIBUTE_NORETURN;
static void pipe_closed PROTO((int)) ATTRIBUTE_NORETURN;
#ifdef ASM_IDENTIFY_LANGUAGE
@ -542,10 +556,14 @@ int flag_fast_math = 0;
int flag_volatile;
/* Nonzero means treat all global and extern variables as global. */
/* Nonzero means treat all global and extern variables as volatile. */
int flag_volatile_global;
/* Nonzero means treat all static variables as volatile. */
int flag_volatile_static;
/* Nonzero means just do syntax checking; don't output anything. */
int flag_syntax_only = 0;
@ -800,6 +818,8 @@ lang_independent_options f_options[] =
"Consider all mem refs through pointers as volatile"},
{"volatile-global", &flag_volatile_global, 1,
"Consider all mem refs to global data to be volatile" },
{"volatile-static", &flag_volatile_static, 1,
"Consider all mem refs to static data to be volatile" },
{"defer-pop", &flag_defer_pop, 1,
"Defer popping functions args from stack until later" },
{"omit-frame-pointer", &flag_omit_frame_pointer, 1,
@ -1343,7 +1363,7 @@ count_error (warningp)
if (warningp && !warning_message)
{
fprintf (stderr, "%s: warnings being treated as errors\n", progname);
notice ("%s: warnings being treated as errors\n", progname);
warning_message = 1;
}
errorcount++;
@ -1368,7 +1388,7 @@ void
fatal_io_error (name)
const char *name;
{
fprintf (stderr, "%s: %s: I/O error\n", progname, name);
notice ("%s: %s: I/O error\n", progname, name);
exit (FATAL_EXIT_CODE);
}
@ -1376,11 +1396,11 @@ fatal_io_error (name)
just calling abort(). */
void
fatal_insn (message, insn)
const char *message;
fatal_insn (msgid, insn)
const char *msgid;
rtx insn;
{
error (message);
error (msgid);
debug_rtx (insn);
if (asm_out_file)
fflush (asm_out_file);
@ -1455,21 +1475,16 @@ default_print_error_function (file)
{
if (last_error_function != current_function_decl)
{
const char *kind = "function";
if (current_function_decl != 0
&& TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
kind = "method";
if (file)
fprintf (stderr, "%s: ", file);
if (current_function_decl == NULL)
fprintf (stderr, "At top level:\n");
notice ("At top level:\n");
else
{
char *name = (*decl_printable_name) (current_function_decl, 2);
fprintf (stderr, "In %s `%s':\n", kind, name);
}
notice ((TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE
? "In method `%s':\n"
: "In function `%s':\n"),
(*decl_printable_name) (current_function_decl, 2));
last_error_function = current_function_decl;
}
@ -1502,13 +1517,11 @@ report_error_function (file)
&& input_file_stack_tick != last_error_tick
&& file == input_filename)
{
fprintf (stderr, "In file included");
for (p = input_file_stack->next; p; p = p->next)
{
fprintf (stderr, " from %s:%d", p->name, p->line);
if (p->next)
fprintf (stderr, ",\n ");
}
notice ((p == input_file_stack->next
? "In file included from %s:%d"
: ",\n from %s:%d"),
p->name, p->line);
fprintf (stderr, ":\n");
last_error_tick = input_file_stack_tick;
}
@ -1517,76 +1530,137 @@ report_error_function (file)
/* Print a message. */
static void
vmessage (prefix, s, ap)
const char *prefix;
const char *s;
vnotice (file, msgid, ap)
FILE *file;
char *msgid;
va_list ap;
{
if (prefix)
fprintf (stderr, "%s: ", prefix);
vfprintf (stderr, s, ap);
vfprintf (file, _(msgid), ap);
}
/* Print a message relevant to line LINE of file FILE. */
void
notice VPROTO((const char *msgid, ...))
{
#ifndef __STDC__
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
#ifndef __STDC__
msgid = va_arg (ap, char *);
#endif
vnotice (stderr, msgid, ap);
va_end (ap);
}
void
fnotice VPROTO((FILE *file, char *msgid, ...))
{
#ifndef __STDC__
FILE *file;
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
#ifndef __STDC__
file = va_arg (ap, FILE *);
msgid = va_arg (ap, char *);
#endif
vnotice (file, msgid, ap);
va_end (ap);
}
/* Report FILE and LINE (or program name), and optionally just WARN. */
static void
v_message_with_file_and_line (file, line, prefix, s, ap)
const char *file;
report_file_and_line (file, line, warn)
char *file;
int line;
const char *prefix;
const char *s;
va_list ap;
int warn;
{
if (file)
fprintf (stderr, "%s:%d: ", file, line);
else
fprintf (stderr, "%s: ", progname);
vmessage (prefix, s, ap);
if (warn)
notice ("warning: ");
}
/* Print a message. */
static void
vmessage (prefix, msgid, ap)
const char *prefix;
const char *msgid;
va_list ap;
{
if (prefix)
fprintf (stderr, "%s: ", prefix);
vfprintf (stderr, msgid, ap);
}
/* Print a message relevant to line LINE of file FILE. */
static void
v_message_with_file_and_line (file, line, warn, msgid, ap)
const char *file;
int line;
int warn;
const char *msgid;
va_list ap;
{
report_file_and_line (file, line, warn);
vnotice (stderr, msgid, ap);
fputc ('\n', stderr);
}
/* Print a message relevant to the given DECL. */
static void
v_message_with_decl (decl, prefix, s, ap)
v_message_with_decl (decl, warn, msgid, ap)
tree decl;
const char *prefix;
const char *s;
int warn;
const char *msgid;
va_list ap;
{
const char *p;
fprintf (stderr, "%s:%d: ",
DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
if (prefix)
fprintf (stderr, "%s: ", prefix);
report_file_and_line (DECL_SOURCE_FILE (decl),
DECL_SOURCE_LINE (decl), warn);
/* Do magic to get around lack of varargs support for insertion
of arguments into existing list. We know that the decl is first;
we ass_u_me that it will be printed with "%s". */
for (p = s; *p; ++p)
for (p = _(msgid); *p; ++p)
{
if (*p == '%')
{
if (*(p + 1) == '%')
++p;
else if (*(p + 1) != 's')
abort ();
else
break;
}
}
if (p > s) /* Print the left-hand substring. */
if (p > _(msgid)) /* Print the left-hand substring. */
{
char fmt[sizeof "%.255s"];
long width = p - s;
long width = p - _(msgid);
if (width > 255L) width = 255L; /* arbitrary */
sprintf (fmt, "%%.%lds", width);
fprintf (stderr, fmt, s);
fprintf (stderr, fmt, _(msgid));
}
if (*p == '%') /* Print the name. */
@ -1649,72 +1723,72 @@ file_and_line_for_asm (insn, pfile, pline)
/* Report an error at line LINE of file FILE. */
static void
v_error_with_file_and_line (file, line, s, ap)
v_error_with_file_and_line (file, line, msgid, ap)
const char *file;
int line;
const char *s;
const char *msgid;
va_list ap;
{
count_error (0);
report_error_function (file);
v_message_with_file_and_line (file, line, (char *)NULL, s, ap);
v_message_with_file_and_line (file, line, 0, msgid, ap);
}
void
error_with_file_and_line VPROTO((const char *file, int line,
const char *s, ...))
const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *file;
int line;
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
file = va_arg (ap, const char *);
line = va_arg (ap, int);
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_error_with_file_and_line (file, line, s, ap);
v_error_with_file_and_line (file, line, msgid, ap);
va_end (ap);
}
/* Report an error at the declaration DECL.
S is a format string which uses %s to substitute the declaration
MSGID is a format string which uses %s to substitute the declaration
name; subsequent substitutions are a la printf. */
static void
v_error_with_decl (decl, s, ap)
v_error_with_decl (decl, msgid, ap)
tree decl;
const char *s;
const char *msgid;
va_list ap;
{
count_error (0);
report_error_function (DECL_SOURCE_FILE (decl));
v_message_with_decl (decl, (char *)NULL, s, ap);
v_message_with_decl (decl, 0, msgid, ap);
}
void
error_with_decl VPROTO((tree decl, const char *s, ...))
error_with_decl VPROTO((tree decl, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
tree decl;
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
decl = va_arg (ap, tree);
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_error_with_decl (decl, s, ap);
v_error_with_decl (decl, msgid, ap);
va_end (ap);
}
@ -1723,9 +1797,9 @@ error_with_decl VPROTO((tree decl, const char *s, ...))
and each ASM_OPERANDS records its own source file and line. */
static void
v_error_for_asm (insn, s, ap)
v_error_for_asm (insn, msgid, ap)
rtx insn;
const char *s;
const char *msgid;
va_list ap;
{
char *file;
@ -1734,159 +1808,159 @@ v_error_for_asm (insn, s, ap)
count_error (0);
file_and_line_for_asm (insn, &file, &line);
report_error_function (file);
v_message_with_file_and_line (file, line, (char *)NULL, s, ap);
v_message_with_file_and_line (file, line, 0, msgid, ap);
}
void
error_for_asm VPROTO((rtx insn, const char *s, ...))
error_for_asm VPROTO((rtx insn, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
rtx insn;
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
insn = va_arg (ap, rtx);
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_error_for_asm (insn, s, ap);
v_error_for_asm (insn, msgid, ap);
va_end (ap);
}
/* Report an error at the current line number. */
static void
verror (s, ap)
const char *s;
verror (msgid, ap)
const char *msgid;
va_list ap;
{
v_error_with_file_and_line (input_filename, lineno, s, ap);
v_error_with_file_and_line (input_filename, lineno, msgid, ap);
}
void
error VPROTO((const char *s, ...))
error VPROTO((const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
s = va_arg (ap, const char *);
msgic = va_arg (ap, const char *);
#endif
verror (s, ap);
verror (msgid, ap);
va_end (ap);
}
/* Report a fatal error at the current line number. */
static void
vfatal (s, ap)
const char *s;
vfatal (msgid, ap)
const char *msgid;
va_list ap;
{
verror (s, ap);
verror (msgid, ap);
exit (FATAL_EXIT_CODE);
}
void
fatal VPROTO((const char *s, ...))
fatal VPROTO((const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
vfatal (s, ap);
vfatal (msgid, ap);
va_end (ap);
}
/* Report a warning at line LINE of file FILE. */
static void
v_warning_with_file_and_line (file, line, s, ap)
v_warning_with_file_and_line (file, line, msgid, ap)
const char *file;
int line;
const char *s;
const char *msgid;
va_list ap;
{
if (count_error (1))
{
report_error_function (file);
v_message_with_file_and_line (file, line, "warning", s, ap);
v_message_with_file_and_line (file, line, 1, msgid, ap);
}
}
void
warning_with_file_and_line VPROTO((const char *file, int line,
const char *s, ...))
const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *file;
int line;
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
file = va_arg (ap, const char *);
line = va_arg (ap, int);
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_warning_with_file_and_line (file, line, s, ap);
v_warning_with_file_and_line (file, line, msgid, ap);
va_end (ap);
}
/* Report a warning at the declaration DECL.
S is a format string which uses %s to substitute the declaration
MSGID is a format string which uses %s to substitute the declaration
name; subsequent substitutions are a la printf. */
static void
v_warning_with_decl (decl, s, ap)
v_warning_with_decl (decl, msgid, ap)
tree decl;
const char *s;
const char *msgid;
va_list ap;
{
if (count_error (1))
{
report_error_function (DECL_SOURCE_FILE (decl));
v_message_with_decl (decl, "warning", s, ap);
v_message_with_decl (decl, 1, msgid, ap);
}
}
void
warning_with_decl VPROTO((tree decl, const char *s, ...))
warning_with_decl VPROTO((tree decl, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
tree decl;
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
decl = va_arg (ap, tree);
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_warning_with_decl (decl, s, ap);
v_warning_with_decl (decl, msgid, ap);
va_end (ap);
}
@ -1895,9 +1969,9 @@ warning_with_decl VPROTO((tree decl, const char *s, ...))
and each ASM_OPERANDS records its own source file and line. */
static void
v_warning_for_asm (insn, s, ap)
v_warning_for_asm (insn, msgid, ap)
rtx insn;
const char *s;
const char *msgid;
va_list ap;
{
if (count_error (1))
@ -1907,55 +1981,55 @@ v_warning_for_asm (insn, s, ap)
file_and_line_for_asm (insn, &file, &line);
report_error_function (file);
v_message_with_file_and_line (file, line, "warning", s, ap);
v_message_with_file_and_line (file, line, 1, msgid, ap);
}
}
void
warning_for_asm VPROTO((rtx insn, const char *s, ...))
warning_for_asm VPROTO((rtx insn, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
rtx insn;
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
insn = va_arg (ap, rtx);
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_warning_for_asm (insn, s, ap);
v_warning_for_asm (insn, msgid, ap);
va_end (ap);
}
/* Report a warning at the current line number. */
static void
vwarning (s, ap)
const char *s;
vwarning (msgid, ap)
const char *msgid;
va_list ap;
{
v_warning_with_file_and_line (input_filename, lineno, s, ap);
v_warning_with_file_and_line (input_filename, lineno, msgid, ap);
}
void
warning VPROTO((const char *s, ...))
warning VPROTO((const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
vwarning (s, ap);
vwarning (msgid, ap);
va_end (ap);
}
@ -1963,38 +2037,38 @@ warning VPROTO((const char *s, ...))
-pedantic-errors. */
static void
vpedwarn (s, ap)
const char *s;
vpedwarn (msgid, ap)
const char *msgid;
va_list ap;
{
if (flag_pedantic_errors)
verror (s, ap);
verror (msgid, ap);
else
vwarning (s, ap);
vwarning (msgid, ap);
}
void
pedwarn VPROTO((const char *s, ...))
pedwarn VPROTO((const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
vpedwarn (s, ap);
vpedwarn (msgid, ap);
va_end (ap);
}
static void
v_pedwarn_with_decl (decl, s, ap)
v_pedwarn_with_decl (decl, msgid, ap)
tree decl;
const char *s;
const char *msgid;
va_list ap;
{
/* We don't want -pedantic-errors to cause the compilation to fail from
@ -2007,73 +2081,73 @@ v_pedwarn_with_decl (decl, s, ap)
if (! DECL_IN_SYSTEM_HEADER (decl))
{
if (flag_pedantic_errors)
v_error_with_decl (decl, s, ap);
v_error_with_decl (decl, msgid, ap);
else
v_warning_with_decl (decl, s, ap);
v_warning_with_decl (decl, msgid, ap);
}
}
void
pedwarn_with_decl VPROTO((tree decl, const char *s, ...))
pedwarn_with_decl VPROTO((tree decl, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
tree decl;
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
decl = va_arg (ap, tree);
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_pedwarn_with_decl (decl, s, ap);
v_pedwarn_with_decl (decl, msgid, ap);
va_end (ap);
}
static void
v_pedwarn_with_file_and_line (file, line, s, ap)
v_pedwarn_with_file_and_line (file, line, msgid, ap)
const char *file;
int line;
const char *s;
const char *msgid;
va_list ap;
{
if (flag_pedantic_errors)
v_error_with_file_and_line (file, line, s, ap);
v_error_with_file_and_line (file, line, msgid, ap);
else
v_warning_with_file_and_line (file, line, s, ap);
v_warning_with_file_and_line (file, line, msgid, ap);
}
void
pedwarn_with_file_and_line VPROTO((const char *file, int line,
const char *s, ...))
const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *file;
int line;
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
file = va_arg (ap, const char *);
line = va_arg (ap, int);
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
v_pedwarn_with_file_and_line (file, line, s, ap);
v_pedwarn_with_file_and_line (file, line, msgid, ap);
va_end (ap);
}
/* Apologize for not implementing some feature. */
static void
vsorry (s, ap)
const char *s;
vsorry (msgid, ap)
const char *msgid;
va_list ap;
{
sorrycount++;
@ -2081,59 +2155,26 @@ vsorry (s, ap)
fprintf (stderr, "%s:%d: ", input_filename, lineno);
else
fprintf (stderr, "%s: ", progname);
vmessage ("sorry, not implemented", s, ap);
notice ("sorry, not implemented: ");
vnotice (stderr, msgid, ap);
fputc ('\n', stderr);
}
void
sorry VPROTO((const char *s, ...))
sorry VPROTO((const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *s;
const char *msgid;
#endif
va_list ap;
VA_START (ap, s);
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
s = va_arg (ap, const char *);
msgid = va_arg (ap, const char *);
#endif
vsorry (s, ap);
va_end (ap);
}
/* Apologize for not implementing some feature, then quit. */
static void
v_really_sorry (s, ap)
const char *s;
va_list ap;
{
sorrycount++;
if (input_filename)
fprintf (stderr, "%s:%d: ", input_filename, lineno);
else
fprintf (stderr, "%s: ", progname);
vmessage ("sorry, not implemented", s, ap);
fatal (" (fatal)\n");
}
void
really_sorry VPROTO((const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef ANSI_PROTOTYPES
s = va_arg (ap, const char *);
#endif
v_really_sorry (s, ap);
vsorry (msgid, ap);
va_end (ap);
}
@ -2899,7 +2940,7 @@ compile_file (name)
if (yyparse () != 0)
{
if (errorcount == 0)
fprintf (stderr, "Errors detected in input file (your bison.simple is out of date)");
notice ("Errors detected in input file (your bison.simple is out of date)\n");
/* In case there were missing closebraces,
get us back to the global binding level. */
@ -4535,6 +4576,10 @@ main (argc, argv)
}
#endif
setlocale (LC_MESSAGES, "");
bindtextdomain (PACKAGE, localedir);
textdomain (PACKAGE);
signal (SIGFPE, float_signal);
#ifdef SIGPIPE
@ -5196,7 +5241,7 @@ main (argc, argv)
{
char *lim = (char *) sbrk (0);
fprintf (stderr, "Data size %ld.\n", (long)(lim - (char *) &environ));
notice ("Data size %ld.\n", (long) (lim - (char *) &environ));
fflush (stderr);
#ifndef __MSDOS__
@ -5225,7 +5270,7 @@ set_target_switch (name)
const char *name;
{
register size_t j;
int valid = 0;
int valid_target_option = 0;
for (j = 0; j < sizeof target_switches / sizeof target_switches[0]; j++)
if (!strcmp (target_switches[j].name, name))
@ -5234,23 +5279,23 @@ set_target_switch (name)
target_flags &= ~-target_switches[j].value;
else
target_flags |= target_switches[j].value;
valid = 1;
valid_target_option = 1;
}
#ifdef TARGET_OPTIONS
if (!valid)
if (!valid_target_option)
for (j = 0; j < sizeof target_options / sizeof target_options[0]; j++)
{
int len = strlen (target_options[j].prefix);
if (!strncmp (target_options[j].prefix, name, len))
{
*target_options[j].variable = name + len;
valid = 1;
valid_target_option = 1;
}
}
#endif
if (!valid)
if (!valid_target_option)
error ("Invalid option `%s'", name);
}
@ -5263,17 +5308,17 @@ print_version (file, indent)
FILE *file;
const char *indent;
{
fprintf (file, "%s%s%s version %s", indent, *indent != 0 ? " " : "",
language_string, version_string);
fprintf (file, " (%s)", TARGET_NAME);
#ifdef __GNUC__
#ifndef __VERSION__
#define __VERSION__ "[unknown]"
#define __VERSION__ "[?]"
#endif
fprintf (file, " compiled by GNU C version %s.\n", __VERSION__);
fnotice (file,
#ifdef __GNUC__
"%s%s%s version %s (%s) compiled by GNU C version %s.\n"
#else
fprintf (file, " compiled by CC.\n");
"%s%s%s version %s (%s) compiled by CC.\n"
#endif
, indent, *indent != 0 ? " " : "",
language_string, version_string, TARGET_NAME, __VERSION__);
}
/* Print an option value and return the adjusted position in the line.
@ -5323,7 +5368,7 @@ print_switch_values (file, pos, max, indent, sep, term)
/* Print the options as passed. */
pos = print_single_switch (file, pos, max, indent, *indent ? " " : "", term,
"options passed: ", "");
_("options passed: "), "");
for (p = &save_argv[1]; *p != NULL; p++)
if (**p == '-')
@ -5352,7 +5397,7 @@ print_switch_values (file, pos, max, indent, sep, term)
should suffice. */
pos = print_single_switch (file, 0, max, indent, *indent ? " " : "", term,
"options enabled: ", "");
_("options enabled: "), "");
for (j = 0; j < sizeof f_options / sizeof f_options[0]; j++)
if (*f_options[j].variable == f_options[j].on_value)

View File

@ -3324,7 +3324,7 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
tree decl ATTRIBUTE_UNUSED;
tree type ATTRIBUTE_UNUSED;
{
int valid = 0;
int validated = 0;
#ifdef VALID_MACHINE_DECL_ATTRIBUTE
tree decl_attr_list = decl != 0 ? DECL_MACHINE_ATTRIBUTES (decl) : 0;
#endif
@ -3354,12 +3354,12 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
decl = build_decl_attribute_variant (decl, decl_attr_list);
}
valid = 1;
validated = 1;
}
#endif
#ifdef VALID_MACHINE_TYPE_ATTRIBUTE
if (valid)
if (validated)
/* Don't apply the attribute to both the decl and the type. */;
else if (VALID_MACHINE_TYPE_ATTRIBUTE (type, type_attr_list, attr_name,
attr_args))
@ -3388,7 +3388,7 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
}
if (decl != 0)
TREE_TYPE (decl) = type;
valid = 1;
validated = 1;
}
/* Handle putting a type attribute on pointer-to-function-type by putting
@ -3415,11 +3415,11 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
if (decl != 0)
TREE_TYPE (decl) = build_pointer_type (inner_type);
valid = 1;
validated = 1;
}
#endif
return valid;
return validated;
}
/* Return non-zero if IDENT is a valid name for attribute ATTR,

View File

@ -769,6 +769,10 @@ make_decl_rtl (decl, asmspec, top_level)
if (flag_volatile_global && TREE_CODE (decl) == VAR_DECL
&& TREE_PUBLIC (decl))
TREE_SIDE_EFFECTS (decl) = 1;
else if (flag_volatile_static && TREE_CODE (decl) == VAR_DECL
&& (TREE_PUBLIC (decl) || TREE_STATIC (decl)))
TREE_SIDE_EFFECTS (decl) = 1;
if (TREE_SIDE_EFFECTS (decl))
MEM_VOLATILE_P (DECL_RTL (decl)) = 1;
@ -1314,6 +1318,7 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
#if ! defined (ASM_OUTPUT_BSS) && ! defined (ASM_OUTPUT_ALIGNED_BSS)
&& DECL_COMMON (decl)
#endif
&& DECL_SECTION_NAME (decl) == 0
&& ! dont_output_data)
{
int size = TREE_INT_CST_LOW (size_tree);

View File

@ -1 +1 @@
char *version_string = "egcs-2.93.03 19990127 (gcc2 ss-980609 experimental)";
char *version_string = "egcs-2.93.03 19990127 (gcc2 ss-980929 experimental)";

View File

@ -177,7 +177,7 @@ xcoff_output_standard_types (syms)
#define UNKNOWN_STAB(STR) \
do { \
fprintf(stderr, "Error, unknown stab %s: : 0x%x\n", STR, stab); \
error ("Unknown stab %s: : 0x%x\n", STR, stab); \
fflush (stderr); \
} while (0)

View File

@ -1,3 +1,7 @@
Wed Jan 27 02:31:01 1999 Jeffrey A Law (law@cygnus.com)
* Makefile.in (ALL_CFLAGS): Add -DIN_GCC.
Tue Jan 5 01:38:53 1999 Jeffrey A Law (law@cygnus.com)
* configure.in (thread_file): Correct and simplify code to find

View File

@ -60,7 +60,7 @@ RANLIB = @RANLIB@
CC = @CC@
CFLAGS = @CFLAGS@
ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS)
ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) -DIN_GCC
INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config -I$(MULTIBUILDTOP)../../gcc \