diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-07 05:49:18 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-07 05:49:18 +0000 |
commit | 7014838cdd847f5d22f8b4bff0285ad622b707b5 (patch) | |
tree | f1a67b6ea75a7f0da3f06e0a1c60b213f4403168 /gcc | |
parent | 713829e97b2cabe9369424002f6efb23a7c86aba (diff) | |
download | gcc-7014838cdd847f5d22f8b4bff0285ad622b707b5.tar.gz |
Merge in gcc2-ss-010999
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29150 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
202 files changed, 5890 insertions, 4932 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 01e15cc0776..c7300cd85ed 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Mon Sep 6 22:44:47 1999 Jeffrey A Law (law@cygnus.com) + + * Merge from gcc2 snapshot Jan 9, 1999. See FSFChangeLog for + details. + Mon Sep 6 22:31:28 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * c-aux-info.c (concat): Don't define. @@ -126,6 +131,7 @@ Mon Sep 6 14:30:13 1999 Bernd Schmidt <bernds@cygnus.co.uk> (ix86_mark_machine_status): New function. (override_options): Set mark_machine_status. +>>>>>>> 1.4290 Mon Sep 6 15:26:23 1999 Bernd Schmidt <bernds@cygnus.co.uk> * tree.c (copy_node): Copy node contents also if doing GC. @@ -136,6 +142,7 @@ Mon Sep 6 08:42:06 1999 Alexandre Oliva <oliva@dcc.unicamp.br> Mon Sep 6 02:42:36 1999 Jeffrey A Law (law@cygnus.com) +>>>>>>> 1.4287 * collect2.c (scan_libraries): Fix thinko. * cse.c (delete_trivially_dead_insns): Do not skip the last diff --git a/gcc/FSFChangeLog b/gcc/FSFChangeLog index 9a0e7f82804..d8cdf7bd564 100644 --- a/gcc/FSFChangeLog +++ b/gcc/FSFChangeLog @@ -1,9 +1,646 @@ +Sat Jan 9 08:19:14 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * toplev.c (rest_of_compilation): Set cse_not_expected earlier. + + * optabs.c (emit_conditional_move): Undo canonicalization previously + done by get_condition. + + * jump.c (jump_optimize): Move simple optimizations in front + of complex ones. + Reset NEXT whenever deleting an insn in case NEXT was deleted. + Disable some conditional move optimizations if have + conditional arithmetic or if CSE not run yet. + Add new optimization to conditionalize code if have conditional + arithmetic. + (can_reverse_comparison_p): Check REVERSIBLE_CC_MODE. + (condjump{,_in_parallel}_p): Simplify. + +Thu Jan 7 09:25:51 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * jump.c (delete_computation): Don't trust location of REG_DEAD + note within a basic block. + +Sat Dec 26 06:31:43 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * cse.c (cse_insn): Always make SET a nop if dest is hard regster and + src is equivalent. + + * flow.c (print_rtl_with_bb): Write insns in epilogue delay list. + + * combine.c (simplify_set): Update SET_SRC after force_to_mode call. + If HAVE_conditional_arithmetic, make conditional if comparison + operator is arg of arithmetic. + + * genconfig.c (have_cond_arith_flag): New variable. + (walk_insn_part, case IF_THEN_ELSE): Set it. + (main): Define HAVE_conditional_arithmetic if have_cond_arith_flag. + + * reorg.c (optimize_skip): Count insns in delay slots for epilogue + as being after a conditional return. + +Wed Dec 23 07:30:22 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * mips.md (movdf [mips4]): Remove '=' in constraint when not output. + + * toplev.c (fatal_function): New static variable. + (set_fatal_function): New function. + (vfatal): If fatal_function nonzero, call it. + +Thu Dec 10 07:21:44 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * expr.c (move_by_pieces_1): Give inner arg types of function passed + as first operand. + + * aclocal.m4 (GCC_HEADER_INTTYPES, GCC_CHECK_STRINGIFY): New macros. + * configure.in: Use them instead of inline text. + (malloc.h): Check for presence. + (free, malloc, calloc, realloc): Include malloc.h to see if need decl. + * system.h (malloc.h): Conditionally include. + (free, malloc, calloc, realloc): Conditionally declare. + * xm-mn10200.h (free, malloc, realloc, calloc): Remove redundant decls. + * xm-mn10300.h, rs6000/xm-sysv4.h, xm-v850.h: Likewise. + * xm-alpha.h: Likewise. + (string.h): Remove reundant #include. + * rtl.h (free): Remove declaration. + * tree.h (free): Likewise. + + * gcov.c (fatal): New function. + +Wed Dec 9 06:25:12 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * protoize.c: Remove extraneous #endif. + Remove redundant declarations and includes. + (fatal): New function, from gen*.c. + +Wed Dec 9 06:16:26 1998 Craig Burley (burley@gnu.ai.mit.edu) + + * fold-const.c (multiple_of_p): New function. + (fold): Turn some cases of *_DIV_EXPR into EXACT_DIV_EXPR. + +Wed Dec 9 04:42:23 1998 H.J. Lu (hjl@gnu.ai.mit.edu) + + * expr.h, real.h: Add more prototypes. + +Tue Dec 8 06:04:19 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * c-typeck.c (c_expand_asm_operands): Fix text of error message + and handle conversion as lvalue. + +Mon Dec 7 21:35:31 1998 Paul Eggert <eggert@twinsun.com> + + * dwarf2out.c (dyn-string.h): Fix patching error. + * toplev.c (<sys/times.h>): Include if HAVE_SYS_TIMES_H is defined. + +Sun Dec 6 01:14:46 1998 Paul Eggert <eggert@twinsun.com> + + * collect2.c (mktemp): Remove unused decl. + +Sat Dec 5 21:02:13 1998 Paul Eggert <eggert@twinsun.com> + + * cccp.c (fwrite): New VMS macro. + (VMS_fwrite): New VMS function. + (strerror): Declare only if NEED_DECLARATION_STRERROR. + (warn_white_space): New var. + (do_warning): Remove. + (directive_table): Use do_error to print warnings. + (eprint_string): Remove. All callers now use fwrite instead. + (check_white_space): New function. + (fatal): Now extern. + (main): Add new option --White-space, implied by -Wall. + If DEPENDENCIES_OUTPUT has the form `FILE TARGET', have TARGET depend + on source file as well as files it includes. + (newline_fix, name_newline_fix): Assume that *BP == '\\', + but don't assume that BP[1] == '\n'; all callers changed. + (rescan): Warn about white space at end of line in string. + Fix bug with counting newlines in strings as result of macro-expanding. + (expand_to_temp_buffer): Do not stomp on the output buffer length; + all callers changed. + (handle_directive): No need to check bp < limit if *bp == '\n'. + Allocate a larger directive buffer; expand newline to + backslash-'n' in string literals. + (timestamp): Don't assume that localtime succeeds. + (finclude): Add call to check_white_space in included file. + (collect_expansion): No need to check for p < limit at backslash. + (do_line): Allow nulls in file name. + (do_error): Also do warnings. + (do_pragma): Handle escapes in strings correctly. + (skip_quoted_string): Don't say ``Unterminated string or character'' + if it's known to be a character. + Warn about white space at end of line in string. + (struct argdata): New member expand_size. + Rename member stringified_length to stringified_length_bound. + All uses changed. + (macroexpand): Record expand_size separately from expand_length. + Generate nothing for backslash-newline in a string. + Escape newlines in strings. + (macarg): Have macarg1 count newlines. Escape newlines in strings. + (macarg1): Skip backslash-newline in strings. + (change_newlines): Now takes struct argdata * (not U_CHAR * and int) + returns void, not int. Modify the arg in-place. + (change_newlines, make_definition): In strings, replace + backslash-newline with nothing, and non-backslashed newline + with backslash-'n'. + + * cexp.y (fatal): New decl (exported by cccp.c). + (yylex): Allow multiple-char constants like 'abcde' that are longer + than long; draft C9x requires this. Don't treat (char)-1 like EOF. + (parse_escape): Return -2 if backslash-newline is seen. + Parse backslash-newline in numeric escapes. + Parse \x using unsigned, not signed, for proper overflow detection. + +Fri Dec 4 16:24:36 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * Defer some __builtin_constant_p elaborations until after cse; + original idea from rth@cygnus.com + * rtl.def (CONSTANT_P_RTX): New RTL code. + * expr.c (expand_builtin, case BUILT_IN_CONSTANT_P): Rework to + consider constant CONSTRUCTOR constant and to defer some cases to cse. + * cse.c (fold_rtx, case CONST): Add handling for CONSTANT_P_RTX. + * regclass.c (reg_scan_mark_refs, case CONST): Likewise. + +Tue Dec 1 09:35:45 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * Makefile.in (C_AND_OBJC_OBJS): Add mbchar.o. + (c-lex.o, cexp.o, cccp.o): Depend on mbchar.h. + (mbchar.o): New rule. + (CCCP_OBJS, CPPMAIN_OBJS): Include mbchar.o. + * po/POTFILES.in (mbchar.[ch]): Add. + +Tue Dec 1 09:32:27 1998 Dave Brolley <brolley@cygnus.com> + + * mbchar.[ch]: New files for multibyte character handling. + * configure.in (enable_c_mbchar): New configure option. + * cexp.y (mbchar.h): #include it. + (yylex): Handle Multibyte characters in character literals. + * cccp.c (mbchar.h): #include it. + (main): Set character set based on LANG environment variable. + (rescan): Handle multibyte characters in comments. + (skip_if_group, validate_else, skip_to_end_of_comment): Likewise. + (macarg1, discard_comments): Likewise. + (rescan): Handle multibyte characters in string and character literals. + (collect_expansion, skip_quoted_string, macroexpand): Likewise. + (macarg1, discard_comments, change_newlines): Likewise. + * c-lex.c (mbchar.h): #include it. + (GET_ENVIRONMENT): New macro. + (init_lex): Set character set based on LANG environment variable. + (yylex): Handle multibyte characters in character and string literals. + +Mon Nov 30 08:25:35 1998 Mark Mitchell <mark@markmitchell.com> + + * dyn-string.h: New file. + * dyn-string.c: Likewise. + * Makefile.in (OBJS): Add dyn-string.o. + (dwarf2out.o): Add dyn-string.h dependency. + (dyn-string.o): New rule. + * dwarf2out.c (dyn-string.h): Include. + (ASM_NAME_TO_STRING): Use dyn_string_append, rather than strcpy. + (addr_const_to_string): Take a dyn_string_t, not a char * as a + prototype. Use dyn_string_append rather than strcat, throughout. + (addr_to_string): Use dyn_string_t. + +Mon Nov 30 06:57:49 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * po/POTFILES.in (dyn-string.[ch]): New files. + + * sched.c (swap_sort): Fix typo in last change. + +Sun Nov 29 21:02:34 1998 Paul Eggert <eggert@twinsun.com> + + * po/POTFILES.in: Add gengenrtl.c, system.h. + +Sun Nov 29 16:36:59 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * expmed.c (emit_store_flag): Don't try to negate STORE_FLAG_VALUE. + + * configure.in: Remove inadvertently added duplicate tests. + + * reload1.c (emit_reload_insns): Fix typos in preserve death note code. + + * Makefile.in (c-lex.o): Depends on $(RTL_H). + + * genattr.c (fatal): No longer static. + * genattrtab.c, gencodes.c, genconfig.c, genemit.c: Likewise. + * genextract.c, genflags.c, gengenrtl.c, genopinit.c: Likewise. + * genoutput.c, genpeep.c, genrecog.c: Likewise. + + * 1750a.c: Use gen_rtx_FOO and GEN_INT, not gen_rtx; include system.h. + * a29k.c, alpha.c, arc.c, arm.c, clipper.c, convex.c: Likewise. + * dsp16xx.c, fx80.c, gmicro.c, h8300.c, i386.c, i860.c: Likewise. + * i960.c, m32r.c, m68k.c, m88k.c, mips.c, mn10200.c: Likewise. + * mn10300.c, ns32k.c, pa.c, pdp11.c, pyr.c, romp.c: Likewise. + * rs6000.c, sh.c, sparc.c, spur.c, tahoe.c, v850.c: Likewise. + * vax.c, we32k.c: Likewise. + * elxsi.c, i370.c: Include system.h + * gofast.h: Use gen_rtx_FOO and GEN_INT instead of gen_rtx. + * 1750a.{md,h}, a29k{md,h}, alpha.{md,h}, alpha/vms.h: Likewise. + * arc.{md,h}, arm.{md,h}, clipper.{md,h}, convex.{md,h}: Likewise. + * dsp16xx.{md,h}, elxsi.h, fx80.{md,h}, gmicro.{md,h}: Likewise. + * h8300.h, i370.{md,h}, i386.{md,h}, i386/cygwin32.h: Likewise. + * i386/osfrose.h, i386/win-nt.h, i860.{md,h}, i960.{md,h}: Likewise. + * m32r.{md,h}, m68k.{md,h}, m68k/a-ux.h, m68k/crds.h: Likewise. + * m68k/isi.h, m68k/linux.h, m68k/lynx.h, m68k/m68kemb.h: Likewise. + * m68k/m68kv4.h, m68k/mot3300.h, m68k/news.h, m68k/sun3.h: Likewise. + * m88k.{md,h}, mips.{md,h}, mips/abi64.h, mn10200.{md,h}: Likewise. + * mn10300.{md,h}, ns32k.{md,h}, pa.{md,h}, pyr.{md,h}: Likewise. + * romp.{md,h}, rs6000.{md,h}, sh.{md,h}, sparc.{md.h}: Likewise. + * spur{md,h}, tahoe.{md,h}, v850.{md,h}, vax.{md,h}: Likewise. + * we32k.{md,h}: Likewise. + +Sat Nov 28 19:32:33 1998 Jeffrey A Law (law@cygnus.com) + + * rtl.def (INLINE_HEADER): Fix type error found by gen_rtx_FOO changes. + + * configure.in: If host != build, run autoconf to generate auto + build.h for the build machine and include it in build_xm_files. + +Sat Nov 28 19:20:06 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * bc-emit.c, caller-save.c, calls.c, combine.c: Call gen_rtx_FOO. + * cse.c, dwarf2out.c, emit-rtl.c, except.c, explow.c: Likewise. + * expmed.c expr.c, final.c, function.c, genpeep.c, halfpic.c: Likewise. + * integrate.c, jump.c, local-alloc.c, loop.c, optabs.c: Likewise. + * profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise. + * reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise. + * unroll.c, varasm.c: Likewise. + + * Makefile.in (*.o): Depend on system.h. + * system.h (ANSI_PROTOTYPES): Add definition. + * *.c, c-parse.in, cexp.y: Include system.h and delete any + non-redundant includes, macro definitions, or declarations. + * gen*.c, bc-emit.c, calls.c, cccp.c, combine.c, emit-rtl.c: + Use ANSI_PROTOTYPES, not __STDC__ to select varargs vs. stdargs. + * gcc.c, mips-tfile.c, prefix.c, toplev.c, tree.c: Likewise. + * gen*.c (fatal): Fix error in varargs case. + * genattrtab.c (fatal): Make same as other gen programs. + * genattrtab.c: Write #include for system.h in output. + * genemit.c, genextract.c, genoutput.c, genpeep.c: Likewise. + * genrecog.c: Likewise. + +Sat Nov 28 06:01:525 1998 John F. Carr <jfc@mit.edu> + + * emit-rtl.c (const_int_rtx): Now array of rtx_def, not rtx. + +Sat Nov 28 05:53:45 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * rtl.h (obstack_alloc_rtx): New declaration. + * rtl.c (rtx_alloc): Try to clear as integer or HOST_WIDE_INT indirect. + (obstack_alloc_rtx): New function. + +Sat Nov 28 05:46:41 1998 Richard Henderson <rth@cygnus.com> + + * gengenrtl.c: New file. + * Makefile.in (OBJS): Add genrtl.c. + (GEN): Add gengenrtl. + (STAGESTUFF): Add s-genrtl and gengenrtl$(exeext); + (RTL_BASE_H): New, from RTL_H. + (RTL_H): Contains RTL_BASE_H and genrtl.h + (genrtl.o, genrtl.c, s-genrtl, gengenrtl): New rules. + * emit-rtl.c (gen_rtx_{CONST_INT,REG,MEM}): New functions. + (gen_rtx): Call them. + * genemit.c (gen_exp, gen_insn): Call gen_rtx_FOO for constant FOO. + * rtl.h (genrtl.h): Include ifndef NO_GENRTL_H. + (gen_rtx_{CONST_INT,REG,MEM}): New declarations. + (GEN_INT): Call gen_rtx_CONST_INT. + +Fri Nov 27 20:16:12 1998 Michael Meissner <meissner@cygnus.com> + + * configure.in (AC_CHECK_FUNCS): Check for strchr and strrchr. + +Fri Nov 27 20:13:36 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * system.h: New file. + + * configure.in (AC_CHECK_FUNCS): Remove check for vprintf. + Add check for isascii and strsignal. + Collapse multiple calls. + (GCC_NEED_DECLARATIONS): Likewise, from GCC_NEED_DECLARATION. + Check for bcopy, bcmp, bzero, strerror, atof, getcwd, + strsignal and getwd. + Add checks for getrlimit and setrlimit; search in sys/resource.h. + (GCC_FUNC_PRINTF_PTR, GCC_C_VOLATILE, GCC_FUNC_VFPRINTF_DOPRNT): Call. + (GCC_HEADER_STRING, AC_FUNC_VFORK, AC_HEADER_SYS_WAIT): Likewise. + + * acconfig.h (NEED_DECLARATION_{STRERROR,GETCWD,GETWD,BZERO}: Add. + (NEED_DECLARATION_{{G,S}ETRLIMIT,STRSIGNAL,BCOPY,BCMP}): Likewise. + (STRING_WITH_STRINGS, HAVE_VOLATILE, HOST_PTR_PRINTF): Likewise. + + * aclocal.m4 (GCC_NEED_DECLARATION): Accept optional second arg. + Test STRING_WITH_STRINGS when deciding which headers to search for + function declarations. + (GCC_NEED_DECLARATIONS, GCC_HEADER_STRING): New autoconf test. + (GCC_FUNC_{VFPRINTF_DOPRNT,PRINTF_PTR}, GCC_C_VOLATILE): Likewise. + +Fri Nov 27 20:10:42 1998 Richard Henderson <rth@cygnus.com> + + * configure.in: Add cpp stringify test. + (AC_CHECK_FUNCS): Check for sbrk. + * acconfig.h (HAVE_CPP_STRINGIFY): New tag. + +Fri Nov 27 20:09:27 1998 Manfred Hollstein <manfred@s-direktnet.de> + + * configure.in (AC_CHECK_FUNCS): Check for getrlimit and setrlimit. + +Fri Nov 27 19:48:27 1998 Jeffrey A Law <law@cygnus.com> + + * configure.in (AC_CHECK_FUNCS): Add gettimeofday, atoq, atoll, + strerror, stroul, abort and bsearch. + * acconfig.h (NEED_DECLARATION_{ATOL,ABORT}): New tags. + +Fri Nov 27 19:46:09 1998 Jim Wilson <wilson@cygnus.com> + + * acconfig.h (HAVE_INTTYPES_H): New tag. + * configure.in (inttypes.h): Check for conflicts between sys/types.h + and inttypes.h and verify that intmax_t is defined. + +Fri Nov 27 08:07:53 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * alpha.c (sext_add_operand): Use reg_not_elim_operand. + (reg_not_elim_or_8bit_operand): New function. + * alpha.h (PREDICATE_CODE): Add new entry and alphabetize. + * alpha.md (mult patterns): Ensure eliminable reg not any input. + + * Makefile.in (STAGESTUFF): Remove s-ver. + (s-ver): Remove rule and revert back to version.c as target. + +Fri Nov 27 02:39:36 1998 Paul Eggert <eggert@twinsun.com> + + * cccp.c (main): Make `-I -' equivalent to `-I-'. + +Fri Nov 27 02:39:36 1998 Sam Kendall <kendall@init.com> + + * cccp.c (main): Avoid `++i' and `i' in same expression. + +Thu Nov 26 19:42:02 1998 Stephen L Moshier <moshier@mediaone.net> + + * real.c (ereal_atof): New function for hexadecimal floating constants. + * real.h (REAL_VALUE_HTOF): New macro for hex float conversion. + * c-lex.c (yylex): Use it and check syntax of hex floats. + * fold-const.c (real_hex_to_f): New function reads hex float + if no REAL_ARITHMETIC. + +Thu Nov 26 18:51:51 1998 Richard Henderson <rth@cygnus.com> + + * alpha.c (reg_not_elim_operand): New function. + * alpha.h (PREDICATE_CODES): Add it. + * alpha.md: Remove reload-only patterns for (plus (plus (mult ...))). + (s[48]{add,sub}q): Use new function as predicate for multiplicand. + +Thu Nov 26 09:13:35 1998 Hans Cappelle <cappelle@imec.be> + + * reorg.c (fill_simple_delay_slots): Fix typo in sets_cc0_p call. + +Thu Nov 26 06:15:46 1998 Paul Edwards <avon@matra.com.au> + + * genattr.c (fatal): Use vprintf if available. + * genattrtab.c, gencodes.c, genconfig.c, genemit.c: Likewise. + * genextract.c, genflags.c, genopinit.c, genoutput.c: Likewise. + * genpeep.c: Likewise. + +Wed Nov 25 08:02:23 1998 Ken Raeburn <raeburn@cygnus.com> + + * Makefile.in (version.c): Truncate tmp-version.c when writing to + it, instead of appending. Use timestamp file s-ver to prevent + repeated rebuilding of file with unchanged contents. + (STAGESTUFF): Add s-ver. + +Wed Nov 25 07:53:24 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * reload.h (form_sum): Add new parm, DIFF_P. + * reload.c (form_sum): Likewise. + (subst_indexed_address): Call it with new parm. + * reload1.c (eliminate_regs, case MINUS): Make common with PLUS. + (eliminate_regs_in_insn): Re-recognize if was MINUS. + * alpha.md: Add patterns for (plus (minus (mult ..) ...) ...). + + * libgcc2.c (__bb_init_prg): Avoid use of bzero. + + * combine.c (make_extraction): Make extraction even if may + span if INNER is not MEM. + +Wed Nov 25 07:30:28 1998 David Addison <addy@quadrics.com> + + * sparc.h (SPARC_INCOMING_INT_ARG_FIRST): Respect TARGET_FLAT. + +Mon Nov 23 07:00:57 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * function.c (purge_addressof_1): If validate_change fails, try + validate_replace_rtx. + + * expr.c (expand_expr, case ADDR_EXPR): Non-constant can be ADDRESSOF. + + * expr.c (store_constructor_{,field}): New parameter ALIGN and + use it when making recursive calls and clearing memory. + (expand_expr, case CONSTRUCTOR): Call with new parameter. + + * mips/abi64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove ABI_EABI test. + * mips.c (function_arg_pass_by_reference): Return 1 if would + otherwise pass both in registers and on stack. + +Fri Nov 13 06:56:24 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * alpha/vms.h (struct avms_arg_info): Use int for num_args. + +Mon Nov 2 07:35:26 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * sched.c ({true,anti,output}_dependence): Volatile conflicts with + anything where MEM_IN_STRUCT_P doesn't match. + +Fri Oct 30 14:05:32 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * expr.c (struct move_by_pieces): New fields {to,from}_readonly. + (move_by_pieces): Initialize them. + (move_by_pieces_1): Use them. + + +Sun Oct 25 06:12:33 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * optabs.c (emit_no_conflict_block): Allow insn of just USE or SET. + + * explow.c (allocate_dynamic_stack_space): If operand 1 has VOIDmode, + use Pmode. + + * configure.in (AC_CHECK_HEADERS): Fix typo with sys/stat.h. + + * Makefile.in (config.status): Use $(srcdir) for configure. + + * sparc.md (*sethi_di_medium_pic): Add CLOBBER of register 1. + + * x-alpha (CLIB): Add -lexc. + + * i386/mingw32.h (OUTPUT_QUOTED_STRING): Don't use Cygwin format + for drive letter. + + * cccp.c (handle_directive): Complete support for #undef when -dM. + + * configure.in (alpha*-*-vxworks*): Set MASK_SUPPORT_ARCH from host. + + * m68k.md (adddi3, subdi3, anddi3, iordi3, xordi3): Use split_double. + +Sat Oct 24 13:41:06 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * local-alloc.c (alloc_qty_for_scratch, requires_inout): Allow + matching up to operand number 9. + * recog.c (constrain_operands): Likewise. + * reg-stack.c (constrain_asm_operands): Likewise. + * regclass.c (record_reg_classes): Likewise. + * regmove.c (find_matches): Likewise. + * reload.c (find_reloads): Likewise. + * reload1.c (reload_cse_simplify_operands): Likewise. + +Sat Oct 24 09:27:30 1998 David Edelsohn <edelsohn@mhpcc.edu> + + * regclass.c (record_reg_classes): Skip modifiers when looking + for constraint that just matches a previous operand. + Initialize classes[i] before handling matching operand. + +Fri Oct 23 07:05:52 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * fold-const.c (fold_range_test, fold): Use global_bindings_p, + not checking current_function_decl, to see if in function. + +Mon Oct 12 06:21:08 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * function.c (gen_mem_addressof): Copy REG_USERVAR_P to new reg. + +Sun Oct 11 14:40:24 1998 Ken Raeburn <raeburn@cygnus.com> + + * calls.c (store_one_arg): Use ARGS_SIZE_RTX to get size of argument + when emitting chkr_set_right_libfunc call. + +Mon Oct 5 18:28:33 1998 Hans-Peter Nilsson <hp@axis.se> + + * Makefile.in (version.c): Apply basename when using VERSION_DEP. + +Mon Oct 5 18:08:31 1998 Ken Raeburn <raeburn@cygnus.com> + + * rs6000.c (rs6000_stack_info): Remove extra paren. + (print_operand): Cast -1 to HOST_WIDE_INT before shifting it. + * optabs.c (init_optabs): Create Checker symbols in Pmode. + +Mon Oct 5 06:23:27 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * function.c (purge_addressof_1): Add new parm IN_DEST. + If have different modes and IN_DEST, try making STRICT_LOW_PART. + + * regmove.c (regmove_profitable_p): Put obfree at right place. + +Sun Oct 4 08:37:36 1998 Paul Edwards <avon@matra.com.au> + + * configure.in (AC_CHECK_HEADERS): Add sys/types.h and sys/stat.h. + * gcc.c (sys/types.h, sys/stat.h): Only include if exist. + * cccp.c, toplev.c: Likewise. + +Sun Oct 4 07:11:34 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.eu> + + * calls.c (expand_call): Don't call emit_group_store if target + is the same as VALREG. + + * loop.c (strength_reduce): Track maybe_multiple on giv scan. + (find_mem_givs, record_giv): New argument maybe_multiple. + + * reorg.c (fill_{simple,eager}_delay_slots): If insn no longer needs + delay slots, just skip instead of aborting. + +Sat Oct 3 08:04:28 1998 Ken Raeburn <raeburn@cygnus.com> + + * tree.h (DECL_NO_CHECK_MEMORY_USAGE): New macro. + (struct tree_decl): New field no_check_memory_usage. + * c-common.c (enum attrs): Add A_NO_CHECK_MEMORY_USAGE. + (init_attributes): Register it as a new attribute. + (decl_attributes): Set flags on functions given that attribute. + * c-decl.c (duplicate_decls): Merge new attribute. + * expr.h (current_function_check_memory_usage): Declare. + * calls.c, expr.c, function.c, stmt.c: Replace uses of + flag_check_memory_usage with current_function_check_memory_usage. + * alpha.c, clipper.c, m88k.c, pa.c, sparc.c: Likewise. + * function.h (struct function): New field check_memory_usage. + * function.c (current_function_check_memory_usage): Define it. + (push_function_context_to, pop_function_context_from): Save and + restore it. + (expand_function_start): Set it, based on global flag and function + attribute. + + * expr.c (expand_expr, case VAR_DECL): In memory-checking code, do + check non-automatic variables. + +Sat Oct 3 07:20:28 1998 Stephen L Moshier <moshier@world.std.com> + + * emit-rtl.c (gen_lowpart_common): Disable optimization of + initialized float-int union if the value is a NaN. + +Sat Oct 3 06:58:53 1998 David Edelsohn <edelsohn@mhpcc.edu> + + * rs6000.h (ASM_OUTPUT_ADDR_DIFF_ELT): Remove extraneous parameter. + +Sat Oct 3 06:53:43 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * regmove.c (regmove_profitable_p): Free allocated mem if we return 1. + + * rs6000.h (CPP_PREDEFINES): Add -D_LONG_LONG. + +Fri Oct 2 11:02:41 1998 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de> + + * Makefile.in (stmp-fixinc, stmp-fixproto, install-multilib): + Fix directory permissions. + * objc/Makefile.in (copy-headers): Likewise. + +Fri Oct 2 10:39:08 1998 Hans-Peter Nilsson <hp@axis.se> + + * expr.c (expand_expr, case CONSTRUCTOR): Change ">" to ">=" + making MOVE_RATIO use consistent. + +Fri Oct 2 08:22:01 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * h8300.c (get_shift_alg): Fix typo in asm string; "n" should be "\n". + +Wed Sep 30 15:53:17 1998 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de> + + * rs6000.h (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Delete. + Wed Sep 30 14:27:49 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * function.c (assign_parms): Undo change of June 9. +Wed Sep 30 14:21:39 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * c-typeck.c (c_expand_asm_operands): Give error if non-lvalue for + output operand. + + * libgcc2.c (__bb_init_prg): Properly zero bb_hashbuckets. + +Wed Sep 30 11:31:23 1998 Walter Gadeyne <gadeynew@sebb.bel.alcatel.be> + + * combine.c (num_sign_bit_copies, case UDIV): Return 1. + +Wed Sep 30 10:44:15 1998 Tristan Gingold <gingold@gavroche.enst.fr> + + * c-decl.c (finish_decl): Set the assembler name to the current + decl if it was specified. + (finish_function): Use assembler name for constructor and + destructor name. + (duplicate_decls): Copy the assembler name. + +Wed Sep 30 10:42:49 1998 Jim Wilson <wilson@cygnus.com> + + * regmove.c (struct match): Change char to int. + Tue Sep 29 09:57:26 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + * regmove.c (regmove_profitable_p): For shift, use 1 as third arg. + + * function.c (find_fixup_replacement): Consider equivalent if + rtx_equal_p, not just same rtx. + + * reload.h (last_output_reload_regno): New declaration. + * reload.c (find_reloads): No longer make it static and get last value. + * reload1.c (last_output_reload_regno): New definition. + (reload): Initialize it before each scan. + (reload_as_needed): Likewise, and also when insn has no reloads. + + * combine.c (simplify_comparison, case AND): Properly check for + SUBREG of a low part and exclude paradoxcal SUBREG, not low part, + for non-WORD_REGISTER_OPERATIONS machines. + * expr.c (get_inner_reference): Fix typo in last change. Mon Sep 27 21:34:00 1998 Paul Eggert <eggert@twinsun.com> @@ -62,19 +699,12 @@ Mon Aug 17 00:12:42 1998 Paul Eggert <eggert@twinsun.com> 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. + * intl/*, mkinstalldirs, po/*, exgettext, intl.c, intl.h: New files. + * Makefile.in (AWK, datadir, localedir, top_builddir): New variables. + (USE_NLS, INTLLIBS, POSUB, INTL_SUBDIRS, HOST_INTLLIBS): Likewise. + (PREPEND_DOTDOT_TO_RELATIVE_PATHS, SUBDIR_FLAGS_TO_PASS): Likewise. + (GCC_OBJS, COLLECT2_OBJS, CCCP_OBJS, CPPMAIN_OBJS): Likewise. + (PROTO_OBJS, GCOV_OBJS, INTL_DISTCLEAN, GEN_PROTOS_OBJS): Likewise. (LIBDEPS, LIBS): Add $(INTLLIBS). (HOST_LIBDEPS, HOST_LIBS): Add $(HOST_INTLLIBS). (LIBS): Add @LIBS@. @@ -85,25 +715,22 @@ Sun Aug 2 01:10:15 1998 Paul Eggert <eggert@twinsun.com> (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. + (xgcc, collect2, cccp, cppmain, {,un}protoize, gcov): Link intl.o. + (c-typeck.o, c-lex.o, collect2.o, gcc.o, toplev.o): Depend on intl.h. + (integrate.o, final.o, cccp.o, cppmain.o, cpplib.o): Likewise. + (cpperror.o, s-proto, gcov.o): Likewise. + (gencheck): Depend on $(HOST_LIBDEPS) instead of tree.h and tree.def. + (gencheck.o, intl.o, $(top_builddir)/intl/libintl.a): New rules. + ($(srcdir)/cp/parse.c, intl.all, intl.install): Likewise. + (intl.uninstall, intl.distdir, intl.mostlyclean, intl.clean): Likewise. + (intl.distclean, intl.maintainer-clean, intl.distdir-fixup): Likewise. + (distdir-check): Likewise. (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). + INTL_DISTCLEAN to be empty. Remove intl/libintl.h and libintl.h. (maintainer-clean): Make intl.maintainer-clean, but define INTL_DISTCLEAN to be empty. (install-normal): Depend on intl.install. @@ -112,34 +739,26 @@ Sun Aug 2 01:10:15 1998 Paul Eggert <eggert@twinsun.com> 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. + (compare, compare3, gnucompare, gnucompare3): Handle intl subdirectory. + (stage1-start, stage2-start, stage3-start, stage4-start): Likewise. - * 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. + * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT): New macros. + (HAVE_LC_MESSAGES, HAVE_STPCPY, PACKAGE, VERSION): Likewise. + * aclocal.m4 (AC_ISC_POSIX, AM_WITH_NLS): New functions. + (AM_GNU_GETTEXT, AM_LC_MESSAGES, AM_PATH_PROG_WITH_TEST): Likewise. * 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. + * 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. @@ -148,245 +767,177 @@ Sun Aug 2 01:10:15 1998 Paul Eggert <eggert@twinsun.com> (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. + (incomplete_type_error): Reword messages to ease localization. + (build_unary_op, lvalue_or_else, readonly_warning): Likewise. + (build_modify_expr): Likewise. (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. - + (error_init, pedwarn_init): Now takes one arg. All callers changed. + * c-tree.h (error_init, pedwarn_init): Likewise. * cccp.c: Include intl.h. (char_name): Remove. - (check_macro_name): Now takes int 2nd arg, not char *. All - callers changed. + (check_macro_name): 2nd arg now int, 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): 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. + (do_include, check_macro_name): Reword messages to ease localization. + (my_strerror): Likewise. + (verror, vwarning): Invoke vnotice to localize msgid. + (verror_with_line, vwarning_with_line): Likewise. + (pedwarn_with_file_and_line, fatal): Likewise. (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. + (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. + (my_strerror): Reword messages so they do not require localization. + (main, collect_execute, scan_prog_file, scan_libraries): Likewise. + (read_file, end_file): Likewise. + (notice): New function. + (fatal, error, main): Use it to translate msgid strings. + (collect_execute, maybe_unlink, write_c_file_stat): Likewise. + (locatelib, scan_libraries, scan_prog_file, add_func_table): Likewise. + (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. - + (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. + * cppexp.c (cpp_lex): 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. + (check_macro_name): 2nd arg now int, not char *. All callers changed. + (check_macro_name, do_define): Reword messages to ease localization. + (do_define): 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_error, cpp_warning, cpp_warning_with_line): Translate msgid arg. + (cpp_pedwarn_with_file_and_line): Likewise. (cpp_notice): New function. - (my_strerror): Reword message so that it does not require - localization. - + (my_strerror): Reword message so 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. + (my_strerror, snapshot_warning): Reword messages so they do not + require localization. + (init_spec, set_spec): Invoke `notice' to localize notices. + (read_specs, execute, do_spec_1, main, snapshot_warning): Likewise. + (struct switchstr): Don't use `valid' as identifier. (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". + (pfatal_with_name): Invoke perror_with_name, not fatal. + (perror_with_name): Invoke printf, not error. + (pfatal_pexecute): Invoke pfatal_with_name, not fatal. (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. - + (xmalloc, fancy_abort, print_usage): Use it to to print diagnostics. + (open_files, read_files, function_summary, output_data): Likewise. * 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. + (my_strerror): Reword message so it does not require localization. + (xmalloc, xrealloc, fancy_abort): Use `notice' to print diagnostic. + (safe_write, usage, file_normally_convertible, abspath): Likewise. + (find_file, aux_info_corrupted, save_def_or_dec): Likewise. + (gen_aux_info_file, process_aux_info_file, rename_c_file): Likewise. + (find_extern_def, find_static_definition): Likewise. + (declare_source_confusing, edit_fn_declaration): Likewise. + (edit_formals_lists, add_local_decl, add_global_decls): Likewise. + (edit_fn_definition, scan_for_missed_items, edit_file, main): Likewise. (main): Set message locale. - * real.c (NMSGS, ermsg): Remove. - (mtherr): Revamp to pass explicit strings to diagnostic - generators. Abort on invalid operations. - + (mtherr): 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. + (default_print_error_function): Reword messages to ease localization. + Use `notice' to translate diagnostics. + (report_error_function, main, print_version): Likewise. (vnotice, notice, fnotice): New functions. (vmessage): Remove. - (v_message_with_file_and_line, vsorry): Translate msgid with - vnotice. + (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>. - + (set_target_switch): Don't use `valid' as an identifier. + (__VERSION__): Reword message so it does not require localization. + (print_switch_values): Translate "options passed" and "enabled". + * tree.c (valid_machine_attribute): Don't use `valid' as identifier. * xcoffout.c (xcoff_output_standard_types): Use `error' to output diagnostic, so that it gets translated. + * 1750a.c (memop_valid): Don't use `valid' as an identifier. + * arc/initfini.c (__do_global_dtors): Put backslash before + newline in strings, to pacify xgettext. + * dsp16xx.c (dsp16xx_invalid_register_for_compare): New function. + * dsp16xx.h: Declare it. + * dsp16xx.md: Use it to report invalid registers. + * i370.h: Include <ctype.h>. + * i386.c: Include config.h first. + * m32r/initfini.c (__do_global_dtors): Put backslash before + newline in strings, to pacify xgettext. + * m88k/dguxbcs.h (CPP_SPEC): Likewise. + * rs6000.c: Include config.h first. + (rs6000_fatal_bad_address): New function. + * rs6000.h: Declare it. + * rs6000.md: Use it to report bad addresses. + * v850.c: Include config.h first. + + * configure.in: When generating config.h and mentioning file from + the config directory, surround it with #ifdef IN_GCC. + (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'. + If libintl.h is created, echo '#include "intl/libintl.h"' >libintl.h. + * 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). * patch-apollo-includes: Remove; this is part of README.APOLLO. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 07a343703fe..ce56466ff01 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -689,7 +689,7 @@ CCCP=@cpp_main@ 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 tree-check.h \ - s-flags s-config s-codes s-mlib s-under\ + s-flags s-config s-codes s-mlib s-unders s-genrtl \ s-output s-recog s-emit s-extract s-peep s-check \ s-attr s-attrtab s-opinit s-crt s-crtS s-crt0 \ genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \ @@ -786,6 +786,16 @@ REGS_H = regs.h varray.h machmode.h machmode.def .SUFFIXES: .SUFFIXES: .c .o +$(srcdir)/version.c: $(VERSION_DEP) + (cd $(srcdir); cvs log -h `basename $?`) >tmp-ver + tag=`sed '1,/^sym/d;s/ *gcc-//;s/:.*$$//;q' tmp-ver`; \ + ver=`echo $${tag} | sed 's/-.*//' | sed 's/_/./g'`; \ + date=`echo $${tag} | sed 's/.*-//'`; \ + if [ $${date} != RELEASE ]; then ver="testgcc-$${ver} $${date} experimental"; fi; \ + echo "char *version_string = \"$${ver}\";" >tmp-version.c + rm -f tmp-ver + $(srcdir)/move-if-change tmp-version.c $(srcdir)/version.c + Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.c \ $(xmake_file) $(tmake_file) $(LANG_MAKEFILES) $(SHELL) $(srcdir)/configure.frag $(srcdir) "$(SUBDIRS)" \ @@ -818,7 +828,7 @@ cstamp-h: config.in config.status # Really, really stupid make features, such as SUN's KEEP_STATE, may force # a target to build even if it is up-to-date. So we must verify that # config.status does not exist before failing. -config.status: configure version.c +config.status: $(srcdir)/configure version.c @if [ ! -f config.status ] ; then \ echo You must configure gcc. Look at the INSTALL file for details.; \ false; \ @@ -1449,7 +1459,7 @@ prefix.o: prefix.c $(CONFIG_H) system.h Makefile prefix.h -DPREFIX=\"$(prefix)\" \ -c `echo $(srcdir)/prefix.c | sed 's,^\./,,'` -convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h toplev.h +convert.o: convert.c $(CONFIG_H) system.h $(TREE_H) flags.h convert.h toplev.h tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h \ ggc.h @@ -1521,11 +1531,9 @@ emit-rtl.o : emit-rtl.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \ function.h $(REGS_H) insn-config.h $(RECOG_H) real.h ggc.h \ $(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h real.o : real.c $(CONFIG_H) system.h $(TREE_H) toplev.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) \ 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 function.h \ toplev.h insn-attr.h @@ -1567,7 +1575,6 @@ bitmap.o : bitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H) \ global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h reload.h function.h \ $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h varray.o : varray.c $(CONFIG_H) system.h varray.h $(RTL_H) $(TREE_H) bitmap.h - reload.o : reload.c $(CONFIG_H) system.h $(RTL_H) flags.h output.h $(EXPR_H) \ reload.h $(RECOG_H) hard-reg-set.h insn-config.h insn-codes.h $(REGS_H) \ function.h real.h toplev.h @@ -1757,11 +1764,11 @@ genrtl.c genrtl.h : s-genrtl @true # force gnu make to recheck modification times. s-genrtl: gengenrtl $(srcdir)/move-if-change $(RTL_BASE_H) - ./gengenrtl tmp-genrtl.h tmp-genrtl.c + ./gengenrtl -h >tmp-genrtl.h $(srcdir)/move-if-change tmp-genrtl.h genrtl.h + ./gengenrtl >tmp-genrtl.c $(srcdir)/move-if-change tmp-genrtl.c genrtl.c touch s-genrtl - # # Compile the programs that generate insn-* from the machine description. # They are compiled with $(HOST_CC), and associated libraries, @@ -1862,7 +1869,6 @@ gengenrtl : gengenrtl.o $(HOST_LIBDEPS) gengenrtl.o : gengenrtl.c $(RTL_BASE_H) system.h $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c - # # Compile the libraries to be used by gen*. # If we are not cross-building, gen* use the same .o's that cc1 will use, @@ -1970,7 +1976,7 @@ cpp$(exeext): $(CCCP)$(exeext) 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 +cexp.o: $(srcdir)/cexp.c $(CONFIG_H) system.h mbchar.h $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c $(srcdir)/cexp.c: $(srcdir)/cexp.y cd $(srcdir); $(BISON) -o cexp.c cexp.y @@ -2162,6 +2168,7 @@ fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \ # Build fixed copies of system files. stmp-fixinc: fixinc.sh gsyslimits.h rm -rf include; mkdir include + -chmod a+rx include TARGET_MACHINE=$(target); srcdir=`cd $(srcdir); pwd`; \ INSTALL_ASSERT_H=$(INSTALL_ASSERT_H); SHELL=$(SHELL) ;\ export TARGET_MACHINE srcdir INSTALL_ASSERT_H SHELL ; \ @@ -2251,7 +2258,7 @@ fixhdr.ready: fix-header # if it has already been run on the files in `include'. stmp-fixproto: fixhdr.ready fixproto stmp-headers @echo "Various warnings and error messages from fixproto are normal" - -if [ -d include ] ; then true; else mkdir include; fi + -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi -if [ -f include/fixed ] ; then true; \ else \ : This line works around a 'make' bug in BSDI 1.1.; \ @@ -2621,7 +2628,7 @@ install-libgcc: libgcc.a installdirs install-multilib: stmp-multilib installdirs for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \ dir=`echo $$i | sed -e 's/;.*$$//'`; \ - if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; fi; \ + if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; chmod a+rx $(libsubdir)/$${dir}; fi; \ for f in libgcc.a $(EXTRA_MULTILIB_PARTS); do \ rm -f $(libsubdir)/$${dir}/$${f}; \ $(INSTALL_DATA) $${dir}/$${f} $(libsubdir)/$${dir}/$${f}; \ diff --git a/gcc/bitmap.c b/gcc/bitmap.c index b4fc0971601..b6d1dbf2f67 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */ /* Obstack to allocate bitmap elements from. */ static struct obstack bitmap_obstack; static int bitmap_obstack_init = FALSE; - #ifndef INLINE #ifndef __GNUC__ diff --git a/gcc/c-convert.c b/gcc/c-convert.c index 9cb941662f2..7bde098e0e1 100644 --- a/gcc/c-convert.c +++ b/gcc/c-convert.c @@ -25,6 +25,7 @@ Boston, MA 02111-1307, USA. */ but what kind of conversions it does will depend on the language. */ #include "config.h" +#include "system.h" #include "tree.h" #include "flags.h" #include "convert.h" diff --git a/gcc/c-decl.c b/gcc/c-decl.c index d4c4fe1178f..c2d04c1a680 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1925,6 +1925,10 @@ duplicate_decls (newdecl, olddecl, different_binding_level) if (DECL_SECTION_NAME (newdecl) == NULL_TREE) DECL_SECTION_NAME (newdecl) = DECL_SECTION_NAME (olddecl); + /* Copy the assembler name. + Currently, it can only be defined in the prototype. */ + DECL_ASSEMBLER_NAME (newdecl) = DECL_ASSEMBLER_NAME (olddecl); + if (TREE_CODE (newdecl) == FUNCTION_DECL) { DECL_STATIC_CONSTRUCTOR(newdecl) |= DECL_STATIC_CONSTRUCTOR(olddecl); @@ -3740,6 +3744,7 @@ finish_decl (decl, init, asmspec_tree) { DECL_BUILT_IN (decl) = 0; DECL_RTL (decl) = 0; + DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec); } /* Output the assembler code and/or RTL code for variables and functions, @@ -7005,7 +7010,8 @@ finish_function (nested) static_ctors = perm_tree_cons (NULL_TREE, fndecl, static_ctors); else #endif - assemble_constructor (IDENTIFIER_POINTER (DECL_NAME (fndecl))); + assemble_constructor (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl))); + } if (DECL_STATIC_DESTRUCTOR (fndecl)) { @@ -7014,7 +7020,7 @@ finish_function (nested) static_dtors = perm_tree_cons (NULL_TREE, fndecl, static_dtors); else #endif - assemble_destructor (IDENTIFIER_POINTER (DECL_NAME (fndecl))); + assemble_destructor (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl))); } if (! nested) diff --git a/gcc/c-gperf.h b/gcc/c-gperf.h index 481d402bb5d..c554b759d23 100644 --- a/gcc/c-gperf.h +++ b/gcc/c-gperf.h @@ -1,5 +1,5 @@ -/* C code produced by gperf version 2.7 */ -/* Command-line: gperf -L C -F , 0, 0 -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ ../../../egcs/gcc/c-parse.gperf */ +/* C code produced by gperf version 2.7.1 (19981006 egcs) */ +/* Command-line: gperf -L C -F , 0, 0 -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ /home/law/egcs/egcs/gcc/c-parse.gperf */ /* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */ struct resword { const char *name; short token; enum rid rid; }; diff --git a/gcc/c-iterate.c b/gcc/c-iterate.c index dc0cc8a84af..c8acc4b81e3 100644 --- a/gcc/c-iterate.c +++ b/gcc/c-iterate.c @@ -1,5 +1,5 @@ /* Build expressions with type checking for C compiler. - Copyright (C) 1987, 88, 89, 92, 93, 96, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 89, 92-97, 1998 Free Software Foundation, Inc. This file is part of GNU CC. diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 79002f3e3fd..ccb113f1671 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -45,6 +45,9 @@ Boston, MA 02111-1307, USA. */ #include "mbchar.h" #include <locale.h> #endif /* MULTIBYTE_CHARS */ +#ifndef GET_ENVIRONMENT +#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ((ENV_VALUE) = getenv (ENV_NAME)) +#endif #if USE_CPPLIB #include "cpplib.h" @@ -279,7 +282,7 @@ init_lex () #ifdef MULTIBYTE_CHARS /* Change to the native locale for multibyte conversions. */ setlocale (LC_CTYPE, ""); - literal_codeset = getenv ("LANG"); + GET_ENVIRONMENT (literal_codeset, "LANG"); #endif maxtoken = 40; @@ -1529,7 +1532,7 @@ yylex () #define TOTAL_PARTS ((HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR) * 2) unsigned int parts[TOTAL_PARTS]; - enum anon1 { NOT_FLOAT, AFTER_POINT, TOO_MANY_POINTS, AFTER_EXPON } + enum anon1 { NOT_FLOAT, AFTER_POINT, TOO_MANY_POINTS, AFTER_EXPON} floatflag = NOT_FLOAT; for (count = 0; count < TOTAL_PARTS; count++) @@ -1970,7 +1973,7 @@ yylex () int max_chars; #ifdef MULTIBYTE_CHARS int longest_char = local_mb_cur_max (); - local_mbtowc (NULL_PTR, NULL_PTR, 0); + (void) local_mbtowc (NULL_PTR, NULL_PTR, 0); #endif max_chars = TYPE_PRECISION (integer_type_node) / width; @@ -2091,7 +2094,7 @@ yylex () } if (c != '\'') - error ("malformatted character constant"); + error ("malformed character constant"); else if (chars_seen == 0) error ("empty character constant"); else if (num_chars > max_chars) @@ -2139,9 +2142,8 @@ yylex () : TYPE_PRECISION (char_type_node); #ifdef MULTIBYTE_CHARS int longest_char = local_mb_cur_max (); - local_mbtowc (NULL_PTR, NULL_PTR, 0); + (void) local_mbtowc (NULL_PTR, NULL_PTR, 0); #endif - c = token_getch (); p = token_buffer + 1; diff --git a/gcc/c-parse.c b/gcc/c-parse.c index 919e0fc3dbd..9c98db28d83 100644 --- a/gcc/c-parse.c +++ b/gcc/c-parse.c @@ -1,71 +1,71 @@ /* A Bison parser, made from c-parse.y - by GNU Bison version 1.27 + by GNU Bison version 1.25 */ #define YYBISON 1 /* Identify Bison output. */ -#define IDENTIFIER 257 -#define TYPENAME 258 -#define SCSPEC 259 -#define TYPESPEC 260 -#define TYPE_QUAL 261 -#define CONSTANT 262 -#define STRING 263 -#define ELLIPSIS 264 -#define SIZEOF 265 -#define ENUM 266 -#define STRUCT 267 -#define UNION 268 -#define IF 269 -#define ELSE 270 -#define WHILE 271 -#define DO 272 -#define FOR 273 -#define SWITCH 274 -#define CASE 275 -#define DEFAULT 276 -#define BREAK 277 -#define CONTINUE 278 -#define RETURN 279 -#define GOTO 280 -#define ASM_KEYWORD 281 -#define TYPEOF 282 -#define ALIGNOF 283 -#define ATTRIBUTE 284 -#define EXTENSION 285 -#define LABEL 286 -#define REALPART 287 -#define IMAGPART 288 -#define VA_ARG 289 -#define END_OF_LINE 290 -#define ASSIGN 291 -#define OROR 292 -#define ANDAND 293 -#define EQCOMPARE 294 -#define ARITHCOMPARE 295 -#define LSHIFT 296 -#define RSHIFT 297 -#define UNARY 298 -#define PLUSPLUS 299 -#define MINUSMINUS 300 -#define HYPERUNARY 301 -#define POINTSAT 302 -#define INTERFACE 303 -#define IMPLEMENTATION 304 -#define END 305 -#define SELECTOR 306 -#define DEFS 307 -#define ENCODE 308 -#define CLASSNAME 309 -#define PUBLIC 310 -#define PRIVATE 311 -#define PROTECTED 312 -#define PROTOCOL 313 -#define OBJECTNAME 314 -#define CLASS 315 -#define ALIAS 316 -#define OBJC_STRING 317 +#define IDENTIFIER 258 +#define TYPENAME 259 +#define SCSPEC 260 +#define TYPESPEC 261 +#define TYPE_QUAL 262 +#define CONSTANT 263 +#define STRING 264 +#define ELLIPSIS 265 +#define SIZEOF 266 +#define ENUM 267 +#define STRUCT 268 +#define UNION 269 +#define IF 270 +#define ELSE 271 +#define WHILE 272 +#define DO 273 +#define FOR 274 +#define SWITCH 275 +#define CASE 276 +#define DEFAULT 277 +#define BREAK 278 +#define CONTINUE 279 +#define RETURN 280 +#define GOTO 281 +#define ASM_KEYWORD 282 +#define TYPEOF 283 +#define ALIGNOF 284 +#define ATTRIBUTE 285 +#define EXTENSION 286 +#define LABEL 287 +#define REALPART 288 +#define IMAGPART 289 +#define VA_ARG 290 +#define END_OF_LINE 291 +#define ASSIGN 292 +#define OROR 293 +#define ANDAND 294 +#define EQCOMPARE 295 +#define ARITHCOMPARE 296 +#define LSHIFT 297 +#define RSHIFT 298 +#define UNARY 299 +#define PLUSPLUS 300 +#define MINUSMINUS 301 +#define HYPERUNARY 302 +#define POINTSAT 303 +#define INTERFACE 304 +#define IMPLEMENTATION 305 +#define END 306 +#define SELECTOR 307 +#define DEFS 308 +#define ENCODE 309 +#define CLASSNAME 310 +#define PUBLIC 311 +#define PRIVATE 312 +#define PROTECTED 313 +#define PROTOCOL 314 +#define OBJECTNAME 315 +#define CLASS 316 +#define ALIAS 317 +#define OBJC_STRING 318 #line 33 "c-parse.y" @@ -151,7 +151,7 @@ c_parse_init () #define YYFLAG -32768 #define YYNTBASE 86 -#define YYTRANSLATE(x) ((unsigned)(x) <= 317 ? yytranslate[x] : 244) +#define YYTRANSLATE(x) ((unsigned)(x) <= 318 ? yytranslate[x] : 244) static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -179,13 +179,13 @@ static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 41, 42, 46, 47, 48, 49, 55, 56, 57, - 58, 59, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77 + 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 41, 42, 46, 47, 48, 49, 55, 56, + 57, 58, 59, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77 }; #if YYDEBUG != 0 @@ -1256,8 +1256,7 @@ static const short yycheck[] = { 38, 53, 54 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/lib/bison.simple" -/* This file comes from bison-1.27. */ +#line 3 "/usr/cygnus/TBD-TBD/share/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -1274,66 +1273,46 @@ static const short yycheck[] = { 38, You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + 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. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ +#ifndef alloca #ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) #include <alloca.h> #else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ +#if defined (MSDOS) && !defined (__TURBOC__) #include <malloc.h> -#endif #else /* not MSDOS, or __TURBOC__ */ #if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include <malloc.h> */ +#include <malloc.h> #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca +#else /* not MSDOS, __TURBOC__, or _AIX */ +#ifdef __hpux +#ifdef __cplusplus +extern "C" { +void *alloca (unsigned int); +}; +#else /* not __cplusplus */ +void *alloca (); +#endif /* not __cplusplus */ #endif /* __hpux */ -#endif #endif /* not _AIX */ #endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ +#endif /* not sparc. */ +#endif /* not GNU C. */ +#endif /* alloca not defined. */ -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action @@ -1343,8 +1322,8 @@ static const short yycheck[] = { 38, #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab +#define YYACCEPT return(0) +#define YYABORT return(1) #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the @@ -1425,12 +1404,12 @@ int yydebug; /* nonzero means print parse trace */ #ifndef YYMAXDEPTH #define YYMAXDEPTH 10000 #endif - -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +int yyparse (void); +#endif + #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ @@ -1442,7 +1421,7 @@ static void __yy_memcpy (to, from, count) char *to; char *from; - unsigned int count; + int count; { register char *f = from; register char *t = to; @@ -1457,10 +1436,10 @@ __yy_memcpy (to, from, count) /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void -__yy_memcpy (char *to, char *from, unsigned int count) +__yy_memcpy (char *to, char *from, int count) { - register char *t = to; register char *f = from; + register char *t = to; register int i = count; while (i-- > 0) @@ -1470,7 +1449,7 @@ __yy_memcpy (char *to, char *from, unsigned int count) #endif #endif -#line 216 "/usr/lib/bison.simple" +#line 196 "/usr/cygnus/TBD-TBD/share/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 *. @@ -1491,15 +1470,6 @@ __yy_memcpy (char *to, char *from, unsigned int count) #define YYPARSE_PARAM_DECL #endif /* not YYPARSE_PARAM */ -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -#ifdef YYPARSE_PARAM -int yyparse (void *); -#else -int yyparse (void); -#endif -#endif - int yyparse(YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL @@ -1528,7 +1498,6 @@ yyparse(YYPARSE_PARAM_ARG) #endif int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; #ifdef YYPURE int yychar; @@ -1613,32 +1582,18 @@ yynewstate: if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); + yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); + yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); #ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); + yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); #endif #endif /* no yyoverflow */ @@ -3868,7 +3823,7 @@ case 407: break;} } /* the action file gets copied in in place of this dollarsign */ -#line 542 "/usr/lib/bison.simple" +#line 498 "/usr/cygnus/TBD-TBD/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; @@ -4063,30 +4018,6 @@ yyerrhandle: yystate = yyn; goto yynewstate; - - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 0; - - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 1; } #line 2254 "c-parse.y" diff --git a/gcc/c-parse.h b/gcc/c-parse.h index cbffaaac88b..5c9abe09ac1 100644 --- a/gcc/c-parse.h +++ b/gcc/c-parse.h @@ -1,66 +1,66 @@ typedef union {long itype; tree ttype; enum tree_code code; char *filename; int lineno; int ends_in_label; } YYSTYPE; -#define IDENTIFIER 257 -#define TYPENAME 258 -#define SCSPEC 259 -#define TYPESPEC 260 -#define TYPE_QUAL 261 -#define CONSTANT 262 -#define STRING 263 -#define ELLIPSIS 264 -#define SIZEOF 265 -#define ENUM 266 -#define STRUCT 267 -#define UNION 268 -#define IF 269 -#define ELSE 270 -#define WHILE 271 -#define DO 272 -#define FOR 273 -#define SWITCH 274 -#define CASE 275 -#define DEFAULT 276 -#define BREAK 277 -#define CONTINUE 278 -#define RETURN 279 -#define GOTO 280 -#define ASM_KEYWORD 281 -#define TYPEOF 282 -#define ALIGNOF 283 -#define ATTRIBUTE 284 -#define EXTENSION 285 -#define LABEL 286 -#define REALPART 287 -#define IMAGPART 288 -#define VA_ARG 289 -#define END_OF_LINE 290 -#define ASSIGN 291 -#define OROR 292 -#define ANDAND 293 -#define EQCOMPARE 294 -#define ARITHCOMPARE 295 -#define LSHIFT 296 -#define RSHIFT 297 -#define UNARY 298 -#define PLUSPLUS 299 -#define MINUSMINUS 300 -#define HYPERUNARY 301 -#define POINTSAT 302 -#define INTERFACE 303 -#define IMPLEMENTATION 304 -#define END 305 -#define SELECTOR 306 -#define DEFS 307 -#define ENCODE 308 -#define CLASSNAME 309 -#define PUBLIC 310 -#define PRIVATE 311 -#define PROTECTED 312 -#define PROTOCOL 313 -#define OBJECTNAME 314 -#define CLASS 315 -#define ALIAS 316 -#define OBJC_STRING 317 +#define IDENTIFIER 258 +#define TYPENAME 259 +#define SCSPEC 260 +#define TYPESPEC 261 +#define TYPE_QUAL 262 +#define CONSTANT 263 +#define STRING 264 +#define ELLIPSIS 265 +#define SIZEOF 266 +#define ENUM 267 +#define STRUCT 268 +#define UNION 269 +#define IF 270 +#define ELSE 271 +#define WHILE 272 +#define DO 273 +#define FOR 274 +#define SWITCH 275 +#define CASE 276 +#define DEFAULT 277 +#define BREAK 278 +#define CONTINUE 279 +#define RETURN 280 +#define GOTO 281 +#define ASM_KEYWORD 282 +#define TYPEOF 283 +#define ALIGNOF 284 +#define ATTRIBUTE 285 +#define EXTENSION 286 +#define LABEL 287 +#define REALPART 288 +#define IMAGPART 289 +#define VA_ARG 290 +#define END_OF_LINE 291 +#define ASSIGN 292 +#define OROR 293 +#define ANDAND 294 +#define EQCOMPARE 295 +#define ARITHCOMPARE 296 +#define LSHIFT 297 +#define RSHIFT 298 +#define UNARY 299 +#define PLUSPLUS 300 +#define MINUSMINUS 301 +#define HYPERUNARY 302 +#define POINTSAT 303 +#define INTERFACE 304 +#define IMPLEMENTATION 305 +#define END 306 +#define SELECTOR 307 +#define DEFS 308 +#define ENCODE 309 +#define CLASSNAME 310 +#define PUBLIC 311 +#define PRIVATE 312 +#define PROTECTED 313 +#define PROTOCOL 314 +#define OBJECTNAME 315 +#define CLASS 316 +#define ALIAS 317 +#define OBJC_STRING 318 extern YYSTYPE yylval; diff --git a/gcc/c-parse.in b/gcc/c-parse.in index a0c7f94712c..d9bfcf26ac5 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -38,7 +38,6 @@ end ifc #include "config.h" #include "system.h" #include <setjmp.h> - #include "tree.h" #include "input.h" #include "c-lex.h" diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 3bab9ff16b8..72885ebdeb4 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3155,8 +3155,10 @@ lvalue_or_else (ref, msgid) const char *msgid; { int win = lvalue_p (ref); + if (! win) error (msgid); + return win; } @@ -3802,8 +3804,7 @@ build_modify_expr (lhs, modifycode, rhs) /* Handle (a, b) used as an "lvalue". */ case COMPOUND_EXPR: pedantic_lvalue_warning (COMPOUND_EXPR); - newrhs = build_modify_expr (TREE_OPERAND (lhs, 1), - modifycode, rhs); + newrhs = build_modify_expr (TREE_OPERAND (lhs, 1), modifycode, rhs); if (TREE_CODE (newrhs) == ERROR_MARK) return error_mark_node; return build (COMPOUND_EXPR, lhstype, @@ -6560,7 +6561,26 @@ c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) /* Record the contents of OUTPUTS before it is modified. */ for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++) - o[i] = TREE_VALUE (tail); + { + tree output = TREE_VALUE (tail); + + /* We can remove conversions that just change the type, not the mode. */ + STRIP_NOPS (output); + o[i] = output; + + /* Allow conversions as LHS here. build_modify_expr as called below + will do the right thing with them. */ + while (TREE_CODE (output) == NOP_EXPR + || TREE_CODE (output) == CONVERT_EXPR + || TREE_CODE (output) == FLOAT_EXPR + || TREE_CODE (output) == FIX_TRUNC_EXPR + || TREE_CODE (output) == FIX_FLOOR_EXPR + || TREE_CODE (output) == FIX_ROUND_EXPR + || TREE_CODE (output) == FIX_CEIL_EXPR) + output = TREE_OPERAND (output, 1); + + lvalue_or_else (o[i], "invalid lvalue in asm statement"); + } /* Perform default conversions on array and function inputs. */ /* Don't do this for other types-- diff --git a/gcc/caller-save.c b/gcc/caller-save.c index 761dd924b15..c322f6017da 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -1,5 +1,5 @@ /* Save and restore call-clobbered registers which are live across a call. - Copyright (C) 1989, 1992, 94-95, 97, 98, 1999 Free Software Foundation, Inc. + Copyright (C) 1989, 92, 94, 95, 97, 1998 Free Software Foundation, Inc. This file is part of GNU CC. diff --git a/gcc/calls.c b/gcc/calls.c index c070472e3f3..bc1e2a7b895 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2433,8 +2433,9 @@ expand_call (exp, target, ignore) preserve_temp_slots (target); } - emit_group_store (target, valreg, bytes, - TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT); + if (! rtx_equal_p (target, valreg)) + emit_group_store (target, valreg, bytes, + TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT); } else if (target && GET_MODE (target) == TYPE_MODE (TREE_TYPE (exp)) && GET_MODE (target) == GET_MODE (valreg)) @@ -2901,9 +2902,13 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode, = mode_for_size (argvec[argnum].size.constant * BITS_PER_UNIT, MODE_INT, 1); rtx stack_area - = gen_rtx_MEM (save_mode, - memory_address (save_mode, - plus_constant (argblock, argvec[argnum].offset.constant))); + = gen_rtx_MEM + (save_mode, + memory_address + (save_mode, + plus_constant (argblock, + argvec[argnum].offset.constant))); + argvec[argnum].save_area = gen_reg_rtx (save_mode); emit_move_insn (argvec[argnum].save_area, stack_area); } @@ -3024,8 +3029,10 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode, enum machine_mode save_mode = GET_MODE (argvec[count].save_area); rtx stack_area = gen_rtx_MEM (save_mode, - memory_address (save_mode, - plus_constant (argblock, argvec[count].offset.constant))); + memory_address + (save_mode, + plus_constant (argblock, + argvec[count].offset.constant))); emit_move_insn (stack_area, argvec[count].save_area); } @@ -3464,11 +3471,14 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue, = mode_for_size (argvec[argnum].size.constant * BITS_PER_UNIT, MODE_INT, 1); rtx stack_area - = gen_rtx_MEM (save_mode, - memory_address (save_mode, - plus_constant (argblock, - argvec[argnum].offset.constant))); + = gen_rtx_MEM + (save_mode, + memory_address + (save_mode, + plus_constant (argblock, + argvec[argnum].offset.constant))); argvec[argnum].save_area = gen_reg_rtx (save_mode); + emit_move_insn (argvec[argnum].save_area, stack_area); } #endif @@ -3613,8 +3623,10 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue, enum machine_mode save_mode = GET_MODE (argvec[count].save_area); rtx stack_area = gen_rtx_MEM (save_mode, - memory_address (save_mode, plus_constant (argblock, - argvec[count].offset.constant))); + memory_address + (save_mode, + plus_constant (argblock, + argvec[count].offset.constant))); emit_move_insn (stack_area, argvec[count].save_area); } @@ -3840,8 +3852,7 @@ store_one_arg (arg, argblock, may_be_alloca, variable_size, if (arg->value == arg->stack) { - /* If the value is already in the stack slot, we are done moving - data. */ + /* If the value is already in the stack slot, we are done. */ if (current_function_check_memory_usage && GET_CODE (arg->stack) == MEM) { emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, diff --git a/gcc/cccp.c b/gcc/cccp.c index d4d2a39fcf5..23a5077d628 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -72,11 +72,13 @@ typedef unsigned char U_CHAR; #define fopen(fname,mode) VMS_fopen (fname,mode) #define freopen(fname,mode,ofile) VMS_freopen (fname,mode,ofile) #define fstat(fd,stbuf) VMS_fstat (fd,stbuf) +#define fwrite(ptr,size,nitems,stream) VMS_fwrite (ptr,size,nitems,stream) static int VMS_fstat (), VMS_stat (); static int VMS_open (); static FILE *VMS_fopen (); static FILE *VMS_freopen (); -static int hack_vms_include_specification (); +static size_t VMS_fwrite (); +static void hack_vms_include_specification (); #define INO_T_EQ(a, b) (!bcmp((char *) &(a), (char *) &(b), sizeof (a))) #define INO_T_HASH(a) 0 #define INCLUDE_LEN_FUDGE 12 /* leave room for VMS syntax conversion */ @@ -243,6 +245,10 @@ static int warn_trigraphs; static int warn_undef; +/* Nonzero means warn if we find white space where it doesn't belong. */ + +static int warn_white_space; + /* Nonzero means warn if #import is used. */ static int warn_import = 1; @@ -783,7 +789,6 @@ static int do_sccs DO_PROTO; #endif static int do_unassert DO_PROTO; static int do_undef DO_PROTO; -static int do_warning DO_PROTO; static int do_xifdef DO_PROTO; /* Here is the actual list of #-directives, most-often-used first. */ @@ -802,7 +807,7 @@ static struct directive directive_table[] = { { 6, do_include, "import", T_IMPORT}, { 5, do_undef, "undef", T_UNDEF}, { 5, do_error, "error", T_ERROR}, - { 7, do_warning, "warning", T_WARNING}, + { 7, do_error, "warning", T_WARNING}, #ifdef SCCS_DIRECTIVE { 4, do_sccs, "sccs", T_SCCS}, #endif @@ -874,7 +879,6 @@ static int ignore_srcdir; static int safe_read PROTO((int, char *, int)); static void safe_write PROTO((int, char *, int)); -static void eprint_string PROTO((const char *, size_t)); int main PROTO((int, char **)); @@ -883,6 +887,7 @@ static void path_include PROTO((char *)); static U_CHAR *index0 PROTO((U_CHAR *, int, size_t)); static void trigraph_pcp PROTO((FILE_BUF *)); +static void check_white_space PROTO((FILE_BUF *)); static void newline_fix PROTO((U_CHAR *)); static void name_newline_fix PROTO((U_CHAR *)); @@ -962,7 +967,7 @@ static U_CHAR *macarg1 PROTO((U_CHAR *, U_CHAR *, struct hashnode *, int *, int static int discard_comments PROTO((U_CHAR *, int, int)); -static int change_newlines PROTO((U_CHAR *, int)); +static void change_newlines PROTO((struct argdata *)); static void notice PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1; static void vnotice PROTO((const char *, va_list)); @@ -1088,33 +1093,6 @@ safe_write (desc, ptr, len) } } -/* Print a string to stderr, with extra handling in case it contains - embedded NUL characters. Any present are written as is. - - Using fwrite for this purpose produces undesireable results on VMS - when stderr happens to be a record oriented file, such as a batch log - file, rather than a stream oriented one. */ - -static void -eprint_string (string, length) - const char *string; - size_t length; -{ - size_t segment_length; - - do { - fprintf(stderr, "%s", string); - length -= (segment_length = strlen(string)); - if (length > 0) - { - fputc('\0', stderr); - length -= 1; - /* Advance past the portion which has already been printed. */ - string += segment_length + 1; - } - } while (length > 0); -} - static void print_help () @@ -1320,20 +1298,20 @@ main (argc, argv) case 'i': if (!strcmp (argv[i], "-include")) { - int temp = i; - if (i + 1 == argc) fatal ("Filename missing after `-include' option"); - else - simplify_filename (pend_includes[temp] = argv[++i]); + else { + simplify_filename (pend_includes[i] = argv[i]); + i++; + } } if (!strcmp (argv[i], "-imacros")) { - int temp = i; - if (i + 1 == argc) fatal ("Filename missing after `-imacros' option"); - else - simplify_filename (pend_files[temp] = argv[++i]); + else { + simplify_filename (pend_files[i] = argv[i]); + i++; + } } if (!strcmp (argv[i], "-iprefix")) { if (i + 1 == argc) @@ -1511,6 +1489,10 @@ main (argc, argv) warn_stringify = 1; else if (!strcmp (argv[i], "-Wno-traditional")) warn_stringify = 0; + else if (!strcmp (argv[i], "-Wwhite-space")) + warn_white_space = 1; + else if (!strcmp (argv[i], "-Wno-white-space")) + warn_white_space = 0; else if (!strcmp (argv[i], "-Wundef")) warn_undef = 1; else if (!strcmp (argv[i], "-Wno-undef")) @@ -1527,6 +1509,7 @@ main (argc, argv) { warn_trigraphs = 1; warn_comments = 1; + warn_white_space = 1; } break; @@ -1691,15 +1674,15 @@ main (argc, argv) case 'I': /* Add directory to path for includes. */ { struct file_name_list *dirtmp; + char *dir = argv[i][2] ? argv[i] + 2 : argv[++i]; - if (! ignore_srcdir && !strcmp (argv[i] + 2, "-")) { + if (! ignore_srcdir && !strcmp (dir, "-")) { ignore_srcdir = 1; /* Don't use any preceding -I directories for #include <...>. */ first_bracket_include = 0; } else { - dirtmp = new_include_prefix (last_include, NULL_PTR, "", - argv[i][2] ? argv[i] + 2 : argv[++i]); + dirtmp = new_include_prefix (last_include, NULL_PTR, "", dir); append_include_chain (dirtmp, dirtmp); } } @@ -1958,17 +1941,14 @@ main (argc, argv) else print_deps = 1; - s = spec; /* Find the space before the DEPS_TARGET, if there is one. */ - /* This should use index. (mrs) */ - while (*s != 0 && *s != ' ') s++; - if (*s != 0) { + s = index (spec, ' '); + if (s) { deps_target = s + 1; output_file = xmalloc (s - spec + 1); bcopy (spec, output_file, s - spec); output_file[s - spec] = 0; - } - else { + } else { deps_target = 0; output_file = spec; } @@ -2029,8 +2009,9 @@ main (argc, argv) strcpy (q, OBJECT_SUFFIX); deps_output (p, ':'); - deps_output (in_fname, ' '); } + + deps_output (in_fname, ' '); } /* Scan the -imacros files before the main input. @@ -2118,6 +2099,9 @@ main (argc, argv) if (!no_trigraphs) trigraph_pcp (fp); + if (warn_white_space) + check_white_space (fp); + /* Now that we know the input file is valid, open the output. */ if (!out_fname || !strcmp (out_fname, "")) @@ -2328,13 +2312,43 @@ trigraph_pcp (buf) warning_with_line (0, "%lu trigraph(s) encountered", (unsigned long) (fptr - bptr) / 2); } + +/* Warn about white space between backslash and end of line. */ + +static void +check_white_space (buf) + FILE_BUF *buf; +{ + register U_CHAR *sptr = buf->buf; + register U_CHAR *lptr = sptr + buf->length; + register U_CHAR *nptr; + int line = 0; + + nptr = sptr = buf->buf; + lptr = sptr + buf->length; + for (nptr = sptr; + (nptr = index0 (nptr, '\n', (size_t) (lptr - nptr))) != NULL; + nptr ++) { + register U_CHAR *p = nptr; + line++; + for (p = nptr; sptr < p; p--) { + if (! is_hor_space[p[-1]]) { + if (p[-1] == '\\' && p != nptr) + warning_with_line (line, + "`\\' followed by white space at end of line"); + break; + } + } + } +} /* Move all backslash-newline pairs out of embarrassing places. Exchange all such pairs following BP with any potentially-embarrassing characters that follow them. Potentially-embarrassing characters are / and * (because a backslash-newline inside a comment delimiter - would cause it not to be recognized). */ + would cause it not to be recognized). + We assume that *BP == '\\'. */ static void newline_fix (bp) @@ -2343,21 +2357,24 @@ newline_fix (bp) register U_CHAR *p = bp; /* First count the backslash-newline pairs here. */ - - while (p[0] == '\\' && p[1] == '\n') + do { + if (p[1] != '\n') + break; p += 2; + } while (*p == '\\'); /* What follows the backslash-newlines is not embarrassing. */ if (*p != '/' && *p != '*') + /* What follows the backslash-newlines is not embarrassing. */ return; /* Copy all potentially embarrassing characters that follow the backslash-newline pairs down to where the pairs originally started. */ - - while (*p == '*' || *p == '/') + do *bp++ = *p++; + while (*p == '*' || *p == '/'); /* Now write the same number of pairs after the embarrassing chars. */ while (bp < p) { @@ -2376,20 +2393,24 @@ name_newline_fix (bp) register U_CHAR *p = bp; /* First count the backslash-newline pairs here. */ - while (p[0] == '\\' && p[1] == '\n') + do { + if (p[1] != '\n') + break; p += 2; + } while (*p == '\\'); /* What follows the backslash-newlines is not embarrassing. */ if (!is_idchar[*p]) + /* What follows the backslash-newlines is not embarrassing. */ return; /* Copy all potentially embarrassing characters that follow the backslash-newline pairs down to where the pairs originally started. */ - - while (is_idchar[*p]) + do *bp++ = *p++; + while (is_idchar[*p]); /* Now write the same number of pairs after the embarrassing chars. */ while (bp < p) { @@ -2467,7 +2488,7 @@ get_lintcmd (ibp, limit, argstart, arglen, cmdlen) * If OUTPUT_MARKS is nonzero, keep Newline markers found in the input * and insert them when appropriate. This is set while scanning macro * arguments before substitution. It is zero when scanning for final output. - * There are three types of Newline markers: + * There are two types of Newline markers: * * Newline - follows a macro name that was not expanded * because it appeared inside an expansion of the same macro. * This marker prevents future expansion of that identifier. @@ -2791,6 +2812,8 @@ do { ip = &instack[indepth]; \ *obp++ = *ibp; switch (*ibp++) { case '\n': + if (warn_white_space && ip->fname && is_hor_space[ibp[-2]]) + warning ("white space at end of line in string"); ++ip->lineno; ++op->lineno; /* Traditionally, end of line ends a string constant with no error. @@ -2818,9 +2841,10 @@ do { ip = &instack[indepth]; \ keep the line counts correct. But if we are reading from a macro, keep the backslash newline, since backslash newlines have already been processed. */ - if (ip->macro) + if (ip->macro) { *obp++ = '\n'; - else + ++op->lineno; + } else --obp; ++ibp; ++ip->lineno; @@ -2829,8 +2853,10 @@ do { ip = &instack[indepth]; \ is *not* prevented from combining with a newline. */ if (!ip->macro) { while (*ibp == '\\' && ibp[1] == '\n') { - ibp += 2; + *obp++ = *ibp++; + *obp++ = *ibp++; ++ip->lineno; + ++op->lineno; } } *obp++ = *ibp++; @@ -2868,7 +2894,7 @@ do { ip = &instack[indepth]; \ case '/': if (ip->macro != 0) goto randomchar; - if (*ibp == '\\' && ibp[1] == '\n') + if (*ibp == '\\') newline_fix (ibp); if (*ibp != '*' && !(cplusplus_comments && *ibp == '/')) @@ -2986,7 +3012,7 @@ do { ip = &instack[indepth]; \ case '*': if (ibp[-2] == '/' && warn_comments) warning ("`/*' within comment"); - if (*ibp == '\\' && ibp[1] == '\n') + if (*ibp == '\\') newline_fix (ibp); if (*ibp == '/') goto comment_end; @@ -3357,7 +3383,7 @@ randomchar: break; else if (*ibp == '/') { /* If a comment, copy it unchanged or discard it. */ - if (ibp[1] == '\\' && ibp[2] == '\n') + if (ibp[1] == '\\') newline_fix (ibp + 1); if (ibp[1] == '*') { if (put_out_comments) { @@ -3370,7 +3396,7 @@ randomchar: /* We need not worry about newline-marks, since they are never found in comments. */ if (ibp[0] == '*') { - if (ibp[1] == '\\' && ibp[2] == '\n') + if (ibp[1] == '\\') newline_fix (ibp + 1); if (ibp[1] == '/') { ibp += 2; @@ -3627,9 +3653,6 @@ expand_to_temp_buffer (buf, limit, output_marks, assertions) if (indepth != odepth) abort (); - /* Record the output. */ - obuf.length = obuf.bufp - obuf.buf; - assertions_flag = save_assertions_flag; return obuf; } @@ -3677,7 +3700,7 @@ handle_directive (ip, op) pedwarn_strange_white_space (*bp); bp++; } else if (*bp == '/') { - if (bp[1] == '\\' && bp[2] == '\n') + if (bp[1] == '\\') newline_fix (bp + 1); if (! (bp[1] == '*' || (cplusplus_comments && bp[1] == '/'))) break; @@ -3698,7 +3721,7 @@ handle_directive (ip, op) if (is_idchar[*cp]) cp++; else { - if (*cp == '\\' && cp[1] == '\n') + if (*cp == '\\') name_newline_fix (cp); if (is_idchar[*cp]) cp++; @@ -3789,14 +3812,12 @@ handle_directive (ip, op) register U_CHAR c = *bp++; switch (c) { case '\\': - if (bp < limit) { - if (*bp == '\n') { - ip->lineno++; - copy_directive = 1; - bp++; - } else if (traditional) - bp++; - } + if (*bp == '\n') { + ip->lineno++; + copy_directive = 1; + bp++; + } else if (traditional && bp < limit) + bp++; break; case '"': @@ -3848,7 +3869,7 @@ handle_directive (ip, op) break; case '/': - if (*bp == '\\' && bp[1] == '\n') + if (*bp == '\\') newline_fix (bp); if (*bp == '*' || (cplusplus_comments && *bp == '/')) { @@ -3931,12 +3952,13 @@ handle_directive (ip, op) register U_CHAR *xp = buf; /* Need to copy entire directive into temp buffer before dispatching */ - cp = (U_CHAR *) alloca (bp - buf + 5); /* room for directive plus - some slop */ + /* room for directive plus some slop */ + cp = (U_CHAR *) alloca (2 * (bp - buf) + 5); buf = cp; /* Copy to the new buffer, deleting comments - and backslash-newlines (and whitespace surrounding the latter). */ + and backslash-newlines (and whitespace surrounding the latter + if outside of char and string constants). */ while (xp < bp) { register U_CHAR c = *xp++; @@ -4043,7 +4065,8 @@ handle_directive (ip, op) directives through. */ if (!no_output && already_output == 0 - && (kt->type == T_DEFINE ? (int) dump_names <= (int) dump_macros + && ((kt->type == T_DEFINE || kt->type == T_UNDEF) + ? (int) dump_names <= (int) dump_macros : IS_INCLUDE_DIRECTIVE_TYPE (kt->type) ? dump_includes : kt->type == T_PRAGMA)) { int len; @@ -4072,7 +4095,7 @@ handle_directive (ip, op) bcopy (buf, (char *) op->bufp, len); } op->bufp += len; - } /* Don't we need a newline or #line? */ + } /* Call the appropriate directive handler. buf now points to either the appropriate place in the input buffer, or to @@ -4094,12 +4117,19 @@ handle_directive (ip, op) static struct tm * timestamp () { - static struct tm *timebuf; - if (!timebuf) { + static struct tm tmbuf; + if (! tmbuf.tm_mday) { time_t t = time ((time_t *) 0); - timebuf = localtime (&t); + struct tm *tm = localtime (&t); + if (tm) + tmbuf = *tm; + else { + /* Use 0000-01-01 00:00:00 if local time is not available. */ + tmbuf.tm_year = -1900; + tmbuf.tm_mday = 1; + } } - return timebuf; + return &tmbuf; } static char *monthnames[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", @@ -5284,6 +5314,9 @@ finclude (f, inc, op, system_header_p, dirptr) if (!no_trigraphs) trigraph_pcp (fp); + if (warn_white_space) + check_white_space (fp); + output_line_directive (fp, op, 0, enter_file); rescan (op, 0); @@ -5497,7 +5530,7 @@ pcfinclude (buf, name, op) tmpbuf = expand_to_temp_buffer (string_start, cp++, 0, 0); /* Lineno is already set in the precompiled file */ str->contents = tmpbuf.buf; - str->len = tmpbuf.length; + str->len = tmpbuf.bufp - tmpbuf.buf; str->writeflag = 0; str->filename = name; str->output_mark = outbuf.bufp - outbuf.buf; @@ -5521,6 +5554,7 @@ pcfinclude (buf, name, op) for (; nkeys--; free (tmpbuf.buf), cp = endofthiskey + 1) { KEYDEF *kp = (KEYDEF *) (GENERIC_PTR) cp; HASHNODE *hp; + U_CHAR *bp; /* It starts with a KEYDEF structure */ cp += sizeof (KEYDEF); @@ -5532,20 +5566,19 @@ pcfinclude (buf, name, op) /* Expand the key, and enter it into the hash table. */ tmpbuf = expand_to_temp_buffer (cp, endofthiskey, 0, 0); - tmpbuf.bufp = tmpbuf.buf; + bp = tmpbuf.buf; - while (is_hor_space[*tmpbuf.bufp]) - tmpbuf.bufp++; - if (!is_idstart[*tmpbuf.bufp] - || tmpbuf.bufp == tmpbuf.buf + tmpbuf.length) { + while (is_hor_space[*bp]) + bp++; + if (!is_idstart[*bp] || bp == tmpbuf.bufp) { str->writeflag = 1; continue; } - hp = lookup (tmpbuf.bufp, -1, -1); + hp = lookup (bp, -1, -1); if (hp == NULL) { kp->chain = 0; - install (tmpbuf.bufp, -1, T_PCSTRING, (char *) kp, -1); + install (bp, -1, T_PCSTRING, (char *) kp, -1); } else if (hp->type == T_PCSTRING) { kp->chain = hp->value.keydef; @@ -6136,7 +6169,7 @@ collect_expansion (buf, end, nargs, arglist) break; case '\\': - if (p < limit && expected_delimiter) { + if (expected_delimiter) { /* In a string, backslash goes through and makes next char ordinary. */ *exp_p++ = *p++; @@ -6804,6 +6837,7 @@ do_line (buf, limit, op, keyword) /* Point to macroexpanded line, which is null-terminated now. */ bp = tem.buf; + limit = tem.bufp; SKIP_WHITE_SPACE (bp); if (!ISDIGIT (*bp)) { @@ -6846,10 +6880,6 @@ do_line (buf, limit, op, keyword) p = bp; for (;;) switch ((*p++ = *bp++)) { - case '\0': - error ("invalid format `#line' directive"); - return 0; - case '\\': if (! ignore_escape_flag) { @@ -6974,50 +7004,39 @@ do_undef (buf, limit, op, keyword) return 0; } + /* Report an error detected by the program we are processing. - Use the text of the line in the error message. - (We use error because it prints the filename & line#.) */ + Use the text of the line in the error message. */ static int do_error (buf, limit, op, keyword) U_CHAR *buf, *limit; FILE_BUF *op ATTRIBUTE_UNUSED; - struct directive *keyword ATTRIBUTE_UNUSED; + struct directive *keyword; { int length = limit - buf; U_CHAR *copy = (U_CHAR *) alloca (length + 1); bcopy ((char *) buf, (char *) copy, length); copy[length] = 0; SKIP_WHITE_SPACE (copy); - error ("#error %s", copy); - return 0; -} -/* Report a warning detected by the program we are processing. - Use the text of the line in the warning message, then continue. - (We use error because it prints the filename & line#.) */ + switch (keyword->type) { + case T_ERROR: + error ("#error %s", copy); + break; -static int -do_warning (buf, limit, op, keyword) - U_CHAR *buf, *limit; - FILE_BUF *op ATTRIBUTE_UNUSED; - struct directive *keyword ATTRIBUTE_UNUSED; -{ - int length = limit - buf; - U_CHAR *copy = (U_CHAR *) alloca (length + 1); - bcopy ((char *) buf, (char *) copy, length); - copy[length] = 0; - SKIP_WHITE_SPACE (copy); + case T_WARNING: + if (pedantic && !instack[indepth].system_header_p) + pedwarn ("ANSI C does not allow `#warning'"); + warning ("#warning %s", copy); + break; - if (pedantic && !instack[indepth].system_header_p) - pedwarn ("ANSI C does not allow `#warning'"); + default: + abort (); + } - /* Use `pedwarn' not `warning', because #warning isn't in the C Standard; - if -pedantic-errors is given, #warning should cause an error. */ - pedwarn ("#warning %s", copy); return 0; } - /* Remember the name of the current file being read from so that we can avoid ever including it again. */ @@ -7092,8 +7111,9 @@ do_pragma (buf, limit, op, keyword) return 0; fname = p + 1; - if ((p = (U_CHAR *) index ((char *) fname, '\"'))) - *p = '\0'; + p = skip_quoted_string (p, limit, 0, NULL_PTR, NULL_PTR, NULL_PTR); + if (p[-1] == '"') + *--p = '\0'; for (h = 0; h < INCLUDE_HASHSIZE; h++) { struct include_file *inc; @@ -7198,7 +7218,8 @@ do_elif (buf, limit, op, keyword) && !bcmp (if_stack->fname, ip->nominal_fname, if_stack->fname_len))) { fprintf (stderr, ", file "); - eprint_string (if_stack->fname, if_stack->fname_len); + fwrite (if_stack->fname, sizeof if_stack->fname[0], + if_stack->fname_len, stderr); } fprintf (stderr, ")\n"); } @@ -7238,7 +7259,7 @@ eval_if_expression (buf, length) pcp_inside_if = 0; delete_macro (save_defined); /* clean up special symbol */ - temp_obuf.buf[temp_obuf.length] = '\n'; + *temp_obuf.bufp = '\n'; value = parse_c_expression ((char *) temp_obuf.buf, warn_undef && !instack[indepth].system_header_p); @@ -7417,7 +7438,7 @@ skip_if_group (ip, any, op) while (bp < endb) { switch (*bp++) { case '/': /* possible comment */ - if (*bp == '\\' && bp[1] == '\n') + if (*bp == '\\') newline_fix (bp); if (*bp == '*' || (cplusplus_comments && *bp == '/')) { @@ -7547,7 +7568,7 @@ skip_if_group (ip, any, op) else if (*bp == '\\' && bp[1] == '\n') bp += 2; else if (*bp == '/') { - if (bp[1] == '\\' && bp[2] == '\n') + if (bp[1] == '\\') newline_fix (bp + 1); if (bp[1] == '*') { for (bp += 2; ; bp++) { @@ -7556,7 +7577,7 @@ skip_if_group (ip, any, op) else if (*bp == '*') { if (bp[-1] == '/' && warn_comments) warning ("`/*' within comment"); - if (bp[1] == '\\' && bp[2] == '\n') + if (bp[1] == '\\') newline_fix (bp + 1); if (bp[1] == '/') break; @@ -7609,7 +7630,7 @@ skip_if_group (ip, any, op) if (is_idchar[*bp]) bp++; else { - if (*bp == '\\' && bp[1] == '\n') + if (*bp == '\\') name_newline_fix (bp); if (is_idchar[*bp]) bp++; @@ -7778,7 +7799,8 @@ do_else (buf, limit, op, keyword) && !bcmp (if_stack->fname, ip->nominal_fname, if_stack->fname_len))) { fprintf (stderr, ", file "); - eprint_string (if_stack->fname, if_stack->fname_len); + fwrite (if_stack->fname, sizeof if_stack->fname[0], + if_stack->fname_len, stderr); } fprintf (stderr, ")\n"); } @@ -7998,7 +8020,7 @@ skip_to_end_of_comment (ip, line_counter, nowarn) case '*': if (bp[-2] == '/' && !nowarn && warn_comments) warning ("`/*' within comment"); - if (*bp == '\\' && bp[1] == '\n') + if (*bp == '\\') newline_fix (bp); if (*bp == '/') { if (op) @@ -8041,7 +8063,8 @@ skip_to_end_of_comment (ip, line_counter, nowarn) The input stack state is not changed. If COUNT_NEWLINES is nonzero, it points to an int to increment - for each newline passed. + for each newline passed; also, warn about any white space + just before line end. If BACKSLASH_NEWLINES_P is nonzero, store 1 thru it if we pass a backslash-newline. @@ -8097,15 +8120,18 @@ skip_quoted_string (bp, limit, start_line, count_newlines, backslash_newlines_p, } if (match == '\'') { error_with_line (line_for_error (start_line), - "unterminated string or character constant"); + "unterminated character constant"); bp--; if (eofp) *eofp = 1; break; } /* If not traditional, then allow newlines inside strings. */ - if (count_newlines) + if (count_newlines) { + if (warn_white_space && is_hor_space[bp[-2]]) + warning ("white space at end of line in string"); ++*count_newlines; + } if (multiline_string_line == 0) { if (pedantic) pedwarn_with_line (line_for_error (start_line), @@ -8295,9 +8321,9 @@ output_line_directive (ip, op, conditional, file_change) /* This structure represents one parsed argument in a macro call. `raw' points to the argument text as written (`raw_length' is its length). `expanded' points to the argument's macro-expansion - (its length is `expand_length'). - `stringified_length' is the length the argument would have - if stringified. + (its length is `expand_length', and its allocated size is `expand_size'). + `stringified_length_bound' is an upper bound on the length + the argument would have if stringified. `use_count' is the number of times this macro arg is substituted into the macro. If the actual use count exceeds 10, the value stored is 10. @@ -8306,8 +8332,8 @@ output_line_directive (ip, op, conditional, file_change) struct argdata { U_CHAR *raw, *expanded; - int raw_length, expand_length; - int stringified_length; + int raw_length, expand_length, expand_size; + int stringified_length_bound; U_CHAR *free1, *free2; char newlines; char use_count; @@ -8358,8 +8384,8 @@ macroexpand (hp, op) for (i = 0; i < nargs; i++) { args[i].raw = (U_CHAR *) ""; args[i].expanded = 0; - args[i].raw_length = args[i].expand_length - = args[i].stringified_length = 0; + args[i].raw_length = args[i].expand_length = args[i].expand_size + = args[i].stringified_length_bound = 0; args[i].free1 = args[i].free2 = 0; args[i].use_count = 0; } @@ -8453,7 +8479,7 @@ macroexpand (hp, op) xbuf_len = defn->length; for (ap = defn->pattern; ap != NULL; ap = ap->next) { if (ap->stringify) - xbuf_len += args[ap->argno].stringified_length; + xbuf_len += args[ap->argno].stringified_length_bound; else if (ap->raw_before != 0 || ap->raw_after != 0 || traditional) /* Add 4 for two newline-space markers to prevent token concatenation. */ @@ -8468,13 +8494,20 @@ macroexpand (hp, op) 1, 0); args[ap->argno].expanded = obuf.buf; - args[ap->argno].expand_length = obuf.length; + args[ap->argno].expand_length = obuf.bufp - obuf.buf; + args[ap->argno].expand_size = obuf.length; args[ap->argno].free2 = obuf.buf; - } + xbuf_len += args[ap->argno].expand_length; + } else { + /* If the arg appears more than once, its later occurrences + may have newline turned into backslash-'n', which is a + factor of 2 expansion. */ + xbuf_len += 2 * args[ap->argno].expand_length; + } /* Add 4 for two newline-space markers to prevent token concatenation. */ - xbuf_len += args[ap->argno].expand_length + 4; + xbuf_len += 4; } if (args[ap->argno].use_count < 10) args[ap->argno].use_count++; @@ -8531,27 +8564,28 @@ macroexpand (hp, op) for (; i < arglen; i++) { c = arg->raw[i]; - if (! in_string) { - /* Special markers Newline Space + if (in_string) { + /* Generate nothing for backslash-newline in a string. */ + if (c == '\\' && arg->raw[i + 1] == '\n') { + i++; + continue; + } + } else { + /* Special markers generate nothing for a stringified argument. */ - if (c == '\n' && arg->raw[i+1] != '\n') { + if (c == '\n') { i++; continue; } /* Internal sequences of whitespace are replaced by one space - except within an string or char token. */ - if (c == '\n' ? arg->raw[i+1] == '\n' : is_space[c]) { - while (1) { - /* Note that Newline Space does occur within whitespace - sequences; consider it part of the sequence. */ - if (c == '\n' && is_space[arg->raw[i+1]]) - i += 2; - else if (c != '\n' && is_space[c]) - i++; - else break; - c = arg->raw[i]; - } + except within a string or char token. */ + if (is_space[c]) { + i++; + while (is_space[(c = arg->raw[i])]) + /* Newline markers can occur within a whitespace sequence; + consider them part of the sequence. */ + i += (c == '\n') + 1; i--; c = ' '; } @@ -8583,8 +8617,15 @@ macroexpand (hp, op) in_string = c; } - /* Escape these chars */ - if (c == '\"' || (in_string && c == '\\')) + /* Escape double-quote, and backslashes in strings. + Newlines in strings are best escaped as \n, since + otherwise backslash-backslash-newline-newline is + mishandled. The C Standard doesn't allow newlines in + strings, so we can escape newlines as we please. */ + if (c == '\"' + || (in_string + && (c == '\\' + || (c == '\n' ? (c = 'n', 1) : 0)))) xbuf[totlen++] = '\\'; /* We used to output e.g. \008 for control characters here, but this doesn't conform to the C Standard. @@ -8660,8 +8701,7 @@ macroexpand (hp, op) /* Don't bother doing change_newlines for subsequent uses of arg. */ arg->use_count = 1; - arg->expand_length - = change_newlines (arg->expanded, arg->expand_length); + change_newlines (arg); } } @@ -8738,23 +8778,23 @@ macarg (argptr, rest_args) { FILE_BUF *ip = &instack[indepth]; int paren = 0; - int newlines = 0; + int lineno0 = ip->lineno; int comments = 0; int result = 0; /* Try to parse as much of the argument as exists at this input stack level. */ U_CHAR *bp = macarg1 (ip->bufp, ip->buf + ip->length, ip->macro, - &paren, &newlines, &comments, rest_args); + &paren, &ip->lineno, &comments, rest_args); /* If we find the end of the argument at this level, set up *ARGPTR to point at it in the input stack. */ - if (!(ip->fname != 0 && (newlines != 0 || comments != 0)) + if (!(ip->fname != 0 && (ip->lineno != lineno0 || comments != 0)) && bp != ip->buf + ip->length) { if (argptr != 0) { argptr->raw = ip->bufp; argptr->raw_length = bp - ip->bufp; - argptr->newlines = newlines; + argptr->newlines = ip->lineno - lineno0; } ip->bufp = bp; } else { @@ -8763,13 +8803,12 @@ macarg (argptr, rest_args) Therefore, we must allocate a temporary buffer and copy the macro argument into it. */ int bufsize = bp - ip->bufp; - int extra = newlines; + int extra = ip->lineno - lineno0; U_CHAR *buffer = (U_CHAR *) xmalloc (bufsize + extra + 1); int final_start = 0; bcopy ((char *) ip->bufp, (char *) buffer, bufsize); ip->bufp = bp; - ip->lineno += newlines; while (bp == ip->buf + ip->length) { if (instack[indepth].macro == 0) { @@ -8780,18 +8819,17 @@ macarg (argptr, rest_args) if (ip->free_ptr) free (ip->free_ptr); ip = &instack[--indepth]; - newlines = 0; + lineno0 = ip->lineno; comments = 0; bp = macarg1 (ip->bufp, ip->buf + ip->length, ip->macro, &paren, - &newlines, &comments, rest_args); + &ip->lineno, &comments, rest_args); final_start = bufsize; bufsize += bp - ip->bufp; - extra += newlines; + extra += ip->lineno - lineno0; buffer = (U_CHAR *) xrealloc (buffer, bufsize + extra + 1); bcopy ((char *) ip->bufp, (char *) (buffer + bufsize - (bp - ip->bufp)), bp - ip->bufp); ip->bufp = bp; - ip->lineno += newlines; } /* Now, if arg is actually wanted, record its raw form, @@ -8803,13 +8841,13 @@ macarg (argptr, rest_args) argptr->raw = buffer; argptr->raw_length = bufsize; argptr->free1 = buffer; - argptr->newlines = newlines; - if ((newlines || comments) && ip->fname != 0) + argptr->newlines = ip->lineno - lineno0; + if ((argptr->newlines || comments) && ip->fname != 0) argptr->raw_length = final_start + discard_comments (argptr->raw + final_start, argptr->raw_length - final_start, - newlines); + argptr->newlines); argptr->raw[argptr->raw_length] = 0; if (argptr->raw_length > bufsize + extra) abort (); @@ -8843,10 +8881,10 @@ macarg (argptr, rest_args) SKIP_ALL_WHITE_SPACE (buf); else #endif - if (c == '\"' || c == '\\') /* escape these chars */ + if (c == '\"' || c == '\\' || c == '\n') /* escape these chars */ totlen++; } - argptr->stringified_length = totlen; + argptr->stringified_length_bound = totlen; } return result; } @@ -8895,7 +8933,7 @@ macarg1 (start, limit, macro, depthptr, newlines, comments, rest_args) case '/': if (macro) break; - if (bp[1] == '\\' && bp[2] == '\n') + if (bp[1] == '\\') newline_fix (bp + 1); if (bp[1] == '*') { *comments = 1; @@ -8905,7 +8943,7 @@ macarg1 (start, limit, macro, depthptr, newlines, comments, rest_args) else if (*bp == '*') { if (bp[-1] == '/' && warn_comments) warning ("`/*' within comment"); - if (bp[1] == '\\' && bp[2] == '\n') + if (bp[1] == '\\') newline_fix (bp + 1); if (bp[1] == '/') { bp++; @@ -8952,18 +8990,18 @@ macarg1 (start, limit, macro, depthptr, newlines, comments, rest_args) case '\"': { int quotec; - for (quotec = *bp++; bp + 1 < limit && *bp != quotec; bp++) { + for (quotec = *bp++; bp < limit && *bp != quotec; bp++) { if (*bp == '\\') { bp++; if (*bp == '\n') ++*newlines; - if (!macro) { - while (*bp == '\\' && bp[1] == '\n') { - bp += 2; - ++*newlines; - } + while (*bp == '\\' && bp[1] == '\n') { + bp += 2; + ++*newlines; } } else if (*bp == '\n') { + if (warn_white_space && is_hor_space[bp[-1]] && ! macro) + warning ("white space at end of line in string"); ++*newlines; if (quotec == '\'') break; @@ -9047,7 +9085,7 @@ discard_comments (start, length, newlines) break; case '/': - if (*ibp == '\\' && ibp[1] == '\n') + if (*ibp == '\\') newline_fix (ibp); /* Delete any comment. */ if (cplusplus_comments && ibp[0] == '/') { @@ -9082,7 +9120,7 @@ discard_comments (start, length, newlines) obp[-1] = ' '; while (++ibp < limit) { if (ibp[0] == '*') { - if (ibp[1] == '\\' && ibp[2] == '\n') + if (ibp[1] == '\\') newline_fix (ibp + 1); if (ibp[1] == '/') { ibp += 2; @@ -9153,15 +9191,16 @@ discard_comments (start, length, newlines) return obp - start; } -/* Turn newlines to spaces in the string of length LENGTH at START, - except inside of string constants. - The string is copied into itself with its beginning staying fixed. */ +/* Turn newlines to spaces in the macro argument ARG. + Remove backslash-newline from string constants, + and turn other newlines in string constants to backslash-'n'. */ -static int -change_newlines (start, length) - U_CHAR *start; - int length; +static void +change_newlines (arg) + struct argdata *arg; { + U_CHAR *start = arg->expanded; + int length = arg->expand_length; register U_CHAR *ibp; register U_CHAR *obp; register U_CHAR *limit; @@ -9225,7 +9264,10 @@ change_newlines (start, length) } } - return obp - start; + arg->expand_length = obp - arg->expanded; + + if (start != arg->expanded) + free (start); } /* notice - output message to stderr */ @@ -9293,7 +9335,8 @@ verror (msgid, args) } if (ip != NULL) { - eprint_string (ip->nominal_fname, ip->nominal_fname_len); + fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0], + ip->nominal_fname_len, stderr); fprintf (stderr, ":%d: ", ip->lineno); } vnotice (msgid, args); @@ -9320,7 +9363,8 @@ error_from_errno (name) } if (ip != NULL) { - eprint_string (ip->nominal_fname, ip->nominal_fname_len); + fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0], + ip->nominal_fname_len, stderr); fprintf (stderr, ":%d: ", ip->lineno); } @@ -9372,7 +9416,8 @@ vwarning (msgid, args) } if (ip != NULL) { - eprint_string (ip->nominal_fname, ip->nominal_fname_len); + fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0], + ip->nominal_fname_len, stderr); fprintf (stderr, ":%d: ", ip->lineno); } notice ("warning: "); @@ -9419,7 +9464,8 @@ verror_with_line (line, msgid, args) } if (ip != NULL) { - eprint_string (ip->nominal_fname, ip->nominal_fname_len); + fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0], + ip->nominal_fname_len, stderr); fprintf (stderr, ":%d: ", line); } vnotice (msgid, args); @@ -9471,7 +9517,8 @@ vwarning_with_line (line, msgid, args) } if (ip != NULL) { - eprint_string (ip->nominal_fname, ip->nominal_fname_len); + fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0], + ip->nominal_fname_len, stderr); fprintf (stderr, line ? ":%d: " : ": ", line); } notice ("warning: "); @@ -9553,7 +9600,7 @@ pedwarn_with_file_and_line VPROTO ((const char *file, size_t file_len, int line, #endif if (file) { - eprint_string (file, file_len); + fwrite (file, sizeof file[0], file_len, stderr); fprintf (stderr, ":%d: ", line); } if (pedantic_errors) @@ -9614,7 +9661,8 @@ print_containing_files () notice (",\n from "); } - eprint_string (ip->nominal_fname, ip->nominal_fname_len); + fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0], + ip->nominal_fname_len, stderr); fprintf (stderr, ":%d", ip->lineno); } if (! first) @@ -10207,8 +10255,18 @@ make_definition (str) NULL_PTR, NULL_PTR, &unterminated); if (unterminated) return; - while (p != p1) - *q++ = *p++; + while (p != p1) { + if (*p == '\\' && p[1] == '\n') + p += 2; + else if (*p == '\n') + { + *q++ = '\\'; + *q++ = 'n'; + p++; + } + else + *q++ = *p++; + } } else if (*p == '\\' && p[1] == '\n') p += 2; /* Change newline chars into newline-markers. */ @@ -11048,4 +11106,25 @@ VMS_stat (name, statbuf) return result; } + +static size_t +VMS_fwrite (ptr, size, nitems, stream) + void const *ptr; + size_t size; + size_t nitems; + FILE *stream; +{ + /* VMS fwrite has undesirable results + if STREAM happens to be a record oriented file. + Work around this problem by writing each character individually. */ + char const *p = ptr; + size_t bytes = size * nitems; + char *lim = p + bytes; + + while (p < lim) + if (putc (*p++, stream) == EOF) + return 0; + + return bytes; +} #endif /* VMS */ diff --git a/gcc/cexp.c b/gcc/cexp.c index ed318a9e3e4..9379a3dac1a 100644 --- a/gcc/cexp.c +++ b/gcc/cexp.c @@ -336,7 +336,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 "/tmp/sky/share/bison.simple" +#line 3 "/usr/cygnus/TBD-TBD/share/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -529,7 +529,7 @@ __yy_memcpy (char *to, char *from, int count) #endif #endif -#line 196 "/tmp/sky/share/bison.simple" +#line 196 "/usr/cygnus/TBD-TBD/share/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 *. @@ -1110,7 +1110,7 @@ case 40: break;} } /* the action file gets copied in in place of this dollarsign */ -#line 498 "/tmp/sky/share/bison.simple" +#line 498 "/usr/cygnus/TBD-TBD/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; diff --git a/gcc/combine.c b/gcc/combine.c index 01703ba67f9..97e1375ebb3 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -76,7 +76,7 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" -#include "rtl.h" /* stdio.h must precede rtl.h for FFS. */ +#include "rtl.h" #include "flags.h" #include "regs.h" #include "hard-reg-set.h" @@ -1812,17 +1812,17 @@ try_combine (i3, i2, i1) ? gen_rtx_SET (VOIDmode, i1dest, i1src) : PATTERN (i1)); if (added_sets_2) - { - /* If there is no I1, use I2's body as is. We used to also not do - the subst call below if I2 was substituted into I3, - but that could lose a simplification. */ - if (i1 == 0) - XVECEXP (newpat, 0, --total_sets) = i2pat; - else - /* See comment where i2pat is assigned. */ - XVECEXP (newpat, 0, --total_sets) - = subst (i2pat, i1dest, i1src, 0, 0); - } + { + /* If there is no I1, use I2's body as is. We used to also not do + the subst call below if I2 was substituted into I3, + but that could lose a simplification. */ + if (i1 == 0) + XVECEXP (newpat, 0, --total_sets) = i2pat; + else + /* See comment where i2pat is assigned. */ + XVECEXP (newpat, 0, --total_sets) + = subst (i2pat, i1dest, i1src, 0, 0); + } } /* We come here when we are replacing a destination in I2 with the @@ -1906,14 +1906,14 @@ try_combine (i3, i2, i1) || (REG_N_SETS (REGNO (i2dest)) == 1 && ! added_sets_2 && ! REG_USERVAR_P (i2dest)))) ni2dest = gen_rtx_REG (GET_MODE (SET_DEST (newpat)), - REGNO (i2dest)); - - m_split = split_insns - (gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (2, newpat, - gen_rtx_CLOBBER (VOIDmode, - ni2dest))), - i3); + REGNO (i2dest)); + + m_split = split_insns (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (2, newpat, + gen_rtx_CLOBBER (VOIDmode, + ni2dest))), + i3); } if (m_split && GET_CODE (m_split) == SEQUENCE @@ -4604,7 +4604,10 @@ simplify_set (x) low-order bits. */ if (GET_MODE_CLASS (mode) == MODE_INT) - src = force_to_mode (src, mode, GET_MODE_MASK (mode), NULL_RTX, 0); + { + src = force_to_mode (src, mode, GET_MODE_MASK (mode), NULL_RTX, 0); + SUBST (SET_SRC (x), src); + } /* If we are setting CC0 or if the source is a COMPARE, look for the use of the comparison result and try to simplify it unless we already have used @@ -4852,6 +4855,68 @@ simplify_set (x) src = SET_SRC (x); } +#ifdef HAVE_conditional_arithmetic + /* If we have conditional arithmetic and the operand of a SET is + a conditional expression, replace this with an IF_THEN_ELSE. + We can either have a conditional expression or a MULT of that expression + with a constant. */ + if ((GET_RTX_CLASS (GET_CODE (src)) == '1' + || GET_RTX_CLASS (GET_CODE (src)) == '2' + || GET_RTX_CLASS (GET_CODE (src)) == 'c') + && (GET_RTX_CLASS (GET_CODE (XEXP (src, 0))) == '<' + || (GET_CODE (XEXP (src, 0)) == MULT + && GET_RTX_CLASS (GET_CODE (XEXP (XEXP (src, 0), 0))) == '<' + && GET_CODE (XEXP (XEXP (src, 0), 1)) == CONST_INT))) + { + rtx cond = XEXP (src, 0); + rtx true_val = const1_rtx; + rtx false_arm, true_arm; + + if (GET_CODE (cond) == MULT) + { + true_val = XEXP (cond, 1); + cond = XEXP (cond, 0); + } + + if (GET_RTX_CLASS (GET_CODE (src)) == '1') + { + true_arm = gen_unary (GET_CODE (src), GET_MODE (src), + GET_MODE (XEXP (src, 0)), true_val); + false_arm = gen_unary (GET_CODE (src), GET_MODE (src), + GET_MODE (XEXP (src, 0)), const0_rtx); + } + else + { + true_arm = gen_binary (GET_CODE (src), GET_MODE (src), + true_val, XEXP (src, 1)); + false_arm = gen_binary (GET_CODE (src), GET_MODE (src), + const0_rtx, XEXP (src, 1)); + } + + /* Canonicalize if true_arm is the simpler one. */ + if (GET_RTX_CLASS (GET_CODE (true_arm)) == 'o' + && GET_RTX_CLASS (GET_CODE (false_arm)) != 'o' + && reversible_comparison_p (cond)) + { + rtx temp = true_arm; + + true_arm = false_arm; + false_arm = temp; + + cond = gen_rtx_combine (reverse_condition (GET_CODE (cond)), + GET_MODE (cond), XEXP (cond, 0), + XEXP (cond, 1)); + } + + src = gen_rtx_combine (IF_THEN_ELSE, GET_MODE (src), + gen_rtx_combine (GET_CODE (cond), VOIDmode, + XEXP (cond, 0), + XEXP (cond, 1)), + true_arm, false_arm); + SUBST (SET_SRC (x), src); + } +#endif + /* If either SRC or DEST is a CLOBBER of (const_int 0), make this whole thing fail. */ if (GET_CODE (src) == CLOBBER && XEXP (src, 0) == const0_rtx) @@ -5419,8 +5484,9 @@ expand_field_assignment (x) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD))) { x = gen_rtx_SET (VOIDmode, SUBREG_REG (SET_DEST (x)), - gen_lowpart_for_combine (GET_MODE (SUBREG_REG (SET_DEST (x))), - SET_SRC (x))); + gen_lowpart_for_combine + (GET_MODE (SUBREG_REG (SET_DEST (x))), + SET_SRC (x))); continue; } else @@ -5458,22 +5524,22 @@ expand_field_assignment (x) /* Now compute the equivalent expression. Make a copy of INNER for the SET_DEST in case it is a MEM into which we will substitute; we don't want shared RTL in that case. */ - x = gen_rtx_SET (VOIDmode, copy_rtx (inner), - gen_binary (IOR, compute_mode, - gen_binary (AND, compute_mode, - gen_unary (NOT, compute_mode, - compute_mode, - gen_binary (ASHIFT, - compute_mode, - mask, pos)), - inner), - gen_binary (ASHIFT, compute_mode, - gen_binary (AND, compute_mode, - gen_lowpart_for_combine - (compute_mode, - SET_SRC (x)), - mask), - pos))); + x = gen_rtx_SET + (VOIDmode, copy_rtx (inner), + gen_binary (IOR, compute_mode, + gen_binary (AND, compute_mode, + gen_unary (NOT, compute_mode, + compute_mode, + gen_binary (ASHIFT, + compute_mode, + mask, pos)), + inner), + gen_binary (ASHIFT, compute_mode, + gen_binary (AND, compute_mode, + gen_lowpart_for_combine + (compute_mode, SET_SRC (x)), + mask), + pos))); } return x; @@ -5614,7 +5680,8 @@ make_extraction (mode, inner, pos, pos_rtx, len, if (tmode != inner_mode) new = gen_rtx_SUBREG (tmode, inner, (WORDS_BIG_ENDIAN - && GET_MODE_SIZE (inner_mode) > UNITS_PER_WORD + && (GET_MODE_SIZE (inner_mode) + > UNITS_PER_WORD) ? (((GET_MODE_SIZE (inner_mode) - GET_MODE_SIZE (tmode)) / UNITS_PER_WORD) @@ -5654,12 +5721,12 @@ make_extraction (mode, inner, pos, pos_rtx, len, && ! in_compare && ! spans_byte && unsignedp) return 0; - /* Unless we are allowed to span bytes, reject this if we would be - spanning bytes or if the position is not a constant and the length - is not 1. In all other cases, we would only be going outside - out object in cases when an original shift would have been + /* Unless we are allowed to span bytes or INNER is not MEM, reject this if + we would be spanning bytes or if the position is not a constant and the + length is not 1. In all other cases, we would only be going outside + our object in cases when an original shift would have been undefined. */ - if (! spans_byte + if (! spans_byte && GET_CODE (inner) == MEM && ((pos_rtx == 0 && pos + len > GET_MODE_BITSIZE (is_mode)) || (pos_rtx != 0 && len != 1))) return 0; @@ -9129,7 +9196,8 @@ recog_for_combine (pnewpat, insn, pnotes) { rtx newpat = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (GET_CODE (pat) == PARALLEL - ? XVECLEN (pat, 0) + num_clobbers_to_add + ? (XVECLEN (pat, 0) + + num_clobbers_to_add) : num_clobbers_to_add + 1)); if (GET_CODE (pat) == PARALLEL) @@ -9230,6 +9298,7 @@ gen_lowpart_for_combine (mode, x) if (WORDS_BIG_ENDIAN) offset = (MAX (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD) - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD)); + if (BYTES_BIG_ENDIAN) { /* Adjust the address so that the address-after-the-data is @@ -10208,12 +10277,17 @@ simplify_comparison (code, pop0, pop1) represents the low part, permute the SUBREG and the AND and try again. */ if (GET_CODE (XEXP (op0, 0)) == SUBREG - && ((mode_width - >= GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0))))) + && (0 #ifdef WORD_REGISTER_OPERATIONS - || subreg_lowpart_p (XEXP (op0, 0)) + || ((mode_width + > (GET_MODE_BITSIZE + (GET_MODE (SUBREG_REG (XEXP (op0, 0)))))) + && mode_width <= BITS_PER_WORD) #endif - ) + || ((mode_width + <= (GET_MODE_BITSIZE + (GET_MODE (SUBREG_REG (XEXP (op0, 0)))))) + && subreg_lowpart_p (XEXP (op0, 0)))) #ifndef WORD_REGISTER_OPERATIONS /* It is unsafe to commute the AND into the SUBREG if the SUBREG is paradoxical and WORD_REGISTER_OPERATIONS is not defined. @@ -11700,8 +11774,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1) if (! find_regno_note (tem, REG_UNUSED, REGNO (XEXP (note, 0)))) REG_NOTES (tem) - = gen_rtx_EXPR_LIST (REG_UNUSED, - XEXP (note, 0), + = gen_rtx_EXPR_LIST (REG_UNUSED, XEXP (note, 0), REG_NOTES (tem)); } else @@ -11863,8 +11936,8 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1) && ! reg_bitfield_target_p (piece, PATTERN (place))) REG_NOTES (place) - = gen_rtx_EXPR_LIST (REG_DEAD, - piece, REG_NOTES (place)); + = gen_rtx_EXPR_LIST (REG_DEAD, piece, + REG_NOTES (place)); } place = 0; diff --git a/gcc/config/1750a/1750a.c b/gcc/config/1750a/1750a.c index 789eedb6c58..631d8df8e1d 100644 --- a/gcc/config/1750a/1750a.c +++ b/gcc/config/1750a/1750a.c @@ -21,8 +21,7 @@ Boston, MA 02111-1307, USA. */ #define __datalbl #include "config.h" -#include <stdio.h> -#include <string.h> +#include "system.h" #include "rtl.h" #include "tree.h" #include "function.h" @@ -118,7 +117,7 @@ function_arg (cum, mode, type, named) else size = GET_MODE_SIZE (mode); if (cum + size < 12) - return gen_rtx (REG, mode, cum); + return gen_rtx_REG (mode, cum); else return (rtx) 0; } diff --git a/gcc/config/1750a/1750a.h b/gcc/config/1750a/1750a.h index 9ef50309356..1c61ab5d69d 100644 --- a/gcc/config/1750a/1750a.h +++ b/gcc/config/1750a/1750a.h @@ -474,14 +474,14 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA otherwise, FUNC is 0. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx(REG,TYPE_MODE(VALTYPE),0) + gen_rtx_REG (TYPE_MODE (VALTYPE), 0) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ /* 1750 note: no libcalls yet */ #define LIBCALL_VALUE(MODE) printf("LIBCALL_VALUE called!\n"), \ - gen_rtx(REG,MODE,0) + gen_rtx_REG (MODE, 0) /* 1 if N is a possible register number for a function value. */ @@ -696,8 +696,8 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) printf("INITIALIZE_TRAMPO called\n") /* { \ - emit_move_insn (gen_rtx (MEM, QImode, plus_constant (TRAMP, 1)), CXT); \ - emit_move_insn (gen_rtx (MEM, QImode, plus_constant (TRAMP, 6)), FNADDR); \ + emit_move_insn (gen_rtx_MEM (QImode, plus_constant (TRAMP, 1)), CXT); \ + emit_move_insn (gen_rtx_MEM (QImode, plus_constant (TRAMP, 6)), FNADDR); \ } */ diff --git a/gcc/config/1750a/1750a.md b/gcc/config/1750a/1750a.md index cff2d9291b8..3bea692edbd 100644 --- a/gcc/config/1750a/1750a.md +++ b/gcc/config/1750a/1750a.md @@ -1,6 +1,6 @@ ;;- Machine description for GNU compiler ;;- MIL-STD-1750A version. -;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +;; Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. ;; Contributed by O.M.Kellogg, DASA (oliver.kellogg@space.otn.dasa.de). ;; This file is part of GNU CC. @@ -767,9 +767,9 @@ (neg:TQF (match_operand:TQF 1 "register_operand" "r")))] "" " - emit_insn(gen_rtx(SET,VOIDmode,operands[0],CONST0_RTX(TQFmode))); - emit_insn(gen_rtx(SET,VOIDmode,operands[0], - gen_rtx(MINUS,TQFmode,operands[0],operands[1]))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], CONST0_RTX (TQFmode))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_MINUS (TQFmode, operands[0], operands[1]))); DONE; ") @@ -954,7 +954,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); + operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); }") (define_insn "" @@ -981,7 +981,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); + operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); }") (define_insn "" @@ -1012,7 +1012,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); + operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); }") (define_insn "" @@ -1038,7 +1038,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); + operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); }") (define_insn "" @@ -1375,17 +1375,6 @@ "" "ANYCALL %0") - -; (define_insn "return" -; [(return)] -; "" -; "* -; { -; rtx oprnd = GEN_INT (get_frame_size()); -; output_asm_insn(\"ret.m %0\",&oprnd); -; return \"\;\"; -; } ") - (define_insn "indirect_jump" [(set (pc) (match_operand:QI 0 "address_operand" "p"))] "" diff --git a/gcc/config/a29k/a29k.c b/gcc/config/a29k/a29k.c index ce41b34d91e..d930363f12d 100644 --- a/gcc/config/a29k/a29k.c +++ b/gcc/config/a29k/a29k.c @@ -1,5 +1,5 @@ /* Subroutines used for code generation on AMD Am29000. - Copyright (C) 1987, 88, 90-94, 1995, 1997, 1999 Free Software + Copyright (C) 1987, 88, 90-95, 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@nyu.edu) @@ -21,7 +21,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -854,9 +854,10 @@ a29k_clobbers_to (insn, op) for (i = R_LR (2); i < high_regno; i++) CALL_INSN_FUNCTION_USAGE (insn) - = gen_rtx (EXPR_LIST, VOIDmode, - gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, i)), - CALL_INSN_FUNCTION_USAGE (insn)); + = gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_CLOBBER (VOIDmode, + gen_rtx (REG, SImode, i)), + CALL_INSN_FUNCTION_USAGE (insn)); } /* These routines are used in finding insns to fill delay slots in the diff --git a/gcc/config/a29k/a29k.h b/gcc/config/a29k/a29k.h index a7f5d8d3ff7..4ea977c5fbe 100644 --- a/gcc/config/a29k/a29k.h +++ b/gcc/config/a29k/a29k.h @@ -746,12 +746,12 @@ extern struct rtx_def *a29k_get_reloaded_address (); On 29k the value is found in gr96. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), R_GR (96)) + gen_rtx_REG (TYPE_MODE (VALTYPE), R_GR (96)) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, R_GR (96)) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, R_GR (96)) /* 1 if N is a possible register number for a function value as seen by the caller. @@ -846,7 +846,7 @@ extern struct rtx_def *a29k_get_reloaded_address (); #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ ((CUM) < 16 && (NAMED) && ! MUST_PASS_IN_STACK (MODE, TYPE) \ - ? gen_rtx(REG, (MODE), R_LR (2) + (CUM)) : 0) + ? gen_rtx_REG ((MODE), R_LR (2) + (CUM)) : 0) /* Define where a function finds its arguments. This is different from FUNCTION_ARG because of register windows. @@ -856,8 +856,8 @@ extern struct rtx_def *a29k_get_reloaded_address (); #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \ ((CUM) < 16 && (NAMED) && ! MUST_PASS_IN_STACK (MODE, TYPE) \ - ? gen_rtx (REG, MODE, \ - incoming_reg (CUM, A29K_ARG_SIZE (MODE, TYPE, NAMED))) \ + ? gen_rtx_REG (MODE, \ + incoming_reg (CUM, A29K_ARG_SIZE (MODE, TYPE, NAMED))) \ : 0) /* This indicates that an argument is to be passed with an invisible reference @@ -911,7 +911,7 @@ extern struct rtx_def *a29k_get_reloaded_address (); if (! (NO_RTL) && first_reg_offset != 16) \ move_block_from_reg \ (R_AR (0) + first_reg_offset, \ - gen_rtx (MEM, BLKmode, virtual_incoming_args_rtx), \ + gen_rtx_MEM (BLKmode, virtual_incoming_args_rtx), \ 16 - first_reg_offset, (16 - first_reg_offset) * UNITS_PER_WORD); \ PRETEND_SIZE = (16 - first_reg_offset) * UNITS_PER_WORD; \ } \ @@ -1043,25 +1043,25 @@ extern char *a29k_function_name; rtx _val = force_reg (SImode, VALUE); \ \ _addr = memory_address (QImode, plus_constant (TRAMP, (CONST) + 3)); \ - emit_move_insn (gen_rtx (MEM, QImode, _addr), \ + emit_move_insn (gen_rtx_MEM (QImode, _addr), \ gen_lowpart (QImode, _val)); \ \ _temp = expand_shift (RSHIFT_EXPR, SImode, _val, \ build_int_2 (8, 0), 0, 1); \ _addr = memory_address (QImode, plus_constant (TRAMP, (CONST) + 1)); \ - emit_move_insn (gen_rtx (MEM, QImode, _addr), \ + emit_move_insn (gen_rtx_MEM (QImode, _addr), \ gen_lowpart (QImode, _temp)); \ \ _temp = expand_shift (RSHIFT_EXPR, SImode, _temp, \ build_int_2 (8, 0), _temp, 1); \ _addr = memory_address (QImode, plus_constant (TRAMP, (CONSTH) + 3)); \ - emit_move_insn (gen_rtx (MEM, QImode, _addr), \ + emit_move_insn (gen_rtx_MEM (QImode, _addr), \ gen_lowpart (QImode, _temp)); \ \ _temp = expand_shift (RSHIFT_EXPR, SImode, _temp, \ build_int_2 (8, 0), _temp, 1); \ _addr = memory_address (QImode, plus_constant (TRAMP, (CONSTH) + 1)); \ - emit_move_insn (gen_rtx (MEM, QImode, _addr), \ + emit_move_insn (gen_rtx_MEM (QImode, _addr), \ gen_lowpart (QImode, _temp)); \ } diff --git a/gcc/config/a29k/a29k.md b/gcc/config/a29k/a29k.md index cc4f422b0f2..aa82c6c5ca7 100644 --- a/gcc/config/a29k/a29k.md +++ b/gcc/config/a29k/a29k.md @@ -1,5 +1,5 @@ ;;- Machine description for AMD Am29000 for GNU C compiler -;; Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. +;; Copyright (C) 1991, 1992, 1994, 1998, 1999 Free Software Foundation, Inc. ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) ;; This file is part of GNU CC. @@ -145,8 +145,8 @@ later be inlined into another function. */ if (! TARGET_SMALL_MEMORY && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) - operands[0] = gen_rtx (MEM, SImode, - force_reg (Pmode, XEXP (operands[0], 0))); + operands[0] = gen_rtx_MEM (SImode, + force_reg (Pmode, XEXP (operands[0], 0))); }") (define_expand "call_value" @@ -178,9 +178,8 @@ later be inlined into another function. */ if (! TARGET_SMALL_MEMORY && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) - operands[1] = gen_rtx (MEM, SImode, - force_reg (Pmode, XEXP (operands[1], 0))); - + operands[1] = gen_rtx_MEM (SImode, + force_reg (Pmode, XEXP (operands[1], 0))); }") (define_insn "" @@ -644,9 +643,9 @@ if (size != 8 || (pos != 8 && pos != 16)) FAIL; - operands[3] = gen_rtx (ASHIFT, PSImode, - force_reg (PSImode, GEN_INT (pos / 8)), - GEN_INT (3)); + operands[3] = gen_rtx_ASHIFT (PSImode, + force_reg (PSImode, GEN_INT (pos / 8)), + GEN_INT (3)); }") @@ -967,9 +966,9 @@ if ((size != 8 && size != 16) || pos % size != 0) FAIL; - operands[2] = gen_rtx (ASHIFT, PSImode, - force_reg (PSImode, GEN_INT (pos / 8)), - GEN_INT (3)); + operands[2] = gen_rtx_ASHIFT (PSImode, + force_reg (PSImode, GEN_INT (pos / 8)), + GEN_INT (3)); }") ;; LOAD (also used by move insn). @@ -1056,20 +1055,20 @@ /* CR gets set to the number of registers minus one. */ operands[2] = GEN_INT(count - 1); - operands[3] = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (count + 2)); + operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count + 2)); from = memory_address (SImode, XEXP (operands[1], 0)); - XVECEXP (operands[3], 0, 0) = gen_rtx (SET, VOIDmode, - gen_rtx (REG, SImode, regno), - gen_rtx (MEM, SImode, from)); + XVECEXP (operands[3], 0, 0) = gen_rtx_SET (VOIDmode, + gen_rtx_REG (SImode, regno), + gen_rtx_MEM (SImode, from)); operands[4] = gen_reg_rtx (PSImode); - XVECEXP (operands[3], 0, 1) = gen_rtx (USE, VOIDmode, operands[4]); - XVECEXP (operands[3], 0, 2) = gen_rtx (CLOBBER, VOIDmode, operands[4]); + XVECEXP (operands[3], 0, 1) = gen_rtx_USE (VOIDmode, operands[4]); + XVECEXP (operands[3], 0, 2) = gen_rtx_CLOBBER (VOIDmode, operands[4]); for (i = 1; i < count; i++) XVECEXP (operands[3], 0, i + 2) - = gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, regno + i), - gen_rtx (MEM, SImode, plus_constant (from, i * 4))); + = gen_rtx_SET (VOIDmode, gen_rtx (REG, SImode, regno + i), + gen_rtx_MEM (SImode, plus_constant (from, i * 4))); }") ;; Indicate that CR is used and is then clobbered. @@ -1378,20 +1377,20 @@ /* CR gets set to the number of registers minus one. */ operands[2] = GEN_INT(count - 1); - operands[3] = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (count + 2)); + operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count + 2)); from = memory_address (SImode, XEXP (operands[0], 0)); - XVECEXP (operands[3], 0, 0) = gen_rtx (SET, VOIDmode, - gen_rtx (MEM, SImode, from), - gen_rtx (REG, SImode, regno)); + XVECEXP (operands[3], 0, 0) = gen_rtx_SET (VOIDmode, + gen_rtx_MEM (SImode, from), + gen_rtx_REG (SImode, regno)); operands[4] = gen_reg_rtx (PSImode); - XVECEXP (operands[3], 0, 1) = gen_rtx (USE, VOIDmode, operands[4]); - XVECEXP (operands[3], 0, 2) = gen_rtx (CLOBBER, VOIDmode, operands[4]); + XVECEXP (operands[3], 0, 1) = gen_rtx_USE (VOIDmode, operands[4]); + XVECEXP (operands[3], 0, 2) = gen_rtx_CLOBBER (VOIDmode, operands[4]); for (i = 1; i < count; i++) XVECEXP (operands[3], 0, i + 2) - = gen_rtx (SET, VOIDmode, - gen_rtx (MEM, SImode, plus_constant (from, i * 4)), - gen_rtx (REG, SImode, regno + i)); + = gen_rtx_SET (VOIDmode, + gen_rtx_MEM (SImode, plus_constant (from, i * 4)), + gen_rtx_REG (SImode, regno + i)); }") (define_expand "store_multiple_bug" @@ -1417,19 +1416,19 @@ count = INTVAL (operands[2]); regno = REGNO (operands[1]); - operands[3] = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (count + 1)); + operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count + 1)); from = memory_address (SImode, XEXP (operands[0], 0)); - XVECEXP (operands[3], 0, 0) = gen_rtx (SET, VOIDmode, - gen_rtx (MEM, SImode, from), - gen_rtx (REG, SImode, regno)); + XVECEXP (operands[3], 0, 0) = gen_rtx_SET (VOIDmode, + gen_rtx_MEM (SImode, from), + gen_rtx_REG (SImode, regno)); XVECEXP (operands[3], 0, 1) - = gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, PSImode)); + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (PSImode)); for (i = 1; i < count; i++) XVECEXP (operands[3], 0, i + 1) - = gen_rtx (SET, VOIDmode, - gen_rtx (MEM, SImode, plus_constant (from, i * 4)), - gen_rtx (REG, SImode, regno + i)); + = gen_rtx_SET (VOIDmode, + gen_rtx_MEM (SImode, plus_constant (from, i * 4)), + gen_rtx_REG (SImode, regno + i)); }") (define_insn "" @@ -1811,7 +1810,7 @@ " { rtx seq = gen_loadhi (gen_lowpart (SImode, operands[0]), a29k_get_reloaded_address (operands[1]), - gen_rtx (REG, SImode, R_TAV), + gen_rtx_REG (SImode, R_TAV), operands[2]); a29k_set_memflags (seq, operands[1]); @@ -1828,7 +1827,7 @@ { rtx (*fcn) () = TARGET_BYTE_WRITES ? gen_storehihww : gen_storehinhww; rtx seq = (*fcn) (a29k_get_reloaded_address (operands[0]), gen_lowpart (SImode, operands[1]), - gen_rtx (REG, SImode, R_TAV), operands[2]); + gen_rtx_REG (SImode, R_TAV), operands[2]); a29k_set_memflags (seq, operands[0]); emit_insn (seq); @@ -1941,7 +1940,7 @@ " { rtx seq = gen_loadqi (gen_lowpart (SImode, operands[0]), a29k_get_reloaded_address (operands[1]), - gen_rtx (REG, SImode, R_TAV), + gen_rtx_REG (SImode, R_TAV), operands[2]); a29k_set_memflags (seq, operands[1]); @@ -1958,7 +1957,7 @@ { rtx (*fcn) () = TARGET_BYTE_WRITES ? gen_storeqihww : gen_storeqinhww; rtx seq = (*fcn) (a29k_get_reloaded_address (operands[0]), gen_lowpart (SImode, operands[1]), - gen_rtx (REG, SImode, R_TAV), operands[2]); + gen_rtx_REG (SImode, R_TAV), operands[2]); a29k_set_memflags (seq, operands[0]); emit_insn (seq); @@ -2173,25 +2172,25 @@ if (REGNO (operands[0]) >= REGNO (operands[1]) + 1 && REGNO (operands[0]) <= REGNO (operands[1]) + 3) { - operands[3] = gen_rtx (REG, SImode, REGNO (operands[0]) + 3); - operands[4] = gen_rtx (REG, SImode, REGNO (operands[1]) + 3); - operands[5] = gen_rtx (REG, SImode, REGNO (operands[0]) + 2); - operands[6] = gen_rtx (REG, SImode, REGNO (operands[1]) + 2); - operands[7] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); - operands[8] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); - operands[9] = gen_rtx (REG, SImode, REGNO (operands[0])); - operands[10] = gen_rtx (REG, SImode, REGNO (operands[1])); + operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 3); + operands[4] = gen_rtx_REG (SImode, REGNO (operands[1]) + 3); + operands[5] = gen_rtx_REG (SImode, REGNO (operands[0]) + 2); + operands[6] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2); + operands[7] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); + operands[8] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); + operands[9] = gen_rtx_REG (SImode, REGNO (operands[0])); + operands[10] = gen_rtx_REG (SImode, REGNO (operands[1])); } else { - operands[3] = gen_rtx (REG, SImode, REGNO (operands[0])); - operands[4] = gen_rtx (REG, SImode, REGNO (operands[1])); - operands[5] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); - operands[6] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); - operands[7] = gen_rtx (REG, SImode, REGNO (operands[0]) + 2); - operands[8] = gen_rtx (REG, SImode, REGNO (operands[1]) + 2); - operands[9] = gen_rtx (REG, SImode, REGNO (operands[0]) + 3); - operands[10] = gen_rtx (REG, SImode, REGNO (operands[1]) + 3); + operands[3] = gen_rtx_REG (SImode, REGNO (operands[0])); + operands[4] = gen_rtx_REG (SImode, REGNO (operands[1])); + operands[5] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); + operands[6] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); + operands[7] = gen_rtx_REG (SImode, REGNO (operands[0]) + 2); + operands[8] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2); + operands[9] = gen_rtx_REG (SImode, REGNO (operands[0]) + 3); + operands[10] = gen_rtx_REG (SImode, REGNO (operands[1]) + 3); } }") @@ -2553,9 +2552,9 @@ { operands[1] = gen_reg_rtx (SImode); if (a29k_compare_fp_p) - operands[2] = gen_rtx (GT, SImode, a29k_compare_op1, a29k_compare_op0); + operands[2] = gen_rtx_GT (SImode, a29k_compare_op1, a29k_compare_op0); else - operands[2] = gen_rtx (LT, SImode, a29k_compare_op0, a29k_compare_op1); + operands[2] = gen_rtx_LT (SImode, a29k_compare_op0, a29k_compare_op1); }") ;; Similarly for "le". @@ -2570,9 +2569,9 @@ { operands[1] = gen_reg_rtx (SImode); if (a29k_compare_fp_p) - operands[2] = gen_rtx (GE, SImode, a29k_compare_op1, a29k_compare_op0); + operands[2] = gen_rtx_GE (SImode, a29k_compare_op1, a29k_compare_op0); else - operands[2] = gen_rtx (LE, SImode, a29k_compare_op0, a29k_compare_op1); + operands[2] = gen_rtx_LE (SImode, a29k_compare_op0, a29k_compare_op1); }") (define_expand "bltu" @@ -2708,9 +2707,9 @@ " { if (a29k_compare_fp_p) - operands[1] = gen_rtx (GT, SImode, a29k_compare_op1, a29k_compare_op0); + operands[1] = gen_rtx_GT (SImode, a29k_compare_op1, a29k_compare_op0); else - operands[1] = gen_rtx (LT, SImode, a29k_compare_op0, a29k_compare_op1); + operands[1] = gen_rtx_LT (SImode, a29k_compare_op0, a29k_compare_op1); }") ;; Similarly for "le" @@ -2721,9 +2720,9 @@ " { if (a29k_compare_fp_p) - operands[1] = gen_rtx (GE, SImode, a29k_compare_op1, a29k_compare_op0); + operands[1] = gen_rtx_GE (SImode, a29k_compare_op1, a29k_compare_op0); else - operands[1] = gen_rtx (LE, SImode, a29k_compare_op0, a29k_compare_op1); + operands[1] = gen_rtx_LE (SImode, a29k_compare_op0, a29k_compare_op1); }") (define_expand "sltu" diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index ca097f6121d..e9da5dbbe25 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -412,7 +412,7 @@ sext_add_operand (op, mode) return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'I') || CONST_OK_FOR_LETTER_P (INTVAL (op), 'O')); - return register_operand (op, mode); + return reg_not_elim_operand (op, mode); } /* Return 1 if OP is the constant 4 or 8. */ @@ -3052,9 +3052,9 @@ alpha_initialize_trampoline (tramp, fnaddr, cxt, fnofs, cxtofs, jmpofs) /* Store function address and CXT. */ addr = memory_address (mode, plus_constant (tramp, fnofs)); - emit_move_insn (gen_rtx (MEM, mode, addr), fnaddr); + emit_move_insn (gen_rtx_MEM (mode, addr), fnaddr); addr = memory_address (mode, plus_constant (tramp, cxtofs)); - emit_move_insn (gen_rtx (MEM, mode, addr), cxt); + emit_move_insn (gen_rtx_MEM (mode, addr), cxt); /* This has been disabled since the hint only has a 32k range, and in no existing OS is the stack within 32k of the text segment. */ @@ -3070,15 +3070,15 @@ alpha_initialize_trampoline (tramp, fnaddr, cxt, fnofs, cxtofs, jmpofs) /* Merge in the hint. */ addr = memory_address (SImode, plus_constant (tramp, jmpofs)); - temp1 = force_reg (SImode, gen_rtx (MEM, SImode, addr)); + temp1 = force_reg (SImode, gen_rtx_MEM (SImode, addr)); temp1 = expand_and (temp1, GEN_INT (0xffffc000), NULL_RTX); temp1 = expand_binop (SImode, ior_optab, temp1, temp, temp1, 1, OPTAB_WIDEN); - emit_move_insn (gen_rtx (MEM, SImode, addr), temp1); + emit_move_insn (gen_rtx_MEM (SImode, addr), temp1); } #ifdef TRANSFER_FROM_TRAMPOLINE - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"), + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), 0, VOIDmode, 1, addr, Pmode); #endif diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 2c0e0a2d2cc..233dae9a3fd 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -1009,25 +1009,25 @@ extern int alpha_memory_latency; On Alpha the value is found in $0 for integer functions and $f0 for floating-point functions. */ -#define FUNCTION_VALUE(VALTYPE, FUNC) \ +#define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx_REG (((INTEGRAL_TYPE_P (VALTYPE) \ - && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ - || POINTER_TYPE_P (VALTYPE)) \ + && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ + || POINTER_TYPE_P (VALTYPE)) \ ? word_mode : TYPE_MODE (VALTYPE), \ ((TARGET_FPREGS \ - && (TREE_CODE (VALTYPE) == REAL_TYPE \ + && (TREE_CODE (VALTYPE) == REAL_TYPE \ || TREE_CODE (VALTYPE) == COMPLEX_TYPE)) \ - ? 32 : 0)) + ? 32 : 0)) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) \ +#define LIBCALL_VALUE(MODE) \ gen_rtx_REG (MODE, \ - (TARGET_FPREGS \ - && (GET_MODE_CLASS (MODE) == MODE_FLOAT \ + (TARGET_FPREGS \ + && (GET_MODE_CLASS (MODE) == MODE_FLOAT \ || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \ - ? 32 : 0)) + ? 32 : 0)) /* The definition of this macro implies that there are cases where a scalar value cannot be returned in registers. @@ -1105,11 +1105,12 @@ extern int alpha_memory_latency; #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ ((CUM) < 6 && ! MUST_PASS_IN_STACK (MODE, TYPE) \ - ? gen_rtx(REG, (MODE), \ - (CUM) + 16 + ((TARGET_FPREGS \ - && (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ - || GET_MODE_CLASS (MODE) == MODE_FLOAT)) \ - * 32)) \ + ? gen_rtx_REG ((MODE), \ + (CUM) + 16 \ + + ((TARGET_FPREGS \ + && (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ + || GET_MODE_CLASS (MODE) == MODE_FLOAT)) \ + * 32)) \ : 0) /* Specify the padding direction of arguments. diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 9fb35d90a4e..6407b6c1d09 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -491,7 +491,7 @@ (define_split [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI - (plus:SI (match_operand:SI 1 "register_operand" "") + (plus:SI (match_operand:SI 1 "reg_not_elim_operand" "") (match_operand:SI 2 "const_int_operand" "")))) (clobber (match_operand:SI 3 "reg_not_elim_operand" ""))] "! sext_add_operand (operands[2], SImode) && INTVAL (operands[2]) > 0 @@ -626,7 +626,7 @@ [(match_operand 2 "" "") (match_operand 3 "" "")]) (match_operand:SI 4 "const48_operand" "")) - (match_operand:SI 5 "add_operand" "")))) + (match_operand:SI 5 "sext_add_operand" "")))) (clobber (match_operand:DI 6 "reg_not_elim_operand" ""))] "" [(set (match_dup 6) (match_dup 7)) @@ -650,95 +650,6 @@ s%2addq %1,%3,%0 s%2subq %1,%n3,%0") -;; These variants of the above insns can occur if the third operand -;; is the frame pointer. This is a kludge, but there doesn't -;; seem to be a way around it. Only recognize them while reloading. - -(define_insn "" - [(set (match_operand:DI 0 "some_operand" "=&r") - (plus:DI (plus:DI (match_operand:DI 1 "some_operand" "r") - (match_operand:DI 2 "some_operand" "r")) - (match_operand:DI 3 "some_operand" "rIOKL")))] - "reload_in_progress" - "#") - -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (plus:DI (plus:DI (match_operand:DI 1 "register_operand" "") - (match_operand:DI 2 "register_operand" "")) - (match_operand:DI 3 "add_operand" "")))] - "reload_completed" - [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2))) - (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))] - "") - -(define_insn "" - [(set (match_operand:SI 0 "some_operand" "=&r") - (plus:SI (plus:SI (mult:SI (match_operand:SI 1 "some_operand" "rJ") - (match_operand:SI 2 "const48_operand" "I")) - (match_operand:SI 3 "some_operand" "r")) - (match_operand:SI 4 "some_operand" "rIOKL")))] - "reload_in_progress" - "#") - -(define_split - [(set (match_operand:SI 0 "register_operand" "r") - (plus:SI (plus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "") - (match_operand:SI 2 "const48_operand" "")) - (match_operand:SI 3 "register_operand" "")) - (match_operand:SI 4 "add_operand" "rIOKL")))] - "reload_completed" - [(set (match_dup 0) - (plus:SI (mult:SI (match_dup 1) (match_dup 2)) (match_dup 3))) - (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))] - "") - -(define_insn "" - [(set (match_operand:DI 0 "some_operand" "=&r") - (sign_extend:DI - (plus:SI (plus:SI - (mult:SI (match_operand:SI 1 "some_operand" "rJ") - (match_operand:SI 2 "const48_operand" "I")) - (match_operand:SI 3 "some_operand" "r")) - (match_operand:SI 4 "some_operand" "rIOKL"))))] - "reload_in_progress" - "#") - -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (sign_extend:DI - (plus:SI (plus:SI - (mult:SI (match_operand:SI 1 "reg_or_0_operand" "") - (match_operand:SI 2 "const48_operand" "")) - (match_operand:SI 3 "register_operand" "")) - (match_operand:SI 4 "add_operand" ""))))] - "reload_completed" - [(set (match_dup 5) - (plus:SI (mult:SI (match_dup 1) (match_dup 2)) (match_dup 3))) - (set (match_dup 0) (sign_extend:DI (plus:SI (match_dup 5) (match_dup 4))))] - "operands[5] = gen_lowpart (SImode, operands[0]);") - -(define_insn "" - [(set (match_operand:DI 0 "some_operand" "=&r") - (plus:DI (plus:DI (mult:DI (match_operand:DI 1 "some_operand" "rJ") - (match_operand:DI 2 "const48_operand" "I")) - (match_operand:DI 3 "some_operand" "r")) - (match_operand:DI 4 "some_operand" "rIOKL")))] - "reload_in_progress" - "#") - -(define_split - [(set (match_operand:DI 0 "register_operand" "=") - (plus:DI (plus:DI (mult:DI (match_operand:DI 1 "reg_or_0_operand" "") - (match_operand:DI 2 "const48_operand" "")) - (match_operand:DI 3 "register_operand" "")) - (match_operand:DI 4 "add_operand" "")))] - "reload_completed" - [(set (match_dup 0) - (plus:DI (mult:DI (match_dup 1) (match_dup 2)) (match_dup 3))) - (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))] - "") - (define_insn "negsi2" [(set (match_operand:SI 0 "register_operand" "=r") (neg:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI")))] diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h index 44388b2cf33..4d9bb1bd194 100644 --- a/gcc/config/alpha/vms.h +++ b/gcc/config/alpha/vms.h @@ -143,7 +143,7 @@ Boston, MA 02111-1307, USA. */ Thus 6 or more means all following args should go on the stack. */ enum avms_arg_type {I64, FF, FD, FG, FS, FT}; -typedef struct {char num_args; enum avms_arg_type atypes[6];} avms_arg_info; +typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info; #undef CUMULATIVE_ARGS #define CUMULATIVE_ARGS avms_arg_info @@ -185,12 +185,12 @@ extern struct rtx_def *alpha_arg_info_reg_val (); #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ ((MODE) == VOIDmode ? alpha_arg_info_reg_val (CUM) \ : ((CUM.num_args) < 6 && ! MUST_PASS_IN_STACK (MODE, TYPE) \ - ? gen_rtx(REG, (MODE), \ - ((CUM).num_args + 16 \ - + ((TARGET_FPREGS \ - && (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ - || GET_MODE_CLASS (MODE) == MODE_FLOAT)) \ - * 32))) \ + ? gen_rtx_REG ((MODE), \ + ((CUM).num_args + 16 \ + + ((TARGET_FPREGS \ + && (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ + || GET_MODE_CLASS (MODE) == MODE_FLOAT)) \ + * 32))) \ : 0)) #undef FUNCTION_ARG_ADVANCE @@ -242,7 +242,7 @@ extern struct rtx_def *alpha_arg_info_reg_val (); { \ if (! (NO_RTL)) \ { \ - emit_move_insn (gen_rtx (REG, DImode, 1), \ + emit_move_insn (gen_rtx_REG (DImode, 1), \ virtual_incoming_args_rtx); \ emit_insn (gen_arg_home ()); \ } \ diff --git a/gcc/config/alpha/x-alpha b/gcc/config/alpha/x-alpha index 9686ab96472..61ed8b0950d 100644 --- a/gcc/config/alpha/x-alpha +++ b/gcc/config/alpha/x-alpha @@ -1,2 +1,2 @@ -CLIB=-lmld +CLIB=-lmld -lexc EXTRA_HEADERS = $(srcdir)/config/alpha/va_list.h diff --git a/gcc/config/alpha/xm-alpha.h b/gcc/config/alpha/xm-alpha.h index c04844fdacd..91e2edee9ad 100644 --- a/gcc/config/alpha/xm-alpha.h +++ b/gcc/config/alpha/xm-alpha.h @@ -1,5 +1,5 @@ /* Configuration for GNU C-compiler for DEC Alpha. - Copyright (C) 1990, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 1990, 92, 93, 94, 95, 1998 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu). This file is part of GNU CC. @@ -61,16 +61,6 @@ extern void *alloca (); #define ONLY_INT_FIELDS #endif -/* Declare some functions needed for this machine. We don't want to - include these in the sources since other machines might define them - differently. */ - -extern void *malloc (), *realloc (), *calloc (); - -#ifndef inhibit_libc -#include "string.h" -#endif - /* OSF/1 is POSIX.1 compliant. */ #define POSIX diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 39b6cef2e0c..c5638f1f753 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -1,5 +1,5 @@ /* Subroutines used for code generation on the Argonaut ARC cpu. - Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -20,8 +20,8 @@ Boston, MA 02111-1307, USA. */ /* ??? This is an old port, and is undoubtedly suffering from bit rot. */ -#include <stdio.h> #include "config.h" +#include "system.h" #include "tree.h" #include "rtl.h" #include "regs.h" @@ -707,10 +707,10 @@ gen_compare_reg (code, x, y) enum machine_mode mode = SELECT_CC_MODE (code, x, y); rtx cc_reg; - cc_reg = gen_rtx (REG, mode, 61); + cc_reg = gen_rtx_REG (mode, 61); - emit_insn (gen_rtx (SET, VOIDmode, cc_reg, - gen_rtx (COMPARE, mode, x, y))); + emit_insn (gen_rtx_SET (VOIDmode, cc_reg, + gen_rtx_COMPARE (mode, x, y))); return cc_reg; } @@ -786,12 +786,11 @@ arc_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) int align_slop = size & 1; rtx regblock; - regblock = gen_rtx (MEM, BLKmode, - plus_constant (arg_pointer_rtx, - FIRST_PARM_OFFSET (0) - + align_slop * UNITS_PER_WORD)); + regblock = gen_rtx_MEM (BLKmode, + plus_constant (arg_pointer_rtx, + FIRST_PARM_OFFSET (0) + + align_slop * UNITS_PER_WORD)); MEM_ALIAS_SET (regblock) = get_varargs_alias_set (); - move_block_from_reg (first_reg_offset, regblock, MAX_ARC_PARM_REGS - first_reg_offset, ((MAX_ARC_PARM_REGS - first_reg_offset) diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 10a163bad9a..8135198e312 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -601,10 +601,12 @@ extern enum reg_class arc_regno_reg_class[]; farther back is at [%fp,4]. */ #if 0 /* The default value should work. */ #define RETURN_ADDR_RTX(COUNT, FRAME) \ -(((COUNT) == -1) \ - ? gen_rtx (REG, Pmode, 31) \ - : copy_to_reg (gen_rtx (MEM, Pmode, \ - memory_address (Pmode, plus_constant ((FRAME), UNITS_PER_WORD))))) +(((COUNT) == -1) \ + ? gen_rtx_REG (Pmode, 31) \ + : copy_to_reg (gen_rtx_MEM (Pmode, \ + memory_address (Pmode, \ + plus_constant ((FRAME), \ + UNITS_PER_WORD))))) #endif /* Register to use for pushing function arguments. */ @@ -722,7 +724,7 @@ extern enum reg_class arc_regno_reg_class[]; and the rest are pushed. */ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ (PASS_IN_REG_P ((CUM), (MODE), (TYPE), (NAMED)) \ - ? gen_rtx (REG, (MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \ + ? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \ : 0) /* A C expression for the number of words, at the beginning of an @@ -812,11 +814,11 @@ arc_setup_incoming_varargs(&ARGS_SO_FAR, MODE, TYPE, &PRETEND_SIZE, NO_RTL) VALTYPE is the data type of the value (as a tree). If the precise function being called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. */ -#define FUNCTION_VALUE(VALTYPE, FUNC) gen_rtx (REG, TYPE_MODE (VALTYPE), 0) +#define FUNCTION_VALUE(VALTYPE, FUNC) gen_rtx_REG (TYPE_MODE (VALTYPE), 0) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0) /* 1 if N is a possible register number for a function value as seen by the caller. */ @@ -909,9 +911,9 @@ do { \ CXT is an RTX for the static chain value for the function. */ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ do { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 4)), CXT); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 12)), FNADDR); \ - emit_insn (gen_flush_icache (validize_mem (gen_rtx (MEM, SImode, TRAMP)))); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), CXT); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 12)), FNADDR); \ + emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)))); \ } while (0) /* Library calls. */ diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index b4c86ba8b62..89ebc8ed9be 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -1,5 +1,5 @@ ;; Machine description of the Argonaut ARC cpu for GNU C compiler -;; Copyright (C) 1994, 1997, 1999 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1997, 1998, 1999 Free Software Foundation, Inc. ;; This file is part of GNU CC. @@ -304,7 +304,7 @@ ;{ ; /* Flow doesn't understand that this is effectively a DFmode move. ; It doesn't know that all of `operands[0]' is set. */ -; emit_insn (gen_rtx (CLOBBER, VOIDmode, operands[0])); +; emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0])); ; ; /* Emit insns that movsi_insn can handle. */ ; emit_insn (gen_movsi (operand_subword (operands[0], 0, 0, DImode), @@ -407,7 +407,7 @@ ;{ ; /* Flow doesn't understand that this is effectively a DFmode move. ; It doesn't know that all of `operands[0]' is set. */ -; emit_insn (gen_rtx (CLOBBER, VOIDmode, operands[0])); +; emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0])); ; ; /* Emit insns that movsi_insn can handle. */ ; emit_insn (gen_movsi (operand_subword (operands[0], 0, 0, DFmode), @@ -586,9 +586,9 @@ " { enum rtx_code code = GET_CODE (operands[1]); - rtx ccreg = gen_rtx (REG, - SELECT_CC_MODE (code, arc_compare_op0, arc_compare_op1), - 61); + rtx ccreg + = gen_rtx_REG (SELECT_CC_MODE (code, arc_compare_op0, arc_compare_op1), + 61); operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); }") @@ -602,14 +602,14 @@ ; " ;{ ; enum rtx_code code = GET_CODE (operands[1]); -; rtx ccreg = gen_rtx (REG, -; SELECT_CC_MODE (code, arc_compare_op0, arc_compare_op1), -; 61); +; rtx ccreg +; = gen_rtx_REG (SELECT_CC_MODE (code, arc_compare_op0, arc_compare_op1), +; 61); ; ; operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); -;}") - +}") (define_expand "movsfcc" + [(set (match_operand:SF 0 "register_operand" "") (if_then_else (match_operand 1 "comparison_operator" "") (match_operand:SF 2 "nonmemory_operand" "") @@ -618,9 +618,9 @@ " { enum rtx_code code = GET_CODE (operands[1]); - rtx ccreg = gen_rtx (REG, - SELECT_CC_MODE (code, arc_compare_op0, arc_compare_op1), - 61); + rtx ccreg + = gen_rtx_REG (SELECT_CC_MODE (code, arc_compare_op0, arc_compare_op1), + 61); operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); }") @@ -633,13 +633,13 @@ ; "0 /* ??? can generate less efficient code if constants involved */" ; " ;{ -; enum rtx_code code = GET_CODE (operands[1]); -; rtx ccreg = gen_rtx (REG, -; SELECT_CC_MODE (code, arc_compare_op0, arc_compare_op1), -; 61); +; enum rtx_code code = GET_CODE (operands[1]); +; rtx ccreg +; = gen_rtx_REG (SELECT_CC_MODE (code, arc_compare_op0, arc_compare_op1), +; 61); ; ; operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); -;}") +}") (define_insn "*movsicc_insn" [(set (match_operand:SI 0 "register_operand" "=r") @@ -1060,12 +1060,14 @@ { if (! TARGET_SHIFTER) { - emit_insn (gen_rtx - (PARALLEL, VOIDmode, + emit_insn (gen_rtx_PARALLEL + (VOIDmode, gen_rtvec (2, - gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (ASHIFT, SImode, operands[1], operands[2])), - gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, SImode, 0))))); + gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_ASHIFT (SImode, operands[1], + operands[2])), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (SImode))))); DONE; } }") @@ -1079,12 +1081,15 @@ { if (! TARGET_SHIFTER) { - emit_insn (gen_rtx - (PARALLEL, VOIDmode, + emit_insn (gen_rtx_PARALLEL + (VOIDmode, gen_rtvec (2, - gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (ASHIFTRT, SImode, operands[1], operands[2])), - gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, SImode, 0))))); + gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_ASHIFTRT (SImode, + operands[1], + operands[2])), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (SImode))))); DONE; } }") @@ -1098,12 +1103,15 @@ { if (! TARGET_SHIFTER) { - emit_insn (gen_rtx - (PARALLEL, VOIDmode, + emit_insn (gen_rtx_PARALLEL + (VOIDmode, gen_rtvec (2, - gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (LSHIFTRT, SImode, operands[1], operands[2])), - gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, SImode, 0))))); + gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_LSHIFTRT (SImode, + operands[1], + operands[2])), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (SImode))))); DONE; } }") diff --git a/gcc/config/clipper/clipper.c b/gcc/config/clipper/clipper.c index d9f00c84ff1..c76570e2e13 100644 --- a/gcc/config/clipper/clipper.c +++ b/gcc/config/clipper/clipper.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Clipper - Copyright (C) 1987, 1988, 1991, 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 91, 97, 98, 1999 Free Software Foundation, Inc. Contributed by Holger Teutsch (holger@hotbso.rhein-main.de) This file is part of GNU CC. @@ -20,7 +20,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -43,16 +43,14 @@ extern int frame_pointer_needed; static int frame_size; -/* - * compute size of a clipper stack frame where 'lsize' is the required - * space for local variables. - */ +/* Compute size of a clipper stack frame where 'lsize' is the required + space for local variables. */ int clipper_frame_size (lsize) int lsize; { - int i,size; /* total size of frame */ + int i, size; /* total size of frame */ int save_size; save_size = 0; /* compute size for reg saves */ @@ -70,17 +68,15 @@ clipper_frame_size (lsize) return size; } -/* - * prologue and epilogue output - * function is entered with pc pushed, i.e. stack is 32 bit aligned - * - * current_function_args_size == 0 means that the current function's args - * are passed totally in registers i.e fp is not used as ap. - * If frame_size is also 0 the current function does not push anything and - * can run with misaligned stack -> subq $4,sp / add $4,sp on entry and exit - * can be omitted. - * - */ +/* Prologue and epilogue output + Function is entered with pc pushed, i.e. stack is 32 bit aligned + + current_function_args_size == 0 means that the current function's args + are passed totally in registers i.e fp is not used as ap. + If frame_size is also 0 the current function does not push anything and + can run with misaligned stack -> subq $4,sp / add $4,sp on entry and exit + can be omitted. */ + void output_function_prologue (file, lsize) FILE *file; diff --git a/gcc/config/clipper/clipper.h b/gcc/config/clipper/clipper.h index ab76541408b..e73ebfcc586 100644 --- a/gcc/config/clipper/clipper.h +++ b/gcc/config/clipper/clipper.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Clipper version. - Copyright (C) 1987, 88, 91, 93-96, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 91, 93-96, 1998, 1999 Free Software Foundation, Inc. Contributed by Holger Teutsch (holger@hotbso.rhein-main.de) This file is part of GNU CC. @@ -393,15 +393,15 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, ALL_REGS, LIM_REG_CLASSES}; otherwise, FUNC is 0. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), ((TYPE_MODE (VALTYPE) == SFmode ||\ - TYPE_MODE (VALTYPE) == DFmode) ? \ - 16 : 0)) + gen_rtx_REG (TYPE_MODE (VALTYPE), ((TYPE_MODE (VALTYPE) == SFmode ||\ + TYPE_MODE (VALTYPE) == DFmode) ? \ + 16 : 0)) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ #define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, (MODE), ((MODE) == SFmode || (MODE) == DFmode ? 16 : 0)) + gen_rtx_REG ((MODE), ((MODE) == SFmode || (MODE) == DFmode ? 16 : 0)) /* 1 if N is a possible register number for a function value @@ -527,8 +527,9 @@ do \ && (GET_MODE_SIZE (MODE) <= 8) \ && ((TYPE) == NULL || !AGGREGATE_TYPE_P(TYPE)) \ && ((MODE) != DImode || (CUM).num == 0)) \ - ? gen_rtx (REG, (MODE), \ - GET_MODE_CLASS(MODE) == MODE_FLOAT ? (CUM).num+16 : (CUM).num) \ + ? gen_rtx_REG ((MODE), \ + GET_MODE_CLASS(MODE) == MODE_FLOAT \ + ? (CUM).num+16 : (CUM).num) \ : 0) /* If defined, a C expression that gives the alignment boundary, in bits, @@ -633,8 +634,8 @@ do \ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 24)), CXT); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 28)), FNADDR); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 24)), CXT); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 28)), FNADDR); \ } /* Addressing modes, and classification of registers for them. */ diff --git a/gcc/config/clipper/clipper.md b/gcc/config/clipper/clipper.md index 87f30fa5d0a..efe26a995f3 100644 --- a/gcc/config/clipper/clipper.md +++ b/gcc/config/clipper/clipper.md @@ -1,5 +1,6 @@ ;;- Machine description for GNU compiler, Clipper Version -;; Copyright (C) 1987, 88, 91, 93, 94, 1997 Free Software Foundation, Inc. +;; Copyright (C) 1987, 88, 91, 93, 94, 97, 98, 1999 +;; Free Software Foundation, Inc. ;; Contributed by Holger Teutsch (holger@hotbso.rhein-main.de) ;; This file is part of GNU CC. @@ -178,7 +179,7 @@ { rtx xops[4]; xops[0] = operands[0]; - xops[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xops[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); xops[2] = operands[1]; xops[3] = adj_offsettable_operand (operands[1], 4); output_asm_insn (\"loadw %2,%0\;loadw %3,%1\", xops); @@ -189,9 +190,9 @@ { rtx xops[4]; xops[0] = operands[0]; - xops[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xops[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); xops[2] = operands[1]; - xops[3] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xops[3] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"movw %2,%0\;movw %3,%1\", xops); return \"\"; } @@ -215,7 +216,7 @@ xops[0] = operands[0]; /* r -> o */ xops[1] = adj_offsettable_operand (operands[0], 4); xops[2] = operands[1]; - xops[3] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xops[3] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"storw %2,%0\;storw %3,%1\", xops); return \"\"; }" @@ -317,12 +318,12 @@ { rtx xoperands[2],yoperands[2]; - xoperands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xoperands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (which_alternative == 0) /* r -> r */ { output_asm_insn (\"movw %1,%0\", operands); - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"movw %1,%0\", xoperands); return \"\"; } @@ -366,7 +367,7 @@ xops[0] = operands[0]; xops[1] = adj_offsettable_operand (operands[0], 4); xops[2] = operands[1]; - xops[3] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xops[3] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"storw %2,%0\;storw %3,%1\", xops); return \"\"; }" @@ -696,9 +697,9 @@ rtx xoperands[4]; xoperands[0] = operands[0]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); xoperands[2] = operands[2]; - xoperands[3] = gen_rtx (REG, SImode, REGNO (operands[2]) + 1); + xoperands[3] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); output_asm_insn (\"addw %2,%0\;addwc %3,%1\", xoperands); return \"\"; }" @@ -767,9 +768,9 @@ rtx xoperands[4]; xoperands[0] = operands[0]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); xoperands[2] = operands[2]; - xoperands[3] = gen_rtx (REG, SImode, REGNO (operands[2]) + 1); + xoperands[3] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); output_asm_insn (\"subw %2,%0\;subwc %3,%1\", xoperands); return \"\"; }" @@ -991,7 +992,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1018,7 +1019,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1088,7 +1089,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1115,7 +1116,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1146,7 +1147,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1173,7 +1174,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" diff --git a/gcc/config/convex/convex.c b/gcc/config/convex/convex.c index 1a588e034c5..63de08cc8ea 100644 --- a/gcc/config/convex/convex.c +++ b/gcc/config/convex/convex.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Convex. - Copyright (C) 1988, 1993, 1994, 1997 Free Software Foundation, Inc. + Copyright (C) 1988, 93, 94, 97, 98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -19,7 +19,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "tree.h" #include "rtl.h" #include "regs.h" @@ -360,8 +360,8 @@ expand_movstr (operands) dest = change_address (dest, mode, 0); /* Make load and store patterns for this piece */ - load = gen_rtx (SET, VOIDmode, reg, src); - store = gen_rtx (SET, VOIDmode, dest, reg); + load = gen_rtx_SET (VOIDmode, reg, src); + store = gen_rtx_SET (VOIDmode, dest, reg); /* Emit the load and the store from last time. When we emit a store, we can reuse its temp reg. */ @@ -398,7 +398,7 @@ static void expand_movstr_call (operands) rtx *operands; { - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "memcpy"), 0, + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "memcpy"), 0, VOIDmode, 3, XEXP (operands[0], 0), Pmode, XEXP (operands[1], 0), Pmode, diff --git a/gcc/config/convex/convex.md b/gcc/config/convex/convex.md index cb6f64dc39b..fc6ce66be23 100644 --- a/gcc/config/convex/convex.md +++ b/gcc/config/convex/convex.md @@ -1,5 +1,5 @@ ;;- Machine description for GNU compiler, Convex Version -;; Copyright (C) 1988, 1994, 1995 Free Software Foundation, Inc. +;; Copyright (C) 1988, 1994, 1995, 1998, 1999 Free Software Foundation, Inc. ;; This file is part of GNU CC. @@ -1518,7 +1518,7 @@ } else { - output_cmp (gen_rtx (REG, SImode, 7), constm1_rtx, 'W'); + output_cmp (gen_rtx_REG (SImode, 7), constm1_rtx, 'W'); return \"psh.w s7\;ld.w %0,s7\;add.w #-1,s7\;st.w s7,%0\;pop.w s7\"; } }") @@ -1540,7 +1540,7 @@ } else { - output_cmp (gen_rtx (REG, SImode, 7), const0_rtx, 'W'); + output_cmp (gen_rtx_REG (SImode, 7), const0_rtx, 'W'); return \"psh.w s7\;ld.w %0,s7\;add.w #-1,s7\;st.w s7,%0\;pop.w s7\"; } }") @@ -1561,7 +1561,7 @@ } else { - output_cmp (gen_rtx (REG, HImode, 7), constm1_rtx, 'H'); + output_cmp (gen_rtx_REG (HImode, 7), constm1_rtx, 'H'); return \"psh.w s7\;ld.h %0,s7\;add.h #-1,s7\;st.h s7,%0\;pop.w s7\"; } }") @@ -1583,7 +1583,7 @@ } else { - output_cmp (gen_rtx (REG, HImode, 7), const0_rtx, 'H'); + output_cmp (gen_rtx_REG (HImode, 7), const0_rtx, 'H'); return \"psh.w s7\;ld.h %0,s7\;add.h #-1,s7\;st.h s7,%0\;pop.w s7\"; } }") diff --git a/gcc/config/dsp16xx/dsp16xx.c b/gcc/config/dsp16xx/dsp16xx.c index b1a1a1c7b29..cac77af4294 100644 --- a/gcc/config/dsp16xx/dsp16xx.c +++ b/gcc/config/dsp16xx/dsp16xx.c @@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */ /* Some output-actions in dsp1600.md need these. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -1795,10 +1795,11 @@ enum machine_mode mode; quotient = shift_amount/16; shift_amount = shift_amount - (quotient * 16); for (i = 0; i < quotient; i++) - emit_insn (gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (shift_op, mode, - first_shift_emitted ? operands[0] : operands[1], - GEN_INT (16)))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx (shift_op, mode, + first_shift_emitted + ? operands[0] : operands[1], + GEN_INT (16)))); first_shift_emitted = 1; } else if (shift_amount/8) @@ -1806,10 +1807,11 @@ enum machine_mode mode; quotient = shift_amount/8; shift_amount = shift_amount - (quotient * 8); for (i = 0; i < quotient; i++) - emit_insn (gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (shift_op, mode, - first_shift_emitted ? operands[0] : operands[1], - GEN_INT (8)))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx (shift_op, mode, + first_shift_emitted + ? operands[0] : operands[1], + GEN_INT (8)))); first_shift_emitted = 1; } else if (shift_amount/4) @@ -1817,10 +1819,11 @@ enum machine_mode mode; quotient = shift_amount/4; shift_amount = shift_amount - (quotient * 4); for (i = 0; i < quotient; i++) - emit_insn (gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (shift_op, mode, - first_shift_emitted ? operands[0] : operands[1], - GEN_INT (4)))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx (shift_op, mode, + first_shift_emitted + ? operands[0] : operands[1], + GEN_INT (4)))); first_shift_emitted = 1; } else if (shift_amount/1) @@ -1828,10 +1831,11 @@ enum machine_mode mode; quotient = shift_amount/1; shift_amount = shift_amount - (quotient * 1); for (i = 0; i < quotient; i++) - emit_insn (gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (shift_op, mode, - first_shift_emitted ? operands[0] : operands[1], - GEN_INT (1)))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx (shift_op, mode, + first_shift_emitted + ? operands[0] : operands[1], + GEN_INT (1)))); first_shift_emitted = 1; } } @@ -2085,7 +2089,7 @@ dsp16xx_function_arg (args_so_far, mode, type, named) args_so_far++; if (named && args_so_far < 4 && !MUST_PASS_IN_STACK (mode,type)) - return gen_rtx (REG, mode, args_so_far + FIRST_REG_FOR_FUNCTION_ARG); + return gen_rtx_REG (mode, args_so_far + FIRST_REG_FOR_FUNCTION_ARG); else return (struct rtx_def *) 0; } @@ -2135,14 +2139,14 @@ gen_tst_reg (x) if (mode == QImode) { - emit_insn (gen_rtx (PARALLEL, VOIDmode, - gen_rtvec (2, - gen_rtx (SET, VOIDmode, cc0_rtx, x), - gen_rtx (CLOBBER, VOIDmode, - gen_rtx (SCRATCH, QImode, 0))))); + emit_insn (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (2, gen_rtx_SET (VOIDmode, cc0_rtx, x), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (QImode))))); } else if (mode == HImode) - emit_insn (gen_rtx (SET, VOIDmode, cc0_rtx, x)); + emit_insn (gen_rtx_SET (VOIDmode, cc0_rtx, x)); else fatal ("Invalid mode for gen_tst_reg"); @@ -2165,54 +2169,64 @@ gen_compare_reg (code, x, y) if (mode == QImode) { - if (code == GTU || code == GEU || - code == LTU || code == LEU) + if (code == GTU || code == GEU + || code == LTU || code == LEU) { - emit_insn (gen_rtx (PARALLEL, VOIDmode, - gen_rtvec (3, - gen_rtx (SET, VOIDmode, cc0_rtx, - gen_rtx (COMPARE, mode, x, y)), - gen_rtx (CLOBBER, VOIDmode, - gen_rtx (SCRATCH, QImode, 0)), - gen_rtx (CLOBBER, VOIDmode, - gen_rtx (SCRATCH, QImode, 0))))); + emit_insn (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (3, + gen_rtx_SET (VOIDmode, cc0_rtx, + gen_rtx_COMPARE (mode, x, y)), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (QImode)), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (QImode))))); } else { - emit_insn (gen_rtx (PARALLEL, VOIDmode, - gen_rtvec (3, - gen_rtx (SET, VOIDmode, cc0_rtx, - gen_rtx (COMPARE, mode, x, y)), - gen_rtx (CLOBBER, VOIDmode, - gen_rtx (SCRATCH, QImode, 0)), - gen_rtx (CLOBBER, VOIDmode, - gen_rtx (SCRATCH, QImode, 0))))); + emit_insn (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (3, gen_rtx_SET (VOIDmode, cc0_rtx, + gen_rtx_COMPARE (mode, x, y)), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (QImode)), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (QImode))))); } } else if (mode == HImode) { - if (code == GTU || code == GEU || - code == LTU || code == LEU) + if (code == GTU || code == GEU + || code == LTU || code == LEU) { #if 1 - emit_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (5, - gen_rtx (SET, VOIDmode, cc0_rtx, gen_rtx (COMPARE, VOIDmode, x, y)), - gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, QImode, 0)), - gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, QImode, 0)), - gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, QImode, 0)), - gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, QImode, 0))))); + emit_insn (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (5, + gen_rtx_SET (VOIDmode, cc0_rtx, + gen_rtx_COMPARE (VOIDmode, + x, y)), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (QImode)), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (QImode)), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (QImode)), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (QImode))))); #else if (!dsp16xx_ucmphi2_libcall) - dsp16xx_ucmphi2_libcall = gen_rtx (SYMBOL_REF, Pmode, UCMPHI2_LIBCALL); + dsp16xx_ucmphi2_libcall = gen_rtx_SYMBOL_REF (Pmode, UCMPHI2_LIBCALL); emit_library_call (dsp16xx_ucmphi2_libcall, 1, HImode, 2, x, HImode, y, HImode); emit_insn (gen_tsthi_1 (copy_to_reg(hard_libcall_value (HImode)))); #endif } else - emit_insn (gen_rtx (SET, VOIDmode, cc0_rtx, - gen_rtx (COMPARE, VOIDmode, force_reg(HImode, x), - force_reg(HImode,y)))); + emit_insn (gen_rtx_SET (VOIDmode, cc0_rtx, + gen_rtx_COMPARE (VOIDmode, + force_reg (HImode, x), + force_reg (HImode,y)))); } else fatal ("Invalid mode for integer comparison in gen_compare_reg"); diff --git a/gcc/config/dsp16xx/dsp16xx.md b/gcc/config/dsp16xx/dsp16xx.md index 6029489628b..5ded3bb956a 100644 --- a/gcc/config/dsp16xx/dsp16xx.md +++ b/gcc/config/dsp16xx/dsp16xx.md @@ -195,8 +195,8 @@ if (GET_CODE(operands[1]) == REG) { - if (REGNO (operands[1]) == REG_Y || - REGNO (operands[1]) == REG_PROD) + if (REGNO (operands[1]) == REG_Y + || REGNO (operands[1]) == REG_PROD) { output_asm_insn (\"a1=%1\", operands); } @@ -1049,11 +1049,13 @@ emit_move_insn (operands[0], addr_reg); /* Then generate the add insn */ - emit_insn (gen_rtx (PARALLEL, VOIDmode, - gen_rtvec (2, - gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (PLUS, QImode, operands[0], offset)), - gen_rtx (CLOBBER, VOIDmode, operands[2])))); + emit_insn (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (2, + gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_PLUS (QImode, operands[0], + offset)), + gen_rtx_CLOBBER (VOIDmode, operands[2])))); DONE; }") @@ -1251,7 +1253,7 @@ " { operands[2] = gen_reg_rtx (HImode); - operands[3] = gen_rtx (SUBREG, QImode, operands[2], 1); + operands[3] = gen_rtx_SUBREG (QImode, operands[2], 1); }") ;;(define_insn "extendqihi2" @@ -1301,7 +1303,7 @@ " { operands[2] = gen_reg_rtx (HImode); - operands[3] = gen_rtx (SUBREG, QImode, operands[2], 1); + operands[3] = gen_rtx_SUBREG (QImode, operands[2], 1); }") @@ -1357,8 +1359,8 @@ emit_jump_insn (gen_bge (label1)); emit_insn (gen_fix_trunchfhi2 (operands[0], operands[1])); - emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx, - gen_rtx (LABEL_REF, VOIDmode, label2))); + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, + gen_rtx_LABEL_REF (VOIDmode, label2))); emit_barrier (); emit_label (label1); @@ -1372,7 +1374,7 @@ /* allow REG_NOTES to be set on last insn (labels don't have enough fields, and can't be used for REG_NOTES anyway). */ - emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); DONE; } }") @@ -1438,7 +1440,8 @@ #if 0 if (!dsp16xx_ashrhi3_libcall) - dsp16xx_ashrhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, ASHRHI3_LIBCALL); + dsp16xx_ashrhi3_libcall + = gen_rtx_SYMBOL_REF (Pmode, ASHRHI3_LIBCALL); emit_library_call (dsp16xx_ashrhi3_libcall, 1, HImode, 2, operands[1], HImode, @@ -1562,7 +1565,8 @@ rtx label2 = gen_label_rtx (); #if 0 if (!dsp16xx_lshrhi3_libcall) - dsp16xx_lshrhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, LSHRHI3_LIBCALL); + dsp16xx_lshrhi3_libcall + = gen_rtx_SYMBOL_REF (Pmode, LSHRHI3_LIBCALL); emit_library_call (dsp16xx_lshrhi3_libcall, 1, HImode, 2, operands[1], HImode, @@ -1704,11 +1708,11 @@ rtx label2 = gen_label_rtx (); #if 0 if (!dsp16xx_ashlhi3_libcall) - dsp16xx_ashlhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, ASHLHI3_LIBCALL); + dsp16xx_ashlhi3_libcall + = gen_rtx_SYMBOL_REF (Pmode, ASHLHI3_LIBCALL); emit_library_call (dsp16xx_ashlhi3_libcall, 1, HImode, 2, - operands[1], HImode, - operands[2], QImode); + operands[1], HImode, operands[2], QImode); emit_move_insn (operands[0], hard_libcall_value(HImode)); DONE; #else @@ -2028,8 +2032,8 @@ { if (GET_CODE (operands[0]) == MEM && ! call_address_operand (XEXP (operands[0], 0), QImode)) - operands[0] = gen_rtx (MEM, GET_MODE (operands[0]), - force_reg (Pmode, XEXP (operands[0], 0))); + operands[0] = gen_rtx_MEM (GET_MODE (operands[0]), + force_reg (Pmode, XEXP (operands[0], 0))); }") (define_insn "" @@ -2059,8 +2063,8 @@ { if (GET_CODE (operands[1]) == MEM && ! call_address_operand (XEXP (operands[1], 0), QImode)) - operands[1] = gen_rtx (MEM, GET_MODE (operands[1]), - force_reg (Pmode, XEXP (operands[1], 0))); + operands[1] = gen_rtx_MEM (GET_MODE (operands[1]), + force_reg (Pmode, XEXP (operands[1], 0))); }") (define_insn "" diff --git a/gcc/config/elxsi/elxsi.c b/gcc/config/elxsi/elxsi.c index 5526beb6b4f..8362e48b763 100644 --- a/gcc/config/elxsi/elxsi.c +++ b/gcc/config/elxsi/elxsi.c @@ -1,6 +1,6 @@ /* Subroutines for insn-output.c for GNU compiler. Elxsi version. - Copyright (C) 1987, 1992, 1997 Free Software Foundation, Inc - This port, done by Mike Stump <mrs@cygnus.com> in 1988, and is the first + Copyright (C) 1987, 1992, 1998, 1999 Free Software Foundation, Inc + Contributrd by Mike Stump <mrs@cygnus.com> in 1988 and is the first 64 bit port of GNU CC. Based upon the VAX port. @@ -22,7 +22,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "function.h" diff --git a/gcc/config/elxsi/elxsi.h b/gcc/config/elxsi/elxsi.h index b38af880fd7..06e83f89f58 100644 --- a/gcc/config/elxsi/elxsi.h +++ b/gcc/config/elxsi/elxsi.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Elxsi version. - Copyright (C) 1987, 1988, 1992, 1995, 1996 Free Software Foundation, Inc. - This port, contributed by Mike Stump <mrs@cygnus.com> in 1988, is the first + Copyright (C) 1987, 88, 92, 95, 96, 1998, 1999 Free Software Foundation, Inc. + Contributed by Mike Stump <mrs@cygnus.com> in 1988. This is the first 64 bit port of GNU CC. Based upon the VAX port. @@ -319,14 +319,14 @@ enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES }; /* On the Vax the return value is in R0 regardless. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), 0) + gen_rtx_REG (TYPE_MODE (VALTYPE), 0) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ /* On the Vax the return value is in R0 regardless. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0) /* Define this if PCC uses the nonreentrant convention for returning structure and union values. */ @@ -481,11 +481,11 @@ enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES }; else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx) \ { rtx other_reg = XEXP (ADDR, 1); \ offset = 0; \ - regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \ + regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \ else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx) \ { rtx other_reg = XEXP (ADDR, 0); \ offset = 0; \ - regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \ + regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \ if (offset >= 0) \ { int regno; \ extern char call_used_regs[]; \ diff --git a/gcc/config/fx80/fx80.c b/gcc/config/fx80/fx80.c index 48658e24fec..81d637e18f6 100644 --- a/gcc/config/fx80/fx80.c +++ b/gcc/config/fx80/fx80.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Alliant FX computers. - Copyright (C) 1989, 1991, 1997 Free Software Foundation, Inc. + Copyright (C) 1989, 1991, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */ /* Some output-actions in alliant.md need these. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -153,14 +153,14 @@ output_move_double (operands) { operands[0] = XEXP (XEXP (operands[0], 0), 0); output_asm_insn ("subq%.l %#8,%0", operands); - operands[0] = gen_rtx (MEM, DImode, operands[0]); + operands[0] = gen_rtx_MEM (DImode, operands[0]); optype0 = OFFSOP; } if (optype0 == POPOP && optype1 == PUSHOP) { operands[1] = XEXP (XEXP (operands[1], 0), 0); output_asm_insn ("subq%.l %#8,%1", operands); - operands[1] = gen_rtx (MEM, DImode, operands[1]); + operands[1] = gen_rtx_MEM (DImode, operands[1]); optype1 = OFFSOP; } @@ -183,14 +183,14 @@ output_move_double (operands) operands in OPERANDS to be suitable for the low-numbered word. */ if (optype0 == REGOP) - latehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + latehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else if (optype0 == OFFSOP) latehalf[0] = adj_offsettable_operand (operands[0], 4); else latehalf[0] = operands[0]; if (optype1 == REGOP) - latehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + latehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); else if (optype1 == OFFSOP) latehalf[1] = adj_offsettable_operand (operands[1], 4); else if (optype1 == CNSTOP) diff --git a/gcc/config/fx80/fx80.h b/gcc/config/fx80/fx80.h index b69f0b06fb4..c416d5c8765 100644 --- a/gcc/config/fx80/fx80.h +++ b/gcc/config/fx80/fx80.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Alliant FX version. - Copyright (C) 1989, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1989, 93, 94, 95, 96, 1998, 1999 Free Software Foundation, Inc. Adapted from m68k.h by Paul Petersen (petersen@uicsrd.csrd.uiuc.edu) and Joe Weening (weening@gang-of-four.stanford.edu). @@ -453,8 +453,8 @@ extern enum reg_class regno_reg_class[]; #define FUNCTION_VALUE(VALTYPE, FUNC) \ (TREE_CODE (VALTYPE) == REAL_TYPE \ - ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \ - : gen_rtx (REG, TYPE_MODE (VALTYPE), 0)) + ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ + : gen_rtx_REG (TYPE_MODE (VALTYPE), 0)) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ @@ -467,8 +467,8 @@ extern enum reg_class regno_reg_class[]; #define LIBCALL_VALUE(MODE) \ (((MODE) == DFmode || (MODE) == SFmode) \ - ? gen_rtx (REG, MODE, 16) \ - : gen_rtx (REG, MODE, 0)) + ? gen_rtx_REG (MODE, 16) \ + : gen_rtx_REG (MODE, 0)) /* 1 if N is a possible register number for a function value. On the Alliant, D0 and FP0 are the only registers thus used. diff --git a/gcc/config/fx80/fx80.md b/gcc/config/fx80/fx80.md index cec863bfd6f..6fffb163c39 100644 --- a/gcc/config/fx80/fx80.md +++ b/gcc/config/fx80/fx80.md @@ -1,5 +1,5 @@ ;;- Machine description for GNU C compiler for Alliant FX systems -;; Copyright (C) 1989, 1994, 1996 Free Software Foundation, Inc. +;; Copyright (C) 1989, 1994, 1996, 1998, 1999 Free Software Foundation, Inc. ;; Adapted from m68k.md by Paul Petersen (petersen@uicsrd.csrd.uiuc.edu) ;; and Joe Weening (weening@gang-of-four.stanford.edu). @@ -415,8 +415,7 @@ { xoperands[1] = operands[1]; xoperands[2] - = gen_rtx (MEM, QImode, - gen_rtx (PLUS, VOIDmode, stack_pointer_rtx, const1_rtx)); + = gen_rtx_MEM (QImode, plus_constant (stack_pointer_rtx, 1)); xoperands[3] = stack_pointer_rtx; /* Just pushing a byte puts it in the high byte of the halfword. */ /* We must put it in the low half, the second byte. */ @@ -428,8 +427,7 @@ xoperands[0] = operands[0]; xoperands[1] = operands[1]; xoperands[2] - = gen_rtx (MEM, QImode, - gen_rtx (PLUS, VOIDmode, stack_pointer_rtx, const1_rtx)); + = gen_rtx_MEM (QImode, plus_constant (stack_pointer_rtx, 1)); xoperands[3] = stack_pointer_rtx; output_asm_insn (\"mov%.w %1,%-\;mov%.b %2,%0\;addq%.w %#2,%3\", xoperands); return \"\"; @@ -537,7 +535,7 @@ if (REG_P (operands[1])) { rtx xoperands[2]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"mov%.l %1,%-\", xoperands); output_asm_insn (\"mov%.l %1,%-\", operands); return \"fmove%.d %+,%0\"; @@ -549,7 +547,7 @@ if (REG_P (operands[0])) { output_asm_insn (\"fmove%.d %1,%-\;mov%.l %+,%0\", operands); - operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); return \"mov%.l %+,%0\"; } return \"fmove%.d %1,%0\"; @@ -570,7 +568,7 @@ if (REG_P (operands[1])) { rtx xoperands[2]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"mov%.l %1,%-\", xoperands); output_asm_insn (\"mov%.l %1,%-\", operands); return \"fmove%.d %+,%0\"; @@ -582,7 +580,7 @@ if (REG_P (operands[0])) { output_asm_insn (\"fmove%.d %1,%-\;mov%.l %+,%0\", operands); - operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); return \"mov%.l %+,%0\"; } return \"fmove%.d %1,%0\"; @@ -1395,7 +1393,8 @@ operands[1] = GEN_INT (logval); else { - operands[0] = adj_offsettable_operand (operands[0], 3 - (logval / 8)); + operands[0] + = adj_offsettable_operand (operands[0], 3 - (logval / 8)); operands[1] = GEN_INT (logval % 8); } return \"bset %1,%0\"; @@ -1896,10 +1895,8 @@ && GET_CODE (operands[2]) == CONST_INT) { int width = GET_CODE (operands[0]) == REG ? 31 : 7; - return output_btst (operands, - GEN_INT (width - INTVAL (operands[2])), - operands[0], - insn, 1000); + return output_btst (operands, GEN_INT (width - INTVAL (operands[2])), + operands[0], insn, 1000); /* Pass 1000 as SIGNPOS argument so that btst will not think we are testing the sign bit for an `and' and assume that nonzero implies a negative result. */ @@ -1922,10 +1919,8 @@ && GET_CODE (operands[2]) == CONST_INT) { int width = GET_CODE (operands[0]) == REG ? 31 : 7; - return output_btst (operands, - GEN_INT (width - INTVAL (operands[2])), - operands[0], - insn, 1000); + return output_btst (operands, GEN_INT (width - INTVAL (operands[2])), + operands[0], insn, 1000); /* Pass 1000 as SIGNPOS argument so that btst will not think we are testing the sign bit for an `and' and assume that nonzero implies a negative result. */ @@ -2292,10 +2287,9 @@ table_elt_addr = memory_address_noforce (HImode, - gen_rtx (PLUS, Pmode, - gen_rtx (MULT, Pmode, index_diff, - GEN_INT (2)), - gen_rtx (LABEL_REF, VOIDmode, operands[3]))); + gen_rtx_PLUS (Pmode, + gen_rtx_MULT (Pmode, index_diff, GEN_INT (2)), + gen_rtx_LABEL_REF (Pmode, operands[3]))); /* Emit the last few insns. */ emit_insn (gen_casesi_2 (gen_reg_rtx (HImode), table_elt_addr, operands[3])); DONE; @@ -2508,7 +2502,7 @@ ; "* ;{ ; rtx xoperands[2]; -; xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); +; xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); ; output_asm_insn (\"mov%.l %1,%@\", xoperands); ; output_asm_insn (\"mov%.l %1,%-\", operands); ; return \"fmove%.d %+,%0\"; diff --git a/gcc/config/gmicro/gmicro.c b/gcc/config/gmicro/gmicro.c index ed60e494bf1..306431cd118 100644 --- a/gcc/config/gmicro/gmicro.c +++ b/gcc/config/gmicro/gmicro.c @@ -1,9 +1,8 @@ /* Subroutines for insn-output.c for the Gmicro. - Ported by Masanobu Yuhara, Fujitsu Laboratories LTD. + Copyright (C) 1990, 1991, 1997, 1998, 1999 Free Software Foundation, Inc. + Contributed by Masanobu Yuhara, Fujitsu Laboratories LTD. (yuhara@flab.fujitsu.co.jp) - Copyright (C) 1990, 1991, 1997 Free Software Foundation, Inc. - This file is part of GNU CC. GNU CC is free software; you can redistribute it and/or modify @@ -24,9 +23,8 @@ 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 "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -498,14 +496,14 @@ output_move_double (operands) { operands[0] = XEXP (XEXP (operands[0], 0), 0); output_asm_insn ("sub.w %#8,%0", operands); - operands[0] = gen_rtx (MEM, DImode, operands[0]); + operands[0] = gen_rtx_MEM (DImode, operands[0]); optype0 = OFFSOP; } if (optype0 == POPOP && optype1 == PUSHOP) { operands[1] = XEXP (XEXP (operands[1], 0), 0); output_asm_insn ("sub.w %#8,%1", operands); - operands[1] = gen_rtx (MEM, DImode, operands[1]); + operands[1] = gen_rtx_MEM (DImode, operands[1]); optype1 = OFFSOP; } @@ -528,14 +526,14 @@ output_move_double (operands) operands in OPERANDS to be suitable for the low-numbered word. */ if (optype0 == REGOP) - latehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + latehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else if (optype0 == OFFSOP) latehalf[0] = adj_offsettable_operand (operands[0], 4); else latehalf[0] = operands[0]; if (optype1 == REGOP) - latehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + latehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); else if (optype1 == OFFSOP) latehalf[1] = adj_offsettable_operand (operands[1], 4); else if (optype1 == CNSTOP) @@ -633,16 +631,14 @@ output_move_const_double (operands) else if (GREG_P (operands[0])) { rtx xoperands[2]; - xoperands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xoperands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); xoperands[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); output_asm_insn ("mov.w %1,%0", xoperands); operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); return "mov.w %1,%0"; } else - { - return output_move_double (operands); /* ?????? */ - } + return output_move_double (operands); /* ?????? */ } char * diff --git a/gcc/config/gmicro/gmicro.h b/gcc/config/gmicro/gmicro.h index b12d6c0231f..529d3cc8fdf 100644 --- a/gcc/config/gmicro/gmicro.h +++ b/gcc/config/gmicro/gmicro.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Gmicro (TRON) version. - Copyright (C) 1987, 88, 89, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 89, 95-98, 1999 Free Software Foundation, Inc. Contributed by Masanobu Yuhara, Fujitsu Laboratories LTD. (yuhara@flab.fujitsu.co.jp) @@ -477,9 +477,10 @@ extern enum reg_class regno_reg_class[]; /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) \ - (gen_rtx (REG, (MODE), \ - ((TARGET_FPU && ((MODE) == SFmode || (MODE) == DFmode)) ? 16 : 0))) +#define LIBCALL_VALUE(MODE) \ + (gen_rtx_REG ((MODE), \ + ((TARGET_FPU && ((MODE) == SFmode || (MODE) == DFmode)) \ + ? 16 : 0))) /* 1 if N is a possible register number for a function value. @@ -546,7 +547,7 @@ extern enum reg_class regno_reg_class[]; It exists only to test register calling conventions. */ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ -((TARGET_REGPARM && (CUM) < 8) ? gen_rtx (REG, (MODE), (CUM) / 4) : 0) +((TARGET_REGPARM && (CUM) < 8) ? gen_rtx_REG ((MODE), (CUM) / 4) : 0) /* For an arg passed partly in registers and partly in memory, this is the number of registers used. @@ -830,25 +831,25 @@ extern enum reg_class regno_reg_class[]; else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx) \ { rtx other_reg = XEXP (ADDR, 1); \ offset = 0; \ - regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \ + regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \ else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx) \ { rtx other_reg = XEXP (ADDR, 0); \ offset = 0; \ - regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \ + regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \ else if (GET_CODE (ADDR) == PLUS \ && GET_CODE (XEXP (ADDR, 0)) == PLUS \ && XEXP (XEXP (ADDR, 0), 0) == frame_pointer_rtx \ && GET_CODE (XEXP (ADDR, 1)) == CONST_INT) \ { rtx other_reg = XEXP (XEXP (ADDR, 0), 1); \ offset = INTVAL (XEXP (ADDR, 1)); \ - regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \ + regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \ else if (GET_CODE (ADDR) == PLUS \ && GET_CODE (XEXP (ADDR, 0)) == PLUS \ && XEXP (XEXP (ADDR, 0), 1) == frame_pointer_rtx \ && GET_CODE (XEXP (ADDR, 1)) == CONST_INT) \ { rtx other_reg = XEXP (XEXP (ADDR, 0), 0); \ offset = INTVAL (XEXP (ADDR, 1)); \ - regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \ + regs = gen_rtx_PLUS (Pmode, stack_pointer_rtx, other_reg); } \ if (offset >= 0) \ { int regno; \ extern char call_used_regs[]; \ diff --git a/gcc/config/gmicro/gmicro.md b/gcc/config/gmicro/gmicro.md index 35384ce044d..631b4b52ebe 100644 --- a/gcc/config/gmicro/gmicro.md +++ b/gcc/config/gmicro/gmicro.md @@ -1,5 +1,5 @@ ;;- Machine description for GNU compiler, Fujitsu Gmicro Version -;; Copyright (C) 1990, 1994, 1996 Free Software Foundation, Inc. +;; Copyright (C) 1990, 1994, 1996, 1998, 1999 Free Software Foundation, Inc. ;; Contributed by M.Yuhara, Fujitsu Laboratories LTD. ;; This file is part of GNU CC. @@ -581,7 +581,7 @@ if (FPU_REG_P (operands[0])) { rtx xoperands[2]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"mov.w %1,%-\", xoperands); output_asm_insn (\"mov.w %1,%-\", operands); return \"fmov.d %+,%0\"; @@ -590,7 +590,7 @@ { output_asm_insn (\"fmov.d %f1,%-\", operands); output_asm_insn (\"mov.w %+,%0\", operands); - operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); return \"mov.w %+,%0\"; } } @@ -616,7 +616,7 @@ if (REG_P (operands[1])) { rtx xoperands[2]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"mov.w %1,%-\", xoperands); output_asm_insn (\"mov.w %1,%-\", operands); return \"fmov.d %+,%0\"; @@ -630,7 +630,7 @@ if (REG_P (operands[0])) { output_asm_insn (\"fmov.d %f1,%-\;mov.w %+,%0\", operands); - operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); return \"mov.w %+,%0\"; } else @@ -1601,7 +1601,8 @@ } else { - operands[0] = adj_offsettable_operand (operands[0], 3 - (logval / 8)); + operands[0] + = adj_offsettable_operand (operands[0], 3 - (logval / 8)); operands[1] = GEN_INT (7 - (logval % 8)); } return \"bset.b %1,%0\"; @@ -1864,7 +1865,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1889,7 +1890,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, HImode, negate_rtx (HImode, operands[2])); + operands[2] = gen_rtx_NEG (HImode, negate_rtx (HImode, operands[2])); }") (define_insn "" @@ -1914,7 +1915,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); + operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); }") (define_insn "" @@ -2270,7 +2271,7 @@ output_asm_insn (\"mov.w %1,%0\", operands); if (INTVAL (operands[3]) != 0) output_asm_insn (\"shl.w %3,%0\", operands); - operands[2] = GEN_INT (-(32 - INTVAL (operands[2]))); + operands[2] = GEN_INT (- (32 - INTVAL (operands[2]))); return \"shl.w %3,%0\"; }") @@ -2730,7 +2731,7 @@ "* { rtx xoperands[2]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"mov.w %1,@sp\", xoperands); output_asm_insn (\"mov.w %1,%-\", operands); return \"fmov.d %+,%0\"; diff --git a/gcc/config/gofast.h b/gcc/config/gofast.h index 84bea516758..26d2327e356 100644 --- a/gcc/config/gofast.h +++ b/gcc/config/gofast.h @@ -1,5 +1,5 @@ /* US Software GOFAST floating point library support. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -44,33 +44,33 @@ Boston, MA 02111-1307, USA. */ } while (0) #define GOFAST_RENAME_LIBCALLS \ - add_optab->handlers[(int) SFmode].libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpadd"); \ - add_optab->handlers[(int) DFmode].libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpadd"); \ - sub_optab->handlers[(int) SFmode].libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpsub"); \ - sub_optab->handlers[(int) DFmode].libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpsub"); \ - smul_optab->handlers[(int) SFmode].libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpmul"); \ - smul_optab->handlers[(int) DFmode].libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpmul"); \ - flodiv_optab->handlers[(int) SFmode].libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpdiv"); \ - flodiv_optab->handlers[(int) DFmode].libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpdiv"); \ - cmp_optab->handlers[(int) SFmode].libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpcmp"); \ - cmp_optab->handlers[(int) DFmode].libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpcmp"); \ + add_optab->handlers[(int) SFmode].libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpadd"); \ + add_optab->handlers[(int) DFmode].libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpadd"); \ + sub_optab->handlers[(int) SFmode].libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpsub"); \ + sub_optab->handlers[(int) DFmode].libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpsub"); \ + smul_optab->handlers[(int) SFmode].libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpmul"); \ + smul_optab->handlers[(int) DFmode].libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpmul"); \ + flodiv_optab->handlers[(int) SFmode].libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpdiv"); \ + flodiv_optab->handlers[(int) DFmode].libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpdiv"); \ + cmp_optab->handlers[(int) SFmode].libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpcmp"); \ + cmp_optab->handlers[(int) DFmode].libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpcmp"); \ \ - extendsfdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "fptodp"); \ - truncdfsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "dptofp"); \ + extendsfdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "fptodp"); \ + truncdfsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "dptofp"); \ \ - eqsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpcmp"); \ - nesf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpcmp"); \ - gtsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpcmp"); \ - gesf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpcmp"); \ - ltsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpcmp"); \ - lesf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "fpcmp"); \ + eqsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpcmp"); \ + nesf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpcmp"); \ + gtsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpcmp"); \ + gesf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpcmp"); \ + ltsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpcmp"); \ + lesf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "fpcmp"); \ \ - eqdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpcmp"); \ - nedf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpcmp"); \ - gtdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpcmp"); \ - gedf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpcmp"); \ - ltdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpcmp"); \ - ledf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "dpcmp"); \ + eqdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpcmp"); \ + nedf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpcmp"); \ + gtdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpcmp"); \ + gedf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpcmp"); \ + ltdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpcmp"); \ + ledf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "dpcmp"); \ \ eqxf2_libfunc = NULL_RTX; \ nexf2_libfunc = NULL_RTX; \ diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 4fac366f71d..aa58157284c 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -22,7 +22,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "tree.h" #include "regs.h" @@ -41,7 +41,6 @@ Boston, MA 02111-1307, USA. */ /* Forward declarations. */ void print_operand_address (); -char *index (); static int h8300_interrupt_function_p PROTO ((tree)); static int h8300_monitor_function_p PROTO ((tree)); @@ -954,16 +953,16 @@ function_arg (cum, mode, type, named) switch (cum->nbytes / UNITS_PER_WORD) { case 0: - result = gen_rtx (REG, mode, 0); + result = gen_rtx_REG (mode, 0); break; case 1: - result = gen_rtx (REG, mode, 1); + result = gen_rtx_REG (mode, 1); break; case 2: - result = gen_rtx (REG, mode, 2); + result = gen_rtx_REG (mode, 2); break; case 3: - result = gen_rtx (REG, mode, 3); + result = gen_rtx_REG (mode, 3); break; default: result = 0; @@ -1858,12 +1857,14 @@ expand_a_shift (mode, code, operands) /* need a loop to get all the bits we want - we generate the code at emit time, but need to allocate a scratch reg now */ - emit_insn (gen_rtx - (PARALLEL, VOIDmode, + emit_insn (gen_rtx_PARALLEL + (VOIDmode, gen_rtvec (2, - gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (code, mode, operands[0], operands[2])), - gen_rtx (CLOBBER, VOIDmode, gen_rtx (SCRATCH, QImode, 0))))); + gen_rtx_SET (VOIDmode, operands[0], + gen_rtx (code, mode, operands[0], + operands[2])), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (QImode))))); return 1; } @@ -2791,9 +2792,9 @@ fix_bit_operand (operands, what, type) /* Ok to have a memory dest. */ if (GET_CODE (operands[0]) == MEM && !EXTRA_CONSTRAINT (operands[0], 'U')) { - rtx mem; - mem = gen_rtx (MEM, GET_MODE (operands[0]), - copy_to_mode_reg (Pmode, XEXP (operands[0], 0))); + rtx mem = gen_rtx_MEM (GET_MODE (operands[0]), + copy_to_mode_reg (Pmode, + XEXP (operands[0], 0))); RTX_UNCHANGING_P (mem) = RTX_UNCHANGING_P (operands[0]); MEM_COPY_ATTRIBUTES (mem, operands[0]); operands[0] = mem; @@ -2801,9 +2802,9 @@ fix_bit_operand (operands, what, type) if (GET_CODE (operands[1]) == MEM && !EXTRA_CONSTRAINT (operands[1], 'U')) { - rtx mem; - mem = gen_rtx (MEM, GET_MODE (operands[1]), - copy_to_mode_reg (Pmode, XEXP (operands[1], 0))); + rtx mem = gen_rtx_MEM (GET_MODE (operands[1]), + copy_to_mode_reg (Pmode, + XEXP (operands[1], 0))); RTX_UNCHANGING_P (mem) = RTX_UNCHANGING_P (operands[1]); MEM_COPY_ATTRIBUTES (mem, operands[0]); operands[1] = mem; @@ -2817,8 +2818,9 @@ fix_bit_operand (operands, what, type) operands[1] = force_reg (QImode, operands[1]); { rtx res = gen_reg_rtx (QImode); - emit_insn (gen_rtx (SET, VOIDmode, res, gen_rtx (type, QImode, operands[1], operands[2]))); - emit_insn (gen_rtx (SET, VOIDmode, operands[0], res)); + emit_insn (gen_rtx_SET (VOIDmode, res, + gen_rtx (type, QImode, operands[1], operands[2]))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], res)); } return 1; } diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 4ee440ac58d..9e8b68232f2 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -526,7 +526,7 @@ enum reg_class { On the H8 the return value is in R0/R1. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), 0) + gen_rtx_REG (TYPE_MODE (VALTYPE), 0) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ @@ -534,7 +534,7 @@ enum reg_class { /* On the h8 the return value is in R0/R1 */ #define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, MODE, 0) + gen_rtx_REG (MODE, 0) /* 1 if N is a possible register number for a function value. On the H8, R0 is the only register thus used. */ @@ -713,10 +713,11 @@ struct rtx_def *function_arg(); #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ enum machine_mode mode = TARGET_H8300H || TARGET_H8300S? SImode : HImode; \ - emit_move_insn (gen_rtx (MEM, mode, plus_constant ((TRAMP), 2)), CXT); \ - emit_move_insn (gen_rtx (MEM, mode, plus_constant ((TRAMP), 6)), FNADDR); \ - if (TARGET_H8300H || TARGET_H8300S) \ - emit_move_insn (gen_rtx (MEM, QImode, plus_constant ((TRAMP), 6)), GEN_INT (0x5A)); \ + emit_move_insn (gen_rtx_MEM (mode, plus_constant ((TRAMP), 2)), CXT); \ + emit_move_insn (gen_rtx_MEM (mode, plus_constant ((TRAMP), 6)), FNADDR); \ + if (TARGET_H8300H || TARGET_H8300S) \ + emit_move_insn (gen_rtx_MEM (QImode, plus_constant ((TRAMP), 6)), \ + GEN_INT (0x5A)); \ } /* Addressing modes, and classification of registers for them. */ @@ -1387,15 +1388,15 @@ extern int handle_pragma (); #define INIT_TARGET_OPTABS \ do { \ smul_optab->handlers[(int) HImode].libfunc \ - = gen_rtx (SYMBOL_REF, Pmode, MULHI3_LIBCALL); \ + = gen_rtx_SYMBOL_REF (Pmode, MULHI3_LIBCALL); \ sdiv_optab->handlers[(int) HImode].libfunc \ - = gen_rtx (SYMBOL_REF, Pmode, DIVHI3_LIBCALL); \ + = gen_rtx_SYMBOL_REF (Pmode, DIVHI3_LIBCALL); \ udiv_optab->handlers[(int) HImode].libfunc \ - = gen_rtx (SYMBOL_REF, Pmode, UDIVHI3_LIBCALL); \ + = gen_rtx_SYMBOL_REF (Pmode, UDIVHI3_LIBCALL); \ smod_optab->handlers[(int) HImode].libfunc \ - = gen_rtx (SYMBOL_REF, Pmode, MODHI3_LIBCALL); \ + = gen_rtx_SYMBOL_REF (Pmode, MODHI3_LIBCALL); \ umod_optab->handlers[(int) HImode].libfunc \ - = gen_rtx (SYMBOL_REF, Pmode, UMODHI3_LIBCALL); \ + = gen_rtx_SYMBOL_REF (Pmode, UMODHI3_LIBCALL); \ } while (0) #define MOVE_RATIO 3 diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c index 5c0e5760f40..d9954e3137e 100644 --- a/gcc/config/i370/i370.c +++ b/gcc/config/i370/i370.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for System/370. - Copyright (C) 1989, 1993, 1995, 1997 Free Software Foundation, Inc. + Copyright (C) 1989, 93, 95, 97, 98, 1999 Free Software Foundation, Inc. Contributed by Jan Stein (jan@cd.chalmers.se). Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com) Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org) @@ -22,12 +22,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> +#include "system.h" #include "rtl.h" #include "tree.h" #include "regs.h" @@ -41,7 +36,6 @@ Boston, MA 02111-1307, USA. */ #include "function.h" #include "flags.h" #include "recog.h" -#include <time.h> extern FILE *asm_out_file; diff --git a/gcc/config/i370/i370.h b/gcc/config/i370/i370.h index dcacc4202be..1e32e0102e4 100644 --- a/gcc/config/i370/i370.h +++ b/gcc/config/i370/i370.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. System/370 version. - Copyright (C) 1989, 1993, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1989, 93, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc. Contributed by Jan Stein (jan@cd.chalmers.se). Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com) Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org) @@ -545,7 +545,7 @@ enum reg_class (((MODE) == DCmode || (MODE) == SCmode || (MODE) == TFmode || (MODE) == DFmode || (MODE) == SFmode) ? 16 : 15) #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx(REG, TYPE_MODE (VALTYPE), RET_REG(TYPE_MODE(VALTYPE))) + gen_rtx_REG (TYPE_MODE (VALTYPE), RET_REG (TYPE_MODE (VALTYPE))) #define RETURN_IN_MEMORY(VALTYPE) \ ((DImode == TYPE_MODE (VALTYPE)) || (BLKmode == TYPE_MODE (VALTYPE))) @@ -553,7 +553,7 @@ enum reg_class /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx(REG, MODE, RET_REG(MODE)) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, RET_REG (MODE)) /* 1 if N is a possible register number for a function value. On the 370 under C/370, R15 and R16 are thus used. */ @@ -585,13 +585,12 @@ enum reg_class #define TRAMPOLINE_TEMPLATE(FILE) \ { \ - ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x05E0)); \ - ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x5800 | \ - STATIC_CHAIN_REGNUM << 4)); \ - ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0xE00A)); \ - ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x58F0)); \ - ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0xE00E)); \ - ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x07FF)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x05E0)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x5800 | STATIC_CHAIN_REGNUM << 4)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0xE00A)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x58F0)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0xE00E)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x07FF)); \ ASM_OUTPUT_SHORT (FILE, const0_rtx); \ ASM_OUTPUT_SHORT (FILE, const0_rtx); \ ASM_OUTPUT_SHORT (FILE, const0_rtx); \ @@ -606,8 +605,8 @@ enum reg_class #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 12)), CXT); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 16)), FNADDR); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 12)), CXT); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 16)), FNADDR); \ } /* Define EXIT_IGNORE_STACK if, when returning from a function, the stack @@ -792,17 +791,17 @@ enum reg_class #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ { \ if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ - copy_to_mode_reg (SImode, XEXP (X, 1))); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ + copy_to_mode_reg (SImode, XEXP (X, 1))); \ if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0))) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \ - copy_to_mode_reg (SImode, XEXP (X, 0))); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ + copy_to_mode_reg (SImode, XEXP (X, 0))); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \ - force_operand (XEXP (X, 0), 0)); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ + force_operand (XEXP (X, 0), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ - force_operand (XEXP (X, 1), 0)); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ + force_operand (XEXP (X, 1), 0)); \ if (memory_address_p (MODE, X)) \ goto WIN; \ } diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 4c1460cc9bf..f08812bbc3b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1441,11 +1441,11 @@ static rtx gen_push (arg) rtx arg; { - return gen_rtx (SET, VOIDmode, - gen_rtx_MEM (SImode, - gen_rtx (PRE_DEC, SImode, - stack_pointer_rtx)), - arg); + return gen_rtx_SET (VOIDmode, + gen_rtx_MEM (SImode, + gen_rtx_PRE_DEC (SImode, + stack_pointer_rtx)), + arg); } /* Compute the size of local storage taking into consideration the @@ -2239,9 +2239,9 @@ legitimize_address (x, oldx, mode) && (log = (unsigned)exact_log2 (INTVAL (XEXP (XEXP (x, 0), 1)))) < 4) { changed = 1; - XEXP (x, 0) = gen_rtx (MULT, Pmode, - force_reg (Pmode, XEXP (XEXP (x, 0), 0)), - GEN_INT (1 << log)); + XEXP (x, 0) = gen_rtx_MULT (Pmode, + force_reg (Pmode, XEXP (XEXP (x, 0), 0)), + GEN_INT (1 << log)); } if (GET_CODE (XEXP (x, 1)) == ASHIFT @@ -2249,9 +2249,9 @@ legitimize_address (x, oldx, mode) && (log = (unsigned)exact_log2 (INTVAL (XEXP (XEXP (x, 1), 1)))) < 4) { changed = 1; - XEXP (x, 1) = gen_rtx (MULT, Pmode, - force_reg (Pmode, XEXP (XEXP (x, 1), 0)), - GEN_INT (1 << log)); + XEXP (x, 1) = gen_rtx_MULT (Pmode, + force_reg (Pmode, XEXP (XEXP (x, 1), 0)), + GEN_INT (1 << log)); } /* Put multiply first if it isn't already. */ @@ -2270,10 +2270,10 @@ legitimize_address (x, oldx, mode) if (GET_CODE (XEXP (x, 0)) == MULT && GET_CODE (XEXP (x, 1)) == PLUS) { changed = 1; - x = gen_rtx (PLUS, Pmode, - gen_rtx (PLUS, Pmode, XEXP (x, 0), - XEXP (XEXP (x, 1), 0)), - XEXP (XEXP (x, 1), 1)); + x = gen_rtx_PLUS (Pmode, + gen_rtx_PLUS (Pmode, XEXP (x, 0), + XEXP (XEXP (x, 1), 0)), + XEXP (XEXP (x, 1), 1)); } /* Canonicalize @@ -2303,10 +2303,10 @@ legitimize_address (x, oldx, mode) if (constant) { changed = 1; - x = gen_rtx (PLUS, Pmode, - gen_rtx (PLUS, Pmode, XEXP (XEXP (x, 0), 0), - XEXP (XEXP (XEXP (x, 0), 1), 0)), - plus_constant (other, INTVAL (constant))); + x = gen_rtx_PLUS (Pmode, + gen_rtx_PLUS (Pmode, XEXP (XEXP (x, 0), 0), + XEXP (XEXP (XEXP (x, 0), 1), 0)), + plus_constant (other, INTVAL (constant))); } } diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 9411948c46e..eebd336d80b 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1103,7 +1103,7 @@ enum reg_class otherwise, FUNC is 0. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx_REG (TYPE_MODE (VALTYPE), \ - VALUE_REGNO (TYPE_MODE (VALTYPE))) + VALUE_REGNO (TYPE_MODE (VALTYPE))) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ @@ -2168,12 +2168,12 @@ number as al, and ax. /* Before the prologue, RA is at 0(%esp). */ #define INCOMING_RETURN_ADDR_RTX \ gen_rtx_MEM (VOIDmode, gen_rtx_REG (VOIDmode, STACK_POINTER_REGNUM)) - + /* After the prologue, RA is at -4(AP) in the current frame. */ #define RETURN_ADDR_RTX(COUNT, FRAME) \ ((COUNT) == 0 \ - ? gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, arg_pointer_rtx, GEN_INT(-4)))\ - : gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, (FRAME), GEN_INT(4)))) + ? gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -4))\ + : gen_rtx_MEM (Pmode, plus_constant (FRAME, 4))) /* PC is dbx register 8; let's use that column for RA. */ #define DWARF_FRAME_RETURN_COLUMN 8 diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h index 552cbcd1932..5ec2448593c 100644 --- a/gcc/config/i386/mingw32.h +++ b/gcc/config/i386/mingw32.h @@ -70,14 +70,6 @@ do { \ char c; \ \ putc ('\"', asm_file); \ - if (STRING[1] == ':' \ - && (STRING[2] == '/' || STRING[2] == '\\')) \ - { \ - putc ('/', asm_file); \ - putc ('/', asm_file); \ - putc (*string, asm_file); \ - string += 2; \ - } \ \ while ((c = *string++) != 0) \ { \ diff --git a/gcc/config/i386/osfrose.h b/gcc/config/i386/osfrose.h index 9ad9f952d57..f75fe1f46c0 100644 --- a/gcc/config/i386/osfrose.h +++ b/gcc/config/i386/osfrose.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Intel 386 (OSF/1 with OSF/rose) version. - Copyright (C) 1991, 1992, 1993, 1996, 1999 Free Software Foundation, Inc. + Copyright (C) 1991, 92, 93, 96, 98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -217,8 +217,8 @@ do \ rtx symref; \ \ HALF_PIC_EXTERNAL ("_mcount_ptr"); \ - symref = HALF_PIC_PTR (gen_rtx (SYMBOL_REF, Pmode, \ - "_mcount_ptr")); \ + symref = HALF_PIC_PTR (gen_rtx_SYMBOL_REF (Pmode, \ + "_mcount_ptr")); \ \ fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \ fprintf (FILE, "\tmovl %s%s,%%eax\n", prefix, \ @@ -290,7 +290,7 @@ do \ rtx symdef; \ \ HALF_PIC_EXTERNAL ("mcount"); \ - symdef = HALF_PIC_PTR (gen_rtx (SYMBOL_REF, Pmode, "mcount")); \ + symdef = HALF_PIC_PTR (gen_rtx_SYMBOL_REF (Pmode, "mcount")); \ fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \ fprintf (FILE, "\tcall *%s%s\n", prefix, XSTR (symdef, 0)); \ } \ diff --git a/gcc/config/i386/win-nt.h b/gcc/config/i386/win-nt.h index 97f10c39d00..262c3afee27 100644 --- a/gcc/config/i386/win-nt.h +++ b/gcc/config/i386/win-nt.h @@ -1,6 +1,6 @@ /* Operating system specific defines to be used when targeting GCC for Windows NT 3.x on an i386. - Copyright (C) 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1998, 1999 Free Software Foundation, Inc. Contributed by Douglas B. Rupp (drupp@cs.washington.edu). This file is part of GNU CC. @@ -118,7 +118,7 @@ do \ if (lookup_attribute ("stdcall", \ TYPE_ATTRIBUTES (TREE_TYPE (DECL)))) \ XEXP (DECL_RTL (DECL), 0) = \ - gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (DECL)); \ + gen_rtx_SYMBOL_REF (Pmode, gen_stdcall_suffix (DECL)); \ } \ while (0) #endif diff --git a/gcc/config/i860/i860.c b/gcc/config/i860/i860.c index 966c5724b20..d55e912f2e0 100644 --- a/gcc/config/i860/i860.c +++ b/gcc/config/i860/i860.c @@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "flags.h" #include "rtl.h" #include "tree.h" @@ -522,7 +522,7 @@ singlemove_string (operands) rtx xoperands[2]; cc_status.flags &= ~CC_F0_IS_0; - xoperands[0] = gen_rtx (REG, SFmode, 32); + xoperands[0] = gen_rtx_REG (SFmode, 32); xoperands[1] = operands[1]; output_asm_insn (singlemove_string (xoperands), xoperands); xoperands[1] = xoperands[0]; @@ -627,14 +627,14 @@ output_move_double (operands) operands in OPERANDS to be suitable for the low-numbered word. */ if (optype0 == REGOP) - latehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + latehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else if (optype0 == OFFSOP) latehalf[0] = adj_offsettable_operand (operands[0], 4); else latehalf[0] = operands[0]; if (optype1 == REGOP) - latehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + latehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); else if (optype1 == OFFSOP) latehalf[1] = adj_offsettable_operand (operands[1], 4); else if (optype1 == CNSTOP) @@ -693,7 +693,7 @@ output_move_double (operands) xops[0] = latehalf[0]; xops[1] = operands[0]; output_asm_insn ("adds %1,%0,%1", xops); - operands[1] = gen_rtx (MEM, DImode, operands[0]); + operands[1] = gen_rtx_MEM (DImode, operands[0]); latehalf[1] = adj_offsettable_operand (operands[1], 4); addreg1 = 0; highest_first = 1; @@ -747,7 +747,7 @@ output_fp_move_double (operands) /* If the source operand is any sort of zero, use f0 instead. */ if (operands[1] == CONST0_RTX (GET_MODE (operands[1]))) - operands[1] = gen_rtx (REG, DFmode, F0_REGNUM); + operands[1] = gen_rtx_REG (DFmode, F0_REGNUM); if (FP_REG_P (operands[0])) { @@ -756,8 +756,8 @@ output_fp_move_double (operands) if (GET_CODE (operands[1]) == REG) { output_asm_insn ("ixfr %1,%0", operands); - operands[0] = gen_rtx (REG, VOIDmode, REGNO (operands[0]) + 1); - operands[1] = gen_rtx (REG, VOIDmode, REGNO (operands[1]) + 1); + operands[0] = gen_rtx_REG (VOIDmode, REGNO (operands[0]) + 1); + operands[1] = gen_rtx_REG (VOIDmode, REGNO (operands[1]) + 1); return "ixfr %1,%0"; } if (operands[1] == CONST0_RTX (DFmode)) @@ -782,8 +782,8 @@ output_fp_move_double (operands) if (GET_CODE (operands[0]) == REG) { output_asm_insn ("fxfr %1,%0", operands); - operands[0] = gen_rtx (REG, VOIDmode, REGNO (operands[0]) + 1); - operands[1] = gen_rtx (REG, VOIDmode, REGNO (operands[1]) + 1); + operands[0] = gen_rtx_REG (VOIDmode, REGNO (operands[0]) + 1); + operands[1] = gen_rtx_REG (VOIDmode, REGNO (operands[1]) + 1); return "fxfr %1,%0"; } if (CONSTANT_ADDRESS_P (XEXP (operands[0], 0))) @@ -1116,8 +1116,7 @@ output_size_for_block_move (size, reg, align) output_asm_insn ("sub %2,%1,%0", xoperands); else { - xoperands[1] - = GEN_INT (INTVAL (size) - INTVAL (align)); + xoperands[1] = GEN_INT (INTVAL (size) - INTVAL (align)); cc_status.flags &= ~ CC_KNOW_HI_R31; output_asm_insn ("mov %1,%0", xoperands); } @@ -1432,8 +1431,8 @@ output_delayed_branch (template, operands, insn) else { int insn_code_number; - rtx pat = gen_rtx (SET, VOIDmode, dest, src); - rtx delay_insn = gen_rtx (INSN, VOIDmode, 0, 0, 0, pat, -1, 0, 0); + rtx pat = gen_rtx_SET (VOIDmode, dest, src); + rtx delay_insn = gen_rtx_INSN (VOIDmode, 0, 0, 0, pat, -1, 0, 0); int i; /* Output the branch instruction first. */ diff --git a/gcc/config/i860/i860.h b/gcc/config/i860/i860.h index a95eccfc842..107849d63cd 100644 --- a/gcc/config/i860/i860.h +++ b/gcc/config/i860/i860.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for Intel 860. - Copyright (C) 1989, 91, 93, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1989, 91, 93, 95-98, 1999 Free Software Foundation, Inc. Hacked substantially by Ron Guilmette (rfg@monkeys.com) to cater to the whims of the System V Release 4 assembler. @@ -428,17 +428,17 @@ enum reg_class { NO_REGS, GENERAL_REGS, FP_REGS, ALL_REGS, LIM_REG_CLASSES }; /* On the i860, the value register depends on the mode. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), \ - (GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_FLOAT \ - ? 40 : 16)) + gen_rtx_REG (TYPE_MODE (VALTYPE), \ + (GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_FLOAT \ + ? 40 : 16)) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ #define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, MODE, \ - (GET_MODE_CLASS ((MODE)) == MODE_FLOAT \ - ? 40 : 16)) + gen_rtx_REG (MODE, \ + (GET_MODE_CLASS ((MODE)) == MODE_FLOAT \ + ? 40 : 16)) /* 1 if N is a possible register number for a function value as seen by the caller. */ @@ -523,17 +523,17 @@ struct cumulative_args { int ints, floats; }; ? 0 \ : GET_MODE_CLASS ((MODE)) == MODE_FLOAT || (MODE) == DImode \ ? (ROUNDUP ((CUM).floats, GET_MODE_SIZE ((MODE))) < 32 \ - ? gen_rtx (REG, (MODE), \ - 40+(ROUNDUP ((CUM).floats, \ - GET_MODE_SIZE ((MODE))) \ - / 4)) \ + ? gen_rtx_REG ((MODE), \ + 40 + (ROUNDUP ((CUM).floats, \ + GET_MODE_SIZE ((MODE))) \ + / 4)) \ : 0) \ : GET_MODE_CLASS ((MODE)) == MODE_INT \ ? (ROUNDUP ((CUM).ints, GET_MODE_SIZE ((MODE))) < 48 \ - ? gen_rtx (REG, (MODE), \ - 16+(ROUNDUP ((CUM).ints, \ - GET_MODE_SIZE ((MODE))) \ - / 4)) \ + ? gen_rtx_REG ((MODE), \ + 16 + (ROUNDUP ((CUM).ints, \ + GET_MODE_SIZE ((MODE))) \ + / 4)) \ : 0) \ : 0) @@ -660,13 +660,13 @@ struct cumulative_args { int ints, floats; }; size_int (16), 0, 0); \ rtx hi_fn = expand_shift (RSHIFT_EXPR, SImode, fn, \ size_int (16), 0, 0); \ - emit_move_insn (gen_rtx (MEM, HImode, plus_constant (TRAMP, 16)), \ + emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 16)), \ gen_lowpart (HImode, cxt)); \ - emit_move_insn (gen_rtx (MEM, HImode, plus_constant (TRAMP, 4)), \ + emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 4)), \ gen_lowpart (HImode, fn)); \ - emit_move_insn (gen_rtx (MEM, HImode, plus_constant (TRAMP, 8)), \ + emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 8)), \ gen_lowpart (HImode, hi_cxt)); \ - emit_move_insn (gen_rtx (MEM, HImode, plus_constant (TRAMP, 0)), \ + emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 0)), \ gen_lowpart (HImode, hi_fn)); \ } @@ -819,25 +819,25 @@ struct cumulative_args { int ints, floats; }; #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ { if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \ - force_operand (XEXP (X, 0), 0)); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ + force_operand (XEXP (X, 0), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ - force_operand (XEXP (X, 1), 0)); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ + force_operand (XEXP (X, 1), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == PLUS) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \ - force_operand (XEXP (X, 0), 0)); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ + force_operand (XEXP (X, 0), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == PLUS) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ - force_operand (XEXP (X, 1), 0)); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ + force_operand (XEXP (X, 1), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) != REG \ && GET_CODE (XEXP (X, 0)) != CONST_INT) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \ - copy_to_mode_reg (SImode, XEXP (X, 0))); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ + copy_to_mode_reg (SImode, XEXP (X, 0))); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) != REG \ && GET_CODE (XEXP (X, 1)) != CONST_INT) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ - copy_to_mode_reg (SImode, XEXP (X, 1))); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ + copy_to_mode_reg (SImode, XEXP (X, 1))); \ if (GET_CODE (x) == SYMBOL_REF) \ (X) = copy_to_reg (X); \ if (GET_CODE (x) == CONST) \ diff --git a/gcc/config/i860/i860.md b/gcc/config/i860/i860.md index 3b1fc32822c..59b0b6d144e 100644 --- a/gcc/config/i860/i860.md +++ b/gcc/config/i860/i860.md @@ -1,5 +1,5 @@ ;;- Machine description for Intel 860 chip for GNU C compiler -;; Copyright (C) 1989, 1990, 1997 Free Software Foundation, Inc. +;; Copyright (C) 1989, 1990, 1997, 1998, 1999 Free Software Foundation, Inc. ;; This file is part of GNU CC. @@ -1527,7 +1527,7 @@ "* { CC_STATUS_PARTIAL_INIT; - operands[2] = GEN_INT ((INTVAL (operands[2]) << INTVAL (operands[1]))); + operands[2] = GEN_INT (INTVAL (operands[2]) << INTVAL (operands[1])); return \"and %2,%0,%?r0\"; }") @@ -1542,7 +1542,7 @@ "* { CC_STATUS_PARTIAL_INIT; - operands[2] = GEN_INT ((INTVAL (operands[2]) << INTVAL (operands[1]))); + operands[2] = GEN_INT (INTVAL (operands[2]) << INTVAL (operands[1])); return \"and %2,%0,%?r0\"; }") @@ -1766,14 +1766,15 @@ return \"and %2,%1,%0\"; if ((INTVAL (operands[2]) & 0xffff) == 0) { - operands[2] = GEN_INT ((unsigned) INTVAL (operands[2]) >> 16); + operands[2] + = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) >> 16); return \"andh %2,%1,%0\"; } xop[0] = operands[0]; xop[1] = operands[1]; xop[2] = GEN_INT (~INTVAL (operands[2]) & 0xffff); output_asm_insn (\"andnot %2,%1,%0\", xop); - operands[2] = GEN_INT (~(unsigned) INTVAL (operands[2]) >> 16); + operands[2] = GEN_INT (~(unsigned HOST_WIDE_INT) INTVAL (operands[2]) >> 16); return \"andnoth %2,%0,%0\"; }") @@ -1791,14 +1792,15 @@ return \"andnot %1,%2,%0\"; if ((INTVAL (operands[1]) & 0xffff) == 0) { - operands[1] = GEN_INT ((unsigned) INTVAL (operands[1]) >> 16); + operands[1] + = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (operands[1]) >> 16); return \"andnoth %1,%2,%0\"; } xop[0] = operands[0]; - xop[1] = GEN_INT ((INTVAL (operands[1]) & 0xffff)); + xop[1] = GEN_INT (INTVAL (operands[1]) & 0xffff); xop[2] = operands[2]; output_asm_insn (\"andnot %1,%2,%0\", xop); - operands[1] = GEN_INT ((unsigned) INTVAL (operands[1]) >> 16); + operands[1] = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (operands[1]) >> 16); return \"andnoth %1,%0,%0\"; }") @@ -1816,14 +1818,15 @@ return \"or %2,%1,%0\"; if ((INTVAL (operands[2]) & 0xffff) == 0) { - operands[2] = GEN_INT ((unsigned) INTVAL (operands[2]) >> 16); + operands[2] + = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) >> 16); return \"orh %2,%1,%0\"; } xop[0] = operands[0]; xop[1] = operands[1]; - xop[2] = GEN_INT ((INTVAL (operands[2]) & 0xffff)); + xop[2] = GEN_INT (INTVAL (operands[2]) & 0xffff); output_asm_insn (\"or %2,%1,%0\", xop); - operands[2] = GEN_INT ((unsigned) INTVAL (operands[2]) >> 16); + operands[2] = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) >> 16); return \"orh %2,%0,%0\"; }") @@ -1841,14 +1844,15 @@ return \"xor %2,%1,%0\"; if ((INTVAL (operands[2]) & 0xffff) == 0) { - operands[2] = GEN_INT ((unsigned) INTVAL (operands[2]) >> 16); + operands[2] + = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) >> 16); return \"xorh %2,%1,%0\"; } xop[0] = operands[0]; xop[1] = operands[1]; - xop[2] = GEN_INT ((INTVAL (operands[2]) & 0xffff)); + xop[2] = GEN_INT (INTVAL (operands[2]) & 0xffff); output_asm_insn (\"xor %2,%1,%0\", xop); - operands[2] = GEN_INT ((unsigned) INTVAL (operands[2]) >> 16); + operands[2] = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) >> 16); return \"xorh %2,%0,%0\"; }") @@ -2121,7 +2125,7 @@ fmul.ss %1,%0,%4\;fmul.ss %3,%4,%0\"; if (INTVAL (operands[1]) > 0) { emit_move_insn (arg_pointer_rtx, stack_pointer_rtx); - emit_insn (gen_rtx (USE, VOIDmode, arg_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, arg_pointer_rtx)); } }") @@ -2189,7 +2193,7 @@ fmul.ss %1,%0,%4\;fmul.ss %3,%4,%0\"; if (INTVAL (operands[2]) > 0) { emit_move_insn (arg_pointer_rtx, stack_pointer_rtx); - emit_insn (gen_rtx (USE, VOIDmode, arg_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, arg_pointer_rtx)); } }") diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c index 7a661e60e01..fa98ad4c4d0 100644 --- a/gcc/config/i960/i960.c +++ b/gcc/config/i960/i960.c @@ -23,7 +23,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -507,9 +507,9 @@ gen_compare_reg (code, x, y) y = force_reg (SImode, y); } - cc_reg = gen_rtx (REG, ccmode, 36); - emit_insn (gen_rtx (SET, VOIDmode, cc_reg, - gen_rtx (COMPARE, ccmode, x, y))); + cc_reg = gen_rtx_REG (ccmode, 36); + emit_insn (gen_rtx_SET (VOIDmode, cc_reg, + gen_rtx_COMPARE (ccmode, x, y))); return cc_reg; } @@ -608,12 +608,12 @@ emit_move_sequence (operands, mode) && REGNO (operands[1]) < FIRST_PSEUDO_REGISTER && ! HARD_REGNO_MODE_OK (REGNO (operands[1]), mode)) { - emit_insn (gen_rtx (PARALLEL, VOIDmode, - gen_rtvec (2, - gen_rtx (SET, VOIDmode, - operands[0], operands[1]), - gen_rtx (CLOBBER, VOIDmode, - gen_rtx (SCRATCH, Pmode))))); + emit_insn (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (2, + gen_rtx_SET (VOIDmode, operands[0], operands[1]), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (Pmode))))); return 1; } @@ -664,8 +664,8 @@ i960_output_move_double (dst, src) edge conditions. */ operands[0] = dst; operands[1] = src; - operands[2] = gen_rtx (REG, Pmode, REGNO (dst) + 1); - operands[3] = gen_rtx (MEM, word_mode, operands[2]); + operands[2] = gen_rtx_REG (Pmode, REGNO (dst) + 1); + operands[3] = gen_rtx_MEM (word_mode, operands[2]); operands[4] = adj_offsettable_operand (operands[3], UNITS_PER_WORD); output_asm_insn ("lda %1,%2\n\tld %3,%0\n\tld %4,%D0", operands); return ""; @@ -754,8 +754,8 @@ i960_output_move_quad (dst, src) edge conditions. */ operands[0] = dst; operands[1] = src; - operands[2] = gen_rtx (REG, Pmode, REGNO (dst) + 3); - operands[3] = gen_rtx (MEM, word_mode, operands[2]); + operands[2] = gen_rtx_REG (Pmode, REGNO (dst) + 3); + operands[3] = gen_rtx_MEM (word_mode, operands[2]); operands[4] = adj_offsettable_operand (operands[3], UNITS_PER_WORD); operands[5] = adj_offsettable_operand (operands[4], UNITS_PER_WORD); operands[6] = adj_offsettable_operand (operands[5], UNITS_PER_WORD); @@ -844,7 +844,7 @@ i960_output_ldconst (dst, src) for (i = 0; i < 3; i++) { - operands[0] = gen_rtx (REG, SImode, REGNO (dst) + i); + operands[0] = gen_rtx_REG (SImode, REGNO (dst) + i); operands[1] = GEN_INT (value_long[i]); output_asm_insn (i960_output_ldconst (operands[0], operands[1]), operands); @@ -863,11 +863,11 @@ i960_output_ldconst (dst, src) output_asm_insn ("# ldconst %1,%0",operands); - operands[0] = gen_rtx (REG, SImode, REGNO (dst)); + operands[0] = gen_rtx_REG (SImode, REGNO (dst)); operands[1] = first; output_asm_insn (i960_output_ldconst (operands[0], operands[1]), operands); - operands[0] = gen_rtx (REG, SImode, REGNO (dst) + 1); + operands[0] = gen_rtx_REG (SImode, REGNO (dst) + 1); operands[1] = second; output_asm_insn (i960_output_ldconst (operands[0], operands[1]), operands); @@ -882,7 +882,7 @@ i960_output_ldconst (dst, src) REAL_VALUE_TO_TARGET_SINGLE (d, value); output_asm_insn ("# ldconst %1,%0",operands); - operands[0] = gen_rtx (REG, SImode, REGNO (dst)); + operands[0] = gen_rtx_REG (SImode, REGNO (dst)); operands[1] = GEN_INT (value); output_asm_insn (i960_output_ldconst (operands[0], operands[1]), operands); @@ -918,7 +918,7 @@ i960_output_ldconst (dst, src) return "movl %1,%0"; /* Output the upper half with a recursive call. */ - xoperands[0] = gen_rtx (REG, SImode, REGNO (dst) + 1); + xoperands[0] = gen_rtx_REG (SImode, REGNO (dst) + 1); xoperands[1] = upperhalf; output_asm_insn (i960_output_ldconst (xoperands[0], xoperands[1]), xoperands); @@ -2144,9 +2144,9 @@ legitimize_address (x, oldx, mode) similar optimizations. */ if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == MULT && GET_CODE (XEXP (x, 1)) == PLUS) - x = gen_rtx (PLUS, Pmode, - gen_rtx (PLUS, Pmode, XEXP (x, 0), XEXP (XEXP (x, 1), 0)), - XEXP (XEXP (x, 1), 1)); + x = gen_rtx_PLUS (Pmode, + gen_rtx_PLUS (Pmode, XEXP (x, 0), XEXP (XEXP (x, 1), 0)), + XEXP (XEXP (x, 1), 1)); /* Canonicalize (plus (plus (mult (reg) (const)) (plus (reg) (const))) const) into (plus (plus (mult (reg) (const)) (reg)) (const)). */ @@ -2171,10 +2171,10 @@ legitimize_address (x, oldx, mode) constant = 0; if (constant) - x = gen_rtx (PLUS, Pmode, - gen_rtx (PLUS, Pmode, XEXP (XEXP (x, 0), 0), - XEXP (XEXP (XEXP (x, 0), 1), 0)), - plus_constant (other, INTVAL (constant))); + x = gen_rtx_PLUS (Pmode, + gen_rtx_PLUS (Pmode, XEXP (XEXP (x, 0), 0), + XEXP (XEXP (XEXP (x, 0), 1), 0)), + plus_constant (other, INTVAL (constant))); } return x; @@ -2483,7 +2483,7 @@ i960_function_arg (cum, mode, type, named) else { cum->ca_nregparms = ROUND_PARM (cum->ca_nregparms, align); - ret = gen_rtx (REG, mode, cum->ca_nregparms); + ret = gen_rtx_REG (mode, cum->ca_nregparms); } return ret; @@ -2615,17 +2615,17 @@ i960_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) va_start assumes it. */ emit_insn (gen_cmpsi (arg_pointer_rtx, const0_rtx)); emit_jump_insn (gen_bne (label)); - emit_insn (gen_rtx (SET, VOIDmode, arg_pointer_rtx, - stack_pointer_rtx)); - emit_insn (gen_rtx (SET, VOIDmode, stack_pointer_rtx, - memory_address (SImode, - plus_constant (stack_pointer_rtx, - 48)))); + emit_insn (gen_rtx_SET (VOIDmode, arg_pointer_rtx, + stack_pointer_rtx)); + emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx, + memory_address (SImode, + plus_constant (stack_pointer_rtx, + 48)))); emit_label (label); /* ??? Note that we unnecessarily store one extra register for stdarg - fns. We could optimize this, but it's kept as-is for now. */ - regblock = gen_rtx (MEM, BLKmode, + fns. We could optimize this, but it's kept as for now. */ + regblock = gen_rtx_MEM (BLKmode, plus_constant (arg_pointer_rtx, first_reg * 4)); MEM_ALIAS_SET (regblock) = get_varargs_alias_set (); diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h index e273438ca28..63be254fda6 100644 --- a/gcc/config/i960/i960.h +++ b/gcc/config/i960/i960.h @@ -831,7 +831,7 @@ enum reg_class { NO_REGS, GLOBAL_REGS, LOCAL_REGS, LOCAL_OR_GLOBAL_REGS, /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx ((REG), (MODE), 0) +#define LIBCALL_VALUE(MODE) gen_rtx_REG ((MODE), 0) /* 1 if N is a possible register number for a function value as seen by the caller. @@ -947,7 +947,7 @@ extern struct rtx_def *i960_function_arg (); otherwise, FUNC is 0. */ #define FUNCTION_VALUE(TYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (TYPE), 0) + gen_rtx_REG (TYPE_MODE (TYPE), 0) /* Force aggregates and objects larger than 16 bytes to be returned in memory, since we only have 4 registers available for return values. */ @@ -1583,10 +1583,8 @@ extern struct rtx_def *gen_compare_reg (); #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 4)), \ - FNADDR); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 12)), \ - CXT); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), FNADDR); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 12)), CXT); \ } /* Generate RTL to flush the register windows so as to make arbitrary frames diff --git a/gcc/config/i960/i960.md b/gcc/config/i960/i960.md index 945b514c9de..616e97939bd 100644 --- a/gcc/config/i960/i960.md +++ b/gcc/config/i960/i960.md @@ -875,7 +875,7 @@ if (which_alternative == 0) return i960_output_move_double (operands[0], operands[1]); - operands[3] = gen_rtx (MEM, word_mode, operands[2]); + operands[3] = gen_rtx_MEM (word_mode, operands[2]); operands[4] = adj_offsettable_operand (operands[3], UNITS_PER_WORD); return \"lda %0,%2\;st %1,%3\;st %D1,%4\"; }" @@ -954,7 +954,7 @@ if (which_alternative == 0) return i960_output_move_quad (operands[0], operands[1]); - operands[3] = gen_rtx (MEM, word_mode, operands[2]); + operands[3] = gen_rtx_MEM (word_mode, operands[2]); operands[4] = adj_offsettable_operand (operands[3], UNITS_PER_WORD); operands[5] = adj_offsettable_operand (operands[4], UNITS_PER_WORD); operands[6] = adj_offsettable_operand (operands[5], UNITS_PER_WORD); @@ -1266,7 +1266,7 @@ operand0 = SUBREG_REG (operand0); } if (GET_MODE (operand0) != SImode) - operand0 = gen_rtx (SUBREG, SImode, operand0, op0_subreg_word); + operand0 = gen_rtx_SUBREG (SImode, operand0, op0_subreg_word); emit_insn (gen_ashlsi3 (temp, operand1, shift_24)); emit_insn (gen_ashrsi3 (operand0, temp, shift_24)); @@ -1387,7 +1387,7 @@ operand0 = SUBREG_REG (operand0); } if (GET_MODE (operand0) != SImode) - operand0 = gen_rtx (SUBREG, SImode, operand0, op0_subreg_word); + operand0 = gen_rtx_SUBREG (SImode, operand0, op0_subreg_word); emit_insn (gen_ashlsi3 (temp, operand1, shift_24)); emit_insn (gen_lshrsi3 (operand0, temp, shift_24)); @@ -1470,11 +1470,12 @@ " { rtx temp = gen_reg_rtx (DImode); - emit_insn (gen_rtx (SET, VOIDmode, temp, - gen_rtx (UNSIGNED_FIX, DImode, - gen_rtx (FIX, DFmode, operands[1])))); - emit_insn (gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (SUBREG, SImode, temp, 0))); + emit_insn (gen_rtx_SET (VOIDmode, temp, + gen_rtx_UNSIGNED_FIX (DImode, + gen_rtx_FIX (DFmode, + operands[1])))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_SUBREG (SImode, temp, 0))); DONE; }") @@ -1492,11 +1493,12 @@ " { rtx temp = gen_reg_rtx (DImode); - emit_insn (gen_rtx (SET, VOIDmode, temp, - gen_rtx (UNSIGNED_FIX, DImode, - gen_rtx (FIX, SFmode, operands[1])))); - emit_insn (gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (SUBREG, SImode, temp, 0))); + emit_insn (gen_rtx_SET (VOIDmode, temp, + gen_rtx_UNSIGNED_FIX (DImode, + gen_rtx_FIX (SFmode, + operands[1])))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_SUBREG (SImode, temp, 0))); DONE; }") diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index 685de334629..8bc569863ef 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -1,5 +1,5 @@ /* Subroutines used for code generation on the Mitsubishi M32R cpu. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -938,18 +938,15 @@ m32r_select_cc_mode (op, x, y) than being susummed into the following branch instruction. */ rtx -gen_compare (int_code, x, y, need_compare) - int int_code; - rtx x; - rtx y; - int need_compare; +gen_compare (code, x, y, need_compare) + enum rtx_code code; + rtx x, y; + int need_compare; { - enum rtx_code code = (enum rtx_code)int_code; - enum rtx_code compare_code; - enum rtx_code branch_code; - enum machine_mode mode = SELECT_CC_MODE (code, x, y); - rtx cc_reg = gen_rtx (REG, mode, CARRY_REGNUM); - int must_swap = 0; + enum machine_mode mode = SELECT_CC_MODE (code, x, y); + enum rtx_code compare_code, branch_code; + rtx cc_reg = gen_rtx_REG (mode, CARRY_REGNUM); + int swap_p = 0; switch (code) { @@ -1336,9 +1333,9 @@ m32r_setup_incoming_varargs (cum, int_mode, type, pretend_size, no_rtl) int size = M32R_MAX_PARM_REGS - first_reg_offset; rtx regblock; - regblock = gen_rtx (MEM, BLKmode, - plus_constant (arg_pointer_rtx, - FIRST_PARM_OFFSET (0))); + regblock = gen_rtx_MEM (BLKmode, + plus_constant (arg_pointer_rtx, + FIRST_PARM_OFFSET (0))); MEM_ALIAS_SET (regblock) = get_varargs_alias_set (); move_block_from_reg (first_reg_offset, regblock, size, size * UNITS_PER_WORD); diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index 903745f328f..7cad6c0f71b 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, Mitsubishi M32R cpu. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -706,10 +706,12 @@ M32R_STACK_ALIGN (current_function_outgoing_args_size) /* The current return address is in r14. */ #if 0 /* The default value should work. */ #define RETURN_ADDR_RTX(COUNT, FRAME) \ -(((COUNT) == -1) \ - ? gen_rtx (REG, Pmode, 14) \ - : copy_to_reg (gen_rtx (MEM, Pmode, \ - memory_address (Pmode, plus_constant ((FRAME), UNITS_PER_WORD))))) +(((COUNT) == -1) \ + ? gen_rtx_REG (Pmode, 14) \ + : copy_to_reg (gen_rtx_MEM (Pmode, \ + memory_address (Pmode, \ + plus_constant ((FRAME), \ + UNITS_PER_WORD))))) #endif /* Register to use for pushing function arguments. */ @@ -918,14 +920,14 @@ M32R_STACK_ALIGN (current_function_outgoing_args_size) and the rest are pushed. */ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ (PASS_IN_REG_P ((CUM), (MODE), (TYPE), (NAMED)) \ - ? gen_rtx (REG, (MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \ + ? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \ : 0) /* ??? Quick hack to try to get varargs working the normal way. */ #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \ (((! current_function_varargs || (NAMED)) \ && PASS_IN_REG_P ((CUM), (MODE), (TYPE), (NAMED))) \ - ? gen_rtx (REG, (MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \ + ? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \ : 0) /* A C expression for the number of words, at the beginning of an @@ -1011,11 +1013,11 @@ m32r_setup_incoming_varargs (&ARGS_SO_FAR, MODE, TYPE, &PRETEND_SIZE, NO_RTL) VALTYPE is the data type of the value (as a tree). If the precise function being called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. */ -#define FUNCTION_VALUE(VALTYPE, FUNC) gen_rtx (REG, TYPE_MODE (VALTYPE), 0) +#define FUNCTION_VALUE(VALTYPE, FUNC) gen_rtx_REG (TYPE_MODE (VALTYPE), 0) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0) /* 1 if N is a possible register number for a function value as seen by the caller. */ @@ -1095,13 +1097,13 @@ m32r_output_function_epilogue (FILE, SIZE) CXT is an RTX for the static chain value for the function. */ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ do { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 0)), \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 0)), \ plus_constant ((CXT), 0xe7000000)); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 4)), \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), \ plus_constant ((FNADDR), 0xe6000000)); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 8)), \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 8)), \ GEN_INT (0x1fc67000)); \ - emit_insn (gen_flush_icache (validize_mem (gen_rtx (MEM, SImode, TRAMP)))); \ + emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)))); \ } while (0) /* Library calls. */ diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md index 3f1e6e51f71..85ab2530e1f 100644 --- a/gcc/config/m32r/m32r.md +++ b/gcc/config/m32r/m32r.md @@ -1,5 +1,5 @@ ;; Machine description of the Mitsubishi M32R cpu for GNU C compiler -;; Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. +;; Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. ;; This file is part of GNU CC. @@ -684,11 +684,11 @@ op0_subword = SUBREG_WORD (operand0); operand0 = XEXP (operand0, 0); } - emit_insn (gen_ashlsi3 (temp, gen_rtx (SUBREG, SImode, operand1, - op1_subword), + emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, + op1_subword), shift_24)); if (GET_MODE (operand0) != SImode) - operand0 = gen_rtx (SUBREG, SImode, operand0, op0_subword); + operand0 = gen_rtx_SUBREG (SImode, operand0, op0_subword); emit_insn (gen_ashrsi3 (operand0, temp, shift_24)); DONE; }") @@ -717,8 +717,7 @@ operand1 = XEXP (operand1, 0); } - emit_insn (gen_ashlsi3 (temp, gen_rtx (SUBREG, SImode, operand1, - op1_subword), + emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, op1_subword), shift_24)); emit_insn (gen_ashrsi3 (operand0, temp, shift_24)); DONE; @@ -748,8 +747,7 @@ operand1 = XEXP (operand1, 0); } - emit_insn (gen_ashlsi3 (temp, gen_rtx (SUBREG, SImode, operand1, - op1_subword), + emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, op1_subword), shift_16)); emit_insn (gen_ashrsi3 (operand0, temp, shift_16)); DONE; diff --git a/gcc/config/m68k/a-ux.h b/gcc/config/m68k/a-ux.h index 229b6ab045b..1b85ce44046 100644 --- a/gcc/config/m68k/a-ux.h +++ b/gcc/config/m68k/a-ux.h @@ -1,5 +1,5 @@ /* Definitions for Motorola 680x0 running A/UX - Copyright (C) 1996, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -116,14 +116,14 @@ crt2.o%s " #undef FUNCTION_VALUE #define FUNCTION_VALUE(VALTYPE, FUNC) \ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ - ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \ + ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ : (POINTER_TYPE_P (VALTYPE) \ - ? gen_rtx (REG, TYPE_MODE (VALTYPE), 8) \ - : gen_rtx (REG, TYPE_MODE (VALTYPE), 0))) + ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ + : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) #undef LIBCALL_VALUE #define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, (MODE), ((TARGET_68881 && \ + gen_rtx_REG ((MODE), ((TARGET_68881 && \ ((MODE) == SFmode || (MODE) == DFmode)) ? 16 : 0)) /* 1 if N is a possible register number for a function value. @@ -166,9 +166,9 @@ crt2.o%s " #undef FINALIZE_TRAMPOLINE #define FINALIZE_TRAMPOLINE(TRAMP) \ - emit_library_call(gen_rtx(SYMBOL_REF, Pmode, "__clear_cache"), \ - 0, VOIDmode, 2, TRAMP, Pmode, \ - plus_constant(TRAMP, TRAMPOLINE_SIZE), Pmode); + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ + 0, VOIDmode, 2, TRAMP, Pmode, \ + plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); /* Clear the instruction cache from `beg' to `end'. This makes an inline system call to SYS_sysm68k. The arguments are as follows: diff --git a/gcc/config/m68k/crds.h b/gcc/config/m68k/crds.h index 441b285b4ee..89bf07ac1d4 100644 --- a/gcc/config/m68k/crds.h +++ b/gcc/config/m68k/crds.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler; Charles River Data Systems UNiverse/32. - Copyright (C) 1987, 1993, 1994, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 93, 94, 96, 97, 1998, 1999 Free Software Foundation, Inc. Contributed by Gary E. Miller (Gary_Edmunds_Miller@cup.portal.com) This file is part of GNU CC. @@ -79,7 +79,7 @@ Boston, MA 02111-1307, USA. */ #if 0 #define HAVE_probe 1 -#define gen_probe() gen_rtx(ASM_INPUT, VOIDmode, "tstb -2048(sp)\t;probe\n") +#define gen_probe() gen_rtx_ASM_INPUT (VOIDmode, "tstb -2048(sp)\t;probe\n") #else #undef NEED_PROBE #define NEED_PROBE (-2048) @@ -109,7 +109,7 @@ Boston, MA 02111-1307, USA. */ /* unos uses ".comm c.sac" returns &c.sac in d0 */ /* make pointer to c.sac ? #undef STRUCT_VALUE_REGNUM -#define STRUCT_VALUE gen_rtx(MEM, Pmode, gen_rtx( , , ) ) +#define STRUCT_VALUE gen_rtx_MEM (Pmode, gen_rtx( , , ) ) */ #define BSS_SECTION_ASM_OP ".bss" diff --git a/gcc/config/m68k/isi.h b/gcc/config/m68k/isi.h index a458cf9e080..32d2706aab0 100644 --- a/gcc/config/m68k/isi.h +++ b/gcc/config/m68k/isi.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. ISI 68000/68020 version. Intended only for use with GAS, and not ISI's assembler, which is buggy - Copyright (C) 1988, 1996 Free Software Foundation, Inc. + Copyright (C) 1988, 1996, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -74,7 +74,7 @@ Boston, MA 02111-1307, USA. */ #define FUNCTION_VALUE(VALTYPE,FUNC) LIBCALL_VALUE (TYPE_MODE (VALTYPE)) #define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, (MODE), ((TARGET_68881 && ((MODE) == SFmode || (MODE) == DFmode)) ? 16 : 0)) + gen_rtx_REG ((MODE), ((TARGET_68881 && ((MODE) == SFmode || (MODE) == DFmode)) ? 16 : 0)) /* 1 if N is a possible register number for a function value. D0 may be used, and F0 as well if -m68881 is specified. */ diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h index d100f5c6fe5..a7707dd800f 100644 --- a/gcc/config/m68k/linux.h +++ b/gcc/config/m68k/linux.h @@ -1,6 +1,6 @@ /* Definitions for Motorola 68k running Linux-based GNU systems with ELF format. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -298,8 +298,8 @@ do { \ #define LIBCALL_VALUE(MODE) \ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ && TARGET_68881) \ - ? gen_rtx_REG (MODE, 16) \ - : gen_rtx_REG (MODE, 0)) + ? gen_rtx_REG ((MODE), 16) \ + : gen_rtx_REG ((MODE), 0)) /* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an operand of a function call. */ diff --git a/gcc/config/m68k/lynx.h b/gcc/config/m68k/lynx.h index 8c54b8bc13f..b0b7206634c 100644 --- a/gcc/config/m68k/lynx.h +++ b/gcc/config/m68k/lynx.h @@ -1,5 +1,5 @@ /* Definitions for Motorola 680x0 running LynxOS. - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1993, 94, 95, 96, 98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -62,9 +62,10 @@ Boston, MA 02111-1307, USA. */ #undef LIBCALL_VALUE #define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, (MODE), \ - ((TARGET_68881 \ - && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode)) \ + gen_rtx_REG ((MODE), \ + ((TARGET_68881 \ + && ((MODE) == SFmode || (MODE) == DFmode \ + || (MODE) == XFmode)) \ ? 16 : 0)) #undef FUNCTION_VALUE_REGNO_P diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 659c7057cb2..2db8626b01e 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -18,8 +18,6 @@ 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. */ - -/* Some output-actions in m68k.md need these. */ #include "config.h" #include "system.h" #include "tree.h" @@ -2147,7 +2145,7 @@ output_addsi3 (operands) if (INTVAL (operands[2]) < 0 && INTVAL (operands[2]) >= -8) { - operands[2] = GEN_INT (-INTVAL (operands[2])); + operands[2] = GEN_INT (- INTVAL (operands[2])); return "subq%.l %2,%0"; } /* On the CPU32 it is faster to use two addql instructions to @@ -2164,7 +2162,7 @@ output_addsi3 (operands) if (INTVAL (operands[2]) < -8 && INTVAL (operands[2]) >= -16) { - operands[2] = GEN_INT (-INTVAL (operands[2]) - 8); + operands[2] = GEN_INT (- INTVAL (operands[2]) - 8); return "subq%.l %#8,%0\n\tsubq%.l %2,%0"; } } diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index 33c9885c331..37e5ea32c17 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -1504,7 +1504,7 @@ "* { CC_STATUS_INIT; - operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); return \"moveq %#0,%0\;moveq %#0,%2\;move%.b %1,%2\"; }") @@ -1515,7 +1515,7 @@ "* { CC_STATUS_INIT; - operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); return \"moveq %#0,%0\;moveq %#0,%2\;move%.w %1,%2\"; }") @@ -2197,32 +2197,33 @@ return \"add%.l %R2,%R0\;addx%.l %2,%0\"; else if (GET_CODE (operands[2]) == MEM && GET_CODE (XEXP (operands[2], 0)) == POST_INC) - { - return \"move%.l %2,%3\;add%.l %2,%R0\;addx%.l %3,%0\"; - } + return \"move%.l %2,%3\;add%.l %2,%R0\;addx%.l %3,%0\"; else { + rtx high, low; rtx xoperands[2]; + if (GET_CODE (operands[2]) == REG) - operands[1] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); - else if (GET_CODE (operands[2]) == CONST_DOUBLE) { - operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2])); - operands[2] = GEN_INT (CONST_DOUBLE_HIGH (operands[2])); + low = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); + high = operands[2]; } - else if (GET_CODE (operands[2]) == CONST_INT) + else if (CONSTANT_P (operands[2])) + split_double (operands[2], &high, &low); + else { - operands[1] = operands[2]; - operands[2] = INTVAL (operands[2]) < 0 ? constm1_rtx : const0_rtx; + low = adj_offsettable_operand (operands[2], 4); + high = operands[2]; } - else - operands[1] = adj_offsettable_operand (operands[2], 4); + + operands[1] = low, operands[2] = high; xoperands[0] = operands[3]; if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0) xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1); else xoperands[1] = operands[2]; + output_asm_insn (output_move_simode (xoperands), xoperands); if (GET_CODE (operands[1]) == CONST_INT) { @@ -2255,10 +2256,8 @@ CC_STATUS_INIT; if (GET_CODE (XEXP (operands[0], 0)) == POST_INC) { - operands[1] - = gen_rtx_MEM (SImode, - gen_rtx_PLUS (VOIDmode, XEXP(operands[0], 0), - GEN_INT (-8))); + operands[1] = gen_rtx_MEM (SImode, + plus_constant (XEXP(operands[0], 0), -8)); return \"move%.l %0,%3\;add%.l %R2,%0\;addx%.l %2,%3\;move%.l %3,%1\"; } else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) @@ -2368,7 +2367,7 @@ if (INTVAL (operands[2]) < 0 && INTVAL (operands[2]) >= -8) { - operands[2] = GEN_INT (-INTVAL (operands[2])); + operands[2] = GEN_INT (- INTVAL (operands[2])); return \"subq%.w %2,%0\"; } /* On the CPU32 it is faster to use two addqw instructions to @@ -2385,7 +2384,7 @@ if (INTVAL (operands[2]) < -8 && INTVAL (operands[2]) >= -16) { - operands[2] = GEN_INT (-INTVAL (operands[2]) - 8); + operands[2] = GEN_INT (- INTVAL (operands[2]) - 8); return \"subq%.w %#8,%0\;subq%.w %2,%0\"; } } @@ -2430,7 +2429,7 @@ if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8) { - operands[1] = GEN_INT (-INTVAL (operands[1])); + operands[1] = GEN_INT (- INTVAL (operands[1])); return \"subq%.w %1,%0\"; } /* On the CPU32 it is faster to use two addqw instructions to @@ -2447,7 +2446,7 @@ if (INTVAL (operands[1]) < -8 && INTVAL (operands[1]) >= -16) { - operands[1] = GEN_INT (-INTVAL (operands[1]) - 8); + operands[1] = GEN_INT (- INTVAL (operands[1]) - 8); return \"subq%.w %#8,%0\;subq%.w %1,%0\"; } } @@ -2486,7 +2485,7 @@ if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8) { - operands[1] = GEN_INT (-INTVAL (operands[1])); + operands[1] = GEN_INT (- INTVAL (operands[1])); return \"subq%.w %1,%0\"; } /* On the CPU32 it is faster to use two addqw instructions to @@ -2503,7 +2502,7 @@ if (INTVAL (operands[1]) < -8 && INTVAL (operands[1]) >= -16) { - operands[1] = GEN_INT (-INTVAL (operands[1]) - 8); + operands[1] = GEN_INT (- INTVAL (operands[1]) - 8); return \"subq%.w %#8,%0\;subq%.w %1,%0\"; } } @@ -2536,7 +2535,7 @@ return \"addq%.b %2,%0\"; if (INTVAL (operands[2]) < 0 && INTVAL (operands[2]) >= -8) { - operands[2] = GEN_INT (-INTVAL (operands[2])); + operands[2] = GEN_INT (- INTVAL (operands[2])); return \"subq%.b %2,%0\"; } } @@ -2562,7 +2561,7 @@ return \"addq%.b %1,%0\"; if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8) { - operands[1] = GEN_INT (-INTVAL (operands[1])); + operands[1] = GEN_INT (- INTVAL (operands[1])); return \"subq%.b %1,%0\"; } } @@ -2588,7 +2587,7 @@ return \"addq%.b %1,%0\"; if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8) { - operands[1] = GEN_INT (-INTVAL (operands[1])); + operands[1] = GEN_INT (- INTVAL (operands[1])); return \"subq%.b %1,%0\"; } } @@ -2763,27 +2762,30 @@ } else { + rtx high, low; rtx xoperands[2]; + if (GET_CODE (operands[2]) == REG) - operands[1] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); - else if (GET_CODE (operands[2]) == CONST_DOUBLE) { - operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2])); - operands[2] = GEN_INT (CONST_DOUBLE_HIGH (operands[2])); + low = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); + high = operands[2]; } - else if (GET_CODE (operands[2]) == CONST_INT) + else if (CONSTANT_P (operands[2])) + split_double (operands[2], &high, &low); + else { - operands[1] = operands[2]; - operands[2] = INTVAL (operands[2]) < 0 ? constm1_rtx : const0_rtx; + low = adj_offsettable_operand (operands[2], 4); + high = operands[2]; } - else - operands[1] = adj_offsettable_operand (operands[2], 4); + + operands[1] = low, operands[2] = high; xoperands[0] = operands[3]; if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0) xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1); else xoperands[1] = operands[2]; + output_asm_insn (output_move_simode (xoperands), xoperands); if (GET_CODE (operands[1]) == CONST_INT) { @@ -2817,9 +2819,7 @@ if (GET_CODE (XEXP (operands[0], 0)) == POST_INC) { operands[1] - = gen_rtx_MEM (SImode, - gen_rtx_PLUS (VOIDmode, XEXP(operands[0], 0), - GEN_INT (-8))); + = gen_rtx_MEM (SImode, plus_constant (XEXP (operands[0], 0), -8)); return \"move%.l %0,%3\;sub%.l %R2,%0\;subx%.l %2,%3\;move%.l %3,%1\"; } else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) @@ -3641,21 +3641,12 @@ { CC_STATUS_INIT; /* We can get CONST_DOUBLE, but also const1_rtx etc. */ - if (GET_CODE (operands[2]) == CONST_DOUBLE - || GET_CODE (operands[2]) == CONST_INT) + if (CONSTANT_P (operands[2])) { rtx hi, lo; - if (GET_CODE (operands[2]) == CONST_DOUBLE) - { - hi = GEN_INT (CONST_DOUBLE_HIGH (operands[2])); - lo = GEN_INT (CONST_DOUBLE_LOW (operands[2])); - } - else - { - lo = operands[2]; - hi = INTVAL (lo) < 0 ? constm1_rtx : const0_rtx; - } + split_double (operands[2], &hi, &lo); + switch (INTVAL (hi)) { case 0 : @@ -3790,7 +3781,7 @@ CC_STATUS_INIT; if (GET_CODE (operands[0]) == REG) - operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else operands[0] = adj_offsettable_operand (operands[0], 4); if (GET_MODE (operands[1]) == SImode) @@ -3814,21 +3805,12 @@ { CC_STATUS_INIT; /* We can get CONST_DOUBLE, but also const1_rtx etc. */ - if (GET_CODE (operands[2]) == CONST_DOUBLE - || GET_CODE (operands[2]) == CONST_INT) + if (CONSTANT_P (operands[2])) { rtx hi, lo; - if (GET_CODE (operands[2]) == CONST_DOUBLE) - { - hi = GEN_INT (CONST_DOUBLE_HIGH (operands[2])); - lo = GEN_INT (CONST_DOUBLE_LOW (operands[2])); - } - else - { - lo = operands[2]; - hi = INTVAL (lo) < 0 ? constm1_rtx : const0_rtx; - } + split_double (operands[2], &hi, &lo); + switch (INTVAL (hi)) { case 0 : @@ -4001,21 +3983,13 @@ { CC_STATUS_INIT; /* We can get CONST_DOUBLE, but also const1_rtx etc. */ - if (GET_CODE (operands[2]) == CONST_DOUBLE - || GET_CODE (operands[2]) == CONST_INT) + + if (CONSTANT_P (operands[2])) { rtx hi, lo; - if (GET_CODE (operands[2]) == CONST_DOUBLE) - { - hi = GEN_INT (CONST_DOUBLE_HIGH (operands[2])); - lo = GEN_INT (CONST_DOUBLE_LOW (operands[2])); - } - else - { - lo = operands[2]; - hi = INTVAL (lo) < 0 ? constm1_rtx : const0_rtx; - } + split_double (operands[2], &hi, &lo); + switch (INTVAL (hi)) { case 0 : @@ -4248,7 +4222,7 @@ target = operand_subword_force (operands[0], 0, SFmode); result = expand_binop (SImode, xor_optab, operand_subword_force (operands[1], 0, SFmode), - GEN_INT(0x80000000), target, 0, OPTAB_WIDEN); + GEN_INT (0x80000000), target, 0, OPTAB_WIDEN); if (result == 0) abort (); @@ -4299,7 +4273,7 @@ target = operand_subword (operands[0], 0, 1, DFmode); result = expand_binop (SImode, xor_optab, operand_subword_force (operands[1], 0, DFmode), - GEN_INT(0x80000000), target, 0, OPTAB_WIDEN); + GEN_INT (0x80000000), target, 0, OPTAB_WIDEN); if (result == 0) abort (); @@ -4382,7 +4356,7 @@ target = operand_subword_force (operands[0], 0, SFmode); result = expand_binop (SImode, and_optab, operand_subword_force (operands[1], 0, SFmode), - GEN_INT(0x7fffffff), target, 0, OPTAB_WIDEN); + GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN); if (result == 0) abort (); @@ -4428,7 +4402,7 @@ target = operand_subword (operands[0], 0, 1, DFmode); result = expand_binop (SImode, and_optab, operand_subword_force (operands[1], 0, DFmode), - GEN_INT(0x7fffffff), target, 0, OPTAB_WIDEN); + GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN); if (result == 0) abort (); @@ -5645,8 +5619,7 @@ int width = GET_CODE (operands[0]) == REG ? 31 : 7; return output_btst (operands, GEN_INT (width - INTVAL (operands[2])), - operands[0], - insn, 1000); + operands[0], insn, 1000); /* Pass 1000 as SIGNPOS argument so that btst will not think we are testing the sign bit for an `and' and assume that nonzero implies a negative result. */ @@ -5670,10 +5643,8 @@ && GET_CODE (operands[2]) == CONST_INT) { int width = GET_CODE (operands[0]) == REG ? 31 : 7; - return output_btst (operands, - GEN_INT (width - INTVAL (operands[2])), - operands[0], - insn, 1000); + return output_btst (operands, GEN_INT (width - INTVAL (operands[2])), + operands[0], insn, 1000); /* Pass 1000 as SIGNPOS argument so that btst will not think we are testing the sign bit for an `and' and assume that nonzero implies a negative result. */ @@ -7003,8 +6974,7 @@ "NEED_PROBE" "* { - operands[0] = gen_rtx_PLUS (SImode, stack_pointer_rtx, - GEN_INT (NEED_PROBE)); + operands[0] = plus_constant (stack_pointer_rtx, NEED_PROBE); return \"tstl %a0\"; }") @@ -7207,9 +7177,7 @@ xoperands[1] = operands[1]; xoperands[2] - = gen_rtx_MEM (QImode, - gen_rtx_PLUS (VOIDmode, stack_pointer_rtx, - GEN_INT (3))); + = gen_rtx_MEM (QImode, plus_constant (stack_pointer_rtx, 3)); xoperands[3] = stack_pointer_rtx; if (!TARGET_5200) output_asm_insn (\"subq%.w %#4,%3\;move%.b %1,%2\", xoperands); @@ -7552,7 +7520,7 @@ if (REG_P (operands[1])) { rtx xoperands[2]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + 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\"; @@ -7784,7 +7752,7 @@ target = operand_subword (operands[0], 0, 1, XFmode); result = expand_binop (SImode, xor_optab, operand_subword_force (operands[1], 0, XFmode), - GEN_INT(0x80000000), target, 0, OPTAB_WIDEN); + GEN_INT (0x80000000), target, 0, OPTAB_WIDEN); if (result == 0) abort (); @@ -7833,7 +7801,7 @@ target = operand_subword (operands[0], 0, 1, XFmode); result = expand_binop (SImode, and_optab, operand_subword_force (operands[1], 0, XFmode), - GEN_INT(0x7fffffff), target, 0, OPTAB_WIDEN); + GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN); if (result == 0) abort (); diff --git a/gcc/config/m68k/m68kemb.h b/gcc/config/m68k/m68kemb.h index 9fa0c6923bc..379bf3afe0a 100644 --- a/gcc/config/m68k/m68kemb.h +++ b/gcc/config/m68k/m68kemb.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. "embedded" 68XXX. This is meant to be included after m68k.h. - Copyright (C) 1994, 1995 Free Software Foundation, Inc. */ + Copyright (C) 1994, 1995, 1998, 1999 Free Software Foundation, Inc. */ #define PTRDIFF_TYPE "long int" #define SIZE_TYPE "long unsigned int" @@ -26,10 +26,11 @@ #define FUNCTION_VALUE(VALTYPE,FUNC) LIBCALL_VALUE (TYPE_MODE (VALTYPE)) #undef LIBCALL_VALUE -#define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, (MODE), \ - ((TARGET_68881 \ - && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode)) \ +#define LIBCALL_VALUE(MODE) \ + gen_rtx_REG ((MODE), \ + ((TARGET_68881 \ + && ((MODE) == SFmode || (MODE) == DFmode \ + || (MODE) == XFmode)) \ ? 16 : 0)) #undef FUNCTION_VALUE_REGNO_P diff --git a/gcc/config/m68k/m68kv4.h b/gcc/config/m68k/m68kv4.h index 6c229b6e558..dd2b3c1d6fd 100644 --- a/gcc/config/m68k/m68kv4.h +++ b/gcc/config/m68k/m68kv4.h @@ -1,5 +1,5 @@ /* Target definitions for GNU compiler for mc680x0 running System V.4 - Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1991, 93, 94, 95, 96, 1998, 1999 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@monkeys.com) and Fred Fish (fnf@cygnus.com). @@ -167,10 +167,10 @@ while (0) #undef FUNCTION_VALUE #define FUNCTION_VALUE(VALTYPE, FUNC) \ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ - ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \ + ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ : (POINTER_TYPE_P (VALTYPE) \ - ? gen_rtx (REG, TYPE_MODE (VALTYPE), 8) \ - : gen_rtx (REG, TYPE_MODE (VALTYPE), 0))) + ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ + : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) /* For compatibility with the large body of existing code which does not always properly declare external functions returning pointer types, the @@ -195,8 +195,8 @@ do { \ #define LIBCALL_VALUE(MODE) \ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ && TARGET_68881) \ - ? gen_rtx (REG, (MODE), 16) \ - : gen_rtx (REG, (MODE), 0)) + ? gen_rtx_REG ((MODE), 16) \ + : gen_rtx_REG ((MODE), 0)) /* Boundary (in *bits*) on which stack pointer should be aligned. The m68k/SVR4 convention is to keep the stack pointer longword aligned. */ @@ -321,13 +321,13 @@ int switch_table_difference_label_flag; #undef TRAMPOLINE_TEMPLATE #define TRAMPOLINE_TEMPLATE(FILE) \ { \ - ASM_OUTPUT_SHORT (FILE, GEN_INT (0x227a)); \ - ASM_OUTPUT_SHORT (FILE, GEN_INT (8)); \ - ASM_OUTPUT_SHORT (FILE, GEN_INT (0x2f3a)); \ - ASM_OUTPUT_SHORT (FILE, GEN_INT (8)); \ - ASM_OUTPUT_SHORT (FILE, GEN_INT (0x4e75)); \ - ASM_OUTPUT_INT (FILE, const0_rtx); \ - ASM_OUTPUT_INT (FILE, const0_rtx); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x227a)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (8)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x2f3a)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (8)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x4e75)); \ + ASM_OUTPUT_INT (FILE, const0_rtx); \ + ASM_OUTPUT_INT (FILE, const0_rtx); \ } /* Redefine since we are using a different trampoline */ @@ -341,6 +341,6 @@ int switch_table_difference_label_flag; #undef INITIALIZE_TRAMPOLINE #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 10)), CXT); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 14)), FNADDR); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 10)), CXT); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 14)), FNADDR); \ } diff --git a/gcc/config/m68k/mot3300.h b/gcc/config/m68k/mot3300.h index 1a4ca6dbf84..8074e5b4d2e 100644 --- a/gcc/config/m68k/mot3300.h +++ b/gcc/config/m68k/mot3300.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, SysV68 Motorola 3300 Delta Series. - Copyright (C) 1987, 93, 94, 95, 96, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 93-98, 1999 Free Software Foundation, Inc. Contributed by Abramo and Roberto Bagnara (bagnara@dipisa.di.unipi.it) based on Alex Crain's 3B1 definitions. Maintained by Philippe De Muyter (phdm@info.ucl.ac.be). @@ -298,20 +298,21 @@ dtors_section () \ /* sysV68 (brain damaged) cc convention support. */ #define FUNCTION_VALUE(VALTYPE,FUNC) \ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ - ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \ + ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ : (POINTER_TYPE_P (VALTYPE) \ - ? gen_rtx (REG, TYPE_MODE (VALTYPE), 8) \ - : gen_rtx (REG, TYPE_MODE (VALTYPE), 0))) + ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ + : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) /* If TARGET_68881, SF and DF values are returned in fp0 instead of d0. */ /* Is LIBCALL_VALUE never called with a pointer ? */ #undef LIBCALL_VALUE -#define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, (MODE), \ - ((TARGET_68881 \ - && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode)) \ - ? 16 : 0)) +#define LIBCALL_VALUE(MODE) \ + gen_rtx_REG ((MODE), \ + ((TARGET_68881 \ + && ((MODE) == SFmode || (MODE) == DFmode \ + || (MODE) == XFmode)) \ + ? 16 : 0)) /* 1 if N is a possible register number for a function value. d0 may be used, and fp0 as well if -msoft-float is not specified. */ @@ -772,8 +773,8 @@ do {(CUM).offset = 0;\ #undef FUNCTION_ARG #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ -(((CUM).libcall && (CUM).offset == 0) ? gen_rtx(REG, (MODE), 0)\ -: (TARGET_REGPARM && (CUM).offset < 8) ? gen_rtx (REG, (MODE), (CUM).offset / 4) : 0) +(((CUM).libcall && (CUM).offset == 0) ? gen_rtx_REG ((MODE), 0)\ +: (TARGET_REGPARM && (CUM).offset < 8) ? gen_rtx_REG ((MODE), (CUM).offset / 4) : 0) #undef FUNCTION_ARG_PARTIAL_NREGS #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ @@ -815,5 +816,5 @@ do {(CUM).offset = 0;\ if (!TARGET_68040) \ ; \ else \ - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__clear_insn_cache"), \ + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_insn_cache"), \ 0, VOIDmode, 0) diff --git a/gcc/config/m68k/news.h b/gcc/config/m68k/news.h index f83524cc0cf..246f5e77e85 100644 --- a/gcc/config/m68k/news.h +++ b/gcc/config/m68k/news.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. SONY NEWS-OS 4 version. - Copyright (C) 1987, 89, 93, 94, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 89, 93, 94, 96-98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -126,11 +126,12 @@ Boston, MA 02111-1307, USA. */ #define FUNCTION_VALUE(VALTYPE,FUNC) LIBCALL_VALUE (TYPE_MODE (VALTYPE)) -#define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, (MODE), \ - ((TARGET_68881 \ - && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode)) \ - ? 16 : 0)) +#define LIBCALL_VALUE(MODE) \ + gen_rtx_REG ((MODE), \ + ((TARGET_68881 \ + && ((MODE) == SFmode || (MODE) == DFmode \ + || (MODE) == XFmode)) \ + ? 16 : 0)) #define ASM_OUTPUT_ALIGN(FILE,LOG) \ fprintf (FILE, "\t.align %d\n", (LOG)) diff --git a/gcc/config/m68k/next.h b/gcc/config/m68k/next.h index 8391ab50cb1..9320a1fccac 100644 --- a/gcc/config/m68k/next.h +++ b/gcc/config/m68k/next.h @@ -1,5 +1,5 @@ /* Target definitions for GNU compiler for mc680x0 running NeXTSTEP - Copyright (C) 1989, 90-94, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1989, 90-94, 96, 97, 98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -186,8 +186,8 @@ Boston, MA 02111-1307, USA. */ #undef FINALIZE_TRAMPOLINE #define FINALIZE_TRAMPOLINE(TRAMP) \ - emit_library_call(gen_rtx(SYMBOL_REF, Pmode, "__enable_execute_stack"), \ - 0, VOIDmode, 1, memory_address(SImode, (TRAMP)), Pmode) + emit_library_call(gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), \ + 0, VOIDmode, 1, memory_address (SImode, (TRAMP)), Pmode) /* A C expression used to clear the instruction cache from address BEG to address END. On NeXTSTEP this i a system trap. */ diff --git a/gcc/config/m68k/sun3.h b/gcc/config/m68k/sun3.h index 13e927ede4d..4e277636c3d 100644 --- a/gcc/config/m68k/sun3.h +++ b/gcc/config/m68k/sun3.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Sun 68000/68020 version. - Copyright (C) 1987, 1988, 1993, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 93, 95, 96, 98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -171,11 +171,12 @@ Boston, MA 02111-1307, USA. */ /* This is not a good idea. It prevents interoperation between files compiled with -m68881 and those compiled with -msoft-float. */ #if 0 -#define FUNCTION_VALUEX(MODE) \ - gen_rtx (REG, (MODE), \ - ((TARGET_68881 \ - && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode)) \ - ? 16 : 0)) +#define FUNCTION_VALUEX(MODE) \ + gen_rtx_REG ((MODE), \ + ((TARGET_68881 \ + && ((MODE) == SFmode || (MODE) == DFmode \ + || (MODE) == XFmode)) \ + ? 16 : 0)) #undef FUNCTION_VALUE #define FUNCTION_VALUE(VALTYPE,FUNC) FUNCTION_VALUEX (TYPE_MODE (VALTYPE)) diff --git a/gcc/config/m88k/m88k.c b/gcc/config/m88k/m88k.c index df3010e1f1c..ddc80506b1b 100644 --- a/gcc/config/m88k/m88k.c +++ b/gcc/config/m88k/m88k.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Motorola 88000. - Copyright (C) 1988, 92, 93, 94, 95, 16, 1997, 1999 Free Software + Copyright (C) 1988, 92, 93, 94, 95, 96, 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@mcc.com) Currently maintained by (gcc@dg-rtp.dg.com) @@ -22,12 +22,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" - -#include <stdio.h> -#include <sys/types.h> -#include <time.h> -#include <ctype.h> - +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -44,8 +39,6 @@ Boston, MA 02111-1307, USA. */ #include "flags.h" extern char *version_string; -extern time_t time (); -extern char *ctime (); extern int flag_traditional; extern FILE *asm_out_file; @@ -237,7 +230,7 @@ emit_move_sequence (operands, mode, scratch) || GET_CODE (operand1) == MEM) { /* Run this case quickly. */ - emit_insn (gen_rtx (SET, VOIDmode, operand0, operand1)); + emit_insn (gen_rtx_SET (VOIDmode, operand0, operand1)); return 1; } } @@ -247,7 +240,7 @@ emit_move_sequence (operands, mode, scratch) || (operand1 == const0_rtx && GET_MODE_SIZE (mode) <= UNITS_PER_WORD)) { /* Run this case quickly. */ - emit_insn (gen_rtx (SET, VOIDmode, operand0, operand1)); + emit_insn (gen_rtx_SET (VOIDmode, operand0, operand1)); return 1; } if (! reload_in_progress && ! reload_completed) @@ -269,7 +262,7 @@ emit_move_sequence (operands, mode, scratch) && symbolic_address_p (operand1), operand1, temp, scratch); if (mode != SImode) - operands[1] = gen_rtx (SUBREG, mode, operands[1], 0); + operands[1] = gen_rtx_SUBREG (mode, operands[1], 0); } } @@ -316,28 +309,33 @@ legitimize_address (pic, orig, reg, scratch) temp = ((reload_in_progress || reload_completed) ? reg : gen_reg_rtx (Pmode)); - emit_insn (gen_rtx (SET, VOIDmode, temp, - gen_rtx (HIGH, SImode, - gen_rtx (UNSPEC, SImode, - gen_rtvec (1, addr), - 0)))); - emit_insn (gen_rtx (SET, VOIDmode, temp, - gen_rtx (LO_SUM, SImode, temp, - gen_rtx (UNSPEC, SImode, - gen_rtvec (1, addr), - 0)))); + emit_insn (gen_rtx_SET + (VOIDmode, temp, + gen_rtx_HIGH (SImode, + gen_rtx_UNSPEC (SImode, + gen_rtvec (1, addr), + 0)))); + + emit_insn (gen_rtx_SET + (VOIDmode, temp, + gen_rtx_LO_SUM (SImode, temp, + gen_rtx_UNSPEC (SImode, + gen_rtvec (1, addr), + 0)))); addr = temp; } - new = gen_rtx (MEM, Pmode, - gen_rtx (PLUS, SImode, - pic_offset_table_rtx, addr)); + + new = gen_rtx_MEM (Pmode, + gen_rtx_PLUS (SImode, + pic_offset_table_rtx, addr)); + current_function_uses_pic_offset_table = 1; RTX_UNCHANGING_P (new) = 1; insn = emit_move_insn (reg, new); /* Put a REG_EQUAL note on this insn, so that it can be optimized by loop. */ - REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL, orig, - REG_NOTES (insn)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, orig, + REG_NOTES (insn)); new = reg; } else if (GET_CODE (addr) == CONST) @@ -381,7 +379,7 @@ legitimize_address (pic, orig, reg, scratch) for this address. */ abort (); } - new = gen_rtx (PLUS, SImode, base, addr); + new = gen_rtx_PLUS (SImode, base, addr); /* Should we set special REG_NOTEs here? */ } } @@ -395,15 +393,15 @@ legitimize_address (pic, orig, reg, scratch) reg = gen_reg_rtx (Pmode); } - emit_insn (gen_rtx (SET, VOIDmode, - reg, gen_rtx (HIGH, SImode, addr))); - new = gen_rtx (LO_SUM, SImode, reg, addr); + emit_insn (gen_rtx_SET (VOIDmode, + reg, gen_rtx_HIGH (SImode, addr))); + new = gen_rtx_LO_SUM (SImode, reg, addr); } if (new != orig && GET_CODE (orig) == MEM) { - new = gen_rtx (MEM, GET_MODE (orig), new); + new = gen_rtx_MEM (GET_MODE (orig), new); RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (orig); MEM_COPY_ATTRIBUTES (new, orig); } @@ -527,7 +525,7 @@ expand_block_move (dest_mem, src_mem, operands) else { #ifdef TARGET_MEM_FUNCTIONS - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "memcpy"), 0, + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "memcpy"), 0, VOIDmode, 3, operands[0], Pmode, operands[1], Pmode, @@ -535,7 +533,7 @@ expand_block_move (dest_mem, src_mem, operands) TREE_UNSIGNED (sizetype)), TYPE_MODE (sizetype)); #else - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "bcopy"), 0, + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "bcopy"), 0, VOIDmode, 3, operands[1], Pmode, operands[0], Pmode, @@ -596,22 +594,22 @@ block_move_loop (dest, dest_mem, src, src_mem, size, align) offset_rtx = GEN_INT (MOVSTR_LOOP + (1 - units) * align); - value_rtx = gen_rtx (MEM, MEM_IN_STRUCT_P (src_mem) ? mode : BLKmode, - gen_rtx (PLUS, Pmode, - gen_rtx (REG, Pmode, 3), - offset_rtx)); + value_rtx = gen_rtx_MEM (MEM_IN_STRUCT_P (src_mem) ? mode : BLKmode, + gen_rtx_PLUS (Pmode, + gen_rtx_REG (Pmode, 3), + offset_rtx)); RTX_UNCHANGING_P (value_rtx) = RTX_UNCHANGING_P (src_mem); MEM_COPY_ATTRIBUTES (value_rtx, src_mem); emit_insn (gen_call_movstrsi_loop - (gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (entry_name)), + (gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (entry_name)), dest, src, offset_rtx, value_rtx, - gen_rtx (REG, mode, ((units & 1) ? 4 : 5)), + gen_rtx_REG (mode, ((units & 1) ? 4 : 5)), GEN_INT (count))); if (remainder) - block_move_sequence (gen_rtx (REG, Pmode, 2), dest_mem, - gen_rtx (REG, Pmode, 3), src_mem, + block_move_sequence (gen_rtx_REG (Pmode, 2), dest_mem, + gen_rtx_REG (Pmode, 3), src_mem, remainder, align, MOVSTR_LOOP + align); } @@ -652,10 +650,11 @@ block_move_no_loop (dest, dest_mem, src, src_mem, size, align) offset_rtx = GEN_INT (most - (size - remainder)); - value_rtx = gen_rtx (MEM, MEM_IN_STRUCT_P (src_mem) ? mode : BLKmode, - gen_rtx (PLUS, Pmode, - gen_rtx (REG, Pmode, 3), - offset_rtx)); + value_rtx = gen_rtx_MEM (MEM_IN_STRUCT_P (src_mem) ? mode : BLKmode, + gen_rtx_PLUS (Pmode, + gen_rtx_REG (Pmode, 3), + offset_rtx)); + RTX_UNCHANGING_P (value_rtx) = RTX_UNCHANGING_P (src_mem); MEM_COPY_ATTRIBUTES (value_rtx, src_mem); @@ -663,13 +662,13 @@ block_move_no_loop (dest, dest_mem, src, src_mem, size, align) ? (align == 8 ? 6 : 5) : 4); emit_insn (gen_call_block_move - (gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (entry_name)), + (gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (entry_name)), dest, src, offset_rtx, value_rtx, - gen_rtx (REG, mode, value_reg))); + gen_rtx_REG (mode, value_reg))); if (remainder) - block_move_sequence (gen_rtx (REG, Pmode, 2), dest_mem, - gen_rtx (REG, Pmode, 3), src_mem, + block_move_sequence (gen_rtx_REG (Pmode, 2), dest_mem, + gen_rtx_REG (Pmode, 3), src_mem, remainder, align, most); } @@ -724,13 +723,12 @@ block_move_sequence (dest, dest_mem, src, src_mem, size, align, offset) temp[next] = gen_reg_rtx (mode[next]); } size -= amount[next]; - srcp = gen_rtx (MEM, - MEM_IN_STRUCT_P (src_mem) ? mode[next] : BLKmode, - gen_rtx (PLUS, Pmode, src, - GEN_INT (offset_ld))); + srcp = gen_rtx_MEM (MEM_IN_STRUCT_P (src_mem) ? mode[next] : BLKmode, + plus_constant (src, offset_ld)); + RTX_UNCHANGING_P (srcp) = RTX_UNCHANGING_P (src_mem); MEM_COPY_ATTRIBUTES (srcp, src_mem); - emit_insn (gen_rtx (SET, VOIDmode, temp[next], srcp)); + emit_insn (gen_rtx_SET (VOIDmode, temp[next], srcp)); offset_ld += amount[next]; active[next] = TRUE; } @@ -738,13 +736,13 @@ block_move_sequence (dest, dest_mem, src, src_mem, size, align, offset) if (active[phase]) { active[phase] = FALSE; - dstp = gen_rtx (MEM, - MEM_IN_STRUCT_P (dest_mem) ? mode[phase] : BLKmode, - gen_rtx (PLUS, Pmode, dest, - GEN_INT (offset_st))); + dstp + = gen_rtx_MEM (MEM_IN_STRUCT_P (dest_mem) ? mode[phase] : BLKmode, + plus_constant (dest, offset_st)); + RTX_UNCHANGING_P (dstp) = RTX_UNCHANGING_P (dest_mem); MEM_COPY_ATTRIBUTES (dstp, dest_mem); - emit_insn (gen_rtx (SET, VOIDmode, dstp, temp[phase])); + emit_insn (gen_rtx_SET (VOIDmode, dstp, temp[phase])); offset_st += amount[phase]; } } @@ -927,9 +925,9 @@ output_call (operands, addr) } /* Record the values to be computed later as "def name,high-low". */ - sb_name = gen_rtx (EXPR_LIST, VOIDmode, operands[0], sb_name); - sb_high = gen_rtx (EXPR_LIST, VOIDmode, high, sb_high); - sb_low = gen_rtx (EXPR_LIST, VOIDmode, low, sb_low); + sb_name = gen_rtx_EXPR_LIST (VOIDmode, operands[0], sb_name); + sb_high = gen_rtx_EXPR_LIST (VOIDmode, high, sb_high); + sb_low = gen_rtx_EXPR_LIST (VOIDmode, low, sb_low); #endif /* Don't USE_GAS */ return last; @@ -1160,7 +1158,7 @@ legitimize_operand (op, mode) && (u.s.exponent1 == 0x8 || u.s.exponent1 == 0x7) /* Exponent fits */ && (temp = simplify_unary_operation (FLOAT_TRUNCATE, SFmode, op, mode)) != 0) - return gen_rtx (FLOAT_EXTEND, mode, force_reg (SFmode, temp)); + return gen_rtx_FLOAT_EXTEND (mode, force_reg (SFmode, temp)); } else if (register_operand (op, mode)) return op; @@ -1982,13 +1980,13 @@ m88k_expand_prologue () if (flag_pic && save_regs[PIC_OFFSET_TABLE_REGNUM]) { - rtx return_reg = gen_rtx (REG, SImode, 1); + rtx return_reg = gen_rtx_REG (SImode, 1); rtx label = gen_label_rtx (); rtx temp_reg; if (! save_regs[1]) { - temp_reg = gen_rtx (REG, SImode, TEMP_REGNUM); + temp_reg = gen_rtx_REG (SImode, TEMP_REGNUM); emit_move_insn (temp_reg, return_reg); } emit_insn (gen_locate1 (pic_offset_table_rtx, label)); @@ -2092,9 +2090,10 @@ emit_add (dstreg, srcreg, amount) int amount; { rtx incr = GEN_INT (abs (amount)); + if (! ADD_INTVAL (amount)) { - rtx temp = gen_rtx (REG, SImode, TEMP_REGNUM); + rtx temp = gen_rtx_REG (SImode, TEMP_REGNUM); emit_move_insn (temp, incr); incr = temp; } @@ -2207,22 +2206,23 @@ emit_ldst (store_p, regno, mode, offset) enum machine_mode mode; int offset; { - rtx reg = gen_rtx (REG, mode, regno); + rtx reg = gen_rtx_REG (mode, regno); rtx mem; if (SMALL_INTVAL (offset)) { - mem = gen_rtx (MEM, mode, plus_constant (stack_pointer_rtx, offset)); + mem = gen_rtx_MEM (mode, plus_constant (stack_pointer_rtx, offset)); } else { /* offset is too large for immediate index must use register */ rtx disp = GEN_INT (offset); - rtx temp = gen_rtx (REG, SImode, TEMP_REGNUM); - rtx regi = gen_rtx (PLUS, SImode, stack_pointer_rtx, temp); + rtx temp = gen_rtx_REG (SImode, TEMP_REGNUM); + rtx regi = gen_rtx_PLUS (SImode, stack_pointer_rtx, temp); + emit_move_insn (temp, disp); - mem = gen_rtx (MEM, mode, regi); + mem = gen_rtx_MEM (mode, regi); } if (store_p) @@ -2561,9 +2561,8 @@ m88k_function_arg (args_so_far, mode, type, named) || bytes != UNITS_PER_WORD)) return (rtx) 0; - return gen_rtx (REG, - ((mode == BLKmode) ? TYPE_MODE (type) : mode), - 2 + args_so_far); + return gen_rtx_REG (((mode == BLKmode) ? TYPE_MODE (type) : mode), + 2 + args_so_far); } /* Do what is necessary for `va_start'. We look at the current function @@ -2788,15 +2787,14 @@ emit_bcnd (op, label) rtx label; { if (m88k_compare_op1 == const0_rtx) - emit_jump_insn( gen_bcnd ( - gen_rtx (op, VOIDmode,m88k_compare_op0, const0_rtx), - label)); + emit_jump_insn (gen_bcnd + (gen_rtx (op, VOIDmode,m88k_compare_op0, const0_rtx), + label)); else if (m88k_compare_op0 == const0_rtx) - emit_jump_insn( gen_bcnd( - gen_rtx( - swap_condition (op), - VOIDmode, m88k_compare_op1, const0_rtx), - label)); + emit_jump_insn (gen_bcnd + (gen_rtx (swap_condition (op), + VOIDmode, m88k_compare_op1, const0_rtx), + label)); else if (op != EQ && op != NE) emit_jump_insn (gen_bxx (emit_test (op, VOIDmode), label)); else diff --git a/gcc/config/m88k/m88k.h b/gcc/config/m88k/m88k.h index 5017d8d901b..707bd3cebdd 100644 --- a/gcc/config/m88k/m88k.h +++ b/gcc/config/m88k/m88k.h @@ -975,9 +975,8 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, If the precise function being called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, \ - TYPE_MODE (VALTYPE) == BLKmode ? SImode : TYPE_MODE (VALTYPE), \ - 2) + gen_rtx_REG (TYPE_MODE (VALTYPE) == BLKmode ? SImode : TYPE_MODE (VALTYPE), \ + 2) /* Define this if it differs from FUNCTION_VALUE. */ /* #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) ... */ @@ -997,7 +996,7 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 2) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 2) /* True if N is a possible register number for a function value as seen by the caller. */ @@ -1239,8 +1238,8 @@ extern struct rtx_def *m88k_va_arg (); #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 40)), FNADDR); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 36)), CXT); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 40)), FNADDR); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 36)), CXT); \ } /*** Library Subroutine Names ***/ @@ -1416,23 +1415,23 @@ extern struct rtx_def *m88k_va_arg (); #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ { \ if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ - copy_to_mode_reg (SImode, XEXP (X, 1))); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ + copy_to_mode_reg (SImode, XEXP (X, 1))); \ if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0))) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \ - copy_to_mode_reg (SImode, XEXP (X, 0))); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ + copy_to_mode_reg (SImode, XEXP (X, 0))); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \ - force_operand (XEXP (X, 0), 0)); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ + force_operand (XEXP (X, 0), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ - force_operand (XEXP (X, 1), 0)); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ + force_operand (XEXP (X, 1), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == PLUS) \ - (X) = gen_rtx (PLUS, Pmode, force_operand (XEXP (X, 0), NULL_RTX),\ - XEXP (X, 1)); \ + (X) = gen_rtx_PLUS (Pmode, force_operand (XEXP (X, 0), NULL_RTX),\ + XEXP (X, 1)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == PLUS) \ - (X) = gen_rtx (PLUS, Pmode, XEXP (X, 0), \ - force_operand (XEXP (X, 1), NULL_RTX)); \ + (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \ + force_operand (XEXP (X, 1), NULL_RTX)); \ if (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST \ || GET_CODE (X) == LABEL_REF) \ (X) = legitimize_address (flag_pic, X, 0, 0); \ diff --git a/gcc/config/m88k/m88k.md b/gcc/config/m88k/m88k.md index edab3f706ae..a82a528c420 100644 --- a/gcc/config/m88k/m88k.md +++ b/gcc/config/m88k/m88k.md @@ -1,5 +1,5 @@ ;;- Machine description for the Motorola 88000 for GNU C compiler -;;; Copyright (C) 1988, 92-96, 1999 Free Software Foundation, Inc. +;;; Copyright (C) 1988, 92-96, 1998, 1999 Free Software Foundation, Inc. ;; Contributed by Michael Tiemann (tiemann@mcc.com) ;; Currently maintained by (gcc@dg-rtp.dg.com) @@ -432,24 +432,25 @@ (match_dup 2))) (set (match_dup 0) (neg:SI (match_op_dup 1 [(match_dup 5) (const_int 0)])))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0); + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0); if (GET_CODE (operands[1]) == GET_CODE (operands[3])) ; /* The conditions match. */ else if (GET_CODE (operands[1]) == reverse_condition (GET_CODE (operands[3]))) /* Reverse the condition by complimenting the compare word. */ - operands[4] = gen_rtx (NOT, CCmode, operands[4]); + operands[4] = gen_rtx_NOT (CCmode, operands[4]); else { /* Make the condition pairs line up by rotating the compare word. */ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[4] = gen_rtx (ROTATE, CCmode, operands[4], - GEN_INT (((cv2 & ~1) - (cv1 & ~1)) & 0x1f)); + operands[4] = gen_rtx_ROTATE (CCmode, operands[4], + GEN_INT (((cv2 & ~1) - (cv1 & ~1)) + & 0x1f)); /* Reverse the condition if needed. */ if ((cv1 & 1) != (cv2 & 1)) - operands[4] = gen_rtx (NOT, CCmode, operands[4]); + operands[4] = gen_rtx_NOT (CCmode, operands[4]); }") (define_split @@ -469,7 +470,7 @@ (match_dup 2))) (set (match_dup 0) (neg:SI (match_op_dup 1 [(match_dup 5) (const_int 0)])))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0); + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0); if (GET_CODE (operands[1]) == GET_CODE (operands[3])) ; /* The conditions match. */ else @@ -478,8 +479,8 @@ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[4] = gen_rtx (ROTATE, CCmode, operands[4], - GEN_INT ((cv2 - cv1) & 0x1f)); + operands[4] = gen_rtx_ROTATE (CCmode, operands[4], + GEN_INT ((cv2 - cv1) & 0x1f)); }") (define_split @@ -499,7 +500,7 @@ (match_dup 4))) (set (match_dup 0) (neg:SI (match_op_dup 3 [(match_dup 5) (const_int 0)])))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0); + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0); if (GET_CODE (operands[1]) == reverse_condition (GET_CODE (operands[3]))) ; @@ -509,8 +510,9 @@ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[2] = gen_rtx (ROTATE, CCmode, operands[2], - GEN_INT (((cv1 & ~1) - (cv2 & ~1)) & 0x1f)); + operands[2] = gen_rtx_ROTATE (CCmode, operands[2], + GEN_INT (((cv1 & ~1) - (cv2 & ~1)) + & 0x1f)); }") (define_split @@ -529,10 +531,10 @@ (match_dup 2))) (set (match_dup 0) (match_op_dup 1 [(match_dup 5) (const_int 0)]))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0); + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0); /* Reverse the condition by complimenting the compare word. */ if (GET_CODE (operands[1]) != GET_CODE (operands[3])) - operands[4] = gen_rtx (NOT, CCmode, operands[4]);") + operands[4] = gen_rtx_NOT (CCmode, operands[4]);") (define_split [(set (match_operand:SI 0 "register_operand" "=r") @@ -549,7 +551,7 @@ (match_dup 2))) (set (match_dup 0) (match_op_dup 1 [(match_dup 5) (const_int 0)]))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0);") + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0);") (define_split [(set (match_operand:SI 0 "register_operand" "=r") @@ -566,7 +568,7 @@ (match_dup 2))) (set (match_dup 0) (match_op_dup 1 [(match_dup 5) (const_int 0)]))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0);") + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0);") (define_split [(set (match_operand:SI 0 "register_operand" "=r") @@ -585,23 +587,24 @@ (match_dup 2))) (set (match_dup 0) (neg:SI (match_op_dup 1 [(match_dup 5) (const_int 0)])))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0); + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0); if (GET_CODE (operands[1]) == GET_CODE (operands[3])) ; /* The conditions match. */ else if (GET_CODE (operands[1]) == reverse_condition (GET_CODE (operands[3]))) /* Reverse the condition by complimenting the compare word. */ - operands[4] = gen_rtx (NOT, CCmode, operands[4]); + operands[4] = gen_rtx_NOT (CCmode, operands[4]); else { /* Make the condition pairs line up by rotating the compare word. */ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[4] = gen_rtx (ROTATE, CCmode, operands[4], - GEN_INT (((cv2 & ~1) - (cv1 & ~1)) & 0x1f)); + operands[4] = gen_rtx_ROTATE (CCmode, operands[4], + GEN_INT (((cv2 & ~1) - (cv1 & ~1)) + & 0x1f)); /* Reverse the condition if needed. */ if ((cv1 & 1) != (cv2 & 1)) - operands[4] = gen_rtx (NOT, CCmode, operands[4]); + operands[4] = gen_rtx_NOT (CCmode, operands[4]); }") (define_split @@ -621,7 +624,7 @@ (match_dup 2))) (set (match_dup 0) (neg:SI (match_op_dup 1 [(match_dup 5) (const_int 0)])))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0); + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0); if (GET_CODE (operands[1]) == GET_CODE (operands[3])) ; /* The conditions match. */ else @@ -629,8 +632,8 @@ /* Make the condition pairs line up by rotating the compare word. */ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[4] = gen_rtx (ROTATE, CCmode, operands[4], - GEN_INT ((cv2 - cv1) & 0x1f)); + operands[4] = gen_rtx_ROTATE (CCmode, operands[4], + GEN_INT ((cv2 - cv1) & 0x1f)); }") (define_split @@ -650,7 +653,7 @@ (match_dup 4))) (set (match_dup 0) (neg:SI (match_op_dup 3 [(match_dup 5) (const_int 0)])))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0); + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0); if (GET_CODE (operands[1]) == reverse_condition (GET_CODE (operands[3]))) ; @@ -659,8 +662,9 @@ /* Make the condition pairs line up by rotating the compare word. */ int cv1 = condition_value (operands[1]); int cv2 = condition_value (operands[3]); - operands[2] = gen_rtx (ROTATE, CCmode, operands[2], - GEN_INT (((cv1 & ~1) - (cv2 & ~1)) & 0x1f)); + operands[2] = gen_rtx_ROTATE (CCmode, operands[2], + GEN_INT (((cv1 & ~1) - (cv2 & ~1)) + & 0x1f)); }") (define_split @@ -679,10 +683,10 @@ (match_dup 2))) (set (match_dup 0) (match_op_dup 1 [(match_dup 5) (const_int 0)]))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0); + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0); /* Reverse the condition by complimenting the compare word. */ if (GET_CODE (operands[1]) != GET_CODE (operands[3])) - operands[4] = gen_rtx (NOT, CCmode, operands[4]);") + operands[4] = gen_rtx_NOT (CCmode, operands[4]);") (define_split [(set (match_operand:SI 0 "register_operand" "=r") @@ -699,7 +703,7 @@ (match_dup 2))) (set (match_dup 0) (match_op_dup 1 [(match_dup 5) (const_int 0)]))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0);") + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0);") (define_split [(set (match_operand:SI 0 "register_operand" "=r") @@ -716,7 +720,7 @@ (match_dup 4))) (set (match_dup 0) (match_op_dup 3 [(match_dup 5) (const_int 0)]))] - "operands[5] = gen_rtx(SUBREG, CCEVENmode, operands[5], 0);") + "operands[5] = gen_rtx_SUBREG (CCEVENmode, operands[5], 0);") ;; Logical operations on compare words. @@ -1786,7 +1790,7 @@ DONE; /* We don't want the clobber emitted, so handle this ourselves. */ - emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1])); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1])); DONE; }") @@ -2279,8 +2283,8 @@ { operands[1] = legitimize_address (flag_pic, operands[1], 0, 0); - emit_insn (gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (ZERO_EXTEND, SImode, operands[1]))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_ZERO_EXTEND (SImode, operands[1]))); DONE; } }") @@ -2852,7 +2856,7 @@ if (TARGET_USE_DIV) { - emit_move_insn (op0, gen_rtx (DIV, SImode, op1, op2)); + emit_move_insn (op0, gen_rtx_DIV (SImode, op1, op2)); if (TARGET_CHECK_ZERO_DIV && GET_CODE (op2) != CONST_INT) { rtx label = gen_label_rtx (); @@ -2881,7 +2885,7 @@ emit_insn (gen_cmpsi (op2, const0_rtx)); emit_jump_insn (gen_bgt (label1)); /* constant / 0-or-negative */ - emit_move_insn (op0, gen_rtx (UDIV, SImode, op1, neg_op2)); + emit_move_insn (op0, gen_rtx_UDIV (SImode, op1, neg_op2)); if (!neg) emit_insn (gen_negsi2 (op0, op0)); @@ -2891,7 +2895,7 @@ emit_barrier (); emit_label (label1); /* constant / positive */ - emit_move_insn (op0, gen_rtx (UDIV, SImode, op1, op2)); + emit_move_insn (op0, gen_rtx_UDIV (SImode, op1, op2)); if (neg) emit_insn (gen_negsi2 (op0, op0)); } @@ -2914,7 +2918,7 @@ emit_insn (gen_cmpsi (op1, const0_rtx)); emit_jump_insn (gen_bge (label1)); /* 0-or-negative / constant */ - emit_move_insn (op0, gen_rtx (UDIV, SImode, neg_op1, op2)); + emit_move_insn (op0, gen_rtx_UDIV (SImode, neg_op1, op2)); if (!neg) emit_insn (gen_negsi2 (op0, op0)); @@ -2922,7 +2926,7 @@ emit_barrier (); emit_label (label1); /* positive / constant */ - emit_move_insn (op0, gen_rtx (UDIV, SImode, op1, op2)); + emit_move_insn (op0, gen_rtx_UDIV (SImode, op1, op2)); if (neg) emit_insn (gen_negsi2 (op0, op0)); } @@ -2944,7 +2948,7 @@ emit_insn (gen_cmpsi (op1, const0_rtx)); emit_jump_insn (gen_bge (label2)); /* negative / negative-or-0 */ - emit_move_insn (op0, gen_rtx (UDIV, SImode, neg_op1, neg_op2)); + emit_move_insn (op0, gen_rtx_UDIV (SImode, neg_op1, neg_op2)); if (TARGET_CHECK_ZERO_DIV) { @@ -2958,7 +2962,7 @@ emit_barrier (); emit_label (label2); /* pos.-or-0 / neg.-or-0 */ - emit_move_insn (op0, gen_rtx (UDIV, SImode, op1, neg_op2)); + emit_move_insn (op0, gen_rtx_UDIV (SImode, op1, neg_op2)); if (TARGET_CHECK_ZERO_DIV) { @@ -2975,13 +2979,13 @@ emit_insn (gen_cmpsi (op1, const0_rtx)); emit_jump_insn (gen_bge (label3)); /* negative / positive */ - emit_move_insn (op0, gen_rtx (UDIV, SImode, neg_op1, op2)); + emit_move_insn (op0, gen_rtx_UDIV (SImode, neg_op1, op2)); emit_insn (gen_negsi2 (op0, op0)); emit_jump_insn (gen_jump (join_label)); emit_barrier (); emit_label (label3); /* positive-or-0 / positive */ - emit_move_insn (op0, gen_rtx (UDIV, SImode, op1, op2)); + emit_move_insn (op0, gen_rtx_UDIV (SImode, op1, op2)); } emit_label (join_label); @@ -3016,8 +3020,8 @@ else if (GET_CODE (op2) != CONST_INT && TARGET_CHECK_ZERO_DIV) { rtx label = gen_label_rtx (); - emit_insn (gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (UDIV, SImode, operands[1], op2))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_UDIV (SImode, operands[1], op2))); emit_insn (gen_tcnd_divide_by_zero (op2, label)); emit_label (label); emit_insn (gen_dummy (operands[0])); @@ -3801,7 +3805,7 @@ { register rtx index_diff = gen_reg_rtx (SImode); register rtx low = GEN_INT (-INTVAL (operands[1])); - register rtx label = gen_rtx (LABEL_REF, VOIDmode, operands[3]); + register rtx label = gen_rtx_LABEL_REF (Pmode, operands[3]); register rtx base; if (! CASE_VECTOR_INSNS) @@ -3879,8 +3883,8 @@ { if (GET_CODE (operands[0]) == MEM && ! call_address_operand (XEXP (operands[0], 0), SImode)) - operands[0] = gen_rtx (MEM, GET_MODE (operands[0]), - force_reg (Pmode, XEXP (operands[0], 0))); + operands[0] = gen_rtx_MEM (GET_MODE (operands[0]), + force_reg (Pmode, XEXP (operands[0], 0))); }") (define_insn "" @@ -3901,8 +3905,8 @@ { if (GET_CODE (operands[1]) == MEM && ! call_address_operand (XEXP (operands[1], 0), SImode)) - operands[1] = gen_rtx (MEM, GET_MODE (operands[1]), - force_reg (Pmode, XEXP (operands[1], 0))); + operands[1] = gen_rtx_MEM (GET_MODE (operands[1]), + force_reg (Pmode, XEXP (operands[1], 0))); }") (define_insn "" diff --git a/gcc/config/m88k/sysv3.h b/gcc/config/m88k/sysv3.h index 546b6dfc1a6..11df8850ff0 100644 --- a/gcc/config/m88k/sysv3.h +++ b/gcc/config/m88k/sysv3.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Motorola m88100 running the AT&T/Unisoft/Motorola V.3 reference port. - Copyright (C) 1990, 1991, 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1990, 1991, 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by Ray Essick (ressick@mot.com) Enhanced by Tom Wood (Tom_Wood@NeXT.com) @@ -145,10 +145,11 @@ do { \ #undef INITIALIZE_TRAMPOLINE #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 40)), FNADDR); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 36)), CXT); \ - emit_call_insn (gen_call (gen_rtx (MEM, SImode, \ - gen_rtx (SYMBOL_REF, Pmode, \ - "__enable_execute_stack")), \ - const0_rtx)); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 40)), FNADDR); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 36)), CXT); \ + emit_call_insn (gen_call \ + (gen_rtx_MEM \ + (SImode, \ + gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack")), \ + const0_rtx)); \ } diff --git a/gcc/config/mips/abi64.h b/gcc/config/mips/abi64.h index ce1e5fe3831..3e4447e5bdd 100644 --- a/gcc/config/mips/abi64.h +++ b/gcc/config/mips/abi64.h @@ -134,7 +134,7 @@ extern struct rtx_def *mips_function_value (); ptr = plus_constant (virtual_incoming_args_rtx, \ - (mips_save_gp_regs \ * UNITS_PER_WORD)); \ - mem = gen_rtx (MEM, BLKmode, ptr); \ + mem = gen_rtx_MEM (BLKmode, ptr); \ /* va_arg is an array access in this case, which causes \ it to get MEM_IN_STRUCT_P set. We must set it here \ so that the insn scheduler won't assume that these \ @@ -167,15 +167,15 @@ extern struct rtx_def *mips_function_value (); for (i = 0; i < mips_save_fp_regs; i++) \ { \ rtx tem = \ - gen_rtx (MEM, mode, \ - plus_constant (virtual_incoming_args_rtx, \ - off)); \ + gen_rtx_MEM (mode, \ + plus_constant (virtual_incoming_args_rtx, \ + off)); \ emit_move_insn (tem, \ - gen_rtx (REG, mode, \ - ((CUM).fp_arg_words \ - + FP_ARG_FIRST \ - + i \ - + mips_fp_off))); \ + gen_rtx_REG (mode, \ + ((CUM).fp_arg_words \ + + FP_ARG_FIRST \ + + i \ + + mips_fp_off))); \ off += size; \ if (! TARGET_FLOAT64 || TARGET_SINGLE_FLOAT) \ ++i; \ @@ -193,8 +193,7 @@ extern struct rtx_def *mips_function_value (); argument itself. The pointer is passed in whatever way is appropriate for passing a pointer to that type. */ #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ - (mips_abi == ABI_EABI \ - && function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED)) + function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED) /* A C expression that indicates when it is the called function's responsibility to make a copy of arguments passed by invisible diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index a090a2e758e..e65e4be7a8d 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" #include <signal.h> - #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -41,6 +40,8 @@ Boston, MA 02111-1307, USA. */ #include "insn-codes.h" #include "recog.h" #include "toplev.h" +#include "output.h" + #include "tree.h" #include "function.h" #include "expr.h" @@ -1478,14 +1479,14 @@ mips_fill_delay_slot (ret, type, operands, cur_insn) mips_load_reg = set_reg; if (GET_MODE_SIZE (mode) > (FP_REG_P (REGNO (set_reg)) ? UNITS_PER_FPREG : UNITS_PER_WORD)) - mips_load_reg2 = gen_rtx (REG, SImode, REGNO (set_reg) + 1); + mips_load_reg2 = gen_rtx_REG (SImode, REGNO (set_reg) + 1); else mips_load_reg2 = 0; if (type == DELAY_HILO) { - mips_load_reg3 = gen_rtx (REG, SImode, MD_REG_FIRST); - mips_load_reg4 = gen_rtx (REG, SImode, MD_REG_FIRST+1); + mips_load_reg3 = gen_rtx_REG (SImode, MD_REG_FIRST); + mips_load_reg4 = gen_rtx_REG (SImode, MD_REG_FIRST+1); } else { @@ -1646,9 +1647,10 @@ embedded_pic_offset (x) pop_topmost_sequence (); } - return gen_rtx (CONST, Pmode, - gen_rtx (MINUS, Pmode, x, - XEXP (DECL_RTL (current_function_decl), 0))); + return + gen_rtx_CONST (Pmode, + gen_rtx_MINUS (Pmode, x, + XEXP (DECL_RTL (current_function_decl), 0))); } /* Return the appropriate instructions to move one operand to another. */ @@ -2790,7 +2792,7 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert) else if (test == ITEST_EQ) { reg2 = invert ? gen_reg_rtx (mode) : result; - convert_move (reg2, gen_rtx (LTU, mode, reg, const1_rtx), 0); + convert_move (reg2, gen_rtx_LTU (mode, reg, const1_rtx), 0); reg = reg2; } @@ -2857,7 +2859,7 @@ gen_conditional_branch (operands, test_code) case CMP_SF: case CMP_DF: if (mips_isa < 4) - reg = gen_rtx (REG, CCmode, FPSW_REGNUM); + reg = gen_rtx_REG (CCmode, FPSW_REGNUM); else reg = gen_reg_rtx (CCmode); @@ -2865,10 +2867,10 @@ gen_conditional_branch (operands, test_code) 0 in the instruction built below. The MIPS FPU handles inequality testing by testing for equality and looking for a false result. */ - emit_insn (gen_rtx (SET, VOIDmode, reg, - gen_rtx (test_code == NE ? EQ : test_code, - CCmode, cmp0, cmp1))); - + emit_insn (gen_rtx_SET (VOIDmode, reg, + gen_rtx (test_code == NE ? EQ : test_code, + CCmode, cmp0, cmp1))); + test_code = test_code == NE ? EQ : NE; mode = CCmode; cmp0 = reg; @@ -2882,7 +2884,7 @@ gen_conditional_branch (operands, test_code) /* Generate the branch. */ - label1 = gen_rtx (LABEL_REF, VOIDmode, operands[0]); + label1 = gen_rtx_LABEL_REF (VOIDmode, operands[0]); label2 = pc_rtx; if (invert) @@ -2891,10 +2893,11 @@ gen_conditional_branch (operands, test_code) label1 = pc_rtx; } - emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx, - gen_rtx (IF_THEN_ELSE, VOIDmode, - gen_rtx (test_code, mode, cmp0, cmp1), - label1, label2))); + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, + gen_rtx_IF_THEN_ELSE (VOIDmode, + gen_rtx (test_code, mode, + cmp0, cmp1), + label1, label2))); } /* Emit the common code for conditional moves. OPERANDS is the array @@ -2973,14 +2976,15 @@ gen_conditional_move (operands) abort (); cmp_reg = gen_reg_rtx (cmp_mode); - emit_insn (gen_rtx (SET, cmp_mode, cmp_reg, - gen_rtx (cmp_code, cmp_mode, op0, op1))); - - emit_insn (gen_rtx (SET, op_mode, operands[0], - gen_rtx (IF_THEN_ELSE, op_mode, - gen_rtx (move_code, VOIDmode, - cmp_reg, CONST0_RTX (SImode)), - operands[2], operands[3]))); + emit_insn (gen_rtx_SET (cmp_mode, cmp_reg, + gen_rtx (cmp_code, cmp_mode, op0, op1))); + + emit_insn (gen_rtx_SET (op_mode, operands[0], + gen_rtx_IF_THEN_ELSE (op_mode, + gen_rtx (move_code, VOIDmode, + cmp_reg, + CONST0_RTX (SImode)), + operands[2], operands[3]))); } /* Write a loop to move a constant number of bytes. @@ -3097,13 +3101,13 @@ block_move_call (dest_reg, src_reg, bytes_rtx) bytes_rtx = convert_to_mode (Pmode, bytes_rtx, 1); #ifdef TARGET_MEM_FUNCTIONS - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "memcpy"), 0, + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "memcpy"), 0, VOIDmode, 3, dest_reg, Pmode, src_reg, Pmode, convert_to_mode (TYPE_MODE (sizetype), bytes_rtx, TREE_UNSIGNED (sizetype)), TYPE_MODE (sizetype)); #else - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "bcopy"), 0, + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "bcopy"), 0, VOIDmode, 3, src_reg, Pmode, dest_reg, Pmode, convert_to_mode (TYPE_MODE (integer_type_node), bytes_rtx, TREE_UNSIGNED (integer_type_node)), @@ -3502,23 +3506,23 @@ output_block_move (insn, operands, num_regs, move_type) abort (); if (GET_MODE (operands[i + 4]) != load_store[i].mode) - operands[i + 4] = gen_rtx (REG, load_store[i].mode, - REGNO (operands[i + 4])); + operands[i + 4] = gen_rtx_REG (load_store[i].mode, + REGNO (operands[i + 4])); offset = load_store[i].offset; xoperands[0] = operands[i + 4]; - xoperands[1] = gen_rtx (MEM, load_store[i].mode, - plus_constant (src_reg, offset)); + xoperands[1] = gen_rtx_MEM (load_store[i].mode, + plus_constant (src_reg, offset)); if (use_lwl_lwr) { int extra_offset = GET_MODE_SIZE (load_store[i].mode) - 1; - xoperands[2] = gen_rtx (MEM, load_store[i].mode, - plus_constant (src_reg, - extra_offset - + offset)); + xoperands[2] = gen_rtx_MEM (load_store[i].mode, + plus_constant (src_reg, + extra_offset + + offset)); } output_asm_insn (load_store[i].load, xoperands); @@ -3531,17 +3535,17 @@ output_block_move (insn, operands, num_regs, move_type) int offset = load_store[i].offset; xoperands[0] = operands[i + 4]; - xoperands[1] = gen_rtx (MEM, load_store[i].mode, - plus_constant (dest_reg, offset)); + xoperands[1] = gen_rtx_MEM (load_store[i].mode, + plus_constant (dest_reg, offset)); if (use_lwl_lwr) { int extra_offset = GET_MODE_SIZE (load_store[i].mode) - 1; - xoperands[2] = gen_rtx (MEM, load_store[i].mode, - plus_constant (dest_reg, - extra_offset - + offset)); + xoperands[2] = gen_rtx_MEM (load_store[i].mode, + plus_constant (dest_reg, + extra_offset + + offset)); } if (move_type == BLOCK_MOVE_NORMAL) @@ -3814,7 +3818,7 @@ function_arg (cum, mode, type, named) if (! type || TREE_CODE (type) != RECORD_TYPE || mips_abi == ABI_32 || mips_abi == ABI_EABI || mips_abi == ABI_O64 || ! named) - ret = gen_rtx (REG, mode, regbase + *arg_words + bias); + ret = gen_rtx_REG (mode, regbase + *arg_words + bias); else { /* The Irix 6 n32/n64 ABIs say that if any 64 bit chunk of the @@ -3834,7 +3838,7 @@ function_arg (cum, mode, type, named) /* If the whole struct fits a DFmode register, we don't need the PARALLEL. */ if (! field || mode == DFmode) - ret = gen_rtx (REG, mode, regbase + *arg_words + bias); + ret = gen_rtx_REG (mode, regbase + *arg_words + bias); else { /* Now handle the special case by returning a PARALLEL @@ -3853,7 +3857,7 @@ function_arg (cum, mode, type, named) /* assign_parms checks the mode of ENTRY_PARM, so we must use the actual mode here. */ - ret = gen_rtx (PARALLEL, mode, rtvec_alloc (chunks)); + ret = gen_rtx_PARALLEL (mode, rtvec_alloc (chunks)); bitpos = 0; regno = regbase + *arg_words + bias; @@ -3872,14 +3876,14 @@ function_arg (cum, mode, type, named) && TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field)) == bitpos && TREE_CODE (TREE_TYPE (field)) == REAL_TYPE && TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD) - reg = gen_rtx (REG, DFmode, - regno + FP_ARG_FIRST - GP_ARG_FIRST); + reg = gen_rtx_REG (DFmode, + regno + FP_ARG_FIRST - GP_ARG_FIRST); else - reg = gen_rtx (REG, word_mode, regno); - + reg = gen_rtx_REG (word_mode, regno); + XVECEXP (ret, 0, i) - = gen_rtx (EXPR_LIST, VOIDmode, reg, - GEN_INT (bitpos / BITS_PER_UNIT)); + = gen_rtx_EXPR_LIST (VOIDmode, reg, + GEN_INT (bitpos / BITS_PER_UNIT)); bitpos += 64; regno++; @@ -3915,7 +3919,7 @@ function_arg (cum, mode, type, named) { rtx amount = GEN_INT (BITS_PER_WORD - int_size_in_bytes (type) * BITS_PER_UNIT); - rtx reg = gen_rtx (REG, word_mode, regbase + *arg_words + bias); + rtx reg = gen_rtx_REG (word_mode, regbase + *arg_words + bias); if (TARGET_64BIT) cum->adjust[cum->num_adjusts++] = gen_ashldi3 (reg, reg, amount); @@ -5773,7 +5777,7 @@ save_restore_insns (store_p, large_reg, large_offset, file) && (unsigned HOST_WIDE_INT) (large_offset - gp_offset) < 32768 && (unsigned HOST_WIDE_INT) (large_offset - end_offset) < 32768) { - base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); + base_reg_rtx = gen_rtx_REG (Pmode, MIPS_TEMP2_REGNUM); base_offset = large_offset; if (file == 0) { @@ -5796,7 +5800,7 @@ save_restore_insns (store_p, large_reg, large_offset, file) else { - base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); + base_reg_rtx = gen_rtx_REG (Pmode, MIPS_TEMP2_REGNUM); base_offset = gp_offset; if (file == 0) { @@ -5990,7 +5994,7 @@ save_restore_insns (store_p, large_reg, large_offset, file) && (unsigned HOST_WIDE_INT) (large_offset - fp_offset) < 32768 && (unsigned HOST_WIDE_INT) (large_offset - end_offset) < 32768) { - base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); + base_reg_rtx = gen_rtx_REG (Pmode, MIPS_TEMP2_REGNUM); base_offset = large_offset; if (file == 0) { @@ -6014,7 +6018,7 @@ save_restore_insns (store_p, large_reg, large_offset, file) else { - base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); + base_reg_rtx = gen_rtx_REG (Pmode, MIPS_TEMP2_REGNUM); base_offset = fp_offset; if (file == 0) { @@ -6665,7 +6669,7 @@ mips_expand_prologue () if (TARGET_ABICALLS && (mips_abi != ABI_32 && mips_abi != ABI_O64)) emit_insn (gen_loadgp (XEXP (DECL_RTL (current_function_decl), 0), - gen_rtx (REG, DImode, 25))); + gen_rtx_REG (DImode, 25))); } /* If we are profiling, make sure no instructions are scheduled before @@ -6794,7 +6798,7 @@ mips_expand_epilogue () if (tsize > 32767 && ! TARGET_MIPS16) { - tmp_rtx = gen_rtx (REG, Pmode, MIPS_TEMP1_REGNUM); + tmp_rtx = gen_rtx_REG (Pmode, MIPS_TEMP1_REGNUM); emit_move_insn (tmp_rtx, tsize_rtx); tsize_rtx = tmp_rtx; } @@ -7111,12 +7115,13 @@ mips_function_value (valtype, func) strictly necessary. */ enum machine_mode field_mode = TYPE_MODE (TREE_TYPE (fields[0])); - return gen_rtx (PARALLEL, mode, - gen_rtvec (1, - gen_rtx (EXPR_LIST, VOIDmode, - gen_rtx (REG, field_mode, - FP_RETURN), - const0_rtx))); + return gen_rtx_PARALLEL + (mode, + gen_rtvec (1, + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (field_mode, + FP_RETURN), + const0_rtx))); } else if (i == 2) @@ -7130,23 +7135,24 @@ mips_function_value (valtype, func) int second_offset = TREE_INT_CST_LOW (DECL_FIELD_BITPOS (fields[1])); - return gen_rtx (PARALLEL, mode, - gen_rtvec (2, - gen_rtx (EXPR_LIST, VOIDmode, - gen_rtx (REG, first_mode, - FP_RETURN), - GEN_INT (first_offset - / BITS_PER_UNIT)), - gen_rtx (EXPR_LIST, VOIDmode, - gen_rtx (REG, second_mode, - FP_RETURN + 2), - GEN_INT (second_offset - / BITS_PER_UNIT)))); + return gen_rtx_PARALLEL + (mode, + gen_rtvec (2, + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (first_mode, + FP_RETURN), + GEN_INT (first_offset + / BITS_PER_UNIT)), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (second_mode, + FP_RETURN + 2), + GEN_INT (second_offset + / BITS_PER_UNIT)))); } } } - return gen_rtx (REG, mode, reg); + return gen_rtx_REG (mode, reg); } /* The implementation of FUNCTION_ARG_PASS_BY_REFERENCE. Return @@ -7161,6 +7167,18 @@ function_arg_pass_by_reference (cum, mode, type, named) { int size; + /* We must pass by reference if we would be both passing in registers + and the stack. This is because any subsequent partial arg would be + handled incorrectly in this case. + + ??? This is really a kludge. We should either fix GCC so that such + a situation causes an abort and then do something in the MIPS port + to prevent it, or add code to function.c to properly handle the case. */ + if (FUNCTION_ARG (*cum, mode, type, named) != 0 + && MUST_PASS_IN_STACK (mode, type)) + return 1; + + /* Otherwise, we only do this if EABI is selected. */ if (mips_abi != ABI_EABI) return 0; diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index e80eb6afeb9..084f5d2a925 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -1131,7 +1131,7 @@ while (0) #define DWARF_FRAME_RETURN_COLUMN (FP_REG_LAST + 1) /* Before the prologue, RA lives in r31. */ -#define INCOMING_RETURN_ADDR_RTX gen_rtx (REG, VOIDmode, GP_REG_FIRST + 31) +#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, GP_REG_FIRST + 31) /* Overrides for the COFF debug format. */ #define PUT_SDB_SCL(a) \ @@ -2164,7 +2164,7 @@ extern enum reg_class mips_secondary_reload_class (); #define RETURN_ADDR_RTX(count, frame) \ ((count == 0) \ - ? gen_rtx (MEM, Pmode, gen_rtx (REG, Pmode, RETURN_ADDRESS_POINTER_REGNUM))\ + ? gen_rtx_MEM (Pmode, gen_rtx_REG (Pmode, RETURN_ADDRESS_POINTER_REGNUM))\ : (rtx) 0) /* Structure to be filled in by compute_frame_size with register @@ -2706,19 +2706,19 @@ typedef struct mips_args { rtx addr = ADDR; \ if (Pmode == DImode) \ { \ - emit_move_insn (gen_rtx (MEM, DImode, plus_constant (addr, 32)), FUNC); \ - emit_move_insn (gen_rtx (MEM, DImode, plus_constant (addr, 40)), CHAIN);\ + emit_move_insn (gen_rtx_MEM (DImode, plus_constant (addr, 32)), FUNC); \ + emit_move_insn (gen_rtx_MEM (DImode, plus_constant (addr, 40)), CHAIN);\ } \ else \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (addr, 32)), FUNC); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (addr, 36)), CHAIN);\ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 32)), FUNC); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 36)), CHAIN);\ } \ \ /* Flush both caches. We need to flush the data cache in case \ the system has a write-back cache. */ \ /* ??? Should check the return value for errors. */ \ - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, CACHE_FLUSH_FUNC), \ + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, CACHE_FLUSH_FUNC), \ 0, VOIDmode, 3, addr, Pmode, \ GEN_INT (TRAMPOLINE_SIZE), TYPE_MODE (integer_type_node),\ GEN_INT (3), TYPE_MODE (integer_type_node)); \ @@ -3050,8 +3050,10 @@ typedef struct mips_args { if (mips_split_addresses && mips_check_split (X, MODE)) \ { \ /* ??? Is this ever executed? */ \ - X = gen_rtx (LO_SUM, Pmode, \ - copy_to_mode_reg (Pmode, gen_rtx (HIGH, Pmode, X)), X); \ + X = gen_rtx_LO_SUM (Pmode, \ + copy_to_mode_reg (Pmode, \ + gen_rtx (HIGH, Pmode, X)), \ + X); \ goto WIN; \ } \ \ @@ -3067,7 +3069,7 @@ typedef struct mips_args { \ emit_move_insn (ptr_reg, XEXP (XEXP (xinsn, 0), 0)); \ \ - X = gen_rtx (PLUS, Pmode, ptr_reg, constant); \ + X = gen_rtx_PLUS (Pmode, ptr_reg, constant); \ if (SMALL_INT (constant)) \ goto WIN; \ /* Otherwise we fall through so the code below will fix the \ @@ -3099,12 +3101,12 @@ typedef struct mips_args { emit_move_insn (int_reg, \ GEN_INT (INTVAL (xplus1) & ~ 0x7fff)); \ \ - emit_insn (gen_rtx (SET, VOIDmode, \ - ptr_reg, \ - gen_rtx (PLUS, Pmode, xplus0, int_reg))); \ + emit_insn (gen_rtx_SET (VOIDmode, \ + ptr_reg, \ + gen_rtx_PLUS (Pmode, xplus0, int_reg))); \ \ - X = gen_rtx (PLUS, Pmode, ptr_reg, \ - GEN_INT (INTVAL (xplus1) & 0x7fff)); \ + X = gen_rtx_PLUS (Pmode, ptr_reg, \ + GEN_INT (INTVAL (xplus1) & 0x7fff)); \ goto WIN; \ } \ } \ diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 7b860edc652..ff03d01e1d5 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -1,9 +1,9 @@ ;; Mips.md Machine Description for MIPS based processors +;; Copyright (C) 1989, 90-98, 1999 Free Software Foundation, Inc. ;; Contributed by A. Lichnewsky, lich@inria.inria.fr ;; Changes by Michael Meissner, meissner@osf.org ;; 64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and ;; Brendan Eich, brendan@microunity.com. -;; Copyright (C) 1989, 90-98, 1999 Free Software Foundation, Inc. ;; This file is part of GNU CC. @@ -1701,7 +1701,7 @@ rtx xoperands[10]; xoperands[0] = operands[0]; - xoperands[1] = gen_rtx (REG, SImode, LO_REGNUM); + xoperands[1] = gen_rtx_REG (SImode, LO_REGNUM); output_asm_insn (\"mult\\t%1,%2\", operands); output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands); @@ -1829,13 +1829,13 @@ output_asm_insn (\"dmult\\t%0,%1,%2\", operands); else { - rtx xoperands[10]; + rtx xoperands[10]; - xoperands[0] = operands[0]; - xoperands[1] = gen_rtx (REG, DImode, LO_REGNUM); + xoperands[0] = operands[0]; + xoperands[1] = gen_rtx_REG (DImode, LO_REGNUM); - output_asm_insn (\"dmult\\t%1,%2\", operands); - output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands); + output_asm_insn (\"dmult\\t%1,%2\", operands); + output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands); } return \"\"; }" @@ -4265,12 +4265,12 @@ move\\t%0,%z4\\n\\ emit_jump_insn (gen_bge (label1)); emit_insn (gen_fix_truncdfsi2 (operands[0], operands[1])); - emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx, - gen_rtx (LABEL_REF, VOIDmode, label2))); + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, + gen_rtx_LABEL_REF (VOIDmode, label2))); emit_barrier (); emit_label (label1); - emit_move_insn (reg2, gen_rtx (MINUS, DFmode, operands[1], reg1)); + emit_move_insn (reg2, gen_rtx_MINUS (DFmode, operands[1], reg1)); emit_move_insn (reg3, GEN_INT (0x80000000)); emit_insn (gen_fix_truncdfsi2 (operands[0], reg2)); @@ -4280,7 +4280,7 @@ move\\t%0,%z4\\n\\ /* allow REG_NOTES to be set on last insn (labels don't have enough fields, and can't be used for REG_NOTES anyway). */ - emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); DONE; } }") @@ -4308,12 +4308,12 @@ move\\t%0,%z4\\n\\ emit_jump_insn (gen_bge (label1)); emit_insn (gen_fix_truncdfdi2 (operands[0], operands[1])); - emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx, - gen_rtx (LABEL_REF, VOIDmode, label2))); + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, + gen_rtx_LABEL_REF (VOIDmode, label2))); emit_barrier (); emit_label (label1); - emit_move_insn (reg2, gen_rtx (MINUS, DFmode, operands[1], reg1)); + emit_move_insn (reg2, gen_rtx_MINUS (DFmode, operands[1], reg1)); emit_move_insn (reg3, GEN_INT (0x80000000)); emit_insn (gen_ashldi3 (reg3, reg3, GEN_INT (32))); @@ -4324,7 +4324,7 @@ move\\t%0,%z4\\n\\ /* allow REG_NOTES to be set on last insn (labels don't have enough fields, and can't be used for REG_NOTES anyway). */ - emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); DONE; } }") @@ -4352,12 +4352,12 @@ move\\t%0,%z4\\n\\ emit_jump_insn (gen_bge (label1)); emit_insn (gen_fix_truncsfsi2 (operands[0], operands[1])); - emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx, - gen_rtx (LABEL_REF, VOIDmode, label2))); + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, + gen_rtx_LABEL_REF (VOIDmode, label2))); emit_barrier (); emit_label (label1); - emit_move_insn (reg2, gen_rtx (MINUS, SFmode, operands[1], reg1)); + emit_move_insn (reg2, gen_rtx_MINUS (SFmode, operands[1], reg1)); emit_move_insn (reg3, GEN_INT (0x80000000)); emit_insn (gen_fix_truncsfsi2 (operands[0], reg2)); @@ -4367,7 +4367,7 @@ move\\t%0,%z4\\n\\ /* allow REG_NOTES to be set on last insn (labels don't have enough fields, and can't be used for REG_NOTES anyway). */ - emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); DONE; } }") @@ -4395,12 +4395,12 @@ move\\t%0,%z4\\n\\ emit_jump_insn (gen_bge (label1)); emit_insn (gen_fix_truncsfdi2 (operands[0], operands[1])); - emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx, - gen_rtx (LABEL_REF, VOIDmode, label2))); + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, + gen_rtx_LABEL_REF (VOIDmode, label2))); emit_barrier (); emit_label (label1); - emit_move_insn (reg2, gen_rtx (MINUS, SFmode, operands[1], reg1)); + emit_move_insn (reg2, gen_rtx_MINUS (SFmode, operands[1], reg1)); emit_move_insn (reg3, GEN_INT (0x80000000)); emit_insn (gen_ashldi3 (reg3, reg3, GEN_INT (32))); @@ -4411,7 +4411,7 @@ move\\t%0,%z4\\n\\ /* allow REG_NOTES to be set on last insn (labels don't have enough fields, and can't be used for REG_NOTES anyway). */ - emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); DONE; } }") @@ -4729,10 +4729,10 @@ move\\t%0,%z4\\n\\ rtx tem = ((reload_in_progress | reload_completed) ? operands[0] : gen_reg_rtx (mode)); - emit_insn (gen_rtx (SET, VOIDmode, tem, - gen_rtx (HIGH, mode, operands[1]))); + emit_insn (gen_rtx_SET (VOIDmode, tem, + gen_rtx_HIGH (mode, operands[1]))); - operands[1] = gen_rtx (LO_SUM, mode, tem, operands[1]); + operands[1] = gen_rtx_LO_SUM (mode, tem, operands[1]); } /* If we are generating embedded PIC code, and we are referring to a @@ -4746,8 +4746,8 @@ move\\t%0,%z4\\n\\ rtx temp; temp = embedded_pic_offset (operands[1]); - temp = gen_rtx (PLUS, Pmode, embedded_pic_fnaddr_rtx, - force_reg (DImode, temp)); + temp = gen_rtx_PLUS (Pmode, embedded_pic_fnaddr_rtx, + force_reg (DImode, temp)); emit_move_insn (operands[0], force_reg (DImode, temp)); DONE; } @@ -4762,7 +4762,7 @@ move\\t%0,%z4\\n\\ if (! SMALL_INT (temp2)) temp2 = force_reg (DImode, temp2); - emit_move_insn (operands[0], gen_rtx (PLUS, DImode, temp, temp2)); + emit_move_insn (operands[0], gen_rtx_PLUS (DImode, temp, temp2)); DONE; } @@ -4972,10 +4972,10 @@ move\\t%0,%z4\\n\\ "TARGET_64BIT" " { - rtx scratch = gen_rtx (REG, DImode, - (REGNO (operands[0]) == REGNO (operands[2]) - ? REGNO (operands[2]) + 1 - : REGNO (operands[2]))); + rtx scratch = gen_rtx_REG (DImode, + (REGNO (operands[0]) == REGNO (operands[2]) + ? REGNO (operands[2]) + 1 + : REGNO (operands[2]))); if (GET_CODE (operands[0]) == REG && REGNO (operands[0]) == HILO_REGNUM) { @@ -4985,7 +4985,7 @@ move\\t%0,%z4\\n\\ rtx addr = find_replacement (&XEXP (operands[1], 0)); rtx op1 = change_address (operands[1], VOIDmode, addr); - scratch = gen_rtx (REG, SImode, REGNO (scratch)); + scratch = gen_rtx_REG (SImode, REGNO (scratch)); memword = change_address (op1, SImode, NULL_RTX); offword = change_address (adj_offsettable_operand (op1, 4), SImode, NULL_RTX); @@ -5000,7 +5000,7 @@ move\\t%0,%z4\\n\\ loword = memword; } emit_move_insn (scratch, hiword); - emit_move_insn (gen_rtx (REG, SImode, 64), scratch); + emit_move_insn (gen_rtx_REG (SImode, 64), scratch); emit_move_insn (scratch, loword); emit_move_insn (gen_rtx (REG, SImode, 65), scratch); emit_insn (gen_rtx_USE (VOIDmode, operands[0])); @@ -5008,7 +5008,7 @@ move\\t%0,%z4\\n\\ else { emit_insn (gen_ashrdi3 (scratch, operands[1], GEN_INT (32))); - emit_insn (gen_movdi (gen_rtx (REG, DImode, 64), scratch)); + emit_insn (gen_movdi (gen_rtx_REG (DImode, 64), scratch)); emit_insn (gen_ashldi3 (scratch, operands[1], GEN_INT (32))); emit_insn (gen_ashrdi3 (scratch, scratch, GEN_INT (32))); emit_insn (gen_movdi (gen_rtx (REG, DImode, 65), scratch)); @@ -5018,10 +5018,10 @@ move\\t%0,%z4\\n\\ } if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == HILO_REGNUM) { - emit_insn (gen_movdi (scratch, gen_rtx (REG, DImode, 65))); + emit_insn (gen_movdi (scratch, gen_rtx_REG (DImode, 65))); emit_insn (gen_ashldi3 (scratch, scratch, GEN_INT (32))); emit_insn (gen_lshrdi3 (scratch, scratch, GEN_INT (32))); - emit_insn (gen_movdi (operands[0], gen_rtx (REG, DImode, 64))); + emit_insn (gen_movdi (operands[0], gen_rtx_REG (DImode, 64))); emit_insn (gen_ashldi3 (operands[0], operands[0], GEN_INT (32))); emit_insn (gen_iordi3 (operands[0], operands[0], scratch)); emit_insn (gen_rtx_USE (VOIDmode, operands[1])); @@ -5065,7 +5065,7 @@ move\\t%0,%z4\\n\\ rtx addr = find_replacement (&XEXP (operands[0], 0)); rtx op0 = change_address (operands[0], VOIDmode, addr); - scratch = gen_rtx (REG, SImode, REGNO (operands[2])); + scratch = gen_rtx_REG (SImode, REGNO (operands[2])); memword = change_address (op0, SImode, NULL_RTX); offword = change_address (adj_offsettable_operand (op0, 4), SImode, NULL_RTX); @@ -5079,9 +5079,9 @@ move\\t%0,%z4\\n\\ hiword = offword; loword = memword; } - emit_move_insn (scratch, gen_rtx (REG, SImode, 64)); + emit_move_insn (scratch, gen_rtx_REG (SImode, 64)); emit_move_insn (hiword, scratch); - emit_move_insn (scratch, gen_rtx (REG, SImode, 65)); + emit_move_insn (scratch, gen_rtx_REG (SImode, 65)); emit_move_insn (loword, scratch); emit_insn (gen_rtx_USE (VOIDmode, operands[1])); } @@ -5151,10 +5151,10 @@ move\\t%0,%z4\\n\\ rtx tem = ((reload_in_progress | reload_completed) ? operands[0] : gen_reg_rtx (mode)); - emit_insn (gen_rtx (SET, VOIDmode, tem, - gen_rtx (HIGH, mode, operands[1]))); + emit_insn (gen_rtx_SET (VOIDmode, tem, + gen_rtx_HIGH (mode, operands[1]))); - operands[1] = gen_rtx (LO_SUM, mode, tem, operands[1]); + operands[1] = gen_rtx_LO_SUM (mode, tem, operands[1]); } /* If we are generating embedded PIC code, and we are referring to a @@ -5168,8 +5168,8 @@ move\\t%0,%z4\\n\\ rtx temp; temp = embedded_pic_offset (operands[1]); - temp = gen_rtx (PLUS, Pmode, embedded_pic_fnaddr_rtx, - force_reg (SImode, temp)); + temp = gen_rtx_PLUS (Pmode, embedded_pic_fnaddr_rtx, + force_reg (SImode, temp)); emit_move_insn (operands[0], force_reg (SImode, temp)); DONE; } @@ -5184,7 +5184,7 @@ move\\t%0,%z4\\n\\ if (! SMALL_INT (temp2)) temp2 = force_reg (SImode, temp2); - emit_move_insn (operands[0], gen_rtx (PLUS, SImode, temp, temp2)); + emit_move_insn (operands[0], gen_rtx_PLUS (SImode, temp, temp2)); DONE; } @@ -5429,7 +5429,7 @@ move\\t%0,%z4\\n\\ if (TARGET_64BIT && GET_CODE (operands[0]) == REG && REGNO (operands[0]) == HILO_REGNUM) { - emit_insn (gen_movsi (gen_rtx (REG, SImode, 65), operands[1])); + emit_insn (gen_movsi (gen_rtx_REG (SImode, 65), operands[1])); emit_insn (gen_ashrsi3 (operands[2], operands[1], GEN_INT (31))); emit_insn (gen_movsi (gen_rtx (REG, SImode, 64), operands[2])); emit_insn (gen_rtx_USE (VOIDmode, operands[0])); @@ -5596,17 +5596,17 @@ move\\t%0,%z4\\n\\ if (GET_CODE (operands[1]) == MEM) source = change_address (operands[1], SFmode, NULL_RTX); else if (GET_CODE (operands[1]) == REG || GET_CODE (operands[1]) == SUBREG) - source = gen_rtx (REG, SFmode, true_regnum (operands[1])); + source = gen_rtx_REG (SFmode, true_regnum (operands[1])); else source = operands[1]; - fp1 = gen_rtx (REG, SFmode, REGNO (operands[2])); - fp2 = gen_rtx (REG, SFmode, REGNO (operands[2]) + 1); + fp1 = gen_rtx_REG (SFmode, REGNO (operands[2])); + fp2 = gen_rtx_REG (SFmode, REGNO (operands[2]) + 1); emit_insn (gen_move_insn (fp1, source)); - emit_insn (gen_move_insn (fp2, gen_rtx (REG, SFmode, 0))); - emit_insn (gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (LT, CCmode, fp2, fp1))); + emit_insn (gen_move_insn (fp2, gen_rtx_REG (SFmode, 0))); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_LT (CCmode, fp2, fp1))); DONE; }") @@ -5692,7 +5692,7 @@ move\\t%0,%z4\\n\\ (define_insn "" [(set (mem:SF (plus:SI (match_operand:SI 1 "register_operand" "d") (match_operand:SI 2 "register_operand" "d"))) - (match_operand:SF 0 "register_operand" "=f"))] + (match_operand:SF 0 "register_operand" "f"))] "mips_isa >= 4 && TARGET_HARD_FLOAT" "swxc1\\t%0,%1(%2)" [(set_attr "type" "store") @@ -5701,7 +5701,7 @@ move\\t%0,%z4\\n\\ (define_insn "" [(set (mem:SF (plus:DI (match_operand:DI 1 "se_register_operand" "d") (match_operand:DI 2 "se_register_operand" "d"))) - (match_operand:SF 0 "register_operand" "=f"))] + (match_operand:SF 0 "register_operand" "f"))] "mips_isa >= 4 && TARGET_HARD_FLOAT" "swxc1\\t%0,%1(%2)" [(set_attr "type" "store") @@ -5710,7 +5710,7 @@ move\\t%0,%z4\\n\\ (define_insn "" [(set (mem:DF (plus:SI (match_operand:SI 1 "register_operand" "d") (match_operand:SI 2 "register_operand" "d"))) - (match_operand:DF 0 "register_operand" "=f"))] + (match_operand:DF 0 "register_operand" "f"))] "mips_isa >= 4 && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" "sdxc1\\t%0,%1(%2)" [(set_attr "type" "store") @@ -5719,7 +5719,7 @@ move\\t%0,%z4\\n\\ (define_insn "" [(set (mem:DF (plus:DI (match_operand:DI 1 "se_register_operand" "d") (match_operand:DI 2 "se_register_operand" "d"))) - (match_operand:DF 0 "register_operand" "=f"))] + (match_operand:DF 0 "register_operand" "f"))] "mips_isa >= 4 && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" "sdxc1\\t%0,%1(%2)" [(set_attr "type" "store") @@ -6551,9 +6551,9 @@ move\\t%0,%z4\\n\\ { int amount = INTVAL (operands[2]); - operands[2] = GEN_INT ((amount & 31)); + operands[2] = GEN_INT (amount & 31); operands[4] = const0_rtx; - operands[5] = GEN_INT (((-amount) & 31)); + operands[5] = GEN_INT ((-amount) & 31); return \"sll\\t%M0,%M1,%2\;srl\\t%3,%L1,%5\;or\\t%M0,%M0,%3\;sll\\t%L0,%L1,%2\"; }" @@ -6592,8 +6592,8 @@ move\\t%0,%z4\\n\\ " { int amount = INTVAL (operands[2]); - operands[2] = GEN_INT ((amount & 31)); - operands[4] = GEN_INT (((-amount) & 31)); + operands[2] = GEN_INT (amount & 31); + operands[4] = GEN_INT ((-amount) & 31); }") @@ -6627,8 +6627,8 @@ move\\t%0,%z4\\n\\ " { int amount = INTVAL (operands[2]); - operands[2] = GEN_INT ((amount & 31)); - operands[4] = GEN_INT (((-amount) & 31)); + operands[2] = GEN_INT (amount & 31); + operands[4] = GEN_INT ((-amount) & 31); }") @@ -6905,8 +6905,8 @@ move\\t%0,%z4\\n\\ { int amount = INTVAL (operands[2]); - operands[2] = GEN_INT ((amount & 31)); - operands[4] = GEN_INT (((-amount) & 31)); + operands[2] = GEN_INT (amount & 31); + operands[4] = GEN_INT ((-amount) & 31); return \"srl\\t%L0,%L1,%2\;sll\\t%3,%M1,%4\;or\\t%L0,%L0,%3\;sra\\t%M0,%M1,%2\"; }" @@ -6945,8 +6945,8 @@ move\\t%0,%z4\\n\\ " { int amount = INTVAL (operands[2]); - operands[2] = GEN_INT ((amount & 31)); - operands[4] = GEN_INT (((-amount) & 31)); + operands[2] = GEN_INT (amount & 31); + operands[4] = GEN_INT ((-amount) & 31); }") @@ -6980,8 +6980,8 @@ move\\t%0,%z4\\n\\ " { int amount = INTVAL (operands[2]); - operands[2] = GEN_INT ((amount & 31)); - operands[4] = GEN_INT (((-amount) & 31)); + operands[2] = GEN_INT (amount & 31); + operands[4] = GEN_INT ((-amount) & 31); }") @@ -7290,8 +7290,8 @@ move\\t%0,%z4\\n\\ { int amount = INTVAL (operands[2]); - operands[2] = GEN_INT ((amount & 31)); - operands[4] = GEN_INT (((-amount) & 31)); + operands[2] = GEN_INT (amount & 31); + operands[4] = GEN_INT ((-amount) & 31); return \"srl\\t%L0,%L1,%2\;sll\\t%3,%M1,%4\;or\\t%L0,%L0,%3\;srl\\t%M0,%M1,%2\"; }" @@ -7330,8 +7330,8 @@ move\\t%0,%z4\\n\\ " { int amount = INTVAL (operands[2]); - operands[2] = GEN_INT ((amount & 31)); - operands[4] = GEN_INT (((-amount) & 31)); + operands[2] = GEN_INT (amount & 31); + operands[4] = GEN_INT ((-amount) & 31); }") @@ -7365,8 +7365,8 @@ move\\t%0,%z4\\n\\ " { int amount = INTVAL (operands[2]); - operands[2] = GEN_INT ((amount & 31)); - operands[4] = GEN_INT (((-amount) & 31)); + operands[2] = GEN_INT (amount & 31); + operands[4] = GEN_INT ((-amount) & 31); }") @@ -8775,7 +8775,7 @@ move\\t%0,%z4\\n\\ "!TARGET_MIPS16 && INTVAL (operands[2]) < 32767" "* { - operands[2] = GEN_INT (INTVAL (operands[2])+1); + operands[2] = GEN_INT (INTVAL (operands[2]) + 1); return \"sltu\\t%0,%1,%2\"; }" [(set_attr "type" "arith") @@ -8804,7 +8804,7 @@ move\\t%0,%z4\\n\\ "TARGET_64BIT && !TARGET_MIPS16 && INTVAL (operands[2]) < 32767" "* { - operands[2] = GEN_INT (INTVAL (operands[2])+1); + operands[2] = GEN_INT (INTVAL (operands[2]) + 1); return \"sltu\\t%0,%1,%2\"; }" [(set_attr "type" "arith") @@ -9514,8 +9514,8 @@ move\\t%0,%z4\\n\\ } emit_call_insn (gen_call_internal0 (operands[0], operands[1], - gen_rtx (REG, SImode, GP_REG_FIRST + 31))); - + gen_rtx_REG (SImode, + GP_REG_FIRST + 31))); DONE; } }") @@ -9694,7 +9694,7 @@ move\\t%0,%z4\\n\\ (XEXP (XVECEXP (operands[0], 0, 0), 0), operands[1], operands[2], XEXP (XVECEXP (operands[0], 0, 1), 0), - gen_rtx (REG, SImode, GP_REG_FIRST + 31))); + gen_rtx_REG (SImode, GP_REG_FIRST + 31))); DONE; } @@ -9704,7 +9704,8 @@ move\\t%0,%z4\\n\\ operands[0] = XEXP (XVECEXP (operands[0], 0, 0), 0); emit_call_insn (gen_call_value_internal0 (operands[0], operands[1], operands[2], - gen_rtx (REG, SImode, GP_REG_FIRST + 31))); + gen_rtx_REG (SImode, + GP_REG_FIRST + 31))); DONE; } @@ -9945,7 +9946,7 @@ move\\t%0,%z4\\n\\ ;; " ;; { ;; operands[0] = gen_reg_rtx (SImode); -;; operands[1] = gen_rtx (MEM, SImode, stack_pointer_rtx); +;; operands[1] = gen_rtx_MEM (SImode, stack_pointer_rtx); ;; MEM_VOLATILE_P (operands[1]) = TRUE; ;; ;; /* fall through and generate default code */ diff --git a/gcc/config/mn10200/mn10200.c b/gcc/config/mn10200/mn10200.c index 26205afeedb..cda180a5675 100644 --- a/gcc/config/mn10200/mn10200.c +++ b/gcc/config/mn10200/mn10200.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Matsushita MN10200 series - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). This file is part of GNU CC. @@ -20,7 +20,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "tree.h" #include "regs.h" @@ -276,7 +276,7 @@ print_operand (file, x, code) if (GET_CODE (x) != MEM) abort (); if (GET_CODE (XEXP (x, 0)) == REG) - x = gen_rtx (PLUS, PSImode, XEXP (x, 0), GEN_INT (0)); + x = gen_rtx_PLUS (PSImode, XEXP (x, 0), GEN_INT (0)); else x = XEXP (x, 0); fputc ('(', file); @@ -595,12 +595,12 @@ expand_prologue () if (!regs_ever_live[2]) { regs_ever_live[2] = 1; - zero_dreg = gen_rtx (REG, HImode, 2); + zero_dreg = gen_rtx_REG (HImode, 2); } if (!regs_ever_live[3]) { regs_ever_live[3] = 1; - zero_dreg = gen_rtx (REG, HImode, 3); + zero_dreg = gen_rtx_REG (HImode, 3); } } @@ -612,12 +612,12 @@ expand_prologue () if (!regs_ever_live[5]) { regs_ever_live[5] = 1; - zero_areg = gen_rtx (REG, HImode, 5); + zero_areg = gen_rtx_REG (HImode, 5); } if (!regs_ever_live[6]) { regs_ever_live[6] = 1; - zero_areg = gen_rtx (REG, HImode, 6); + zero_areg = gen_rtx_REG (HImode, 6); } } @@ -639,14 +639,14 @@ expand_prologue () { emit_insn (gen_addpsi3 (stack_pointer_rtx, stack_pointer_rtx, GEN_INT (-4))); - emit_move_insn (gen_rtx (MEM, PSImode, stack_pointer_rtx), - gen_rtx (REG, PSImode, STATIC_CHAIN_REGNUM)); + emit_move_insn (gen_rtx_MEM (PSImode, stack_pointer_rtx), + gen_rtx_REG (PSImode, STATIC_CHAIN_REGNUM)); } if (frame_pointer_needed) { /* Store a2 into a0 temporarily. */ - emit_move_insn (gen_rtx (REG, PSImode, 4), frame_pointer_rtx); + emit_move_insn (gen_rtx_REG (PSImode, 4), frame_pointer_rtx); /* Set up the frame pointer. */ emit_move_insn (frame_pointer_rtx, stack_pointer_rtx); @@ -671,11 +671,10 @@ expand_prologue () register 4 (a0). */ regno = (i == FRAME_POINTER_REGNUM && frame_pointer_needed) ? 4 : i; - emit_move_insn (gen_rtx (MEM, PSImode, - gen_rtx (PLUS, Pmode, - stack_pointer_rtx, - GEN_INT (offset))), - gen_rtx (REG, PSImode, regno)); + emit_move_insn (gen_rtx_MEM (PSImode, + plus_constant (stack_pointer_rtx, + offset)), + gen_rtx_REG (PSImode, regno)); offset += 4; } } @@ -684,10 +683,10 @@ expand_prologue () expects to find it. */ if (current_function_needs_context) { - emit_move_insn (gen_rtx (REG, PSImode, STATIC_CHAIN_REGNUM), + emit_move_insn (gen_rtx_REG (PSImode, STATIC_CHAIN_REGNUM), gen_rtx (MEM, PSImode, - gen_rtx (PLUS, PSImode, stack_pointer_rtx, - GEN_INT (size)))); + gen_rtx_PLUS (PSImode, stack_pointer_rtx, + GEN_INT (size)))); } } @@ -765,11 +764,9 @@ expand_epilogue () regno = ((i == FRAME_POINTER_REGNUM && frame_pointer_needed) ? temp_regno : i); - emit_move_insn (gen_rtx (REG, PSImode, regno), - gen_rtx (MEM, PSImode, - gen_rtx (PLUS, Pmode, - basereg, - GEN_INT (offset)))); + emit_move_insn (gen_rtx_REG (PSImode, regno), + gen_rtx_MEM (PSImode, + plus_constant (basereg, offset))); offset += 4; } } @@ -779,7 +776,7 @@ expand_epilogue () /* Deallocate this frame's stack. */ emit_move_insn (stack_pointer_rtx, frame_pointer_rtx); /* Restore the old frame pointer. */ - emit_move_insn (frame_pointer_rtx, gen_rtx (REG, PSImode, temp_regno)); + emit_move_insn (frame_pointer_rtx, gen_rtx_REG (PSImode, temp_regno)); } else if (size) { @@ -973,14 +970,14 @@ expand_a_shift (mode, code, operands) /* need a loop to get all the bits we want - we generate the code at emit time, but need to allocate a scratch reg now */ - emit_insn (gen_rtx - (PARALLEL, VOIDmode, + emit_insn (gen_rtx_PARALLEL + (VOIDmode, gen_rtvec (2, - gen_rtx (SET, VOIDmode, operands[0], - gen_rtx (code, mode, - operands[0], operands[2])), - gen_rtx (CLOBBER, VOIDmode, - gen_rtx (SCRATCH, HImode, 0))))); + gen_rtx_SET (VOIDmode, operands[0], + gen_rtx (code, mode, + operands[0], operands[2])), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_SCRATCH (HImode))))); return 1; } @@ -1375,10 +1372,10 @@ function_arg (cum, mode, type, named) switch (cum->nbytes / UNITS_PER_WORD) { case 0: - result = gen_rtx (REG, mode, 0); + result = gen_rtx_REG (mode, 0); break; case 1: - result = gen_rtx (REG, mode, 1); + result = gen_rtx_REG (mode, 1); break; default: result = 0; diff --git a/gcc/config/mn10200/mn10200.h b/gcc/config/mn10200/mn10200.h index 34b43225182..ce44d826da7 100644 --- a/gcc/config/mn10200/mn10200.h +++ b/gcc/config/mn10200/mn10200.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Matsushita MN10200 series - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). This file is part of GNU CC. @@ -528,12 +528,12 @@ extern struct rtx_def *mn10200_va_arg(); otherwise, FUNC is 0. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), TYPE_MODE (VALTYPE) == PSImode ? 4 : 0) + gen_rtx_REG (TYPE_MODE (VALTYPE), TYPE_MODE (VALTYPE) == PSImode ? 4 : 0) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, (MODE) == PSImode ? 4 : 0) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, (MODE) == PSImode ? 4 : 0) /* 1 if N is a possible register number for a function value. */ @@ -594,9 +594,9 @@ extern struct rtx_def *mn10200_va_arg(); #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, PSImode, plus_constant ((TRAMP), 20)), \ + emit_move_insn (gen_rtx_MEM (PSImode, plus_constant ((TRAMP), 20)), \ (CXT)); \ - emit_move_insn (gen_rtx (MEM, PSImode, plus_constant ((TRAMP), 24)), \ + emit_move_insn (gen_rtx_MEM (PSImode, plus_constant ((TRAMP), 24)), \ (FNADDR)); \ } @@ -605,7 +605,7 @@ extern struct rtx_def *mn10200_va_arg(); #define RETURN_ADDR_RTX(COUNT, FRAME) \ ((COUNT == 0) \ - ? gen_rtx (MEM, Pmode, frame_pointer_rtx) \ + ? gen_rtx_MEM (Pmode, frame_pointer_rtx) \ : (rtx) 0) @@ -1051,9 +1051,9 @@ do { char dstr[30]; \ #define INIT_TARGET_OPTABS \ do { \ sdiv_optab->handlers[(int) HImode].libfunc \ - = gen_rtx (SYMBOL_REF, Pmode, DIVHI3_LIBCALL); \ + = gen_rtx_SYMBOL_REF (Pmode, DIVHI3_LIBCALL); \ smod_optab->handlers[(int) HImode].libfunc \ - = gen_rtx (SYMBOL_REF, Pmode, MODHI3_LIBCALL); \ + = gen_rtx_SYMBOL_REF (Pmode, MODHI3_LIBCALL); \ } while (0) /* The assembler op to get a word. */ diff --git a/gcc/config/mn10200/mn10200.md b/gcc/config/mn10200/mn10200.md index 1fccbf4afe1..e9bbd02fdad 100644 --- a/gcc/config/mn10200/mn10200.md +++ b/gcc/config/mn10200/mn10200.md @@ -1,6 +1,5 @@ ;; GCC machine description for Matsushita MN10200 -;; Copyright (C) 1997, 1998 Free Software Foundation, Inc. - +;; Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. ;; Contributed by Jeff Law (law@cygnus.com). ;; This file is part of GNU CC. @@ -401,13 +400,13 @@ rtx ret, insns; start_sequence (); - ret = emit_library_call_value (gen_rtx (SYMBOL_REF, Pmode, \"__addsi3\"), + ret = emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, \"__addsi3\"), NULL_RTX, 1, SImode, 2, operands[1], SImode, operands[2], SImode); insns = get_insns (); end_sequence (); emit_libcall_block (insns, operands[0], ret, - gen_rtx (PLUS, SImode, operands[1], operands[2])); + gen_rtx_PLUS (SImode, operands[1], operands[2])); DONE; } else @@ -478,13 +477,13 @@ rtx ret, insns; start_sequence (); - ret = emit_library_call_value (gen_rtx (SYMBOL_REF, Pmode, \"__subsi3\"), + ret = emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, \"__subsi3\"), NULL_RTX, 1, SImode, 2, operands[1], SImode, operands[2], SImode); insns = get_insns (); end_sequence (); emit_libcall_block (insns, operands[0], ret, - gen_rtx (MINUS, SImode, operands[1], operands[2])); + gen_rtx_MINUS (SImode, operands[1], operands[2])); DONE; } else @@ -1275,9 +1274,9 @@ emit_move_insn (operands[0], operands[1]); while (count > 0) { - emit_insn (gen_rtx (SET, HImode, operands[0], - gen_rtx (ASHIFT, HImode, - operands[0], GEN_INT (1)))); + emit_insn (gen_rtx_SET (HImode, operands[0], + gen_rtx_ASHIFT (HImode, + operands[0], GEN_INT (1)))); count--; } DONE; @@ -1314,9 +1313,10 @@ emit_move_insn (operands[0], operands[1]); while (count > 0) { - emit_insn (gen_rtx (SET, HImode, operands[0], - gen_rtx (LSHIFTRT, HImode, - operands[0], GEN_INT (1)))); + emit_insn (gen_rtx_SET (HImode, operands[0], + gen_rtx_LSHIFTRT (HImode, + operands[0], + GEN_INT (1)))); count--; } DONE; @@ -1353,9 +1353,9 @@ emit_move_insn (operands[0], operands[1]); while (count > 0) { - emit_insn (gen_rtx (SET, HImode, operands[0], - gen_rtx (ASHIFTRT, HImode, - operands[0], GEN_INT (1)))); + emit_insn (gen_rtx_SET (HImode, operands[0], + gen_rtx_ASHIFTRT (HImode, operands[0], + GEN_INT (1)))); count--; } DONE; @@ -1407,9 +1407,9 @@ emit_move_insn (operands[0], operands[1]); while (count > 0) { - emit_insn (gen_rtx (SET, PSImode, operands[0], - gen_rtx (ASHIFT, PSImode, - operands[0], GEN_INT (1)))); + emit_insn (gen_rtx_SET (PSImode, operands[0], + gen_rtx_ASHIFT (PSImode, + operands[0], GEN_INT (1)))); count--; } DONE; @@ -1484,9 +1484,9 @@ emit_move_insn (operands[0], operands[1]); while (count > 0) { - emit_insn (gen_rtx (SET, SImode, operands[0], - gen_rtx (ASHIFT, SImode, - operands[0], GEN_INT (1)))); + emit_insn (gen_rtx_SET (SImode, operands[0], + gen_rtx_ASHIFT (SImode, + operands[0], GEN_INT (1)))); count--; } DONE; @@ -1498,13 +1498,13 @@ rtx ret, insns; start_sequence (); - ret = emit_library_call_value (gen_rtx (SYMBOL_REF, Pmode, \"__ashlsi3\"), + ret = emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, \"__ashlsi3\"), NULL_RTX, 1, SImode, 2, operands[1], SImode, operands[2], HImode); insns = get_insns (); end_sequence (); emit_libcall_block (insns, operands[0], ret, - gen_rtx (ASHIFT, SImode, operands[1], operands[2])); + gen_rtx_ASHIFT (SImode, operands[1], operands[2])); DONE; } else @@ -1542,9 +1542,9 @@ emit_move_insn (operands[0], operands[1]); while (count > 0) { - emit_insn (gen_rtx (SET, SImode, operands[0], - gen_rtx (LSHIFTRT, SImode, - operands[0], GEN_INT (1)))); + emit_insn (gen_rtx_SET (SImode, operands[0], + gen_rtx_LSHIFTRT (SImode, operands[0], + GEN_INT (1)))); count--; } DONE; @@ -1556,13 +1556,13 @@ rtx ret, insns; start_sequence (); - ret = emit_library_call_value (gen_rtx (SYMBOL_REF, Pmode, \"__lshrsi3\"), + ret = emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, \"__lshrsi3\"), NULL_RTX, 1, SImode, 2, operands[1], SImode, operands[2], HImode); insns = get_insns (); end_sequence (); emit_libcall_block (insns, operands[0], ret, - gen_rtx (LSHIFTRT, SImode, operands[1], operands[2])); + gen_rtx_LSHIFTRT (SImode, operands[1], operands[2])); DONE; } else @@ -1600,9 +1600,9 @@ emit_move_insn (operands[0], operands[1]); while (count > 0) { - emit_insn (gen_rtx (SET, SImode, operands[0], - gen_rtx (ASHIFTRT, SImode, - operands[0], GEN_INT (1)))); + emit_insn (gen_rtx_SET (SImode, operands[0], + gen_rtx_ASHIFTRT (SImode, operands[0], + GEN_INT (1)))); count--; } DONE; @@ -1614,13 +1614,13 @@ rtx ret, insns; start_sequence (); - ret = emit_library_call_value (gen_rtx (SYMBOL_REF, Pmode, \"__ashrsi3\"), + ret = emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, \"__ashrsi3\"), NULL_RTX, 1, SImode, 2, operands[1], SImode, operands[2], HImode); insns = get_insns (); end_sequence (); emit_libcall_block (insns, operands[0], ret, - gen_rtx (ASHIFTRT, SImode, operands[1], operands[2])); + gen_rtx_ASHIFTRT (SImode, operands[1], operands[2])); DONE; } else diff --git a/gcc/config/mn10200/xm-mn10200.h b/gcc/config/mn10200/xm-mn10200.h index 7ebac70ed3f..5e291d0991a 100644 --- a/gcc/config/mn10200/xm-mn10200.h +++ b/gcc/config/mn10200/xm-mn10200.h @@ -1,5 +1,5 @@ /* Configuration for Matsushita MN10200. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GNU CC. @@ -38,10 +38,3 @@ Boston, MA 02111-1307, USA. */ tm.h is a symbolic link to the actual target specific file. */ #include "tm.h" - -#ifndef __STDC__ -extern char *malloc (), *realloc (), *calloc (); -#else -extern void *malloc (), *realloc (), *calloc (); -#endif -extern void free (); diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index 8703bf03134..d85f9d2dc00 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Matsushita MN10300 series - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). This file is part of GNU CC. @@ -20,7 +20,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "tree.h" #include "regs.h" @@ -233,7 +233,7 @@ print_operand (file, x, code) case 'A': fputc ('(', file); if (GET_CODE (XEXP (x, 0)) == REG) - output_address (gen_rtx (PLUS, SImode, XEXP (x, 0), GEN_INT (0))); + output_address (gen_rtx_PLUS (SImode, XEXP (x, 0), GEN_INT (0))); else output_address (XEXP (x, 0)); fputc (')', file); @@ -314,9 +314,9 @@ print_operand_address (file, addr) { case REG: if (addr == stack_pointer_rtx) - print_operand_address (file, gen_rtx (PLUS, SImode, - stack_pointer_rtx, - GEN_INT (0))); + print_operand_address (file, gen_rtx_PLUS (SImode, + stack_pointer_rtx, + GEN_INT (0))); else print_operand (file, addr, 0); break; @@ -376,14 +376,12 @@ expand_prologue () need to be flushed back to the stack. */ if (current_function_varargs) { - emit_move_insn (gen_rtx (MEM, SImode, - gen_rtx (PLUS, Pmode, stack_pointer_rtx, - GEN_INT (4))), - gen_rtx (REG, SImode, 0)); - emit_move_insn (gen_rtx (MEM, SImode, - gen_rtx (PLUS, Pmode, stack_pointer_rtx, - GEN_INT (8))), - gen_rtx (REG, SImode, 1)); + emit_move_insn (gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, 4)), + gen_rtx_REG (SImode, 0)); + emit_move_insn (gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, 8)), + gen_rtx_REG (SImode, 1)); } /* And now store all the registers onto the stack with a @@ -747,10 +745,10 @@ function_arg (cum, mode, type, named) switch (cum->nbytes / UNITS_PER_WORD) { case 0: - result = gen_rtx (REG, mode, 0); + result = gen_rtx_REG (mode, 0); break; case 1: - result = gen_rtx (REG, mode, 1); + result = gen_rtx_REG (mode, 1); break; default: result = 0; @@ -995,7 +993,7 @@ legitimize_address (x, oldx, mode) regy2 = force_reg (Pmode, force_operand (XEXP (y, 1), 0)); regx1 = force_reg (Pmode, gen_rtx (GET_CODE (y), Pmode, regx1, regy2)); - return force_reg (Pmode, gen_rtx (PLUS, Pmode, regx1, regy1)); + return force_reg (Pmode, gen_rtx_PLUS (Pmode, regx1, regy1)); } } return x; diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index b426413c422..a7686ca81cb 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Matsushita MN10300 series - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). This file is part of GNU CC. @@ -485,12 +485,12 @@ extern struct rtx_def *function_arg (); otherwise, FUNC is 0. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), POINTER_TYPE_P (VALTYPE) ? 4 : 0) + gen_rtx_REG (TYPE_MODE (VALTYPE), POINTER_TYPE_P (VALTYPE) ? 4 : 0) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0) /* 1 if N is a possible register number for a function value. */ @@ -544,9 +544,9 @@ extern struct rtx_def *function_arg (); #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 0x14)), \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 0x14)), \ (CXT)); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 0x18)), \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 0x18)), \ (FNADDR)); \ } /* A C expression whose value is RTL representing the value of the return @@ -560,7 +560,7 @@ extern struct rtx_def *function_arg (); #define RETURN_ADDR_RTX(COUNT, FRAME) \ ((COUNT == 0) \ - ? gen_rtx (MEM, Pmode, arg_pointer_rtx) \ + ? gen_rtx_MEM (Pmode, arg_pointer_rtx) \ : (rtx) 0) /* Emit code for a call to builtin_saveregs. We must emit USE insns which diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md index 8c3e2ac3cc0..59acf5ac397 100644 --- a/gcc/config/mn10300/mn10300.md +++ b/gcc/config/mn10300/mn10300.md @@ -1,7 +1,6 @@ ;; GCC machine description for Matsushita MN10300 -;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. - -;; Contributed by Jeff Law (law@cygnus.com). +;; Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +;; Contributed by Jeff Law (law@cygnus.com). ;; This file is part of GNU CC. @@ -159,8 +158,9 @@ && (GET_MODE_SIZE (GET_MODE (XEXP (operands[1], 1))) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (operands[1], 1)))))) emit_move_insn (operands[2], - gen_rtx (ZERO_EXTEND, GET_MODE (XEXP (operands[1], 1)), - SUBREG_REG (XEXP (operands[1], 1)))); + gen_rtx_ZERO_EXTEND + (GET_MODE (XEXP (operands[1], 1)), + SUBREG_REG (XEXP (operands[1], 1)))); else emit_move_insn (operands[2], XEXP (operands[1], 1)); emit_move_insn (operands[0], XEXP (operands[1], 0)); @@ -171,8 +171,9 @@ && (GET_MODE_SIZE (GET_MODE (XEXP (operands[1], 0))) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (operands[1], 0)))))) emit_move_insn (operands[2], - gen_rtx (ZERO_EXTEND, GET_MODE (XEXP (operands[1], 0)), - SUBREG_REG (XEXP (operands[1], 0)))); + gen_rtx_ZERO_EXTEND + (GET_MODE (XEXP (operands[1], 0)), + SUBREG_REG (XEXP (operands[1], 0)))); else emit_move_insn (operands[2], XEXP (operands[1], 0)); emit_move_insn (operands[0], XEXP (operands[1], 1)); @@ -344,7 +345,7 @@ if (GET_CODE (temp) != REG) abort (); - if (reg_overlap_mentioned_p (gen_rtx (REG, SImode, REGNO (temp)), + if (reg_overlap_mentioned_p (gen_rtx_REG (SImode, REGNO (temp)), XEXP (operands[1], 0))) return \"mov %H1,%H0\;mov %L1,%L0\"; else @@ -476,7 +477,7 @@ if (GET_CODE (temp) != REG) abort (); - if (reg_overlap_mentioned_p (gen_rtx (REG, SImode, REGNO (temp)), + if (reg_overlap_mentioned_p (gen_rtx_REG (SImode, REGNO (temp)), XEXP (operands[1], 0))) return \"mov %H1,%H0\;mov %L1,%L0\"; else @@ -586,7 +587,7 @@ && GET_CODE (operands[2]) != CONST_INT) { rtx temp = gen_reg_rtx (SImode); - emit_move_insn (temp, gen_rtx (PLUS, SImode, operands[1], operands[2])); + emit_move_insn (temp, gen_rtx_PLUS (SImode, operands[1], operands[2])); emit_move_insn (operands[0], temp); DONE; } diff --git a/gcc/config/mn10300/xm-mn10300.h b/gcc/config/mn10300/xm-mn10300.h index 63d61c276c2..84f888be488 100644 --- a/gcc/config/mn10300/xm-mn10300.h +++ b/gcc/config/mn10300/xm-mn10300.h @@ -1,5 +1,5 @@ /* Configuration for Matsushita MN10300. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GNU CC. @@ -38,10 +38,3 @@ Boston, MA 02111-1307, USA. */ tm.h is a symbolic link to the actual target specific file. */ #include "tm.h" - -#ifndef __STDC__ -extern char *malloc (), *realloc (), *calloc (); -#else -extern void *malloc (), *realloc (), *calloc (); -#endif -extern void free (); diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c index cfc7cd2a12d..ab7535c1dec 100644 --- a/gcc/config/ns32k/ns32k.c +++ b/gcc/config/ns32k/ns32k.c @@ -1,5 +1,5 @@ /* Subroutines for assembler code output on the NS32000. - Copyright (C) 1988, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1988, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -18,7 +18,6 @@ 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. */ -/* Some output-actions in ns32k.md need these. */ #include "config.h" #include "system.h" #include "rtl.h" @@ -208,10 +207,10 @@ gen_indexed_expr (base, index, scale) /* This generates an invalid addressing mode, if BASE is fp or sp. This is handled by PRINT_OPERAND_ADDRESS. */ if (GET_CODE (base) != REG && GET_CODE (base) != CONST_INT) - base = gen_rtx (MEM, SImode, base); - addr = gen_rtx (MULT, SImode, index, - GEN_INT (1 << INTVAL (scale))); - addr = gen_rtx (PLUS, SImode, base, addr); + base = gen_rtx_MEM (SImode, base); + addr = gen_rtx_MULT (SImode, index, + GEN_INT (1 << INTVAL (scale))); + addr = gen_rtx_PLUS (SImode, base, addr); return addr; } @@ -246,8 +245,8 @@ split_di (operands, num, lo_half, hi_half) { if (GET_CODE (operands[num]) == REG) { - lo_half[num] = gen_rtx (REG, SImode, REGNO (operands[num])); - hi_half[num] = gen_rtx (REG, SImode, REGNO (operands[num]) + 1); + lo_half[num] = gen_rtx_REG (SImode, REGNO (operands[num])); + hi_half[num] = gen_rtx_REG (SImode, REGNO (operands[num]) + 1); } else if (CONSTANT_P (operands[num])) { @@ -324,14 +323,14 @@ output_move_double (operands) operands in OPERANDS to be suitable for the low-numbered word. */ if (optype0 == REGOP) - latehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + latehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else if (optype0 == OFFSOP) latehalf[0] = adj_offsettable_operand (operands[0], 4); else latehalf[0] = operands[0]; if (optype1 == REGOP) - latehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + latehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); else if (optype1 == OFFSOP) latehalf[1] = adj_offsettable_operand (operands[1], 4); else if (optype1 == CNSTOP) @@ -382,7 +381,7 @@ output_move_double (operands) xops[0] = XEXP (operands[1], 0); xops[1] = operands[0]; output_asm_insn ("addr %a0,%1", xops); - operands[1] = gen_rtx (MEM, DImode, operands[0]); + operands[1] = gen_rtx_MEM (DImode, operands[0]); latehalf[1] = adj_offsettable_operand (operands[1], 4); /* The first half has the overlap, Do the late half first. */ output_asm_insn (singlemove_string (latehalf), latehalf); @@ -968,7 +967,7 @@ print_operand_address (file, addr) case CONST_INT: case LABEL_REF: if (offset) - offset = gen_rtx (PLUS, SImode, tmp, offset); + offset = gen_rtx_PLUS (SImode, tmp, offset); else offset = tmp; break; @@ -1063,7 +1062,7 @@ print_operand_address (file, addr) case SYMBOL_REF: case LABEL_REF: if (offset) - offset = gen_rtx (PLUS, SImode, tmp, offset); + offset = gen_rtx_PLUS (SImode, tmp, offset); else offset = tmp; break; diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h index 5e0268c64c0..71df54afda4 100644 --- a/gcc/config/ns32k/ns32k.h +++ b/gcc/config/ns32k/ns32k.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. NS32000 version. - Copyright (C) 1988, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1988, 93, 94-98, 1999 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GNU CC. @@ -587,8 +587,8 @@ enum reg_class or perhaps F0 is there is fp support. */ #define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, MODE, \ - FLOAT_MODE_P(MODE) && TARGET_32081 ? F0_REGNUM: R0_REGNUM) + gen_rtx_REG (MODE, \ + FLOAT_MODE_P(MODE) && TARGET_32081 ? F0_REGNUM: R0_REGNUM) /* Define this if PCC uses the nonreentrant convention for returning structure and union values. */ @@ -653,7 +653,7 @@ enum reg_class It exists only to test register calling conventions. */ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ -((TARGET_REGPARM && (CUM) < 8) ? gen_rtx (REG, (MODE), (CUM) / 4) : 0) +((TARGET_REGPARM && (CUM) < 8) ? gen_rtx_REG ((MODE), (CUM) / 4) : 0) /* For an arg passed partly in registers and partly in memory, this is the number of registers used. @@ -941,8 +941,8 @@ operands on the 32k are stored). */ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 12)), CXT); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 16)), FNADDR); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 12)), CXT); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 16)), FNADDR); \ } /* This is the library routine that is used diff --git a/gcc/config/ns32k/ns32k.md b/gcc/config/ns32k/ns32k.md index c5fe1602b43..dfe66290216 100644 --- a/gcc/config/ns32k/ns32k.md +++ b/gcc/config/ns32k/ns32k.md @@ -1,5 +1,5 @@ ;;- Machine description for GNU compiler, ns32000 Version -;; Copyright (C) 1988, 1994, 1996, 1999 Free Software Foundation, Inc. +;; Copyright (C) 1988, 1994, 1996, 1998, 1999 Free Software Foundation, Inc. ;; Contributed by Michael Tiemann (tiemann@cygnus.com) ;; This file is part of GNU CC. @@ -221,7 +221,7 @@ if (REG_P (operands[1])) { rtx xoperands[2]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"movd %1,tos\", xoperands); output_asm_insn (\"movd %1,tos\", operands); return \"movl tos,%0\"; @@ -233,7 +233,7 @@ if (REG_P (operands[0])) { output_asm_insn (\"movl %1,tos\;movd tos,%0\", operands); - operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); return \"movd tos,%0\"; } else @@ -277,7 +277,7 @@ convrt.i[1] = CONST_DOUBLE_HIGH (operands[1]); convrt.f = convrt.d; - /* Is there a better machine-independent way to do this? */ + /* Is there a better machine-independent way to to this? */ operands[1] = GEN_INT (convrt.i[0]); return \"movd %1,%0\"; } @@ -304,7 +304,7 @@ if (REG_P (operands[1])) { rtx xoperands[2]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); output_asm_insn (\"movd %1,tos\", xoperands); output_asm_insn (\"movd %1,tos\", operands); return \"movl tos,%0\"; @@ -316,7 +316,7 @@ if (REG_P (operands[0])) { output_asm_insn (\"movl %1,tos\;movd tos,%0\", operands); - operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); return \"movd tos,%0\"; } else @@ -357,8 +357,7 @@ && REGNO (operands[0]) == FRAME_POINTER_REGNUM) return \"lprd fp,%1\"; if (GET_CODE (operands[1]) == CONST_DOUBLE) - operands[1] - = GEN_INT (CONST_DOUBLE_LOW (operands[1])); + operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); if (GET_CODE (operands[1]) == CONST_INT) { int i = INTVAL (operands[1]); @@ -437,8 +436,7 @@ if (i <= 7 && i >= -8) { if (INTVAL (operands[1]) > 7) - operands[1] = - GEN_INT (i); + operands[1] = GEN_INT (i); return \"movqw %1,%0\"; } return \"movw %1,%0\"; @@ -483,8 +481,7 @@ if (char_val <= 7 && char_val >= -8) { if (INTVAL (operands[1]) > 7) - operands[1] = - GEN_INT (char_val); + operands[1] = GEN_INT (char_val); return \"movqb %1,%0\"; } return \"movb %1,%0\"; @@ -1784,7 +1781,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1809,7 +1806,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1834,7 +1831,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1862,7 +1859,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1887,7 +1884,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1912,7 +1909,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1962,7 +1959,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -1987,7 +1984,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" @@ -2012,7 +2009,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, SImode, negate_rtx (SImode, operands[2])); + operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2])); }") (define_insn "" diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 640b02b71a7..4bb427efe0a 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -21,7 +21,6 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" - #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -662,8 +661,9 @@ legitimize_pic_address (orig, mode, reg) } else pic_ref = gen_rtx_MEM (Pmode, - gen_rtx_PLUS (Pmode, - pic_offset_table_rtx, orig)); + gen_rtx_PLUS (Pmode, pic_offset_table_rtx, + orig)); + current_function_uses_pic_offset_table = 1; RTX_UNCHANGING_P (pic_ref) = 1; emit_move_insn (reg, pic_ref); @@ -803,16 +803,14 @@ hppa_legitimize_address (x, oldx, mode) if (! VAL_14_BITS_P (newoffset) && GET_CODE (XEXP (x, 0)) == SYMBOL_REF) { - rtx const_part - = gen_rtx_CONST (VOIDmode, gen_rtx_PLUS (Pmode, - XEXP (x, 0), - GEN_INT (newoffset))); + rtx const_part = plus_constant (XEXP (x, 0), newoffset); rtx tmp_reg = force_reg (Pmode, gen_rtx_HIGH (Pmode, const_part)); ptr_reg = force_reg (Pmode, - gen_rtx_LO_SUM (Pmode, tmp_reg, const_part)); + gen_rtx_LO_SUM (Pmode, + tmp_reg, const_part)); } else { @@ -850,8 +848,9 @@ hppa_legitimize_address (x, oldx, mode) reg2 = force_reg (Pmode, force_operand (reg2, 0)); return force_reg (Pmode, gen_rtx_PLUS (Pmode, - gen_rtx_MULT (Pmode, reg2, - GEN_INT (val)), + gen_rtx_MULT (Pmode, + reg2, + GEN_INT (val)), reg1)); } @@ -926,11 +925,12 @@ hppa_legitimize_address (x, oldx, mode) reg1 = force_reg (Pmode, gen_rtx_PLUS (Pmode, reg1, GEN_INT (val))); /* We can now generate a simple scaled indexed address. */ - return force_reg (Pmode, - gen_rtx_PLUS (Pmode, - gen_rtx_MULT (Pmode, reg1, - XEXP (XEXP (idx, 0), 1)), - base)); + return + force_reg + (Pmode, gen_rtx_PLUS (Pmode, + gen_rtx_MULT (Pmode, reg1, + XEXP (XEXP (idx, 0), 1)), + base)); } /* If B + C is still a valid base register, then add them. */ @@ -948,7 +948,8 @@ hppa_legitimize_address (x, oldx, mode) reg2 = force_reg (Pmode, force_operand (reg2, 0)); return force_reg (Pmode, gen_rtx_PLUS (Pmode, - gen_rtx_MULT (Pmode, reg2, + gen_rtx_MULT (Pmode, + reg2, GEN_INT (val)), reg1)); } @@ -1034,9 +1035,10 @@ hppa_legitimize_address (x, oldx, mode) return force_reg (Pmode, gen_rtx_PLUS (Pmode, - gen_rtx_MULT (Pmode, reg2, + gen_rtx_MULT (Pmode, + reg2, GEN_INT (val)), - reg1)); + reg1)); } else if ((mode == DFmode || mode == SFmode) && GET_CODE (XEXP (y, 0)) == SYMBOL_REF @@ -1054,12 +1056,12 @@ hppa_legitimize_address (x, oldx, mode) regx2 = force_reg (Pmode, force_operand (regx2, 0)); regx2 = force_reg (Pmode, gen_rtx_fmt_ee (GET_CODE (y), Pmode, regx2, regx1)); - return force_reg (Pmode, - gen_rtx_PLUS (Pmode, - gen_rtx_MULT (Pmode, regx2, - XEXP (XEXP (x, 0), - 1)), - force_reg (Pmode, XEXP (y, 0)))); + return + force_reg (Pmode, + gen_rtx_PLUS (Pmode, + gen_rtx_MULT (Pmode, regx2, + XEXP (XEXP (x, 0), 1)), + force_reg (Pmode, XEXP (y, 0)))); } else if (GET_CODE (XEXP (y, 1)) == CONST_INT && INTVAL (XEXP (y, 1)) >= -4096 @@ -1201,8 +1203,8 @@ emit_move_sequence (operands, mode, scratch_reg) } else emit_move_insn (scratch_reg, XEXP (operand1, 0)); - emit_insn (gen_rtx_SET (VOIDmode, operand0, gen_rtx_MEM (mode, - scratch_reg))); + emit_insn (gen_rtx_SET (VOIDmode, operand0, + gen_rtx_MEM (mode, scratch_reg))); return 1; } else if (fp_reg_operand (operand1, mode) @@ -1266,7 +1268,8 @@ emit_move_sequence (operands, mode, scratch_reg) emit_move_sequence (xoperands, Pmode, 0); /* Now load the destination register. */ - emit_insn (gen_rtx_SET (mode, operand0, gen_rtx_MEM (mode, scratch_reg))); + emit_insn (gen_rtx_SET (mode, operand0, + gen_rtx_MEM (mode, scratch_reg))); return 1; } /* Handle secondary reloads for SAR. These occur when trying to load @@ -1495,7 +1498,8 @@ emit_move_sequence (operands, mode, scratch_reg) if (ishighonly) set = gen_rtx_SET (mode, operand0, temp); else - set = gen_rtx_SET (VOIDmode, operand0, + set = gen_rtx_SET (VOIDmode, + operand0, gen_rtx_LO_SUM (mode, temp, operand1)); emit_insn (gen_rtx_SET (VOIDmode, @@ -2515,18 +2519,16 @@ remove_useless_addtr_insns (insns, check_notes) Note in DISP > 8k case, we will leave the high part of the address in %r1. There is code in expand_hppa_{prologue,epilogue} that knows this.*/ + static void store_reg (reg, disp, base) int reg, disp, base; { if (VAL_14_BITS_P (disp)) - { - emit_move_insn (gen_rtx_MEM (word_mode, - gen_rtx_PLUS (Pmode, - gen_rtx_REG (Pmode, base), - GEN_INT (disp))), - gen_rtx_REG (word_mode, reg)); - } + emit_move_insn (gen_rtx_MEM (word_mode, + plus_constant (gen_rtx_REG (Pmode, base), + disp)), + gen_rtx_REG (word_mode, reg)); else { emit_move_insn (gen_rtx_REG (Pmode, 1), @@ -2545,18 +2547,16 @@ store_reg (reg, disp, base) Note in DISP > 8k case, we will leave the high part of the address in %r1. There is code in expand_hppa_{prologue,epilogue} that knows this.*/ + static void load_reg (reg, disp, base) int reg, disp, base; { if (VAL_14_BITS_P (disp)) - { - emit_move_insn (gen_rtx_REG (word_mode, reg), - gen_rtx_MEM (word_mode, - gen_rtx_PLUS (Pmode, - gen_rtx_REG (Pmode, base), - GEN_INT (disp)))); - } + emit_move_insn (gen_rtx_REG (word_mode, reg), + gen_rtx_MEM (word_mode, + plus_constant (gen_rtx_REG (Pmode, base), + disp))); else { emit_move_insn (gen_rtx_REG (Pmode, 1), @@ -2575,17 +2575,14 @@ load_reg (reg, disp, base) Note in DISP > 8k case, we will leave the high part of the address in %r1. There is code in expand_hppa_{prologue,epilogue} that knows this.*/ + static void -set_reg_plus_d(reg, base, disp) +set_reg_plus_d (reg, base, disp) int reg, base, disp; { if (VAL_14_BITS_P (disp)) - { - emit_move_insn (gen_rtx_REG (Pmode, reg), - gen_rtx_PLUS (Pmode, - gen_rtx_REG (Pmode, base), - GEN_INT (disp))); - } + emit_move_insn (gen_rtx_REG (Pmode, reg), + plus_constant (gen_rtx_REG (Pmode, base), disp)); else { emit_move_insn (gen_rtx_REG (Pmode, 1), @@ -2839,7 +2836,8 @@ hppa_expand_prologue() place to get the expected results. sprintf here is just to put something in the name. */ sprintf(hp_profile_label_name, "LP$%04d", -1); - hp_profile_label_rtx = gen_rtx_SYMBOL_REF (Pmode, hp_profile_label_name); + hp_profile_label_rtx = gen_rtx_SYMBOL_REF (Pmode, + hp_profile_label_name); if (current_function_returns_struct) store_reg (STRUCT_VALUE_REGNUM, - 12 - offsetadj, basereg); if (current_function_needs_context) @@ -6392,11 +6390,12 @@ pa_combine_instructions (insns) || anchor_attr == PA_COMBINE_TYPE_FMPY)) { /* Emit the new instruction and delete the old anchor. */ - emit_insn_before (gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (2, - PATTERN (anchor), - PATTERN (floater))), - anchor); + emit_insn_before (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (2, PATTERN (anchor), + PATTERN (floater))), + anchor); + PUT_CODE (anchor, NOTE); NOTE_LINE_NUMBER (anchor) = NOTE_INSN_DELETED; NOTE_SOURCE_FILE (anchor) = 0; @@ -6413,10 +6412,13 @@ pa_combine_instructions (insns) { rtx temp; /* Emit the new_jump instruction and delete the old anchor. */ - temp = emit_jump_insn_before (gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (2, PATTERN (anchor), - PATTERN (floater))), - anchor); + temp + = emit_jump_insn_before (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (2, PATTERN (anchor), + PATTERN (floater))), + anchor); + JUMP_LABEL (temp) = JUMP_LABEL (anchor); PUT_CODE (anchor, NOTE); NOTE_LINE_NUMBER (anchor) = NOTE_INSN_DELETED; diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 3f993e11971..5e60940c55a 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -880,7 +880,7 @@ int zdepi_cint_p (); #define LIBCALL_VALUE(MODE) \ gen_rtx_REG (MODE, \ (! TARGET_SOFT_FLOAT \ - && ((MODE) == SFmode || (MODE) == DFmode) ? 32 : 28)) + && ((MODE) == SFmode || (MODE) == DFmode) ? 32 : 28)) /* 1 if N is a possible register number for a function value as seen by the caller. */ @@ -1007,41 +1007,42 @@ struct hppa_args {int words, nargs_prototype, indirect; }; || !FLOAT_MODE_P (MODE) || TARGET_SOFT_FLOAT \ || (CUM).nargs_prototype > 0) \ ? gen_rtx_REG ((MODE), \ - (FUNCTION_ARG_SIZE ((MODE), (TYPE)) > 1 \ - ? (((!(CUM).indirect \ - || TARGET_PORTABLE_RUNTIME) \ - && (MODE) == DFmode \ - && ! TARGET_SOFT_FLOAT) \ - ? ((CUM).words ? 38 : 34) \ - : ((CUM).words ? 23 : 25)) \ - : (((!(CUM).indirect \ - || TARGET_PORTABLE_RUNTIME) \ - && (MODE) == SFmode \ - && ! TARGET_SOFT_FLOAT) \ - ? (32 + 2 * (CUM).words) \ - : (27 - (CUM).words - FUNCTION_ARG_SIZE ((MODE), \ - (TYPE))))))\ + (FUNCTION_ARG_SIZE ((MODE), (TYPE)) > 1 \ + ? (((!(CUM).indirect \ + || TARGET_PORTABLE_RUNTIME) \ + && (MODE) == DFmode \ + && ! TARGET_SOFT_FLOAT) \ + ? ((CUM).words ? 38 : 34) \ + : ((CUM).words ? 23 : 25)) \ + : (((!(CUM).indirect \ + || TARGET_PORTABLE_RUNTIME) \ + && (MODE) == SFmode \ + && ! TARGET_SOFT_FLOAT) \ + ? (32 + 2 * (CUM).words) \ + : (27 - (CUM).words - FUNCTION_ARG_SIZE ((MODE),\ + (TYPE))))))\ /* We are calling a non-prototyped function with floating point \ arguments using the portable conventions. */ \ - : gen_rtx_PARALLEL ((MODE), \ - gen_rtvec \ - (2, \ - gen_rtx_EXPR_LIST (VOIDmode, \ - gen_rtx_REG ((MODE), \ - (FUNCTION_ARG_SIZE ((MODE), (TYPE)) > 1 \ - ? ((CUM).words ? 38 : 34) \ - : (32 + 2 * (CUM).words))), \ - const0_rtx), \ - gen_rtx_EXPR_LIST (VOIDmode, \ - gen_rtx_REG ((MODE), \ - (FUNCTION_ARG_SIZE ((MODE), (TYPE)) > 1 \ - ? ((CUM).words ? 23 : 25) \ - : (27 - (CUM).words - \ - FUNCTION_ARG_SIZE ((MODE), \ - (TYPE))))), \ - const0_rtx))) \ - /* Pass this parameter in the stack. */ \ - : 0) + : (gen_rtx_PARALLEL \ + ((MODE), \ + gen_rtvec \ + (2, \ + gen_rtx_EXPR_LIST \ + (VOIDmode, \ + gen_rtx_REG ((MODE), \ + (FUNCTION_ARG_SIZE ((MODE), (TYPE)) > 1 \ + ? ((CUM).words ? 38 : 34) : (32 + 2 * (CUM).words))), \ + const0_rtx), \ + gen_rtx_EXPR_LIST \ + (VOIDmode, \ + gen_rtx_REG ((MODE), \ + (FUNCTION_ARG_SIZE ((MODE), (TYPE)) > 1 \ + ? ((CUM).words ? 23 : 25) \ + : (27 - (CUM).words - \ + FUNCTION_ARG_SIZE ((MODE), (TYPE))))), \ + const0_rtx)))) \ + /* Pass this parameter in the stack. */ \ + : 0) /* For an arg passed partly in registers and partly in memory, this is the number of registers used. diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index f28d1915643..eff818b37db 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -3107,8 +3107,7 @@ operands[1] = force_reg (SImode, operands[1]); operands[2] = force_reg (SImode, operands[2]); emit_insn (gen_umulsidi3 (scratch, operands[1], operands[2])); - emit_insn (gen_rtx_SET (VOIDmode, - operands[0], + emit_insn (gen_rtx_SET (VOIDmode, operands[0], gen_rtx_SUBREG (SImode, scratch, 1))); DONE; } @@ -5410,7 +5409,8 @@ /* Else call $$sh_func_adrs to extract the function's real add24. */ return output_millicode_call (insn, - gen_rtx_SYMBOL_REF (SImode, \"$$sh_func_adrs\")); + gen_rtx_SYMBOL_REF (SImode, + \"$$sh_func_adrs\")); }" [(set_attr "type" "multi") (set (attr "length") @@ -5456,8 +5456,9 @@ /* Load the PIC register from the stack slot (in our caller's frame). */ emit_move_insn (pic_offset_table_rtx, - gen_rtx_MEM (SImode, plus_constant (stack_pointer_rtx, -32))); - emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx)); + gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, -32))); + emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx)); emit_insn (gen_blockage ()); DONE; }") diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c index ebe76e3e1e5..f65e27f34fc 100644 --- a/gcc/config/pdp11/pdp11.c +++ b/gcc/config/pdp11/pdp11.c @@ -1,5 +1,5 @@ /* Subroutines for gcc2 for pdp11. - Copyright (C) 1994, 1995, 1996, 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 95-98, 1999 Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). This file is part of GNU CC. @@ -20,7 +20,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -364,14 +364,14 @@ output_move_double (operands) { operands[0] = XEXP (XEXP (operands[0], 0), 0); output_asm_insn ("sub $4,%0", operands); - operands[0] = gen_rtx (MEM, SImode, operands[0]); + operands[0] = gen_rtx_MEM (SImode, operands[0]); optype0 = OFFSOP; } if (optype0 == POPOP && optype1 == PUSHOP) { operands[1] = XEXP (XEXP (operands[1], 0), 0); output_asm_insn ("sub $4,%1", operands); - operands[1] = gen_rtx (MEM, SImode, operands[1]); + operands[1] = gen_rtx_MEM (SImode, operands[1]); optype1 = OFFSOP; } @@ -394,14 +394,14 @@ output_move_double (operands) operands in OPERANDS to be suitable for the low-numbered word. */ if (optype0 == REGOP) - latehalf[0] = gen_rtx (REG, HImode, REGNO (operands[0]) + 1); + latehalf[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1); else if (optype0 == OFFSOP) latehalf[0] = adj_offsettable_operand (operands[0], 2); else latehalf[0] = operands[0]; if (optype1 == REGOP) - latehalf[1] = gen_rtx (REG, HImode, REGNO (operands[1]) + 1); + latehalf[1] = gen_rtx_REG (HImode, REGNO (operands[1]) + 1); else if (optype1 == OFFSOP) latehalf[1] = adj_offsettable_operand (operands[1], 2); else if (optype1 == CNSTOP) @@ -411,8 +411,8 @@ output_move_double (operands) /* now the mess begins, high word is in lower word??? that's what ashc makes me think, but I don't remember :-( */ - latehalf[1] = GEN_INT (INTVAL(operands[1])>>16); - operands[1] = GEN_INT (INTVAL(operands[1])&0xff); + latehalf[1] = GEN_INT (INTVAL(operands[1]) >> 16); + operands[1] = GEN_INT (INTVAL(operands[1]) & 0xff); } else if (GET_CODE (operands[1]) == CONST_DOUBLE) { @@ -576,14 +576,14 @@ output_move_quad (operands) { operands[0] = XEXP (XEXP (operands[0], 0), 0); output_asm_insn ("sub $8,%0", operands); - operands[0] = gen_rtx (MEM, DImode, operands[0]); + operands[0] = gen_rtx_MEM (DImode, operands[0]); optype0 = OFFSOP; } if (optype0 == POPOP && optype1 == PUSHOP) { operands[1] = XEXP (XEXP (operands[1], 0), 0); output_asm_insn ("sub $8,%1", operands); - operands[1] = gen_rtx (MEM, SImode, operands[1]); + operands[1] = gen_rtx_MEM (SImode, operands[1]); optype1 = OFFSOP; } @@ -606,14 +606,14 @@ output_move_quad (operands) operands in OPERANDS to be suitable for the low-numbered word. */ if (optype0 == REGOP) - latehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 2); + latehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 2); else if (optype0 == OFFSOP) latehalf[0] = adj_offsettable_operand (operands[0], 4); else latehalf[0] = operands[0]; if (optype1 == REGOP) - latehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 2); + latehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2); else if (optype1 == OFFSOP) latehalf[1] = adj_offsettable_operand (operands[1], 4); else if (optype1 == CNSTOP) @@ -631,19 +631,18 @@ output_move_quad (operands) #ifndef HOST_WORDS_BIG_ENDIAN latehalf[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); - operands[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); + operands[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); #else /* HOST_WORDS_BIG_ENDIAN */ latehalf[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); #endif /* HOST_WORDS_BIG_ENDIAN */ } else if (GET_CODE(operands[1]) == CONST_INT) - { + { latehalf[1] = GEN_INT (0); - } + } else - abort(); - + abort(); } else latehalf[1] = operands[1]; diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h index 2a1d936f6e4..804e0d27478 100644 --- a/gcc/config/pdp11/pdp11.h +++ b/gcc/config/pdp11/pdp11.h @@ -569,18 +569,18 @@ extern int current_first_parm_offset; not without FPU!!!! ) */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE))) + gen_rtx_REG (TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE))) /* and the called function leaves it in the first register. Difference only on machines with register windows. */ #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE))) + gen_rtx_REG (TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE))) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, BASE_RETURN_VALUE_REG(MODE)) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, BASE_RETURN_VALUE_REG(MODE)) /* 1 if N is a possible register number for a function value as seen by the caller. @@ -1300,8 +1300,8 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION if (TARGET_SPLIT) \ abort(); \ \ - emit_move_insn (gen_rtx (MEM, HImode, plus_constant (TRAMP, 2)), CXT); \ - emit_move_insn (gen_rtx (MEM, HImode, plus_constant (TRAMP, 6)), FNADDR); \ + emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 2)), CXT); \ + emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), FNADDR); \ } diff --git a/gcc/config/pdp11/pdp11.md b/gcc/config/pdp11/pdp11.md index f07acefd3bd..217e314f1eb 100644 --- a/gcc/config/pdp11/pdp11.md +++ b/gcc/config/pdp11/pdp11.md @@ -1,5 +1,5 @@ ;;- Machine description for the pdp11 for GNU C compiler -;; Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 1997, 1998, 1999 Free Software Foundation, Inc. ;; Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). ;; This file is part of GNU CC. @@ -732,7 +732,7 @@ { output_asm_insn(\"{stcdf|movfo} %1, -(sp)\", operands); output_asm_insn(\"mov (sp)+, %0\", operands); - operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1); + operands[0] = gen_rtx_REG (HImode, REGNO (operands[0])+1); output_asm_insn(\"mov (sp)+, %0\", operands); return \"\"; } @@ -805,8 +805,8 @@ /* make register pair available */ latehalf[0] = operands[0]; - operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1); - + operands[0] = gen_rtx_REG (HImode, REGNO (operands[0])+ 1); + output_asm_insn(\"movb %1, %0\", operands); output_asm_insn(\"sxt %0\", latehalf); @@ -857,7 +857,7 @@ /* make register pair available */ latehalf[0] = operands[0]; - operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1); + operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1); output_asm_insn(\"mov %1, %0\", operands); output_asm_insn(\"sxt %0\", latehalf); @@ -883,7 +883,7 @@ rtx lateoperands[2]; lateoperands[0] = operands[0]; - operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1); + operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1); output_asm_insn(\"tst %0\", operands); sprintf(buf, \"bge extendhisi%d\", count); @@ -918,7 +918,7 @@ rtx latehalf[2]; latehalf[0] = NULL; - latehalf[1] = gen_rtx(REG, HImode, REGNO (operands[0])+1); + latehalf[1] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1); output_asm_insn(\"mov %1, -(sp)\", latehalf); output_asm_insn(\"mov %1, -(sp)\", operands); @@ -952,7 +952,7 @@ output_asm_insn(\"{stcdl|movfi} %1, -(sp)\", operands); output_asm_insn(\"seti\", operands); output_asm_insn(\"mov (sp)+, %0\", operands); - operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1); + operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1); output_asm_insn(\"mov (sp)+, %0\", operands); return \"\"; } @@ -998,7 +998,7 @@ lateoperands[0] = operands[0]; if (REG_P (operands[0])) - operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1); + operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1); else operands[0] = adj_offsettable_operand (operands[0], 2); @@ -1007,7 +1007,7 @@ lateoperands[2] = operands[2]; if (REG_P (operands[2])) - operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1); + operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1); else operands[2] = adj_offsettable_operand(operands[2], 2); @@ -1017,8 +1017,8 @@ return \"\"; } - lateoperands[2] = GEN_INT ((INTVAL(operands[2]) >> 16) & 0xffff); - operands[2] = GEN_INT (INTVAL(operands[2]) & 0xffff); + lateoperands[2] = GEN_INT (INTVAL (operands[2]) >> 16) & 0xffff); + operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff); if (INTVAL(operands[2])) { @@ -1101,14 +1101,14 @@ lateoperands[0] = operands[0]; if (REG_P (operands[0])) - operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1); + operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1); else operands[0] = adj_offsettable_operand (operands[0], 2); lateoperands[2] = operands[2]; if (REG_P (operands[2])) - operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1); + operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1); else operands[2] = adj_offsettable_operand(operands[2], 2); @@ -1209,7 +1209,7 @@ lateoperands[0] = operands[0]; if (REG_P (operands[0])) - operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1); + operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1); else operands[0] = adj_offsettable_operand (operands[0], 2); @@ -1218,7 +1218,7 @@ lateoperands[2] = operands[2]; if (REG_P (operands[2])) - operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1); + operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1); else operands[2] = adj_offsettable_operand(operands[2], 2); @@ -1227,8 +1227,8 @@ return \"\"; } - lateoperands[2] = GEN_INT ((INTVAL(operands[2]) >> 16) & 0xffff); - operands[2] = GEN_INT (INTVAL(operands[2]) & 0xffff); + lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff); + operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff); /* these have different lengths, so we should have different constraints! */ @@ -1275,26 +1275,26 @@ lateoperands[0] = operands[0]; if (REG_P (operands[0])) - operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1); + operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1); else operands[0] = adj_offsettable_operand (operands[0], 2); if (! CONSTANT_P(operands[2])) - { - lateoperands[2] = operands[2]; + { + lateoperands[2] = operands[2]; - if (REG_P (operands[2])) - operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1); - else - operands[2] = adj_offsettable_operand(operands[2], 2); + if (REG_P (operands[2])) + operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1); + else + operands[2] = adj_offsettable_operand (operands[2], 2); - output_asm_insn (\"bis %2, %0\", operands); - output_asm_insn (\"bis %2, %0\", lateoperands); - return \"\"; - } + output_asm_insn (\"bis %2, %0\", operands); + output_asm_insn (\"bis %2, %0\", lateoperands); + return \"\"; + } - lateoperands[2] = GEN_INT ((INTVAL(operands[2]) >> 16) & 0xffff); - operands[2] = GEN_INT (INTVAL(operands[2]) & 0xffff); + lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff); + operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff); /* these have different lengths, so we should have different constraints! */ @@ -1336,26 +1336,26 @@ rtx lateoperands[3]; lateoperands[0] = operands[0]; - operands[0] = gen_rtx(REG, HImode, REGNO(operands[0]) + 1); + operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1); if (REG_P(operands[2])) - { - lateoperands[2] = operands[2]; - operands[2] = gen_rtx(REG, HImode, REGNO(operands[2]) + 1); - - output_asm_insn (\"xor %2, %0\", operands); - output_asm_insn (\"xor %2, %0\", lateoperands); + { + lateoperands[2] = operands[2]; + operands[2] = gen_rtx_REG (HImode, REGNO (operands[2]) + 1); - return \"\"; - } + output_asm_insn (\"xor %2, %0\", operands); + output_asm_insn (\"xor %2, %0\", lateoperands); - lateoperands[2] = GEN_INT ((INTVAL(operands[2]) >> 16) & 0xffff); + return \"\"; + } + + lateoperands[2] = GEN_INT ((INTVAL (operands[2]) >> 16) & 0xffff); operands[2] = GEN_INT (INTVAL(operands[2]) & 0xffff); - if (INTVAL(operands[2])) + if (INTVAL (operands[2])) output_asm_insn (\"xor %2, %0\", operands); - if (INTVAL(lateoperands[2])) + if (INTVAL (lateoperands[2])) output_asm_insn (\"xor %2, %0\", lateoperands); return \"\"; @@ -1614,7 +1614,7 @@ ; ; /* allow REG_NOTES to be set on last insn (labels don't have enough ; fields, and can't be used for REG_NOTES anyway). */ -; emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx)); +; emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); ; DONE; ;}") diff --git a/gcc/config/pyr/pyr.c b/gcc/config/pyr/pyr.c index c760c24ec4f..9c39e3f77e9 100644 --- a/gcc/config/pyr/pyr.c +++ b/gcc/config/pyr/pyr.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Pyramid 90x, 9000, and MIServer Series. - Copyright (C) 1989, 1991, 1997 Free Software Foundation, Inc. + Copyright (C) 1989, 1991, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */ /* Some output-actions in pyr.md need these. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -258,6 +258,7 @@ extend_const (x, extop, from_mode, to_mode) val = val & ~((-1) << (GET_MODE_BITSIZE (from_mode))); if (GET_MODE_BITSIZE (to_mode) == HOST_BITS_PER_INT) return GEN_INT (val); + return GEN_INT (val & ~((-1) << (GET_MODE_BITSIZE (to_mode)))); } @@ -296,7 +297,7 @@ extend_and_branch (extop) if (op1 == 0) { op0 = ensure_extended (op0, extop, test_mode); - emit_insn (gen_rtx (SET, VOIDmode, cc0_rtx, op0)); + emit_insn (gen_rtx_SET (VOIDmode, cc0_rtx, op0)); } else { @@ -338,8 +339,8 @@ extend_and_branch (extop) op0 = force_reg (test_mode, op0); } - emit_insn (gen_rtx (SET, VOIDmode, cc0_rtx, - gen_rtx (COMPARE, VOIDmode, op0, op1))); + emit_insn (gen_rtx_SET (VOIDmode, cc0_rtx, + gen_rtx_COMPARE (VOIDmode, op0, op1))); } } @@ -630,7 +631,7 @@ output_move_double (operands) } operands[1] = GEN_INT (CONST_DOUBLE_HIGH (const_op)); output_asm_insn ("movw %1,%0", operands); - operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); operands[1] = GEN_INT (CONST_DOUBLE_LOW (const_op)); return "movw %1,%0"; } @@ -648,7 +649,7 @@ output_move_double (operands) } operands[1] = GEN_INT (CONST_DOUBLE_LOW (const_op)); output_asm_insn ("movw %1,%0", operands); - operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); operands[1] = GEN_INT (CONST_DOUBLE_HIGH (const_op)); return "movw %1,%0"; } diff --git a/gcc/config/pyr/pyr.h b/gcc/config/pyr/pyr.h index e4395029189..e5167791665 100644 --- a/gcc/config/pyr/pyr.h +++ b/gcc/config/pyr/pyr.h @@ -1,6 +1,6 @@ /* Definitions of target machine parameters for GNU compiler, for Pyramid 90x, 9000, and MIServer Series. - Copyright (C) 1989, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1989, 95-98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -511,19 +511,19 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; --> its type. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), PYR_TREG(0)) + gen_rtx_REG (TYPE_MODE (VALTYPE), PYR_TREG(0)) /* --> but the callee has to leave it in PR0(/PR1) */ #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), PYR_PREG(0)) + gen_rtx_REG (TYPE_MODE (VALTYPE), PYR_PREG(0)) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ /* --> On Pyramid the return value is in TR0/TR1 regardless. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, PYR_TREG(0)) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, PYR_TREG(0)) /* Define this if PCC uses the nonreentrant convention for returning structure and union values. */ @@ -652,7 +652,7 @@ extern int inner_param_safe_helper(); + ((MODE) == BLKmode \ ? (int_size_in_bytes (TYPE) + 3) / 4 \ : (GET_MODE_SIZE (MODE) + 3) / 4)) \ - ? gen_rtx (REG, (MODE), PYR_TREG(CUM)) \ + ? gen_rtx_REG ((MODE), PYR_TREG(CUM)) \ : 0) \ : 0) #ifdef __GNUC__ @@ -673,7 +673,7 @@ extern void* pyr_function_arg (); + ((MODE) == BLKmode \ ? (int_size_in_bytes (TYPE) + 3) / 4 \ : (GET_MODE_SIZE (MODE) + 3) / 4)) \ - ? gen_rtx (REG, (MODE), PYR_PREG(CUM)) \ + ? gen_rtx_REG ((MODE), PYR_PREG(CUM)) \ : 0) \ : 0) @@ -749,12 +749,13 @@ extern void* pyr_function_arg (); CXT is an RTX for the static chain value for the function. */ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ -{ emit_move_insn (gen_rtx (MEM, Pmode, plus_constant (TRAMP, 4)), CXT); \ +{ emit_move_insn (gen_rtx_MEM (Pmode, plus_constant (TRAMP, 4)), CXT); \ emit_move_insn (gen_rtx (MEM, Pmode, plus_constant (TRAMP, 12)), FNADDR); \ - emit_call_insn (gen_call (gen_rtx (MEM, QImode, \ - gen_rtx (SYMBOL_REF, Pmode, \ - "__enable_execute_stack")), \ - const0_rtx)); \ + emit_call_insn (gen_call \ + (gen_rtx_MEM \ + (QImode, \ + gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack")), \ + const0_rtx)); \ } /* Output assembler code to FILE to increment profiler label # LABELNO diff --git a/gcc/config/pyr/pyr.md b/gcc/config/pyr/pyr.md index c1d440a5ed4..efd7bce5a1a 100644 --- a/gcc/config/pyr/pyr.md +++ b/gcc/config/pyr/pyr.md @@ -1,5 +1,5 @@ ;; GNU C machine description for Pyramid 90x, 9000, MIServer Series -;; Copyright (C) 1989, 1990, 1995, 1997 Free Software Foundation, Inc. +;; Copyright (C) 1989, 90, 95, 97, 98, 1999 Free Software Foundation, Inc. ;; This file is part of GNU CC. @@ -1257,9 +1257,9 @@ { rtx xoperands[2]; CC_STATUS_INIT; - xoperands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xoperands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (REG_P (operands[2])) - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[2]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); else { xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2])); @@ -1278,9 +1278,9 @@ { rtx xoperands[2]; CC_STATUS_INIT; - xoperands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xoperands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (REG_P (operands[2])) - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[2]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); else { xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2])); @@ -1299,9 +1299,9 @@ { rtx xoperands[2]; CC_STATUS_INIT; - xoperands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xoperands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (REG_P (operands[2])) - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[2]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); else { xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2])); @@ -1320,9 +1320,9 @@ { rtx xoperands[2]; CC_STATUS_INIT; - xoperands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xoperands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (REG_P (operands[2])) - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[2]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); else { xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2])); @@ -1341,9 +1341,9 @@ { rtx xoperands[2]; CC_STATUS_INIT; - xoperands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xoperands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (REG_P (operands[2])) - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[2]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); else { xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2])); diff --git a/gcc/config/romp/romp.c b/gcc/config/romp/romp.c index a29d95447b3..b5096c2f9c2 100644 --- a/gcc/config/romp/romp.c +++ b/gcc/config/romp/romp.c @@ -1,5 +1,5 @@ /* Subroutines used for code generation on ROMP. - Copyright (C) 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. + Copyright (C) 1990, 91, 92, 93, 97, 98, 1999 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@nyu.edu) This file is part of GNU CC. @@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -825,8 +825,8 @@ print_operand (file, x, code) if (GET_CODE (x) == REG) fprintf (file, "%s", reg_names[REGNO (x) + 1]); else if (GET_CODE (x) == MEM) - print_operand (file, gen_rtx (MEM, GET_MODE (x), - plus_constant (XEXP (x, 0), 4)), 0); + print_operand (file, gen_rtx_MEM (GET_MODE (x), + plus_constant (XEXP (x, 0), 4)), 0); else abort (); break; @@ -1222,8 +1222,7 @@ output_epilog (file, size) /* Restore floating-point registers. */ if (write_code) output_loadsave_fpregs (file, CLOBBER, - gen_rtx (PLUS, Pmode, gen_rtx (REG, Pmode, 1), - GEN_INT (fp_save))); + plus_constant (gen_rtx_REG (Pmode, 1), fp_save)); /* If we push the stack and do not have size > 32K, adjust the register save location to the current position of sp. Otherwise, if long frame, @@ -1349,9 +1348,9 @@ get_symref (name) end_temporary_allocation (); p = *last_p = (struct symref_hashent *) permalloc (sizeof (struct symref_hashent)); - p->symref = gen_rtx (SYMBOL_REF, Pmode, - obstack_copy0 (&permanent_obstack, - name, strlen (name))); + p->symref = gen_rtx_SYMBOL_REF (Pmode, + obstack_copy0 (&permanent_obstack, + name, strlen (name))); p->next = 0; resume_temporary_allocation (); } @@ -1740,8 +1739,7 @@ output_loadsave_fpregs (file, code, addr) if (mask) fprintf (file, "\t%s\n", - output_fpop (code, GEN_INT (mask), - gen_rtx (MEM, Pmode, addr), + output_fpop (code, GEN_INT (mask), gen_rtx_MEM (Pmode, addr), 0, const0_rtx)); } diff --git a/gcc/config/romp/romp.h b/gcc/config/romp/romp.h index 82a0186a66c..521a78c2b13 100644 --- a/gcc/config/romp/romp.h +++ b/gcc/config/romp/romp.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for ROMP chip. - Copyright (C) 1989, 1991, 1993, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1989, 91, 93, 95, 96, 98, 1999 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@nyu.edu) This file is part of GNU CC. @@ -271,13 +271,11 @@ extern int target_flags; /* Place to put static chain when calling a function that requires it. */ #define STATIC_CHAIN \ - gen_rtx (MEM, Pmode, gen_rtx (PLUS, Pmode, stack_pointer_rtx, \ - GEN_INT (-36))) + gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, -36)) /* Place where static chain is found upon entry to routine. */ #define STATIC_CHAIN_INCOMING \ - gen_rtx (MEM, Pmode, gen_rtx (PLUS, Pmode, arg_pointer_rtx, \ - GEN_INT (-20))) + gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -20)) /* Place that structure value return address is placed. @@ -520,15 +518,16 @@ enum reg_class { NO_REGS, R0_REGS, R15_REGS, BASE_REGS, GENERAL_REGS, On ROMP the value is found in r2, unless the machine specific option fp-arg-in-fpregs is selected, in which case FP return values are in fr1 */ -#define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), \ - (TARGET_FP_REGS && \ - GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_FLOAT) ? 18 : 2) +#define FUNCTION_VALUE(VALTYPE, FUNC) \ + gen_rtx_REG (TYPE_MODE (VALTYPE), \ + (TARGET_FP_REG \ + && GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_FLOAT) \ + ? 18 : 2) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 2) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 2) /* The definition of this macro implies that there are cases where a scalar value cannot be returned in registers. @@ -628,8 +627,8 @@ struct rt_cargs {int gregs, fregs; }; #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ (! (NAMED) ? 0 \ : ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST) ? 0 \ - : USE_FP_REG(MODE,CUM) ? gen_rtx(REG, (MODE),(CUM.fregs) + 17) \ - : (CUM).gregs < 4 ? gen_rtx(REG, (MODE), 2 + (CUM).gregs) : 0) + : USE_FP_REG(MODE,CUM) ? gen_rtx_REG ((MODE), (CUM.fregs) + 17) \ + : (CUM).gregs < 4 ? gen_rtx_REG ((MODE), 2 + (CUM).gregs) : 0) /* For an arg passed partly in registers and partly in memory, this is the number of registers used. @@ -672,9 +671,9 @@ struct rt_cargs {int gregs, fregs; }; if (! NO_RTL && first_reg_offset != 4) \ move_block_from_reg \ (2 + first_reg_offset, \ - gen_rtx (MEM, BLKmode, \ - plus_constant (virtual_incoming_args_rtx, \ - first_reg_offset * 4)), \ + gen_rtx_MEM (BLKmode, \ + plus_constant (virtual_incoming_args_rtx, \ + first_reg_offset * 4)), \ 4 - first_reg_offset, (4 - first_reg_offset) * UNITS_PER_WORD); \ PRETEND_SIZE = (4 - first_reg_offset) * UNITS_PER_WORD; \ } \ @@ -814,27 +813,27 @@ struct rt_cargs {int gregs, fregs; }; _temp = expand_binop (SImode, add_optab, ADDR, \ GEN_INT (4), \ 0, 1, OPTAB_LIB_WIDEN); \ - emit_move_insn (gen_rtx (MEM, SImode, \ - memory_address (SImode, ADDR)), _temp); \ + emit_move_insn (gen_rtx_MEM (SImode, \ + memory_address (SImode, ADDR)), _temp); \ \ _val = force_reg (SImode, CXT); \ _addr = memory_address (HImode, plus_constant (ADDR, 10)); \ - emit_move_insn (gen_rtx (MEM, HImode, _addr), \ + emit_move_insn (gen_rtx_MEM (HImode, _addr), \ gen_lowpart (HImode, _val)); \ _temp = expand_shift (RSHIFT_EXPR, SImode, _val, \ build_int_2 (16, 0), 0, 1); \ _addr = memory_address (HImode, plus_constant (ADDR, 6)); \ - emit_move_insn (gen_rtx (MEM, HImode, _addr), \ + emit_move_insn (gen_rtx_MEM (HImode, _addr), \ gen_lowpart (HImode, _temp)); \ \ _val = force_reg (SImode, FNADDR); \ _addr = memory_address (HImode, plus_constant (ADDR, 24)); \ - emit_move_insn (gen_rtx (MEM, HImode, _addr), \ + emit_move_insn (gen_rtx_MEM (HImode, _addr), \ gen_lowpart (HImode, _val)); \ _temp = expand_shift (RSHIFT_EXPR, SImode, _val, \ build_int_2 (16, 0), 0, 1); \ _addr = memory_address (HImode, plus_constant (ADDR, 20)); \ - emit_move_insn (gen_rtx (MEM, HImode, _addr), \ + emit_move_insn (gen_rtx_MEM (HImode, _addr), \ gen_lowpart (HImode, _temp)); \ \ } @@ -1074,11 +1073,10 @@ struct rt_cargs {int gregs, fregs; }; low_int = INTVAL (XEXP (X, 1)) & 0xffff; \ if (low_int & 0x8000) \ high_int += 1, low_int |= 0xffff0000; \ - (X) = gen_rtx (PLUS, SImode, \ - force_operand \ - (gen_rtx (PLUS, SImode, XEXP (X, 0), \ - GEN_INT (high_int << 16)), 0),\ - GEN_INT (low_int)); \ + (X) = gen_rtx_PLUS (SImode, \ + force_operand (plus_constant (XEXP (X, 0), \ + high_int << 16)), \ + GEN_INT (low_int)); \ } \ } @@ -1129,7 +1127,7 @@ struct rt_cargs {int gregs, fregs; }; && GET_CODE (op2) == REG && FP_REGNO_P (REGNO (op2)) \ && REGNO (op0) == REGNO (op2)) \ { \ - tem = gen_rtx (REG, GET_MODE (op0), 17); \ + tem = gen_rtx_REG (GET_MODE (op0), 17); \ emit_insn_after (gen_move_insn (op0, tem), INSN); \ SET_DEST (XVECEXP (PATTERN (INSN), 0, 0)) = tem; \ OPERANDS[0] = tem; \ @@ -1584,8 +1582,8 @@ extern int romp_debugger_arg_correction(); else if (GET_CODE (addr) == SYMBOL_REF \ && CONSTANT_POOL_ADDRESS_P (addr)) \ { \ - offset = GEN_INT (get_pool_offset (addr) + 12); \ - base = gen_rtx (REG, SImode, 14); \ + offset = GEN_INT (get_pool_offset (addr) + 12); \ + base = gen_rtx_REG (SImode, 14); \ } \ else if (GET_CODE (addr) == CONST \ && GET_CODE (XEXP (addr, 0)) == PLUS \ @@ -1596,7 +1594,7 @@ extern int romp_debugger_arg_correction(); offset = plus_constant (XEXP (XEXP (addr, 0), 1), \ (get_pool_offset (XEXP (XEXP (addr, 0), 0)) \ + 12)); \ - base = gen_rtx (REG, SImode, 14); \ + base = gen_rtx_REG (SImode, 14); \ } \ output_addr_const (FILE, offset); \ if (base) \ diff --git a/gcc/config/romp/romp.md b/gcc/config/romp/romp.md index 5f0631521e3..82290c49780 100644 --- a/gcc/config/romp/romp.md +++ b/gcc/config/romp/romp.md @@ -1,5 +1,5 @@ ;;- Machine description for ROMP chip for GNU C compiler -;; Copyright (C) 1988, 91, 93, 94, 95, 1999 Free Software Foundation, Inc. +;; Copyright (C) 1988, 91, 93, 94, 95, 98, 1999 Free Software Foundation, Inc. ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) ;; This file is part of GNU CC. @@ -180,8 +180,7 @@ || (unsigned) ((- const_val) + 0x8000) < 0x10000) { /* Can do this by loading the negative constant and then negating. */ - emit_move_insn (operands[0], - GEN_INT (- const_val)); + emit_move_insn (operands[0], GEN_INT (- const_val)); emit_insn (gen_negsi2 (operands[0], operands[0])); DONE; } @@ -195,8 +194,7 @@ if (low_part >= 0x10 && exact_log2 (low_part) >= 0) i = high_part, high_part = low_part, low_part = i; - emit_move_insn (operands[0], - GEN_INT (low_part)); + emit_move_insn (operands[0], GEN_INT (low_part)); emit_insn (gen_iorsi3 (operands[0], operands[0], GEN_INT (high_part))); DONE; @@ -482,11 +480,9 @@ { operands[2] = operand_subword (operands[0], 1, 0, DImode); operands[3] = XEXP (operands[1], 0); operands[4] = operand_subword (operands[0], 0, 0, DImode); - operands[5] = gen_rtx (MEM, SImode, operands[2]); + operands[5] = gen_rtx_MEM (SImode, operands[2]); operands[6] = operands[2]; - operands[7] = gen_rtx (MEM, SImode, - gen_rtx (PLUS, SImode, operands[2], - GEN_INT (4))); + operands[7] = gen_rtx_MEM (SImode, plus_constant (operands[2], 4)); if (operands[2] == 0 || operands[4] == 0) FAIL; @@ -503,11 +499,9 @@ (set (match_dup 6) (match_dup 7))] " { operands[3] = XEXP (operands[0], 0); - operands[4] = gen_rtx (MEM, SImode, operands[2]); + operands[4] = gen_rtx_MEM (SImode, operands[2]); operands[5] = operand_subword (operands[1], 0, 0, DImode); - operands[6] = gen_rtx (MEM, SImode, - gen_rtx (PLUS, SImode, operands[2], - GEN_INT (4))); + operands[6] = gen_rtx_MEM (SImode, plus_constant (operands[4], 4)); operands[7] = operand_subword (operands[1], 1, 0, DImode); if (operands[5] == 0 || operands[7] == 0) @@ -607,8 +601,8 @@ operands[7] = operands[8] = operands[6]; else { - operands[7] = gen_rtx (SCRATCH, SImode); - operands[8] = gen_rtx (SCRATCH, SImode); + operands[7] = gen_rtx_SCRATCH (SImode); + operands[8] = gen_rtx_SCRATCH (SImode); } }") @@ -631,7 +625,7 @@ if (op0 == op1) { - emit_insn (gen_rtx (SET, VOIDmode, op0, op1)); + emit_insn (gen_rtx_SET (VOIDmode, op0, op1)); DONE; } @@ -686,7 +680,7 @@ if (op0 == op1) { - emit_insn (gen_rtx (SET, VOIDmode, op0, op1)); + emit_insn (gen_rtx_SET (VOIDmode, op0, op1)); DONE; } @@ -706,7 +700,7 @@ last = emit_move_insn (operand_subword (op0, 0, 1, SFmode), operand_subword_force (op1, 0, SFmode)); - REG_NOTES (last) = gen_rtx (EXPR_LIST, REG_EQUAL, op1, REG_NOTES (last)); + REG_NOTES (last) = gen_rtx_EXPR_LIST (REG_EQUAL, op1, REG_NOTES (last)); DONE; } }") @@ -812,11 +806,10 @@ " { operands[2] = XEXP (operands[1], 0); operands[3] = operand_subword (operands[0], 0, 0, DFmode); - operands[4] = gen_rtx (MEM, SImode, gen_rtx (REG, SImode, 15)); + operands[4] = gen_rtx_MEM (SImode, gen_rtx (REG, SImode, 15)); operands[5] = operand_subword (operands[0], 1, 0, DFmode); - operands[6] = gen_rtx (MEM, SImode, - gen_rtx (PLUS, SImode, gen_rtx (REG, SImode, 15), - GEN_INT (4))); + operands[6] = gen_rtx_MEM (SImode, + plus_constant (gen_rtx (REG, SImode, 15), 4)); if (operands[3] == 0 || operands[5] == 0) FAIL; @@ -833,11 +826,10 @@ (set (match_dup 5) (match_dup 6))] " { operands[2] = XEXP (operands[0], 0); - operands[3] = gen_rtx (MEM, SImode, gen_rtx (REG, SImode, 15)); + operands[3] = gen_rtx_MEM (SImode, gen_rtx (REG, SImode, 15)); operands[4] = operand_subword (operands[1], 0, 0, DFmode); - operands[5] = gen_rtx (MEM, SImode, - gen_rtx (PLUS, SImode, gen_rtx (REG, SImode, 15), - GEN_INT (4))); + operands[5] = gen_rtx_MEM (SImode, + plus_constant (gen_rtx_REG (SImode, 15), 4)); operands[6] = operand_subword (operands[1], 1, 0, DFmode); if (operands[4] == 0 || operands[6] == 0) @@ -870,11 +862,11 @@ FAIL; if (reload_completed) - operands[6] = operands[7] = gen_rtx (REG, SImode, 15); + operands[6] = operands[7] = gen_rtx_REG (SImode, 15); else { - operands[6] = gen_rtx (SCRATCH, SImode); - operands[7] = gen_rtx (SCRATCH, SImode); + operands[6] = gen_rtx_SCRATCH (SImode); + operands[7] = gen_rtx_SCRATCH (SImode); } }") @@ -1208,8 +1200,7 @@ if (low & 0x8000) high++, low |= 0xffff0000; - emit_insn (gen_addsi3 (operands[0], operands[1], - GEN_INT (high << 16))); + emit_insn (gen_addsi3 (operands[0], operands[1], GEN_INT (high << 16))); operands[1] = operands[0]; operands[2] = GEN_INT (low); } @@ -1366,16 +1357,16 @@ rtx insn; emit_insn (gen_divmodsi4_doit (operands[1], operands[2])); - insn = emit_move_insn (operands[0], gen_rtx (REG, SImode, 2)); - REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL, - gen_rtx (DIV, SImode, operands[1], - operands[2]), - REG_NOTES (insn)); - insn = emit_move_insn (operands[3], gen_rtx (REG, SImode, 3)); - REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL, - gen_rtx (MOD, SImode, operands[1], - operands[2]), - REG_NOTES (insn)); + insn = emit_move_insn (operands[0], gen_rtx_REG (SImode, 2)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, + gen_rtx_DIV (SImode, operands[1], + operands[2]), + REG_NOTES (insn)); + insn = emit_move_insn (operands[3], gen_rtx_REG (SImode, 3)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, + gen_rtx_MOD (SImode, operands[1], + operands[2]), + REG_NOTES (insn)); DONE; }") @@ -1416,16 +1407,16 @@ rtx insn; emit_insn (gen_udivmodsi4_doit (operands[1], operands[2])); - insn = emit_move_insn (operands[0], gen_rtx (REG, SImode, 2)); - REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL, - gen_rtx (UDIV, SImode, operands[1], - operands[2]), - REG_NOTES (insn)); - insn = emit_move_insn (operands[3], gen_rtx (REG, SImode, 3)); - REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL, - gen_rtx (UMOD, SImode, operands[1], - operands[2]), - REG_NOTES (insn)); + insn = emit_move_insn (operands[0], gen_rtx_REG (SImode, 2)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, + gen_rtx_UDIV (SImode, operands[1], + operands[2]), + REG_NOTES (insn)); + insn = emit_move_insn (operands[3], gen_rtx_REG (SImode, 3)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, + gen_rtx_UMOD (SImode, operands[1], + operands[2]), + REG_NOTES (insn)); DONE; }") @@ -1550,7 +1541,7 @@ if (top != 0 && bottom != 0) { emit_insn (gen_iorsi3 (operands[0], operands[1], - GEN_INT ((top << 16)))); + GEN_INT (top << 16)))); operands[1] = operands[0]; operands[2] = GEN_INT (bottom); } @@ -1590,7 +1581,7 @@ else if (top != 0 && bottom != 0) { emit_insn (gen_xorsi3 (operands[0], operands[1], - GEN_INT ((top << 16)))); + GEN_INT (top << 16))); operands[1] = operands[0]; operands[2] = GEN_INT (bottom); } @@ -1664,7 +1655,7 @@ "" " { - rtx reg0 = gen_rtx (REG, SImode, 0); + rtx reg0 = gen_rtx_REG (SImode, 0); rtx call_insn; if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT) @@ -1674,8 +1665,8 @@ if (GET_CODE (operands[0]) == SYMBOL_REF) { extern rtx get_symref (); - char *real_fcnname = - (char *) alloca (strlen (XSTR (operands[0], 0)) + 2); + char *real_fcnname + = (char *) alloca (strlen (XSTR (operands[0], 0)) + 2); /* Copy the data area address to r0. */ emit_move_insn (reg0, force_reg (SImode, operands[0])); @@ -1688,7 +1679,7 @@ rtx data_access; emit_move_insn (reg0, force_reg (SImode, operands[0])); - data_access = gen_rtx (MEM, SImode, operands[0]); + data_access = gen_rtx_MEM (SImode, operands[0]); RTX_UNCHANGING_P (data_access) = 1; operands[0] = copy_to_reg (data_access); } @@ -1723,7 +1714,7 @@ "" " { - rtx reg0 = gen_rtx (REG, SImode, 0); + rtx reg0 = gen_rtx_REG (SImode, 0); rtx call_insn; if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT) @@ -1747,7 +1738,7 @@ rtx data_access; emit_move_insn (reg0,force_reg (SImode, operands[1])); - data_access = gen_rtx (MEM, SImode, operands[1]); + data_access = gen_rtx_MEM (SImode, operands[1]); RTX_UNCHANGING_P (data_access) = 1; operands[1] = copy_to_reg (data_access); } @@ -1977,8 +1968,7 @@ result = expand_binop (SImode, xor_optab, operand_subword_force (operands[1], 0, SFmode), - GEN_INT (0x80000000), - target, 0, OPTAB_WIDEN); + GEN_INT (0x80000000), target, 0, OPTAB_WIDEN); if (result == 0) abort (); @@ -2011,8 +2001,7 @@ start_sequence (); result = expand_binop (SImode, xor_optab, operand_subword_force (operands[1], 0, DFmode), - GEN_INT (0x80000000), - target, 0, OPTAB_WIDEN); + GEN_INT (0x80000000), target, 0, OPTAB_WIDEN); if (result == 0) abort (); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 700fd3eaea0..2594863de85 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2199,8 +2199,8 @@ expand_block_move (operands) } else { - src_addr = gen_rtx_PLUS (Pmode, src_reg, GEN_INT (offset)); - dest_addr = gen_rtx_PLUS (Pmode, dest_reg, GEN_INT (offset)); + src_addr = plus_constant (src_reg, offset); + dest_addr = plus_constant (dest_reg, offset); } /* Generate the appropriate load and store, saving the stores for later */ @@ -3675,7 +3675,8 @@ rs6000_stack_info () if (TARGET_EABI) #endif { - if (strcmp (IDENTIFIER_POINTER (DECL_NAME (current_function_decl)), "main") == 0 + if (0 == strcmp (IDENTIFIER_POINTER (DECL_NAME (current_function_decl)), + "main") && DECL_CONTEXT (current_function_decl) == NULL_TREE) { info_ptr->main_p = 1; @@ -5594,7 +5595,8 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt) /* Macros to shorten the code expansions below. */ #define MEM_DEREF(addr) gen_rtx_MEM (pmode, memory_address (pmode, addr)) -#define MEM_PLUS(addr,offset) gen_rtx_MEM (pmode, memory_address (pmode, plus_constant (addr, offset))) +#define MEM_PLUS(addr,offset) \ + gen_rtx_MEM (pmode, memory_address (pmode, plus_constant (addr, offset))) /* Under AIX, just build the 3 word function descriptor */ case ABI_AIX: diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 643193e219c..db1108417f0 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1368,8 +1368,8 @@ extern int rs6000_sysv_varargs_p; assuming the value has mode MODE. */ #define LIBCALL_VALUE(MODE) \ - gen_rtx_REG (MODE, \ - GET_MODE_CLASS (MODE) == MODE_FLOAT && TARGET_HARD_FLOAT ? 33 : 3) + gen_rtx_REG (MODE, (GET_MODE_CLASS (MODE) == MODE_FLOAT \ + && TARGET_HARD_FLOAT ? 33 : 3)) /* The definition of this macro implies that there are cases where a scalar value cannot be returned in registers. @@ -1718,10 +1718,13 @@ typedef struct rs6000_args ((count == -1) \ ? gen_rtx_REG (Pmode, 65) \ : gen_rtx_MEM (Pmode, \ - memory_address (Pmode, \ - plus_constant (copy_to_reg (gen_rtx_MEM (Pmode, \ - memory_address (Pmode, frame))), \ - RETURN_ADDRESS_OFFSET)))) + memory_address \ + (Pmode, \ + plus_constant (copy_to_reg \ + (gen_rtx_MEM (Pmode, \ + memory_address (Pmode, \ + frame))), \ + RETURN_ADDRESS_OFFSET)))) /* Definitions for register eliminations. @@ -1998,7 +2001,7 @@ typedef struct rs6000_args if (low_int & 0x8000) \ high_int += 0x10000, low_int |= ((HOST_WIDE_INT) -1) << 16; \ sum = force_operand (gen_rtx_PLUS (Pmode, XEXP (X, 0), \ - GEN_INT (high_int)), 0); \ + GEN_INT (high_int)), 0); \ (X) = gen_rtx_PLUS (Pmode, sum, GEN_INT (low_int)); \ goto WIN; \ } \ @@ -2009,7 +2012,7 @@ typedef struct rs6000_args && (MODE) != TImode) \ { \ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \ - force_reg (Pmode, force_operand (XEXP (X, 1), 0))); \ + force_reg (Pmode, force_operand (XEXP (X, 1), 0))); \ goto WIN; \ } \ else if (TARGET_ELF && TARGET_32BIT && TARGET_NO_TOC \ @@ -3107,7 +3110,7 @@ do { \ /* This is how to output an element of a case-vector that is relative. */ -#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL)\ +#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ do { char buf[100]; \ fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", FILE); \ ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \ diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 5be4c710f42..54e62060d2b 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -4318,11 +4318,12 @@ else indx = stack_pointer_rtx; - operands[2] = gen_rtx_MEM (SImode, - gen_rtx_PLUS (Pmode, - indx, - GEN_INT ((((rs6000_fpmem_offset & 0xffff) ^ 0x8000) - 0x8000) - + ((WORDS_BIG_ENDIAN != 0) * 4)))); + operands[2] + = gen_rtx_MEM (SImode, + plus_constant (indx, + (((rs6000_fpmem_offset & 0xffff) ^ 0x8000) + - 0x8000) + + ((WORDS_BIG_ENDIAN != 0) * 4))); return \"{st|stw} %0,%2\"; }" @@ -4345,11 +4346,12 @@ else indx = stack_pointer_rtx; - operands[2] = gen_rtx_MEM (SImode, - gen_rtx_PLUS (Pmode, - indx, - GEN_INT ((((rs6000_fpmem_offset & 0xffff) ^ 0x8000) - 0x8000) - + ((WORDS_BIG_ENDIAN == 0) * 4)))); + operands[2] + = gen_rtx_MEM (SImode, + plus_constant (indx, + (((rs6000_fpmem_offset & 0xffff) ^ 0x8000) + - 0x8000) + + ((WORDS_BIG_ENDIAN == 0) * 4))); return \"{st|stw} %0,%2\"; }" @@ -4375,8 +4377,7 @@ else indx = stack_pointer_rtx; - operands[2] = gen_rtx_MEM (SImode, - gen_rtx_PLUS (Pmode, indx, GEN_INT (offset))); + operands[2] = gen_rtx_MEM (SImode, plus_constant (indx, offset)); return \"lfd %0,%2\"; }" @@ -4449,10 +4450,9 @@ indx = stack_pointer_rtx; operands[2] = gen_rtx_MEM (DFmode, - gen_rtx_PLUS (Pmode, - indx, - GEN_INT ((((rs6000_fpmem_offset & 0xffff) - ^ 0x8000) - 0x8000)))); + plus_constant (indx, + (((rs6000_fpmem_offset & 0xffff) + ^ 0x8000) - 0x8000))); return \"stfd %0,%2\"; }" @@ -4474,11 +4474,12 @@ else indx = stack_pointer_rtx; - operands[2] = gen_rtx_MEM (DFmode, - gen_rtx_PLUS (Pmode, - indx, - GEN_INT ((((rs6000_fpmem_offset & 0xffff) ^ 0x8000) - 0x8000) - + ((WORDS_BIG_ENDIAN) ? 4 : 0)))); + operands[2] + = gen_rtx_MEM (DFmode, + plus_constant (indx, + (((rs6000_fpmem_offset & 0xffff) ^ 0x8000) + - 0x8000) + + ((WORDS_BIG_ENDIAN) ? 4 : 0))); return \"{l|lwz} %0,%2\"; }" @@ -4507,7 +4508,7 @@ rtx last = XVECEXP (insns, 0, XVECLEN (insns, 0) - 1); REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last, - REG_NOTES (first)); + REG_NOTES (first)); REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last)); emit_insn (insns); @@ -6015,7 +6016,8 @@ while (*name == '.') name++; new_ref = gen_rtx_SYMBOL_REF (Pmode, name); - CONSTANT_POOL_ADDRESS_P (new_ref) = CONSTANT_POOL_ADDRESS_P (operands[1]); + CONSTANT_POOL_ADDRESS_P (new_ref) + = CONSTANT_POOL_ADDRESS_P (operands[1]); SYMBOL_REF_FLAG (new_ref) = SYMBOL_REF_FLAG (operands[1]); SYMBOL_REF_USED (new_ref) = SYMBOL_REF_USED (operands[1]); operands[1] = new_ref; @@ -7198,8 +7200,8 @@ for (i = 0; i < count; i++) XVECEXP (operands[3], 0, i) = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno + i), - change_address (operands[1], SImode, - plus_constant (from, i * 4))); + change_address (operands[1], SImode, + plus_constant (from, i * 4))); }") (define_insn "" @@ -7293,16 +7295,16 @@ XVECEXP (operands[3], 0, 0) = gen_rtx_SET (VOIDmode, change_address (operands[0], SImode, to), - operands[1]); + operands[1]); XVECEXP (operands[3], 0, 1) = gen_rtx_CLOBBER (VOIDmode, - gen_rtx_SCRATCH (SImode)); + gen_rtx_SCRATCH (SImode)); for (i = 1; i < count; i++) XVECEXP (operands[3], 0, i + 1) = gen_rtx_SET (VOIDmode, - change_address (operands[0], SImode, - plus_constant (to, i * 4)), - gen_rtx_REG (SImode, regno + i)); + change_address (operands[0], SImode, + plus_constant (to, i * 4)), + gen_rtx_REG (SImode, regno + i)); }") (define_insn "" @@ -7874,7 +7876,8 @@ && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) > 4096)) { rtx tmp = gen_reg_rtx (Pmode); - emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, \"__allocate_stack\"), + emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, + \"__allocate_stack\"), tmp, 0, Pmode, 1, operands[1], Pmode); emit_insn (gen_set_sp (tmp)); emit_move_insn (operands[0], tmp); @@ -7962,7 +7965,8 @@ /* Copy the backchain to the first word, sp to the second. */ emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1])); - emit_move_insn (operand_subword (operands[0], 0, 0, (TARGET_32BIT ? DImode : TImode)), + emit_move_insn (operand_subword (operands[0], 0, 0, + (TARGET_32BIT ? DImode : TImode)), temp); emit_move_insn (operand_subword (operands[0], 1, 0, (TARGET_32BIT ? DImode : TImode)), operands[1]); @@ -7981,7 +7985,8 @@ emit_move_insn (temp, operand_subword (operands[1], 0, 0, (TARGET_32BIT ? DImode : TImode))); emit_move_insn (operands[0], - operand_subword (operands[1], 1, 0, (TARGET_32BIT ? DImode : TImode))); + operand_subword (operands[1], 1, 0, + (TARGET_32BIT ? DImode : TImode))); emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp); DONE; }") @@ -8201,7 +8206,8 @@ if (DEFAULT_ABI == ABI_AIX) { - /* AIX function pointers are really pointers to a three word area */ + /* AIX function pointers are really pointers to a three word + area. */ rtx static_chain = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM); emit_call_insn (TARGET_32BIT ? gen_call_indirect_aix32 (force_reg (Pmode, operands[0]), @@ -8263,7 +8269,8 @@ if (DEFAULT_ABI == ABI_AIX) { - /* AIX function pointers are really pointers to a three word area */ + /* AIX function pointers are really pointers to a three word + area. */ rtx static_chain = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM); emit_call_insn (TARGET_32BIT ? gen_call_value_indirect_aix32 (operands[0], @@ -8655,7 +8662,7 @@ " { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8670,7 +8677,7 @@ " { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8685,7 +8692,7 @@ " { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8700,7 +8707,7 @@ " { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8715,7 +8722,7 @@ " { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8730,7 +8737,7 @@ " { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8744,7 +8751,7 @@ "" " { operands[1] = gen_rtx_COMPARE (CCUNSmode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (CCUNSmode); }") @@ -8758,7 +8765,7 @@ "" " { operands[1] = gen_rtx_COMPARE (CCUNSmode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (CCUNSmode); }") @@ -8772,7 +8779,7 @@ "" " { operands[1] = gen_rtx_COMPARE (CCUNSmode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (CCUNSmode); }") @@ -8786,7 +8793,7 @@ "" " { operands[1] = gen_rtx_COMPARE (CCUNSmode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (CCUNSmode); }") @@ -8803,7 +8810,7 @@ " { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8817,7 +8824,7 @@ FAIL; operands[1] = gen_rtx_COMPARE (CCFPmode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (CCFPmode); }") @@ -8834,7 +8841,7 @@ FAIL; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8851,7 +8858,7 @@ FAIL; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8863,7 +8870,7 @@ " { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8880,7 +8887,7 @@ FAIL; operands[1] = gen_rtx_COMPARE (mode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (mode); }") @@ -8891,7 +8898,7 @@ "" " { operands[1] = gen_rtx_COMPARE (CCUNSmode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (CCUNSmode); }") @@ -8902,7 +8909,7 @@ "" " { operands[1] = gen_rtx_COMPARE (CCUNSmode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (CCUNSmode); }") @@ -8913,7 +8920,7 @@ "" " { operands[1] = gen_rtx_COMPARE (CCUNSmode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (CCUNSmode); }") @@ -8924,7 +8931,7 @@ "" " { operands[1] = gen_rtx_COMPARE (CCUNSmode, - rs6000_compare_op0, rs6000_compare_op1); + rs6000_compare_op0, rs6000_compare_op1); operands[2] = gen_reg_rtx (CCUNSmode); }") @@ -10368,7 +10375,7 @@ "TARGET_32BIT" " { operands[0] = force_reg (SImode, operands[0]); - operands[2] = force_reg (SImode, gen_rtx_LABEL_REF (VOIDmode, operands[1])); + operands[2] = force_reg (SImode, gen_rtx_LABEL_REF (SImode, operands[1])); operands[3] = gen_reg_rtx (SImode); }") @@ -10381,7 +10388,7 @@ "TARGET_64BIT" " { operands[0] = force_reg (DImode, operands[0]); - operands[2] = force_reg (DImode, gen_rtx_LABEL_REF (VOIDmode, operands[1])); + operands[2] = force_reg (DImode, gen_rtx_LABEL_REF (SImode, operands[1])); operands[3] = gen_reg_rtx (DImode); }") diff --git a/gcc/config/rs6000/xm-sysv4.h b/gcc/config/rs6000/xm-sysv4.h index 181f8b7d818..46d1ddd8e54 100644 --- a/gcc/config/rs6000/xm-sysv4.h +++ b/gcc/config/rs6000/xm-sysv4.h @@ -1,6 +1,5 @@ /* Configuration for GNU C-compiler for PowerPC running System V.4. - Copyright (C) 1995, 1998 Free Software Foundation, Inc. - + Copyright (C) 1995, 1998, 1999 Free Software Foundation, Inc. Cloned from sparc/xm-sysv4.h by Michael Meissner (meissner@cygnus.com). This file is part of GNU CC. @@ -59,12 +58,3 @@ extern char *alloca (); #undef ONLY_INT_FIELDS #define ONLY_INT_FIELDS #endif - -#ifdef __PPC__ -#ifndef __STDC__ -extern char *malloc (), *realloc (), *calloc (); -#else -extern void *malloc (), *realloc (), *calloc (); -#endif -extern void free (); -#endif diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index d9d39c1a8cb..c6c28cdb687 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -1,5 +1,7 @@ /* Output routines for GCC for Hitachi Super-H. - Copyright (C) 1993-1998 Free Software Foundation, Inc. + Copyright (C) 1993-1998, 1999 Free Software Foundation, Inc. + Contributed by Steve Chamberlain (sac@cygnus.com). + Improved by Jim Wilson (wilson@cygnus.com). This file is part of GNU CC. @@ -18,13 +20,8 @@ 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. */ -/* Contributed by Steve Chamberlain (sac@cygnus.com). - Improved by Jim Wilson (wilson@cygnus.com). */ - #include "config.h" - -#include <stdio.h> - +#include "system.h" #include "rtl.h" #include "tree.h" #include "flags.h" @@ -392,16 +389,16 @@ expand_block_move (operands) char entry[30]; tree entry_name; rtx func_addr_rtx; - rtx r4 = gen_rtx (REG, SImode, 4); - rtx r5 = gen_rtx (REG, SImode, 5); + rtx r4 = gen_rtx_REG (SImode, 4); + rtx r5 = gen_rtx_REG (SImode, 5); sprintf (entry, "__movstrSI%d", bytes); entry_name = get_identifier (entry); func_addr_rtx = copy_to_mode_reg (Pmode, - gen_rtx (SYMBOL_REF, Pmode, - IDENTIFIER_POINTER (entry_name))); + gen_rtx_SYMBOL_REF + (Pmode, IDENTIFIER_POINTER (entry_name))); force_into (XEXP (operands[0], 0), r4); force_into (XEXP (operands[1], 0), r5); emit_insn (gen_block_move_real (func_addr_rtx)); @@ -415,15 +412,15 @@ expand_block_move (operands) tree entry_name; rtx func_addr_rtx; int final_switch, while_loop; - rtx r4 = gen_rtx (REG, SImode, 4); - rtx r5 = gen_rtx (REG, SImode, 5); - rtx r6 = gen_rtx (REG, SImode, 6); + rtx r4 = gen_rtx_REG (SImode, 4); + rtx r5 = gen_rtx_REG (SImode, 5); + rtx r6 = gen_rtx_REG (SImode, 6); entry_name = get_identifier ("__movstr"); func_addr_rtx = copy_to_mode_reg (Pmode, - gen_rtx (SYMBOL_REF, Pmode, - IDENTIFIER_POINTER (entry_name))); + gen_rtx_SYMBOL_REF + (Pmode, IDENTIFIER_POINTER (entry_name))); force_into (XEXP (operands[0], 0), r4); force_into (XEXP (operands[1], 0), r5); @@ -478,7 +475,7 @@ rtx prepare_scc_operands (code) enum rtx_code code; { - rtx t_reg = gen_rtx (REG, SImode, T_REG); + rtx t_reg = gen_rtx_REG (SImode, T_REG); enum rtx_code oldcode = code; enum machine_mode mode; @@ -562,9 +559,10 @@ from_compare (operands, code) insn = gen_ieee_ccmpeqsf_t (sh_compare_op0, sh_compare_op1); } else - insn = gen_rtx (SET, VOIDmode, - gen_rtx (REG, SImode, 18), - gen_rtx (code, SImode, sh_compare_op0, sh_compare_op1)); + insn = gen_rtx_SET (VOIDmode, + gen_rtx_REG (SImode, 18), + gen_rtx (code, SImode, sh_compare_op0, + sh_compare_op1)); if (TARGET_SH4 && GET_MODE_CLASS (mode) == MODE_FLOAT) { insn = gen_rtx (PARALLEL, VOIDmode, @@ -711,7 +709,7 @@ output_far_jump (insn, op) if (dbr_sequence_length ()) print_slot (final_sequence); - this.reg = gen_rtx (REG, SImode, 13); + this.reg = gen_rtx_REG (SImode, 13); output_asm_insn ("mov.l r13,@-r15", 0); output_asm_insn (jump, &this.lab); output_asm_insn ("mov.l @r15+,r13", 0); @@ -1218,13 +1216,13 @@ expand_ashiftrt (operands) wrk = gen_reg_rtx (Pmode); /* Load the value into an arg reg and call a helper. */ - emit_move_insn (gen_rtx (REG, SImode, 4), operands[1]); + emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]); sprintf (func, "__ashiftrt_r4_%d", value); func_name = get_identifier (func); - emit_move_insn (wrk, gen_rtx (SYMBOL_REF, Pmode, - IDENTIFIER_POINTER (func_name))); + emit_move_insn (wrk, gen_rtx_SYMBOL_REF (Pmode, + IDENTIFIER_POINTER (func_name))); emit_insn (gen_ashrsi3_n (GEN_INT (value), wrk)); - emit_move_insn (operands[0], gen_rtx (REG, SImode, 4)); + emit_move_insn (operands[0], gen_rtx_REG (SImode, 4)); return 1; } @@ -2559,7 +2557,7 @@ gen_block_redirect (jump, addr, need_block) if (dead) { - rtx reg = gen_rtx (REG, SImode, exact_log2 (dead & -dead)); + rtx reg = gen_rtx_REG (SImode, exact_log2 (dead & -dead)); /* It would be nice if we could convert the jump into an indirect jump / far branch right now, and thus exposing all constituent @@ -2767,8 +2765,8 @@ machine_dependent_reorg (first) { rtx insn, mova; int num_mova; - rtx r0_rtx = gen_rtx (REG, Pmode, 0); - rtx r0_inc_rtx = gen_rtx (POST_INC, Pmode, r0_rtx); + rtx r0_rtx = gen_rtx_REG (Pmode, 0); + rtx r0_inc_rtx = gen_rtx_POST_INC (Pmode, r0_rtx); /* If relaxing, generate pseudo-ops to associate function calls with the symbols they call. It does no harm to not generate these @@ -2973,10 +2971,10 @@ machine_dependent_reorg (first) or pseudo-op. */ label = gen_label_rtx (); - REG_NOTES (link) = gen_rtx (EXPR_LIST, REG_LABEL, label, - REG_NOTES (link)); - REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_LABEL, label, - REG_NOTES (insn)); + REG_NOTES (link) = gen_rtx_EXPR_LIST (REG_LABEL, label, + REG_NOTES (link)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, label, + REG_NOTES (insn)); if (rescan) { scan = link; @@ -2990,8 +2988,8 @@ machine_dependent_reorg (first) && reg_mentioned_p (reg, scan)) || ((reg2 = sfunc_uses_reg (scan)) && REGNO (reg2) == REGNO (reg)))) - REG_NOTES (scan) = gen_rtx (EXPR_LIST, REG_LABEL, - label, REG_NOTES (scan)); + REG_NOTES (scan) + = gen_rtx_EXPR_LIST (REG_LABEL, label, REG_NOTES (scan)); } while (scan != dies); } @@ -3091,7 +3089,7 @@ machine_dependent_reorg (first) offset += SUBREG_WORD (dst); dst = SUBREG_REG (dst); } - dst = gen_rtx (REG, HImode, REGNO (dst) + offset); + dst = gen_rtx_REG (HImode, REGNO (dst) + offset); } if (GET_CODE (dst) == REG @@ -3145,11 +3143,11 @@ machine_dependent_reorg (first) else { lab = add_constant (src, mode, 0); - newsrc = gen_rtx (MEM, mode, - gen_rtx (LABEL_REF, VOIDmode, lab)); + newsrc = gen_rtx_MEM (mode, + gen_rtx_LABEL_REF (VOIDmode, lab)); } RTX_UNCHANGING_P (newsrc) = 1; - *patp = gen_rtx (SET, VOIDmode, dst, newsrc); + *patp = gen_rtx_SET (VOIDmode, dst, newsrc); INSN_CODE (scan) = -1; } } @@ -3564,7 +3562,7 @@ output_stack_adjust (size, reg, temp) to handle this case, so just abort when we see it. */ if (temp < 0) abort (); - const_reg = gen_rtx (REG, SImode, temp); + const_reg = gen_rtx_REG (SImode, temp); /* If SIZE is negative, subtract the positive value. This sometimes allows a constant pool entry to be shared @@ -3597,16 +3595,17 @@ push (rn) { if ((rn - FIRST_FP_REG) & 1 && rn <= LAST_FP_REG) return; - x = gen_push_4 (gen_rtx (REG, DFmode, rn)); + x = gen_push_4 (gen_rtx_REG (DFmode, rn)); } else if (TARGET_SH3E && rn >= FIRST_FP_REG && rn <= LAST_FP_REG) - x = gen_push_e (gen_rtx (REG, SFmode, rn)); + x = gen_push_e (gen_rtx_REG (SFmode, rn)); else - x = gen_push (gen_rtx (REG, SImode, rn)); + x = gen_push (gen_rtx_REG (SImode, rn)); x = emit_insn (x); - REG_NOTES (x) = gen_rtx (EXPR_LIST, REG_INC, - gen_rtx(REG, SImode, STACK_POINTER_REGNUM), 0); + REG_NOTES (x) + = gen_rtx_EXPR_LIST (REG_INC, + gen_rtx_REG (SImode, STACK_POINTER_REGNUM), 0); } /* Output RTL to pop register RN from the stack. */ @@ -3623,16 +3622,17 @@ pop (rn) { if ((rn - FIRST_FP_REG) & 1 && rn <= LAST_FP_REG) return; - x = gen_pop_4 (gen_rtx (REG, DFmode, rn)); + x = gen_pop_4 (gen_rtx_REG (DFmode, rn)); } else if (TARGET_SH3E && rn >= FIRST_FP_REG && rn <= LAST_FP_REG) - x = gen_pop_e (gen_rtx (REG, SFmode, rn)); + x = gen_pop_e (gen_rtx_REG (SFmode, rn)); else - x = gen_pop (gen_rtx (REG, SImode, rn)); + x = gen_pop (gen_rtx_REG (SImode, rn)); x = emit_insn (x); - REG_NOTES (x) = gen_rtx (EXPR_LIST, REG_INC, - gen_rtx(REG, SImode, STACK_POINTER_REGNUM), 0); + REG_NOTES (x) + = gen_rtx_EXPR_LIST (REG_INC, + gen_rtx_REG (SImode, STACK_POINTER_REGNUM), 0); } /* Generate code to push the regs specified in the mask. */ @@ -3904,9 +3904,10 @@ sh_builtin_saveregs () named args need not be saved. */ if (n_intregs > 0) move_block_from_reg (BASE_ARG_REG (SImode) + first_intreg, - gen_rtx (MEM, BLKmode, - plus_constant (XEXP (regbuf, 0), - n_floatregs * UNITS_PER_WORD)), + gen_rtx_MEM (BLKmode, + plus_constant (XEXP (regbuf, 0), + (n_floatregs + * UNITS_PER_WORD))), n_intregs, n_intregs * UNITS_PER_WORD); /* Save float args. @@ -3943,8 +3944,8 @@ sh_builtin_saveregs () for (regno = NPARM_REGS (SFmode) - 1; regno >= first_floatreg; regno--) { emit_insn (gen_addsi3 (fpregs, fpregs, GEN_INT (- UNITS_PER_WORD))); - emit_move_insn (gen_rtx (MEM, SFmode, fpregs), - gen_rtx (REG, SFmode, BASE_ARG_REG (SFmode) + regno)); + emit_move_insn (gen_rtx_MEM (SFmode, fpregs), + gen_rtx_REG (SFmode, BASE_ARG_REG (SFmode) + regno)); } /* Return the address of the regbuf. */ @@ -4085,8 +4086,8 @@ sh_valid_machine_decl_attribute (decl, attributes, attr, args) if (TREE_CODE (TREE_VALUE (args)) != STRING_CST) return 0; - sp_switch = gen_rtx (SYMBOL_REF, VOIDmode, - TREE_STRING_POINTER (TREE_VALUE (args))); + sp_switch = gen_rtx_SYMBOL_REF (VOIDmode, + TREE_STRING_POINTER (TREE_VALUE (args))); return 1; } diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index 949e2e714b6..dd802ab6f79 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler for Hitachi Super-H. - Copyright (C) 1993-1998 Free Software Foundation, Inc. + Copyright (C) 1993-1998, 1999 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com). Improved by Jim Wilson (wilson@cygnus.com). @@ -923,7 +923,7 @@ extern enum reg_class reg_class_from_letter[]; /* Define how to find the value returned by a library function assuming the value has mode MODE. */ #define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, (MODE), BASE_RETURN_VALUE_REG (MODE)) + gen_rtx_REG ((MODE), BASE_RETURN_VALUE_REG (MODE)); /* 1 if N is a possible register number for a function value. */ #define FUNCTION_VALUE_REGNO_P(REGNO) \ @@ -1043,10 +1043,10 @@ struct sh_args { ((PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \ && ((NAMED) \ || (! TARGET_HITACHI && (TARGET_SH3E || ! current_function_varargs)))) \ - ? gen_rtx (REG, (MODE), \ - ((BASE_ARG_REG (MODE) + ROUND_REG ((CUM), (MODE))) \ - ^ ((MODE) == SFmode && TARGET_SH4 \ - && TARGET_LITTLE_ENDIAN != 0))) \ + ? gen_rtx_REG ((MODE), \ + ((BASE_ARG_REG (MODE) + ROUND_REG ((CUM), (MODE))) \ + ^ ((MODE) == SFmode && TARGET_SH4 \ + && TARGET_LITTLE_ENDIAN != 0))) \ : 0) #define PRETEND_OUTGOING_VARARGS_NAMED (! TARGET_HITACHI) @@ -1129,13 +1129,13 @@ extern int current_function_anonymous_args; #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, (TRAMP)), \ + emit_move_insn (gen_rtx_MEM (SImode, (TRAMP)), \ GEN_INT (TARGET_LITTLE_ENDIAN ? 0xd301dd02 : 0xdd02d301));\ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 4)), \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 4)), \ GEN_INT (TARGET_LITTLE_ENDIAN ? 0x00094d2b : 0x4d2b0009));\ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 8)), \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 8)), \ (CXT)); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 12)), \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 12)), \ (FNADDR)); \ if (TARGET_HARVARD) \ emit_insn (gen_ic_invalidate_line (TRAMP)); \ @@ -1148,7 +1148,7 @@ extern int current_function_anonymous_args; #define RETURN_ADDR_RTX(COUNT, FRAME) \ (((COUNT) == 0) \ - ? gen_rtx (MEM, Pmode, gen_rtx (REG, Pmode, RETURN_ADDRESS_POINTER_REGNUM)) \ + ? gen_rtx_MEM (Pmode, gen_rtx_REG (Pmode, RETURN_ADDRESS_POINTER_REGNUM)) \ : (rtx) 0) /* Generate necessary RTL for __builtin_saveregs(). */ @@ -1393,7 +1393,7 @@ extern struct rtx_def *sh_builtin_saveregs (); GEN_INT (offset_base), NULL_RTX, 0, \ OPTAB_LIB_WIDEN); \ \ - (X) = gen_rtx (PLUS, Pmode, sum, GEN_INT (offset - offset_base)); \ + (X) = gen_rtx_PLUS (Pmode, sum, GEN_INT (offset - offset_base)); \ goto WIN; \ } \ } \ diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 38732e65256..ac3d3b0a6f4 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -706,10 +706,12 @@ " { rtx high0, high2, low0 = gen_lowpart (SImode, operands[0]); - high0 = gen_rtx (REG, SImode, - true_regnum (operands[0]) + (TARGET_LITTLE_ENDIAN ? 1 : 0)); - high2 = gen_rtx (REG, SImode, - true_regnum (operands[2]) + (TARGET_LITTLE_ENDIAN ? 1 : 0)); + high0 = gen_rtx_REG (SImode, + true_regnum (operands[0]) + + (TARGET_LITTLE_ENDIAN ? 1 : 0)); + high2 = gen_rtx_REG (SImode, + true_regnum (operands[2]) + + (TARGET_LITTLE_ENDIAN ? 1 : 0)); emit_insn (gen_clrt ()); emit_insn (gen_addc (low0, low0, gen_lowpart (SImode, operands[2]))); emit_insn (gen_addc1 (high0, high0, high2)); @@ -770,10 +772,12 @@ " { rtx high0, high2, low0 = gen_lowpart (SImode, operands[0]); - high0 = gen_rtx (REG, SImode, - true_regnum (operands[0]) + (TARGET_LITTLE_ENDIAN ? 1 : 0)); - high2 = gen_rtx (REG, SImode, - true_regnum (operands[2]) + (TARGET_LITTLE_ENDIAN ? 1 : 0)); + high0 = gen_rtx_REG (SImode, + true_regnum (operands[0]) + + (TARGET_LITTLE_ENDIAN ? 1 : 0)); + high2 = gen_rtx_REG (SImode, + true_regnum (operands[2]) + + (TARGET_LITTLE_ENDIAN ? 1 : 0)); emit_insn (gen_clrt ()); emit_insn (gen_subc (low0, low0, gen_lowpart (SImode, operands[2]))); emit_insn (gen_subc1 (high0, high0, high2)); @@ -1152,9 +1156,9 @@ emit_insn (gen_mulsidi3_i (operands[1], operands[2])); - emit_insn (gen_rtx (CLOBBER, VOIDmode, operands[0])); - emit_move_insn (low_dst, gen_rtx (REG, SImode, 21)); - emit_move_insn (high_dst, gen_rtx (REG, SImode, 20)); + emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0])); + emit_move_insn (low_dst, gen_rtx_REG (SImode, 21)); + emit_move_insn (high_dst, gen_rtx_REG (SImode, 20)); DONE; } }") @@ -1185,9 +1189,9 @@ emit_insn (gen_umulsidi3_i (operands[1], operands[2])); - emit_insn (gen_rtx (CLOBBER, VOIDmode, operands[0])); - emit_move_insn (low_dst, gen_rtx (REG, SImode, 21)); - emit_move_insn (high_dst, gen_rtx (REG, SImode, 20)); + emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0])); + emit_move_insn (low_dst, gen_rtx_REG (SImode, 21)); + emit_move_insn (high_dst, gen_rtx_REG (SImode, 20)); DONE; } }") @@ -2755,7 +2759,7 @@ emit_move_insn (operands[2], const_int); emit_move_insn (operands[0], change_address (operands[1], VOIDmode, - gen_rtx (PLUS, SImode, reg, operands[2]))); + gen_rtx_PLUS (SImode, reg, operands[2]))); DONE; }") @@ -2780,7 +2784,7 @@ FAIL; emit_move_insn (operands[2], const_int); emit_move_insn (change_address (operands[1], VOIDmode, - gen_rtx (PLUS, SImode, reg, operands[2])), + gen_rtx_PLUS (SImode, reg, operands[2])), operands[0]); DONE; }") @@ -3463,7 +3467,7 @@ { if (TARGET_IEEE) { - rtx t_reg = gen_rtx (REG, SImode, T_REG); + rtx t_reg = gen_rtx_REG (SImode, T_REG); rtx lab = gen_label_rtx (); prepare_scc_operands (EQ); emit_jump_insn (gen_branch_true (lab)); @@ -4394,14 +4398,14 @@ addr_target = copy_addr_to_reg (plus_constant (orig_address, size - 1)); operands[0] = change_address (operands[0], QImode, addr_target); - emit_insn (gen_movqi (operands[0], gen_rtx (SUBREG, QImode, shift_reg, 0))); + emit_insn (gen_movqi (operands[0], gen_rtx_SUBREG (QImode, shift_reg, 0))); while (size -= 1) { emit_insn (gen_lshrsi3_k (shift_reg, shift_reg, GEN_INT (8))); emit_insn (gen_addsi3 (addr_target, addr_target, GEN_INT (-1))); emit_insn (gen_movqi (operands[0], - gen_rtx (SUBREG, QImode, shift_reg, 0))); + gen_rtx_SUBREG (QImode, shift_reg, 0))); } DONE; diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index d113248b808..43583b738e6 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -1195,15 +1195,14 @@ extern int sparc_mode_class[]; #define STRUCT_VALUE \ (TARGET_ARCH64 \ ? 0 \ - : gen_rtx_MEM (Pmode, \ - gen_rtx_PLUS (Pmode, stack_pointer_rtx, \ - GEN_INT (STRUCT_VALUE_OFFSET)))) + : gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, \ + STRUCT_VALUE_OFFSET))) + #define STRUCT_VALUE_INCOMING \ - (TARGET_ARCH64 \ - ? 0 \ - : gen_rtx_MEM (Pmode, \ - gen_rtx_PLUS (Pmode, frame_pointer_rtx, \ - GEN_INT (STRUCT_VALUE_OFFSET)))) + (TARGET_ARCH64 \ + ? 0 \ + : gen_rtx_MEM (Pmode, plus_constant (frame_pointer_rtx, \ + STRUCT_VALUE_OFFSET))) /* Define the classes of registers for register constraints in the machine description. Also define ranges of constants. @@ -1497,8 +1496,8 @@ extern char leaf_reg_remap[]; #define SECONDARY_MEMORY_NEEDED_RTX(MODE) \ (get_frame_size () == 0 \ ? assign_stack_local (MODE, GET_MODE_SIZE (MODE), 0) \ - : gen_rtx_MEM (MODE, gen_rtx_PLUS (Pmode, frame_pointer_rtx, \ - GEN_INT (STARTING_FRAME_OFFSET)))) + : gen_rtx_MEM (MODE, plus_constant (frame_pointer_rtx, \ + STARTING_FRAME_OFFSET))) /* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on v9 because the movsi and movsf patterns don't handle r/f moves. @@ -2076,8 +2075,7 @@ extern struct rtx_def *sparc_builtin_saveregs (); return an rtx for the address of the word in the frame that holds the dynamic chain--the previous frame's address. ??? -mflat support? */ -#define DYNAMIC_CHAIN_ADDRESS(frame) \ - gen_rtx_PLUS (Pmode, frame, GEN_INT (14 * UNITS_PER_WORD)) +#define DYNAMIC_CHAIN_ADDRESS(frame) plus_constant (frame, 14 * UNITS_PER_WORD) /* The return address isn't on the stack, it is in a register, so we can't access it from the current frame pointer. We can access it from the @@ -2098,14 +2096,15 @@ extern struct rtx_def *sparc_builtin_saveregs (); ((count == -1) \ ? gen_rtx_REG (Pmode, 31) \ : gen_rtx_MEM (Pmode, \ - memory_address (Pmode, plus_constant (frame, 15 * UNITS_PER_WORD)))) + memory_address (Pmode, plus_constant (frame, \ + 15 * UNITS_PER_WORD)))) /* Before the prologue, the return address is %o7 + 8. OK, sometimes it's +12, but always using +8 is close enough for frame unwind purposes. Actually, just using %o7 is close enough for unwinding, but %o7+8 is something you can return to. */ #define INCOMING_RETURN_ADDR_RTX \ - gen_rtx_PLUS (word_mode, gen_rtx_REG (word_mode, 15), GEN_INT (8)) + plus_constant (gen_rtx_REG (word_mode, 15), 8) /* The offset from the incoming value of %sp to the top of the stack frame for the current function. On sparc64, we have to account for the stack @@ -2389,25 +2388,25 @@ extern struct rtx_def *legitimize_pic_address (); { rtx sparc_x = (X); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT) \ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 1), \ - force_operand (XEXP (X, 0), NULL_RTX)); \ + force_operand (XEXP (X, 0), NULL_RTX)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT) \ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \ - force_operand (XEXP (X, 1), NULL_RTX)); \ + force_operand (XEXP (X, 1), NULL_RTX)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == PLUS) \ (X) = gen_rtx_PLUS (Pmode, force_operand (XEXP (X, 0), NULL_RTX),\ - XEXP (X, 1)); \ + XEXP (X, 1)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == PLUS) \ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \ - force_operand (XEXP (X, 1), NULL_RTX)); \ + force_operand (XEXP (X, 1), NULL_RTX)); \ if (sparc_x != (X) && memory_address_p (MODE, X)) \ goto WIN; \ if (flag_pic) (X) = legitimize_pic_address (X, MODE, 0); \ else if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \ - copy_to_mode_reg (Pmode, XEXP (X, 1))); \ + copy_to_mode_reg (Pmode, XEXP (X, 1))); \ else if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0))) \ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 1), \ - copy_to_mode_reg (Pmode, XEXP (X, 0))); \ + copy_to_mode_reg (Pmode, XEXP (X, 0))); \ else if (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST \ || GET_CODE (X) == LABEL_REF) \ (X) = copy_to_suggested_reg (X, NULL_RTX, Pmode); \ diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index eff6b2939ad..c51e25cac2f 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -2421,7 +2421,9 @@ (define_insn "*sethi_di_medlow_embmedany_pic" [(set (match_operand:DI 0 "register_operand" "=r") - (high:DI (match_operand:DI 1 "sp64_medium_pic_operand" "")))] + (high:DI (match_operand:DI 1 "sp64_medium_pic_operand" ""))) + ;; The clobber is here because emit_move_sequence assumes the worst case. + (clobber (reg:DI 1))] "(TARGET_CM_MEDLOW || TARGET_CM_EMBMEDANY) && check_pic (1)" "sethi\\t%%hi(%a1), %0" [(set_attr "type" "move") @@ -2430,6 +2432,8 @@ (define_insn "*sethi_di_medlow" [(set (match_operand:DI 0 "register_operand" "=r") (high:DI (match_operand:DI 1 "symbolic_operand" "")))] + ;; The clobber is here because emit_move_sequence assumes the worst case. + (clobber (reg:DI 1))] "TARGET_CM_MEDLOW && check_pic (1)" "sethi\\t%%hi(%a1), %0" [(set_attr "type" "move") @@ -3954,8 +3958,7 @@ operand1 = XEXP (operand1, 0); } - emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, - op1_subword), + emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, op1_subword), shift_16)); emit_insn (gen_lshrsi3 (operand0, temp, shift_16)); DONE; @@ -4033,8 +4036,7 @@ operand1 = XEXP (operand1, 0); } - emit_insn (gen_ashldi3 (temp, gen_rtx_SUBREG (DImode, operand1, - op1_subword), + emit_insn (gen_ashldi3 (temp, gen_rtx_SUBREG (DImode, operand1, op1_subword), shift_48)); emit_insn (gen_lshrdi3 (operand0, temp, shift_48)); DONE; @@ -4214,8 +4216,7 @@ operand1 = XEXP (operand1, 0); } - emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, - op1_subword), + emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, op1_subword), shift_16)); emit_insn (gen_ashrsi3 (operand0, temp, shift_16)); DONE; @@ -4250,8 +4251,7 @@ op0_subword = SUBREG_WORD (operand0); operand0 = XEXP (operand0, 0); } - emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, - op1_subword), + emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, op1_subword), shift_24)); if (GET_MODE (operand0) != SImode) operand0 = gen_rtx_SUBREG (SImode, operand0, op0_subword); @@ -4283,8 +4283,7 @@ operand1 = XEXP (operand1, 0); } - emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, - op1_subword), + emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1, op1_subword), shift_24)); emit_insn (gen_ashrsi3 (operand0, temp, shift_24)); DONE; @@ -4314,8 +4313,7 @@ operand1 = XEXP (operand1, 0); } - emit_insn (gen_ashldi3 (temp, gen_rtx_SUBREG (DImode, operand1, - op1_subword), + emit_insn (gen_ashldi3 (temp, gen_rtx_SUBREG (DImode, operand1, op1_subword), shift_56)); emit_insn (gen_ashrdi3 (operand0, temp, shift_56)); DONE; @@ -4345,8 +4343,7 @@ operand1 = XEXP (operand1, 0); } - emit_insn (gen_ashldi3 (temp, gen_rtx_SUBREG (DImode, operand1, - op1_subword), + emit_insn (gen_ashldi3 (temp, gen_rtx_SUBREG (DImode, operand1, op1_subword), shift_48)); emit_insn (gen_ashrdi3 (operand0, temp, shift_48)); DONE; @@ -6280,11 +6277,14 @@ { if (! TARGET_ARCH64) { - emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, - gen_rtx_SET (VOIDmode, operand0, - gen_rtx_NEG (DImode, operand1)), - gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (CCmode, SPARC_ICC_REG))))); + emit_insn (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (2, + gen_rtx_SET (VOIDmode, operand0, + gen_rtx_NEG (DImode, operand1)), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_REG (CCmode, + SPARC_ICC_REG))))); DONE; } }") @@ -7407,21 +7407,19 @@ if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0) emit_jump_insn - (gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (3, - gen_rtx_SET (VOIDmode, pc_rtx, - XEXP (operands[0], 0)), - GEN_INT (INTVAL (operands[3]) & 0xfff), - gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (Pmode, 15))))); + (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (3, + gen_rtx_SET (VOIDmode, pc_rtx, XEXP (operands[0], 0)), + GEN_INT (INTVAL (operands[3]) & 0xfff), + gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15))))); else emit_jump_insn - (gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (2, - gen_rtx_SET (VOIDmode, pc_rtx, - XEXP (operands[0], 0)), - gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (Pmode, 15))))); + (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (2, + gen_rtx_SET (VOIDmode, pc_rtx, XEXP (operands[0], 0)), + gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15))))); goto finish_call; } @@ -7441,17 +7439,17 @@ if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0) emit_call_insn - (gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (3, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx), - GEN_INT (INTVAL (operands[3]) & 0xfff), - gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (Pmode, 15))))); + (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (3, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx), + GEN_INT (INTVAL (operands[3]) & 0xfff), + gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15))))); else emit_call_insn - (gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (2, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx), - gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (Pmode, 15))))); + (gen_rtx_PARALLEL + (VOIDmode, + gen_rtvec (2, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx), + gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15))))); finish_call: #if 0 @@ -7583,7 +7581,7 @@ vec = gen_rtvec (2, gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx)), + gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx)), gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15))); emit_call_insn (gen_rtx_PARALLEL (VOIDmode, vec)); @@ -7935,6 +7933,7 @@ ; [(set_attr "type" "multi") ; (set_attr "length" "4")]) + ;; Peepholes go at the end. diff --git a/gcc/config/spur/spur.c b/gcc/config/spur/spur.c index 62453f2af97..5c4024379e8 100644 --- a/gcc/config/spur/spur.c +++ b/gcc/config/spur/spur.c @@ -1,6 +1,6 @@ /* Subroutines for insn-output.c for SPUR. Adapted from routines for the Motorola 68000 family. - Copyright (C) 1988, 1991, 1997 Free Software Foundation, Inc. + Copyright (C) 1988, 1991, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -20,7 +20,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -140,14 +140,14 @@ output_move_double (operands) operands in OPERANDS to be suitable for the low-numbered word. */ if (optype0 == REGOP) - latehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + latehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else if (optype0 == OFFSOP) latehalf[0] = adj_offsettable_operand (operands[0], 4); else latehalf[0] = operands[0]; if (optype1 == REGOP) - latehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + latehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); else if (optype1 == OFFSOP) latehalf[1] = adj_offsettable_operand (operands[1], 4); else if (optype1 == CNSTOP) @@ -224,7 +224,7 @@ output_fp_move_double (operands) { rtx xoperands[2]; int offset = - get_frame_size () - 8; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); xoperands[0] = GEN_INT (offset + 4); output_asm_insn ("st_32 %1,r25,%0", xoperands); xoperands[1] = operands[1]; @@ -247,7 +247,7 @@ output_fp_move_double (operands) output_asm_insn ("st_dbl %1,r25,%0", xoperands); xoperands[1] = operands[0]; output_asm_insn ("ld_32 %1,r25,%0\n\tnop", xoperands); - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); xoperands[0] = GEN_INT (offset + 4); output_asm_insn ("ld_32 %1,r25,%0\n\tnop", xoperands); return ""; diff --git a/gcc/config/spur/spur.h b/gcc/config/spur/spur.h index 3ce499ef9de..3c893d49466 100644 --- a/gcc/config/spur/spur.h +++ b/gcc/config/spur/spur.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for SPUR chip. - Copyright (C) 1988, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1988, 1995, 1996, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -355,17 +355,17 @@ enum reg_class { NO_REGS, GENERAL_REGS, FP_REGS, ALL_REGS, LIM_REG_CLASSES }; /* On SPUR the value is found in the second "output" register. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), 27) + gen_rtx_REG (TYPE_MODE (VALTYPE), 27) /* But the called function leaves it in the second "input" register. */ #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), 11) + gen_rtx_REG (TYPE_MODE (VALTYPE), 11) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 27) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 27) /* 1 if N is a possible register number for a function value as seen by the caller. @@ -449,7 +449,7 @@ enum reg_class { NO_REGS, GENERAL_REGS, FP_REGS, ALL_REGS, LIM_REG_CLASSES }; + ((MODE) == BLKmode \ ? (int_size_in_bytes (TYPE) + 3) / 4 \ : (GET_MODE_SIZE (MODE) + 3) / 4)) \ - ? gen_rtx (REG, (MODE), 27 + (CUM)) \ + ? gen_rtx_REG ((MODE), 27 + (CUM)) \ : 0) /* Define where a function finds its arguments. @@ -460,7 +460,7 @@ enum reg_class { NO_REGS, GENERAL_REGS, FP_REGS, ALL_REGS, LIM_REG_CLASSES }; + ((MODE) == BLKmode \ ? (int_size_in_bytes (TYPE) + 3) / 4 \ : (GET_MODE_SIZE (MODE) + 3) / 4)) \ - ? gen_rtx (REG, (MODE), 11 + (CUM)) \ + ? gen_rtx_REG ((MODE), 11 + (CUM)) \ : 0) /* For an arg passed partly in registers and partly in memory, @@ -708,17 +708,17 @@ enum reg_class { NO_REGS, GENERAL_REGS, FP_REGS, ALL_REGS, LIM_REG_CLASSES }; #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ { if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ - copy_to_mode_reg (SImode, XEXP (X, 1))); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ + copy_to_mode_reg (SImode, XEXP (X, 1))); \ if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0))) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \ - copy_to_mode_reg (SImode, XEXP (X, 0))); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ + copy_to_mode_reg (SImode, XEXP (X, 0))); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \ - force_operand (XEXP (X, 0), 0)); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ + force_operand (XEXP (X, 0), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT) \ - (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ - force_operand (XEXP (X, 1), 0)); \ + (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ + force_operand (XEXP (X, 1), 0)); \ if (memory_address_p (MODE, X)) \ goto WIN; } diff --git a/gcc/config/spur/spur.md b/gcc/config/spur/spur.md index 7ad4af5b342..100cc0b5a92 100644 --- a/gcc/config/spur/spur.md +++ b/gcc/config/spur/spur.md @@ -1,5 +1,5 @@ ;;- Machine description for SPUR chip for GNU C compiler -;; Copyright (C) 1988 Free Software Foundation, Inc. +;; Copyright (C) 1988, 1998, 1999 Free Software Foundation, Inc. ;; This file is part of GNU CC. @@ -288,17 +288,17 @@ rtx addr = force_reg (SImode, XEXP (operands[1], 0)); rtx subreg; - emit_move_insn (tem, gen_rtx (MEM, SImode, addr)); + emit_move_insn (tem, gen_rtx_MEM (SImode, addr)); if (GET_CODE (operands[0]) == SUBREG) - subreg = gen_rtx (SUBREG, SImode, SUBREG_REG (operands[0]), - SUBREG_WORD (operands[0])); + subreg = gen_rtx_SUBREG (SImode, SUBREG_REG (operands[0]), + SUBREG_WORD (operands[0])); else - subreg = gen_rtx (SUBREG, SImode, operands[0], 0); + subreg = gen_rtx_SUBREG (SImode, operands[0], 0); - emit_insn (gen_rtx (SET, VOIDmode, subreg, - gen_rtx (ZERO_EXTRACT, SImode, tem, - GEN_INT (8), - addr))); + emit_insn (gen_rtx_SET (VOIDmode, subreg, + gen_rtx_ZERO_EXTRACT (SImode, tem, + GEN_INT (8), + addr))); } else if (GET_CODE (operands[0]) == MEM) { @@ -306,26 +306,26 @@ rtx addr = force_reg (SImode, XEXP (operands[0], 0)); rtx subreg; - emit_move_insn (tem, gen_rtx (MEM, SImode, addr)); + emit_move_insn (tem, gen_rtx_MEM (SImode, addr)); if (! CONSTANT_ADDRESS_P (operands[1])) { if (GET_CODE (operands[1]) == SUBREG) - subreg = gen_rtx (SUBREG, SImode, SUBREG_REG (operands[1]), - SUBREG_WORD (operands[1])); + subreg = gen_rtx_SUBREG (SImode, SUBREG_REG (operands[1]), + SUBREG_WORD (operands[1])); else - subreg = gen_rtx (SUBREG, SImode, operands[1], 0); + subreg = gen_rtx_SUBREG (SImode, operands[1], 0); } - emit_insn (gen_rtx (SET, VOIDmode, - gen_rtx (ZERO_EXTRACT, SImode, tem, - GEN_INT (8), - addr), - subreg)); - emit_move_insn (gen_rtx (MEM, SImode, addr), tem); + emit_insn (gen_rtx_SET (VOIDmode, + gen_rtx_ZERO_EXTRACT (SImode, tem, + GEN_INT (8), + addr), + subreg)); + emit_move_insn (gen_rtx_MEM (SImode, addr), tem); } else { - emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1])); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1])); } DONE; }") @@ -443,10 +443,10 @@ " { if (GET_CODE (operands[1]) == SUBREG) - operands[5] = gen_rtx (SUBREG, SImode, SUBREG_REG (operands[1]), - SUBREG_WORD (operands[1])); + operands[5] = gen_rtx_SUBREG (SImode, SUBREG_REG (operands[1]), + SUBREG_WORD (operands[1])); else - operands[5] = gen_rtx (SUBREG, SImode, operands[1], 0); + operands[5] = gen_rtx_SUBREG (SImode, operands[1], 0); }") ;; Like storehi but operands[1] is a CONST_INT. @@ -468,7 +468,7 @@ (match_dup 2))] "" " operands[5] = GEN_INT (INTVAL (operands[1]) & 255); - operands[6] = GEN_INT ((INTVAL (operands[1]) >> 8) & 255); + operands[6] = GEN_INT (INTVAL (operands[1]) >> 8) & 255); ") ;; Main entry for generating insns to move halfwords. @@ -490,8 +490,8 @@ gen_reg_rtx (SImode), gen_reg_rtx (SImode), gen_reg_rtx (QImode))); /* Tell cse what value the loadhi produces, so it detect duplicates. */ - REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL, operands[1], - REG_NOTES (insn)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], + REG_NOTES (insn)); } else if (GET_CODE (operands[0]) == MEM) { @@ -511,7 +511,7 @@ } } else - emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1])); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1])); DONE; }") @@ -579,7 +579,7 @@ return output_fp_move_double (operands); if (operands[1] == CONST0_RTX (DFmode) && GET_CODE (operands[0]) == REG) { - operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); return \"add_nt %0,r0,$0\;add_nt %1,r0,$0\"; } if (operands[1] == CONST0_RTX (DFmode) && GET_CODE (operands[0]) == MEM) @@ -699,10 +699,10 @@ " { if (GET_CODE (operands[1]) == SUBREG) - operands[1] = gen_rtx (SUBREG, SImode, SUBREG_REG (operands[1]), - SUBREG_WORD (operands[1])); + operands[1] = gen_rtx_SUBREG (SImode, SUBREG_REG (operands[1]), + SUBREG_WORD (operands[1])); else - operands[1] = gen_rtx (SUBREG, SImode, operands[1], 0); + operands[1] = gen_rtx_SUBREG (SImode, operands[1], 0); operands[2] = force_reg (SImode, GEN_INT (65535)); }") @@ -736,10 +736,10 @@ " { if (GET_CODE (operands[1]) == SUBREG) - operands[1] = gen_rtx (SUBREG, SImode, SUBREG_REG (operands[1]), - SUBREG_WORD (operands[1])); + operands[1] = gen_rtx_SUBREG (SImode, SUBREG_REG (operands[1]), + SUBREG_WORD (operands[1])); else - operands[1] = gen_rtx (SUBREG, SImode, operands[1], 0); + operands[1] = gen_rtx_SUBREG (SImode, operands[1], 0); operands[2] = gen_reg_rtx (SImode); operands[3] = gen_reg_rtx (SImode); @@ -759,10 +759,10 @@ " { if (GET_CODE (operands[1]) == SUBREG) - operands[1] = gen_rtx (SUBREG, HImode, SUBREG_REG (operands[1]), - SUBREG_WORD (operands[1])); + operands[1] = gen_rtx_SUBREG (HImode, SUBREG_REG (operands[1]), + SUBREG_WORD (operands[1])); else - operands[1] = gen_rtx (SUBREG, HImode, operands[1], 0); + operands[1] = gen_rtx_SUBREG (HImode, operands[1], 0); operands[2] = gen_reg_rtx (HImode); operands[3] = gen_reg_rtx (HImode); @@ -779,10 +779,10 @@ " { if (GET_CODE (operands[1]) == SUBREG) - operands[1] = gen_rtx (SUBREG, SImode, SUBREG_REG (operands[1]), - SUBREG_WORD (operands[1])); + operands[1] = gen_rtx_SUBREG (SImode, SUBREG_REG (operands[1]), + SUBREG_WORD (operands[1])); else - operands[1] = gen_rtx (SUBREG, SImode, operands[1], 0); + operands[1] = gen_rtx_SUBREG (SImode, operands[1], 0); operands[2] = gen_reg_rtx (SImode); operands[3] = gen_reg_rtx (SImode); diff --git a/gcc/config/tahoe/tahoe.c b/gcc/config/tahoe/tahoe.c index 53f77d64be2..89cdc3d8f84 100644 --- a/gcc/config/tahoe/tahoe.c +++ b/gcc/config/tahoe/tahoe.c @@ -1,5 +1,10 @@ /* Subroutines for insn-output.c for Tahoe. - Copyright (C) 1989, 1991, 1997 Free Software Foundation, Inc. + Copyright (C) 1989, 1991, 1997, 1998, 1999 Free Software Foundation, Inc. + Contributed by the University of Buffalo (Devon Bowen, Dale Wiles + and Kevin Zachmann. + Changes for HCX by Piet van Oostrum, University of Utrecht, + The Netherlands (piet@cs.ruu.nl) + Speed tweaks by Michael Tiemann (tiemann@lurch.stanford.edu). This file is part of GNU CC. @@ -18,9 +23,8 @@ 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 "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -32,21 +36,6 @@ Boston, MA 02111-1307, USA. */ #include "output.h" #include "insn-attr.h" -/* - * File: output-tahoe.c - * - * Original port made at the University of Buffalo by Devon Bowen, - * Dale Wiles and Kevin Zachmann. - * - * Changes for HCX by Piet van Oostrum, - * University of Utrecht, The Netherlands (piet@cs.ruu.nl) - * - * Speed tweaks by Michael Tiemann (tiemann@lurch.stanford.edu). - * - * Mail bugs reports or fixes to: gcc@cs.buffalo.edu - */ - - /* On tahoe, you have to go to memory to convert a register from sub-word to word. */ @@ -61,13 +50,15 @@ extensible_operand (op, mode) || (GET_CODE (op) == SUBREG && GET_CODE (SUBREG_REG (op)) == REG)) && tahoe_reg_conversion_loc == 0) - tahoe_reg_conversion_loc = assign_stack_local (SImode, GET_MODE_SIZE (SImode)); + tahoe_reg_conversion_loc + = assign_stack_local (SImode, GET_MODE_SIZE (SImode)); + return general_operand (op, mode); } -/* most of the print_operand_address function was taken from the vax */ -/* since the modes are basically the same. I had to add a special case, */ -/* though, for symbol references with offsets. */ +/* Most of the print_operand_address function was taken from the VAX since + the modes are basically the same. I had to add a special case, though, for + symbol references with offsets. */ print_operand_address (file, addr) FILE *file; @@ -98,8 +89,8 @@ print_operand_address (file, addr) break; case PLUS: - reg1 = 0; reg2 = 0; - ireg = 0; breg = 0; + reg1 = 0, reg2 = 0; + ireg = 0, breg = 0; offset = 0; if (CONSTANT_ADDRESS_P (XEXP (addr, 0)) @@ -112,38 +103,22 @@ print_operand_address (file, addr) if (CONSTANT_ADDRESS_P (XEXP (addr, 0)) || GET_CODE (XEXP (addr, 0)) == MEM) - { - offset = XEXP (addr, 0); - addr = XEXP (addr, 1); - } + offset = XEXP (addr, 0), addr = XEXP (addr, 1); else if (CONSTANT_ADDRESS_P (XEXP (addr, 1)) || GET_CODE (XEXP (addr, 1)) == MEM) - { - offset = XEXP (addr, 1); - addr = XEXP (addr, 0); - } + offset = XEXP (addr, 1), addr = XEXP (addr, 0); + if (GET_CODE (addr) != PLUS) ; else if (GET_CODE (XEXP (addr, 0)) == MULT) - { - reg1 = XEXP (addr, 0); - addr = XEXP (addr, 1); - } + reg1 = XEXP (addr, 0), addr = XEXP (addr, 1); else if (GET_CODE (XEXP (addr, 1)) == MULT) - { - reg1 = XEXP (addr, 1); - addr = XEXP (addr, 0); - } + reg1 = XEXP (addr, 1), addr = XEXP (addr, 0); else if (GET_CODE (XEXP (addr, 0)) == REG) - { - reg1 = XEXP (addr, 0); - addr = XEXP (addr, 1); - } + reg1 = XEXP (addr, 0), addr = XEXP (addr, 1); else if (GET_CODE (XEXP (addr, 1)) == REG) - { - reg1 = XEXP (addr, 1); - addr = XEXP (addr, 0); - } + reg1 = XEXP (addr, 1), addr = XEXP (addr, 0); + if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT) { if (reg1 == 0) @@ -152,39 +127,34 @@ print_operand_address (file, addr) reg2 = addr; addr = 0; } + if (offset != 0) { - if (addr != 0) abort (); + if (addr != 0) + abort (); + addr = offset; } + if (reg1 != 0 && GET_CODE (reg1) == MULT) - { - breg = reg2; - ireg = reg1; - } + breg = reg2, ireg = reg1; else if (reg2 != 0 && GET_CODE (reg2) == MULT) - { - breg = reg1; - ireg = reg2; - } + breg = reg1, ireg = reg2; else if (reg2 != 0 || GET_CODE (addr) == MEM) - { - breg = reg2; - ireg = reg1; - } + breg = reg2, ireg = reg1; else - { - breg = reg1; - ireg = reg2; - } + breg = reg1, ireg = reg2; + if (addr != 0) output_address (offset); + if (breg != 0) { if (GET_CODE (breg) != REG) abort (); fprintf (file, "(%s)", reg_name[REGNO (breg)]); } + if (ireg != 0) { if (GET_CODE (ireg) == MULT) @@ -200,8 +170,8 @@ print_operand_address (file, addr) } } -/* Do a quick check and find out what the best way to do the */ -/* mini-move is. Could be a push or a move..... */ +/* Do a quick check and find out what the best way to do the mini-move is. + Could be a push or a move..... */ static char * singlemove_string (operands) @@ -209,65 +179,69 @@ singlemove_string (operands) { if (operands[1] == const0_rtx) return "clrl %0"; + if (push_operand (operands[0], SImode)) return "pushl %1"; + return "movl %1,%0"; } -/* given the rtx for an address, return true if the given */ -/* register number is used in the address somewhere. */ +/* Given the rtx for an address, return true if the given register number is + used in the address somewhere. */ -regisused(addr,regnum) -rtx addr; -int regnum; +int +regisused (addr, regnum) + rtx addr; + int regnum; { - if (GET_CODE(addr) == REG) - if (REGNO(addr) == regnum) - return (1); - else - return (0); + if (GET_CODE (addr) == REG) + return REGNO (addr) == regnum; - if (GET_CODE(addr) == MEM) - return regisused(XEXP(addr,0),regnum); + else if (GET_CODE (addr) == MEM) + return regisused (XEXP (addr, 0), regnum); - if ((GET_CODE(addr) == MULT) || (GET_CODE(addr) == PLUS)) - return ((regisused(XEXP(addr,0),regnum)) || - (regisused(XEXP(addr,1),regnum))); + else if (GET_CODE (addr) == MULT || GET_CODE (addr) == PLUS) + return (regisused (XEXP (addr, 0), regnum) + || regisused (XEXP (addr, 1), regnum)); - return 0; + return 0; } -/* Given some rtx, traverse it and return the register used in a */ -/* index. If no index is found, return 0. */ +/* Given some rtx, traverse it and return the register used in a index. If no + index is found, return 0. */ rtx -index_reg(addr) -rtx addr; +index_reg (addr) + rtx addr; { - rtx temp; + rtx temp; - if (GET_CODE(addr) == MEM) - return index_reg(XEXP(addr,0)); + if (GET_CODE (addr) == MEM) + return index_reg (XEXP (addr, 0)); - if (GET_CODE(addr) == MULT) - if (GET_CODE(XEXP(addr,0)) == REG) - return XEXP(addr,0); - else - return XEXP(addr,1); + else if (GET_CODE (addr) == MULT) + { + if (GET_CODE (XEXP (addr, 0)) == REG) + return XEXP (addr, 0); + else + return XEXP (addr, 1); + } - if (GET_CODE(addr) == PLUS) - if (temp = index_reg(XEXP(addr,0))) - return temp; - else - return index_reg(XEXP(addr,1)); + else if (GET_CODE (addr) == PLUS) + { + if ((temp = index_reg (XEXP (addr, 0))) != 0) + return temp; + else + return index_reg (XEXP (addr, 1)); + } - return 0; + return 0; } -/* simulate the move double by generating two movl's. You have */ -/* to be careful about mixing modes here. */ +/* Simulate the move double by generating two movl's. We need to be careful + about mixing modes here. */ char * output_move_double (operands) @@ -285,21 +259,25 @@ output_move_double (operands) if (REG_P (operands[0])) optype0 = REGOP; - else if ((GET_CODE(operands[0])==MEM) && (shftreg0=index_reg(operands[0]))) + else if (GET_CODE (operands[0]) == MEM + && (shftreg0 = index_reg (operands[0])) != 0) optype0 = INDOP; else if (offsettable_memref_p (operands[0])) optype0 = OFFSOP; - else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) { - optype0 = PUSHOP; - dohighfirst++; - } else if (GET_CODE (operands[0]) == MEM) + else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) + { + optype0 = PUSHOP; + dohighfirst++; + } + else if (GET_CODE (operands[0]) == MEM) optype0 = MEMOP; else optype0 = RNDOP; if (REG_P (operands[1])) optype1 = REGOP; - else if ((GET_CODE(operands[1])==MEM) && (shftreg1=index_reg(operands[1]))) + else if (GET_CODE (operands[1]) == MEM + && (shftreg1 = index_reg (operands[1])) !+ 0) optype1 = INDOP; else if (offsettable_memref_p (operands[1])) optype1 = OFFSOP; @@ -312,214 +290,233 @@ output_move_double (operands) else optype1 = RNDOP; - /* set up for the high byte move for operand zero */ + /* Set up for the high byte move for operand zero */ - switch (optype0) { - - /* if it's a register, just use the next highest in the */ - /* high address move. */ - - case REGOP : latehalf[0] = gen_rtx (REG,SImode,REGNO(operands[0])+1); - break; - - /* for an offsettable address, use the gcc function to */ - /* modify the operand to get an offset of 4 higher for */ - /* the second move. */ - - case OFFSOP : latehalf[0] = adj_offsettable_operand (operands[0], 4); - break; - - /* if the operand is MEMOP type, it must be a pointer */ - /* to a pointer. So just remember to increase the mem */ - /* location and use the same operand. */ - - case MEMOP : latehalf[0] = operands[0]; - addreg0 = XEXP(operands[0],0); - break; + switch (optype0) + { + /* If it's a register, just use the next highest in the high address + move. */ + case REGOP: + latehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); + break; - /* if we're dealing with a push instruction, just leave */ - /* the operand alone since it auto-increments. */ + /* For an offsettable address, use the GCC function to modify the + operand to get an offset of 4 higher for the second move. */ + case OFFSOP: + latehalf[0] = adj_offsettable_operand (operands[0], 4); + break; - case PUSHOP : latehalf[0] = operands[0]; - break; + /* If the operand is MEMOP type, it must be a pointer to a pointer. + So just remember to increase the mem location and use the same + operand. */ + case MEMOP: + latehalf[0] = operands[0]; + addreg0 = XEXP(operands[0],0); + break; - /* YUCK! Indexed addressing!! If the address is considered */ - /* offsettable, go use the offset in the high part. Otherwise */ - /* find what exactly is being added to the multiplication. If */ - /* it's a mem reference, increment that with the high part */ - /* being unchanged to cause the shift. If it's a reg, do the */ - /* same. If you can't identify it, abort. Remember that the */ - /* shift register was already set during identification. */ + /* If we're dealing with a push instruction, just leave the operand + alone since it auto-increments. */ + case PUSHOP: + latehalf[0] = operands[0]; + break; - case INDOP : if (offsettable_memref_p(operands[0])) { - latehalf[0] = adj_offsettable_operand(operands[0],4); - break; - } + /* Indexed addressing. If the address is considered offsettable, use + the offset in the high part. Otherwise find what exactly is being + added to the multiplication. If it's a mem reference, increment that + with the high part being unchanged to cause the shift. If it's a + reg, do the same. If we can't identify it, abort. Remember that the + shift register was already set during identification. */ - latehalf[0] = operands[0]; + case INDOP: + if (offsettable_memref_p (operands[0])) + { + latehalf[0] = adj_offsettable_operand (operands[0], 4); + break; + } - temp0 = XEXP(XEXP(operands[0],0),0); - if (GET_CODE(temp0) == MULT) { - temp1 = temp0; - temp0 = XEXP(XEXP(operands[0],0),1); - } else { - temp1 = XEXP(XEXP(operands[0],0),1); - if (GET_CODE(temp1) != MULT) - abort(); - } + latehalf[0] = operands[0]; - if (GET_CODE(temp0) == MEM) - addreg0 = temp0; - else if (GET_CODE(temp0) == REG) - addreg0 = temp0; - else - abort(); + temp0 = XEXP (XEXP (operands[0], 0), 0); + if (GET_CODE(temp0) == MULT) + { + temp1 = temp0; + temp0 = XEXP (XEXP (operands[0], 0), 1); + } + else + { + temp1 = XEXP (XEXP (operands[0], 0), 1); + if (GET_CODE (temp1) != MULT) + abort(); + } - break; + if (GET_CODE (temp0) == MEM) + addreg0 = temp0; + else if (GET_CODE (temp0) == REG) + addreg0 = temp0; + else + abort(); - /* if we don't know the operand type, print a friendly */ - /* little error message... 8-) */ + break; - case RNDOP : - default : abort(); + case RNDOP: + default: + abort(); } - /* do the same setup for operand one */ + /* Do the same setup for operand one. */ - switch (optype1) { + switch (optype1) + { + case REGOP: + latehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); + break; - case REGOP : latehalf[1] = gen_rtx(REG,SImode,REGNO(operands[1])+1); - break; + case OFFSOP: + latehalf[1] = adj_offsettable_operand (operands[1], 4); + break; - case OFFSOP : latehalf[1] = adj_offsettable_operand (operands[1], 4); - break; + case MEMOP: + latehalf[1] = operands[1]; + addreg1 = XEXP (operands[1], 0); + break; - case MEMOP : latehalf[1] = operands[1]; - addreg1 = XEXP(operands[1],0); - break; + case POPOP: + latehalf[1] = operands[1]; + break; - case POPOP : latehalf[1] = operands[1]; - break; + case INDOP: + if (offsettable_memref_p (operands[1])) + { + latehalf[1] = adj_offsettable_operand (operands[1], 4); + break; + } - case INDOP : if (offsettable_memref_p(operands[1])) { - latehalf[1] = adj_offsettable_operand(operands[1],4); - break; - } + latehalf[1] = operands[1]; - latehalf[1] = operands[1]; + temp0 = XEXP (XEXP (operands[1], 0), 0); + if (GET_CODE (temp0) == MULT) + { + temp1 = temp0; + temp0 = XEXP (XEXP (operands[1], 0), 1); + } + else + { + temp1 = XEXP (XEXP (operands[1], 0), 1); + if (GET_CODE (temp1) != MULT) + abort(); + } - temp0 = XEXP(XEXP(operands[1],0),0); - if (GET_CODE(temp0) == MULT) { - temp1 = temp0; - temp0 = XEXP(XEXP(operands[1],0),1); - } else { - temp1 = XEXP(XEXP(operands[1],0),1); - if (GET_CODE(temp1) != MULT) - abort(); - } + if (GET_CODE (temp0) == MEM) + addreg1 = temp0; + else if (GET_CODE (temp0) == REG) + addreg1 = temp0; + else + abort(); + break; - if (GET_CODE(temp0) == MEM) - addreg1 = temp0; - else if (GET_CODE(temp0) == REG) - addreg1 = temp0; - else - abort(); + case CNSTOP: + if (GET_CODE (operands[1]) == CONST_DOUBLE) + split_double (operands[1], &operands[1], &latehalf[1]); + else if (CONSTANT_P (operands[1])) + latehalf[1] = const0_rtx; + else + abort (); + break; - break; + case RNDOP: + default: + abort (); + } - case CNSTOP : - if (GET_CODE (operands[1]) == CONST_DOUBLE) - split_double (operands[1], &operands[1], &latehalf[1]); - else if (CONSTANT_P (operands[1])) - latehalf[1] = const0_rtx; - else abort (); - break; - case RNDOP : - default : abort(); - } + /* Double the register used for shifting in both of the operands but make + sure the same register isn't doubled twice! */ + if (shftreg0 != 0 && shftreg1 != 0 && rtx_equal_p (shftreg0, shftreg1)) + output_asm_insn ("addl2 %0,%0", &shftreg0); + else + { + if (shftreg0 != 0) + output_asm_insn ("addl2 %0,%0", &shftreg0); + if (shftreg1!= 0) + output_asm_insn ("addl2 %0,%0", &shftreg1); + } - /* double the register used for shifting in both of the operands */ - /* but make sure the same register isn't doubled twice! */ + /* If the destination is a register and that register is needed in the + source addressing mode, swap the order of the moves since we don't want + this destroyed til last. If both regs are used, not much we can do, so + abort. If these becomes a problem, maybe we can do it on the stack? */ - if (shftreg0 && shftreg1 && (rtx_equal_p(shftreg0,shftreg1))) - output_asm_insn("addl2 %0,%0", &shftreg0); - else { - if (shftreg0) - output_asm_insn("addl2 %0,%0", &shftreg0); - if (shftreg1) - output_asm_insn("addl2 %0,%0", &shftreg1); - } + if (GET_CODE (operands[0]) == REG + && regisused (operands[1], REGNO (operands[0]))) + { + if (regisused (latehalf[1], REGNO(latehalf[0]))) + ; + else + dohighfirst++; + } + + /* If we're pushing, do the high address part first. */ - /* if the destination is a register and that register is needed in */ - /* the source addressing mode, swap the order of the moves since we */ - /* don't want this destroyed til last. If both regs are used, not */ - /* much we can do, so abort. If these becomes a problem, maybe we */ - /* can do it on the stack? */ - - if (GET_CODE(operands[0])==REG && regisused(operands[1],REGNO(operands[0]))) - if (regisused(latehalf[1],REGNO(latehalf[0]))) - 8; - else - dohighfirst++; - - /* if we're pushing, do the high address part first. */ - - if (dohighfirst) { - - if (addreg0 && addreg1 && (rtx_equal_p(addreg0,addreg1))) - output_asm_insn("addl2 $4,%0", &addreg0); - else { - if (addreg0) - output_asm_insn("addl2 $4,%0", &addreg0); - if (addreg1) - output_asm_insn("addl2 $4,%0", &addreg1); + if (dohighfirst) + { + if (addreg0 != 0 && addreg1 != 0 && rtx_equal_p (addreg0, addreg1)) + output_asm_insn ("addl2 $4,%0", &addreg0); + else + { + if (addreg0 != 0) + output_asm_insn ("addl2 $4,%0", &addreg0); + if (addreg1 != 0) + output_asm_insn ("addl2 $4,%0", &addreg1); } - output_asm_insn(singlemove_string(latehalf), latehalf); + output_asm_insn (singlemove_string (latehalf), latehalf); - if (addreg0 && addreg1 && (rtx_equal_p(addreg0,addreg1))) - output_asm_insn("subl2 $4,%0", &addreg0); - else { - if (addreg0) - output_asm_insn("subl2 $4,%0", &addreg0); - if (addreg1) - output_asm_insn("subl2 $4,%0", &addreg1); + if (addreg0 != 0 && addreg1 != 0 && rtx_equal_p (addreg0, addreg1)) + output_asm_insn ("subl2 $4,%0", &addreg0); + else + { + if (addreg0 != 0) + output_asm_insn ("subl2 $4,%0", &addreg0); + if (addreg1 != 0) + output_asm_insn ("subl2 $4,%0", &addreg1); } - return singlemove_string(operands); - } + return singlemove_string (operands); + } - output_asm_insn(singlemove_string(operands), operands); + output_asm_insn (singlemove_string(operands), operands); - if (addreg0 && addreg1 && (rtx_equal_p(addreg0,addreg1))) - output_asm_insn("addl2 $4,%0", &addreg0); - else { - if (addreg0) - output_asm_insn("addl2 $4,%0", &addreg0); - if (addreg1) - output_asm_insn("addl2 $4,%0", &addreg1); - } + if (addreg0 != 0 && addreg1 != 0 && rtx_equal_p (addreg0, addreg1)) + output_asm_insn ("addl2 $4,%0", &addreg0); + else + { + if (addreg0 != 0) + output_asm_insn ("addl2 $4,%0", &addreg0); + if (addreg1 != 0) + output_asm_insn ("addl2 $4,%0", &addreg1); + } - output_asm_insn(singlemove_string(latehalf), latehalf); + output_asm_insn (singlemove_string (latehalf), latehalf); - if (addreg0 && addreg1 && (rtx_equal_p(addreg0,addreg1))) - output_asm_insn("subl2 $4,%0", &addreg0); - else { - if (addreg0) - output_asm_insn("subl2 $4,%0", &addreg0); - if (addreg1) - output_asm_insn("subl2 $4,%0", &addreg1); - } + if (addreg0 != 0 && addreg1 != 0 && rtx_equal_p(addreg0, addreg1)) + output_asm_insn ("subl2 $4,%0", &addreg0); + else + { + if (addreg0 != 0) + output_asm_insn ("subl2 $4,%0", &addreg0); + if (addreg1 != 0) + output_asm_insn ("subl2 $4,%0", &addreg1); + } - if (shftreg0 && shftreg1 && (rtx_equal_p(shftreg0,shftreg1))) - output_asm_insn("shar $1,%0,%0", &shftreg0); - else { - if (shftreg0) - output_asm_insn("shar $1,%0,%0", &shftreg0); - if (shftreg1) - output_asm_insn("shar $1,%0,%0", &shftreg1); + if (shftreg0 != 0 && shftreg1 != 0 && rtx_equal_p (shftreg0, shftreg1)) + output_asm_insn ("shar $1,%0,%0", &shftreg0); + else + { + if (shftreg0 != 0) + output_asm_insn ("shar $1,%0,%0", &shftreg0); + if (shftreg1 != 0) + output_asm_insn ("shar $1,%0,%0", &shftreg1); } return ""; @@ -533,33 +530,32 @@ output_move_double (operands) int tahoe_cmp_check (insn, op, max) -rtx insn, op; int max; + rtx insn, op; + int max; { + register rtx next = NEXT_INSN (insn); + if (GET_CODE (op) == CONST_INT - && ( INTVAL (op) < 0 || INTVAL (op) > max )) - return 0; + && (INTVAL (op) < 0 || INTVAL (op) > max)) + return 0; + + if (GET_RTX_CLASS (GET_CODE (next)) == 'i') { - register rtx next = NEXT_INSN (insn); - - if ((GET_CODE (next) == JUMP_INSN - || GET_CODE (next) == INSN - || GET_CODE (next) == CALL_INSN)) - { - next = PATTERN (next); - if (GET_CODE (next) == SET - && SET_DEST (next) == pc_rtx - && GET_CODE (SET_SRC (next)) == IF_THEN_ELSE) - switch (GET_CODE (XEXP (SET_SRC (next), 0))) - { - case EQ: - case NE: - case LTU: - case GTU: - case LEU: - case GEU: - return 1; - } - } + next = PATTERN (next); + if (GET_CODE (next) == SET + && SET_DEST (next) == pc_rtx + && GET_CODE (SET_SRC (next)) == IF_THEN_ELSE) + switch (GET_CODE (XEXP (SET_SRC (next), 0))) + { + case EQ: + case NE: + case LTU: + case GTU: + case LEU: + case GEU: + return 1; + } } - return 0; + + return 0; } diff --git a/gcc/config/tahoe/tahoe.h b/gcc/config/tahoe/tahoe.h index 83063318959..b18e8ab59f0 100644 --- a/gcc/config/tahoe/tahoe.h +++ b/gcc/config/tahoe/tahoe.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Tahoe version. - Copyright (C) 1989, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1989, 93, 94, 95, 96, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -331,11 +331,11 @@ enum reg_class {NO_REGS,GENERAL_REGS,FPP_REG,ALL_REGS,LIM_REG_CLASSES}; /* function values for all types are returned in register 0 */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), 0) + gen_rtx_REG (TYPE_MODE (VALTYPE), 0) /* library routines also return things in reg 0 */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0) /* Tahoe doesn't return structures in a reentrant way */ diff --git a/gcc/config/tahoe/tahoe.md b/gcc/config/tahoe/tahoe.md index 021c1b01032..8ed06497dea 100644 --- a/gcc/config/tahoe/tahoe.md +++ b/gcc/config/tahoe/tahoe.md @@ -1,5 +1,5 @@ ;; Machine description for GNU compiler, Tahoe version -;; Copyright (C) 1989, 1994, 1996, 1997 Free Software Foundation, Inc. +;; Copyright (C) 1989, 1994, 96-98, 1999 Free Software Foundation, Inc. ;; This file is part of GNU CC. @@ -1591,7 +1591,7 @@ "" "* { - operands[1] = GEN_INT ((INTVAL (operands[1]) + 4)); + operands[1] = GEN_INT (INTVAL (operands[1]) + 4); if (GET_CODE(operands[0]) == MEM && CONSTANT_ADDRESS_P (XEXP(operands[0], 0)) && INTVAL (operands[1]) < 64) @@ -1609,7 +1609,7 @@ "" "* { - operands[2] = GEN_INT ((INTVAL (operands[2]) + 4)); + operands[2] = GEN_INT (INTVAL (operands[2]) + 4)); if (GET_CODE(operands[1]) == MEM && CONSTANT_ADDRESS_P (XEXP(operands[1], 0)) && INTVAL (operands[2]) < 64) @@ -2056,8 +2056,7 @@ ; && exact_log2 (INTVAL (operands[1])) >= 0" ; "* ;{ -; operands[1] -; = GEN_INT (exact_log2 (INTVAL (operands[1]))); +; operands[1] = GEN_INT (exact_log2 (INTVAL (operands[1]))); ; return \"bbs %1,%0,%l2\"; ;}") ; @@ -2073,8 +2072,7 @@ ; && exact_log2 (INTVAL (operands[1])) >= 0" ; "* ;{ -; operands[1] -; = GEN_INT (exact_log2 (INTVAL (operands[1]))); +; operands[1] = GEN_INT (exact_log2 (INTVAL (operands[1]))); ; return \"bbc %1,%0,%l2\"; ;}") ; @@ -2090,8 +2088,7 @@ ; && exact_log2 (INTVAL (operands[1])) >= 0" ; "* ;{ -; operands[1] -; = GEN_INT (exact_log2 (INTVAL (operands[1]))); +; operands[1] = GEN_INT (exact_log2 (INTVAL (operands[1]))); ; return \"bbc %1,%0,%l2\"; ;}") ; diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index 2b9b5981315..a085b518d63 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -20,8 +20,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> -#include <ctype.h> +#include "system.h" #include "tree.h" #include "rtl.h" #include "regs.h" @@ -200,16 +199,16 @@ function_arg (cum, mode, type, named) switch (cum->nbytes / UNITS_PER_WORD) { case 0: - result = gen_rtx (REG, mode, 6); + result = gen_rtx_REG (mode, 6); break; case 1: - result = gen_rtx (REG, mode, 7); + result = gen_rtx_REG (mode, 7); break; case 2: - result = gen_rtx (REG, mode, 8); + result = gen_rtx_REG (mode, 8); break; case 3: - result = gen_rtx (REG, mode, 9); + result = gen_rtx_REG (mode, 9); break; default: result = 0; @@ -563,9 +562,8 @@ print_operand (file, x, code) { case MEM: if (GET_CODE (XEXP (x, 0)) == CONST_INT) - output_address (gen_rtx (PLUS, SImode, - gen_rtx (REG, SImode, 0), - XEXP (x, 0))); + output_address (gen_rtx_PLUS (SImode, gen_rtx (REG, SImode, 0), + XEXP (x, 0))); else output_address (XEXP (x, 0)); break; @@ -792,7 +790,7 @@ output_move_single (operands) return "%S0st%W0 %.,%0"; } - fatal_insn ("output_move_single:", gen_rtx (SET, VOIDmode, dst, src)); + fatal_insn ("output_move_single:", gen_rtx_SET (VOIDmode, dst, src)); return ""; } @@ -839,7 +837,7 @@ output_move_double (operands) for (i = 0; i < 2; i++) { - xop[0] = gen_rtx (REG, SImode, REGNO (dst)+i); + xop[0] = gen_rtx_REG (SImode, REGNO (dst)+i); xop[1] = GEN_INT (high_low[i]); output_asm_insn (output_move_single (xop), xop); } @@ -1093,14 +1091,14 @@ substitute_ep_register (first_insn, last_insn, uses, regno, p_r1, p_ep) rtx *p_r1; rtx *p_ep; { - rtx reg = gen_rtx (REG, Pmode, regno); + rtx reg = gen_rtx_REG (Pmode, regno); rtx insn; if (!*p_r1) { regs_ever_live[1] = 1; - *p_r1 = gen_rtx (REG, Pmode, 1); - *p_ep = gen_rtx (REG, Pmode, 30); + *p_r1 = gen_rtx_REG (Pmode, 1); + *p_ep = gen_rtx_REG (Pmode, 30); } if (TARGET_DEBUG) @@ -1156,8 +1154,9 @@ Saved %d bytes (%d uses of register %s) in function %s, starting as insn %d, end unsignedp)) && ((INTVAL (XEXP (addr, 1))) >= 0)) *p_mem = change_address (*p_mem, VOIDmode, - gen_rtx (PLUS, Pmode, - *p_ep, XEXP (addr, 1))); + gen_rtx_PLUS (Pmode, + *p_ep, + XEXP (addr, 1))); } } } @@ -1171,10 +1170,10 @@ Saved %d bytes (%d uses of register %s) in function %s, starting as insn %d, end && SET_SRC (PATTERN (insn)) == *p_r1) delete_insn (insn); else - emit_insn_before (gen_rtx (SET, Pmode, *p_r1, *p_ep), first_insn); + emit_insn_before (gen_rtx_SET (Pmode, *p_r1, *p_ep), first_insn); - emit_insn_before (gen_rtx (SET, Pmode, *p_ep, reg), first_insn); - emit_insn_before (gen_rtx (SET, Pmode, *p_ep, *p_r1), last_insn); + emit_insn_before (gen_rtx_SET (Pmode, *p_ep, reg), first_insn); + emit_insn_before (gen_rtx_SET (Pmode, *p_ep, *p_r1), last_insn); } @@ -1558,10 +1557,10 @@ expand_prologue () offset = 0; for (i = 6; i < 10; i++) { - emit_move_insn (gen_rtx (MEM, SImode, - plus_constant (stack_pointer_rtx, - offset)), - gen_rtx (REG, SImode, i)); + emit_move_insn (gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, + offset)), + gen_rtx_REG (SImode, i)); offset += 4; } } @@ -1573,14 +1572,14 @@ expand_prologue () for (i = 1; i < 31; i++) { if (((1L << i) & reg_saved) != 0) - save_regs[num_save++] = gen_rtx (REG, Pmode, i); + save_regs[num_save++] = gen_rtx_REG (Pmode, i); } /* If the return pointer is saved, the helper functions also allocate 16 bytes of stack for arguments to be saved in. */ if (((1L << LINK_POINTER_REGNUM) & reg_saved) != 0) { - save_regs[num_save++] = gen_rtx (REG, Pmode, LINK_POINTER_REGNUM); + save_regs[num_save++] = gen_rtx_REG (Pmode, LINK_POINTER_REGNUM); default_stack = 16; } @@ -1610,28 +1609,30 @@ expand_prologue () stack space is allocated. */ if (save_func_len < save_normal_len) { - save_all = gen_rtx (PARALLEL, VOIDmode, - rtvec_alloc (num_save + (TARGET_V850 ? 2 : 1))); - XVECEXP (save_all, 0, 0) = gen_rtx (SET, VOIDmode, - stack_pointer_rtx, - gen_rtx (PLUS, Pmode, - stack_pointer_rtx, - GEN_INT (-alloc_stack))); + save_all = gen_rtx_PARALLEL + (VOIDmode, + rtvec_alloc (num_save + (TARGET_V850 ? 2 : 1))); + + XVECEXP (save_all, 0, 0) + = gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, -alloc_stack)); if (TARGET_V850) { - XVECEXP (save_all, 0, num_save + 1) - = gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, Pmode, 10)); + XVECEXP (save_all, 0, num_save+1) + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 10)); } offset = - default_stack; for (i = 0; i < num_save; i++) { - XVECEXP (save_all, 0, i + 1) - = gen_rtx (SET, VOIDmode, - gen_rtx (MEM, Pmode, - plus_constant (stack_pointer_rtx, offset)), - save_regs[i]); + XVECEXP (save_all, 0, i+1) + = gen_rtx_SET (VOIDmode, + gen_rtx_MEM (Pmode, + plus_constant (stack_pointer_rtx, + offset)), + save_regs[i]); offset -= 4; } @@ -1684,18 +1685,18 @@ Saved %d bytes via prologue function (%d vs. %d) for function %s\n", /* Save the return pointer first. */ if (num_save > 0 && REGNO (save_regs[num_save-1]) == LINK_POINTER_REGNUM) { - emit_move_insn (gen_rtx (MEM, SImode, - plus_constant (stack_pointer_rtx, - offset)), + emit_move_insn (gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, + offset)), save_regs[--num_save]); offset -= 4; } for (i = 0; i < num_save; i++) { - emit_move_insn (gen_rtx (MEM, SImode, - plus_constant (stack_pointer_rtx, - offset)), + emit_move_insn (gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, + offset)), save_regs[i]); offset -= 4; } @@ -1714,7 +1715,7 @@ Saved %d bytes via prologue function (%d vs. %d) for function %s\n", GEN_INT (-diff))); else { - rtx reg = gen_rtx (REG, Pmode, 12); + rtx reg = gen_rtx_REG (Pmode, 12); emit_move_insn (reg, GEN_INT (-diff)); emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, reg)); } @@ -1760,14 +1761,14 @@ expand_epilogue () for (i = 1; i < 31; i++) { if (((1L << i) & reg_saved) != 0) - restore_regs[num_restore++] = gen_rtx (REG, Pmode, i); + restore_regs[num_restore++] = gen_rtx_REG (Pmode, i); } /* If the return pointer is saved, the helper functions also allocate 16 bytes of stack for arguments to be saved in. */ if (((1L << LINK_POINTER_REGNUM) & reg_saved) != 0) { - restore_regs[num_restore++] = gen_rtx (REG, Pmode, LINK_POINTER_REGNUM); + restore_regs[num_restore++] = gen_rtx_REG (Pmode, LINK_POINTER_REGNUM); default_stack = 16; } @@ -1797,24 +1798,24 @@ expand_epilogue () /* Don't bother checking if we don't actually save any space. */ if (restore_func_len < restore_normal_len) { - restore_all = gen_rtx (PARALLEL, VOIDmode, - rtvec_alloc (num_restore + 2)); - XVECEXP (restore_all, 0, 0) = gen_rtx (RETURN, VOIDmode); + restore_all = gen_rtx_PARALLEL (VOIDmode, + rtvec_alloc (num_restore + 2)); + XVECEXP (restore_all, 0, 0) = gen_rtx_RETURN (VOIDmode); XVECEXP (restore_all, 0, 1) - = gen_rtx (SET, VOIDmode, stack_pointer_rtx, - gen_rtx (PLUS, Pmode, - stack_pointer_rtx, - GEN_INT (alloc_stack))); + = gen_rtx_SET (VOIDmode, stack_pointer_rtx, + gen_rtx_PLUS (Pmode, + stack_pointer_rtx, + GEN_INT (alloc_stack))); offset = alloc_stack - 4; for (i = 0; i < num_restore; i++) { XVECEXP (restore_all, 0, i+2) - = gen_rtx (SET, VOIDmode, - restore_regs[i], - gen_rtx (MEM, Pmode, - plus_constant - (stack_pointer_rtx, offset))); + = gen_rtx_SET (VOIDmode, + restore_regs[i], + gen_rtx_MEM (Pmode, + plus_constant (stack_pointer_rtx, + offset))); offset -= 4; } @@ -1832,7 +1833,7 @@ expand_epilogue () GEN_INT (actual_fsize))); else { - rtx reg = gen_rtx (REG, Pmode, 12); + rtx reg = gen_rtx_REG (Pmode, 12); emit_move_insn (reg, GEN_INT (actual_fsize)); emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, @@ -1880,7 +1881,7 @@ Saved %d bytes via epilogue function (%d vs. %d) in function %s\n", GEN_INT (diff))); else { - rtx reg = gen_rtx (REG, Pmode, 12); + rtx reg = gen_rtx_REG (Pmode, 12); emit_move_insn (reg, GEN_INT (diff)); emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, @@ -1904,18 +1905,18 @@ Saved %d bytes via epilogue function (%d vs. %d) in function %s\n", && REGNO (restore_regs [num_restore - 1]) == LINK_POINTER_REGNUM) { emit_move_insn (restore_regs[--num_restore], - gen_rtx (MEM, SImode, - plus_constant (stack_pointer_rtx, - offset))); + gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, + offset))); offset -= 4; } for (i = 0; i < num_restore; i++) { emit_move_insn (restore_regs[i], - gen_rtx (MEM, SImode, - plus_constant (stack_pointer_rtx, - offset))); + gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, + offset))); offset -= 4; } diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index b045f830d39..22289c39367 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -755,13 +755,13 @@ extern int current_function_anonymous_args; otherwise, FUNC is 0. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), 10) + gen_rtx_REG (TYPE_MODE (VALTYPE), 10) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ #define LIBCALL_VALUE(MODE) \ - gen_rtx (REG, MODE, 10) + gen_rtx_REG (MODE, 10) /* 1 if N is a possible register number for a function value. */ @@ -811,9 +811,9 @@ extern int current_function_anonymous_args; #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 16)), \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 16)), \ (CXT)); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 20)), \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 20)), \ (FNADDR)); \ } diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md index 5f19c84ceaa..5214d1663c5 100644 --- a/gcc/config/v850/v850.md +++ b/gcc/config/v850/v850.md @@ -1,7 +1,6 @@ ;; GCC machine description for NEC V850 -;; Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. - -;; Contributed by Jeff Law (law@cygnus.com). +;; Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +;; Contributed by Jeff Law (law@cygnus.com). ;; This file is part of GNU CC. @@ -168,10 +167,10 @@ else temp = gen_reg_rtx (SImode); - emit_insn (gen_rtx (SET, SImode, temp, - gen_rtx (HIGH, SImode, operand1))); - emit_insn (gen_rtx (SET, SImode, operand0, - gen_rtx (LO_SUM, SImode, temp, operand1))); + emit_insn (gen_rtx_SET (SImode, temp, + gen_rtx_HIGH (SImode, operand1))); + emit_insn (gen_rtx_SET (SImode, operand0, + gen_rtx_LO_SUM (SImode, temp, operand1))); DONE; } }") @@ -412,8 +411,8 @@ int log2 = exact_log2 (~INTVAL (operands[1]) & 0xffff); rtx xoperands[2]; - xoperands[0] = gen_rtx (MEM, QImode, - plus_constant (XEXP (operands[0], 0), log2 / 8)); + xoperands[0] = gen_rtx_MEM (QImode, + plus_constant (XEXP (operands[0], 0), log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"clr1 %1,%0\", xoperands); return \"\"; @@ -431,8 +430,8 @@ int log2 = exact_log2 (~INTVAL (operands[1]) & 0xffffffff); rtx xoperands[2]; - xoperands[0] = gen_rtx (MEM, QImode, - plus_constant (XEXP (operands[0], 0), log2 / 8)); + xoperands[0] = gen_rtx_MEM (QImode, + plus_constant (XEXP (operands[0], 0), log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"clr1 %1,%0\", xoperands); return \"\"; @@ -479,8 +478,9 @@ else { rtx xoperands[2]; - xoperands[0] = gen_rtx (MEM, QImode, - plus_constant (XEXP (operands[0], 0), log2 / 8)); + xoperands[0] = gen_rtx_MEM (QImode, + plus_constant (XEXP (operands[0], 0), + log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"set1 %1,%0\", xoperands); } @@ -503,8 +503,9 @@ else { rtx xoperands[2]; - xoperands[0] = gen_rtx (MEM, QImode, - plus_constant (XEXP (operands[0], 0), log2 / 8)); + xoperands[0] = gen_rtx_MEM (QImode, + plus_constant (XEXP (operands[0], 0), + log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"set1 %1,%0\", xoperands); } @@ -552,8 +553,9 @@ else { rtx xoperands[2]; - xoperands[0] = gen_rtx (MEM, QImode, - plus_constant (XEXP (operands[0], 0), log2 / 8)); + xoperands[0] = gen_rtx_MEM (QImode, + plus_constant (XEXP (operands[0], 0), + log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"not1 %1,%0\", xoperands); } @@ -576,8 +578,9 @@ else { rtx xoperands[2]; - xoperands[0] = gen_rtx (MEM, QImode, - plus_constant (XEXP (operands[0], 0), log2 / 8)); + xoperands[0] = gen_rtx_MEM (QImode, + plus_constant (XEXP (operands[0], 0), + log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"not1 %1,%0\", xoperands); } @@ -942,11 +945,11 @@ emit_insn (gen_ashlsi3 (reg, reg, GEN_INT (TARGET_BIG_SWITCH ? 2 : 1))); /* Load the table address into a pseudo. */ emit_insn (gen_movsi (tableaddress, - gen_rtx (LABEL_REF, VOIDmode, operands[3]))); + gen_rtx_LABEL_REF (VOIDmode, operands[3]))); /* Add the table address to the index. */ emit_insn (gen_addsi3 (reg, reg, tableaddress)); /* Load the table entry. */ - mem = gen_rtx (MEM, CASE_VECTOR_MODE, reg); + mem = gen_rtx_MEM (CASE_VECTOR_MODE, reg); RTX_UNCHANGING_P (mem); if (! TARGET_BIG_SWITCH) { diff --git a/gcc/config/v850/xm-v850.h b/gcc/config/v850/xm-v850.h index 1e43d033f6f..7e2da6749a3 100644 --- a/gcc/config/v850/xm-v850.h +++ b/gcc/config/v850/xm-v850.h @@ -1,5 +1,5 @@ /* Configuration for NEC V850. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GNU CC. @@ -34,15 +34,6 @@ Boston, MA 02111-1307, USA. */ #define SUCCESS_EXIT_CODE 0 #define FATAL_EXIT_CODE 33 -#ifdef __v850 -#ifndef __STDC__ -extern char *malloc (), *realloc (), *calloc (); -#else -extern void *malloc (), *realloc (), *calloc (); -#endif -extern void free (); -#endif - /* target machine dependencies. tm.h is a symbolic link to the actual target specific file. */ diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 4a9f06d80e7..9eab182b80e 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Vax. - Copyright (C) 1987, 1994, 1995, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1987, 94, 95, 97, 98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -19,7 +19,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -53,11 +53,11 @@ split_quadword_operands (operands, low, n) && (GET_CODE (XEXP (operands[i], 0)) == POST_INC)) { rtx addr = XEXP (operands[i], 0); - operands[i] = low[i] = gen_rtx (MEM, SImode, addr); + operands[i] = low[i] = gen_rtx_MEM (SImode, addr); if (which_alternative == 0 && i == 0) { addr = XEXP (operands[i], 0); - operands[i+1] = low[i+1] = gen_rtx (MEM, SImode, addr); + operands[i+1] = low[i+1] = gen_rtx_MEM (SImode, addr); } } else diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h index ad8fb7cc476..35f3fbdc0e7 100644 --- a/gcc/config/vax/vax.h +++ b/gcc/config/vax/vax.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Vax version. - Copyright (C) 1987, 88, 91, 93-96, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 91, 93-98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -347,8 +347,7 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; /* Given an rtx for the address of a frame, return an rtx for the address of the word in the frame that holds the dynamic chain--the previous frame's address. */ -#define DYNAMIC_CHAIN_ADDRESS(frame) \ -gen_rtx (PLUS, Pmode, frame, GEN_INT (12)) +#define DYNAMIC_CHAIN_ADDRESS(FRAME) plus_constant ((FRAME), 12) /* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. @@ -377,14 +376,14 @@ gen_rtx (PLUS, Pmode, frame, GEN_INT (12)) /* On the Vax the return value is in R0 regardless. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), 0) + gen_rtx_REG (TYPE_MODE (VALTYPE), 0) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ /* On the Vax the return value is in R0 regardless. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0) /* Define this if PCC uses the nonreentrant convention for returning structure and union values. */ @@ -530,14 +529,14 @@ gen_rtx (PLUS, Pmode, frame, GEN_INT (12)) movl $STATIC,r0 (store the functions static chain) jmp *$FUNCTION (jump to function code at address FUNCTION) */ -#define TRAMPOLINE_TEMPLATE(FILE) \ -{ \ - ASM_OUTPUT_SHORT (FILE, const0_rtx); \ - ASM_OUTPUT_SHORT (FILE, GEN_INT (0x8fd0)); \ - ASM_OUTPUT_INT (FILE, const0_rtx); \ - ASM_OUTPUT_BYTE (FILE, 0x50+STATIC_CHAIN_REGNUM); \ - ASM_OUTPUT_SHORT (FILE, GEN_INT (0x9f17)); \ - ASM_OUTPUT_INT (FILE, const0_rtx); \ +#define TRAMPOLINE_TEMPLATE(FILE) \ +{ \ + ASM_OUTPUT_SHORT (FILE, const0_rtx); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x8fd0)); \ + ASM_OUTPUT_INT (FILE, const0_rtx); \ + ASM_OUTPUT_BYTE (FILE, 0x50 + STATIC_CHAIN_REGNUM); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x9f17)); \ + ASM_OUTPUT_INT (FILE, const0_rtx); \ } /* Length in units of the trampoline for entering a nested function. */ @@ -552,12 +551,12 @@ gen_rtx (PLUS, Pmode, frame, GEN_INT (12)) to the start of the trampoline. */ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_insn (gen_rtx (ASM_INPUT, VOIDmode, \ - "movpsl -(sp)\n\tpushal 1(pc)\n\trei")); \ - emit_move_insn (gen_rtx (MEM, HImode, TRAMP), \ - gen_rtx (MEM, HImode, FNADDR)); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 4)), CXT);\ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 11)), \ + emit_insn (gen_rtx_ASM_INPUT (VOIDmode, \ + "movpsl -(sp)\n\tpushal 1(pc)\n\trei")); \ + emit_move_insn (gen_rtx_MEM (HImode, TRAMP), \ + gen_rtx_MEM (HImode, FNADDR)); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), CXT);\ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 11)), \ plus_constant (FNADDR, 2)); \ } @@ -573,7 +572,7 @@ gen_rtx (PLUS, Pmode, frame, GEN_INT (12)) #define RETURN_ADDR_RTX(COUNT, FRAME) \ ((COUNT == 0) \ - ? gen_rtx (MEM, Pmode, plus_constant (FRAME, RETURN_ADDRESS_OFFSET)) \ + ? gen_rtx_MEM (Pmode, plus_constant (FRAME, RETURN_ADDRESS_OFFSET)) \ : (rtx) 0) diff --git a/gcc/config/vax/vax.md b/gcc/config/vax/vax.md index 4ca4668929d..ead66070ae5 100644 --- a/gcc/config/vax/vax.md +++ b/gcc/config/vax/vax.md @@ -1,5 +1,5 @@ -;;- Machine description for GNU compiler, Vax Version -;; Copyright (C) 1987, 88, 91, 94-96, 1998 Free Software Foundation, Inc. +;; Machine description for GNU compiler, Vax Version +;; Copyright (C) 1987, 88, 91, 94-96, 1998, 1999 Free Software Foundation, Inc. ;; This file is part of GNU CC. @@ -1189,7 +1189,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); + operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); }") (define_insn "" @@ -1237,7 +1237,7 @@ "" " { - operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); + operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); }") (define_insn "ashldi3" @@ -1283,7 +1283,7 @@ " { if (GET_CODE (operands[2]) != CONST_INT) - operands[2] = gen_rtx (NEG, QImode, negate_rtx (QImode, operands[2])); + operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2])); }") (define_insn "rotlsi3" @@ -2131,6 +2131,7 @@ "" "* { - operands[3] = GEN_INT (INTVAL (operands[3]) & ~((1 << INTVAL (operands[2])) - 1)); + operands[3] + = GEN_INT (INTVAL (operands[3]) & ~((1 << INTVAL (operands[2])) - 1)); return \"rotl %2,%1,%0\;bicl2 %N3,%0\"; }") diff --git a/gcc/config/we32k/we32k.c b/gcc/config/we32k/we32k.c index e1b58f9f477..ef03232cb5d 100644 --- a/gcc/config/we32k/we32k.c +++ b/gcc/config/we32k/we32k.c @@ -1,6 +1,6 @@ /* Subroutines for insn-output.c for AT&T we32000 Family. + Copyright (C) 1991, 1992, 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by John Wehle (john@feith1.uucp) - Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. This file is part of GNU CC. @@ -21,12 +21,11 @@ Boston, MA 02111-1307, USA. */ #include "config.h" -#include <stdio.h> +#include "system.h" #include "rtl.h" #include "function.h" #include "real.h" - void output_move_double (operands) rtx *operands; @@ -37,7 +36,7 @@ output_move_double (operands) if (GET_CODE (operands[0]) == REG) { - lsw_operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + lsw_operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); msw_dreg = operands[0]; } else if (GET_CODE (operands[0]) == MEM && offsettable_memref_p (operands[0])) @@ -47,7 +46,7 @@ output_move_double (operands) if (GET_CODE (operands[1]) == REG) { - lsw_operands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + lsw_operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); lsw_sreg = lsw_operands[1]; } else if (GET_CODE (operands[1]) == MEM && offsettable_memref_p (operands[1])) @@ -116,12 +115,12 @@ output_push_double (operands) rtx lsw_operands[1]; if (GET_CODE (operands[0]) == REG) - lsw_operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); + lsw_operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else if (GET_CODE (operands[0]) == MEM && offsettable_memref_p (operands[0])) lsw_operands[0] = adj_offsettable_operand (operands[0], 4); else if (GET_CODE (operands[0]) == CONST_DOUBLE) { - lsw_operands[0] = GEN_INT (CONST_DOUBLE_HIGH (operands[0])); + lsw_operands[0] = GEN_INT CONST_DOUBLE_HIGH (operands[0])); operands[0] = GEN_INT (CONST_DOUBLE_LOW (operands[0])); } else if (GET_CODE (operands[0]) == CONST_INT) diff --git a/gcc/config/we32k/we32k.h b/gcc/config/we32k/we32k.h index af7c7ff774d..7a66c734083 100644 --- a/gcc/config/we32k/we32k.h +++ b/gcc/config/we32k/we32k.h @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler. AT&T we32000 version. - Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + Copyright (C) 1991, 92, 93, 94, 95, 96, 98, 1999 + Free Software Foundation, Inc. Contributed by John Wehle (john@feith1.uucp) This file is part of GNU CC. @@ -319,14 +320,14 @@ enum reg_class { NO_REGS, GENERAL_REGS, /* On the we32000 the return value is in r0 regardless. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - gen_rtx (REG, TYPE_MODE (VALTYPE), 0) + gen_rtx_REG (TYPE_MODE (VALTYPE), 0) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ /* On the we32000 the return value is in r0 regardless. */ -#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0) +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0) /* 1 if N is a possible register number for a function value. On the we32000, r0 is the only register thus used. */ @@ -478,15 +479,15 @@ enum reg_class { NO_REGS, GENERAL_REGS, mov #STATIC,%r8 jmp #FUNCTION */ -#define TRAMPOLINE_TEMPLATE(FILE) \ -{ \ - ASM_OUTPUT_SHORT (FILE, GEN_INT (0x844f)); \ - ASM_OUTPUT_SHORT (FILE, const0_rtx); \ - ASM_OUTPUT_SHORT (FILE, const0_rtx); \ - ASM_OUTPUT_CHAR (FILE, GEN_INT (0x48)); \ - ASM_OUTPUT_SHORT (FILE, GEN_INT (0x247f)); \ - ASM_OUTPUT_SHORT (FILE, const0_rtx); \ - ASM_OUTPUT_SHORT (FILE, const0_rtx); \ +#define TRAMPOLINE_TEMPLATE(FILE) \ +{ \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x844f)); \ + ASM_OUTPUT_SHORT (FILE, const0_rtx); \ + ASM_OUTPUT_SHORT (FILE, const0_rtx); \ + ASM_OUTPUT_CHAR (FILE, GEN_INT (0x48)); \ + ASM_OUTPUT_SHORT (FILE, GEN_INT (0x247f)); \ + ASM_OUTPUT_SHORT (FILE, const0_rtx); \ + ASM_OUTPUT_SHORT (FILE, const0_rtx); \ } /* Length in units of the trampoline for entering a nested function. */ @@ -499,8 +500,8 @@ enum reg_class { NO_REGS, GENERAL_REGS, #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 2)), CXT); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 9)), FNADDR); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 2)), CXT); \ + emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 9)), FNADDR); \ } /* Generate calls to memcpy() and memset() rather diff --git a/gcc/config/we32k/we32k.md b/gcc/config/we32k/we32k.md index 9d85a1026db..afabb9200cd 100644 --- a/gcc/config/we32k/we32k.md +++ b/gcc/config/we32k/we32k.md @@ -1,5 +1,5 @@ ;; Machine description for GNU compiler, AT&T we32000 Version -;; Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. +;; Copyright (C) 1991, 1992, 1994, 1998, 1999 Free Software Foundation, Inc. ;; Contributed by John Wehle (john@feith1.uucp) ;; This file is part of GNU CC. @@ -125,7 +125,7 @@ rtx lsw_operands[3]; if (GET_CODE (operands[0]) == REG) - lsw_operands[0] = gen_rtx(REG, SImode, REGNO (operands[0]) + 1); + lsw_operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else if (GET_CODE (operands[0]) == MEM && offsettable_memref_p (operands[0])) lsw_operands[0] = adj_offsettable_operand(operands[0], 4); @@ -133,7 +133,7 @@ abort(); if (GET_CODE (operands[2]) == REG) - lsw_operands[2] = gen_rtx(REG, SImode, REGNO (operands[2]) + 1); + lsw_operands[2] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); else if (GET_CODE (operands[2]) == MEM && offsettable_memref_p (operands[2])) lsw_operands[2] = adj_offsettable_operand(operands[2], 4); @@ -175,7 +175,7 @@ rtx lsw_operands[3]; if (GET_CODE (operands[0]) == REG) - lsw_operands[0] = gen_rtx(REG, SImode, REGNO (operands[0]) + 1); + lsw_operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else if (GET_CODE (operands[0]) == MEM && offsettable_memref_p (operands[0])) lsw_operands[0] = adj_offsettable_operand(operands[0], 4); @@ -183,7 +183,7 @@ abort(); if (GET_CODE (operands[1]) == REG) - lsw_operands[1] = gen_rtx(REG, SImode, REGNO (operands[1]) + 1); + lsw_operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); else if (GET_CODE (operands[1]) == MEM && offsettable_memref_p (operands[1])) lsw_operands[1] = adj_offsettable_operand(operands[1], 4); @@ -203,7 +203,7 @@ abort(); if (GET_CODE (operands[2]) == REG) - lsw_operands[2] = gen_rtx(REG, SImode, REGNO (operands[2]) + 1); + lsw_operands[2] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); else if (GET_CODE (operands[2]) == MEM && offsettable_memref_p (operands[2])) lsw_operands[2] = adj_offsettable_operand(operands[2], 4); @@ -289,7 +289,7 @@ rtx lsw_operands[3]; if (GET_CODE (operands[0]) == REG) - lsw_operands[0] = gen_rtx(REG, SImode, REGNO (operands[0]) + 1); + lsw_operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else if (GET_CODE (operands[0]) == MEM && offsettable_memref_p (operands[0])) lsw_operands[0] = adj_offsettable_operand(operands[0], 4); @@ -297,7 +297,7 @@ abort(); if (GET_CODE (operands[2]) == REG) - lsw_operands[2] = gen_rtx(REG, SImode, REGNO (operands[2]) + 1); + lsw_operands[2] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); else if (GET_CODE (operands[2]) == MEM && offsettable_memref_p (operands[2])) lsw_operands[2] = adj_offsettable_operand(operands[2], 4); @@ -339,7 +339,7 @@ rtx lsw_operands[3]; if (GET_CODE (operands[0]) == REG) - lsw_operands[0] = gen_rtx(REG, SImode, REGNO (operands[0]) + 1); + lsw_operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); else if (GET_CODE (operands[0]) == MEM && offsettable_memref_p (operands[0])) lsw_operands[0] = adj_offsettable_operand(operands[0], 4); @@ -347,7 +347,7 @@ abort(); if (GET_CODE (operands[1]) == REG) - lsw_operands[1] = gen_rtx(REG, SImode, REGNO (operands[1]) + 1); + lsw_operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); else if (GET_CODE (operands[1]) == MEM && offsettable_memref_p (operands[1])) lsw_operands[1] = adj_offsettable_operand(operands[1], 4); @@ -367,7 +367,7 @@ abort(); if (GET_CODE (operands[2]) == REG) - lsw_operands[2] = gen_rtx(REG, SImode, REGNO (operands[2]) + 1); + lsw_operands[2] = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); else if (GET_CODE (operands[2]) == MEM && offsettable_memref_p (operands[2])) lsw_operands[2] = adj_offsettable_operand(operands[2], 4); @@ -758,7 +758,7 @@ if (GET_CODE (operands[1]) == CONST_INT && ((unsigned long)INTVAL (operands[1]) & 0x8000L)) - operands[1] = GEN_INT (INTVAL(operands[1]) | 0xffff0000L); + operands[1] = GEN_INT (INTVAL (operands[1]) | 0xffff0000L); output_asm_insn(\"CMPH %1, %0\",operands); @@ -913,7 +913,7 @@ "* { - operands[2] = GEN_INT (INTVAL(operands[2]) - 1); + operands[2] = GEN_INT (INTVAL (operands[2]) - 1); output_asm_insn(\"EXTFH %2, %3, {uhalf}%1, {uword}%0\",operands); return \"\"; @@ -928,7 +928,7 @@ "* { - operands[2] = GEN_INT (INTVAL(operands[2]) - 1); + operands[2] = GEN_INT (INTVAL (operands[2]) - 1); output_asm_insn(\"EXTFB %2, %3, {ubyte}%1, {uword}%0\",operands); return \"\"; @@ -943,7 +943,7 @@ "* { - operands[1] = GEN_INT (INTVAL(operands[1]) - 1); + operands[1] = GEN_INT (INTVAL (operands[1]) - 1); output_asm_insn(\"INSFW %1, %2, %3, %0\",operands); return \"\"; diff --git a/gcc/configure b/gcc/configure index 8d297408f33..25979971c2a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -42,12 +42,12 @@ ac_help="$ac_help --enable-c-cpplib link cpplib directly into C and C++ compilers (EXPERIMENTAL) (implies --enable-cpplib)." ac_help="$ac_help - --enable-c-mbchar enable multibyte characters for C and C++." -ac_help="$ac_help --disable-fast-fixincludes Disable the new fast fixincludes. Run the old fixincludes script unconditionally" ac_help="$ac_help + --enable-c-mbchar Enable multibyte characters for C and C++." +ac_help="$ac_help --enable-threads enable thread usage for target GCC. --enable-threads=LIB use LIB thread package for target GCC." ac_help="$ac_help @@ -831,16 +831,6 @@ fi fi -# Enable Multibyte Characters for C/C++ -# Check whether --enable-c-mbchar or --disable-c-mbchar was given. -if test "${enable_c_mbchar+set}" = set; then - enableval="$enable_c_mbchar" - if test x$enable_c_mbchar != xno; then - extra_c_flags=-DMULTIBYTE_CHARS=1 -fi -fi - - # Disable fast fixincludes # Check whether --enable-fast-fixincludes or --disable-fast-fixincludes was given. if test "${enable_fast_fixincludes+set}" = set; then @@ -851,6 +841,16 @@ fi fi +# Enable Multibyte Characters for C/C++ +# Check whether --enable-c-mbchar or --disable-c-mbchar was given. +if test "${enable_c_mbchar+set}" = set; then + enableval="$enable_c_mbchar" + if [ x$enable_c_mbchar != xno ]; then + extra_c_flags=-DMULTIBYTE_CHARS=1 +fi +fi + + # Enable threads # Pass with no value to take the default # Pass with a value to specify a thread package @@ -1935,7 +1935,7 @@ EOF fi -for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h unistd.h stab.h sys/file.h sys/time.h sys/resource.h sys/param.h sys/times.h sys/stat.h direct.h +for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h unistd.h stab.h sys/file.h sys/time.h sys/resource.h sys/param.h sys/times.h sys/stat.h direct.h malloc.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -2626,7 +2626,7 @@ EOF fi -for ac_func in malloc realloc calloc free bcopy bzero bcmp \ +for ac_func in bcopy bzero bcmp \ index rindex getenv atol sbrk abort atof strerror getcwd getwd \ strsignal putc_unlocked fputs_unlocked strstr do @@ -2695,7 +2695,7 @@ fi done -for ac_func in getrlimit setrlimit +for ac_func in malloc realloc calloc free do echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6 echo "configure:2702: checking whether $ac_func must be declared" >&5 @@ -2731,6 +2731,76 @@ else #ifndef HAVE_INDEX #define index strchr #endif +#ifdef HAVE_MALLOC_H +#include <malloc.h> +#endif + +int main() { +char *(*pfn) = (char *(*)) $ac_func +; return 0; } +EOF +if { (eval echo configure:2743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "gcc_cv_decl_needed_$ac_func=no" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "gcc_cv_decl_needed_$ac_func=yes" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$gcc_cv_decl_needed_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + gcc_tr_decl=NEED_DECLARATION_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $gcc_tr_decl 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +done + + +for ac_func in getrlimit setrlimit +do +echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6 +echo "configure:2772: checking whether $ac_func must be declared" >&5 +if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2777 "configure" +#include "confdefs.h" + +#include <stdio.h> +#ifdef STRING_WITH_STRINGS +# include <string.h> +# include <strings.h> +#else +# ifdef HAVE_STRING_H +# include <string.h> +# else +# ifdef HAVE_STRINGS_H +# include <strings.h> +# endif +# endif +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifndef HAVE_RINDEX +#define rindex strrchr +#endif +#ifndef HAVE_INDEX +#define index strchr +#endif #include <sys/types.h> #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> @@ -2740,7 +2810,7 @@ int main() { char *(*pfn) = (char *(*)) $ac_func ; return 0; } EOF -if { (eval echo configure:2744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_decl_needed_$ac_func=no" else @@ -2767,12 +2837,12 @@ done echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:2771: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:2841: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2776 "configure" +#line 2846 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -2784,7 +2854,7 @@ int main() { char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:2788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -2807,12 +2877,12 @@ fi # mkdir takes a single argument on some systems. echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6 -echo "configure:2811: checking if mkdir takes one argument" >&5 +echo "configure:2881: checking if mkdir takes one argument" >&5 if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2816 "configure" +#line 2886 "configure" #include "confdefs.h" #include <sys/types.h> @@ -2829,7 +2899,7 @@ int main() { mkdir ("foo", 0); ; return 0; } EOF -if { (eval echo configure:2833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_mkdir_takes_one_arg=no else @@ -6179,7 +6249,7 @@ fi echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 -echo "configure:6183: checking for strerror in -lcposix" >&5 +echo "configure:6253: checking for strerror in -lcposix" >&5 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6187,7 +6257,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcposix $LIBS" cat > conftest.$ac_ext <<EOF -#line 6191 "configure" +#line 6261 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6198,7 +6268,7 @@ int main() { strerror() ; return 0; } EOF -if { (eval echo configure:6202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6221,12 +6291,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:6225: checking for working const" >&5 +echo "configure:6295: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6230 "configure" +#line 6300 "configure" #include "confdefs.h" int main() { @@ -6275,7 +6345,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:6279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -6296,21 +6366,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:6300: checking for inline" >&5 +echo "configure:6370: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 6307 "configure" +#line 6377 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:6314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -6336,12 +6406,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:6340: checking for off_t" >&5 +echo "configure:6410: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6345 "configure" +#line 6415 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -6369,12 +6439,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:6373: checking for size_t" >&5 +echo "configure:6443: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6378 "configure" +#line 6448 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -6404,19 +6474,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:6408: checking for working alloca.h" >&5 +echo "configure:6478: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6413 "configure" +#line 6483 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:6420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -6437,12 +6507,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:6441: checking for alloca" >&5 +echo "configure:6511: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6446 "configure" +#line 6516 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -6470,7 +6540,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:6474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -6502,12 +6572,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:6506: checking whether alloca needs Cray hooks" >&5 +echo "configure:6576: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6511 "configure" +#line 6581 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -6532,12 +6602,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6536: checking for $ac_func" >&5 +echo "configure:6606: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6541 "configure" +#line 6611 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6560,7 +6630,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6587,7 +6657,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:6591: checking stack direction for C alloca" >&5 +echo "configure:6661: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6595,7 +6665,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 6599 "configure" +#line 6669 "configure" #include "confdefs.h" find_stack_direction () { @@ -6614,7 +6684,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:6618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -6639,17 +6709,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6643: checking for $ac_hdr" >&5 +echo "configure:6713: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6648 "configure" +#line 6718 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6678,12 +6748,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6682: checking for $ac_func" >&5 +echo "configure:6752: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6687 "configure" +#line 6757 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6706,7 +6776,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6731,7 +6801,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6735: checking for working mmap" >&5 +echo "configure:6805: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6739,7 +6809,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 6743 "configure" +#line 6813 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -6879,7 +6949,7 @@ main() } EOF -if { (eval echo configure:6883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -6907,17 +6977,17 @@ unistd.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6911: checking for $ac_hdr" >&5 +echo "configure:6981: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6916 "configure" +#line 6986 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6947,12 +7017,12 @@ done strdup __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6951: checking for $ac_func" >&5 +echo "configure:7021: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6956 "configure" +#line 7026 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6975,7 +7045,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7004,12 +7074,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7008: checking for $ac_func" >&5 +echo "configure:7078: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7013 "configure" +#line 7083 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7032,7 +7102,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:7036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7066,19 +7136,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:7070: checking for LC_MESSAGES" >&5 +echo "configure:7140: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7075 "configure" +#line 7145 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:7082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -7099,7 +7169,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:7103: checking whether NLS is requested" >&5 +echo "configure:7173: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -7119,7 +7189,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:7123: checking whether included gettext is requested" >&5 +echo "configure:7193: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -7138,17 +7208,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:7142: checking for libintl.h" >&5 +echo "configure:7212: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7147 "configure" +#line 7217 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7165,19 +7235,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:7169: checking for gettext in libc" >&5 +echo "configure:7239: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7174 "configure" +#line 7244 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:7181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -7193,7 +7263,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:7197: checking for bindtextdomain in -lintl" >&5 +echo "configure:7267: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7201,7 +7271,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 7205 "configure" +#line 7275 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7212,7 +7282,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:7216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7228,12 +7298,12 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:7232: checking for gettext in libintl" >&5 +echo "configure:7302: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:7237: checking for gettext in -lintl" >&5 +echo "configure:7307: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7241,7 +7311,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 7245 "configure" +#line 7315 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7252,7 +7322,7 @@ int main() { gettext() ; return 0; } EOF -if { (eval echo configure:7256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7291,7 +7361,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7295: checking for $ac_word" >&5 +echo "configure:7365: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7325,12 +7395,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7329: checking for $ac_func" >&5 +echo "configure:7399: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7334 "configure" +#line 7404 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7353,7 +7423,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:7357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7380,7 +7450,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7384: checking for $ac_word" >&5 +echo "configure:7454: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7416,7 +7486,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7420: checking for $ac_word" >&5 +echo "configure:7490: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7448,7 +7518,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 7452 "configure" +#line 7522 "configure" #include "confdefs.h" int main() { @@ -7456,7 +7526,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:7460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -7479,7 +7549,7 @@ fi if test "$CATOBJEXT" = "NONE"; then echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 -echo "configure:7483: checking whether catgets can be used" >&5 +echo "configure:7553: checking whether catgets can be used" >&5 # Check whether --with-catgets or --without-catgets was given. if test "${with_catgets+set}" = set; then withval="$with_catgets" @@ -7492,7 +7562,7 @@ fi if test "$nls_cv_use_catgets" = "yes"; then echo $ac_n "checking for main in -li""... $ac_c" 1>&6 -echo "configure:7496: checking for main in -li" >&5 +echo "configure:7566: checking for main in -li" >&5 ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7500,14 +7570,14 @@ else ac_save_LIBS="$LIBS" LIBS="-li $LIBS" cat > conftest.$ac_ext <<EOF -#line 7504 "configure" +#line 7574 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:7511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7535,12 +7605,12 @@ else fi echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:7539: checking for catgets" >&5 +echo "configure:7609: checking for catgets" >&5 if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7544 "configure" +#line 7614 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char catgets(); below. */ @@ -7563,7 +7633,7 @@ catgets(); ; return 0; } EOF -if { (eval echo configure:7567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_catgets=yes" else @@ -7585,7 +7655,7 @@ EOF # Extract the first word of "gencat", so it can be a program name with args. set dummy gencat; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7589: checking for $ac_word" >&5 +echo "configure:7659: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7621,7 +7691,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7625: checking for $ac_word" >&5 +echo "configure:7695: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7658,7 +7728,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7662: checking for $ac_word" >&5 +echo "configure:7732: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7693,7 +7763,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7697: checking for $ac_word" >&5 +echo "configure:7767: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7751,7 +7821,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7755: checking for $ac_word" >&5 +echo "configure:7825: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7785,7 +7855,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7789: checking for $ac_word" >&5 +echo "configure:7859: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7821,7 +7891,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7825: checking for $ac_word" >&5 +echo "configure:7895: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7914,7 +7984,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:7918: checking for catalogs to be installed" >&5 +echo "configure:7988: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -7942,17 +8012,17 @@ echo "configure:7918: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:7946: checking for linux/version.h" >&5 +echo "configure:8016: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7951 "configure" +#line 8021 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8027,7 +8097,7 @@ fi echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6 -echo "configure:8031: checking whether windows registry support is requested" >&5 +echo "configure:8101: checking whether windows registry support is requested" >&5 if test x$enable_win32_registry != xno; then cat >> confdefs.h <<\EOF #define ENABLE_WIN32_REGISTRY 1 @@ -8056,7 +8126,7 @@ esac if test x$enable_win32_registry != xno; then echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6 -echo "configure:8060: checking registry key on windows hosts" >&5 +echo "configure:8130: checking registry key on windows hosts" >&5 cat >> confdefs.h <<EOF #define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key" EOF @@ -8232,7 +8302,7 @@ fi # Figure out what assembler alignment features are present. echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6 -echo "configure:8236: checking assembler alignment features" >&5 +echo "configure:8306: checking assembler alignment features" >&5 gcc_cv_as= gcc_cv_as_alignment_features= gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas @@ -8353,7 +8423,7 @@ fi echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6 echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6 -echo "configure:8357: checking assembler subsection support" >&5 +echo "configure:8427: checking assembler subsection support" >&5 gcc_cv_as_subsections= if test x$gcc_cv_as != x; then # Check if we have .subsection @@ -8395,7 +8465,7 @@ echo "$ac_t""$gcc_cv_as_subsections" 1>&6 case "$target" in sparc*-*-*) echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6 -echo "configure:8399: checking assembler .register pseudo-op support" >&5 +echo "configure:8469: checking assembler .register pseudo-op support" >&5 gcc_cv_as_register_pseudo_op= if test x$gcc_cv_as != x; then # Check if we have .register @@ -8412,7 +8482,7 @@ EOF echo "$ac_t""$gcc_cv_as_register_pseudo_op" 1>&6 echo $ac_n "checking assembler offsetable %lo() support""... $ac_c" 1>&6 -echo "configure:8416: checking assembler offsetable %lo() support" >&5 +echo "configure:8486: checking assembler offsetable %lo() support" >&5 gcc_cv_as_offsetable_lo10= if test x$gcc_cv_as != x; then # Check if assembler has offsetable %lo() @@ -8449,7 +8519,7 @@ EOF i[34567]86-*-*) echo $ac_n "checking assembler instructions""... $ac_c" 1>&6 -echo "configure:8453: checking assembler instructions" >&5 +echo "configure:8523: checking assembler instructions" >&5 gcc_cv_as_instructions= if test x$gcc_cv_as != x; then set "filds fists" "filds mem; fists mem" diff --git a/gcc/configure.in b/gcc/configure.in index 2fbe167e3be..fca71493789 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -216,13 +216,6 @@ if test x$enable_c_cpplib != xno; then cpp_main=cppmain fi) -# Enable Multibyte Characters for C/C++ -AC_ARG_ENABLE(c-mbchar, -[ --enable-c-mbchar enable multibyte characters for C and C++.], -if test x$enable_c_mbchar != xno; then - extra_c_flags=-DMULTIBYTE_CHARS=1 -fi) - # Disable fast fixincludes AC_ARG_ENABLE(fast-fixincludes, [ --disable-fast-fixincludes @@ -232,6 +225,13 @@ if test x$enable_fast_fixincludes = xno ; then cp $srcdir/fixincludes ./fixinc.sh fi) +# Enable Multibyte Characters for C/C++ +AC_ARG_ENABLE(c-mbchar, +[ --enable-c-mbchar Enable multibyte characters for C and C++.], +if [[[ x$enable_c_mbchar != xno ]]]; then + extra_c_flags=-DMULTIBYTE_CHARS=1 +fi) + # Enable threads # Pass with no value to take the default # Pass with a value to specify a thread package @@ -333,7 +333,7 @@ AC_HEADER_STDC AC_HEADER_TIME GCC_HEADER_STRING AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h unistd.h stab.h sys/file.h sys/time.h sys/resource.h sys/param.h sys/times.h sys/stat.h direct.h) +AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h unistd.h stab.h sys/file.h sys/time.h sys/resource.h sys/param.h sys/times.h sys/stat.h direct.h malloc.h) # Check for thread headers. AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=]) @@ -391,10 +391,16 @@ case "${host}" in esac AC_FUNC_VFORK -GCC_NEED_DECLARATIONS(malloc realloc calloc free bcopy bzero bcmp \ +GCC_NEED_DECLARATIONS(bcopy bzero bcmp \ index rindex getenv atol sbrk abort atof strerror getcwd getwd \ strsignal putc_unlocked fputs_unlocked strstr) +GCC_NEED_DECLARATIONS(malloc realloc calloc free, [ +#ifdef HAVE_MALLOC_H +#include <malloc.h> +#endif +]) + GCC_NEED_DECLARATIONS(getrlimit setrlimit, [ #include <sys/types.h> #ifdef HAVE_SYS_RESOURCE_H diff --git a/gcc/convert.c b/gcc/convert.c index bfcb5db4470..31ebb56ff30 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */ intended to be called by the language-specific convert () functions. */ #include "config.h" +#include "system.h" #include "tree.h" #include "flags.h" #include "convert.h" diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 6857adaca79..a1928efbb6f 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2207,7 +2207,7 @@ break_out_target_exprs (t) tree build_min_nt VPROTO((enum tree_code code, ...)) { -#ifndef __STDC__ +#ifndef ANSI_PROTOTYPES enum tree_code code; #endif register struct obstack *ambient_obstack = expression_obstack; @@ -2218,7 +2218,7 @@ build_min_nt VPROTO((enum tree_code code, ...)) VA_START (p, code); -#ifndef __STDC__ +#ifndef ANSI_PROTOTYPES code = va_arg (p, enum tree_code); #endif @@ -2245,7 +2245,7 @@ build_min_nt VPROTO((enum tree_code code, ...)) tree build_min VPROTO((enum tree_code code, tree tt, ...)) { -#ifndef __STDC__ +#ifndef ANSI_PROTOTYPES enum tree_code code; tree tt; #endif @@ -2257,7 +2257,7 @@ build_min VPROTO((enum tree_code code, tree tt, ...)) VA_START (p, tt); -#ifndef __STDC__ +#ifndef ANSI_PROTOTYPES code = va_arg (p, enum tree_code); tt = va_arg (p, tree); #endif diff --git a/gcc/cpp.texi b/gcc/cpp.texi index 5860f1cd680..e9a9095c7b2 100644 --- a/gcc/cpp.texi +++ b/gcc/cpp.texi @@ -2741,12 +2741,6 @@ as when text other than a comment follows @samp{#else} or @samp{#endif}. Like @samp{-pedantic}, except that errors are produced rather than warnings. -@item -Wtrigraphs -@findex -Wtrigraphs -Warn if any trigraphs are encountered. Currently this only works if you -have turned trigraphs on with @samp{-trigraphs} or @samp{-ansi}; in the -future this restriction will be removed. - @item -Wcomment @findex -Wcomment @ignore @@ -2759,10 +2753,19 @@ future this restriction will be removed. Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*} comment, or whenever a Backslash-Newline appears in a @samp{//} comment. +@item -Wtrigraphs +@findex -Wtrigraphs +Warn if any trigraphs are encountered (assuming they are enabled). + +@item -Wwhite-space +@findex -Wwhite-space +Warn about possible white space confusion, e.g. white space between a +backslash and a newline. + @item -Wall @findex -Wall -Requests both @samp{-Wtrigraphs} and @samp{-Wcomment} (but not -@samp{-Wtraditional} or @samp{-Wundef}). +Requests @samp{-Wcomment}, @samp{-Wtrigraphs}, and @samp{-Wwhite-space} +(but not @samp{-Wtraditional} or @samp{-Wundef}). @item -Wtraditional @findex -Wtraditional diff --git a/gcc/cppalloc.c b/gcc/cppalloc.c index 5c96aff7cb8..b42e523d8a5 100644 --- a/gcc/cppalloc.c +++ b/gcc/cppalloc.c @@ -1,5 +1,5 @@ /* Part of CPP library. (memory allocation - xmalloc etc) - Copyright (C) 1986, 87, 89, 92, 93, 94, 1995, 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 diff --git a/gcc/cpphash.c b/gcc/cpphash.c index 2b5291bea2b..66fa3589707 100644 --- a/gcc/cpphash.c +++ b/gcc/cpphash.c @@ -1,5 +1,5 @@ /* Part of CPP library. (Macro handling.) - Copyright (C) 1986, 87, 89, 92-95, 1996, 1998 Free Software Foundation, Inc. + Copyright (C) 1986, 87, 89, 92-96, 98, 1999 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 diff --git a/gcc/cse.c b/gcc/cse.c index d1a2487cb41..2065833e209 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -4025,9 +4025,11 @@ simplify_binary_operation (code, mode, op0, op1) if (GET_CODE (op1) == AND) { if (rtx_equal_p (op0, XEXP (op1, 0))) - return cse_gen_binary (AND, mode, op0, gen_rtx_NOT (mode, XEXP (op1, 1))); + return cse_gen_binary (AND, mode, op0, + gen_rtx_NOT (mode, XEXP (op1, 1))); if (rtx_equal_p (op0, XEXP (op1, 1))) - return cse_gen_binary (AND, mode, op0, gen_rtx_NOT (mode, XEXP (op1, 0))); + return cse_gen_binary (AND, mode, op0, + gen_rtx_NOT (mode, XEXP (op1, 0))); } break; @@ -4172,8 +4174,9 @@ simplify_binary_operation (code, mode, op0, op1) return gen_rtx_MULT (mode, op0, CONST_DOUBLE_FROM_REAL_VALUE (d, mode)); #else - return gen_rtx_MULT (mode, op0, - CONST_DOUBLE_FROM_REAL_VALUE (1./d, mode)); + return + gen_rtx_MULT (mode, op0, + CONST_DOUBLE_FROM_REAL_VALUE (1./d, mode)); #endif } } @@ -7212,9 +7215,10 @@ cse_insn (insn, libcall_insn) && qty_first_reg[REG_QTY (REGNO (dest))] != REGNO (dest) && GET_CODE (src) == REG && REGNO (src) == REGNO (dest) /* Don't do this if the original insn had a hard reg as - SET_SRC. */ + SET_SRC or SET_DEST. */ && (GET_CODE (sets[i].src) != REG - || REGNO (sets[i].src) >= FIRST_PSEUDO_REGISTER)) + || REGNO (sets[i].src) >= FIRST_PSEUDO_REGISTER) + && (GET_CODE (dest) != REG || REGNO (dest) >= FIRST_PSEUDO_REGISTER)) /* We can't call canon_reg here because it won't do anything if SRC is a hard register. */ { @@ -7307,9 +7311,9 @@ cse_insn (insn, libcall_insn) if (note) XEXP (note, 0) = const_insn; else - REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_WAS_0, - const_insn, - REG_NOTES (insn)); + REG_NOTES (insn) + = gen_rtx_INSN_LIST (REG_WAS_0, const_insn, + REG_NOTES (insn)); } } } @@ -8820,7 +8824,8 @@ cse_basic_block (from, to, next_branch, around_loop) qty_first_reg = (int *) alloca ((max_qty - max_reg) * sizeof (int)); qty_last_reg = (int *) alloca ((max_qty - max_reg) * sizeof (int)); - qty_mode= (enum machine_mode *) alloca ((max_qty - max_reg) * sizeof (enum machine_mode)); + qty_mode = (enum machine_mode *) alloca ((max_qty - max_reg) + * sizeof (enum machine_mode)); qty_const = (rtx *) alloca ((max_qty - max_reg) * sizeof (rtx)); qty_const_insn = (rtx *) alloca ((max_qty - max_reg) * sizeof (rtx)); qty_comparison_code diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c2168442f48..91bef90b1ef 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -427,20 +427,20 @@ static void dwarf2out_frame_debug_expr PROTO((rtx, char *)); #define ASM_OUTPUT_DWARF_DELTA2(FILE,LABEL1,LABEL2) \ assemble_integer (gen_rtx_MINUS (HImode, \ - gen_rtx_SYMBOL_REF (Pmode, LABEL1), \ - gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \ + gen_rtx_SYMBOL_REF (Pmode, LABEL1), \ + gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \ 2, 1) #define ASM_OUTPUT_DWARF_DELTA4(FILE,LABEL1,LABEL2) \ assemble_integer (gen_rtx_MINUS (SImode, \ - gen_rtx_SYMBOL_REF (Pmode, LABEL1), \ - gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \ + gen_rtx_SYMBOL_REF (Pmode, LABEL1), \ + gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \ 4, 1) #define ASM_OUTPUT_DWARF_ADDR_DELTA(FILE,LABEL1,LABEL2) \ assemble_integer (gen_rtx_MINUS (Pmode, \ - gen_rtx_SYMBOL_REF (Pmode, LABEL1), \ - gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \ + gen_rtx_SYMBOL_REF (Pmode, LABEL1), \ + gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \ PTR_SIZE, 1) #define ASM_OUTPUT_DWARF_DELTA(FILE,LABEL1,LABEL2) \ @@ -7390,7 +7390,7 @@ add_bound_info (subrange_die, bound_attr, bound) rtx new_addr = fix_lexical_addr (XEXP (loc, 0), bound); if (XEXP (loc, 0) != new_addr) - loc = gen_rtx (MEM, GET_MODE (loc), new_addr); + loc = gen_rtx_MEM (GET_MODE (loc), new_addr); } add_AT_flag (decl_die, DW_AT_artificial, 1); diff --git a/gcc/dyn-string.c b/gcc/dyn-string.c index c9edfcb076e..704629d253b 100644 --- a/gcc/dyn-string.c +++ b/gcc/dyn-string.c @@ -4,28 +4,29 @@ This file is part of GNU CC. -GNU CC is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. -GNU CC is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "config.h" #include "system.h" #include "dyn-string.h" -/* Create a new dynamic string capable of holding at least SPACE - characters, including the terminating NUL. If SPACE is 0, it - will be silently increased to 1. */ +/* Create a new dynamic string capable of holding at least SPACE characters, + including the terminating NUL. If SPACE is 0, it will be silently + increased to 1. */ dyn_string_t dyn_string_new (space) @@ -33,13 +34,12 @@ dyn_string_new (space) { dyn_string_t result = (dyn_string_t) xmalloc (sizeof (struct dyn_string)); + /* We need at least one byte in which to store the terminating NUL. */ if (space == 0) - /* We need at least one byte in which to store the terminating - NUL. */ space = 1; result->allocated = space; - result->s = (char*) xmalloc (space); + result->s = (char *) xmalloc (space); result->length = 0; result->s[0] = '\0'; @@ -56,8 +56,7 @@ dyn_string_delete (ds) free (ds); } -/* Append the NUL-terminated string S to DS, resizing DS if - necessary. */ +/* Append the NUL-terminated string S to DS, resizing DS if necessary. */ dyn_string_t dyn_string_append (ds, s) @@ -65,16 +64,19 @@ dyn_string_append (ds, s) const char *s; { int len = strlen (s); - dyn_string_resize (ds, ds->length + len + 1 /* '\0' */); + + /* The new length is the old length plus the size of our string, plus + one for the null at the end. */ + dyn_string_resize (ds, ds->length + len + 1); strcpy (ds->s + ds->length, s); ds->length += len; return ds; } -/* Increase the capacity of DS so that it can hold at least SPACE - characters, including the terminating NUL. This function will not - (at present) reduce the capacity of DS. */ +/* Increase the capacity of DS so it can hold at least SPACE characters, + including the terminating NUL. This function will not (at present) + reduce the capacity of DS. */ dyn_string_t dyn_string_resize (ds, space) @@ -90,7 +92,7 @@ dyn_string_resize (ds, space) { /* We actually need more space. */ ds->allocated = new_allocated; - ds->s = (char*) xrealloc (ds->s, ds->allocated); + ds->s = (char *) xrealloc (ds->s, ds->allocated); } return ds; diff --git a/gcc/dyn-string.h b/gcc/dyn-string.h index 9f9330886ca..50e00e70031 100644 --- a/gcc/dyn-string.h +++ b/gcc/dyn-string.h @@ -4,26 +4,27 @@ This file is part of GNU CC. -GNU CC is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. -GNU CC is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + typedef struct dyn_string { - int allocated; /* The amount of space allocated for the string. */ - int length; /* The actual length of the string. */ - char *s; /* The string itself, NUL-terminated. */ + int allocated; /* The amount of space allocated for the string. */ + int length; /* The actual length of the string. */ + char *s; /* The string itself, NUL-terminated. */ }* dyn_string_t; extern dyn_string_t dyn_string_new PROTO((int)); diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index a87c5198ca0..5a4b5f2f02a 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -187,6 +187,10 @@ static rtx make_call_insn_raw PROTO((rtx)); static rtx find_line_note PROTO((rtx)); static void mark_sequence_stack PROTO((struct sequence_stack *)); +/* There are some RTL codes that require special attention; the generation + functions do the raw handling. If you add to this list, modify + special_rtx in gengenrtl.c as well. */ + rtx gen_rtx_CONST_INT (mode, arg) enum machine_mode mode; @@ -247,21 +251,22 @@ gen_rtx_REG (mode, regno) if (mode == Pmode && !reload_in_progress) { - if (regno == FRAME_POINTER_REGNUM) + if (frame_pointer_rtx != 0 && regno == FRAME_POINTER_REGNUM) return frame_pointer_rtx; #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - if (regno == HARD_FRAME_POINTER_REGNUM) + if (hard_frame_pointer_rtx != 0 && regno == HARD_FRAME_POINTER_REGNUM) return hard_frame_pointer_rtx; #endif #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && HARD_FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM - if (regno == ARG_POINTER_REGNUM) + if (arg_pointer_rtx != 0 && regno == ARG_POINTER_REGNUM) return arg_pointer_rtx; #endif #ifdef RETURN_ADDRESS_POINTER_REGNUM - if (regno == RETURN_ADDRESS_POINTER_REGNUM) + if (return_address_pointer_rtx != 0 + && regno == RETURN_ADDRESS_POINTER_REGNUM) return return_address_pointer_rtx; #endif - if (regno == STACK_POINTER_REGNUM) + if (stack_pointer_rtx != 0 && regno == STACK_POINTER_REGNUM) return stack_pointer_rtx; } @@ -281,7 +286,7 @@ gen_rtx_MEM (mode, addr) return rt; } - + /* rtx gen_rtx (code, mode, [element1, ..., elementn]) ** ** This routine generates an RTX of the size specified by @@ -747,6 +752,9 @@ gen_lowpart_common (mode, x) i = INTVAL (x); r = REAL_VALUE_FROM_TARGET_SINGLE (i); + /* Avoid changing the bit pattern of a NaN. */ + if (REAL_VALUE_ISNAN (r)) + return 0; return CONST_DOUBLE_FROM_REAL_VALUE (r, mode); } #else @@ -785,6 +793,8 @@ gen_lowpart_common (mode, x) i[0] = low, i[1] = high; r = REAL_VALUE_FROM_TARGET_DOUBLE (i); + if (REAL_VALUE_ISNAN (r)) + return 0; return CONST_DOUBLE_FROM_REAL_VALUE (r, mode); } #else @@ -1478,7 +1488,8 @@ reverse_comparison (insn) } else { - rtx new = gen_rtx_COMPARE (VOIDmode, CONST0_RTX (GET_MODE (comp)), comp); + rtx new = gen_rtx_COMPARE (VOIDmode, + CONST0_RTX (GET_MODE (comp)), comp); if (GET_CODE (body) == SET) SET_SRC (body) = new; else @@ -2105,7 +2116,8 @@ link_cc0_insns (insn) if (GET_CODE (user) == INSN && GET_CODE (PATTERN (user)) == SEQUENCE) user = XVECEXP (PATTERN (user), 0, 0); - REG_NOTES (user) = gen_rtx_INSN_LIST (REG_CC_SETTER, insn, REG_NOTES (user)); + REG_NOTES (user) = gen_rtx_INSN_LIST (REG_CC_SETTER, insn, + REG_NOTES (user)); REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_CC_USER, user, REG_NOTES (insn)); } @@ -3541,6 +3553,8 @@ init_emit_once (line_numbers) /* Create the unique rtx's for certain rtx codes and operand values. */ + /* Don't use gen_rtx here since gen_rtx in this case + tries to use these variables. */ for (i = - MAX_SAVED_CONST_INT; i <= MAX_SAVED_CONST_INT; i++) { PUT_CODE (&const_int_rtx[i + MAX_SAVED_CONST_INT], CONST_INT); @@ -3648,7 +3662,8 @@ init_emit_once (line_numbers) #ifdef STATIC_CHAIN_INCOMING_REGNUM if (STATIC_CHAIN_INCOMING_REGNUM != STATIC_CHAIN_REGNUM) - static_chain_incoming_rtx = gen_rtx_REG (Pmode, STATIC_CHAIN_INCOMING_REGNUM); + static_chain_incoming_rtx + = gen_rtx_REG (Pmode, STATIC_CHAIN_INCOMING_REGNUM); else #endif static_chain_incoming_rtx = static_chain_rtx; diff --git a/gcc/explow.c b/gcc/explow.c index 2e0de41a70a..3af4c2c06a8 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -215,7 +215,7 @@ plus_constant_for_output_wide (x, c) if (GET_CODE (x) == LO_SUM) return gen_rtx_LO_SUM (mode, XEXP (x, 0), - plus_constant_for_output (XEXP (x, 1), c)); + plus_constant_for_output (XEXP (x, 1), c)); else return plus_constant (x, c); @@ -1314,6 +1314,10 @@ allocate_dynamic_stack_space (size, target, known_align) #else target = copy_to_mode_reg (Pmode, target); #endif + + if (mode == VOIDmode) + mode = Pmode; + size = convert_modes (mode, ptr_mode, size, 1); if (insn_operand_predicate[(int) CODE_FOR_allocate_stack][1] && ! ((*insn_operand_predicate[(int) CODE_FOR_allocate_stack][1]) @@ -1420,10 +1424,10 @@ probe_stack_range (first, size) if (insn_operand_predicate[(int) CODE_FOR_check_stack][0] && ! ((*insn_operand_predicate[(int) CODE_FOR_check_stack][0]) - (last_address, Pmode))) - last_address = copy_to_mode_reg (Pmode, last_address); + (last_addr, Pmode))) + last_addr = copy_to_mode_reg (Pmode, last_addr); - emit_insn (gen_check_stack (last_address)); + emit_insn (gen_check_stack (last_addr)); return; } #endif diff --git a/gcc/expmed.c b/gcc/expmed.c index 1ec710d26f2..2138ad189af 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -66,8 +66,8 @@ static int sdiv_pow2_cheap, smod_pow2_cheap; #define MAX_BITS_PER_WORD BITS_PER_WORD #endif -/* Cost of various pieces of RTL. Note that some of these are indexed by shift count, - and some by mode. */ +/* Cost of various pieces of RTL. Note that some of these are indexed by + shift count and some by mode. */ static int add_cost, negate_cost, zero_cost; static int shift_cost[MAX_BITS_PER_WORD]; static int shiftadd_cost[MAX_BITS_PER_WORD]; @@ -96,7 +96,7 @@ init_expmed () makes. */ free_point = (char *) oballoc (0); - reg = gen_rtx (REG, word_mode, 10000); + reg = gen_rtx_REG (word_mode, 10000); zero_cost = rtx_cost (const0_rtx, 0); add_cost = rtx_cost (gen_rtx_PLUS (word_mode, reg, reg), SET); @@ -170,12 +170,13 @@ init_expmed () mul_highpart_cost[(int) mode] = rtx_cost (gen_rtx_TRUNCATE (mode, - gen_rtx_LSHIFTRT - (wider_mode, - gen_rtx_MULT (wider_mode, - gen_rtx_ZERO_EXTEND (wider_mode, reg), - gen_rtx_ZERO_EXTEND (wider_mode, reg)), - GEN_INT (GET_MODE_BITSIZE (mode)))), + gen_rtx_LSHIFTRT (wider_mode, + gen_rtx_MULT (wider_mode, + gen_rtx_ZERO_EXTEND + (wider_mode, reg), + gen_rtx_ZERO_EXTEND + (wider_mode, reg)), + GEN_INT (GET_MODE_BITSIZE (mode)))), SET); } } @@ -365,7 +366,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) } emit_insn (GEN_FCN (icode) - (gen_rtx_SUBREG (fieldmode, op0, offset), value)); + (gen_rtx_SUBREG (fieldmode, op0, offset), value)); } return value; } @@ -2419,7 +2420,8 @@ expand_mult (mode, op0, op1, target, unsignedp) tem = expand_shift (LSHIFT_EXPR, mode, op0, build_int_2 (log, 0), NULL_RTX, 0); accum = force_operand (gen_rtx_PLUS (mode, accum, tem), - add_target ? add_target : accum_target); + add_target + ? add_target : accum_target); val_so_far += (HOST_WIDE_INT) 1 << log; break; @@ -2427,7 +2429,8 @@ expand_mult (mode, op0, op1, target, unsignedp) tem = expand_shift (LSHIFT_EXPR, mode, op0, build_int_2 (log, 0), NULL_RTX, 0); accum = force_operand (gen_rtx_MINUS (mode, accum, tem), - add_target ? add_target : accum_target); + add_target + ? add_target : accum_target); val_so_far -= (HOST_WIDE_INT) 1 << log; break; @@ -2436,7 +2439,8 @@ expand_mult (mode, op0, op1, target, unsignedp) build_int_2 (log, 0), shift_subtarget, 0); accum = force_operand (gen_rtx_PLUS (mode, accum, op0), - add_target ? add_target : accum_target); + add_target + ? add_target : accum_target); val_so_far = (val_so_far << log) + 1; break; @@ -2445,7 +2449,8 @@ expand_mult (mode, op0, op1, target, unsignedp) build_int_2 (log, 0), shift_subtarget, 0); accum = force_operand (gen_rtx_MINUS (mode, accum, op0), - add_target ? add_target : accum_target); + add_target + ? add_target : accum_target); val_so_far = (val_so_far << log) - 1; break; @@ -2453,7 +2458,8 @@ expand_mult (mode, op0, op1, target, unsignedp) tem = expand_shift (LSHIFT_EXPR, mode, accum, build_int_2 (log, 0), NULL_RTX, 0); accum = force_operand (gen_rtx_PLUS (mode, accum, tem), - add_target ? add_target : accum_target); + add_target + ? add_target : accum_target); val_so_far += val_so_far << log; break; @@ -3279,11 +3285,15 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp) t3 = expand_shift (RSHIFT_EXPR, compute_mode, op0, build_int_2 (size - 1, 0), NULL_RTX, 0); if (d < 0) - quotient = force_operand (gen_rtx_MINUS (compute_mode, t3, t2), - tquotient); + quotient + = force_operand (gen_rtx_MINUS (compute_mode, + t3, t2), + tquotient); else - quotient = force_operand (gen_rtx_MINUS (compute_mode, t2, t3), - tquotient); + quotient + = force_operand (gen_rtx_MINUS (compute_mode, + t2, t3), + tquotient); } else { @@ -3297,18 +3307,25 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp) max_cost - extra_cost); if (t1 == 0) goto fail1; - t2 = force_operand (gen_rtx_PLUS (compute_mode, t1, op0), + t2 = force_operand (gen_rtx_PLUS (compute_mode, + t1, op0), NULL_RTX); t3 = expand_shift (RSHIFT_EXPR, compute_mode, t2, - build_int_2 (post_shift, 0), NULL_RTX, 0); + build_int_2 (post_shift, 0), + NULL_RTX, 0); t4 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_2 (size - 1, 0), NULL_RTX, 0); + build_int_2 (size - 1, 0), + NULL_RTX, 0); if (d < 0) - quotient = force_operand (gen_rtx_MINUS (compute_mode, t4, t3), - tquotient); + quotient + = force_operand (gen_rtx_MINUS (compute_mode, + t4, t3), + tquotient); else - quotient = force_operand (gen_rtx_MINUS (compute_mode, t3, t4), - tquotient); + quotient + = force_operand (gen_rtx_MINUS (compute_mode, + t3, t4), + tquotient); } } else /* Too wide mode to use tricky code */ @@ -4261,7 +4278,9 @@ emit_store_flag (target, code, op0, op1, mode, unsignedp, normalizep) we don't have to do anything. */ if (normalizep == 0 || normalizep == STORE_FLAG_VALUE) ; - else if (normalizep == - STORE_FLAG_VALUE) + /* STORE_FLAG_VALUE might be the most negative number, so write + the comparison this way to avoid a compiler-time warning. */ + else if (- normalizep == STORE_FLAG_VALUE) op0 = expand_unop (compare_mode, neg_optab, op0, subtarget, 0); /* We don't want to use STORE_FLAG_VALUE < 0 below since this diff --git a/gcc/expr.c b/gcc/expr.c index 315945a15f9..2f014d345e1 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -98,11 +98,13 @@ struct move_by_pieces int autinc_to; int explicit_inc_to; int to_struct; + int to_readonly; rtx from; rtx from_addr; int autinc_from; int explicit_inc_from; int from_struct; + int from_readonly; int len; int offset; int reverse; @@ -132,13 +134,14 @@ static int move_by_pieces_ninsns PROTO((unsigned int, int)); static void move_by_pieces_1 PROTO((rtx (*) (rtx, ...), enum machine_mode, struct move_by_pieces *)); static void clear_by_pieces PROTO((rtx, int, int)); -static void clear_by_pieces_1 PROTO((rtx (*) (rtx, ...), enum machine_mode, +static void clear_by_pieces_1 PROTO((rtx (*) (rtx, ...), + enum machine_mode, struct clear_by_pieces *)); static int is_zeros_p PROTO((tree)); static int mostly_zeros_p PROTO((tree)); static void store_constructor_field PROTO((rtx, int, int, enum machine_mode, - tree, tree, int)); -static void store_constructor PROTO((tree, rtx, int)); + tree, tree, int, int)); +static void store_constructor PROTO((tree, rtx, int, int)); static rtx store_field PROTO((rtx, int, int, enum machine_mode, tree, enum machine_mode, int, int, int, int)); @@ -309,9 +312,8 @@ static rtx enqueue_insn (var, body) rtx var, body; { - pending_chain = gen_rtx_QUEUED (GET_MODE (var), - var, NULL_RTX, NULL_RTX, body, - pending_chain); + pending_chain = gen_rtx_QUEUED (GET_MODE (var), var, NULL_RTX, NULL_RTX, + body, pending_chain); return pending_chain; } @@ -1365,6 +1367,8 @@ move_by_pieces (to, from, len, align) data.to_struct = MEM_IN_STRUCT_P (to); data.from_struct = MEM_IN_STRUCT_P (from); + data.to_readonly = RTX_UNCHANGING_P (to); + data.from_readonly = RTX_UNCHANGING_P (from); /* If copying requires more than two move insns, copy addresses to registers (to make displacements shorter) @@ -1502,6 +1506,7 @@ move_by_pieces_1 (genfun, mode, data) plus_constant (data->to_addr, data->offset)))); MEM_IN_STRUCT_P (to1) = data->to_struct; + RTX_UNCHANGING_P (to1) = data->to_readonly; from1 = (data->autinc_from @@ -1510,6 +1515,7 @@ move_by_pieces_1 (genfun, mode, data) plus_constant (data->from_addr, data->offset)))); MEM_IN_STRUCT_P (from1) = data->from_struct; + RTX_UNCHANGING_P (from1) = data->from_readonly; if (HAVE_PRE_DECREMENT && data->explicit_inc_to < 0) emit_insn (gen_add2_insn (data->to_addr, GEN_INT (-size))); @@ -2731,7 +2737,7 @@ push_block (size, extra, below) negate_rtx (Pmode, plus_constant (size, extra))); else temp = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx, - negate_rtx (Pmode, size)); + negate_rtx (Pmode, size)); #endif return memory_address (GET_CLASS_NARROWEST_MODE (MODE_INT), temp); @@ -3194,7 +3200,7 @@ rtx expand_assignment (to, from, want_value, suggest_reg) tree to, from; int want_value; - int suggest_reg; + int suggest_reg ATTRIBUTE_UNUSED; { register rtx to_rtx = 0; rtx result; @@ -3277,8 +3283,10 @@ expand_assignment (to, from, want_value, suggest_reg) to_rtx = change_address (to_rtx, VOIDmode, gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0), - force_reg (ptr_mode, offset_rtx))); + force_reg (ptr_mode, + offset_rtx))); } + if (volatilep) { if (GET_CODE (to_rtx) == MEM) @@ -3925,7 +3933,7 @@ mostly_zeros_p (exp) /* Helper function for store_constructor. TARGET, BITSIZE, BITPOS, MODE, EXP are as for store_field. TYPE is the type of the CONSTRUCTOR, not the element type. - CLEARED is as for store_constructor. + ALIGN and CLEARED are as for store_constructor. This provides a recursive shortcut back to store_constructor when it isn't necessary to go through store_field. This is so that we can pass through @@ -3934,11 +3942,12 @@ mostly_zeros_p (exp) static void store_constructor_field (target, bitsize, bitpos, - mode, exp, type, cleared) + mode, exp, type, align, cleared) rtx target; int bitsize, bitpos; enum machine_mode mode; tree exp, type; + int align; int cleared; { if (TREE_CODE (exp) == CONSTRUCTOR @@ -3952,22 +3961,24 @@ store_constructor_field (target, bitsize, bitpos, target = change_address (target, VOIDmode, plus_constant (XEXP (target, 0), bitpos / BITS_PER_UNIT)); - store_constructor (exp, target, cleared); + store_constructor (exp, target, align, cleared); } else - store_field (target, bitsize, bitpos, mode, exp, - VOIDmode, 0, TYPE_ALIGN (type) / BITS_PER_UNIT, - int_size_in_bytes (type), 0); + store_field (target, bitsize, bitpos, mode, exp, VOIDmode, 0, + (align + BITS_PER_UNIT - 1) / BITS_PER_UNIT, + int_size_in_bytes (type), cleared); } /* Store the value of constructor EXP into the rtx TARGET. TARGET is either a REG or a MEM. + ALIGN is the maximum known alignment for TARGET, in bits. CLEARED is true if TARGET is known to have been zero'd. */ static void -store_constructor (exp, target, cleared) +store_constructor (exp, target, align, cleared) tree exp; rtx target; + int align; int cleared; { tree type = TREE_TYPE (exp); @@ -4021,7 +4032,7 @@ store_constructor (exp, target, cleared) { if (! cleared) clear_storage (target, expr_size (exp), - TYPE_ALIGN (type) / BITS_PER_UNIT); + (align + BITS_PER_UNIT - 1) / BITS_PER_UNIT); cleared = 1; } @@ -4035,7 +4046,9 @@ store_constructor (exp, target, cleared) for (elt = CONSTRUCTOR_ELTS (exp); elt; elt = TREE_CHAIN (elt)) { register tree field = TREE_PURPOSE (elt); +#ifdef WORD_REGISTER_OPERATIONS tree value = TREE_VALUE (elt); +#endif register enum machine_mode mode; int bitsize; int bitpos = 0; @@ -4097,8 +4110,10 @@ store_constructor (exp, target, cleared) to_rtx = change_address (to_rtx, VOIDmode, gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0), - force_reg (ptr_mode, offset_rtx))); + force_reg (ptr_mode, + offset_rtx))); } + if (TREE_READONLY (field)) { if (GET_CODE (to_rtx) == MEM) @@ -4135,8 +4150,11 @@ store_constructor (exp, target, cleared) mode = word_mode; } #endif - store_constructor_field (to_rtx, bitsize, bitpos, - mode, value, type, cleared); + store_constructor_field (to_rtx, bitsize, bitpos, mode, + TREE_VALUE (elt), type, + MIN (align, + DECL_ALIGN (TREE_PURPOSE (elt))), + cleared); } } else if (TREE_CODE (type) == ARRAY_TYPE) @@ -4196,7 +4214,7 @@ store_constructor (exp, target, cleared) { if (! cleared) clear_storage (target, expr_size (exp), - TYPE_ALIGN (type) / BITS_PER_UNIT); + (align + BITS_PER_UNIT - 1) / BITS_PER_UNIT); cleared = 1; } else @@ -4215,6 +4233,7 @@ store_constructor (exp, target, cleared) int bitpos; int unsignedp; tree value = TREE_VALUE (elt); + int align = TYPE_ALIGN (TREE_TYPE (value)); tree index = TREE_PURPOSE (elt); rtx xtarget = target; @@ -4250,8 +4269,8 @@ store_constructor (exp, target, cleared) for (; lo <= hi; lo++) { bitpos = lo * TREE_INT_CST_LOW (TYPE_SIZE (elttype)); - store_constructor_field (target, bitsize, bitpos, - mode, value, type, cleared); + store_constructor_field (target, bitsize, bitpos, mode, + value, type, align, cleared); } } else @@ -4290,7 +4309,7 @@ store_constructor (exp, target, cleared) addr = gen_rtx_PLUS (Pmode, XEXP (target, 0), pos_rtx); xtarget = change_address (target, mode, addr); if (TREE_CODE (value) == CONSTRUCTOR) - store_constructor (value, xtarget, cleared); + store_constructor (value, xtarget, align, cleared); else store_expr (value, xtarget, 0); @@ -4337,8 +4356,8 @@ store_constructor (exp, target, cleared) * TREE_INT_CST_LOW (TYPE_SIZE (elttype))); else bitpos = (i * TREE_INT_CST_LOW (TYPE_SIZE (elttype))); - store_constructor_field (target, bitsize, bitpos, - mode, value, type, cleared); + store_constructor_field (target, bitsize, bitpos, mode, value, + type, align, cleared); } } } @@ -5641,6 +5660,7 @@ expand_expr (exp, target, tmode, modifier) label_rtx (exp), forced_labels); } + temp = gen_rtx_MEM (FUNCTION_MODE, gen_rtx_LABEL_REF (Pmode, label_rtx (exp))); if (function != current_function_decl @@ -6171,7 +6191,7 @@ expand_expr (exp, target, tmode, modifier) RTX_UNCHANGING_P (target) = 1; } - store_constructor (exp, target, 0); + store_constructor (exp, target, TYPE_ALIGN (TREE_TYPE (exp)), 0); return target; } @@ -6475,7 +6495,8 @@ expand_expr (exp, target, tmode, modifier) op0 = change_address (op0, VOIDmode, gen_rtx_PLUS (ptr_mode, XEXP (op0, 0), - force_reg (ptr_mode, offset_rtx))); + force_reg (ptr_mode, + offset_rtx))); } /* Don't forget about volatility even if this is a bitfield. */ @@ -6486,8 +6507,7 @@ expand_expr (exp, target, tmode, modifier) } /* Check the access. */ - if (current_function && current_function_check_memory_usage - && GET_CODE (op0) == MEM) + if (current_function_check_memory_usage && GET_CODE (op0) == MEM) { enum memory_use_mode memory_usage; memory_usage = get_memory_usage_from_modifier (modifier); @@ -7092,19 +7112,23 @@ expand_expr (exp, target, tmode, modifier) /* Apply distributive law if OP0 is x+c. */ if (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 1)) == CONST_INT) - return gen_rtx_PLUS (mode, - gen_rtx_MULT (mode, XEXP (op0, 0), - GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))), - GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)) - * INTVAL (XEXP (op0, 1)))); + return + gen_rtx_PLUS + (mode, + gen_rtx_MULT + (mode, XEXP (op0, 0), + GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))), + GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)) + * INTVAL (XEXP (op0, 1)))); if (GET_CODE (op0) != REG) op0 = force_operand (op0, NULL_RTX); if (GET_CODE (op0) != REG) op0 = copy_to_mode_reg (mode, op0); - return gen_rtx_MULT (mode, op0, - GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))); + return + gen_rtx_MULT (mode, op0, + GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))); } if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1)) @@ -7974,10 +7998,9 @@ expand_expr (exp, target, tmode, modifier) op0 = protect_from_queue (op0, 0); - /* We would like the object in memory. If it is a constant, - we can have it be statically allocated into memory. For - a non-constant (REG, SUBREG or CONCAT), we need to allocate some - memory and store the value into it. */ + /* We would like the object in memory. If it is a constant, we can + have it be statically allocated into memory. For a non-constant, + we need to allocate some memory and store the value into it. */ if (CONSTANT_P (op0)) op0 = force_const_mem (TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))), diff --git a/gcc/expr.h b/gcc/expr.h index 958412e6c98..cea80725e3a 100644 --- a/gcc/expr.h +++ b/gcc/expr.h @@ -945,7 +945,7 @@ extern rtx clear_storage PROTO((rtx, rtx, int)); extern rtx emit_move_insn PROTO((rtx, rtx)); /* Emit insns to set X from Y, with no frills. */ -extern rtx emit_move_insn_1 PROTO ((rtx, rtx)); +extern rtx emit_move_insn_1 PROTO((rtx, rtx)); /* Push a block of length SIZE (perhaps variable) and return an rtx to address the beginning of the block. */ diff --git a/gcc/extend.texi b/gcc/extend.texi index a8ebfc8e152..8a3a7e725c9 100644 --- a/gcc/extend.texi +++ b/gcc/extend.texi @@ -1,4 +1,4 @@ -@c Copyright (C) 1988,89,92,93,94,96,99 Free Software Foundation, Inc. +@c Copyright (C) 1988,89,92,93,94,96,98, 99 Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @@ -114,6 +114,7 @@ C++ Language}, for extensions that apply @emph{only} to C++. function. * Return Address:: Getting the return or frame address of a function. * Deprecated Features:: Things might disappear from g++. +* Other Builtins:: Other built-in functions. @end menu @end ifclear @@ -811,7 +812,8 @@ them as a single variable with a complex type. @node Hex Floats @section Hex Floats @cindex hex floats -GNU CC recognizes floating-point numbers written not only in the usual + +GNU CC recognizes floating-point numbers writen not only in the usual decimal notation, such as @code{1.55e1}, but also numbers such as @code{0x1.fp3} written in hexadecimal format. In that format the @code{0x} hex introducer and the @code{p} or @code{P} exponent field are @@ -1555,16 +1557,19 @@ Not all target machines support this attribute. @item no_check_memory_usage @cindex @code{no_check_memory_usage} function attribute -If @samp{-fcheck-memory-usage} is given, calls to support routines will -be generated before most memory accesses, to permit support code to -record usage and detect uses of uninitialized or unallocated storage. -Since the compiler cannot handle them properly, @code{asm} statements -are not allowed. Declaring a function with this attribute disables the +The @code{no_check_memory_usage} attribute causes GNU CC to omit checks +of memory references when it generates code for that function. Normally +if you specify @samp{-fcheck-memory-usage} (see @pxref{Code Gen +Options}), GNU CC generates calls to support routines before most memory +accesses to permit support code to record usage and detect uses of +uninitialized or unallocated storage. Since GNU CC cannot handle +@code{asm} statements properly they are not allowed in such functions. +If you declare a function with this attribute, GNU CC will not generate memory checking code for that function, permitting the use of @code{asm} -statements without requiring separate compilation with different -options, and allowing you to write support routines of your own if you -wish, without getting infinite recursion if they get compiled with this -option. +statements without having to compile that function with different +options. This also allows you to write support routines of your own if +you wish, without getting infinite recursion if they get compiled with +@code{-fcheck-memory-usage}. @item regparm (@var{number}) @cindex functions that are passed arguments in registers on the 386 @@ -2445,13 +2450,15 @@ asm volatile ("movc3 %0,%1,%2" : "r0", "r1", "r2", "r3", "r4", "r5"); @end example -It is an error for a clobber description to overlap an input or output -operand (for example, an operand describing a register class with one -member, mentioned in the clobber list). Most notably, it is invalid to -describe that an input operand is modified, but unused as output. It has -to be specified as an input and output operand anyway. Note that if there -are only unused output operands, you will then also need to specify -@code{volatile} for the @code{asm} construct, as described below. +You may not write a clobber description in a way that overlaps with an +input or output operand. For example, you may not have an operand +describing a register class with one member if you mention that register +in the clobber list. There is no way for you to specify that an input +operand is modified without also specifying it as an output +operand. Note that if all the output operands you specify are for this +purpose (and hence unused), you will then also need to specify +@code{volatile} for the @code{asm} construct, as described below, to +prevent GNU CC from deleting the @code{asm} statement as unused. If you refer to a particular hardware register from the assembler code, you will probably have to list the register after the third colon to diff --git a/gcc/final.c b/gcc/final.c index 1c7ee3c0fed..706a308fa21 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -425,9 +425,11 @@ end_final (filename) if (write_symbols != NO_DEBUG && profile_block_flag) { ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 5); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1); + assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), + pointer_bytes, 1); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 6); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1); + assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), + pointer_bytes, 1); } else { diff --git a/gcc/flow.c b/gcc/flow.c index 92ab49a172a..9ee464022a3 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -134,6 +134,7 @@ Boston, MA 02111-1307, USA. */ #include "insn-flags.h" #include "obstack.h" + #define obstack_chunk_alloc xmalloc #define obstack_chunk_free free @@ -4450,6 +4451,14 @@ print_rtl_with_bb (outf, rtx_first) putc ('\n', outf); } } + + if (current_function_epilogue_delay_list != 0) + { + fprintf (outf, "\n;; Insns in epilogue delay list:\n\n"); + for (tmp_rtx = current_function_epilogue_delay_list; tmp_rtx != 0; + tmp_rtx = XEXP (tmp_rtx, 1)) + print_rtl_single (outf, XEXP (tmp_rtx, 0)); + } } diff --git a/gcc/fold-const.c b/gcc/fold-const.c index f7dc9cb53e8..d3a7696413d 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3603,7 +3603,7 @@ fold_range_test (exp) TREE_TYPE (exp), TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1)); - else if (current_function_decl != 0 + else if (global_bindings_p () == 0 && ! contains_placeholder_p (lhs)) { tree common = save_expr (lhs); @@ -4352,7 +4352,7 @@ fold (expr) && (TREE_CODE (arg0) != COND_EXPR || count_cond (arg0, 25) + count_cond (arg1, 25) <= 25) && (! TREE_SIDE_EFFECTS (arg0) - || (current_function_decl != 0 + || (global_bindings_p () == 0 && ! contains_placeholder_p (arg0)))) { tree test, true_value, false_value; @@ -4387,7 +4387,7 @@ fold (expr) in that case. */ if (TREE_CODE (arg0) != SAVE_EXPR && ! TREE_CONSTANT (arg0) - && current_function_decl != 0 + && global_bindings_p () == 0 && ((TREE_CODE (arg0) != VAR_DECL && TREE_CODE (arg0) != PARM_DECL) || TREE_SIDE_EFFECTS (arg0))) @@ -4427,7 +4427,7 @@ fold (expr) && (TREE_CODE (arg1) != COND_EXPR || count_cond (arg0, 25) + count_cond (arg1, 25) <= 25) && (! TREE_SIDE_EFFECTS (arg1) - || (current_function_decl != 0 + || (global_bindings_p () == 0 && ! contains_placeholder_p (arg1)))) { tree test, true_value, false_value; @@ -4448,7 +4448,7 @@ fold (expr) } if (TREE_CODE (arg1) != SAVE_EXPR && ! TREE_CONSTANT (arg0) - && current_function_decl != 0 + && global_bindings_p () == 0 && ((TREE_CODE (arg1) != VAR_DECL && TREE_CODE (arg1) != PARM_DECL) || TREE_SIDE_EFFECTS (arg1))) @@ -5072,7 +5072,7 @@ fold (expr) if (real_onep (arg1)) return non_lvalue (convert (type, arg0)); /* x*2 is x+x */ - if (! wins && real_twop (arg1) && current_function_decl != 0 + if (! wins && real_twop (arg1) && global_bindings_p () == 0 && ! contains_placeholder_p (arg0)) { tree arg = save_expr (arg0); @@ -6582,13 +6582,12 @@ fold (expr) } /* switch (code) */ } -/* Determine if first argument is a multiple of second argument. - Return 0 if it is not, or is not easily determined to so be. +/* Determine if first argument is a multiple of second argument. Return 0 if + it is not, or we cannot easily determined it to be. - An example of the sort of thing we care about (at this point -- - this routine could surely be made more general, and expanded - to do what the *_DIV_EXPR's fold() cases do now) is discovering - that + An example of the sort of thing we care about (at this point; this routine + could surely be made more general, and expanded to do what the *_DIV_EXPR's + fold cases do now) is discovering that SAVE_EXPR (I) * SAVE_EXPR (J * 8) @@ -6596,40 +6595,27 @@ fold (expr) SAVE_EXPR (J * 8) - when we know that the two `SAVE_EXPR (J * 8)' nodes are the - same node (which means they will have the same value at run - time, even though we don't know when they'll be assigned). + when we know that the two SAVE_EXPR (J * 8) nodes are the same node. This code also handles discovering that SAVE_EXPR (I) * SAVE_EXPR (J * 8) - is a multiple of - - 8 - - (of course) so we don't have to worry about dealing with a + is a multiple of 8 so we don't have to worry about dealing with a possible remainder. - Note that we _look_ inside a SAVE_EXPR only to determine - how it was calculated; it is not safe for fold() to do much - of anything else with the internals of a SAVE_EXPR, since - fold() cannot know when it will be evaluated at run time. - For example, the latter example above _cannot_ be implemented - as - - SAVE_EXPR (I) * J - - or any variant thereof, since the value of J at evaluation time - of the original SAVE_EXPR is not necessarily the same at the time - the new expression is evaluated. The only optimization of this + Note that we *look* inside a SAVE_EXPR only to determine how it was + calculated; it is not safe for fold to do much of anything else with the + internals of a SAVE_EXPR, since it cannot know when it will be evaluated + at run time. For example, the latter example above *cannot* be implemented + as SAVE_EXPR (I) * J or any variant thereof, since the value of J at + evaluation time of the original SAVE_EXPR is not necessarily the same at + the time the new expression is evaluated. The only optimization of this sort that would be valid is changing SAVE_EXPR (I) * SAVE_EXPR (SAVE_EXPR (J) * 8) - divided by - 8 - to + divided by 8 to SAVE_EXPR (I) * SAVE_EXPR (J) @@ -6660,12 +6646,14 @@ multiple_of_p (type, top, bottom) && multiple_of_p (type, TREE_OPERAND (top, 1), bottom)); case NOP_EXPR: - /* Punt if conversion from non-integral or wider integral type. */ + /* Can't handle conversions from non-integral or wider integral type. */ if ((TREE_CODE (TREE_TYPE (TREE_OPERAND (top, 0))) != INTEGER_TYPE) || (TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (top, 0))))) return 0; - /* Fall through. */ + + /* .. fall through ... */ + case SAVE_EXPR: return multiple_of_p (type, TREE_OPERAND (top, 0), bottom); @@ -6681,4 +6669,3 @@ multiple_of_p (type, top, bottom) return 0; } } - diff --git a/gcc/function.c b/gcc/function.c index 960b660eca9..320c0944176 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1419,7 +1419,7 @@ find_fixup_replacement (replacements, x) struct fixup_replacement *p; /* See if we have already replaced this. */ - for (p = *replacements; p && p->old != x; p = p->next) + for (p = *replacements; p != 0 && ! rtx_equal_p (p->old, x); p = p->next) ; if (p == 0) @@ -2045,7 +2045,8 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements) pos %= GET_MODE_BITSIZE (wanted_mode); newmem = gen_rtx_MEM (wanted_mode, - plus_constant (XEXP (tem, 0), offset)); + plus_constant (XEXP (tem, 0), + offset)); RTX_UNCHANGING_P (newmem) = RTX_UNCHANGING_P (tem); MEM_COPY_ATTRIBUTES (newmem, tem); @@ -2693,12 +2694,22 @@ purge_addressof_1 (loc, insn, force, store, ht) code = GET_CODE (x); - if (code == ADDRESSOF && GET_CODE (XEXP (x, 0)) == MEM) + /* If we don't return in any of the cases below, we will recurse inside + the RTX, which will normally result in any ADDRESSOF being forced into + memory. */ + if (code == SET) + { + purge_addressof_1 (&SET_DEST (x), insn, force, 1, ht); + purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht); + return; + } + + else if (code == ADDRESSOF && GET_CODE (XEXP (x, 0)) == MEM) { - rtx insns; /* We must create a copy of the rtx because it was created by overwriting a REG rtx which is always shared. */ rtx sub = copy_rtx (XEXP (XEXP (x, 0), 0)); + rtx insns; if (validate_change (insn, loc, sub, 0) || validate_replace_rtx (x, sub, insn)) @@ -2715,6 +2726,7 @@ purge_addressof_1 (loc, insn, force, store, ht) emit_insn_before (insns, insn); return; } + else if (code == MEM && GET_CODE (XEXP (x, 0)) == ADDRESSOF && ! force) { rtx sub = XEXP (XEXP (x, 0), 0); @@ -2727,13 +2739,9 @@ purge_addressof_1 (loc, insn, force, store, ht) RTX_UNCHANGING_P (sub2) = RTX_UNCHANGING_P (sub); sub = sub2; } - - if (GET_CODE (sub) == REG - && (MEM_VOLATILE_P (x) || GET_MODE (x) == BLKmode)) - { - put_addressof_into_stack (XEXP (x, 0), ht); - return; - } + else if (GET_CODE (sub) == REG + && (MEM_VOLATILE_P (x) || GET_MODE (x) == BLKmode)) + ; else if (GET_CODE (sub) == REG && GET_MODE (x) != GET_MODE (sub)) { int size_x, size_sub; @@ -2890,6 +2898,7 @@ purge_addressof_1 (loc, insn, force, store, ht) return; } } + else if (validate_change (insn, loc, sub, 0)) { /* Remember the replacement so that the same one can be done @@ -2917,6 +2926,7 @@ purge_addressof_1 (loc, insn, force, store, ht) give_up:; /* else give up and put it into the stack */ } + else if (code == ADDRESSOF) { put_addressof_into_stack (x, ht); @@ -5925,7 +5935,8 @@ expand_function_start (subr, parms_have_cleanups) last_ptr = plus_constant (last_ptr, - GET_MODE_SIZE (Pmode)); #endif last_ptr = copy_to_reg (gen_rtx_MEM (Pmode, - memory_address (Pmode, last_ptr))); + memory_address (Pmode, + last_ptr))); /* If we are not optimizing, ensure that we know that this piece of context is live over the entire function. */ diff --git a/gcc/gansidecl.h b/gcc/gansidecl.h index cf7762fad6a..0923eb1b7f1 100644 --- a/gcc/gansidecl.h +++ b/gcc/gansidecl.h @@ -76,6 +76,10 @@ Boston, MA 02111-1307, USA. */ #define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) #endif /* ATTRIBUTE_PRINTF */ +#ifndef NULL +#define NULL 0 +#endif + #define GENERIC_PTR PTR #ifndef NULL_PTR diff --git a/gcc/gcc.c b/gcc/gcc.c index e85b8a9a5ca..1b7638f4ff1 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -30,11 +30,11 @@ and deleting the temporary files at the end. CC recognizes how to compile each input file by suffixes in the file names. Once it knows which kind of compilation to perform, the procedure for compilation is specified by a string called a "spec". */ - + + #include "config.h" #include "system.h" #include <signal.h> - #include "obstack.h" #include "intl.h" #include "prefix.h" diff --git a/gcc/gen-protos.c b/gcc/gen-protos.c index 10850353153..fcec762d06c 100644 --- a/gcc/gen-protos.c +++ b/gcc/gen-protos.c @@ -1,5 +1,5 @@ /* gen-protos.c - massages a list of prototypes, for use by fixproto. - Copyright (C) 1993, 94-96, 1998 Free Software Foundation, Inc. + Copyright (C) 1993, 94-96, 1998, 1999 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the diff --git a/gcc/gencodes.c b/gcc/gencodes.c index 084cfa80d50..23d06787d9c 100644 --- a/gcc/gencodes.c +++ b/gcc/gencodes.c @@ -1,5 +1,4 @@ /* Generate from machine description: - - some macros CODE_FOR_... giving the insn_code_number value for each of the defined standard insn names. Copyright (C) 1987, 1991, 1995, 1998, 1999 Free Software Foundation, Inc. diff --git a/gcc/genconfig.c b/gcc/genconfig.c index 4001774eba3..a40b6b3f05a 100644 --- a/gcc/genconfig.c +++ b/gcc/genconfig.c @@ -42,6 +42,7 @@ static int max_clobbers_per_insn; static int register_constraint_flag; static int have_cc0_flag; static int have_cmove_flag; +static int have_cond_arith_flag; static int have_lo_sum_flag; static int have_peephole_flag; static int have_peephole2_flag; @@ -135,12 +136,21 @@ walk_insn_part (part, recog_p, non_pc_set_src) two arms of the IF_THEN_ELSE are both MATCH_OPERAND. Otherwise, we have some specific IF_THEN_ELSE construct (like the doz instruction on the RS/6000) that can't be used in the general - context we want it for. */ + context we want it for. If the first operand is an arithmetic + operation and the second is a MATCH_OPERNAND, show we have + conditional arithmetic. */ if (recog_p && non_pc_set_src && GET_CODE (XEXP (part, 1)) == MATCH_OPERAND && GET_CODE (XEXP (part, 2)) == MATCH_OPERAND) have_cmove_flag = 1; + else if (recog_p && non_pc_set_src + && (GET_RTX_CLASS (GET_CODE (XEXP (part, 1))) == '1' + || GET_RTX_CLASS (GET_CODE (XEXP (part, 1))) == '2' + || GET_RTX_CLASS (GET_CODE (XEXP (part, 1))) == 'c') + && GET_CODE (XEXP (XEXP (part, 1), 0)) == MATCH_OPERAND + && GET_CODE (XEXP (part, 2)) == MATCH_OPERAND) + have_cond_arith_flag = 1; break; case REG: case CONST_INT: case SYMBOL_REF: @@ -345,6 +355,9 @@ from the machine description file `md'. */\n\n"); if (have_cmove_flag) printf ("#define HAVE_conditional_move\n"); + if (have_cond_arith_flag) + printf ("#define HAVE_conditional_arithmetic\n"); + if (have_lo_sum_flag) printf ("#define HAVE_lo_sum\n"); diff --git a/gcc/genemit.c b/gcc/genemit.c index f9d917e3245..4bdb1513b90 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -401,7 +401,9 @@ gen_insn (insn) } else { - printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d", XVECLEN (insn, 1)); + printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d", + XVECLEN (insn, 1)); + for (i = 0; i < XVECLEN (insn, 1); i++) { printf (",\n\t\t"); diff --git a/gcc/genflags.c b/gcc/genflags.c index b1fa6bb8424..d8dbf8791ed 100644 --- a/gcc/genflags.c +++ b/gcc/genflags.c @@ -1,5 +1,4 @@ /* Generate from machine description: - - some flags HAVE_... saying which simple standard instructions are available for this machine. Copyright (C) 1987, 1991, 1995, 1998, 1999 Free Software Foundation, Inc. diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index 5a3211f64fe..e6d932cbd46 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -62,18 +62,18 @@ struct rtx_definition defs[] = const char *formats[NUM_RTX_CODE]; -static const char *type_from_format PROTO((int)); -static const char *accessor_from_format PROTO((int)); -static int special_format PROTO((const char *)); -static int special_rtx PROTO((int)); -static void find_formats PROTO((void)); -static void gendecl PROTO((FILE *, const char *)); -static void genmacro PROTO((FILE *, int)); -static void gendef PROTO((FILE *, const char *)); -static void genlegend PROTO((FILE *)); -static void genheader PROTO((FILE *)); -static void gencode PROTO((FILE *)); - +static const char *type_from_format PROTO((int)); +static const char *accessor_from_format PROTO((int)); +static int special_format PROTO((const char *)); +static int special_rtx PROTO((int)); +static void find_formats PROTO((void)); +static void gendecl PROTO((const char *)); +static void genmacro PROTO((int)); +static void gendef PROTO((const char *)); +static void genlegend PROTO((void)); +static void genheader PROTO((void)); +static void gencode PROTO((void)); + /* Decode a format letter into a C type string. */ static const char * @@ -83,16 +83,19 @@ type_from_format (c) switch (c) { case 'i': - return "int"; + return "int "; + case 'w': - return "HOST_WIDE_INT"; + return "HOST_WIDE_INT "; + case 's': return "char *"; - case 'e': - case 'u': - return "rtx"; + + case 'e': case 'u': + return "rtx "; + case 'E': - return "rtvec"; + return "rtvec "; case 'b': return "struct bitmap_head_def *"; /* bitmap - typedef not available */ case 't': @@ -112,25 +115,32 @@ accessor_from_format (c) { case 'i': return "XINT"; + case 'w': return "XWINT"; + case 's': return "XSTR"; - case 'e': - case 'u': + + case 'e': case 'u': return "XEXP"; + case 'E': return "XVEC"; + case 'b': return "XBITMAP"; + case 't': return "XTREE"; + default: abort (); } } -/* Return true if a format character doesn't need normal processing. */ +/* Return nonzero if we should ignore FMT, an RTL format, when making + the list of formats we write routines to create. */ static int special_format (fmt) @@ -142,7 +152,9 @@ special_format (fmt) || strchr (fmt, 'n') != 0); } -/* Return true if an rtx requires special processing. */ +/* Return nonzero if the RTL code given by index IDX is one that we should not + generate a gen_RTX_FOO function foo (because that function is present + elsewhere in the compiler. */ static int special_rtx (idx) @@ -154,170 +166,182 @@ special_rtx (idx) || strcmp (defs[idx].enumname, "MEM") == 0); } -/* Fill `formats' with all unique format strings. */ +/* Place a list of all format specifiers we use into the array FORMAT. */ static void find_formats () { int i; - for (i = 0; i < NUM_RTX_CODE; ++i) + for (i = 0; i < NUM_RTX_CODE; i++) { const char **f; if (special_format (defs[i].format)) continue; - for (f = formats; *f ; ++f) + for (f = formats; *f; f++) if (! strcmp (*f, defs[i].format)) break; - if (!*f) + if (*f == 0) *f = defs[i].format; } } -/* Emit a prototype for the rtx generator for a format. */ +/* Write the declarations for the routine to allocate RTL with FORMAT. */ static void -gendecl (f, format) - FILE *f; +gendecl (format) const char *format; { const char *p; - int i; + int i, pos; - fprintf (f, "extern rtx gen_rtx_fmt_%s PROTO((RTX_CODE, enum machine_mode mode", - format); - for (p = format, i = 0; *p ; ++p) + printf ("extern rtx gen_rtx_fmt_%s\tPROTO((RTX_CODE, ", format); + printf ("enum machine_mode mode"); + + /* Write each parameter that is needed and start a new line when the line + would overflow. */ + for (p = format, i = 0, pos = 75; *p != 0; p++) if (*p != '0') - fprintf (f, ", %s arg%d", type_from_format (*p), i++); - fprintf (f, "));\n"); + { + int ourlen = strlen (type_from_format (*p)) + 6 + (i > 9); + + printf (","); + if (pos + ourlen > 76) + printf ("\n\t\t\t\t "), pos = 39; + + printf (" %sarg%d", type_from_format (*p), i++); + pos += ourlen; + } + + printf ("));\n"); } -/* Emit a define mapping an rtx code to the generator for its format. */ +/* Generate macros to generate RTL of code IDX using the functions we + write. */ static void -genmacro (f, idx) - FILE *f; +genmacro (idx) int idx; { const char *p; int i; - fprintf (f, "#define gen_rtx_%s%s(mode", - (special_rtx (idx) ? "raw_" : ""), defs[idx].enumname); + /* We write a macro that defines gen_rtx_RTLCODE to be an equivalent to + gen_rtx_fmt_FORMAT where FORMAT is the RTX_FORMAT of RTLCODE. */ - for (p = defs[idx].format, i = 0; *p ; ++p) + printf ("#define gen_rtx_%s%s(MODE", + special_rtx (idx) ? "raw_" : "", defs[idx].enumname); + + for (p = defs[idx].format, i = 0; *p != 0; p++) if (*p != '0') - fprintf (f, ", arg%d", i++); - fprintf (f, ") "); + printf (", ARG%d", i++); + + printf (") \\\n gen_rtx_fmt_%s (%s, (MODE)", + defs[idx].format, defs[idx].enumname); - fprintf (f, "gen_rtx_fmt_%s(%s,(mode)", defs[idx].format, defs[idx].enumname); - for (p = defs[idx].format, i = 0; *p ; ++p) + for (p = defs[idx].format, i = 0; *p != 0; p++) if (*p != '0') - fprintf (f, ",(arg%d)", i++); - fprintf (f, ")\n"); + printf (", (ARG%d)", i++); + + printf (")\n"); } -/* Emit the implementation for the rtx generator for a format. */ +/* Generate the code for the function to generate RTL whose + format is FORMAT. */ static void -gendef (f, format) - FILE *f; +gendef (format) const char *format; { const char *p; int i, j; - fprintf (f, "rtx\ngen_rtx_fmt_%s (code, mode", format); - for (p = format, i = 0; *p ; ++p) - if (*p != '0') - fprintf (f, ", arg%d", i++); + /* Start by writing the definition of the function name and the types + of the arguments. */ - fprintf (f, ")\n RTX_CODE code;\n enum machine_mode mode;\n"); - for (p = format, i = 0; *p ; ++p) + printf ("rtx\ngen_rtx_fmt_%s (code, mode", format); + for (p = format, i = 0; *p != 0; p++) if (*p != '0') - fprintf (f, " %s arg%d;\n", type_from_format (*p), i++); + printf (", arg%d", i++); - /* See rtx_alloc in rtl.c for comments. */ - fprintf (f, "{\n"); - fprintf (f, " rtx rt;\n"); - fprintf (f, " if (ggc_p)\n"); - fprintf (f, " rt = ggc_alloc_rtx (%d);\n", + printf (")\n RTX_CODE code;\n enum machine_mode mode;\n"); + for (p = format, i = 0; *p != 0; p++) + if (*p != '0') + printf (" %sarg%d;\n", type_from_format (*p), i++); + + /* Now write out the body of the function itself, which allocates + the memory and initializes it. */ + printf ("{\n"); + printf (" rtx rt;\n"); + printf (" if (ggc_p)\n"); + printf (" rt = ggc_alloc_rtx (%d);\n", (int) strlen (format)); - fprintf (f, " else\n"); - fprintf (f, " rt = obstack_alloc_rtx (sizeof (struct rtx_def) + %d * sizeof (rtunion));\n", + printf (" else\n"); + printf (" rt = obstack_alloc_rtx (sizeof (struct rtx_def) + %d * sizeof (rtunion));\n", (int) strlen (format) - 1); - fprintf (f, " PUT_CODE (rt, code);\n"); - fprintf (f, " PUT_MODE (rt, mode);\n"); + printf (" PUT_CODE (rt, code);\n"); + printf (" PUT_MODE (rt, mode);\n"); for (p = format, i = j = 0; *p ; ++p, ++i) if (*p != '0') - { - fprintf (f, " %s (rt, %d) = arg%d;\n", - accessor_from_format (*p), i, j++); - } + printf (" %s (rt, %d) = arg%d;\n", accessor_from_format (*p), i, j++); - fprintf (f, "\n return rt;\n}\n\n"); + printf ("\n return rt;\n}\n\n"); } -/* Emit the `do not edit' banner. */ +/* Generate the documentation header for files we write. */ static void -genlegend (f) - FILE *f; +genlegend () { - fputs ("/* Generated automaticaly by the program `gengenrtl'\n", f); - fputs (" from the RTL description file `rtl.def' */\n\n", f); + printf ("/* Generated automaticaly by the program `gengenrtl'\n"); + printf (" from the RTL description file `rtl.def' */\n\n"); } -/* Emit "genrtl.h". */ +/* Generate the text of the header file we make, genrtl.h. */ static void -genheader (f) - FILE *f; +genheader () { int i; const char **fmt; - + for (fmt = formats; *fmt; ++fmt) - gendecl (f, *fmt); + gendecl (*fmt); - fprintf (f, "\n"); + printf ("\n"); for (i = 0; i < NUM_RTX_CODE; i++) - { - if (special_format (defs[i].format)) - continue; - genmacro (f, i); - } + if (! special_format (defs[i].format)) + genmacro (i); } -/* Emit "genrtl.c". */ +/* Generate the text of the code file we write, genrtl.c. */ static void -gencode (f) - FILE *f; +gencode () { const char **fmt; - fputs ("#include \"config.h\"\n", f); - fputs ("#include \"system.h\"\n", f); - fputs ("#include \"obstack.h\"\n", f); - fputs ("#include \"rtl.h\"\n", f); - fputs ("#include \"ggc.h\"\n\n", f); - fputs ("extern struct obstack *rtl_obstack;\n\n", f); - fputs ("static rtx obstack_alloc_rtx PROTO((int length));\n", f); - fputs ("static rtx obstack_alloc_rtx (length)\n", f); - fputs (" register int length;\n{\n", f); - fputs (" rtx rt = (rtx) obstack_alloc (rtl_obstack, length);\n\n", f); - fputs (" memset(rt, 0, sizeof(struct rtx_def) - sizeof(rtunion));\n\n", f); - fputs (" return rt;\n}\n\n", f); - - for (fmt = formats; *fmt; ++fmt) - gendef (f, *fmt); + puts ("#include \"config.h\"\n"); + puts ("#include \"system.h\"\n"); + puts ("#include \"obstack.h\"\n"); + puts ("#include \"rtl.h\"\n"); + puts ("#include \"ggc.h\"\n\n"); + puts ("extern struct obstack *rtl_obstack;\n\n"); + puts ("static rtx obstack_alloc_rtx PROTO((int length));\n"); + puts ("static rtx obstack_alloc_rtx (length)\n"); + puts (" register int length;\n{\n"); + puts (" rtx rt = (rtx) obstack_alloc (rtl_obstack, length);\n\n"); + puts (" memset(rt, 0, sizeof(struct rtx_def) - sizeof(rtunion));\n\n"); + puts (" return rt;\n}\n\n"); + + for (fmt = formats; *fmt != 0; fmt++) + gendef (*fmt); } #if defined(USE_C_ALLOCA) @@ -338,37 +362,25 @@ xmalloc (nbytes) } #endif /* USE_C_ALLOCA */ +/* This is the main program. We accept only one argument, "-h", which + says we are writing the genrtl.h file. Otherwise we are writing the + genrtl.c file. */ + int -main(argc, argv) +main (argc, argv) int argc; char **argv; { - FILE *f; - - if (argc != 3) - exit (1); - find_formats (); + genlegend (); - f = fopen (argv[1], "w"); - if (f == NULL) - { - perror (argv[1]); - exit (1); - } - genlegend (f); - genheader (f); - fclose (f); - - f = fopen (argv[2], "w"); - if (f == NULL) - { - perror (argv[2]); - exit (1); - } - genlegend (f); - gencode (f); - fclose (f); + if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'h') + genheader (); + else + gencode (); - exit (0); + fflush (stdout); + exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); + /* NOTREACHED */ + return 0; } diff --git a/gcc/halfpic.c b/gcc/halfpic.c index 6233ca9b980..fabc73b0046 100644 --- a/gcc/halfpic.c +++ b/gcc/halfpic.c @@ -1,5 +1,5 @@ /* OSF/rose half-pic support functions. - Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1992, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. diff --git a/gcc/integrate.c b/gcc/integrate.c index 6bcdadbd26e..d5699565a86 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -1647,10 +1647,12 @@ copy_rtx_and_substitute (orig, map) return get_label_from_map (map, CODE_LABEL_NUMBER (orig)); case LABEL_REF: - copy = gen_rtx_LABEL_REF (mode, - LABEL_REF_NONLOCAL_P (orig) ? XEXP (orig, 0) - : get_label_from_map (map, - CODE_LABEL_NUMBER (XEXP (orig, 0)))); + copy + = gen_rtx_LABEL_REF + (mode, + LABEL_REF_NONLOCAL_P (orig) ? XEXP (orig, 0) + : get_label_from_map (map, CODE_LABEL_NUMBER (XEXP (orig, 0)))); + LABEL_OUTSIDE_LOOP_P (copy) = LABEL_OUTSIDE_LOOP_P (orig); /* The fact that this label was previously nonlocal does not mean @@ -1777,10 +1779,13 @@ copy_rtx_and_substitute (orig, map) #ifndef NO_FUNCTION_CSE if (! (optimize && ! flag_no_function_cse)) #endif - return gen_rtx_CALL (GET_MODE (orig), - gen_rtx_MEM (GET_MODE (XEXP (orig, 0)), - copy_rtx_and_substitute (XEXP (XEXP (orig, 0), 0), map)), - copy_rtx_and_substitute (XEXP (orig, 1), map)); + return + gen_rtx_CALL + (GET_MODE (orig), + gen_rtx_MEM (GET_MODE (XEXP (orig, 0)), + copy_rtx_and_substitute (XEXP (XEXP (orig, 0), 0), + map)), + copy_rtx_and_substitute (XEXP (orig, 1), map)); break; #if 0 @@ -1807,6 +1812,7 @@ copy_rtx_and_substitute (orig, map) equiv_loc = VARRAY_CONST_EQUIV (map->const_equiv_varray, REGNO (equiv_reg)).rtx; loc_offset = GET_CODE (equiv_loc) == REG ? 0 : INTVAL (XEXP (equiv_loc, 1)); + return gen_rtx_SET (VOIDmode, SET_DEST (orig), force_operand (plus_constant diff --git a/gcc/invoke.texi b/gcc/invoke.texi index 84184977466..9f87ca9f250 100644 --- a/gcc/invoke.texi +++ b/gcc/invoke.texi @@ -1477,7 +1477,8 @@ unused variables, parameters and labels, use the @samp{unused} attribute (@pxref{Variable Attributes}). @item -Wuninitialized -An automatic variable is used without first being initialized. +Warn if an automatic variable is used without first being initialized or +if a variable may be clobbered by a @code{setjmp} call. These warnings are possible only in optimizing compilation, because they require data flow information that is computed only @@ -1534,7 +1535,8 @@ This has no bug because @code{save_y} is used only if it is set. @cindex @code{longjmp} warnings This option also warns when a nonvolatile automatic variable might be -changed by a call to @code{longjmp}. +changed by a call to @code{longjmp}. These warnings as well are possible +only in optimizing compilation. The compiler sees only the calls to @code{setjmp}. It cannot know where @code{longjmp} will be called; in fact, a signal handler could @@ -1546,6 +1548,12 @@ Some spurious warnings can be avoided if you declare all the functions you use that never return as @code{noreturn}. @xref{Function Attributes}. +@item -Wreorder (C++ only) +@cindex reordering, warning +@cindex warning for reordering of member initializers +Warn when the order of member initializers given in the code does not +match the order in which they must be executed. For instance: + @item -Wunknown-pragmas @cindex warning for unknown pragmas @cindex unknown pragmas, warning @@ -1786,8 +1794,7 @@ because the program does work. Another common use of unreachable code is to provide behaviour which is selectable at compile-time. @item -Winline -Warn if a function can not be inlined, and either it was declared as inline, -or else the @samp{-finline-functions} option was given. +Warn if a function can not be inlined and it was declared as inline. @item -Wlong-long Warn if @samp{long long} type is used. This is default. To inhibit @@ -6636,16 +6643,16 @@ it. @table @code @item -fexceptions Enable exception handling. Generates extra code needed to propagate -exceptions. For some targets, this implies generation of frame unwind -information for all functions. This can produce significant data size -overhead, although it does not affect execution. -If you do not specify this option, it is enabled by -default for languages like C++ which normally require exception handling, -and disabled for languages like C that do not normally require it. -However, when compiling C code that needs to interoperate properly with -exception handlers written in C++, you may need to enable this option. -You may also wish to disable this option is you are compiling older C++ -programs that don't use exception handling. +exceptions. For some targets, this implies GNU CC will generate frame +unwind information for all functions, which can produce significant data +size overhead, although it does not affect execution. If you do not +specify this option, GNU CC will enable it by default for languages like +C++ which normally require exception handling, and disable itfor +languages like C that do not normally require it. However, you may need +to enable this option when compiling C code that needs to interoperate +properly with exception handlers written in C++. You may also wish to +disable this option if you are compiling older C++ programs that don't +use exception handling. @item -fpcc-struct-return Return ``short'' @code{struct} and @code{union} values in memory like @@ -6687,7 +6694,7 @@ shared between processes running the same program, while private data exists in one copy per process. @item -fno-common -Allocate even uninitialized global variables in the bss section of the +Allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks. This has the effect that if the same variable is declared (without @code{extern}) in two different compilations, you will get an error when you link them. @@ -6833,23 +6840,21 @@ stubs for every function you call, you might have to specify @samp{-fcheck-memory-usage} without @samp{-fprefix-function-name}. If you specify this option, you can not use the @code{asm} or -@code{__asm__} keywords in functions with memory checking enabled. The -compiler cannot understand what the @code{asm} statement will do, and -therefore cannot generate the appropriate code, so it is rejected. -However, the function attribute @code{no_check_memory_usage} will -disable memory checking within a function, and @code{asm} statements can -be put inside such functions. Inline expansion of a non-checked -function within a checked function is permitted; the inline function's -memory accesses won't be checked, but the rest will. - -If you move your @code{asm} statements to non-checked inline functions, -but they do access memory, you can add calls to the support code in your +@code{__asm__} keywords in functions with memory checking enabled. GNU +CC cannot understand what the @code{asm} statement may do, and therefore +cannot generate the appropriate code, so it will reject it. However, if +you specify the function attribute @code{no_check_memory_usage} (see +@pxref{Function Attributes}, GNU CC will disable memory checking within a +function; you may use @code{asm} statements inside such functions. You +may have an inline expansion of a non-checked function within a checked +function; in that case GNU CC will not generate checks for the inlined +function's memory accesses. + +If you move your @code{asm} statements to non-checked inline functions +and they do access memory, you can add calls to the support code in your inline function, to indicate any reads, writes, or copies being done. These calls would be similar to those done in the stubs described above. -@c FIXME: The support-routine interface is defined by the compiler and -@c should be documented! - @item -fprefix-function-name Request GCC to add a prefix to the symbols generated for function names. GCC adds a prefix to the names of functions defined as well as diff --git a/gcc/java/parse-scan.c b/gcc/java/parse-scan.c index 8ade4994a83..7090771ae11 100644 --- a/gcc/java/parse-scan.c +++ b/gcc/java/parse-scan.c @@ -1378,7 +1378,7 @@ static const short yycheck[] = { 3, #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/local/gnu/share/bison.simple" +#line 3 "/usr/cygnus/TBD-TBD/share/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -1571,7 +1571,7 @@ __yy_memcpy (char *to, char *from, int count) #endif #endif -#line 196 "/usr/local/gnu/share/bison.simple" +#line 196 "/usr/cygnus/TBD-TBD/share/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 *. @@ -2159,7 +2159,7 @@ case 337: break;} } /* the action file gets copied in in place of this dollarsign */ -#line 498 "/usr/local/gnu/share/bison.simple" +#line 498 "/usr/cygnus/TBD-TBD/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; diff --git a/gcc/jump.c b/gcc/jump.c index 098e2d4dd7a..4e57df5c02c 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -230,7 +230,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) last_insn = delete_unreferenced_labels (f); - if (!optimize) + if (optimize == 0) { /* CAN_REACH_END is persistent for each function. Once set it should not be cleared. This is especially true for the case where we @@ -314,20 +314,6 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) int this_is_simplejump, this_is_condjump, reversep = 0; int this_is_condjump_in_parallel; -#if 0 - /* If NOT the first iteration, if this is the last jump pass - (just before final), do the special peephole optimizations. - Avoiding the first iteration gives ordinary jump opts - a chance to work before peephole opts. */ - - if (reload_completed && !first && !flag_no_peephole) - if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN) - peephole (insn); -#endif - - /* That could have deleted some insns after INSN, so check now - what the following insn is. */ - next = NEXT_INSN (insn); /* See if this is a NOTE_INSN_LOOP_BEG followed by an unconditional @@ -362,6 +348,11 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) if (GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC) changed |= tension_vector_labels (PATTERN (insn), 1); + /* See if this jump goes to another jump and redirect if so. */ + nlabel = follow_jumps (JUMP_LABEL (insn)); + if (nlabel != JUMP_LABEL (insn)) + changed |= redirect_jump (insn, nlabel); + /* If a dispatch table always goes to the same place, get rid of it and replace the insn that uses it. */ @@ -394,18 +385,18 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) } } - reallabelprev = prev_active_insn (JUMP_LABEL (insn)); - /* If a jump references the end of the function, try to turn it into a RETURN insn, possibly a conditional one. */ - if (JUMP_LABEL (insn) + if (JUMP_LABEL (insn) != 0 && (next_active_insn (JUMP_LABEL (insn)) == 0 || GET_CODE (PATTERN (next_active_insn (JUMP_LABEL (insn)))) == RETURN)) changed |= redirect_jump (insn, NULL_RTX); + reallabelprev = prev_active_insn (JUMP_LABEL (insn)); + /* Detect jump to following insn. */ - if (reallabelprev == insn && condjump_p (insn)) + if (reallabelprev == insn && this_is_condjump) { next = next_real_insn (JUMP_LABEL (insn)); delete_jump (insn); @@ -413,6 +404,81 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) continue; } + /* Detect a conditional jump going to the same place + as an immediately following unconditional jump. */ + else if (this_is_condjump + && (temp = next_active_insn (insn)) != 0 + && simplejump_p (temp) + && (next_active_insn (JUMP_LABEL (insn)) + == next_active_insn (JUMP_LABEL (temp)))) + { + /* Don't mess up test coverage analysis. */ + temp2 = temp; + if (flag_test_coverage && !reload_completed) + for (temp2 = insn; temp2 != temp; temp2 = NEXT_INSN (temp2)) + if (GET_CODE (temp2) == NOTE && NOTE_LINE_NUMBER (temp2) > 0) + break; + + if (temp2 == temp) + { + delete_jump (insn); + changed = 1; + continue; + } + } + + /* Detect a conditional jump jumping over an unconditional jump. */ + + else if ((this_is_condjump || this_is_condjump_in_parallel) + && ! this_is_simplejump + && reallabelprev != 0 + && GET_CODE (reallabelprev) == JUMP_INSN + && prev_active_insn (reallabelprev) == insn + && no_labels_between_p (insn, reallabelprev) + && simplejump_p (reallabelprev)) + { + /* When we invert the unconditional jump, we will be + decrementing the usage count of its old label. + Make sure that we don't delete it now because that + might cause the following code to be deleted. */ + rtx prev_uses = prev_nonnote_insn (reallabelprev); + rtx prev_label = JUMP_LABEL (insn); + + if (prev_label) + ++LABEL_NUSES (prev_label); + + if (invert_jump (insn, JUMP_LABEL (reallabelprev))) + { + /* It is very likely that if there are USE insns before + this jump, they hold REG_DEAD notes. These REG_DEAD + notes are no longer valid due to this optimization, + and will cause the life-analysis that following passes + (notably delayed-branch scheduling) to think that + these registers are dead when they are not. + + To prevent this trouble, we just remove the USE insns + from the insn chain. */ + + while (prev_uses && GET_CODE (prev_uses) == INSN + && GET_CODE (PATTERN (prev_uses)) == USE) + { + rtx useless = prev_uses; + prev_uses = prev_nonnote_insn (prev_uses); + delete_insn (useless); + } + + delete_insn (reallabelprev); + changed = 1; + } + + /* We can now safely delete the label if it is unreferenced + since the delete_insn above has deleted the BARRIER. */ + if (prev_label && --LABEL_NUSES (prev_label) == 0) + delete_insn (prev_label); + + next = NEXT_INSN (insn); + } + /* If we have an unconditional jump preceded by a USE, try to put the USE before the target and jump there. This simplifies many of the optimizations below since we don't have to worry about @@ -420,21 +486,22 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) being branch to already has the identical USE or if code never falls through to that label. */ - if (this_is_simplejump - && (temp = prev_nonnote_insn (insn)) != 0 - && GET_CODE (temp) == INSN && GET_CODE (PATTERN (temp)) == USE - && (temp1 = prev_nonnote_insn (JUMP_LABEL (insn))) != 0 - && (GET_CODE (temp1) == BARRIER - || (GET_CODE (temp1) == INSN - && rtx_equal_p (PATTERN (temp), PATTERN (temp1)))) - /* Don't do this optimization if we have a loop containing only - the USE instruction, and the loop start label has a usage - count of 1. This is because we will redo this optimization - everytime through the outer loop, and jump opt will never - exit. */ - && ! ((temp2 = prev_nonnote_insn (temp)) != 0 - && temp2 == JUMP_LABEL (insn) - && LABEL_NUSES (temp2) == 1)) + else if (this_is_simplejump + && (temp = prev_nonnote_insn (insn)) != 0 + && GET_CODE (temp) == INSN + && GET_CODE (PATTERN (temp)) == USE + && (temp1 = prev_nonnote_insn (JUMP_LABEL (insn))) != 0 + && (GET_CODE (temp1) == BARRIER + || (GET_CODE (temp1) == INSN + && rtx_equal_p (PATTERN (temp), PATTERN (temp1)))) + /* Don't do this optimization if we have a loop containing + only the USE instruction, and the loop start label has + a usage count of 1. This is because we will redo this + optimization everytime through the outer loop, and jump + opt will never exit. */ + && ! ((temp2 = prev_nonnote_insn (temp)) != 0 + && temp2 == JUMP_LABEL (insn) + && LABEL_NUSES (temp2) == 1)) { if (GET_CODE (temp1) == BARRIER) { @@ -446,6 +513,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) redirect_jump (insn, get_label_before (temp1)); reallabelprev = prev_real_insn (temp1); changed = 1; + next = NEXT_INSN (insn); } /* Simplify if (...) x = a; else x = b; by converting it @@ -587,6 +655,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) redirect_jump (p, target); changed = 1; + next = NEXT_INSN (insn); continue; } } @@ -683,7 +752,8 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) continue; } -#ifndef HAVE_cc0 +#if !defined(HAVE_cc0) && !defined(HAVE_conditional_arithmetic) + /* If we have if (...) x = exp; and branches are expensive, EXP is a single insn, does not have any side effects, cannot trap, and is not too costly, convert this to @@ -694,6 +764,10 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) the potential for conflicts. We also can't do this when we have notes on the insn for the same reason as above. + If we have conditional arithmetic, this will make this + harder to optimize later and isn't needed, so don't do it + in that case either. + We set: TEMP to the "x = exp;" insn. @@ -865,8 +939,127 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) } #endif /* HAVE_cc0 */ +#ifdef HAVE_conditional_arithmetic + /* See if this is a conditional jump around a small number of + instructions that we can conditionalize. Don't do this before + the initial CSE pass or after reload. + + We reject any insns that have side effects or may trap. + Strictly speaking, this is not needed since the machine may + support conditionalizing these too, but we won't deal with that + now. Specifically, this means that we can't conditionalize a + CALL_INSN, which some machines, such as the ARC, can do, but + this is a very minor optimization. */ + if (this_is_condjump && ! this_is_simplejump + && cse_not_expected && optimize > 0 && ! reload_completed + && BRANCH_COST > 2 + && can_reverse_comparison_p (XEXP (SET_SRC (PATTERN (insn)), 0), + insn)) + { + rtx ourcond = XEXP (SET_SRC (PATTERN (insn)), 0); + int num_insns = 0; + char *storage = (char *) oballoc (0); + int last_insn = 0, failed = 0; + rtx changed_jump = 0; + + ourcond = gen_rtx (reverse_condition (GET_CODE (ourcond)), + VOIDmode, XEXP (ourcond, 0), + XEXP (ourcond, 1)); + + /* Scan forward BRANCH_COST real insns looking for the JUMP_LABEL + of this insn. We see if we think we can conditionalize the + insns we pass. For now, we only deal with insns that have + one SET. We stop after an insn that modifies anything in + OURCOND, if we have too many insns, or if we have an insn + with a side effect or that may trip. Note that we will + be modifying any unconditional jumps we encounter to be + conditional; this will have the effect of also doing this + optimization on the "else" the next time around. */ + for (temp1 = NEXT_INSN (insn); + num_insns <= BRANCH_COST && ! failed && temp1 != 0 + && GET_CODE (temp1) != CODE_LABEL; + temp1 = NEXT_INSN (temp1)) + { + /* Ignore everything but an active insn. */ + if (GET_RTX_CLASS (GET_CODE (temp1)) != 'i' + || GET_CODE (PATTERN (temp1)) == USE + || GET_CODE (PATTERN (temp1)) == CLOBBER) + continue; + + /* If this was an unconditional jump, record it since we'll + need to remove the BARRIER if we succeed. We can only + have one such jump since there must be a label after + the BARRIER and it's either ours, in which case it's the + only one or some other, in which case we'd fail. */ + + if (simplejump_p (temp1)) + changed_jump = temp1; + + /* See if we are allowed another insn and if this insn + if one we think we may be able to handle. */ + if (++num_insns > BRANCH_COST + || last_insn + || (temp2 = single_set (temp1)) == 0 + || side_effects_p (SET_SRC (temp2)) + || may_trap_p (SET_SRC (temp2))) + failed = 1; + else + validate_change (temp1, &SET_SRC (temp2), + gen_rtx_IF_THEN_ELSE + (GET_MODE (SET_DEST (temp2)), + copy_rtx (ourcond), + SET_SRC (temp2), SET_DEST (temp2)), + 1); + + if (modified_in_p (ourcond, temp1)) + last_insn = 1; + } + + /* If we've reached our jump label, haven't failed, and all + the changes above are valid, we can delete this jump + insn. Also remove a BARRIER after any jump that used + to be unconditional and remove any REG_EQUAL or REG_EQUIV + that might have previously been present on insns we + made conditional. */ + if (temp1 == JUMP_LABEL (insn) && ! failed + && apply_change_group ()) + { + for (temp1 = NEXT_INSN (insn); temp1 != JUMP_LABEL (insn); + temp1 = NEXT_INSN (temp1)) + if (GET_RTX_CLASS (GET_CODE (temp1)) == 'i') + for (temp2 = REG_NOTES (temp1); temp2 != 0; + temp2 = XEXP (temp2, 1)) + if (REG_NOTE_KIND (temp2) == REG_EQUAL + || REG_NOTE_KIND (temp2) == REG_EQUIV) + remove_note (temp1, temp2); + + if (changed_jump != 0) + { + if (GET_CODE (NEXT_INSN (changed_jump)) != BARRIER) + abort (); + + delete_insn (NEXT_INSN (changed_jump)); + } + + delete_insn (insn); + changed = 1; + continue; + } + else + { + cancel_changes (0); + obfree (storage); + } + } +#endif + /* Try to use a conditional move (if the target has them), or a - store-flag insn. The general case is: + store-flag insn. If the target has conditional arithmetic as + well as conditional move, the above code will have done something. + Note that we prefer the above code since it is more general: the + code below can make changes that require work to undo. + + The general case here is: 1) x = a; if (...) x = b; and 2) if (...) x = b; @@ -889,6 +1082,11 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) if (/* We can't do this after reload has completed. */ ! reload_completed +#ifdef HAVE_conditional_arithmetic + /* Defer this until after CSE so the above code gets the + first crack at it. */ + && cse_not_expected +#endif && this_is_condjump && ! this_is_simplejump /* Set TEMP to the "x = b;" insn. */ && (temp = next_nonnote_insn (insn)) != 0 @@ -1668,30 +1866,6 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) } } #endif - /* Detect a conditional jump going to the same place - as an immediately following unconditional jump. */ - else if (this_is_condjump - && (temp = next_active_insn (insn)) != 0 - && simplejump_p (temp) - && (next_active_insn (JUMP_LABEL (insn)) - == next_active_insn (JUMP_LABEL (temp)))) - { - rtx tem = temp; - - /* ??? Optional. Disables some optimizations, but makes - gcov output more accurate with -O. */ - if (flag_test_coverage && !reload_completed) - for (tem = insn; tem != temp; tem = NEXT_INSN (tem)) - if (GET_CODE (tem) == NOTE && NOTE_LINE_NUMBER (tem) > 0) - break; - - if (tem == temp) - { - delete_jump (insn); - changed = 1; - continue; - } - } #ifdef HAVE_trap /* Detect a conditional jump jumping over an unconditional trap. */ else if (HAVE_trap @@ -1765,70 +1939,10 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) } } #endif - - /* Detect a conditional jump jumping over an unconditional jump. */ - - else if ((this_is_condjump || this_is_condjump_in_parallel) - && ! this_is_simplejump - && reallabelprev != 0 - && GET_CODE (reallabelprev) == JUMP_INSN - && prev_active_insn (reallabelprev) == insn - && no_labels_between_p (insn, reallabelprev) - && simplejump_p (reallabelprev)) - { - /* When we invert the unconditional jump, we will be - decrementing the usage count of its old label. - Make sure that we don't delete it now because that - might cause the following code to be deleted. */ - rtx prev_uses = prev_nonnote_insn (reallabelprev); - rtx prev_label = JUMP_LABEL (insn); - - if (prev_label) - ++LABEL_NUSES (prev_label); - - if (invert_jump (insn, JUMP_LABEL (reallabelprev))) - { - /* It is very likely that if there are USE insns before - this jump, they hold REG_DEAD notes. These REG_DEAD - notes are no longer valid due to this optimization, - and will cause the life-analysis that following passes - (notably delayed-branch scheduling) to think that - these registers are dead when they are not. - - To prevent this trouble, we just remove the USE insns - from the insn chain. */ - - while (prev_uses && GET_CODE (prev_uses) == INSN - && GET_CODE (PATTERN (prev_uses)) == USE) - { - rtx useless = prev_uses; - prev_uses = prev_nonnote_insn (prev_uses); - delete_insn (useless); - } - - delete_insn (reallabelprev); - next = insn; - changed = 1; - } - - /* We can now safely delete the label if it is unreferenced - since the delete_insn above has deleted the BARRIER. */ - if (prev_label && --LABEL_NUSES (prev_label) == 0) - delete_insn (prev_label); - continue; - } else { /* Detect a jump to a jump. */ - nlabel = follow_jumps (JUMP_LABEL (insn)); - if (nlabel != JUMP_LABEL (insn) - && redirect_jump (insn, nlabel)) - { - changed = 1; - next = insn; - } - /* Look for if (foo) bar; else break; */ /* The insns look like this: insn = condjump label1; @@ -3227,22 +3341,29 @@ can_reverse_comparison_p (comparison, insn) rtx prev = prev_nonnote_insn (insn); rtx set; - /* If the comparison itself was a loop invariant, it could have been - hoisted out of the loop. If we proceed to unroll such a loop, then - we may not be able to find the comparison when copying the loop. - - Returning zero in that case is the safe thing to do. */ - if (prev == 0) - return 0; - - set = single_set (prev); - if (set == 0 || SET_DEST (set) != arg0) - return 0; - - arg0 = SET_SRC (set); + /* First see if the condition code mode alone if enough to say we can + reverse the condition. If not, then search backwards for a set of + ARG0. We do not need to check for an insn clobbering it since valid + code will contain set a set with no intervening clobber. But + stop when we reach a label. */ +#ifdef REVERSIBLE_CC_MODE + if (GET_MODE_CLASS (GET_MODE (arg0)) == MODE_CC + && REVERSIBLE_CC_MODE (GET_MODE (arg0))) + return 1; +#endif + + for (prev = prev_nonnote_insn (insn); + prev != 0 && GET_CODE (prev) != CODE_LABEL; + prev = prev_nonnote_insn (prev)) + if ((set = single_set (prev)) != 0 + && rtx_equal_p (SET_DEST (set), arg0)) + { + arg0 = SET_SRC (set); - if (GET_CODE (arg0) == COMPARE) - arg0 = XEXP (arg0, 0); + if (GET_CODE (arg0) == COMPARE) + arg0 = XEXP (arg0, 0); + break; + } } /* We can reverse this if ARG0 is a CONST_INT or if its mode is @@ -3477,27 +3598,27 @@ condjump_p (insn) rtx insn; { register rtx x = PATTERN (insn); - if (GET_CODE (x) != SET) - return 0; - if (GET_CODE (SET_DEST (x)) != PC) - return 0; - if (GET_CODE (SET_SRC (x)) == LABEL_REF) - return 1; - if (GET_CODE (SET_SRC (x)) != IF_THEN_ELSE) + + if (GET_CODE (x) != SET + || GET_CODE (SET_DEST (x)) != PC) return 0; - if (XEXP (SET_SRC (x), 2) == pc_rtx - && (GET_CODE (XEXP (SET_SRC (x), 1)) == LABEL_REF - || GET_CODE (XEXP (SET_SRC (x), 1)) == RETURN)) - return 1; - if (XEXP (SET_SRC (x), 1) == pc_rtx - && (GET_CODE (XEXP (SET_SRC (x), 2)) == LABEL_REF - || GET_CODE (XEXP (SET_SRC (x), 2)) == RETURN)) + + x = SET_SRC (x); + if (GET_CODE (x) == LABEL_REF) return 1; + else return (GET_CODE (x) == IF_THEN_ELSE + && ((GET_CODE (XEXP (x, 2)) == PC + && (GET_CODE (XEXP (x, 1)) == LABEL_REF + || GET_CODE (XEXP (x, 1)) == RETURN)) + || (GET_CODE (XEXP (x, 1)) == PC + && (GET_CODE (XEXP (x, 2)) == LABEL_REF + || GET_CODE (XEXP (x, 2)) == RETURN)))); + return 0; } -/* Return nonzero if INSN is a (possibly) conditional jump - and nothing more. */ +/* Return nonzero if INSN is a (possibly) conditional jump inside a + PARALLEL. */ int condjump_in_parallel_p (insn) diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 6d8fb0b77db..6ac41438ecb 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -2077,12 +2077,12 @@ found: ; static void __bb_init_prg () { - FILE *file; char buf[BBINBUFSIZE]; const char *p; const char *pos; enum bb_func_mode m; + int i; #ifdef ON_EXIT /* Initialize destructor. */ @@ -2164,7 +2164,10 @@ __bb_init_prg () bb_hashbuckets = (struct bb_edge **) malloc (BB_BUCKETS * sizeof (struct bb_edge *)); if (bb_hashbuckets) - memset (bb_hashbuckets, 0, BB_BUCKETS * sizeof (struct bb_edge *)); + /* Use a loop here rather than calling bzero to avoid having to + conditionalize its existance. */ + for (i = 0; i < BB_BUCKETS; i++) + bb_hashbuckets[i] = 0; } if (bb_mode & 12) diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index dcee4992c5a..870f7473a19 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -2219,7 +2219,8 @@ requires_inout (p) case '=': case '+': case '?': case '#': case '&': case '!': case '*': case '%': - case '1': case '2': case '3': case '4': + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': case 'm': case '<': case '>': case 'V': case 'o': case 'E': case 'F': case 'G': case 'H': case 's': case 'i': case 'n': diff --git a/gcc/loop.c b/gcc/loop.c index 59628fd4f74..97265faf4a2 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -301,11 +301,11 @@ static void strength_reduce PROTO((rtx, rtx, rtx, int, rtx, rtx, struct loop_info *, rtx, int, int)); static void find_single_use_in_loop PROTO((rtx, rtx, varray_type)); static int valid_initial_value_p PROTO((rtx, rtx, int, rtx)); -static void find_mem_givs PROTO((rtx, rtx, int, rtx, rtx)); +static void find_mem_givs PROTO((rtx, rtx, int, int, rtx, rtx)); static void record_biv PROTO((struct induction *, rtx, rtx, rtx, rtx, rtx *, int, int)); static void check_final_value PROTO((struct induction *, rtx, rtx, unsigned HOST_WIDE_INT)); -static void record_giv PROTO((struct induction *, rtx, rtx, rtx, rtx, rtx, int, enum g_types, int, rtx *, rtx, rtx)); +static void record_giv PROTO((struct induction *, rtx, rtx, rtx, rtx, rtx, int, enum g_types, int, int, rtx *, rtx, rtx)); static void update_giv_derive PROTO((rtx)); static int basic_induction_var PROTO((rtx, enum machine_mode, rtx, rtx, rtx *, rtx *, rtx **)); static rtx simplify_giv_expr PROTO((rtx, int *)); @@ -2356,12 +2356,15 @@ constant_high_bytes (p, loop_start) /* Try to change (SET (REG ...) (ZERO_EXTEND (..:B ...))) to (SET (STRICT_LOW_PART (SUBREG:B (REG...))) ...). */ - new = gen_rtx_SET (VOIDmode, - gen_rtx_STRICT_LOW_PART (VOIDmode, - gen_rtx_SUBREG (GET_MODE (XEXP (SET_SRC (PATTERN (p)), 0)), - SET_DEST (PATTERN (p)), - 0)), - XEXP (SET_SRC (PATTERN (p)), 0)); + new + = gen_rtx_SET + (VOIDmode, + gen_rtx_STRICT_LOW_PART + (VOIDmode, + gen_rtx_SUBREG (GET_MODE (XEXP (SET_SRC (PATTERN (p)), 0)), + SET_DEST (PATTERN (p)), 0)), + XEXP (SET_SRC (PATTERN (p)), 0)); + insn_code_number = recog (new, p); if (insn_code_number) @@ -2369,8 +2372,8 @@ constant_high_bytes (p, loop_start) register int i; /* Clear destination register before the loop. */ - emit_insn_before (gen_rtx_SET (VOIDmode, SET_DEST (PATTERN (p)), - const0_rtx), + emit_insn_before (gen_rtx_SET (VOIDmode, + SET_DEST (PATTERN (p)), const0_rtx), loop_start); /* Inside the loop, just load the low part. */ @@ -4377,6 +4380,7 @@ strength_reduce (scan_start, end, loop_top, insn_count, not_every_iteration = 0; loop_depth = 0; + maybe_multiple = 0; p = scan_start; while (1) { @@ -4445,8 +4449,8 @@ strength_reduce (scan_start, end, loop_top, insn_count, p = last_consec_insn; record_giv (v, p, src_reg, dest_reg, mult_val, add_val, benefit, - DEST_REG, not_every_iteration, NULL_PTR, loop_start, - loop_end); + DEST_REG, not_every_iteration, maybe_multiple, + NULL_PTR, loop_start, loop_end); } } @@ -4456,8 +4460,8 @@ strength_reduce (scan_start, end, loop_top, insn_count, /* This resulted in worse code on a VAX 8600. I wonder if it still does. */ if (GET_CODE (p) == INSN) - find_mem_givs (PATTERN (p), p, not_every_iteration, loop_start, - loop_end); + find_mem_givs (PATTERN (p), p, not_every_iteration, maybe_multiple, + loop_start, loop_end); #endif /* Update the status of whether giv can derive other givs. This can @@ -4466,6 +4470,49 @@ strength_reduce (scan_start, end, loop_top, insn_count, || GET_CODE (p) == CODE_LABEL) update_giv_derive (p); + /* Past CODE_LABEL, we get to insns that may be executed multiple + times. The only way we can be sure that they can't is if every + every jump insn between here and the end of the loop either + returns, exits the loop, is a forward jump, or is a jump + to the loop start. */ + + if (GET_CODE (p) == CODE_LABEL) + { + rtx insn = p; + + maybe_multiple = 0; + + while (1) + { + insn = NEXT_INSN (insn); + if (insn == scan_start) + break; + if (insn == end) + { + if (loop_top != 0) + insn = loop_top; + else + break; + if (insn == scan_start) + break; + } + + if (GET_CODE (insn) == JUMP_INSN + && GET_CODE (PATTERN (insn)) != RETURN + && (! condjump_p (insn) + || (JUMP_LABEL (insn) != 0 + && JUMP_LABEL (insn) != scan_start + && (INSN_UID (JUMP_LABEL (insn)) >= max_uid_for_loop + || INSN_UID (insn) >= max_uid_for_loop + || (INSN_LUID (JUMP_LABEL (insn)) + < INSN_LUID (insn)))))) + { + maybe_multiple = 1; + break; + } + } + } + /* Past a jump, we get to insns for which we can't count on whether they will be executed during each iteration. */ /* This code appears twice in strength_reduce. There is also similar @@ -5224,13 +5271,15 @@ valid_initial_value_p (x, insn, call_seen, loop_start) /* Scan X for memory refs and check each memory address as a possible giv. INSN is the insn whose pattern X comes from. NOT_EVERY_ITERATION is 1 if the insn might not be executed during - every loop iteration. */ + every loop iteration. MAYBE_MULTIPLE is 1 if the insn might be executed + more thanonce in each loop iteration. */ static void -find_mem_givs (x, insn, not_every_iteration, loop_start, loop_end) +find_mem_givs (x, insn, not_every_iteration, maybe_multiple, loop_start, + loop_end) rtx x; rtx insn; - int not_every_iteration; + int not_every_iteration, maybe_multiple; rtx loop_start, loop_end; { register int i, j; @@ -5278,7 +5327,7 @@ find_mem_givs (x, insn, not_every_iteration, loop_start, loop_end) record_giv (v, insn, src_reg, addr_placeholder, mult_val, add_val, benefit, DEST_ADDR, not_every_iteration, - &XEXP (x, 0), loop_start, loop_end); + maybe_multiple, &XEXP (x, 0), loop_start, loop_end); v->mem_mode = GET_MODE (x); } @@ -5294,12 +5343,12 @@ find_mem_givs (x, insn, not_every_iteration, loop_start, loop_end) fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) if (fmt[i] == 'e') - find_mem_givs (XEXP (x, i), insn, not_every_iteration, loop_start, - loop_end); + find_mem_givs (XEXP (x, i), insn, not_every_iteration, maybe_multiple, + loop_start, loop_end); else if (fmt[i] == 'E') for (j = 0; j < XVECLEN (x, i); j++) find_mem_givs (XVECEXP (x, i, j), insn, not_every_iteration, - loop_start, loop_end); + maybe_multiple, loop_start, loop_end); } /* Fill in the data about one biv update. @@ -5421,7 +5470,8 @@ record_biv (v, insn, dest_reg, inc_val, mult_val, location, static void record_giv (v, insn, src_reg, dest_reg, mult_val, add_val, benefit, - type, not_every_iteration, location, loop_start, loop_end) + type, not_every_iteration, maybe_multiple, location, loop_start, + loop_end) struct induction *v; rtx insn; rtx src_reg; @@ -5429,7 +5479,7 @@ record_giv (v, insn, src_reg, dest_reg, mult_val, add_val, benefit, rtx mult_val, add_val; int benefit; enum g_types type; - int not_every_iteration; + int not_every_iteration, maybe_multiple; rtx *location; rtx loop_start, loop_end; { @@ -5447,7 +5497,7 @@ record_giv (v, insn, src_reg, dest_reg, mult_val, add_val, benefit, v->location = location; v->cant_derive = 0; v->combined_with = 0; - v->maybe_multiple = 0; + v->maybe_multiple = maybe_multiple; v->maybe_dead = 0; v->derive_adjustment = 0; v->same = 0; @@ -5882,9 +5932,10 @@ update_giv_derive (p) &dummy); if (tem && giv->derive_adjustment) - tem = simplify_giv_expr (gen_rtx_PLUS (giv->mode, tem, - giv->derive_adjustment), - &dummy); + tem = simplify_giv_expr + (gen_rtx_PLUS (giv->mode, tem, giv->derive_adjustment), + &dummy); + if (tem) giv->derive_adjustment = tem; else @@ -6274,10 +6325,13 @@ simplify_giv_expr (x, benefit) case PLUS: /* (a + invar_1) + invar_2. Associate. */ - return simplify_giv_expr ( - gen_rtx_PLUS (mode, XEXP (arg0, 0), - gen_rtx_PLUS (mode, XEXP (arg0, 1), arg1)), - benefit); + return + simplify_giv_expr (gen_rtx_PLUS (mode, + XEXP (arg0, 0), + gen_rtx_PLUS (mode, + XEXP (arg0, 1), + arg1)), + benefit); default: abort (); @@ -6297,11 +6351,12 @@ simplify_giv_expr (x, benefit) tem = arg0, arg0 = arg1, arg1 = tem; if (GET_CODE (arg1) == PLUS) - return simplify_giv_expr (gen_rtx_PLUS (mode, - gen_rtx_PLUS (mode, arg0, - XEXP (arg1, 0)), - XEXP (arg1, 1)), - benefit); + return + simplify_giv_expr (gen_rtx_PLUS (mode, + gen_rtx_PLUS (mode, arg0, + XEXP (arg1, 0)), + XEXP (arg1, 1)), + benefit); /* Now must have MULT + MULT. Distribute if same biv, else not giv. */ if (GET_CODE (arg0) != MULT || GET_CODE (arg1) != MULT) @@ -6321,7 +6376,8 @@ simplify_giv_expr (x, benefit) /* Handle "a - b" as "a + b * (-1)". */ return simplify_giv_expr (gen_rtx_PLUS (mode, XEXP (x, 0), - gen_rtx_MULT (mode, XEXP (x, 1), + gen_rtx_MULT (mode, + XEXP (x, 1), constm1_rtx)), benefit); @@ -6380,7 +6436,8 @@ simplify_giv_expr (x, benefit) case MULT: /* (a * invar_1) * invar_2. Associate. */ - return simplify_giv_expr (gen_rtx_MULT (mode, XEXP (arg0, 0), + return simplify_giv_expr (gen_rtx_MULT (mode, + XEXP (arg0, 0), gen_rtx_MULT (mode, XEXP (arg0, 1), arg1)), @@ -6406,11 +6463,12 @@ simplify_giv_expr (x, benefit) if (GET_CODE (XEXP (x, 1)) != CONST_INT) return 0; - return simplify_giv_expr (gen_rtx_MULT (mode, - XEXP (x, 0), - GEN_INT ((HOST_WIDE_INT) 1 - << INTVAL (XEXP (x, 1)))), - benefit); + return + simplify_giv_expr (gen_rtx_MULT (mode, + XEXP (x, 0), + GEN_INT ((HOST_WIDE_INT) 1 + << INTVAL (XEXP (x, 1)))), + benefit); case NEG: /* "-a" is "a * (-1)" */ @@ -6448,9 +6506,10 @@ simplify_giv_expr (x, benefit) if (v->cant_derive) return 0; - tem = gen_rtx_PLUS (mode, gen_rtx_MULT (mode, v->src_reg, - v->mult_val), - v->add_val); + tem = gen_rtx_PLUS (mode, gen_rtx_MULT (mode, + v->src_reg, v->mult_val), + v->add_val); + if (v->derive_adjustment) tem = gen_rtx_MINUS (mode, tem, v->derive_adjustment); return simplify_giv_expr (tem, benefit); diff --git a/gcc/mbchar.c b/gcc/mbchar.c index a22e52b56b3..0f1794a0344 100644 --- a/gcc/mbchar.c +++ b/gcc/mbchar.c @@ -18,11 +18,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. */ -/* These functions are used to manipulate multibyte characters. */ - /* Note regarding cross compilation: - In general translation of multibyte characters to wide characters can + In general, translation of multibyte characters to wide characters can only work in a native compiler since the translation function (mbtowc) needs to know about both the source and target character encoding. However, this particular implementation for JIS, SJIS and EUCJP source characters @@ -37,31 +35,24 @@ Boston, MA 02111-1307, USA. */ #include "mbchar.h" #include <locale.h> -typedef enum -{ - ESCAPE, DOLLAR, BRACKET, AT, B, J, NUL, JIS_CHAR, OTHER, JIS_C_NUM -} JIS_CHAR_TYPE; +typedef enum {ESCAPE, DOLLAR, BRACKET, AT, B, J, NUL, JIS_CHAR, OTHER, + JIS_C_NUM} JIS_CHAR_TYPE; -typedef enum -{ - ASCII, A_ESC, A_ESC_DL, JIS, JIS_1, JIS_2, J_ESC, J_ESC_BR, - J2_ESC, J2_ESC_BR, INV, JIS_S_NUM -} JIS_STATE; +typedef enum {ASCII, A_ESC, A_ESC_DL, JIS, JIS_1, JIS_2, J_ESC, J_ESC_BR, + J2_ESC, J2_ESC_BR, INV, JIS_S_NUM} JIS_STATE; + +typedef enum {COPYA, COPYJ, COPYJ2, MAKE_A, MAKE_J, NOOP, + EMPTY, ERROR} JIS_ACTION; + +/* State/action tables for processing JIS encoding: + + Where possible, switches to JIS are grouped with proceding JIS characters + and switches to ASCII are grouped with preceding JIS characters. + Thus, maximum returned length is: + 2 (switch to JIS) + 2 (JIS characters) + 2 (switch back to ASCII) = 6. */ -typedef enum -{ - COPYA, COPYJ, COPYJ2, MAKE_A, MAKE_J, NOOP, EMPTY, ERROR -} JIS_ACTION; - -/***************************************************************************** - * state/action tables for processing JIS encoding - * Where possible, switches to JIS are grouped with proceding JIS characters - * and switches to ASCII are grouped with preceding JIS characters. - * Thus, maximum returned length is: - * 2 (switch to JIS) + 2 (JIS characters) + 2 (switch back to ASCII) = 6. - *****************************************************************************/ static JIS_STATE JIS_state_table[JIS_S_NUM][JIS_C_NUM] = { -/* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTHER*/ +/* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTH*/ /*ASCII*/ { A_ESC, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII,ASCII,ASCII}, /*A_ESC*/ { ASCII, A_ESC_DL,ASCII, ASCII, ASCII, ASCII, ASCII,ASCII,ASCII}, /*A_ESC_DL*/{ ASCII, ASCII, ASCII, JIS, JIS, ASCII, ASCII,ASCII,ASCII}, @@ -75,87 +66,112 @@ static JIS_STATE JIS_state_table[JIS_S_NUM][JIS_C_NUM] = { }; static JIS_ACTION JIS_action_table[JIS_S_NUM][JIS_C_NUM] = { -/* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTHER */ +/* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTH */ /*ASCII */ {NOOP, COPYA, COPYA, COPYA, COPYA, COPYA, EMPTY, COPYA, COPYA}, /*A_ESC */ {COPYA, NOOP, COPYA, COPYA, COPYA, COPYA, COPYA, COPYA, COPYA}, /*A_ESC_DL */{COPYA, COPYA, COPYA, MAKE_J, MAKE_J, COPYA, COPYA, COPYA, COPYA}, -/*JIS */ {NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, ERROR, NOOP, ERROR }, -/*JIS_1 */ {ERROR, NOOP, NOOP, NOOP, NOOP, NOOP, ERROR, NOOP, ERROR }, +/*JIS */ {NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, ERROR, NOOP, ERROR}, +/*JIS_1 */ {ERROR, NOOP, NOOP, NOOP, NOOP, NOOP, ERROR, NOOP, ERROR}, /*JIS_2 */ {NOOP, COPYJ2,COPYJ2,COPYJ2, COPYJ2, COPYJ2,ERROR, COPYJ2,COPYJ2}, -/*J_ESC */ {ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR }, -/*J_ESC_BR */{ERROR, ERROR, ERROR, ERROR, NOOP, NOOP, ERROR, ERROR, ERROR }, -/*J2_ESC */ {ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR }, -/*J2_ESC_BR*/{ERROR, ERROR, ERROR, ERROR, COPYJ, COPYJ, ERROR, ERROR, ERROR }, +/*J_ESC */ {ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR}, +/*J_ESC_BR */{ERROR, ERROR, ERROR, ERROR, NOOP, NOOP, ERROR, ERROR, ERROR}, +/*J2_ESC */ {ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR}, +/*J2_ESC_BR*/{ERROR, ERROR, ERROR, ERROR, COPYJ, COPYJ, ERROR, ERROR, ERROR}, }; char *literal_codeset = NULL; +/* Store into *PWC (if PWC is not null) the wide character + corresponding to the multibyte character at the start of the + buffer S of size N. Return the number of bytes in the multibyte + character. Return -1 if the bytes do not form a valid character, + or 0 if S is null or points to a null byte. + + This function behaves like the Standard C function mbtowc, except + it treats locale names of the form "C-..." specially. */ + int local_mbtowc (pwc, s, n) - wchar_t *pwc; - const char *s; - size_t n; + wchar_t *pwc; + char *s; + size_t n; { static JIS_STATE save_state = ASCII; JIS_STATE curr_state = save_state; - unsigned char *t = (unsigned char *)s; + unsigned char *t = (unsigned char *) s; if (s != NULL && n == 0) return -1; if (literal_codeset == NULL || strlen (literal_codeset) <= 1) - { - /* This must be the "C" locale or unknown locale -- fall thru */ - } + /* This must be the "C" locale or unknown locale -- fall thru */ + ; else if (! strcmp (literal_codeset, "C-SJIS")) { int char1; if (s == NULL) - return 0; /* not state-dependent */ + /* Not state-dependent. */ + return 0; + char1 = *t; if (ISSJIS1 (char1)) { int char2 = t[1]; + if (n <= 1) return -1; + if (ISSJIS2 (char2)) { if (pwc != NULL) - *pwc = (((wchar_t)*t) << 8) + (wchar_t)(*(t+1)); + *pwc = (((wchar_t) *t) << 8) + (wchar_t) (*(t + 1)); return 2; } + return -1; } + if (pwc != NULL) - *pwc = (wchar_t)*t; + *pwc = (wchar_t) *t; + if (*t == '\0') return 0; + return 1; } else if (! strcmp (literal_codeset, "C-EUCJP")) { int char1; + if (s == NULL) - return 0; /* not state-dependent */ + /* Not state-dependent. */ + return 0; + char1 = *t; if (ISEUCJP (char1)) { int char2 = t[1]; + if (n <= 1) return -1; + if (ISEUCJP (char2)) { if (pwc != NULL) - *pwc = (((wchar_t)*t) << 8) + (wchar_t)(*(t+1)); + *pwc = (((wchar_t) *t) << 8) + (wchar_t) (*(t + 1)); return 2; } + return -1; } + if (pwc != NULL) - *pwc = (wchar_t)*t; + *pwc = (wchar_t) *t; + if (*t == '\0') return 0; + return 1; } else if (! strcmp (literal_codeset, "C-JIS")) @@ -168,12 +184,13 @@ local_mbtowc (pwc, s, n) if (s == NULL) { save_state = ASCII; - return 1; /* state-dependent */ + /* State-dependent. */ + return 1; } ptr = t; - for (i = 0; i < n; ++i) + for (i = 0; i < n; i++) { curr_ch = t[i]; switch (curr_ch) @@ -213,59 +230,84 @@ local_mbtowc (pwc, s, n) { case NOOP: break; + case EMPTY: if (pwc != NULL) - *pwc = (wchar_t)0; + *pwc = (wchar_t) 0; + save_state = curr_state; return i; + case COPYA: if (pwc != NULL) - *pwc = (wchar_t)*ptr; + *pwc = (wchar_t) *ptr; save_state = curr_state; - return (i + 1); + return i + 1; + case COPYJ: if (pwc != NULL) - *pwc = (((wchar_t)*ptr) << 8) + (wchar_t)(*(ptr+1)); + *pwc = (((wchar_t) *ptr) << 8) + (wchar_t) (*(ptr + 1)); + save_state = curr_state; - return (i + 1); + return i + 1; + case COPYJ2: if (pwc != NULL) - *pwc = (((wchar_t)*ptr) << 8) + (wchar_t)(*(ptr+1)); + *pwc = (((wchar_t) *ptr) << 8) + (wchar_t) (*(ptr + 1)); + save_state = curr_state; - return (ptr - t) + 2; + return ptr - t + 2; + case MAKE_A: case MAKE_J: - ptr = (char *)(t + i + 1); + ptr = (char *) (t + i + 1); break; + case ERROR: default: return -1; } } - return -1; /* n < bytes needed */ + /* More than n bytes needed. */ + return -1; } #ifdef CROSS_COMPILE if (s == NULL) - return 0; /* not state-dependent */ + /* Not state-dependent. */ + return 0; + if (pwc != NULL) *pwc = *s; return 1; #else + /* This must be the "C" locale or unknown locale. */ return mbtowc (pwc, s, n); #endif } +/* Return the number of bytes in the multibyte character at the start + of the buffer S of size N. Return -1 if the bytes do not form a + valid character, or 0 if S is null or points to a null byte. + + This function behaves like the Standard C function mblen, except + it treats locale names of the form "C-..." specially. */ + int local_mblen (s, n) - const char *s; - size_t n; + char *s; + size_t n; { return local_mbtowc (NULL, s, n); } +/* Return the maximum mumber of bytes in a multibyte character. + + This function returns the same value as the Standard C macro MB_CUR_MAX, + except it treats locale names of the form "C-..." specially. */ + int local_mb_cur_max () { diff --git a/gcc/mbchar.h b/gcc/mbchar.h index 65f281a5482..a4c019bf64f 100644 --- a/gcc/mbchar.h +++ b/gcc/mbchar.h @@ -1,4 +1,4 @@ -/* mbchar.h - Various declarations for functions found in mbchar.c +/* Various declarations for functions found in mbchar.c Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU CC. @@ -22,7 +22,8 @@ Boston, MA 02111-1307, USA. */ #define __GCC_MBCHAR_H__ #ifdef MULTIBYTE_CHARS -/* escape character used for JIS encoding */ + +/* Escape character used for JIS encoding */ #define JIS_ESC_CHAR 0x1b #define ISSJIS1(c) ((c) >= 0x81 && (c) <= 0x9f || (c) >= 0xe0 && (c) <= 0xef) @@ -30,12 +31,10 @@ Boston, MA 02111-1307, USA. */ #define ISEUCJP(c) ((c) >= 0xa1 && (c) <= 0xfe) #define ISJIS(c) ((c) >= 0x21 && (c) <= 0x7e) -int local_mbtowc PROTO ((wchar_t *, const char *, size_t)); -int local_mblen PROTO ((const char *, size_t)); -int local_mb_cur_max PROTO ((void)); +extern int local_mbtowc PROTO ((wchar_t *, char *, size_t)); +extern int local_mblen PROTO ((char *, size_t)); +extern int local_mb_cur_max PROTO ((void)); /* The locale being used for multibyte characters in string/char literals. */ extern char *literal_codeset; #endif /* MULTIBYTE_CHARS */ - -#endif /* __GCC_MBCHAR_H__ */ diff --git a/gcc/md.texi b/gcc/md.texi index c300c299ef7..d1df107cbbf 100644 --- a/gcc/md.texi +++ b/gcc/md.texi @@ -1137,6 +1137,9 @@ which are outputs from it. @samp{=} identifies an output; @samp{+} identifies an operand that is both input and output; all other operands are assumed to be input only. +If you specify @samp{=} or @samp{+} in a constraint, you put it in the +first character of the constraint string. + @cindex @samp{&} in constraint @cindex earlyclobber operand @item & diff --git a/gcc/mips-tdump.c b/gcc/mips-tdump.c index d51a2eef0ec..fd70e51d88e 100644 --- a/gcc/mips-tdump.c +++ b/gcc/mips-tdump.c @@ -1,5 +1,6 @@ /* Read and manage MIPS symbol tables from object modules. - Copyright (C) 1991, 1994, 1995, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1991, 1994, 1995, 1997, 1998, 1999 + Free Software Foundation, Inc. Contributed by hartzell@boulder.colorado.edu, Rewritten by meissner@osf.org. @@ -22,7 +23,6 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" - #ifdef index #undef index #undef rindex diff --git a/gcc/objc/objc-parse.c b/gcc/objc/objc-parse.c index 05463a2a7dd..0644cd708dc 100644 --- a/gcc/objc/objc-parse.c +++ b/gcc/objc/objc-parse.c @@ -1,78 +1,77 @@ /* A Bison parser, made from objc-parse.y - by GNU Bison version 1.27 + by GNU Bison version 1.25 */ #define YYBISON 1 /* Identify Bison output. */ -#define IDENTIFIER 257 -#define TYPENAME 258 -#define SCSPEC 259 -#define TYPESPEC 260 -#define TYPE_QUAL 261 -#define CONSTANT 262 -#define STRING 263 -#define ELLIPSIS 264 -#define SIZEOF 265 -#define ENUM 266 -#define STRUCT 267 -#define UNION 268 -#define IF 269 -#define ELSE 270 -#define WHILE 271 -#define DO 272 -#define FOR 273 -#define SWITCH 274 -#define CASE 275 -#define DEFAULT 276 -#define BREAK 277 -#define CONTINUE 278 -#define RETURN 279 -#define GOTO 280 -#define ASM_KEYWORD 281 -#define TYPEOF 282 -#define ALIGNOF 283 -#define ATTRIBUTE 284 -#define EXTENSION 285 -#define LABEL 286 -#define REALPART 287 -#define IMAGPART 288 -#define VA_ARG 289 -#define END_OF_LINE 290 -#define ASSIGN 291 -#define OROR 292 -#define ANDAND 293 -#define EQCOMPARE 294 -#define ARITHCOMPARE 295 -#define LSHIFT 296 -#define RSHIFT 297 -#define UNARY 298 -#define PLUSPLUS 299 -#define MINUSMINUS 300 -#define HYPERUNARY 301 -#define POINTSAT 302 -#define INTERFACE 303 -#define IMPLEMENTATION 304 -#define END 305 -#define SELECTOR 306 -#define DEFS 307 -#define ENCODE 308 -#define CLASSNAME 309 -#define PUBLIC 310 -#define PRIVATE 311 -#define PROTECTED 312 -#define PROTOCOL 313 -#define OBJECTNAME 314 -#define CLASS 315 -#define ALIAS 316 -#define OBJC_STRING 317 +#define IDENTIFIER 258 +#define TYPENAME 259 +#define SCSPEC 260 +#define TYPESPEC 261 +#define TYPE_QUAL 262 +#define CONSTANT 263 +#define STRING 264 +#define ELLIPSIS 265 +#define SIZEOF 266 +#define ENUM 267 +#define STRUCT 268 +#define UNION 269 +#define IF 270 +#define ELSE 271 +#define WHILE 272 +#define DO 273 +#define FOR 274 +#define SWITCH 275 +#define CASE 276 +#define DEFAULT 277 +#define BREAK 278 +#define CONTINUE 279 +#define RETURN 280 +#define GOTO 281 +#define ASM_KEYWORD 282 +#define TYPEOF 283 +#define ALIGNOF 284 +#define ATTRIBUTE 285 +#define EXTENSION 286 +#define LABEL 287 +#define REALPART 288 +#define IMAGPART 289 +#define VA_ARG 290 +#define END_OF_LINE 291 +#define ASSIGN 292 +#define OROR 293 +#define ANDAND 294 +#define EQCOMPARE 295 +#define ARITHCOMPARE 296 +#define LSHIFT 297 +#define RSHIFT 298 +#define UNARY 299 +#define PLUSPLUS 300 +#define MINUSMINUS 301 +#define HYPERUNARY 302 +#define POINTSAT 303 +#define INTERFACE 304 +#define IMPLEMENTATION 305 +#define END 306 +#define SELECTOR 307 +#define DEFS 308 +#define ENCODE 309 +#define CLASSNAME 310 +#define PUBLIC 311 +#define PRIVATE 312 +#define PROTECTED 313 +#define PROTOCOL 314 +#define OBJECTNAME 315 +#define CLASS 316 +#define ALIAS 317 +#define OBJC_STRING 318 #line 33 "objc-parse.y" #include "config.h" #include "system.h" #include <setjmp.h> - #include "tree.h" #include "input.h" #include "c-lex.h" @@ -97,10 +96,10 @@ const char * const language_string = "GNU Obj-C"; /* Cause the `yydebug' variable to be defined. */ #define YYDEBUG 1 -#line 65 "objc-parse.y" +#line 64 "objc-parse.y" typedef union {long itype; tree ttype; enum tree_code code; char *filename; int lineno; int ends_in_label; } YYSTYPE; -#line 196 "objc-parse.y" +#line 195 "objc-parse.y" /* Number of statements (loosely speaking) and compound statements seen so far. */ @@ -152,7 +151,7 @@ extern void yyprint PROTO ((FILE *, int, YYSTYPE)); #define YYFLAG -32768 #define YYNTBASE 86 -#define YYTRANSLATE(x) ((unsigned)(x) <= 317 ? yytranslate[x] : 314) +#define YYTRANSLATE(x) ((unsigned)(x) <= 318 ? yytranslate[x] : 314) static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -180,13 +179,13 @@ static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 41, 42, 46, 47, 48, 49, 55, 56, 57, - 58, 59, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77 + 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 41, 42, 46, 47, 48, 49, 55, 56, + 57, 58, 59, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77 }; #if YYDEBUG != 0 @@ -434,63 +433,63 @@ static const short yyrhs[] = { -1, #if YYDEBUG != 0 static const short yyrline[] = { 0, - 236, 241, 255, 257, 257, 258, 260, 262, 263, 264, - 272, 276, 287, 292, 297, 299, 301, 302, 303, 308, - 315, 317, 322, 327, 333, 335, 340, 345, 351, 353, - 358, 365, 367, 368, 369, 372, 374, 376, 378, 380, - 382, 384, 388, 392, 395, 398, 401, 405, 407, 410, - 413, 417, 445, 451, 454, 457, 460, 462, 464, 468, - 472, 476, 478, 481, 485, 512, 514, 516, 518, 520, - 522, 524, 526, 528, 530, 532, 534, 536, 538, 542, - 544, 548, 550, 553, 557, 559, 566, 569, 577, 588, - 748, 749, 751, 757, 759, 782, 791, 793, 795, 807, - 821, 823, 825, 827, 829, 831, 833, 838, 840, 846, - 848, 852, 854, 855, 865, 870, 872, 873, 874, 881, - 887, 892, 895, 903, 908, 910, 911, 912, 919, 930, - 934, 940, 945, 950, 955, 957, 959, 968, 971, 975, - 977, 979, 984, 988, 991, 995, 998, 1000, 1012, 1015, - 1017, 1019, 1023, 1027, 1029, 1032, 1045, 1048, 1052, 1054, - 1062, 1063, 1064, 1068, 1070, 1075, 1077, 1079, 1085, 1086, - 1087, 1090, 1092, 1095, 1097, 1100, 1103, 1109, 1116, 1118, - 1125, 1132, 1135, 1142, 1145, 1149, 1152, 1156, 1161, 1164, - 1168, 1171, 1173, 1175, 1177, 1184, 1186, 1187, 1188, 1193, - 1195, 1200, 1208, 1213, 1217, 1220, 1222, 1227, 1229, 1230, - 1233, 1233, 1236, 1239, 1241, 1243, 1246, 1248, 1251, 1259, - 1273, 1281, 1285, 1299, 1307, 1314, 1316, 1321, 1324, 1329, - 1331, 1333, 1340, 1342, 1343, 1351, 1357, 1359, 1361, 1368, - 1370, 1376, 1382, 1384, 1386, 1388, 1395, 1397, 1400, 1403, - 1407, 1410, 1414, 1417, 1421, 1426, 1428, 1432, 1434, 1436, - 1438, 1442, 1444, 1447, 1450, 1453, 1456, 1460, 1462, 1465, - 1467, 1472, 1475, 1480, 1482, 1484, 1488, 1512, 1519, 1524, - 1530, 1535, 1537, 1542, 1544, 1548, 1552, 1556, 1566, 1568, - 1573, 1578, 1581, 1585, 1588, 1592, 1595, 1598, 1601, 1605, - 1608, 1612, 1616, 1618, 1620, 1622, 1624, 1626, 1628, 1630, - 1634, 1642, 1650, 1652, 1654, 1658, 1660, 1663, 1666, 1679, - 1681, 1686, 1688, 1691, 1705, 1708, 1711, 1713, 1715, 1723, - 1731, 1741, 1759, 1764, 1769, 1772, 1786, 1795, 1799, 1803, - 1807, 1813, 1817, 1822, 1825, 1830, 1833, 1834, 1851, 1856, - 1859, 1871, 1873, 1883, 1893, 1894, 1902, 1905, 1917, 1921, - 1938, 1948, 1957, 1962, 1967, 1972, 1976, 1980, 1991, 1998, - 2005, 2012, 2023, 2029, 2032, 2037, 2060, 2094, 2125, 2156, - 2171, 2185, 2189, 2193, 2196, 2201, 2203, 2206, 2208, 2212, - 2217, 2220, 2226, 2231, 2236, 2238, 2247, 2248, 2254, 2256, - 2266, 2268, 2272, 2275, 2281, 2291, 2300, 2309, 2319, 2333, - 2338, 2343, 2345, 2354, 2357, 2362, 2365, 2369, 2377, 2379, - 2380, 2381, 2382, 2383, 2397, 2400, 2404, 2410, 2416, 2423, - 2428, 2434, 2441, 2447, 2453, 2458, 2464, 2471, 2477, 2483, - 2489, 2497, 2503, 2509, 2517, 2524, 2530, 2539, 2546, 2554, - 2559, 2562, 2572, 2574, 2577, 2579, 2580, 2583, 2588, 2589, - 2606, 2613, 2619, 2623, 2626, 2627, 2630, 2638, 2644, 2653, - 2663, 2670, 2674, 2679, 2688, 2695, 2699, 2709, 2711, 2712, - 2714, 2716, 2717, 2718, 2719, 2721, 2723, 2726, 2734, 2741, - 2741, 2748, 2754, 2756, 2762, 2767, 2772, 2781, 2783, 2789, - 2791, 2794, 2796, 2797, 2798, 2801, 2807, 2809, 2813, 2816, - 2823, 2829, 2834, 2841, 2846, 2851, 2856, 2863, 2867, 2870, - 2876, 2878, 2879, 2880, 2883, 2885, 2886, 2887, 2888, 2889, - 2890, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, - 2900, 2901, 2902, 2903, 2903, 2906, 2912, 2917, 2922, 2928, - 2930, 2933, 2935, 2942, 2954, 2959, 2965, 2967, 2973, 2977, - 2978, 2984, 2986, 2989, 2991, 2997, 3002, 3008, 3015, 3024 + 235, 240, 254, 256, 256, 257, 259, 261, 262, 263, + 271, 275, 286, 291, 296, 298, 300, 301, 302, 307, + 314, 316, 321, 326, 332, 334, 339, 344, 350, 352, + 357, 364, 366, 367, 368, 371, 373, 375, 377, 379, + 381, 383, 387, 391, 394, 397, 400, 404, 406, 409, + 412, 416, 444, 450, 453, 456, 459, 461, 463, 467, + 471, 475, 477, 480, 484, 511, 513, 515, 517, 519, + 521, 523, 525, 527, 529, 531, 533, 535, 537, 541, + 543, 547, 549, 552, 556, 558, 565, 568, 576, 587, + 747, 748, 750, 756, 758, 781, 790, 792, 794, 806, + 820, 822, 824, 826, 828, 830, 832, 837, 839, 845, + 847, 851, 853, 854, 864, 869, 871, 872, 873, 880, + 886, 891, 894, 902, 907, 909, 910, 911, 918, 929, + 933, 939, 944, 949, 954, 956, 958, 967, 970, 974, + 976, 978, 983, 987, 990, 994, 997, 999, 1011, 1014, + 1016, 1018, 1022, 1026, 1028, 1031, 1044, 1047, 1051, 1053, + 1061, 1062, 1063, 1067, 1069, 1074, 1076, 1078, 1084, 1085, + 1086, 1089, 1091, 1094, 1096, 1099, 1102, 1108, 1115, 1117, + 1124, 1131, 1134, 1141, 1144, 1148, 1151, 1155, 1160, 1163, + 1167, 1170, 1172, 1174, 1176, 1183, 1185, 1186, 1187, 1192, + 1194, 1199, 1207, 1212, 1216, 1219, 1221, 1226, 1228, 1229, + 1232, 1232, 1235, 1238, 1240, 1242, 1245, 1247, 1250, 1258, + 1272, 1280, 1284, 1298, 1306, 1313, 1315, 1320, 1323, 1328, + 1330, 1332, 1339, 1341, 1342, 1350, 1356, 1358, 1360, 1367, + 1369, 1375, 1381, 1383, 1385, 1387, 1394, 1396, 1399, 1402, + 1406, 1409, 1413, 1416, 1420, 1425, 1427, 1431, 1433, 1435, + 1437, 1441, 1443, 1446, 1449, 1452, 1455, 1459, 1461, 1464, + 1466, 1471, 1474, 1479, 1481, 1483, 1487, 1511, 1518, 1523, + 1529, 1534, 1536, 1541, 1543, 1547, 1551, 1555, 1565, 1567, + 1572, 1577, 1580, 1584, 1587, 1591, 1594, 1597, 1600, 1604, + 1607, 1611, 1615, 1617, 1619, 1621, 1623, 1625, 1627, 1629, + 1633, 1641, 1649, 1651, 1653, 1657, 1659, 1662, 1665, 1678, + 1680, 1685, 1687, 1690, 1704, 1707, 1710, 1712, 1714, 1722, + 1730, 1740, 1758, 1763, 1768, 1771, 1785, 1794, 1798, 1802, + 1806, 1812, 1816, 1821, 1824, 1829, 1832, 1833, 1850, 1855, + 1858, 1870, 1872, 1882, 1892, 1893, 1901, 1904, 1916, 1920, + 1937, 1947, 1956, 1961, 1966, 1971, 1975, 1979, 1990, 1997, + 2004, 2011, 2022, 2028, 2031, 2036, 2059, 2093, 2124, 2155, + 2170, 2184, 2188, 2192, 2195, 2200, 2202, 2205, 2207, 2211, + 2216, 2219, 2225, 2230, 2235, 2237, 2246, 2247, 2253, 2255, + 2265, 2267, 2271, 2274, 2280, 2290, 2299, 2308, 2318, 2332, + 2337, 2342, 2344, 2353, 2356, 2361, 2364, 2368, 2376, 2378, + 2379, 2380, 2381, 2382, 2396, 2399, 2403, 2409, 2415, 2422, + 2427, 2433, 2440, 2446, 2452, 2457, 2463, 2470, 2476, 2482, + 2488, 2496, 2502, 2508, 2516, 2523, 2529, 2538, 2545, 2553, + 2558, 2561, 2571, 2573, 2576, 2578, 2579, 2582, 2587, 2588, + 2605, 2612, 2618, 2622, 2625, 2626, 2629, 2637, 2643, 2652, + 2662, 2669, 2673, 2678, 2687, 2694, 2698, 2708, 2710, 2711, + 2713, 2715, 2716, 2717, 2718, 2720, 2722, 2725, 2733, 2740, + 2740, 2747, 2753, 2755, 2761, 2766, 2771, 2780, 2782, 2788, + 2790, 2793, 2795, 2796, 2797, 2800, 2806, 2808, 2812, 2815, + 2822, 2828, 2833, 2840, 2845, 2850, 2855, 2862, 2866, 2869, + 2875, 2877, 2878, 2879, 2882, 2884, 2885, 2886, 2887, 2888, + 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, + 2899, 2900, 2901, 2902, 2902, 2905, 2911, 2916, 2921, 2927, + 2929, 2932, 2934, 2941, 2953, 2958, 2964, 2966, 2972, 2976, + 2977, 2983, 2985, 2988, 2990, 2996, 3001, 3007, 3014, 3023 }; #endif @@ -1724,8 +1723,7 @@ static const short yycheck[] = { 56, 46, 47, 48, 49, 50, 51, 52, 53, 54 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/lib/bison.simple" -/* This file comes from bison-1.27. */ +#line 3 "/usr/cygnus/TBD-TBD/share/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -1742,66 +1740,46 @@ 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, Inc., 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. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ +#ifndef alloca #ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) #include <alloca.h> #else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ +#if defined (MSDOS) && !defined (__TURBOC__) #include <malloc.h> -#endif #else /* not MSDOS, or __TURBOC__ */ #if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include <malloc.h> */ +#include <malloc.h> #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca +#else /* not MSDOS, __TURBOC__, or _AIX */ +#ifdef __hpux +#ifdef __cplusplus +extern "C" { +void *alloca (unsigned int); +}; +#else /* not __cplusplus */ +void *alloca (); +#endif /* not __cplusplus */ #endif /* __hpux */ -#endif #endif /* not _AIX */ #endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ +#endif /* not sparc. */ +#endif /* not GNU C. */ +#endif /* alloca not defined. */ -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action @@ -1811,8 +1789,8 @@ static const short yycheck[] = { 56, #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab +#define YYACCEPT return(0) +#define YYABORT return(1) #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the @@ -1893,12 +1871,12 @@ int yydebug; /* nonzero means print parse trace */ #ifndef YYMAXDEPTH #define YYMAXDEPTH 10000 #endif - -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +int yyparse (void); +#endif + #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ @@ -1910,7 +1888,7 @@ static void __yy_memcpy (to, from, count) char *to; char *from; - unsigned int count; + int count; { register char *f = from; register char *t = to; @@ -1925,10 +1903,10 @@ __yy_memcpy (to, from, count) /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void -__yy_memcpy (char *to, char *from, unsigned int count) +__yy_memcpy (char *to, char *from, int count) { - register char *t = to; register char *f = from; + register char *t = to; register int i = count; while (i-- > 0) @@ -1938,7 +1916,7 @@ __yy_memcpy (char *to, char *from, unsigned int count) #endif #endif -#line 216 "/usr/lib/bison.simple" +#line 196 "/usr/cygnus/TBD-TBD/share/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 *. @@ -1959,15 +1937,6 @@ __yy_memcpy (char *to, char *from, unsigned int count) #define YYPARSE_PARAM_DECL #endif /* not YYPARSE_PARAM */ -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -#ifdef YYPARSE_PARAM -int yyparse (void *); -#else -int yyparse (void); -#endif -#endif - int yyparse(YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL @@ -1996,7 +1965,6 @@ yyparse(YYPARSE_PARAM_ARG) #endif int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; #ifdef YYPURE int yychar; @@ -2081,32 +2049,18 @@ yynewstate: if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); + yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); + yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); #ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); + yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); #endif #endif /* no yyoverflow */ @@ -2267,14 +2221,14 @@ yyreduce: switch (yyn) { case 1: -#line 237 "objc-parse.y" +#line 236 "objc-parse.y" { if (pedantic) pedwarn ("ANSI C forbids an empty source file"); finish_file (); ; break;} case 2: -#line 242 "objc-parse.y" +#line 241 "objc-parse.y" { /* In case there were missing closebraces, get us back to the global binding level. */ @@ -2284,15 +2238,15 @@ case 2: ; break;} case 3: -#line 256 "objc-parse.y" +#line 255 "objc-parse.y" {yyval.ttype = NULL_TREE; ; break;} case 5: -#line 257 "objc-parse.y" +#line 256 "objc-parse.y" {yyval.ttype = NULL_TREE; ; break;} case 10: -#line 265 "objc-parse.y" +#line 264 "objc-parse.y" { STRIP_NOPS (yyvsp[-2].ttype); if ((TREE_CODE (yyvsp[-2].ttype) == ADDR_EXPR && TREE_CODE (TREE_OPERAND (yyvsp[-2].ttype, 0)) == STRING_CST) @@ -2302,11 +2256,11 @@ case 10: error ("argument of `asm' is not a constant string"); ; break;} case 11: -#line 273 "objc-parse.y" +#line 272 "objc-parse.y" { pedantic = yyvsp[-1].itype; ; break;} case 12: -#line 278 "objc-parse.y" +#line 277 "objc-parse.y" { if (pedantic) error ("ANSI C forbids data definition with no type or storage class"); else if (!flag_traditional) @@ -2318,45 +2272,45 @@ case 12: resume_momentary (yyvsp[-2].itype); ; break;} case 13: -#line 288 "objc-parse.y" +#line 287 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-2].itype); ; break;} case 14: -#line 293 "objc-parse.y" +#line 292 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-2].itype); ; break;} case 15: -#line 298 "objc-parse.y" +#line 297 "objc-parse.y" { pedwarn ("empty declaration"); ; break;} case 16: -#line 300 "objc-parse.y" +#line 299 "objc-parse.y" { shadow_tag (yyvsp[-1].ttype); ; break;} case 19: -#line 304 "objc-parse.y" +#line 303 "objc-parse.y" { if (pedantic) pedwarn ("ANSI C does not allow extra `;' outside of a function"); ; break;} case 20: -#line 310 "objc-parse.y" +#line 309 "objc-parse.y" { if (! start_function (current_declspecs, yyvsp[0].ttype, prefix_attributes, NULL_TREE, 0)) YYERROR1; reinit_parse_for_function (); ; break;} case 21: -#line 315 "objc-parse.y" +#line 314 "objc-parse.y" { store_parm_decls (); ; break;} case 22: -#line 317 "objc-parse.y" +#line 316 "objc-parse.y" { finish_function (0); current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -2364,25 +2318,25 @@ case 22: resume_momentary (yyvsp[-5].itype); ; break;} case 23: -#line 323 "objc-parse.y" +#line 322 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-2].itype); ; break;} case 24: -#line 328 "objc-parse.y" +#line 327 "objc-parse.y" { if (! start_function (current_declspecs, yyvsp[0].ttype, prefix_attributes, NULL_TREE, 0)) YYERROR1; reinit_parse_for_function (); ; break;} case 25: -#line 333 "objc-parse.y" +#line 332 "objc-parse.y" { store_parm_decls (); ; break;} case 26: -#line 335 "objc-parse.y" +#line 334 "objc-parse.y" { finish_function (0); current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -2390,25 +2344,25 @@ case 26: resume_momentary (yyvsp[-5].itype); ; break;} case 27: -#line 341 "objc-parse.y" +#line 340 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-2].itype); ; break;} case 28: -#line 346 "objc-parse.y" +#line 345 "objc-parse.y" { if (! start_function (NULL_TREE, yyvsp[0].ttype, prefix_attributes, NULL_TREE, 0)) YYERROR1; reinit_parse_for_function (); ; break;} case 29: -#line 351 "objc-parse.y" +#line 350 "objc-parse.y" { store_parm_decls (); ; break;} case 30: -#line 353 "objc-parse.y" +#line 352 "objc-parse.y" { finish_function (0); current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -2416,72 +2370,72 @@ case 30: resume_momentary (yyvsp[-5].itype); ; break;} case 31: -#line 359 "objc-parse.y" +#line 358 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-2].itype); ; break;} case 36: -#line 373 "objc-parse.y" +#line 372 "objc-parse.y" { yyval.code = ADDR_EXPR; ; break;} case 37: -#line 375 "objc-parse.y" +#line 374 "objc-parse.y" { yyval.code = NEGATE_EXPR; ; break;} case 38: -#line 377 "objc-parse.y" +#line 376 "objc-parse.y" { yyval.code = CONVERT_EXPR; ; break;} case 39: -#line 379 "objc-parse.y" +#line 378 "objc-parse.y" { yyval.code = PREINCREMENT_EXPR; ; break;} case 40: -#line 381 "objc-parse.y" +#line 380 "objc-parse.y" { yyval.code = PREDECREMENT_EXPR; ; break;} case 41: -#line 383 "objc-parse.y" +#line 382 "objc-parse.y" { yyval.code = BIT_NOT_EXPR; ; break;} case 42: -#line 385 "objc-parse.y" +#line 384 "objc-parse.y" { yyval.code = TRUTH_NOT_EXPR; ; break;} case 43: -#line 389 "objc-parse.y" +#line 388 "objc-parse.y" { yyval.ttype = build_compound_expr (yyvsp[0].ttype); ; break;} case 44: -#line 394 "objc-parse.y" +#line 393 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 46: -#line 400 "objc-parse.y" +#line 399 "objc-parse.y" { yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ; break;} case 47: -#line 402 "objc-parse.y" +#line 401 "objc-parse.y" { chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ; break;} case 49: -#line 408 "objc-parse.y" +#line 407 "objc-parse.y" { yyval.ttype = build_indirect_ref (yyvsp[0].ttype, "unary *"); ; break;} case 50: -#line 411 "objc-parse.y" +#line 410 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; pedantic = yyvsp[-1].itype; ; break;} case 51: -#line 414 "objc-parse.y" +#line 413 "objc-parse.y" { yyval.ttype = build_unary_op (yyvsp[-1].code, yyvsp[0].ttype, 0); overflow_warning (yyval.ttype); ; break;} case 52: -#line 418 "objc-parse.y" +#line 417 "objc-parse.y" { tree label = lookup_label (yyvsp[0].ttype); if (pedantic) pedwarn ("ANSI C forbids `&&'"); @@ -2496,7 +2450,7 @@ case 52: ; break;} case 53: -#line 446 "objc-parse.y" +#line 445 "objc-parse.y" { skip_evaluation--; if (TREE_CODE (yyvsp[0].ttype) == COMPONENT_REF && DECL_C_BIT_FIELD (TREE_OPERAND (yyvsp[0].ttype, 1))) @@ -2504,53 +2458,53 @@ case 53: yyval.ttype = c_sizeof (TREE_TYPE (yyvsp[0].ttype)); ; break;} case 54: -#line 452 "objc-parse.y" +#line 451 "objc-parse.y" { skip_evaluation--; yyval.ttype = c_sizeof (groktypename (yyvsp[-1].ttype)); ; break;} case 55: -#line 455 "objc-parse.y" +#line 454 "objc-parse.y" { skip_evaluation--; yyval.ttype = c_alignof_expr (yyvsp[0].ttype); ; break;} case 56: -#line 458 "objc-parse.y" +#line 457 "objc-parse.y" { skip_evaluation--; yyval.ttype = c_alignof (groktypename (yyvsp[-1].ttype)); ; break;} case 57: -#line 461 "objc-parse.y" +#line 460 "objc-parse.y" { yyval.ttype = build_unary_op (REALPART_EXPR, yyvsp[0].ttype, 0); ; break;} case 58: -#line 463 "objc-parse.y" +#line 462 "objc-parse.y" { yyval.ttype = build_unary_op (IMAGPART_EXPR, yyvsp[0].ttype, 0); ; break;} case 59: -#line 465 "objc-parse.y" +#line 464 "objc-parse.y" { yyval.ttype = build_va_arg (yyvsp[-3].ttype, groktypename (yyvsp[-1].ttype)); ; break;} case 60: -#line 469 "objc-parse.y" +#line 468 "objc-parse.y" { skip_evaluation++; ; break;} case 61: -#line 473 "objc-parse.y" +#line 472 "objc-parse.y" { skip_evaluation++; ; break;} case 63: -#line 479 "objc-parse.y" +#line 478 "objc-parse.y" { tree type = groktypename (yyvsp[-2].ttype); yyval.ttype = build_c_cast (type, yyvsp[0].ttype); ; break;} case 64: -#line 482 "objc-parse.y" +#line 481 "objc-parse.y" { start_init (NULL_TREE, NULL, 0); yyvsp[-2].ttype = groktypename (yyvsp[-2].ttype); really_start_incremental_init (yyvsp[-2].ttype); ; break;} case 65: -#line 486 "objc-parse.y" +#line 485 "objc-parse.y" { char *name; tree result = pop_init_level (0); tree type = yyvsp[-5].ttype; @@ -2577,90 +2531,90 @@ case 65: ; break;} case 67: -#line 515 "objc-parse.y" +#line 514 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 68: -#line 517 "objc-parse.y" +#line 516 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 69: -#line 519 "objc-parse.y" +#line 518 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 70: -#line 521 "objc-parse.y" +#line 520 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 71: -#line 523 "objc-parse.y" +#line 522 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 72: -#line 525 "objc-parse.y" +#line 524 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 73: -#line 527 "objc-parse.y" +#line 526 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 74: -#line 529 "objc-parse.y" +#line 528 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 75: -#line 531 "objc-parse.y" +#line 530 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 76: -#line 533 "objc-parse.y" +#line 532 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 77: -#line 535 "objc-parse.y" +#line 534 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 78: -#line 537 "objc-parse.y" +#line 536 "objc-parse.y" { yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 79: -#line 539 "objc-parse.y" +#line 538 "objc-parse.y" { yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype)); skip_evaluation += yyvsp[-1].ttype == boolean_false_node; ; break;} case 80: -#line 542 "objc-parse.y" +#line 541 "objc-parse.y" { skip_evaluation -= yyvsp[-3].ttype == boolean_false_node; yyval.ttype = parser_build_binary_op (TRUTH_ANDIF_EXPR, yyvsp[-3].ttype, yyvsp[0].ttype); ; break;} case 81: -#line 545 "objc-parse.y" +#line 544 "objc-parse.y" { yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype)); skip_evaluation += yyvsp[-1].ttype == boolean_true_node; ; break;} case 82: -#line 548 "objc-parse.y" +#line 547 "objc-parse.y" { skip_evaluation -= yyvsp[-3].ttype == boolean_true_node; yyval.ttype = parser_build_binary_op (TRUTH_ORIF_EXPR, yyvsp[-3].ttype, yyvsp[0].ttype); ; break;} case 83: -#line 551 "objc-parse.y" +#line 550 "objc-parse.y" { yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype)); skip_evaluation += yyvsp[-1].ttype == boolean_false_node; ; break;} case 84: -#line 554 "objc-parse.y" +#line 553 "objc-parse.y" { skip_evaluation += ((yyvsp[-4].ttype == boolean_true_node) - (yyvsp[-4].ttype == boolean_false_node)); ; break;} case 85: -#line 557 "objc-parse.y" +#line 556 "objc-parse.y" { skip_evaluation -= yyvsp[-6].ttype == boolean_true_node; yyval.ttype = build_conditional_expr (yyvsp[-6].ttype, yyvsp[-3].ttype, yyvsp[0].ttype); ; break;} case 86: -#line 560 "objc-parse.y" +#line 559 "objc-parse.y" { if (pedantic) pedwarn ("ANSI C forbids omitting the middle term of a ?: expression"); /* Make sure first operand is calculated only once. */ @@ -2669,12 +2623,12 @@ case 86: skip_evaluation += yyvsp[-1].ttype == boolean_true_node; ; break;} case 87: -#line 567 "objc-parse.y" +#line 566 "objc-parse.y" { skip_evaluation -= yyvsp[-4].ttype == boolean_true_node; yyval.ttype = build_conditional_expr (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[0].ttype); ; break;} case 88: -#line 570 "objc-parse.y" +#line 569 "objc-parse.y" { char class; yyval.ttype = build_modify_expr (yyvsp[-2].ttype, NOP_EXPR, yyvsp[0].ttype); class = TREE_CODE_CLASS (TREE_CODE (yyval.ttype)); @@ -2684,7 +2638,7 @@ case 88: ; break;} case 89: -#line 578 "objc-parse.y" +#line 577 "objc-parse.y" { char class; yyval.ttype = build_modify_expr (yyvsp[-2].ttype, yyvsp[-1].code, yyvsp[0].ttype); /* This inhibits warnings in truthvalue_conversion. */ @@ -2695,7 +2649,7 @@ case 89: ; break;} case 90: -#line 590 "objc-parse.y" +#line 589 "objc-parse.y" { yyval.ttype = lastiddecl; if (!yyval.ttype || yyval.ttype == error_mark_node) @@ -2856,11 +2810,11 @@ case 90: ; break;} case 92: -#line 750 "objc-parse.y" +#line 749 "objc-parse.y" { yyval.ttype = combine_strings (yyvsp[0].ttype); ; break;} case 93: -#line 752 "objc-parse.y" +#line 751 "objc-parse.y" { char class = TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype)); if (class == 'e' || class == '1' || class == '2' || class == '<') @@ -2868,11 +2822,11 @@ case 93: yyval.ttype = yyvsp[-1].ttype; ; break;} case 94: -#line 758 "objc-parse.y" +#line 757 "objc-parse.y" { yyval.ttype = error_mark_node; ; break;} case 95: -#line 760 "objc-parse.y" +#line 759 "objc-parse.y" { tree rtl_exp; if (pedantic) pedwarn ("ANSI C forbids braced-groups within expressions"); @@ -2897,7 +2851,7 @@ case 95: ; break;} case 96: -#line 783 "objc-parse.y" +#line 782 "objc-parse.y" { /* Make sure we call expand_end_stmt_expr. Otherwise we are likely to lose sequences and crash later. */ @@ -2908,15 +2862,15 @@ case 96: ; break;} case 97: -#line 792 "objc-parse.y" +#line 791 "objc-parse.y" { yyval.ttype = build_function_call (yyvsp[-3].ttype, yyvsp[-1].ttype); ; break;} case 98: -#line 794 "objc-parse.y" +#line 793 "objc-parse.y" { yyval.ttype = build_array_ref (yyvsp[-3].ttype, yyvsp[-1].ttype); ; break;} case 99: -#line 796 "objc-parse.y" +#line 795 "objc-parse.y" { if (doing_objc_thang) { @@ -2930,7 +2884,7 @@ case 99: ; break;} case 100: -#line 808 "objc-parse.y" +#line 807 "objc-parse.y" { tree expr = build_indirect_ref (yyvsp[-2].ttype, "->"); @@ -2946,80 +2900,80 @@ case 100: ; break;} case 101: -#line 822 "objc-parse.y" +#line 821 "objc-parse.y" { yyval.ttype = build_unary_op (POSTINCREMENT_EXPR, yyvsp[-1].ttype, 0); ; break;} case 102: -#line 824 "objc-parse.y" +#line 823 "objc-parse.y" { yyval.ttype = build_unary_op (POSTDECREMENT_EXPR, yyvsp[-1].ttype, 0); ; break;} case 103: -#line 826 "objc-parse.y" +#line 825 "objc-parse.y" { yyval.ttype = build_message_expr (yyvsp[0].ttype); ; break;} case 104: -#line 828 "objc-parse.y" +#line 827 "objc-parse.y" { yyval.ttype = build_selector_expr (yyvsp[0].ttype); ; break;} case 105: -#line 830 "objc-parse.y" +#line 829 "objc-parse.y" { yyval.ttype = build_protocol_expr (yyvsp[0].ttype); ; break;} case 106: -#line 832 "objc-parse.y" +#line 831 "objc-parse.y" { yyval.ttype = build_encode_expr (yyvsp[0].ttype); ; break;} case 107: -#line 834 "objc-parse.y" +#line 833 "objc-parse.y" { yyval.ttype = build_objc_string_object (yyvsp[0].ttype); ; break;} case 109: -#line 841 "objc-parse.y" +#line 840 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 111: -#line 849 "objc-parse.y" +#line 848 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 114: -#line 857 "objc-parse.y" +#line 856 "objc-parse.y" { c_mark_varargs (); if (pedantic) pedwarn ("ANSI C does not permit use of `varargs.h'"); ; break;} case 115: -#line 867 "objc-parse.y" +#line 866 "objc-parse.y" { ; break;} case 120: -#line 883 "objc-parse.y" +#line 882 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-2].itype); ; break;} case 121: -#line 888 "objc-parse.y" +#line 887 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-2].itype); ; break;} case 122: -#line 893 "objc-parse.y" +#line 892 "objc-parse.y" { shadow_tag_warned (yyvsp[-1].ttype, 1); pedwarn ("empty declaration"); ; break;} case 123: -#line 896 "objc-parse.y" +#line 895 "objc-parse.y" { pedwarn ("empty declaration"); ; break;} case 124: -#line 905 "objc-parse.y" +#line 904 "objc-parse.y" { ; break;} case 129: -#line 920 "objc-parse.y" +#line 919 "objc-parse.y" { yyval.itype = suspend_momentary (); pending_xref_error (); declspec_stack = tree_cons (prefix_attributes, @@ -3029,131 +2983,131 @@ case 129: ¤t_declspecs, &prefix_attributes); ; break;} case 130: -#line 931 "objc-parse.y" +#line 930 "objc-parse.y" { prefix_attributes = chainon (prefix_attributes, yyvsp[0].ttype); ; break;} case 131: -#line 936 "objc-parse.y" +#line 935 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-2].itype); ; break;} case 132: -#line 941 "objc-parse.y" +#line 940 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-2].itype); ; break;} case 133: -#line 946 "objc-parse.y" +#line 945 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-1].itype); ; break;} case 134: -#line 951 "objc-parse.y" +#line 950 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-1].itype); ; break;} case 135: -#line 956 "objc-parse.y" +#line 955 "objc-parse.y" { shadow_tag (yyvsp[-1].ttype); ; break;} case 136: -#line 958 "objc-parse.y" +#line 957 "objc-parse.y" { pedwarn ("empty declaration"); ; break;} case 137: -#line 960 "objc-parse.y" +#line 959 "objc-parse.y" { pedantic = yyvsp[-1].itype; ; break;} case 138: -#line 970 "objc-parse.y" +#line 969 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 139: -#line 972 "objc-parse.y" +#line 971 "objc-parse.y" { yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ; break;} case 140: -#line 976 "objc-parse.y" +#line 975 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 141: -#line 978 "objc-parse.y" +#line 977 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ; break;} case 142: -#line 980 "objc-parse.y" +#line 979 "objc-parse.y" { if (extra_warnings) warning ("`%s' is not at beginning of declaration", IDENTIFIER_POINTER (yyvsp[0].ttype)); yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ; break;} case 143: -#line 985 "objc-parse.y" +#line 984 "objc-parse.y" { yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ; break;} case 144: -#line 990 "objc-parse.y" +#line 989 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 145: -#line 992 "objc-parse.y" +#line 991 "objc-parse.y" { yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ; break;} case 146: -#line 997 "objc-parse.y" +#line 996 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 147: -#line 999 "objc-parse.y" +#line 998 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ; break;} case 148: -#line 1001 "objc-parse.y" +#line 1000 "objc-parse.y" { if (extra_warnings) warning ("`%s' is not at beginning of declaration", IDENTIFIER_POINTER (yyvsp[0].ttype)); yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ; break;} case 149: -#line 1014 "objc-parse.y" +#line 1013 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 150: -#line 1016 "objc-parse.y" +#line 1015 "objc-parse.y" { yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, NULL_TREE); ; break;} case 151: -#line 1018 "objc-parse.y" +#line 1017 "objc-parse.y" { yyval.ttype = chainon (yyvsp[0].ttype, yyvsp[-1].ttype); ; break;} case 152: -#line 1020 "objc-parse.y" +#line 1019 "objc-parse.y" { yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ; break;} case 153: -#line 1025 "objc-parse.y" +#line 1024 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); TREE_STATIC (yyval.ttype) = 1; ; break;} case 154: -#line 1028 "objc-parse.y" +#line 1027 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ; break;} case 155: -#line 1030 "objc-parse.y" +#line 1029 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); TREE_STATIC (yyval.ttype) = 1; ; break;} case 156: -#line 1033 "objc-parse.y" +#line 1032 "objc-parse.y" { if (extra_warnings && TREE_STATIC (yyvsp[-1].ttype)) warning ("`%s' is not at beginning of declaration", IDENTIFIER_POINTER (yyvsp[0].ttype)); @@ -3161,150 +3115,150 @@ case 156: TREE_STATIC (yyval.ttype) = TREE_STATIC (yyvsp[-1].ttype); ; break;} case 157: -#line 1047 "objc-parse.y" +#line 1046 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 158: -#line 1049 "objc-parse.y" +#line 1048 "objc-parse.y" { yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ; break;} case 159: -#line 1053 "objc-parse.y" +#line 1052 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 160: -#line 1055 "objc-parse.y" +#line 1054 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ; break;} case 163: -#line 1065 "objc-parse.y" +#line 1064 "objc-parse.y" { /* For a typedef name, record the meaning, not the name. In case of `foo foo, bar;'. */ yyval.ttype = lookup_name (yyvsp[0].ttype); ; break;} case 164: -#line 1069 "objc-parse.y" +#line 1068 "objc-parse.y" { yyval.ttype = get_static_reference (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 165: -#line 1071 "objc-parse.y" +#line 1070 "objc-parse.y" { yyval.ttype = get_object_reference (yyvsp[0].ttype); ; break;} case 166: -#line 1076 "objc-parse.y" +#line 1075 "objc-parse.y" { yyval.ttype = get_object_reference (yyvsp[0].ttype); ; break;} case 167: -#line 1078 "objc-parse.y" +#line 1077 "objc-parse.y" { yyval.ttype = TREE_TYPE (yyvsp[-1].ttype); ; break;} case 168: -#line 1080 "objc-parse.y" +#line 1079 "objc-parse.y" { yyval.ttype = groktypename (yyvsp[-1].ttype); ; break;} case 176: -#line 1102 "objc-parse.y" +#line 1101 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 177: -#line 1104 "objc-parse.y" +#line 1103 "objc-parse.y" { if (TREE_CHAIN (yyvsp[-1].ttype)) yyvsp[-1].ttype = combine_strings (yyvsp[-1].ttype); yyval.ttype = yyvsp[-1].ttype; ; break;} case 178: -#line 1111 "objc-parse.y" +#line 1110 "objc-parse.y" { yyval.ttype = start_decl (yyvsp[-3].ttype, current_declspecs, 1, yyvsp[-1].ttype, prefix_attributes); start_init (yyval.ttype, yyvsp[-2].ttype, global_bindings_p ()); ; break;} case 179: -#line 1116 "objc-parse.y" +#line 1115 "objc-parse.y" { finish_init (); finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype); ; break;} case 180: -#line 1119 "objc-parse.y" +#line 1118 "objc-parse.y" { tree d = start_decl (yyvsp[-2].ttype, current_declspecs, 0, yyvsp[0].ttype, prefix_attributes); finish_decl (d, NULL_TREE, yyvsp[-1].ttype); ; break;} case 181: -#line 1127 "objc-parse.y" +#line 1126 "objc-parse.y" { yyval.ttype = start_decl (yyvsp[-3].ttype, current_declspecs, 1, yyvsp[-1].ttype, prefix_attributes); start_init (yyval.ttype, yyvsp[-2].ttype, global_bindings_p ()); ; break;} case 182: -#line 1132 "objc-parse.y" +#line 1131 "objc-parse.y" { finish_init (); decl_attributes (yyvsp[-1].ttype, yyvsp[-3].ttype, prefix_attributes); finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype); ; break;} case 183: -#line 1136 "objc-parse.y" +#line 1135 "objc-parse.y" { tree d = start_decl (yyvsp[-2].ttype, current_declspecs, 0, yyvsp[0].ttype, prefix_attributes); finish_decl (d, NULL_TREE, yyvsp[-1].ttype); ; break;} case 184: -#line 1144 "objc-parse.y" +#line 1143 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 185: -#line 1146 "objc-parse.y" +#line 1145 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 186: -#line 1151 "objc-parse.y" +#line 1150 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 187: -#line 1153 "objc-parse.y" +#line 1152 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 188: -#line 1158 "objc-parse.y" +#line 1157 "objc-parse.y" { yyval.ttype = yyvsp[-2].ttype; ; break;} case 189: -#line 1163 "objc-parse.y" +#line 1162 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 190: -#line 1165 "objc-parse.y" +#line 1164 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 191: -#line 1170 "objc-parse.y" +#line 1169 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 192: -#line 1172 "objc-parse.y" +#line 1171 "objc-parse.y" { yyval.ttype = build_tree_list (yyvsp[0].ttype, NULL_TREE); ; break;} case 193: -#line 1174 "objc-parse.y" +#line 1173 "objc-parse.y" { yyval.ttype = build_tree_list (yyvsp[-3].ttype, build_tree_list (NULL_TREE, yyvsp[-1].ttype)); ; break;} case 194: -#line 1176 "objc-parse.y" +#line 1175 "objc-parse.y" { yyval.ttype = build_tree_list (yyvsp[-5].ttype, tree_cons (NULL_TREE, yyvsp[-3].ttype, yyvsp[-1].ttype)); ; break;} case 195: -#line 1178 "objc-parse.y" +#line 1177 "objc-parse.y" { yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ; break;} case 201: -#line 1196 "objc-parse.y" +#line 1195 "objc-parse.y" { really_start_incremental_init (NULL_TREE); /* Note that the call to clear_momentary is in process_init_element. */ push_momentary (); ; break;} case 202: -#line 1201 "objc-parse.y" +#line 1200 "objc-parse.y" { yyval.ttype = pop_init_level (0); if (yyval.ttype == error_mark_node && ! (yychar == STRING || yychar == CONSTANT)) @@ -3313,36 +3267,36 @@ case 202: pop_momentary_nofree (); ; break;} case 203: -#line 1209 "objc-parse.y" +#line 1208 "objc-parse.y" { yyval.ttype = error_mark_node; ; break;} case 204: -#line 1215 "objc-parse.y" +#line 1214 "objc-parse.y" { if (pedantic) pedwarn ("ANSI C forbids empty initializer braces"); ; break;} case 210: -#line 1231 "objc-parse.y" +#line 1230 "objc-parse.y" { set_init_label (yyvsp[-1].ttype); ; break;} case 213: -#line 1238 "objc-parse.y" +#line 1237 "objc-parse.y" { push_init_level (0); ; break;} case 214: -#line 1240 "objc-parse.y" +#line 1239 "objc-parse.y" { process_init_element (pop_init_level (0)); ; break;} case 215: -#line 1242 "objc-parse.y" +#line 1241 "objc-parse.y" { process_init_element (yyvsp[0].ttype); ; break;} case 219: -#line 1253 "objc-parse.y" +#line 1252 "objc-parse.y" { set_init_label (yyvsp[0].ttype); ; break;} case 220: -#line 1261 "objc-parse.y" +#line 1260 "objc-parse.y" { if (pedantic) pedwarn ("ANSI C forbids nested functions"); @@ -3356,16 +3310,16 @@ case 220: reinit_parse_for_function (); ; break;} case 221: -#line 1273 "objc-parse.y" +#line 1272 "objc-parse.y" { store_parm_decls (); ; break;} case 222: -#line 1281 "objc-parse.y" +#line 1280 "objc-parse.y" { finish_function (1); pop_function_context (); ; break;} case 223: -#line 1287 "objc-parse.y" +#line 1286 "objc-parse.y" { if (pedantic) pedwarn ("ANSI C forbids nested functions"); @@ -3379,197 +3333,197 @@ case 223: reinit_parse_for_function (); ; break;} case 224: -#line 1299 "objc-parse.y" +#line 1298 "objc-parse.y" { store_parm_decls (); ; break;} case 225: -#line 1307 "objc-parse.y" +#line 1306 "objc-parse.y" { finish_function (1); pop_function_context (); ; break;} case 228: -#line 1323 "objc-parse.y" +#line 1322 "objc-parse.y" { yyval.ttype = yyvsp[-1].ttype; ; break;} case 229: -#line 1325 "objc-parse.y" +#line 1324 "objc-parse.y" { yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ; break;} case 230: -#line 1330 "objc-parse.y" +#line 1329 "objc-parse.y" { yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ; break;} case 231: -#line 1332 "objc-parse.y" +#line 1331 "objc-parse.y" { yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ; break;} case 232: -#line 1334 "objc-parse.y" +#line 1333 "objc-parse.y" { yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 233: -#line 1341 "objc-parse.y" +#line 1340 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 236: -#line 1353 "objc-parse.y" +#line 1352 "objc-parse.y" { yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ; break;} case 237: -#line 1358 "objc-parse.y" +#line 1357 "objc-parse.y" { yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ; break;} case 238: -#line 1360 "objc-parse.y" +#line 1359 "objc-parse.y" { yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ; break;} case 239: -#line 1362 "objc-parse.y" +#line 1361 "objc-parse.y" { yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 240: -#line 1369 "objc-parse.y" +#line 1368 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 242: -#line 1378 "objc-parse.y" +#line 1377 "objc-parse.y" { yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ; break;} case 243: -#line 1383 "objc-parse.y" +#line 1382 "objc-parse.y" { yyval.ttype = yyvsp[-1].ttype; ; break;} case 244: -#line 1385 "objc-parse.y" +#line 1384 "objc-parse.y" { yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 245: -#line 1387 "objc-parse.y" +#line 1386 "objc-parse.y" { yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ; break;} case 246: -#line 1389 "objc-parse.y" +#line 1388 "objc-parse.y" { yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ; break;} case 247: -#line 1396 "objc-parse.y" +#line 1395 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 249: -#line 1402 "objc-parse.y" +#line 1401 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 250: -#line 1404 "objc-parse.y" +#line 1403 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 251: -#line 1409 "objc-parse.y" +#line 1408 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 252: -#line 1411 "objc-parse.y" +#line 1410 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 253: -#line 1416 "objc-parse.y" +#line 1415 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 254: -#line 1418 "objc-parse.y" +#line 1417 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 255: -#line 1423 "objc-parse.y" +#line 1422 "objc-parse.y" { yyval.ttype = start_struct (RECORD_TYPE, yyvsp[-1].ttype); /* Start scope of tag before parsing components. */ ; break;} case 256: -#line 1427 "objc-parse.y" +#line 1426 "objc-parse.y" { yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, chainon (yyvsp[-6].ttype, yyvsp[0].ttype)); ; break;} case 257: -#line 1429 "objc-parse.y" +#line 1428 "objc-parse.y" { yyval.ttype = finish_struct (start_struct (RECORD_TYPE, NULL_TREE), yyvsp[-2].ttype, chainon (yyvsp[-4].ttype, yyvsp[0].ttype)); ; break;} case 258: -#line 1433 "objc-parse.y" +#line 1432 "objc-parse.y" { yyval.ttype = xref_tag (RECORD_TYPE, yyvsp[0].ttype); ; break;} case 259: -#line 1435 "objc-parse.y" +#line 1434 "objc-parse.y" { yyval.ttype = start_struct (UNION_TYPE, yyvsp[-1].ttype); ; break;} case 260: -#line 1437 "objc-parse.y" +#line 1436 "objc-parse.y" { yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, chainon (yyvsp[-6].ttype, yyvsp[0].ttype)); ; break;} case 261: -#line 1439 "objc-parse.y" +#line 1438 "objc-parse.y" { yyval.ttype = finish_struct (start_struct (UNION_TYPE, NULL_TREE), yyvsp[-2].ttype, chainon (yyvsp[-4].ttype, yyvsp[0].ttype)); ; break;} case 262: -#line 1443 "objc-parse.y" +#line 1442 "objc-parse.y" { yyval.ttype = xref_tag (UNION_TYPE, yyvsp[0].ttype); ; break;} case 263: -#line 1445 "objc-parse.y" +#line 1444 "objc-parse.y" { yyvsp[0].itype = suspend_momentary (); yyval.ttype = start_enum (yyvsp[-1].ttype); ; break;} case 264: -#line 1448 "objc-parse.y" +#line 1447 "objc-parse.y" { yyval.ttype= finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), chainon (yyvsp[-7].ttype, yyvsp[0].ttype)); resume_momentary (yyvsp[-5].itype); ; break;} case 265: -#line 1451 "objc-parse.y" +#line 1450 "objc-parse.y" { yyvsp[0].itype = suspend_momentary (); yyval.ttype = start_enum (NULL_TREE); ; break;} case 266: -#line 1454 "objc-parse.y" +#line 1453 "objc-parse.y" { yyval.ttype= finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), chainon (yyvsp[-6].ttype, yyvsp[0].ttype)); resume_momentary (yyvsp[-5].itype); ; break;} case 267: -#line 1457 "objc-parse.y" +#line 1456 "objc-parse.y" { yyval.ttype = xref_tag (ENUMERAL_TYPE, yyvsp[0].ttype); ; break;} case 271: -#line 1468 "objc-parse.y" +#line 1467 "objc-parse.y" { if (pedantic && ! flag_isoc9x) pedwarn ("comma at end of enumerator list"); ; break;} case 272: -#line 1474 "objc-parse.y" +#line 1473 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 273: -#line 1476 "objc-parse.y" +#line 1475 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); pedwarn ("no semicolon at end of struct or union"); ; break;} case 274: -#line 1481 "objc-parse.y" +#line 1480 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 275: -#line 1483 "objc-parse.y" +#line 1482 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[-1].ttype); ; break;} case 276: -#line 1485 "objc-parse.y" +#line 1484 "objc-parse.y" { if (pedantic) pedwarn ("extra semicolon in struct or union specified"); ; break;} case 277: -#line 1489 "objc-parse.y" +#line 1488 "objc-parse.y" { tree interface = lookup_interface (yyvsp[-1].ttype); @@ -3584,7 +3538,7 @@ case 277: ; break;} case 278: -#line 1514 "objc-parse.y" +#line 1513 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -3592,14 +3546,14 @@ case 278: resume_momentary (yyvsp[-1].itype); ; break;} case 279: -#line 1520 "objc-parse.y" +#line 1519 "objc-parse.y" { if (pedantic) pedwarn ("ANSI C forbids member declarations with no members"); shadow_tag(yyvsp[0].ttype); yyval.ttype = NULL_TREE; ; break;} case 280: -#line 1525 "objc-parse.y" +#line 1524 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -3607,144 +3561,144 @@ case 280: resume_momentary (yyvsp[-1].itype); ; break;} case 281: -#line 1531 "objc-parse.y" +#line 1530 "objc-parse.y" { if (pedantic) pedwarn ("ANSI C forbids member declarations with no members"); shadow_tag(yyvsp[0].ttype); yyval.ttype = NULL_TREE; ; break;} case 282: -#line 1536 "objc-parse.y" +#line 1535 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 283: -#line 1538 "objc-parse.y" +#line 1537 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; pedantic = yyvsp[-1].itype; ; break;} case 285: -#line 1545 "objc-parse.y" +#line 1544 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 286: -#line 1550 "objc-parse.y" +#line 1549 "objc-parse.y" { yyval.ttype = grokfield (yyvsp[-3].filename, yyvsp[-2].lineno, yyvsp[-1].ttype, current_declspecs, NULL_TREE); decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ; break;} case 287: -#line 1554 "objc-parse.y" +#line 1553 "objc-parse.y" { yyval.ttype = grokfield (yyvsp[-5].filename, yyvsp[-4].lineno, yyvsp[-3].ttype, current_declspecs, yyvsp[-1].ttype); decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ; break;} case 288: -#line 1557 "objc-parse.y" +#line 1556 "objc-parse.y" { yyval.ttype = grokfield (yyvsp[-4].filename, yyvsp[-3].lineno, NULL_TREE, current_declspecs, yyvsp[-1].ttype); decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ; break;} case 290: -#line 1569 "objc-parse.y" +#line 1568 "objc-parse.y" { if (yyvsp[-2].ttype == error_mark_node) yyval.ttype = yyvsp[-2].ttype; else yyval.ttype = chainon (yyvsp[0].ttype, yyvsp[-2].ttype); ; break;} case 291: -#line 1574 "objc-parse.y" +#line 1573 "objc-parse.y" { yyval.ttype = error_mark_node; ; break;} case 292: -#line 1580 "objc-parse.y" +#line 1579 "objc-parse.y" { yyval.ttype = build_enumerator (yyvsp[0].ttype, NULL_TREE); ; break;} case 293: -#line 1582 "objc-parse.y" +#line 1581 "objc-parse.y" { yyval.ttype = build_enumerator (yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 294: -#line 1587 "objc-parse.y" +#line 1586 "objc-parse.y" { yyval.ttype = build_tree_list (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 295: -#line 1589 "objc-parse.y" +#line 1588 "objc-parse.y" { yyval.ttype = build_tree_list (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 296: -#line 1594 "objc-parse.y" +#line 1593 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 298: -#line 1600 "objc-parse.y" +#line 1599 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ; break;} case 299: -#line 1602 "objc-parse.y" +#line 1601 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ; break;} case 300: -#line 1607 "objc-parse.y" +#line 1606 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 301: -#line 1609 "objc-parse.y" +#line 1608 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ; break;} case 302: -#line 1614 "objc-parse.y" +#line 1613 "objc-parse.y" { yyval.ttype = yyvsp[-1].ttype; ; break;} case 303: -#line 1617 "objc-parse.y" +#line 1616 "objc-parse.y" { yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 304: -#line 1619 "objc-parse.y" +#line 1618 "objc-parse.y" { yyval.ttype = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE); ; break;} case 305: -#line 1621 "objc-parse.y" +#line 1620 "objc-parse.y" { yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ; break;} case 306: -#line 1623 "objc-parse.y" +#line 1622 "objc-parse.y" { yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ; break;} case 307: -#line 1625 "objc-parse.y" +#line 1624 "objc-parse.y" { yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ; break;} case 308: -#line 1627 "objc-parse.y" +#line 1626 "objc-parse.y" { yyval.ttype = build_nt (CALL_EXPR, NULL_TREE, yyvsp[0].ttype, NULL_TREE); ; break;} case 309: -#line 1629 "objc-parse.y" +#line 1628 "objc-parse.y" { yyval.ttype = build_nt (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ; break;} case 310: -#line 1631 "objc-parse.y" +#line 1630 "objc-parse.y" { yyval.ttype = build_nt (ARRAY_REF, NULL_TREE, NULL_TREE); ; break;} case 311: -#line 1635 "objc-parse.y" +#line 1634 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 312: -#line 1644 "objc-parse.y" +#line 1643 "objc-parse.y" { if (pedantic && yyvsp[0].ends_in_label) pedwarn ("ANSI C forbids label at end of compound statement"); ; break;} case 314: -#line 1653 "objc-parse.y" +#line 1652 "objc-parse.y" { yyval.ends_in_label = yyvsp[0].ends_in_label; ; break;} case 315: -#line 1655 "objc-parse.y" +#line 1654 "objc-parse.y" { yyval.ends_in_label = 0; ; break;} case 319: -#line 1667 "objc-parse.y" +#line 1666 "objc-parse.y" { emit_line_note (input_filename, lineno); pushlevel (0); clear_last_expr (); @@ -3755,12 +3709,12 @@ case 319: ; break;} case 321: -#line 1682 "objc-parse.y" +#line 1681 "objc-parse.y" { if (pedantic) pedwarn ("ANSI C forbids label declarations"); ; break;} case 324: -#line 1693 "objc-parse.y" +#line 1692 "objc-parse.y" { tree link; for (link = yyvsp[-1].ttype; link; link = TREE_CHAIN (link)) { @@ -3771,19 +3725,19 @@ case 324: ; break;} case 325: -#line 1707 "objc-parse.y" +#line 1706 "objc-parse.y" {; break;} case 327: -#line 1711 "objc-parse.y" +#line 1710 "objc-parse.y" { compstmt_count++; ; break;} case 328: -#line 1714 "objc-parse.y" +#line 1713 "objc-parse.y" { yyval.ttype = convert (void_type_node, integer_zero_node); ; break;} case 329: -#line 1716 "objc-parse.y" +#line 1715 "objc-parse.y" { emit_line_note (input_filename, lineno); expand_end_bindings (getdecls (), 1, 0); yyval.ttype = poplevel (1, 1, 0); @@ -3793,7 +3747,7 @@ case 329: pop_momentary (); ; break;} case 330: -#line 1724 "objc-parse.y" +#line 1723 "objc-parse.y" { emit_line_note (input_filename, lineno); expand_end_bindings (getdecls (), kept_level_p (), 0); yyval.ttype = poplevel (kept_level_p (), 0, 0); @@ -3803,7 +3757,7 @@ case 330: pop_momentary (); ; break;} case 331: -#line 1732 "objc-parse.y" +#line 1731 "objc-parse.y" { emit_line_note (input_filename, lineno); expand_end_bindings (getdecls (), kept_level_p (), 0); yyval.ttype = poplevel (kept_level_p (), 0, 0); @@ -3813,7 +3767,7 @@ case 331: pop_momentary (); ; break;} case 332: -#line 1743 "objc-parse.y" +#line 1742 "objc-parse.y" { if (current_function_decl == 0) { error ("braced-group within expression allowed only inside a function"); @@ -3831,11 +3785,11 @@ case 332: ; break;} case 333: -#line 1760 "objc-parse.y" +#line 1759 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 336: -#line 1774 "objc-parse.y" +#line 1773 "objc-parse.y" { emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno); c_expand_start_cond (truthvalue_conversion (yyvsp[-1].ttype), 0, compstmt_count); @@ -3845,7 +3799,7 @@ case 336: position_after_white_space (); ; break;} case 337: -#line 1788 "objc-parse.y" +#line 1787 "objc-parse.y" { stmt_count++; compstmt_count++; emit_line_note (yyvsp[-2].filename, yyvsp[-1].lineno); @@ -3855,43 +3809,43 @@ case 337: position_after_white_space (); ; break;} case 338: -#line 1796 "objc-parse.y" +#line 1795 "objc-parse.y" { expand_loop_continue_here (); ; break;} case 339: -#line 1800 "objc-parse.y" +#line 1799 "objc-parse.y" { yyval.filename = input_filename; ; break;} case 340: -#line 1804 "objc-parse.y" +#line 1803 "objc-parse.y" { yyval.lineno = lineno; ; break;} case 341: -#line 1809 "objc-parse.y" +#line 1808 "objc-parse.y" { ; break;} case 342: -#line 1814 "objc-parse.y" +#line 1813 "objc-parse.y" { ; break;} case 343: -#line 1819 "objc-parse.y" +#line 1818 "objc-parse.y" { yyval.ends_in_label = yyvsp[0].ends_in_label; ; break;} case 344: -#line 1824 "objc-parse.y" +#line 1823 "objc-parse.y" { yyval.ends_in_label = 0; ; break;} case 345: -#line 1826 "objc-parse.y" +#line 1825 "objc-parse.y" { yyval.ends_in_label = 1; ; break;} case 346: -#line 1832 "objc-parse.y" +#line 1831 "objc-parse.y" { stmt_count++; ; break;} case 348: -#line 1835 "objc-parse.y" +#line 1834 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno); /* It appears that this should not be done--that a non-lvalue array @@ -3910,19 +3864,19 @@ case 348: clear_momentary (); ; break;} case 349: -#line 1852 "objc-parse.y" +#line 1851 "objc-parse.y" { c_expand_start_else (); yyvsp[-1].itype = stmt_count; position_after_white_space (); ; break;} case 350: -#line 1856 "objc-parse.y" +#line 1855 "objc-parse.y" { c_expand_end_cond (); if (extra_warnings && stmt_count == yyvsp[-3].itype) warning ("empty body in an else-statement"); ; break;} case 351: -#line 1860 "objc-parse.y" +#line 1859 "objc-parse.y" { c_expand_end_cond (); /* This warning is here instead of in simple_if, because we do not want a warning if an empty if is followed by an @@ -3933,11 +3887,11 @@ case 351: "empty body in an if-statement"); ; break;} case 352: -#line 1872 "objc-parse.y" +#line 1871 "objc-parse.y" { c_expand_end_cond (); ; break;} case 353: -#line 1874 "objc-parse.y" +#line 1873 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-2].filename, yyvsp[-1].lineno); /* The emit_nop used to come before emit_line_note, @@ -3949,7 +3903,7 @@ case 353: emit_nop (); ; break;} case 354: -#line 1884 "objc-parse.y" +#line 1883 "objc-parse.y" { /* Don't start the loop till we have succeeded in parsing the end test. This is to make sure that we end every loop we start. */ @@ -3960,11 +3914,11 @@ case 354: position_after_white_space (); ; break;} case 355: -#line 1893 "objc-parse.y" +#line 1892 "objc-parse.y" { expand_end_loop (); ; break;} case 356: -#line 1896 "objc-parse.y" +#line 1895 "objc-parse.y" { emit_line_note (input_filename, lineno); expand_exit_loop_if_false (NULL_PTR, truthvalue_conversion (yyvsp[-2].ttype)); @@ -3972,12 +3926,12 @@ case 356: clear_momentary (); ; break;} case 357: -#line 1903 "objc-parse.y" +#line 1902 "objc-parse.y" { expand_end_loop (); clear_momentary (); ; break;} case 358: -#line 1907 "objc-parse.y" +#line 1906 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno); /* See comment in `while' alternative, above. */ @@ -3990,12 +3944,12 @@ case 358: ; break;} case 359: -#line 1919 "objc-parse.y" +#line 1918 "objc-parse.y" { yyvsp[0].lineno = lineno; yyval.filename = input_filename; ; break;} case 360: -#line 1922 "objc-parse.y" +#line 1921 "objc-parse.y" { /* Start the loop. Doing this after parsing all the expressions ensures we will end the loop. */ @@ -4013,7 +3967,7 @@ case 360: position_after_white_space (); ; break;} case 361: -#line 1938 "objc-parse.y" +#line 1937 "objc-parse.y" { /* Emit the increment expression, with a line number. */ emit_line_note (yyvsp[-4].filename, yyvsp[-5].lineno); expand_loop_continue_here (); @@ -4026,7 +3980,7 @@ case 361: expand_end_loop (); ; break;} case 362: -#line 1949 "objc-parse.y" +#line 1948 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno); c_expand_start_case (yyvsp[-1].ttype); @@ -4036,7 +3990,7 @@ case 362: position_after_white_space (); ; break;} case 363: -#line 1957 "objc-parse.y" +#line 1956 "objc-parse.y" { expand_end_case (yyvsp[-3].ttype); if (yychar == CONSTANT || yychar == STRING) pop_momentary_nofree (); @@ -4044,33 +3998,33 @@ case 363: pop_momentary (); ; break;} case 364: -#line 1963 "objc-parse.y" +#line 1962 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno); if ( ! expand_exit_something ()) error ("break statement not within loop or switch"); ; break;} case 365: -#line 1968 "objc-parse.y" +#line 1967 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno); if (! expand_continue_loop (NULL_PTR)) error ("continue statement not within a loop"); ; break;} case 366: -#line 1973 "objc-parse.y" +#line 1972 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno); c_expand_return (NULL_TREE); ; break;} case 367: -#line 1977 "objc-parse.y" +#line 1976 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-4].filename, yyvsp[-3].lineno); c_expand_return (yyvsp[-1].ttype); ; break;} case 368: -#line 1981 "objc-parse.y" +#line 1980 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-7].filename, yyvsp[-6].lineno); STRIP_NOPS (yyvsp[-2].ttype); @@ -4082,7 +4036,7 @@ case 368: error ("argument of `asm' is not a constant string"); ; break;} case 369: -#line 1992 "objc-parse.y" +#line 1991 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-9].filename, yyvsp[-8].lineno); c_expand_asm_operands (yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE, NULL_TREE, @@ -4090,7 +4044,7 @@ case 369: input_filename, lineno); ; break;} case 370: -#line 1999 "objc-parse.y" +#line 1998 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-11].filename, yyvsp[-10].lineno); c_expand_asm_operands (yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE, @@ -4098,7 +4052,7 @@ case 370: input_filename, lineno); ; break;} case 371: -#line 2007 "objc-parse.y" +#line 2006 "objc-parse.y" { stmt_count++; emit_line_note (yyvsp[-13].filename, yyvsp[-12].lineno); c_expand_asm_operands (yyvsp[-8].ttype, yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype, @@ -4106,7 +4060,7 @@ case 371: input_filename, lineno); ; break;} case 372: -#line 2013 "objc-parse.y" +#line 2012 "objc-parse.y" { tree decl; stmt_count++; emit_line_note (yyvsp[-4].filename, yyvsp[-3].lineno); @@ -4119,7 +4073,7 @@ case 372: ; break;} case 373: -#line 2024 "objc-parse.y" +#line 2023 "objc-parse.y" { if (pedantic) pedwarn ("ANSI C forbids `goto *expr;'"); stmt_count++; @@ -4127,7 +4081,7 @@ case 373: expand_computed_goto (convert (ptr_type_node, yyvsp[-1].ttype)); ; break;} case 376: -#line 2039 "objc-parse.y" +#line 2038 "objc-parse.y" { /* The value returned by this action is */ /* 1 if everything is OK */ @@ -4150,14 +4104,14 @@ case 376: ; break;} case 377: -#line 2060 "objc-parse.y" +#line 2059 "objc-parse.y" { if (yyvsp[-1].itype) iterator_for_loop_end (yyvsp[-3].ttype); ; break;} case 378: -#line 2095 "objc-parse.y" +#line 2094 "objc-parse.y" { register tree value = check_case_value (yyvsp[-1].ttype); register tree label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); @@ -4190,7 +4144,7 @@ case 378: position_after_white_space (); ; break;} case 379: -#line 2126 "objc-parse.y" +#line 2125 "objc-parse.y" { register tree value1 = check_case_value (yyvsp[-3].ttype); register tree value2 = check_case_value (yyvsp[-1].ttype); register tree label @@ -4223,7 +4177,7 @@ case 379: position_after_white_space (); ; break;} case 380: -#line 2157 "objc-parse.y" +#line 2156 "objc-parse.y" { tree duplicate; register tree label @@ -4240,7 +4194,7 @@ case 380: position_after_white_space (); ; break;} case 381: -#line 2172 "objc-parse.y" +#line 2171 "objc-parse.y" { tree label = define_label (input_filename, lineno, yyvsp[-2].ttype); stmt_count++; emit_nop (); @@ -4252,52 +4206,52 @@ case 381: position_after_white_space (); ; break;} case 382: -#line 2187 "objc-parse.y" +#line 2186 "objc-parse.y" { emit_line_note (input_filename, lineno); yyval.ttype = NULL_TREE; ; break;} case 383: -#line 2190 "objc-parse.y" +#line 2189 "objc-parse.y" { emit_line_note (input_filename, lineno); ; break;} case 384: -#line 2195 "objc-parse.y" +#line 2194 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 386: -#line 2202 "objc-parse.y" +#line 2201 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 389: -#line 2209 "objc-parse.y" +#line 2208 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 390: -#line 2214 "objc-parse.y" +#line 2213 "objc-parse.y" { yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ; break;} case 391: -#line 2219 "objc-parse.y" +#line 2218 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, combine_strings (yyvsp[0].ttype), NULL_TREE); ; break;} case 392: -#line 2221 "objc-parse.y" +#line 2220 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, combine_strings (yyvsp[0].ttype), yyvsp[-2].ttype); ; break;} case 393: -#line 2227 "objc-parse.y" +#line 2226 "objc-parse.y" { pushlevel (0); clear_parm_order (); declare_parm_level (0); ; break;} case 394: -#line 2231 "objc-parse.y" +#line 2230 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; parmlist_tags_warning (); poplevel (0, 0, 0); ; break;} case 396: -#line 2239 "objc-parse.y" +#line 2238 "objc-parse.y" { tree parm; if (pedantic) pedwarn ("ANSI C forbids forward parameter declarations"); @@ -4307,19 +4261,19 @@ case 396: clear_parm_order (); ; break;} case 397: -#line 2247 "objc-parse.y" +#line 2246 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; ; break;} case 398: -#line 2249 "objc-parse.y" +#line 2248 "objc-parse.y" { yyval.ttype = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE); ; break;} case 399: -#line 2255 "objc-parse.y" +#line 2254 "objc-parse.y" { yyval.ttype = get_parm_info (0); ; break;} case 400: -#line 2257 "objc-parse.y" +#line 2256 "objc-parse.y" { yyval.ttype = get_parm_info (0); /* Gcc used to allow this as an extension. However, it does not work for all targets, and thus has been disabled. @@ -4331,23 +4285,23 @@ case 400: ; break;} case 401: -#line 2267 "objc-parse.y" +#line 2266 "objc-parse.y" { yyval.ttype = get_parm_info (1); ; break;} case 402: -#line 2269 "objc-parse.y" +#line 2268 "objc-parse.y" { yyval.ttype = get_parm_info (0); ; break;} case 403: -#line 2274 "objc-parse.y" +#line 2273 "objc-parse.y" { push_parm_decl (yyvsp[0].ttype); ; break;} case 404: -#line 2276 "objc-parse.y" +#line 2275 "objc-parse.y" { push_parm_decl (yyvsp[0].ttype); ; break;} case 405: -#line 2283 "objc-parse.y" +#line 2282 "objc-parse.y" { yyval.ttype = build_tree_list (build_tree_list (current_declspecs, yyvsp[-1].ttype), build_tree_list (prefix_attributes, @@ -4358,7 +4312,7 @@ case 405: resume_momentary (yyvsp[-2].itype); ; break;} case 406: -#line 2292 "objc-parse.y" +#line 2291 "objc-parse.y" { yyval.ttype = build_tree_list (build_tree_list (current_declspecs, yyvsp[-1].ttype), build_tree_list (prefix_attributes, @@ -4369,7 +4323,7 @@ case 406: resume_momentary (yyvsp[-2].itype); ; break;} case 407: -#line 2301 "objc-parse.y" +#line 2300 "objc-parse.y" { yyval.ttype = build_tree_list (build_tree_list (current_declspecs, yyvsp[-1].ttype), build_tree_list (prefix_attributes, @@ -4380,7 +4334,7 @@ case 407: resume_momentary (yyvsp[-2].itype); ; break;} case 408: -#line 2310 "objc-parse.y" +#line 2309 "objc-parse.y" { yyval.ttype = build_tree_list (build_tree_list (current_declspecs, yyvsp[-1].ttype), build_tree_list (prefix_attributes, @@ -4391,7 +4345,7 @@ case 408: resume_momentary (yyvsp[-2].itype); ; break;} case 409: -#line 2320 "objc-parse.y" +#line 2319 "objc-parse.y" { yyval.ttype = build_tree_list (build_tree_list (current_declspecs, yyvsp[-1].ttype), build_tree_list (prefix_attributes, @@ -4402,19 +4356,19 @@ case 409: resume_momentary (yyvsp[-2].itype); ; break;} case 410: -#line 2334 "objc-parse.y" +#line 2333 "objc-parse.y" { pushlevel (0); clear_parm_order (); declare_parm_level (1); ; break;} case 411: -#line 2338 "objc-parse.y" +#line 2337 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; parmlist_tags_warning (); poplevel (0, 0, 0); ; break;} case 413: -#line 2346 "objc-parse.y" +#line 2345 "objc-parse.y" { tree t; for (t = yyvsp[-1].ttype; t; t = TREE_CHAIN (t)) if (TREE_VALUE (t) == NULL_TREE) @@ -4422,28 +4376,28 @@ case 413: yyval.ttype = tree_cons (NULL_TREE, NULL_TREE, yyvsp[-1].ttype); ; break;} case 414: -#line 2356 "objc-parse.y" +#line 2355 "objc-parse.y" { yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ; break;} case 415: -#line 2358 "objc-parse.y" +#line 2357 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ; break;} case 416: -#line 2364 "objc-parse.y" +#line 2363 "objc-parse.y" { yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ; break;} case 417: -#line 2366 "objc-parse.y" +#line 2365 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ; break;} case 418: -#line 2371 "objc-parse.y" +#line 2370 "objc-parse.y" { yyval.itype = pedantic; pedantic = 0; ; break;} case 424: -#line 2384 "objc-parse.y" +#line 2383 "objc-parse.y" { if (objc_implementation_context) { @@ -4456,27 +4410,27 @@ case 424: ; break;} case 425: -#line 2399 "objc-parse.y" +#line 2398 "objc-parse.y" { yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ; break;} case 426: -#line 2401 "objc-parse.y" +#line 2400 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ; break;} case 427: -#line 2406 "objc-parse.y" +#line 2405 "objc-parse.y" { objc_declare_class (yyvsp[-1].ttype); ; break;} case 428: -#line 2412 "objc-parse.y" +#line 2411 "objc-parse.y" { objc_declare_alias (yyvsp[-2].ttype, yyvsp[-1].ttype); ; break;} case 429: -#line 2418 "objc-parse.y" +#line 2417 "objc-parse.y" { objc_interface_context = objc_ivar_context = start_class (CLASS_INTERFACE_TYPE, yyvsp[-2].ttype, NULL_TREE, yyvsp[-1].ttype); @@ -4484,20 +4438,20 @@ case 429: ; break;} case 430: -#line 2424 "objc-parse.y" +#line 2423 "objc-parse.y" { continue_class (objc_interface_context); ; break;} case 431: -#line 2429 "objc-parse.y" +#line 2428 "objc-parse.y" { finish_class (objc_interface_context); objc_interface_context = NULL_TREE; ; break;} case 432: -#line 2435 "objc-parse.y" +#line 2434 "objc-parse.y" { objc_interface_context = start_class (CLASS_INTERFACE_TYPE, yyvsp[-1].ttype, NULL_TREE, yyvsp[0].ttype); @@ -4505,14 +4459,14 @@ case 432: ; break;} case 433: -#line 2442 "objc-parse.y" +#line 2441 "objc-parse.y" { finish_class (objc_interface_context); objc_interface_context = NULL_TREE; ; break;} case 434: -#line 2448 "objc-parse.y" +#line 2447 "objc-parse.y" { objc_interface_context = objc_ivar_context = start_class (CLASS_INTERFACE_TYPE, yyvsp[-4].ttype, yyvsp[-2].ttype, yyvsp[-1].ttype); @@ -4520,20 +4474,20 @@ case 434: ; break;} case 435: -#line 2454 "objc-parse.y" +#line 2453 "objc-parse.y" { continue_class (objc_interface_context); ; break;} case 436: -#line 2459 "objc-parse.y" +#line 2458 "objc-parse.y" { finish_class (objc_interface_context); objc_interface_context = NULL_TREE; ; break;} case 437: -#line 2465 "objc-parse.y" +#line 2464 "objc-parse.y" { objc_interface_context = start_class (CLASS_INTERFACE_TYPE, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); @@ -4541,14 +4495,14 @@ case 437: ; break;} case 438: -#line 2472 "objc-parse.y" +#line 2471 "objc-parse.y" { finish_class (objc_interface_context); objc_interface_context = NULL_TREE; ; break;} case 439: -#line 2478 "objc-parse.y" +#line 2477 "objc-parse.y" { objc_implementation_context = objc_ivar_context = start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[-1].ttype, NULL_TREE, NULL_TREE); @@ -4556,14 +4510,14 @@ case 439: ; break;} case 440: -#line 2484 "objc-parse.y" +#line 2483 "objc-parse.y" { objc_ivar_chain = continue_class (objc_implementation_context); ; break;} case 441: -#line 2490 "objc-parse.y" +#line 2489 "objc-parse.y" { objc_implementation_context = start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[0].ttype, NULL_TREE, NULL_TREE); @@ -4572,7 +4526,7 @@ case 441: ; break;} case 442: -#line 2498 "objc-parse.y" +#line 2497 "objc-parse.y" { objc_implementation_context = objc_ivar_context = start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[-3].ttype, yyvsp[-1].ttype, NULL_TREE); @@ -4580,14 +4534,14 @@ case 442: ; break;} case 443: -#line 2504 "objc-parse.y" +#line 2503 "objc-parse.y" { objc_ivar_chain = continue_class (objc_implementation_context); ; break;} case 444: -#line 2510 "objc-parse.y" +#line 2509 "objc-parse.y" { objc_implementation_context = start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); @@ -4596,7 +4550,7 @@ case 444: ; break;} case 445: -#line 2518 "objc-parse.y" +#line 2517 "objc-parse.y" { objc_interface_context = start_class (CATEGORY_INTERFACE_TYPE, yyvsp[-4].ttype, yyvsp[-2].ttype, yyvsp[0].ttype); @@ -4604,14 +4558,14 @@ case 445: ; break;} case 446: -#line 2525 "objc-parse.y" +#line 2524 "objc-parse.y" { finish_class (objc_interface_context); objc_interface_context = NULL_TREE; ; break;} case 447: -#line 2531 "objc-parse.y" +#line 2530 "objc-parse.y" { objc_implementation_context = start_class (CATEGORY_IMPLEMENTATION_TYPE, yyvsp[-3].ttype, yyvsp[-1].ttype, NULL_TREE); @@ -4620,7 +4574,7 @@ case 447: ; break;} case 448: -#line 2541 "objc-parse.y" +#line 2540 "objc-parse.y" { remember_protocol_qualifiers (); objc_interface_context @@ -4628,7 +4582,7 @@ case 448: ; break;} case 449: -#line 2547 "objc-parse.y" +#line 2546 "objc-parse.y" { forget_protocol_qualifiers(); finish_protocol(objc_interface_context); @@ -4636,13 +4590,13 @@ case 449: ; break;} case 450: -#line 2556 "objc-parse.y" +#line 2555 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 452: -#line 2564 "objc-parse.y" +#line 2563 "objc-parse.y" { if (yyvsp[-2].code == LT_EXPR && yyvsp[0].code == GT_EXPR) yyval.ttype = yyvsp[-1].ttype; @@ -4651,32 +4605,32 @@ case 452: ; break;} case 455: -#line 2578 "objc-parse.y" +#line 2577 "objc-parse.y" { objc_public_flag = 2; ; break;} case 456: -#line 2579 "objc-parse.y" +#line 2578 "objc-parse.y" { objc_public_flag = 0; ; break;} case 457: -#line 2580 "objc-parse.y" +#line 2579 "objc-parse.y" { objc_public_flag = 1; ; break;} case 458: -#line 2585 "objc-parse.y" +#line 2584 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 460: -#line 2590 "objc-parse.y" +#line 2589 "objc-parse.y" { if (pedantic) pedwarn ("extra semicolon in struct or union specified"); ; break;} case 461: -#line 2608 "objc-parse.y" +#line 2607 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -4684,7 +4638,7 @@ case 461: resume_momentary (yyvsp[-1].itype); ; break;} case 462: -#line 2614 "objc-parse.y" +#line 2613 "objc-parse.y" { yyval.ttype = yyvsp[0].ttype; current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -4692,15 +4646,15 @@ case 462: resume_momentary (yyvsp[-1].itype); ; break;} case 463: -#line 2620 "objc-parse.y" +#line 2619 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 464: -#line 2625 "objc-parse.y" +#line 2624 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 467: -#line 2632 "objc-parse.y" +#line 2631 "objc-parse.y" { yyval.ttype = add_instance_variable (objc_ivar_context, objc_public_flag, @@ -4709,7 +4663,7 @@ case 467: ; break;} case 468: -#line 2639 "objc-parse.y" +#line 2638 "objc-parse.y" { yyval.ttype = add_instance_variable (objc_ivar_context, objc_public_flag, @@ -4717,7 +4671,7 @@ case 468: ; break;} case 469: -#line 2645 "objc-parse.y" +#line 2644 "objc-parse.y" { yyval.ttype = add_instance_variable (objc_ivar_context, objc_public_flag, @@ -4726,7 +4680,7 @@ case 469: ; break;} case 470: -#line 2655 "objc-parse.y" +#line 2654 "objc-parse.y" { remember_protocol_qualifiers (); if (objc_implementation_context) @@ -4736,7 +4690,7 @@ case 470: ; break;} case 471: -#line 2663 "objc-parse.y" +#line 2662 "objc-parse.y" { forget_protocol_qualifiers (); add_class_method (objc_implementation_context, yyvsp[0].ttype); @@ -4745,20 +4699,20 @@ case 471: ; break;} case 472: -#line 2670 "objc-parse.y" +#line 2669 "objc-parse.y" { continue_method_def (); ; break;} case 473: -#line 2674 "objc-parse.y" +#line 2673 "objc-parse.y" { finish_method_def (); objc_method_context = NULL_TREE; ; break;} case 474: -#line 2680 "objc-parse.y" +#line 2679 "objc-parse.y" { remember_protocol_qualifiers (); if (objc_implementation_context) @@ -4768,7 +4722,7 @@ case 474: ; break;} case 475: -#line 2688 "objc-parse.y" +#line 2687 "objc-parse.y" { forget_protocol_qualifiers (); add_instance_method (objc_implementation_context, yyvsp[0].ttype); @@ -4777,28 +4731,28 @@ case 475: ; break;} case 476: -#line 2695 "objc-parse.y" +#line 2694 "objc-parse.y" { continue_method_def (); ; break;} case 477: -#line 2699 "objc-parse.y" +#line 2698 "objc-parse.y" { finish_method_def (); objc_method_context = NULL_TREE; ; break;} case 479: -#line 2711 "objc-parse.y" +#line 2710 "objc-parse.y" {yyval.ttype = NULL_TREE; ; break;} case 484: -#line 2718 "objc-parse.y" +#line 2717 "objc-parse.y" {yyval.ttype = NULL_TREE; ; break;} case 488: -#line 2728 "objc-parse.y" +#line 2727 "objc-parse.y" { /* Remember protocol qualifiers in prototypes. */ remember_protocol_qualifiers (); @@ -4806,7 +4760,7 @@ case 488: ; break;} case 489: -#line 2734 "objc-parse.y" +#line 2733 "objc-parse.y" { /* Forget protocol qualifiers here. */ forget_protocol_qualifiers (); @@ -4814,7 +4768,7 @@ case 489: ; break;} case 491: -#line 2742 "objc-parse.y" +#line 2741 "objc-parse.y" { /* Remember protocol qualifiers in prototypes. */ remember_protocol_qualifiers (); @@ -4822,7 +4776,7 @@ case 491: ; break;} case 492: -#line 2748 "objc-parse.y" +#line 2747 "objc-parse.y" { /* Forget protocol qualifiers here. */ forget_protocol_qualifiers (); @@ -4830,94 +4784,94 @@ case 492: ; break;} case 494: -#line 2758 "objc-parse.y" +#line 2757 "objc-parse.y" { yyval.ttype = build_method_decl (objc_inherit_code, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ; break;} case 495: -#line 2763 "objc-parse.y" +#line 2762 "objc-parse.y" { yyval.ttype = build_method_decl (objc_inherit_code, NULL_TREE, yyvsp[0].ttype, NULL_TREE); ; break;} case 496: -#line 2768 "objc-parse.y" +#line 2767 "objc-parse.y" { yyval.ttype = build_method_decl (objc_inherit_code, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 497: -#line 2773 "objc-parse.y" +#line 2772 "objc-parse.y" { yyval.ttype = build_method_decl (objc_inherit_code, NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 506: -#line 2803 "objc-parse.y" +#line 2802 "objc-parse.y" { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); resume_momentary (yyvsp[-2].itype); ; break;} case 507: -#line 2808 "objc-parse.y" +#line 2807 "objc-parse.y" { shadow_tag (yyvsp[-1].ttype); ; break;} case 508: -#line 2810 "objc-parse.y" +#line 2809 "objc-parse.y" { pedwarn ("empty declaration"); ; break;} case 509: -#line 2815 "objc-parse.y" +#line 2814 "objc-parse.y" { push_parm_decl (yyvsp[0].ttype); ; break;} case 510: -#line 2817 "objc-parse.y" +#line 2816 "objc-parse.y" { push_parm_decl (yyvsp[0].ttype); ; break;} case 511: -#line 2825 "objc-parse.y" +#line 2824 "objc-parse.y" { yyval.ttype = build_tree_list (build_tree_list (current_declspecs, yyvsp[-1].ttype), build_tree_list (prefix_attributes, yyvsp[0].ttype)); ; break;} case 512: -#line 2830 "objc-parse.y" +#line 2829 "objc-parse.y" { yyval.ttype = build_tree_list (build_tree_list (current_declspecs, yyvsp[-1].ttype), build_tree_list (prefix_attributes, yyvsp[0].ttype)); ; break;} case 513: -#line 2835 "objc-parse.y" +#line 2834 "objc-parse.y" { yyval.ttype = build_tree_list (build_tree_list (current_declspecs, yyvsp[-1].ttype), build_tree_list (prefix_attributes, yyvsp[0].ttype)); ; break;} case 514: -#line 2843 "objc-parse.y" +#line 2842 "objc-parse.y" { yyval.ttype = NULL_TREE; ; break;} case 515: -#line 2847 "objc-parse.y" +#line 2846 "objc-parse.y" { /* oh what a kludge! */ yyval.ttype = (tree)1; ; break;} case 516: -#line 2852 "objc-parse.y" +#line 2851 "objc-parse.y" { pushlevel (0); ; break;} case 517: -#line 2856 "objc-parse.y" +#line 2855 "objc-parse.y" { /* returns a tree list node generated by get_parm_info */ yyval.ttype = yyvsp[0].ttype; @@ -4925,119 +4879,119 @@ case 517: ; break;} case 520: -#line 2871 "objc-parse.y" +#line 2870 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 525: -#line 2884 "objc-parse.y" +#line 2883 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 526: -#line 2885 "objc-parse.y" +#line 2884 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 527: -#line 2886 "objc-parse.y" +#line 2885 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 528: -#line 2887 "objc-parse.y" +#line 2886 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 529: -#line 2888 "objc-parse.y" +#line 2887 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 530: -#line 2889 "objc-parse.y" +#line 2888 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 531: -#line 2890 "objc-parse.y" +#line 2889 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 532: -#line 2891 "objc-parse.y" +#line 2890 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 533: -#line 2892 "objc-parse.y" +#line 2891 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 534: -#line 2893 "objc-parse.y" +#line 2892 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 535: -#line 2894 "objc-parse.y" +#line 2893 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 536: -#line 2895 "objc-parse.y" +#line 2894 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 537: -#line 2896 "objc-parse.y" +#line 2895 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 538: -#line 2897 "objc-parse.y" +#line 2896 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 539: -#line 2898 "objc-parse.y" +#line 2897 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 540: -#line 2899 "objc-parse.y" +#line 2898 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 541: -#line 2900 "objc-parse.y" +#line 2899 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 542: -#line 2901 "objc-parse.y" +#line 2900 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 543: -#line 2902 "objc-parse.y" +#line 2901 "objc-parse.y" { yyval.ttype = get_identifier (token_buffer); ; break;} case 546: -#line 2908 "objc-parse.y" +#line 2907 "objc-parse.y" { yyval.ttype = build_keyword_decl (yyvsp[-5].ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 547: -#line 2913 "objc-parse.y" +#line 2912 "objc-parse.y" { yyval.ttype = build_keyword_decl (yyvsp[-2].ttype, NULL_TREE, yyvsp[0].ttype); ; break;} case 548: -#line 2918 "objc-parse.y" +#line 2917 "objc-parse.y" { yyval.ttype = build_keyword_decl (NULL_TREE, yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 549: -#line 2923 "objc-parse.y" +#line 2922 "objc-parse.y" { yyval.ttype = build_keyword_decl (NULL_TREE, NULL_TREE, yyvsp[0].ttype); ; break;} case 553: -#line 2936 "objc-parse.y" +#line 2935 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 554: -#line 2944 "objc-parse.y" +#line 2943 "objc-parse.y" { if (TREE_CHAIN (yyvsp[0].ttype) == NULL_TREE) /* just return the expr., remove a level of indirection */ @@ -5048,76 +5002,76 @@ case 554: ; break;} case 555: -#line 2956 "objc-parse.y" +#line 2955 "objc-parse.y" { yyval.ttype = build_tree_list (yyvsp[-2].ttype, yyvsp[0].ttype); ; break;} case 556: -#line 2960 "objc-parse.y" +#line 2959 "objc-parse.y" { yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ; break;} case 558: -#line 2968 "objc-parse.y" +#line 2967 "objc-parse.y" { yyval.ttype = get_class_reference (yyvsp[0].ttype); ; break;} case 559: -#line 2975 "objc-parse.y" +#line 2974 "objc-parse.y" { objc_receiver_context = 1; ; break;} case 560: -#line 2977 "objc-parse.y" +#line 2976 "objc-parse.y" { objc_receiver_context = 0; ; break;} case 561: -#line 2979 "objc-parse.y" +#line 2978 "objc-parse.y" { yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ; break;} case 565: -#line 2992 "objc-parse.y" +#line 2991 "objc-parse.y" { yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ; break;} case 566: -#line 2999 "objc-parse.y" +#line 2998 "objc-parse.y" { yyval.ttype = build_tree_list (yyvsp[-1].ttype, NULL_TREE); ; break;} case 567: -#line 3003 "objc-parse.y" +#line 3002 "objc-parse.y" { yyval.ttype = build_tree_list (NULL_TREE, NULL_TREE); ; break;} case 568: -#line 3010 "objc-parse.y" +#line 3009 "objc-parse.y" { yyval.ttype = yyvsp[-1].ttype; ; break;} case 569: -#line 3017 "objc-parse.y" +#line 3016 "objc-parse.y" { yyval.ttype = yyvsp[-1].ttype; ; break;} case 570: -#line 3026 "objc-parse.y" +#line 3025 "objc-parse.y" { yyval.ttype = groktypename (yyvsp[-1].ttype); ; break;} } /* the action file gets copied in in place of this dollarsign */ -#line 542 "/usr/lib/bison.simple" +#line 498 "/usr/cygnus/TBD-TBD/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; @@ -5312,30 +5266,6 @@ yyerrhandle: yystate = yyn; goto yynewstate; - - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 0; - - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 1; } -#line 3031 "objc-parse.y" +#line 3030 "objc-parse.y" diff --git a/gcc/objc/objc-parse.y b/gcc/objc/objc-parse.y index 10f98a31f30..7812b9b2ba3 100644 --- a/gcc/objc/objc-parse.y +++ b/gcc/objc/objc-parse.y @@ -34,7 +34,6 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" #include <setjmp.h> - #include "tree.h" #include "input.h" #include "c-lex.h" diff --git a/gcc/optabs.c b/gcc/optabs.c index d82eb2ee6fa..312dfce8455 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -104,7 +104,7 @@ static void init_floating_libfuncs PROTO((optab, const char *, int)); #ifdef HAVE_conditional_trap static void init_traps PROTO((void)); #endif -static int cmp_available_p PROTO((enum machine_mode, enum rtx_code, int)); +static int cmp_available_p PROTO((enum machine_mode, int)); static void emit_cmp_and_jump_insn_1 PROTO((rtx, rtx, enum machine_mode, enum rtx_code, int, rtx)); static void prepare_cmp_insn PROTO((rtx *, rtx *, enum rtx_code *, rtx, @@ -1223,8 +1223,10 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) copy_rtx (xop0), copy_rtx (xop1))); } + return target; } + else delete_insns_since (last); } @@ -1405,6 +1407,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) copy_rtx (op0), copy_rtx (op1))); } + return product; } } @@ -2618,7 +2621,8 @@ emit_no_conflict_block (insns, target, op0, op1, equiv) next = NEXT_INSN (insn); - if (GET_CODE (PATTERN (insn)) == SET) + if (GET_CODE (PATTERN (insn)) == SET || GET_CODE (PATTERN (insn)) == USE + || GET_CODE (PATTERN (insn)) == CLOBBER) set = PATTERN (insn); else if (GET_CODE (PATTERN (insn)) == PARALLEL) { @@ -2822,9 +2826,8 @@ emit_0_to_1_insn (x) straightforwardly. */ static int -cmp_available_p (mode, code, can_use_tst_p) +cmp_available_p (mode, can_use_tst_p) enum machine_mode mode; - enum rtx_code code; int can_use_tst_p; { do @@ -2865,7 +2868,6 @@ prepare_cmp_insn (px, py, pcomparison, size, pmode, punsignedp, align) int *punsignedp; int align; { - enum rtx_code comparison = *pcomparison; enum machine_mode mode = *pmode; rtx x = *px, y = *py; int unsignedp = *punsignedp; @@ -2985,7 +2987,7 @@ prepare_cmp_insn (px, py, pcomparison, size, pmode, punsignedp, align) *px = x; *py = y; - if (cmp_available_p (mode, comparison, y == CONST0_RTX (mode))) + if (cmp_available_p (mode, y == CONST0_RTX (mode))) return; /* Handle a lib call just for the mode we are using. */ @@ -3461,6 +3463,14 @@ emit_conditional_move (target, code, op0, op1, cmode, op2, op3, mode, code = swap_condition (code); } + /* get_condition will prefer to generate LT and GT even if the old + comparison was against zero, so undo that canonicalization here since + comparisons against zero are cheaper. */ + if (code == LT && GET_CODE (op1) == CONST_INT && INTVAL (op1) == 1) + code = LE, op1 = const0_rtx; + else if (code == GT && GET_CODE (op1) == CONST_INT && INTVAL (op1) == -1) + code = GE, op1 = const0_rtx; + if (cmode == VOIDmode) cmode = GET_MODE (op0); @@ -4150,6 +4160,7 @@ expand_fix (to, from, unsignedp) GET_MODE (to), copy_rtx (from))); } + return; } #endif @@ -4552,7 +4563,7 @@ init_optabs () #ifndef INT_TYPE_SIZE #define INT_TYPE_SIZE BITS_PER_WORD #endif - ffs_optab->handlers[(int) mode_for_size (INT_TYPE_SIZE, MODE_INT, 0)] .libfunc + ffs_optab->handlers[(int) mode_for_size (INT_TYPE_SIZE, MODE_INT, 0)].libfunc = gen_rtx_SYMBOL_REF (Pmode, "ffs"); extendsfdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__extendsfdf2"); diff --git a/gcc/po/POTFILES.in b/gcc/po/POTFILES.in index 61a16028630..a633625403a 100644 --- a/gcc/po/POTFILES.in +++ b/gcc/po/POTFILES.in @@ -609,6 +609,8 @@ dwarf.h dwarf2.h dwarf2out.c dwarfout.c +dyn-string.c +dyn-string.h emit-rtl.c #enquire.c is used only by GCC maintainers and installers except.c @@ -642,6 +644,7 @@ gcov.c #genemit.c is used only by GCC maintainers and installers #genextract.c is used only by GCC maintainers and installers #genflags.c is used only by GCC maintainers and installers +#gengenrtl.c is used only by GCC maintainers and installers #genopinit.c is used only by GCC maintainers and installers #genoutput.c is used only by GCC maintainers and installers #genpeep.c is used only by GCC maintainers and installers @@ -718,6 +721,8 @@ local-alloc.c loop.c loop.h machmode.h +mbchar.c +mbchar.h #mips-tdump.c is not yet internationalized #mips-tfile.c is not yet internationalized objc/objc-act.c @@ -762,6 +767,7 @@ stor-layout.c stupid.c sys-protos.h sys-types.h +system.h toplev.c tree.c tree.h diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 52c92f3022f..03c4c41bcb2 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -1,5 +1,6 @@ /* Print RTL for GNU C Compiler. - Copyright (C) 1987, 1988, 1992, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1992, 1997, 1998, 1999 + Free Software Foundation, Inc. This file is part of GNU CC. diff --git a/gcc/profile.c b/gcc/profile.c index 6a473dbfed8..e2b54fbef16 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -1554,10 +1554,8 @@ output_arc_profiler (arcno, insert_after) rtx insert_after; { rtx profiler_target_addr - = (arcno - ? gen_rtx_CONST (Pmode, - gen_rtx_PLUS (Pmode, profiler_label, - GEN_INT (LONG_TYPE_SIZE / BITS_PER_UNIT * arcno))) + = (arcno ? plus_constant (profiler_label, + LONG_TYPE_SIZE / BITS_PER_UNIT * arcno) : profiler_label); enum machine_mode mode = mode_for_size (LONG_TYPE_SIZE, MODE_INT, 0); rtx profiler_reg = gen_reg_rtx (mode); diff --git a/gcc/real.c b/gcc/real.c index c7c2db70d91..83b02954fee 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -5169,9 +5169,9 @@ asctoeg (ss, y, oprec) else { if (decflg) - nexp += 1; /* count digits after decimal point */ + nexp += 1; /* count digits after decimal point */ - eshup1 (yy); /* multiply current number by 10 */ + eshup1 (yy); /* multiply current number by 10 */ emovz (yy, xt); eshup1 (xt); eshup1 (xt); @@ -5274,7 +5274,7 @@ read_expnt: exp *= 10; exp += *s++ - '0'; if (exp > 999999) - break; + break; } if (esign < 0) exp = -exp; diff --git a/gcc/real.h b/gcc/real.h index a1e85b16c84..506a6dd7391 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -180,8 +180,8 @@ extern REAL_VALUE_TYPE real_value_truncate PROTO ((enum machine_mode, /* Convert ASCII string S to floating point in mode M. Decimal input uses ATOF. Hexadecimal uses HTOF. */ -#define REAL_VALUE_ATOF ereal_atof -#define REAL_VALUE_HTOF ereal_atof +#define REAL_VALUE_ATOF(s,m) ereal_atof(s,m) +#define REAL_VALUE_HTOF(s,m) ereal_atof(s,m) #define REAL_VALUE_NEGATE ereal_negate @@ -393,7 +393,8 @@ extern REAL_VALUE_TYPE real_hex_to_f PROTO((char *, enum machine_mode)); size and where `float' is SFmode. */ /* Don't use REAL_VALUE_TRUNCATE directly--always call real_value_truncate. */ -extern REAL_VALUE_TYPE real_value_truncate PROTO((enum machine_mode, REAL_VALUE_TYPE)); +extern REAL_VALUE_TYPE real_value_truncate PROTO((enum machine_mode, + REAL_VALUE_TYPE)); #ifndef REAL_VALUE_TRUNCATE #define REAL_VALUE_TRUNCATE(mode, x) \ @@ -416,9 +417,9 @@ extern REAL_VALUE_TYPE real_value_truncate PROTO((enum machine_mode, REAL_VALUE_ #define REAL_VALUE_NEGATIVE(x) (target_negative (x)) #endif -extern int target_isnan PROTO ((REAL_VALUE_TYPE)); -extern int target_isinf PROTO ((REAL_VALUE_TYPE)); -extern int target_negative PROTO ((REAL_VALUE_TYPE)); +extern int target_isnan PROTO((REAL_VALUE_TYPE)); +extern int target_isinf PROTO((REAL_VALUE_TYPE)); +extern int target_negative PROTO((REAL_VALUE_TYPE)); /* Determine whether a floating-point value X is minus 0. */ #ifndef REAL_VALUE_MINUS_ZERO @@ -485,11 +486,18 @@ extern struct rtx_def *immed_real_const_1 PROTO((REAL_VALUE_TYPE, #endif /* Replace R by 1/R in the given machine mode, if the result is exact. */ -extern int exact_real_inverse PROTO((enum machine_mode, REAL_VALUE_TYPE *)); +extern int exact_real_inverse PROTO((enum machine_mode, REAL_VALUE_TYPE *)); +extern int target_isnan PROTO((REAL_VALUE_TYPE)); +extern int target_isinf PROTO((REAL_VALUE_TYPE)); +extern int target_negative PROTO((REAL_VALUE_TYPE)); +extern void debug_real PROTO((REAL_VALUE_TYPE)); -extern void debug_real PROTO ((REAL_VALUE_TYPE)); +/* In varasm.c */ +extern void assemble_real PROTO((REAL_VALUE_TYPE, + enum machine_mode)); +extern void debug_real PROTO((REAL_VALUE_TYPE)); /* In varasm.c */ -extern void assemble_real PROTO ((REAL_VALUE_TYPE, - enum machine_mode)); +extern void assemble_real PROTO((REAL_VALUE_TYPE, + enum machine_mode)); #endif /* Not REAL_H_INCLUDED */ diff --git a/gcc/recog.c b/gcc/recog.c index 95c93d4dcc9..31ca8cbee1b 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -369,8 +369,9 @@ apply_change_group () { int j; - newpat = gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (XVECLEN (pat, 0) - 1)); + newpat + = gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (XVECLEN (pat, 0) - 1)); for (j = 0; j < XVECLEN (newpat, 0); j++) XVECEXP (newpat, 0, j) = XVECEXP (pat, 0, j); } @@ -1971,7 +1972,8 @@ adj_offsettable_operand (op, offset) if (CONSTANT_ADDRESS_P (y)) { - new = gen_rtx_MEM (GET_MODE (op), plus_constant_for_output (y, offset)); + new = gen_rtx_MEM (GET_MODE (op), + plus_constant_for_output (y, offset)); RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (op); return new; } @@ -2288,12 +2290,8 @@ constrain_operands (strict) while (*p && (c = *p++) != ',') switch (c) { - case '?': - case '!': - case '*': - case '%': - case '=': - case '+': + case '?': case '!': case '*': case '%': + case '=': case '+': break; case '#': @@ -2307,8 +2305,9 @@ constrain_operands (strict) earlyclobber[opno] = 1; break; - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + /* This operand must be the same as a previous one. This kind of constraint is used for instructions such as add when they take only two operands. diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index d9c40483358..e0f1b277a77 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -1492,9 +1492,9 @@ emit_pop_insn (insn, regstack, reg, when) pop_insn = (*when) (pop_rtx, insn); - REG_NOTES (pop_insn) = gen_rtx_EXPR_LIST (REG_DEAD, - FP_MODE_REG (FIRST_STACK_REG, DFmode), - REG_NOTES (pop_insn)); + REG_NOTES (pop_insn) + = gen_rtx_EXPR_LIST (REG_DEAD, FP_MODE_REG (FIRST_STACK_REG, DFmode), + REG_NOTES (pop_insn)); regstack->reg[regstack->top - (hard_regno - FIRST_STACK_REG)] = regstack->reg[regstack->top]; diff --git a/gcc/regmove.c b/gcc/regmove.c index 11a5c704dd4..424e3b11dfc 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -2128,58 +2128,3 @@ stable_but_for_p (x, src, dst) return ! rtx_unstable_p (x); } } - -/* Test if regmove seems profitable for this target. Regmove is useful only - if some common patterns are two address, i.e. require matching constraints, - so we check that condition here. */ - -int -regmove_profitable_p () -{ -#ifdef REGISTER_CONSTRAINTS - struct match match; - enum machine_mode mode; - optab tstoptab = add_optab; - do /* check add_optab and ashl_optab */ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - { - int icode = (int) tstoptab->handlers[(int) mode].insn_code; - rtx reg0, reg1, reg2, pat; - int i; - - if (GET_MODE_BITSIZE (mode) < 32 || icode == CODE_FOR_nothing) - continue; - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if (TEST_HARD_REG_BIT (reg_class_contents[GENERAL_REGS], i)) - break; - if (i + 2 >= FIRST_PSEUDO_REGISTER) - break; - reg0 = gen_rtx_REG (insn_operand_mode[icode][0], i); - reg1 = gen_rtx_REG (insn_operand_mode[icode][1], i + 1); - reg2 = gen_rtx_REG (insn_operand_mode[icode][2], i + 2); - if (! (*insn_operand_predicate[icode][0]) (reg0, VOIDmode) - || ! (*insn_operand_predicate[icode][1]) (reg1, VOIDmode) - || ! (*insn_operand_predicate[icode][2]) (reg2, VOIDmode)) - break; - pat = GEN_FCN (icode) (reg0, reg1, reg2); - if (! pat) - continue; - if (GET_CODE (pat) == SEQUENCE) - pat = XVECEXP (pat, 0, XVECLEN (pat, 0) - 1); - else - pat = make_insn_raw (pat); - if (! single_set (pat) - || GET_CODE (SET_SRC (single_set (pat))) != tstoptab->code) - /* Unexpected complexity; don't need to handle this unless - we find a machine where this occurs and regmove should - be enabled. */ - break; - if (find_matches (pat, &match)) - return 1; - break; - } - while (tstoptab != ashl_optab && (tstoptab = ashl_optab, 1)); -#endif /* REGISTER_CONSTRAINTS */ - return 0; -} diff --git a/gcc/reload.c b/gcc/reload.c index 1ebe140a39f..93ca1430582 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -2472,9 +2472,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) int goal_earlyclobber, this_earlyclobber; enum machine_mode operand_mode[MAX_RECOG_OPERANDS]; int retval = 0; - /* Cache the last regno for the last pseudo we did an output reload - for in case the next insn uses it. */ - static int last_output_reload_regno = -1; this_insn = insn; n_reloads = 0; @@ -2908,9 +2905,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) while (*p && (c = *p++) != ',') switch (c) { - case '=': - case '+': - case '*': + case '=': case '+': case '*': break; case '%': @@ -2933,11 +2928,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) while (*p && *p != ',') p++; break; - case '0': - case '1': - case '2': - case '3': - case '4': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + c -= '0'; this_alternative_matches[i] = c; /* We are supposed to match a previous operand. @@ -3243,21 +3236,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) && this_alternative_matches[i] < 0) bad = 1; -#if 0 - /* If this is a pseudo-register that is set in the previous - insns, there's a good chance that it will already be in a - spill register and we can use that spill register. So - make this case cheaper. - - Disabled for egcs. egcs has better inheritance code and - this change causes problems with the improved reload - inheritance code. */ - if (GET_CODE (operand) == REG - && REGNO (operand) >= FIRST_PSEUDO_REGISTER - && REGNO (operand) == last_output_reload_regno) - reject--; -#endif - /* If this is a constant that is reloaded into the desired class by copying it to memory first, count that as another reload. This is consistent with other code and is @@ -3644,7 +3622,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) reload_earlyclobbers[n_earlyclobbers++] = recog_operand[i]; /* Now record reloads for all the operands that need them. */ - last_output_reload_regno = -1; for (i = 0; i < noperands; i++) if (! goal_alternative_win[i]) { @@ -3708,9 +3685,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) (insn_code_number < 0 ? 0 : insn_operand_strict_low[insn_code_number][i]), 0, i, operand_type[i]); - if (modified[i] != RELOAD_READ - && GET_CODE (recog_operand[i]) == REG) - last_output_reload_regno = REGNO (recog_operand[i]); } /* In a matching pair of operands, one must be input only and the other must be output only. @@ -3728,9 +3702,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) operand_mode[goal_alternative_matched[i]], 0, 0, i, RELOAD_OTHER); operand_reloadnum[goal_alternative_matched[i]] = output_reloadnum; - if (GET_CODE (recog_operand[goal_alternative_matched[i]]) == REG) - last_output_reload_regno - = REGNO (recog_operand[goal_alternative_matched[i]]); } else if (modified[i] == RELOAD_WRITE && modified[goal_alternative_matched[i]] == RELOAD_READ) @@ -3745,8 +3716,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) operand_mode[i], 0, 0, i, RELOAD_OTHER); operand_reloadnum[i] = output_reloadnum; - if (GET_CODE (recog_operand[i]) == REG) - last_output_reload_regno = REGNO (recog_operand[i]); } else if (insn_code_number >= 0) abort (); diff --git a/gcc/reload1.c b/gcc/reload1.c index a03e8106948..39421fa64dd 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -463,7 +463,8 @@ init_reload () register rtx tem = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, - gen_rtx_REG (Pmode, LAST_VIRTUAL_REGISTER + 1), + gen_rtx_REG (Pmode, + LAST_VIRTUAL_REGISTER + 1), GEN_INT (4))); spill_indirect_levels = 0; @@ -485,6 +486,7 @@ init_reload () tem = gen_rtx_PLUS (Pmode, gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM), gen_rtx_REG (Pmode, i)); + /* This way, we make sure that reg+reg is an offsettable address. */ tem = plus_constant (tem, 4); @@ -2756,6 +2758,20 @@ eliminate_regs (x, mem_mode, insn) mem_mode, insn); return x; + /* You might think handling MINUS in a manner similar to PLUS is a + good idea. It is not. It has been tried multiple times and every + time the change has had to have been reverted. + + Other parts of reload know a PLUS is special (gen_reload for example) + and require special code to handle code a reloaded PLUS operand. + + Also consider backends where the flags register is clobbered by a + MINUS, but we can emit a PLUS that does not clobber flags (ia32, + lea instruction comes to mind). If we try to reload a MINUS, we + may kill the flags register that was holding a useful value. + + So, please before trying to handle MINUS, consider reload as a + whole instead of this little section as well as the backend issues. */ case PLUS: /* If this is the sum of an eliminable register and a constant, rework the sum. */ @@ -2871,6 +2887,7 @@ eliminate_regs (x, mem_mode, insn) case CALL: case COMPARE: + /* See comments before PLUS about handling MINUS. */ case MINUS: case DIV: case UDIV: case MOD: case UMOD: @@ -9208,6 +9225,7 @@ reload_cse_simplify_operands (insn) case '#': case '&': case '!': case '*': case '%': case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': case 'm': case '<': case '>': case 'V': case 'o': case 'E': case 'F': case 'G': case 'H': case 's': case 'i': case 'n': diff --git a/gcc/reorg.c b/gcc/reorg.c index 2db04a169b2..43330619603 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -717,7 +717,8 @@ optimize_skip (insn) we have one insn followed by a branch to the same label we branch to. In both of these cases, inverting the jump and annulling the delay slot give the same effect in fewer insns. */ - if ((next_trial == next_active_insn (JUMP_LABEL (insn))) + if ((next_trial == next_active_insn (JUMP_LABEL (insn)) + && ! (next_trial == 0 && current_function_epilogue_delay_list != 0)) || (next_trial != 0 && GET_CODE (next_trial) == JUMP_INSN && JUMP_LABEL (insn) == JUMP_LABEL (next_trial) @@ -2021,10 +2022,10 @@ fill_simple_delay_slots (non_jumps_p) || (GET_CODE (insn) != JUMP_INSN && ! non_jumps_p)) continue; - if (GET_CODE (insn) == JUMP_INSN) - flags = get_jump_flags (insn, JUMP_LABEL (insn)); - else - flags = get_jump_flags (insn, NULL_RTX); + /* It may have been that this insn used to need delay slots, but + now doesn't; ignore in that case. This can happen, for example, + on the HP PA RISC, where the number of delay slots depends on + what insns are nearby. */ slots_to_fill = num_delay_slots (insn); /* Some machine description have defined instructions to have @@ -2062,6 +2063,11 @@ fill_simple_delay_slots (non_jumps_p) slots_filled = 0; delay_list = 0; + if (GET_CODE (insn) == JUMP_INSN) + flags = get_jump_flags (insn, JUMP_LABEL (insn)); + else + flags = get_jump_flags (insn, NULL_RTX); + if ((trial = next_active_insn (insn)) && GET_CODE (trial) == JUMP_INSN && simplejump_p (trial) @@ -2134,8 +2140,7 @@ fill_simple_delay_slots (non_jumps_p) && ! insn_sets_resource_p (trial, &needed, 1) #ifdef HAVE_cc0 /* Can't separate set of cc0 from its use. */ - && ! (reg_mentioned_p (cc0_rtx, pat) - && ! sets_cc0_p (pat)) + && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat)) #endif ) { @@ -2925,7 +2930,7 @@ fill_eager_delay_slots () allows the port to favor filling the delay slot of the call with the unconditional jump. */ if (slots_to_fill == 0) - continue; + continue; slots_filled = 0; target_label = JUMP_LABEL (insn); diff --git a/gcc/rtl.c b/gcc/rtl.c index db28096ac65..1c5bf6db4cb 100644 --- a/gcc/rtl.c +++ b/gcc/rtl.c @@ -1,5 +1,6 @@ /* Allocate and read RTL for GNU C Compiler. - Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999 + Free Software Foundation, Inc. This file is part of GNU CC. @@ -309,6 +310,41 @@ rtx_alloc (code) return rt; } +/* Like the above, but allocate based only on the length. This is called + by the routines built into genrtl.c. */ + +rtx +obstack_alloc_rtx (length) + int length; +{ + rtx rt; + register struct obstack *ob = rtl_obstack; + + /* This function is called more than any other in GCC, + so we manipulate the obstack directly. + + Even though rtx objects are word aligned, we may be sharing an obstack + with tree nodes, which may have to be double-word aligned. So align + our length to the alignment mask in the obstack. */ + + length = (length + ob->alignment_mask) & ~ ob->alignment_mask; + + if (ob->chunk_limit - ob->next_free < length) + _obstack_newchunk (ob, length); + + rt = (rtx) ob->object_base; + ob->next_free += length; + ob->object_base = ob->next_free; + + /* We want to clear everything up to the FLD array. Normally, + this is one int, but we don't want to assume that and it + isn't very portable anyway; this is. */ + + memset (rt, 0, sizeof (struct rtx_def) - sizeof (rtunion)); + + return rt; +} + /* Free the rtx X and all RTL allocated since X. */ void diff --git a/gcc/rtl.def b/gcc/rtl.def index 0b5a83a85e8..257ab07faf8 100644 --- a/gcc/rtl.def +++ b/gcc/rtl.def @@ -1,7 +1,8 @@ /* This file contains the definitions and documentation for the Register Transfer Expressions (rtx's) that make up the Register Transfer Language (rtl) used in the Back End of the GNU compiler. - Copyright (C) 1987, 88, 92, 94, 95, 97, 98, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 92, 94, 95, 97, 98, 1999 + Free Software Foundation, Inc. This file is part of GNU CC. @@ -529,9 +530,14 @@ DEF_RTL_EXPR(CONST_STRING, "const_string", "s", 'o') /* This is used to encapsulate an expression whose value is constant (such as the sum of a SYMBOL_REF and a CONST_INT) so that it will be recognized as a constant operand rather than by arithmetic instructions. */ - DEF_RTL_EXPR(CONST, "const", "e", 'o') +/* A unary `__builtin_constant_p' expression. This RTL code may only be used + as an operand of a CONST. This pattern is only emitted during RTL + generation and then only if optimize > 0. It is converted by the first + CSE pass into the appropriate CONST_INT. */ +DEF_RTL_EXPR(CONSTANT_P_RTX, "constant_p_rtx", "e", 'x') + /* program counter. Ordinary jumps are represented by a SET whose first operand is (PC). */ DEF_RTL_EXPR(PC, "pc", "", 'o') @@ -849,11 +855,6 @@ DEF_RTL_EXPR(RANGE_VAR, "range_var", "eti", 'x') 0 is the live bitmap. Operand 1 is the original block number. */ DEF_RTL_EXPR(RANGE_LIVE, "range_live", "bi", 'x') -/* A unary `__builtin_constant_p' expression. These are only emitted - during RTL generation, and then only if optimize > 0. They are - eliminated by the first CSE pass. */ -DEF_RTL_EXPR(CONSTANT_P_RTX, "constant_p_rtx", "e", 'x') - /* A placeholder for a CALL_INSN which may be turned into a normal call, a sibling (tail) call or tail recursion. diff --git a/gcc/rtl.h b/gcc/rtl.h index d680ed71059..6d90fe70cb5 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -976,6 +976,7 @@ extern rtx read_rtx PROTO((FILE *)); extern char *oballoc PROTO((int)); extern char *permalloc PROTO((int)); extern rtx rtx_alloc PROTO((RTX_CODE)); +extern rtx obstack_alloc_rtx PROTO((int)); extern rtvec rtvec_alloc PROTO((int)); extern rtx copy_rtx PROTO((rtx)); extern rtx copy_rtx_if_shared PROTO((rtx)); @@ -1242,7 +1243,6 @@ extern rtx gen_rtx_MEM PROTO((enum machine_mode, rtx)); and without prototypes. */ #define GEN_INT(N) gen_rtx_CONST_INT (VOIDmode, (HOST_WIDE_INT) (N)) - /* If HARD_FRAME_POINTER_REGNUM is defined, then a special dummy reg is used to represent the frame pointer. This is because the hard frame pointer and the automatic variables are separated by an amount diff --git a/gcc/stmt.c b/gcc/stmt.c index a9f859237c2..92050e97305 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -1232,7 +1232,7 @@ expand_asm (body) { if (current_function_check_memory_usage) { - error ("`asm' cannot be used with `-fcheck-memory-usage'"); + error ("`asm' cannot be used in function where memory usage is checked"); return; } @@ -1301,6 +1301,12 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) MD_ASM_CLOBBERS (clobbers); #endif + if (current_function_check_memory_usage) + { + error ("`asm' cannot be used in function where memory usage is checked"); + return; + } + /* Count the number of meaningful clobbered registers, ignoring what we would ignore later. */ nclobbers = 0; @@ -1724,11 +1730,13 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) XVECEXP (body, 0, i) = gen_rtx_SET (VOIDmode, output_rtx[i], - gen_rtx_ASM_OPERANDS (VOIDmode, - TREE_STRING_POINTER (string), - TREE_STRING_POINTER (TREE_PURPOSE (tail)), - i, argvec, constraints, - filename, line)); + gen_rtx_ASM_OPERANDS + (VOIDmode, + TREE_STRING_POINTER (string), + TREE_STRING_POINTER (TREE_PURPOSE (tail)), + i, argvec, constraints, + filename, line)); + MEM_VOLATILE_P (SET_SRC (XVECEXP (body, 0, i))) = vol; } @@ -1754,8 +1762,9 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) { XVECEXP (body, 0, i++) = gen_rtx_CLOBBER (VOIDmode, - gen_rtx_MEM (BLKmode, - gen_rtx_SCRATCH (VOIDmode))); + gen_rtx_MEM + (BLKmode, + gen_rtx_SCRATCH (VOIDmode))); continue; } @@ -5040,7 +5049,9 @@ check_for_full_enumeration_handling (type) bytes_needed = (size + HOST_BITS_PER_CHAR) / HOST_BITS_PER_CHAR; if (size > 0 && size < 600000 - /* We deliberately use calloc here - not xcalloc. */ + /* We deliberately use calloc here, not cmalloc, so that we can suppress + this optimization if we don't have enough memory rather than + aborting, as xmalloc would do. */ && (cases_seen = (unsigned char *) calloc (bytes_needed, 1)) != NULL) { long i; diff --git a/gcc/stupid.c b/gcc/stupid.c index 41ddcc8e22f..42b57106d6d 100644 --- a/gcc/stupid.c +++ b/gcc/stupid.c @@ -1,5 +1,5 @@ /* Dummy data flow analysis for GNU compiler in nonoptimizing mode. - Copyright (C) 1987, 91, 94-96, 1998 Free Software Foundation, Inc. + Copyright (C) 1987, 91, 94-96, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. diff --git a/gcc/system.h b/gcc/system.h index 41282bf56ba..7538071e7c3 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -1,5 +1,5 @@ -/* system.h - Get common system includes and various definitions and - declarations based on autoconf macros. +/* Get common system includes and various definitions and declarations based + on autoconf macros. Copyright (C) 1998, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -19,6 +19,7 @@ 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. */ + #ifndef __GCC_SYSTEM_H__ #define __GCC_SYSTEM_H__ @@ -121,7 +122,10 @@ extern int fputs_unlocked PROTO ((const char *, FILE *)); #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) +#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> +#endif + #include <errno.h> #ifndef errno @@ -337,6 +341,22 @@ extern char *sbrk (); extern char *strstr (); #endif +#ifdef HAVE_MALLOC_H +#include <malloc.h> +#endif + +#ifdef NEED_DECLARATION_MALLOC +extern char *malloc (); +#endif + +#ifdef NEED_DECLARATION_CALLOC +extern char *calloc (); +#endif + +#ifdef NEED_DECLARATION_REMALLOC +extern char *realloc (); +#endif + #ifdef HAVE_STRERROR # ifdef NEED_DECLARATION_STRERROR # ifndef strerror diff --git a/gcc/texinfo.tex b/gcc/texinfo.tex index 4327aa3ecc2..4ca7bb3aa0d 100644 --- a/gcc/texinfo.tex +++ b/gcc/texinfo.tex @@ -1,5 +1,9 @@ % texinfo.tex -- TeX macros to handle Texinfo files. -% $Id: texinfo.tex,v 1.5 1998/06/29 21:40:12 law Exp $ +% +% Load plain if necessary, i.e., if running under initex. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi +% +\def\texinfoversion{1998-11-13}% % % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98 % Free Software Foundation, Inc. @@ -50,21 +54,12 @@ % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. - -% Make it possible to create a .fmt file just by loading this file: -% if the underlying format is not loaded, start by loading it now. -% Added by gildea November 1993. -\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi - -% This automatically updates the version number based on RCS. -\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} -\deftexinfoversion$Revision: 1.5 $ -\message{Loading texinfo package [Version \texinfoversion]:} +\message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. -\everyjob{\message{[Texinfo version \texinfoversion]}\message{} +\everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} % Save some parts of plain tex whose names we will redefine. @@ -182,13 +177,16 @@ \shipout\vbox{% \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize - \line{\ewtop\hfil\ewtop}% - \nointerlineskip - \line{% - \vbox{\moveleft\cornerthick\nstop}% - \hfill - \vbox{\moveright\cornerthick\nstop}% - }% + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. @@ -211,13 +209,15 @@ \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick - \line{% - \vbox{\moveleft\cornerthick\nsbot}% - \hfill - \vbox{\moveright\cornerthick\nsbot}% + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% }% - \nointerlineskip - \line{\ewbot\hfil\ewbot}% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox @@ -835,7 +835,7 @@ where each line of input produces a line of output.} \immediate\write16{If you are running another version of TeX, relax.} \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} \immediate\write16{ Then upgrade your TeX installation if you can.} - \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)} + \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} \immediate\write16{If you are stuck with version 3.0, run the} \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} \immediate\write16{ to use a workaround.} @@ -958,7 +958,7 @@ where each line of input produces a line of output.} % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax - {[No value for ``#1'']v}% + {[No value for ``#1'']}% \else \csname SET#1\endcsname \fi @@ -2379,6 +2379,11 @@ width0pt\relax} \fi \def\copyright{\realbackslash copyright}% \def\tclose##1{\realbackslash tclose {##1}}% \def\code##1{\realbackslash code {##1}}% +\def\uref##1{\realbackslash uref {##1}}% +\def\url##1{\realbackslash url {##1}}% +\def\env##1{\realbackslash env {##1}}% +\def\command##1{\realbackslash command {##1}}% +\def\option##1{\realbackslash option {##1}}% \def\dotless##1{\realbackslash dotless {##1}}% \def\samp##1{\realbackslash samp {##1}}% \def\,##1{\realbackslash ,{##1}}% @@ -2394,6 +2399,7 @@ width0pt\relax} \fi \def\kbd##1{\realbackslash kbd {##1}}% \def\dfn##1{\realbackslash dfn {##1}}% \def\emph##1{\realbackslash emph {##1}}% +\def\acronym##1{\realbackslash acronym {##1}}% % % Handle some cases of @value -- where the variable name does not % contain - or _, and the value does not contain any @@ -2457,6 +2463,11 @@ width0pt\relax} \fi %\let\tt=\indexdummyfont \let\tclose=\indexdummyfont \let\code=\indexdummyfont +\let\url=\indexdummyfont +\let\uref=\indexdummyfont +\let\env=\indexdummyfont +\let\command=\indexdummyfont +\let\option=\indexdummyfont \let\file=\indexdummyfont \let\samp=\indexdummyfont \let\kbd=\indexdummyfont @@ -5055,7 +5066,7 @@ width0pt\relax} \fi \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize - \advance\outervsize by 0.6in + \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax @@ -5294,5 +5305,9 @@ width0pt\relax} \fi @rm @c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d" +@c time-stamp-end: "}" @c End: diff --git a/gcc/tm.texi b/gcc/tm.texi index eab7b2e4a0b..746c4918248 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -4775,12 +4775,13 @@ than good.) @findex MOVE_RATIO @item MOVE_RATIO The threshold of number of scalar memory-to-memory move insns, @emph{below} -which a sequence of insns should be generated instead of a +which a sequence of insns should be generated instead of a string move insn or a library call. Increasing the value will always make code faster, but eventually incurs high cost in increased code size. -Note that on machines with no memory-to-memory move insns, this macro denotes -the corresponding number of memory-to-memory @emph{sequences}. +Note that on machines where the corresponding move insn is a +@code{define_expand} that emits a sequence of insns, this macro counts +the number of such sequences. If you don't define this, a reasonable default is used. diff --git a/gcc/toplev.c b/gcc/toplev.c index 89ed389168e..fda94dbf3c7 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1915,13 +1915,28 @@ error VPROTO((const char *msgid, ...)) va_end (ap); } -/* Report a fatal error at the current line number. */ +/* Report a fatal error at the current line number. Allow a front end to + intercept the message. */ + +static void (*fatal_function) PROTO((const char *, va_list)); + +/* Set the function to call when a fatal error occurs. */ + +void +set_fatal_function (f) + void (*f) PROTO((char *, va_list)); +{ + fatal_function = f; +} static void vfatal (msgid, ap) const char *msgid; va_list ap; { + if (fatal_function != 0) + (*fatal_function) (_(msgid), ap); + verror (msgid, ap); exit (FATAL_EXIT_CODE); } @@ -3736,13 +3751,16 @@ rest_of_compilation (decl) TIMEVAR (cse_time, reg_scan (insns, max_reg_num (), 1)); if (flag_thread_jumps) - /* Hacks by tiemann & kenner. */ TIMEVAR (jump_time, thread_jumps (insns, max_reg_num (), 1)); TIMEVAR (cse_time, tem = cse_main (insns, max_reg_num (), 0, rtl_dump_file)); TIMEVAR (cse_time, delete_trivially_dead_insns (insns, max_reg_num ())); + /* If we are not running the second CSE pass, then we are no longer + expecting CSE to be run. */ + cse_not_expected = !flag_rerun_cse_after_loop; + if (tem || optimize > 1) TIMEVAR (jump_time, jump_optimize (insns, !JUMP_CROSS_JUMP, !JUMP_NOOP_MOVES, diff --git a/gcc/tree.h b/gcc/tree.h index 44d6f043b5d..6251fa6d8ae 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1291,8 +1291,8 @@ struct tree_type be instrumented with calls to support routines. */ #define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) ((NODE)->decl.no_instrument_function_entry_exit) -/* Used in FUNCTION_DECLs to indicate that in this function, - check-memory-usage should be disabled. */ +/* Used in FUNCTION_DECLs to indicate that check-memory-usage should be + disabled in this function. */ #define DECL_NO_CHECK_MEMORY_USAGE(NODE) ((NODE)->decl.no_check_memory_usage) /* Additional flags for language-specific uses. */ diff --git a/gcc/varasm.c b/gcc/varasm.c index 33b16fe87bd..3d18899ebd2 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" #include <setjmp.h> -/* #include <stab.h> */ #include "rtl.h" #include "tree.h" #include "flags.h" @@ -796,7 +795,7 @@ make_decl_rtl (decl, asmspec, top_level) DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), gen_rtx_SYMBOL_REF (Pmode, name)); MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl); - + /* If this variable is to be treated as volatile, show its tree node has side effects. If it has side effects, either because of this test or from TREE_THIS_VOLATILE also |