aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-09-04 15:20:18 +0000
committerJeffrey A Law <law@cygnus.com>1999-09-04 15:20:18 +0000
commitca026ef5a34cca7ff17404b2ff9f36c8550e45fe (patch)
tree4bcf56e83629ab71ce7e98bc2c08c08c1aea31dd
parentbdbfacbe1477aebee8fa79f7ab934fbe72016312 (diff)
Import final gcc2 snapshot (990109)gcc3
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc3@29103 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog953
-rw-r--r--gcc/Makefile.in277
-rw-r--r--gcc/acconfig.h63
-rw-r--r--gcc/aclocal.m4126
-rw-r--r--gcc/bc-emit.c16
-rw-r--r--gcc/bc-optab.c9
-rw-r--r--gcc/bi-arity.c2
-rw-r--r--gcc/bi-lexer.c4
-rw-r--r--gcc/bi-opcode.c2
-rw-r--r--gcc/bi-opname.c2
-rw-r--r--gcc/bi-parser.c2
-rw-r--r--gcc/bi-parser.y4
-rw-r--r--gcc/bi-reverse.c3
-rw-r--r--gcc/bitmap.c13
-rw-r--r--gcc/c-aux-info.c7
-rw-r--r--gcc/c-common.c21
-rw-r--r--gcc/c-convert.c3
-rw-r--r--gcc/c-decl.c15
-rw-r--r--gcc/c-iterate.c4
-rw-r--r--gcc/c-lang.c2
-rw-r--r--gcc/c-lex.c320
-rw-r--r--gcc/c-parse.c729
-rw-r--r--gcc/c-parse.in5
-rw-r--r--gcc/c-parse.y5
-rw-r--r--gcc/c-pragma.c2
-rw-r--r--gcc/c-typeck.c48
-rw-r--r--gcc/caller-save.c33
-rw-r--r--gcc/calls.c207
-rw-r--r--gcc/cccp.c974
-rw-r--r--gcc/cexp.c311
-rw-r--r--gcc/cexp.y221
-rw-r--r--gcc/collect2.c56
-rw-r--r--gcc/combine.c395
-rw-r--r--gcc/config.in111
-rw-r--r--gcc/config/1750a/1750a.c5
-rw-r--r--gcc/config/1750a/1750a.h12
-rw-r--r--gcc/config/1750a/1750a.md29
-rw-r--r--gcc/config/a29k/a29k.c11
-rw-r--r--gcc/config/a29k/a29k.h20
-rw-r--r--gcc/config/a29k/a29k.md129
-rw-r--r--gcc/config/alpha/alpha.c58
-rw-r--r--gcc/config/alpha/alpha.h97
-rw-r--r--gcc/config/alpha/alpha.md333
-rw-r--r--gcc/config/alpha/vms.h36
-rw-r--r--gcc/config/alpha/x-alpha2
-rw-r--r--gcc/config/alpha/xm-alpha.h12
-rw-r--r--gcc/config/arc/arc.c18
-rw-r--r--gcc/config/arc/arc.h22
-rw-r--r--gcc/config/arc/arc.md76
-rw-r--r--gcc/config/arm/arm.c444
-rw-r--r--gcc/config/arm/arm.h26
-rw-r--r--gcc/config/arm/arm.md64
-rw-r--r--gcc/config/clipper/clipper.c73
-rw-r--r--gcc/config/clipper/clipper.h25
-rw-r--r--gcc/config/clipper/clipper.md44
-rw-r--r--gcc/config/convex/convex.c10
-rw-r--r--gcc/config/convex/convex.md10
-rw-r--r--gcc/config/dsp16xx/dsp16xx.c124
-rw-r--r--gcc/config/dsp16xx/dsp16xx.h4
-rw-r--r--gcc/config/dsp16xx/dsp16xx.md84
-rw-r--r--gcc/config/elxsi/elxsi.c6
-rw-r--r--gcc/config/elxsi/elxsi.h12
-rw-r--r--gcc/config/fx80/fx80.c12
-rw-r--r--gcc/config/fx80/fx80.h10
-rw-r--r--gcc/config/fx80/fx80.md68
-rw-r--r--gcc/config/gmicro/gmicro.c32
-rw-r--r--gcc/config/gmicro/gmicro.h19
-rw-r--r--gcc/config/gmicro/gmicro.md41
-rw-r--r--gcc/config/gofast.h50
-rw-r--r--gcc/config/h8300/h8300.c42
-rw-r--r--gcc/config/h8300/h8300.h25
-rw-r--r--gcc/config/i370/i370.c12
-rw-r--r--gcc/config/i370/i370.h39
-rw-r--r--gcc/config/i386/cygwin32.h2
-rw-r--r--gcc/config/i386/i386.c195
-rw-r--r--gcc/config/i386/i386.h68
-rw-r--r--gcc/config/i386/i386.md92
-rw-r--r--gcc/config/i386/mingw32.h8
-rw-r--r--gcc/config/i386/osfrose.h8
-rw-r--r--gcc/config/i386/win-nt.h4
-rw-r--r--gcc/config/i860/i860.c33
-rw-r--r--gcc/config/i860/i860.h72
-rw-r--r--gcc/config/i860/i860.md65
-rw-r--r--gcc/config/i960/i960.c82
-rw-r--r--gcc/config/i960/i960.h20
-rw-r--r--gcc/config/i960/i960.md93
-rw-r--r--gcc/config/m32r/m32r.c12
-rw-r--r--gcc/config/m32r/m32r.h26
-rw-r--r--gcc/config/m32r/m32r.md30
-rw-r--r--gcc/config/m68k/a-ux.h14
-rw-r--r--gcc/config/m68k/crds.h6
-rw-r--r--gcc/config/m68k/isi.h4
-rw-r--r--gcc/config/m68k/linux.h14
-rw-r--r--gcc/config/m68k/lynx.h9
-rw-r--r--gcc/config/m68k/m68k.c82
-rw-r--r--gcc/config/m68k/m68k.h16
-rw-r--r--gcc/config/m68k/m68k.md363
-rw-r--r--gcc/config/m68k/m68kemb.h11
-rw-r--r--gcc/config/m68k/m68kv4.h30
-rw-r--r--gcc/config/m68k/mot3300.h25
-rw-r--r--gcc/config/m68k/news.h13
-rw-r--r--gcc/config/m68k/next.h6
-rw-r--r--gcc/config/m68k/sun3.h13
-rw-r--r--gcc/config/m88k/m88k.c181
-rw-r--r--gcc/config/m88k/m88k.h39
-rw-r--r--gcc/config/m88k/m88k.md177
-rw-r--r--gcc/config/m88k/sysv3.h15
-rw-r--r--gcc/config/mips/abi64.h21
-rw-r--r--gcc/config/mips/mips.c218
-rw-r--r--gcc/config/mips/mips.h44
-rw-r--r--gcc/config/mips/mips.md228
-rw-r--r--gcc/config/mn10200/mn10200.c63
-rw-r--r--gcc/config/mn10200/mn10200.h16
-rw-r--r--gcc/config/mn10200/mn10200.md66
-rw-r--r--gcc/config/mn10200/xm-mn10200.h9
-rw-r--r--gcc/config/mn10300/mn10300.c52
-rw-r--r--gcc/config/mn10300/mn10300.h12
-rw-r--r--gcc/config/mn10300/mn10300.md21
-rw-r--r--gcc/config/mn10300/xm-mn10300.h9
-rw-r--r--gcc/config/ns32k/ns32k.c27
-rw-r--r--gcc/config/ns32k/ns32k.h16
-rw-r--r--gcc/config/ns32k/ns32k.md72
-rw-r--r--gcc/config/pa/pa.c423
-rw-r--r--gcc/config/pa/pa.h91
-rw-r--r--gcc/config/pa/pa.md47
-rw-r--r--gcc/config/pdp11/pdp11.c42
-rw-r--r--gcc/config/pdp11/pdp11.h26
-rw-r--r--gcc/config/pdp11/pdp11.md97
-rw-r--r--gcc/config/pyr/pyr.c40
-rw-r--r--gcc/config/pyr/pyr.h31
-rw-r--r--gcc/config/pyr/pyr.md57
-rw-r--r--gcc/config/romp/romp.c20
-rw-r--r--gcc/config/romp/romp.h61
-rw-r--r--gcc/config/romp/romp.md131
-rw-r--r--gcc/config/rs6000/rs6000.c115
-rw-r--r--gcc/config/rs6000/rs6000.h48
-rw-r--r--gcc/config/rs6000/rs6000.md254
-rw-r--r--gcc/config/rs6000/xm-sysv4.h10
-rw-r--r--gcc/config/sh/sh.c126
-rw-r--r--gcc/config/sh/sh.h20
-rw-r--r--gcc/config/sh/sh.md58
-rw-r--r--gcc/config/sparc/sparc.c363
-rw-r--r--gcc/config/sparc/sparc.h122
-rw-r--r--gcc/config/sparc/sparc.md162
-rw-r--r--gcc/config/spur/spur.c28
-rw-r--r--gcc/config/spur/spur.h28
-rw-r--r--gcc/config/spur/spur.md97
-rw-r--r--gcc/config/tahoe/tahoe.c602
-rw-r--r--gcc/config/tahoe/tahoe.h6
-rw-r--r--gcc/config/tahoe/tahoe.md19
-rw-r--r--gcc/config/v850/v850.c131
-rw-r--r--gcc/config/v850/v850.h10
-rw-r--r--gcc/config/v850/v850.md45
-rw-r--r--gcc/config/v850/xm-v850.h11
-rw-r--r--gcc/config/vax/vax.c6
-rw-r--r--gcc/config/vax/vax.h39
-rw-r--r--gcc/config/vax/vax.md32
-rw-r--r--gcc/config/we32k/we32k.c23
-rw-r--r--gcc/config/we32k/we32k.h28
-rw-r--r--gcc/config/we32k/we32k.md74
-rwxr-xr-xgcc/configure1496
-rw-r--r--gcc/configure.in127
-rw-r--r--gcc/convert.c1
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/tree.c23
-rw-r--r--gcc/cpp.texi17
-rw-r--r--gcc/cppalloc.c4
-rw-r--r--gcc/cpperror.c9
-rw-r--r--gcc/cppexp.c1
-rw-r--r--gcc/cpphash.c4
-rw-r--r--gcc/cpplib.c69
-rw-r--r--gcc/cppmain.c22
-rw-r--r--gcc/cse.c109
-rw-r--r--gcc/dbxout.c9
-rw-r--r--gcc/dwarf2out.c106
-rw-r--r--gcc/dwarfout.c37
-rw-r--r--gcc/dyn-string.c53
-rw-r--r--gcc/dyn-string.h32
-rw-r--r--gcc/emit-rtl.c280
-rw-r--r--gcc/except.c42
-rw-r--r--gcc/explow.c48
-rw-r--r--gcc/expmed.c235
-rw-r--r--gcc/expr.c469
-rw-r--r--gcc/expr.h22
-rw-r--r--gcc/extend.texi97
-rw-r--r--gcc/final.c34
-rw-r--r--gcc/fix-header.c9
-rw-r--r--gcc/flow.c52
-rw-r--r--gcc/fold-const.c343
-rw-r--r--gcc/function.c218
-rw-r--r--gcc/function.h1
-rw-r--r--gcc/gansidecl.h2
-rw-r--r--gcc/gcc.c90
-rw-r--r--gcc/gcov.c70
-rw-r--r--gcc/gen-protos.c5
-rw-r--r--gcc/genattr.c41
-rw-r--r--gcc/genattrtab.c63
-rw-r--r--gcc/gencheck.c2
-rw-r--r--gcc/gencodes.c42
-rw-r--r--gcc/genconfig.c53
-rw-r--r--gcc/genemit.c50
-rw-r--r--gcc/genextract.c41
-rw-r--r--gcc/genflags.c42
-rw-r--r--gcc/gengenrtl.c352
-rw-r--r--gcc/genopinit.c44
-rw-r--r--gcc/genoutput.c39
-rw-r--r--gcc/genpeep.c42
-rw-r--r--gcc/genrecog.c45
-rw-r--r--gcc/global.c4
-rw-r--r--gcc/halfpic.c9
-rw-r--r--gcc/integrate.c72
-rw-r--r--gcc/invoke.texi69
-rw-r--r--gcc/jump.c499
-rw-r--r--gcc/libgcc2.c7
-rw-r--r--gcc/local-alloc.c18
-rw-r--r--gcc/loop.c268
-rw-r--r--gcc/mbchar.c162
-rw-r--r--gcc/mbchar.h33
-rw-r--r--gcc/md.texi3
-rw-r--r--gcc/mips-tdump.c15
-rw-r--r--gcc/mips-tfile.c17
-rw-r--r--gcc/objc/Makefile.in3
-rw-r--r--gcc/objc/objc-parse.c991
-rw-r--r--gcc/objc/objc-parse.y5
-rw-r--r--gcc/optabs.c347
-rw-r--r--gcc/po/POTFILES.in6
-rw-r--r--gcc/prefix.c12
-rw-r--r--gcc/print-rtl.c5
-rw-r--r--gcc/print-tree.c2
-rw-r--r--gcc/profile.c32
-rw-r--r--gcc/protoize.c123
-rw-r--r--gcc/real.c114
-rw-r--r--gcc/real.h51
-rw-r--r--gcc/recog.c35
-rw-r--r--gcc/reg-stack.c80
-rw-r--r--gcc/regclass.c65
-rw-r--r--gcc/regmove.c36
-rw-r--r--gcc/reload.c144
-rw-r--r--gcc/reload.h7
-rw-r--r--gcc/reload1.c213
-rw-r--r--gcc/reorg.c47
-rw-r--r--gcc/rtl.c63
-rw-r--r--gcc/rtl.def11
-rw-r--r--gcc/rtl.h25
-rw-r--r--gcc/rtlanal.c2
-rw-r--r--gcc/scan-decls.c5
-rw-r--r--gcc/scan.c6
-rw-r--r--gcc/sched.c75
-rw-r--r--gcc/sdbout.c2
-rw-r--r--gcc/stmt.c112
-rw-r--r--gcc/stor-layout.c5
-rw-r--r--gcc/stupid.c9
-rw-r--r--gcc/system.h261
-rw-r--r--gcc/texinfo.tex71
-rw-r--r--gcc/tm.texi15
-rw-r--r--gcc/toplev.c145
-rw-r--r--gcc/tree.c23
-rw-r--r--gcc/tree.h11
-rw-r--r--gcc/unroll.c14
-rw-r--r--gcc/varasm.c41
-rw-r--r--gcc/version.c2
-rw-r--r--gcc/xcoffout.c7
262 files changed, 12584 insertions, 10120 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 261934c3d12..d8cdf7bd564 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +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>
@@ -58,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@.
@@ -81,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.
@@ -108,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.
+ (compare, compare3, gnucompare, gnucompare3): Handle intl subdirectory.
+ (stage1-start, stage2-start, stage3-start, stage4-start): Likewise.
- * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
- HAVE_LC_MESSAGES, HAVE_STPCPY, PACKAGE, VERSION): New macros.
-
- * aclocal.m4 (AC_ISC_POSIX, AM_WITH_NLS, AM_GNU_GETTEXT,
- AM_LC_MESSAGES, AM_PATH_PROG_WITH_TEST): New functions; taken from
- gettext distribution.
+ * 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.
@@ -144,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 2d85df63f21..1450d853bc6 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -584,7 +584,7 @@ SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \
# Language-specific object files for C and Objective C.
C_AND_OBJC_OBJS = c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o \
- c-aux-info.o c-common.o c-iterate.o @extra_c_objs@
+ c-aux-info.o c-common.o c-iterate.o mbchar.o @extra_c_objs@
# Language-specific object files for C.
C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS)
@@ -598,8 +598,8 @@ BC_ALL = bc-arity.h bc-opcode.h bc-opname.h
# Language-independent object files.
OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o \
- intl.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o real.o \
- dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o \
+ intl.o varasm.o genrtl.o rtl.o print-rtl.o rtlanal.o emit-rtl.o real.o \
+ dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o dyn-string.o \
integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o \
insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \
@@ -610,7 +610,7 @@ OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
# makes for cc1 or cc1plus. Otherwise sequent parallel make attempts to load
# them before rtl.o is compiled.
GEN= genemit genoutput genrecog genextract genflags gencodes genconfig \
- genpeep gencheck
+ genpeep gengenrtl gencheck
CCCP=cccp
# Uncomment this line if you want to use cppmain (w/cpplib) as cpp.
@@ -620,12 +620,13 @@ CCCP=cccp
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-proto s-crt s-crtS s-crt0 \
genemit$(exeext) genoutput$(exeext) genrecog$(exeext) genextract$(exeext) \
genflags$(exeext) gencodes$(exeext) genconfig$(exeext) genpeep$(exeext) \
- genattrtab$(exeext) genattr$(exeext) genopinit$(exeext) gencheck$(exeext) \
+ genattrtab$(exeext) genattr$(exeext) genopinit$(exeext) gengenrtl$(exeext) \
+ gencheck$(exeext) \
$(BC_ALL) \
s-bcarity s-bcopcode s-bcopname \
bi-arity$(exeext) bi-opcode$(exeext) bi-opname$(exeext) \
@@ -668,7 +669,8 @@ LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
# If it is, rm *.o is an easy way to do it.
# CONFIG_H = $(host_xm_file) $(tm_file)
CONFIG_H =
-RTL_H = rtl.h rtl.def gansidecl.h machmode.h machmode.def
+RTL_BASE_H = rtl.h rtl.def gansidecl.h machmode.h machmode.def
+RTL_H = $(RTL_BASE_H) genrtl.h
TREE_H = tree.h real.h tree.def gansidecl.h machmode.h machmode.def tree-check.h
BYTECODE_H = bytecode.h bc-emit.h bc-optab.h
BASIC_BLOCK_H = basic-block.h bitmap.h
@@ -703,12 +705,12 @@ RECOG_H = recog.h gansidecl.h
.SUFFIXES: .in .def
$(srcdir)/version.c: $(VERSION_DEP)
- (cd $(srcdir); cvs log -h $?) >tmp-ver
+ (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
+ echo "char *version_string = \"$${ver}\";" >tmp-version.c
rm -f tmp-ver
$(srcdir)/move-if-change tmp-version.c $(srcdir)/version.c
@@ -743,7 +745,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; \
@@ -1208,8 +1210,8 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
# C language specific files.
-c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
- $(srcdir)/c-parse.h c-tree.h input.h flags.h
+c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) system.h $(TREE_H) c-lex.h \
+ $(srcdir)/c-parse.h c-tree.h input.h flags.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
$(srcdir)/c-parse.h: $(srcdir)/c-parse.c
$(srcdir)/c-parse.c: $(srcdir)/c-parse.y
@@ -1226,16 +1228,21 @@ $(srcdir)/c-gperf.h: c-parse.gperf
$(srcdir)/c-parse.gperf >tmp-gperf.h
$(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
-c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h output.h
-c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h intl.h output.h
-c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H)
-c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h $(srcdir)/c-parse.h \
- input.h intl.h flags.h $(srcdir)/c-gperf.h c-pragma.h
-c-aux-info.o : c-aux-info.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
-c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h
-c-pragma.o: c-pragma.c $(CONFIG_H) $(TREE_H) except.h function.h \
- defaults.h c-pragma.h
-c-iterate.o: c-iterate.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h flags.h
+c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h flags.h \
+ output.h
+c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h \
+ intl.h output.h
+c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H)
+c-lex.o : c-lex.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) c-lex.h c-tree.h \
+ mbchar.h $(srcdir)/c-parse.h input.h intl.h flags.h $(srcdir)/c-gperf.h \
+ c-pragma.h
+c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h
+c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h
+c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(TREE_H) except.h function.h \
+ defaults.h c-pragma.h
+c-iterate.o: c-iterate.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-tree.h \
+ flags.h
+mbchar.o: $(CONFIG_H) mbchar.c system.h gansidecl.h mbchar.h
# To make a configuration always use collect2, set USE_COLLECT2 to ld.
ld: collect2
@@ -1245,13 +1252,14 @@ ld: collect2
COLLECT2_OBJS = collect2.o choose-temp.o cplus-dem.o \
intl.o underscore.o version.o
+
collect2 : $(COLLECT2_OBJS) $(LIBDEPS)
# Don't try modifying collect2 (aka ld) in place--it might be linking this.
-rm -f collect2$(exeext)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(COLLECT2_OBJS) $(LIBS)
-collect2.o : collect2.c $(CONFIG_H) gansidecl.h gstab.h intl.h \
- obstack.h $(DEMANGLE_H)
+collect2.o : collect2.c $(CONFIG_H) system.h gansidecl.h gstab.h intl.h \
+ obstack.h $(DEMANGLE_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \
-c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
@@ -1275,7 +1283,7 @@ s-under: $(GCC_PASSES)
# A file used by all variants of C.
-c-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
+c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h flags.h
# Language-independent files.
@@ -1285,8 +1293,8 @@ DRIVER_DEFINES = \
-DDEFAULT_TARGET_VERSION=\"$(version)\" \
-DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
-DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\"
-gcc.o: gcc.c $(CONFIG_H) gansidecl.h intl.h multilib.h \
- Makefile $(lang_specs_files)
+gcc.o: gcc.c $(CONFIG_H) system.h gansidecl.h intl.h multilib.h \
+ Makefile $(lang_specs_files)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(DRIVER_DEFINES) \
-c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
@@ -1301,137 +1309,142 @@ gencheck : gencheck.o $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
gencheck.o $(HOST_LIBS)
-gencheck.o: gencheck.c tree.def $(CONFIG_H)
+gencheck.o: gencheck.c tree.def $(CONFIG_H) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
$(srcdir)/gencheck.c
dumpvers: dumpvers.c
version.o: version.c
-obstack.o: obstack.c $(CONFIG_H)
+obstack.o: obstack.c $(CONFIG_H)
choose-temp.o: choose-temp.c $(CONFIG_H) gansidecl.h
pexecute.o: pexecute.c $(CONFIG_H) gansidecl.h
-prefix.o: prefix.c $(CONFIG_H) gansidecl.h Makefile
+prefix.o: prefix.c $(CONFIG_H) system.h gansidecl.h Makefile
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DPREFIX=\"$(prefix)\" \
-c `echo $(srcdir)/prefix.c | sed 's,^\./,,'`
-convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h
+convert.o: convert.c $(CONFIG_H) system.h $(TREE_H) flags.h convert.h
-tree.o : tree.c $(CONFIG_H) $(TREE_H) flags.h function.h
-print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
-stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) flags.h function.h
-fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h
-toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) bytecode.h bc-emit.h \
- flags.h input.h insn-attr.h insn-codes.h insn-config.h intl.h recog.h \
- xcoffout.h defaults.h output.h Makefile \
+tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h
+print-tree.o : print-tree.c $(CONFIG_H) system.h $(TREE_H)
+stor-layout.o : stor-layout.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h
+fold-const.o : fold-const.c $(CONFIG_H) system.h $(TREE_H) flags.h
+toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) bytecode.h \
+ bc-emit.h flags.h input.h insn-attr.h insn-codes.h insn-config.h intl.h \
+ recog.h xcoffout.h defaults.h output.h Makefile \
$(lang_options_files)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \
-DTARGET_NAME=\"$(target_alias)\" \
-c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
-rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
+rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H)
-print-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H)
+print-rtl.o : print-rtl.c $(CONFIG_H) system.h $(RTL_H)
rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
-varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h function.h \
- defaults.h insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h \
+varasm.o : varasm.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h \
+ function.h defaults.h insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h \
output.h bytecode.h c-pragma.h
-function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
- insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
- $(RECOG_H) output.h bytecode.h bc-emit.h
-stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
+function.o : function.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
+ function.h insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h \
+ insn-config.h $(RECOG_H) output.h bytecode.h bc-emit.h
+stmt.o : stmt.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h except.h \
loop.h $(RECOG_H) bytecode.h bc-typecd.h bc-typecd.def bc-opcode.h \
bc-optab.h bc-emit.h
-except.o : except.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
- insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
- $(RECOG_H) output.h except.h
-expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h regs.h \
- insn-flags.h insn-codes.h expr.h insn-config.h $(RECOG_H) output.h \
+except.o : except.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
+ function.h insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h \
+ insn-config.h $(RECOG_H) output.h except.h
+expr.o : expr.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
+ regs.h insn-flags.h insn-codes.h expr.h insn-config.h $(RECOG_H) output.h \
typeclass.h bytecode.h bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h \
bc-emit.h modemap.def hard-reg-set.h
calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \
insn-flags.h regs.h
-expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
+expmed.o : expmed.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
insn-flags.h insn-config.h insn-codes.h expr.h $(RECOG_H) real.h
-explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \
- insn-config.h expr.h $(RECOG_H) insn-flags.h insn-codes.h
-optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
+explow.o : explow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
+ hard-reg-set.h insn-config.h expr.h $(RECOG_H) insn-flags.h insn-codes.h
+optabs.o : optabs.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
insn-flags.h insn-config.h insn-codes.h expr.h $(RECOG_H) reload.h
-dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \
+dbxout.o : dbxout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h regs.h \
insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h
-sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h except.h \
+sdbout.o : sdbout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h except.h \
function.h expr.h output.h hard-reg-set.h regs.h defaults.h real.h \
insn-config.h bytecode.h obstack.h xcoffout.h c-pragma.h
-dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \
- insn-config.h reload.h output.h defaults.h
-dwarf2out.o : dwarf2out.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf2.h flags.h \
- insn-config.h reload.h output.h defaults.h hard-reg-set.h regs.h expr.h
-xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h
-emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h except.h \
- function.h regs.h insn-config.h $(RECOG_H) real.h expr.h obstack.h \
- bytecode.h bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h bc-emit.h \
- bc-opname.h hard-reg-set.h
-real.o : real.c $(CONFIG_H) $(TREE_H)
+dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \
+ flags.h insn-config.h reload.h output.h defaults.h
+dwarf2out.o : dwarf2out.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf2.h \
+ flags.h insn-config.h reload.h output.h defaults.h hard-reg-set.h regs.h \
+ expr.h dyn-string.h
+xcoffout.o : xcoffout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) xcoffout.h \
+ flags.h
+emit-rtl.o : emit-rtl.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
+ except.h function.h regs.h insn-config.h $(RECOG_H) real.h expr.h \
+ obstack.h bytecode.h bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h \
+ bc-emit.h bc-opname.h hard-reg-set.h
+real.o : real.c $(CONFIG_H) system.h $(TREE_H)
getpwd.o : getpwd.c $(CONFIG_H)
-integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \
- insn-flags.h insn-config.h insn-codes.h expr.h real.h regs.h function.h \
- intl.h bytecode.h output.h $(RECOG_H) except.h
+integrate.o : integrate.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
+ integrate.h insn-flags.h insn-config.h insn-codes.h expr.h real.h regs.h \
+ function.h intl.h bytecode.h output.h $(RECOG_H) except.h
-jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.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
-stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h
+stupid.o : stupid.c $(CONFIG_H) system.h $(RTL_H) regs.h hard-reg-set.h flags.h
-cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \
- insn-config.h $(RECOG_H) expr.h
-profile.o : profile.c $(CONFIG_H) $(RTL_H) flags.h insn-flags.h gcov-io.h \
- $(TREE_H) output.h regs.h
-loop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \
+cse.o : cse.c $(CONFIG_H) system.h $(RTL_H) regs.h hard-reg-set.h flags.h \
+ real.h insn-config.h $(RECOG_H) expr.h
+profile.o : profile.c $(CONFIG_H) system.h $(RTL_H) flags.h insn-flags.h \
+ gcov-io.h $(TREE_H) output.h regs.h
+loop.o : loop.c $(CONFIG_H) system.h $(RTL_H) flags.h loop.h insn-config.h \
insn-flags.h insn-codes.h regs.h hard-reg-set.h $(RECOG_H) expr.h real.h
-unroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h integrate.h regs.h \
- $(RECOG_H) flags.h expr.h loop.h
-flow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \
+unroll.o : unroll.c $(CONFIG_H) system.h $(RTL_H) insn-config.h integrate.h \
+ regs.h $(RECOG_H) flags.h expr.h loop.h
+flow.o : flow.c $(CONFIG_H) system.h $(RTL_H) flags.h insn-config.h \
$(BASIC_BLOCK_H) regs.h hard-reg-set.h output.h
-combine.o : combine.c $(CONFIG_H) $(RTL_H) flags.h \
+combine.o : combine.c $(CONFIG_H) system.h $(RTL_H) flags.h \
insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
$(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h
-regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
+regclass.o : regclass.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h flags.h \
$(BASIC_BLOCK_H) regs.h insn-config.h $(RECOG_H) reload.h real.h bytecode.h
-local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h $(BASIC_BLOCK_H) \
- regs.h hard-reg-set.h insn-config.h $(RECOG_H) output.h
-bitmap.o : bitmap.c $(CONFIG_H) $(RTL_H) flags.h $(BASIC_BLOCK_H) regs.h
-global.o : global.c $(CONFIG_H) $(RTL_H) flags.h \
+local-alloc.o : local-alloc.c $(CONFIG_H) system.h $(RTL_H) flags.h \
+ $(BASIC_BLOCK_H) regs.h hard-reg-set.h insn-config.h $(RECOG_H) output.h
+dyn-string.o : dyn-string.c dyn-string.h $(CONFIG_H) system.h
+bitmap.o : bitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H) \
+ regs.h
+global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h \
$(BASIC_BLOCK_H) regs.h hard-reg-set.h insn-config.h output.h
-reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h output.h expr.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 real.h
-reload1.o : reload1.c $(CONFIG_H) $(RTL_H) real.h flags.h expr.h \
+reload1.o : reload1.c $(CONFIG_H) system.h $(RTL_H) real.h flags.h expr.h \
reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
$(BASIC_BLOCK_H) $(RECOG_H) output.h
-caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
- regs.h hard-reg-set.h insn-codes.h insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) \
- reload.h expr.h
-reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \
+caller-save.o : caller-save.c $(CONFIG_H) system.h $(RTL_H) flags.h \
+ regs.h hard-reg-set.h insn-codes.h insn-config.h $(BASIC_BLOCK_H) \
+ $(RECOG_H) reload.h expr.h
+reorg.o : reorg.c $(CONFIG_H) system.h $(RTL_H) conditions.h hard-reg-set.h \
$(BASIC_BLOCK_H) regs.h insn-config.h insn-attr.h insn-flags.h $(RECOG_H) \
flags.h output.h
-regmove.o : regmove.c $(CONFIG_H) $(RTL_H) insn-config.h \
+regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
insn-codes.h recog.h output.h reload.h regs.h hard-reg-set.h flags.h \
expr.h insn-flags.h
-sched.o : $(SCHED_PREFIX)sched.c $(CONFIG_H) $(RTL_H) $(BASIC_BLOCK_H) regs.h hard-reg-set.h \
- flags.h insn-config.h insn-attr.h
-final.o : final.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h intl.h regs.h \
- $(RECOG_H) conditions.h insn-config.h insn-attr.h except.h real.h output.h \
- hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h
-recog.o : recog.c $(CONFIG_H) $(RTL_H) \
+sched.o : $(SCHED_PREFIX)sched.c $(CONFIG_H) system.h $(RTL_H) \
+ $(BASIC_BLOCK_H) regs.h hard-reg-set.h flags.h insn-config.h insn-attr.h
+final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \
+ regs.h $(RECOG_H) conditions.h insn-config.h insn-attr.h except.h real.h \
+ output.h hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h \
+ defaults.h
+recog.o : recog.c $(CONFIG_H) system.h $(RTL_H) \
regs.h $(RECOG_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \
insn-flags.h insn-codes.h real.h
-reg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
+reg-stack.o : reg-stack.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) \
regs.h hard-reg-set.h flags.h insn-config.h insn-flags.h
-$(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) \
+$(out_object_file): $(out_file) $(CONFIG_H) system.h $(TREE_H) \
$(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \
insn-flags.h output.h insn-attr.h insn-codes.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(out_file)
@@ -1440,15 +1453,15 @@ $(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) \
mips-tfile: mips-tfile.o version.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
-mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H)
+mips-tfile.o : mips-tfile.c $(CONFIG_H) system.h $(RTL_H)
mips-tdump: mips-tdump.o version.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
-mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H)
+mips-tdump.o : mips-tdump.c $(CONFIG_H) system.h $(RTL_H)
# Build file to support OSF/rose half-pic format.
-halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H)
+halfpic.o: halfpic.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H)
# Normally this target is not used; but it is used if you
# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
@@ -1502,8 +1515,8 @@ s-codes : $(md_file) gencodes $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-codes.h insn-codes.h
touch s-codes
-insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \
- insn-config.h insn-flags.h insn-codes.h
+insn-emit.o : insn-emit.c $(CONFIG_H) system.h $(RTL_H) expr.h real.h \
+ output.h insn-config.h insn-flags.h insn-codes.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
insn-emit.c: s-emit ; @true
@@ -1512,8 +1525,8 @@ s-emit : $(md_file) genemit $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-emit.c insn-emit.c
touch s-emit
-insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \
- real.h output.h flags.h
+insn-recog.o : insn-recog.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
+ $(RECOG_H) real.h output.h flags.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
insn-recog.c: s-recog ; @true
@@ -1522,8 +1535,8 @@ s-recog : $(md_file) genrecog $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-recog.c insn-recog.c
touch s-recog
-insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \
- insn-config.h flags.h $(RECOG_H) expr.h reload.h
+insn-opinit.o : insn-opinit.c $(CONFIG_H) system.h $(RTL_H) insn-codes.h \
+ insn-flags.h insn-config.h flags.h $(RECOG_H) expr.h reload.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c
insn-opinit.c: s-opinit ; @true
@@ -1541,7 +1554,7 @@ s-extract : $(md_file) genextract $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-extract.c insn-extract.c
touch s-extract
-insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h
+insn-peep.o : insn-peep.c $(CONFIG_H) system.h $(RTL_H) regs.h output.h real.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
insn-peep.c: s-peep ; @true
@@ -1550,8 +1563,8 @@ s-peep : $(md_file) genpeep $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-peep.c insn-peep.c
touch s-peep
-insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \
- insn-attr.h insn-config.h
+insn-attrtab.o : insn-attrtab.c $(CONFIG_H) system.h $(RTL_H) regs.h real.h \
+ output.h insn-attr.h insn-config.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
insn-attr.h: s-attr ; @true
@@ -1572,9 +1585,9 @@ s-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
touch s-attrtab
-insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
- hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h $(RECOG_H) \
- insn-codes.h
+insn-output.o : insn-output.c $(CONFIG_H) system.h $(RTL_H) regs.h real.h \
+ conditions.h hard-reg-set.h insn-config.h insn-flags.h insn-attr.h \
+ output.h $(RECOG_H) insn-codes.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
insn-output.c: s-output ; @true
@@ -1582,6 +1595,17 @@ s-output : $(md_file) genoutput $(srcdir)/move-if-change
./genoutput $(md_file) > tmp-output.c
$(srcdir)/move-if-change tmp-output.c insn-output.c
touch s-output
+
+genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h
+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 -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,
@@ -1675,6 +1699,13 @@ genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
genoutput.o : genoutput.c $(RTL_H) $(build_xm_file)
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
+
+gengenrtl : gengenrtl.o $(HOST_LIBDEPS)
+ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
+ gengenrtl.o $(HOST_LIBS)
+
+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,
@@ -1833,15 +1864,16 @@ cpp: $(CCCP)
-rm -f cpp$(exeext)
ln $(CCCP)$(exeext) cpp$(exeext) > /dev/null 2>&1 \
|| cp $(CCCP)$(exeext) cpp$(exeext)
-CCCP_OBJS = cccp.o cexp.o intl.o prefix.o version.o
+CCCP_OBJS = cccp.o cexp.o intl.o prefix.o version.o mbchar.o
cccp: $(CCCP_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(CCCP_OBJS) $(LIBS)
-cexp.o: $(srcdir)/cexp.c $(CONFIG_H)
+cexp.o: $(srcdir)/cexp.c $(CONFIG_H) system.h mbchar.h gansidecl.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
-cccp.o: cccp.c $(CONFIG_H) intl.h pcp.h version.c config.status
+cccp.o: cccp.c $(CONFIG_H) system.h mbchar.h intl.h pcp.h version.c \
+ config.status
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
@@ -1852,7 +1884,7 @@ cccp.o: cccp.c $(CONFIG_H) intl.h pcp.h version.c config.status
-c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
CPPMAIN_OBJS = cppmain.o cppalloc.o cpperror.o cppexp.o cpphash.o cpplib.o \
- intl.o prefix.o version.o
+ intl.o prefix.o version.o mbchar.o
cppmain: $(CPPMAIN_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(CPPMAIN_OBJS) $(LIBS)
@@ -2001,6 +2033,7 @@ stmp-headers: stmp-int-hdrs gfloat.h
stmp-fixinc: $(FIXINCLUDES) gsyslimits.h
rm -rf include
mkdir include
+ -chmod a+rx include
if [ x$(FIXINCLUDES) != xMakefile.in ]; \
then \
for dir in $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); do \
@@ -2077,7 +2110,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.; \
@@ -2402,7 +2435,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/acconfig.h b/gcc/acconfig.h
index 4c4c9b3ebfd..1342c792474 100644
--- a/gcc/acconfig.h
+++ b/gcc/acconfig.h
@@ -1,6 +1,18 @@
+/* Define if you can safely include both <string.h> and <strings.h>. */
+#undef STRING_WITH_STRINGS
+
+/* Define if printf supports "%p". */
+#undef HAVE_PRINTF_PTR
+
/* Define if you want expensive run-time checks. */
#undef ENABLE_CHECKING
+/* Define if your cpp understands the stringify operator. */
+#undef HAVE_CPP_STRINGIFY
+
+/* Define if your compiler understands volatile. */
+#undef HAVE_VOLATILE
+
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
@@ -19,6 +31,24 @@
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
+/* Define if you can safely include both <string.h> and <strings.h>. */
+#undef STRING_WITH_STRINGS
+
+/* Define if printf supports "%p". */
+#undef HAVE_PRINTF_PTR
+
+/* Define if you want expensive run-time checks. */
+#undef ENABLE_CHECKING
+
+/* Define if your cpp understands the stringify operator. */
+#undef HAVE_CPP_STRINGIFY
+
+/* Define if your compiler understands volatile. */
+#undef HAVE_VOLATILE
+
+/* Define if you have a working <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
/* Whether malloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_MALLOC
@@ -28,6 +58,15 @@
/* Whether calloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_CALLOC
+/* Whether bcopy must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_BCOPY
+
+/* Whether bcmp must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_BCMP
+
+/* Whether bzero must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_BZERO
+
/* Whether free must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_FREE
@@ -40,9 +79,33 @@
/* Whether getenv must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_GETENV
+/* Whether atol must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_ATOL
+
/* Whether sbrk must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_SBRK
+/* Whether abort must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_ABORT
+
+/* Whether strerror must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_STRERROR
+
+/* Whether strsignal must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_STRSIGNAL
+
+/* Whether getcwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETCWD
+
+/* Whether getwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETWD
+
+/* Whether getrlimit must be declared even if <sys/resource.h> is included. */
+#undef NEED_DECLARATION_GETRLIMIT
+
+/* Whether setrlimit must be declared even if <sys/resource.h> is included. */
+#undef NEED_DECLARATION_SETRLIMIT
+
/* Define to the name of the distribution. */
#undef PACKAGE
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index c238709cbec..76d8b682ef9 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -1,15 +1,32 @@
+dnl See whether we can include both string.h and strings.h.
+AC_DEFUN(GCC_HEADER_STRING,
+[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
+ gcc_cv_header_string,
+[AC_TRY_COMPILE([#include <string.h>
+#include <strings.h>], , gcc_cv_header_string=yes, gcc_cv_header_string=no)])
+if test $gcc_cv_header_string = yes; then
+ AC_DEFINE(STRING_WITH_STRINGS)
+fi
+])
+
dnl See whether we need a declaration for a function.
+dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
AC_DEFUN(GCC_NEED_DECLARATION,
[AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
[AC_TRY_COMPILE([
#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
+#ifdef STRING_WITH_STRINGS
+# include <string.h>
+# include <strings.h>
#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
+# 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>
@@ -22,16 +39,107 @@ AC_CACHE_VAL(gcc_cv_decl_needed_$1,
#endif
#ifndef HAVE_INDEX
#define index strchr
-#endif],
+#endif
+$2],
[char *(*pfn) = (char *(*)) $1],
-gcc_cv_decl_needed_$1=no, gcc_cv_decl_needed_$1=yes)])
-AC_MSG_RESULT($gcc_cv_decl_needed_$1)
-if test $gcc_cv_decl_needed_$1 = yes; then
+eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
+if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
+ AC_MSG_RESULT(yes)
gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
AC_DEFINE_UNQUOTED($gcc_tr_decl)
+else
+ AC_MSG_RESULT(no)
fi
])dnl
+dnl Check multiple functions to see whether each needs a declaration.
+dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
+AC_DEFUN(GCC_NEED_DECLARATIONS,
+[for ac_func in $1
+do
+GCC_NEED_DECLARATION($ac_func, $2)
+done
+])
+
+dnl Use <inttypes.h> only if it exists,
+dnl doesn't clash with <sys/types.h>, and declares intmax_t.
+AC_DEFUN(GCC_HEADER_INTTYPES,
+[AC_MSG_CHECKING(for inttypes.h)
+AC_CACHE_VAL(gcc_cv_header_inttypes_h,
+[AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [intmax_t i = -1;],
+ gcc_cv_header_inttypes_h=yes,
+ gcc_cv_header_inttypes_h=no)])
+AC_MSG_RESULT($gcc_cv_header_inttypes_h)
+if test $gcc_cv_header_inttypes_h = yes; then
+ AC_DEFINE(HAVE_INTTYPES_H)
+fi
+])
+
+dnl See if the system preprocessor understands the ANSI C preprocessor
+dnl stringification operator.
+AC_DEFUN(GCC_CHECK_STRINGIFY,
+[AC_MSG_CHECKING(whether cpp understands the stringify operator)
+AC_CACHE_VAL(gcc_cv_c_have_stringify,
+[AC_TRY_COMPILE(,
+[#define S(x) #x
+char *test = S(foo);],
+gcc_cv_c_have_stringify=yes, gcc_cv_c_have_stringify=no)])
+AC_MSG_RESULT($gcc_cv_c_have_stringify)
+if test $gcc_cv_c_have_stringify = yes; then
+ AC_DEFINE(HAVE_CPP_STRINGIFY)
+fi
+])
+
+dnl Check if we have vprintf and possibly _doprnt.
+dnl Note autoconf checks for vprintf even though we care about vfprintf.
+AC_DEFUN(GCC_FUNC_VFPRINTF_DOPRNT,
+[AC_FUNC_VPRINTF
+vfprintf=
+doprint=
+if test $ac_cv_func_vprintf != yes ; then
+ vfprintf=vfprintf.o
+ if test $ac_cv_func__doprnt != yes ; then
+ doprint=doprint.o
+ fi
+fi
+AC_SUBST(vfprintf)
+AC_SUBST(doprint)
+])
+
+dnl See if the printf functions in libc support %p in format strings.
+AC_DEFUN(GCC_FUNC_PRINTF_PTR,
+[AC_CACHE_CHECK(whether the printf functions support %p,
+ gcc_cv_func_printf_ptr,
+[AC_TRY_RUN([#include <stdio.h>
+
+main()
+{
+ char buf[64];
+ char *p = buf, *q = NULL;
+ sprintf(buf, "%p", p);
+ sscanf(buf, "%p", &q);
+ exit (p != q);
+}], gcc_cv_func_printf_ptr=yes, gcc_cv_func_printf_ptr=no,
+ gcc_cv_func_printf_ptr=no)
+rm -f core core.* *.core])
+if test $gcc_cv_func_printf_ptr = yes ; then
+ AC_DEFINE(HAVE_PRINTF_PTR)
+fi
+])
+
+dnl See whether the stage1 host compiler accepts the volatile keyword.
+AC_DEFUN(GCC_C_VOLATILE,
+[AC_CACHE_CHECK([for volatile], gcc_cv_c_volatile,
+[AC_TRY_COMPILE(, [volatile int foo;],
+ gcc_cv_c_volatile=yes, gcc_cv_c_volatile=no)])
+if test $gcc_cv_c_volatile = yes ; then
+ AC_DEFINE(HAVE_VOLATILE)
+fi
+])
+
#serial 1
dnl This test replaces the one in autoconf.
dnl Currently this macro should have the same name as the autoconf macro
diff --git a/gcc/bc-emit.c b/gcc/bc-emit.c
index e67011dff7e..1a9357beec6 100644
--- a/gcc/bc-emit.c
+++ b/gcc/bc-emit.c
@@ -1,5 +1,5 @@
/* Output bytecodes for GNU C-compiler.
- Copyright (C) 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,12 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
+#include "system.h"
#include "machmode.h"
#include "rtl.h"
#include "real.h"
@@ -870,7 +865,8 @@ bc_gen_rtx (label, offset, bc_label)
if (bc_label == 0)
bc_label = (struct bc_label *) xmalloc (sizeof (struct bc_label));
- r = gen_rtx (CODE_LABEL, VOIDmode, label, bc_label);
+ r = gen_rtx_CODE_LABEL (VOIDmode, 0, 0, 0, (int) (HOST_WIDE_INT) bc_label,
+ label);
bc_label->offset = offset;
return r;
@@ -946,7 +942,7 @@ bc_emit_bytecode (bytecode)
void
bc_emit_instruction VPROTO((enum bytecode_opcode opcode, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
enum bytecode_opcode opcode;
#endif
va_list arguments;
@@ -954,7 +950,7 @@ bc_emit_instruction VPROTO((enum bytecode_opcode opcode, ...))
VA_START (arguments, opcode);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
opcode = va_arg (arguments, enum bytecode_opcode);
#endif
diff --git a/gcc/bc-optab.c b/gcc/bc-optab.c
index 4837d33850f..3fb98684a88 100644
--- a/gcc/bc-optab.c
+++ b/gcc/bc-optab.c
@@ -1,5 +1,5 @@
/* Bytecode conversion definitions for GNU C-compiler.
- Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,10 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "machmode.h"
@@ -36,8 +33,6 @@ Boston, MA 02111-1307, USA. */
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern char *xmalloc ();
-
/* Table relating interpreter typecodes to machine modes. */
#define GET_TYPECODE_MODE(CODE) (typecode_mode[((int) CODE)])
enum machine_mode typecode_mode[] = {
diff --git a/gcc/bi-arity.c b/gcc/bi-arity.c
index 7e20e7600d9..b8dea50b636 100644
--- a/gcc/bi-arity.c
+++ b/gcc/bi-arity.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h"
-#include <stdio.h>
+#include "system.h"
#include "bi-defs.h"
int
diff --git a/gcc/bi-lexer.c b/gcc/bi-lexer.c
index 0ec0b1d56d3..939362bd5c6 100644
--- a/gcc/bi-lexer.c
+++ b/gcc/bi-lexer.c
@@ -1,5 +1,5 @@
/* Lexer for scanner of bytecode definition file.
- Copyright (C) 1993, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -18,8 +18,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 <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "bi-parser.h"
diff --git a/gcc/bi-opcode.c b/gcc/bi-opcode.c
index b241adbad83..4f71e33b337 100644
--- a/gcc/bi-opcode.c
+++ b/gcc/bi-opcode.c
@@ -19,7 +19,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "hconfig.h"
-#include <stdio.h>
+#include "system.h"
#include "bi-defs.h"
int
diff --git a/gcc/bi-opname.c b/gcc/bi-opname.c
index e096fae3ef5..06fb8d74e31 100644
--- a/gcc/bi-opname.c
+++ b/gcc/bi-opname.c
@@ -19,7 +19,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "hconfig.h"
-#include <stdio.h>
+#include "system.h"
#include "bi-defs.h"
int
diff --git a/gcc/bi-parser.c b/gcc/bi-parser.c
index f673fc6c6d1..944e93fe72c 100644
--- a/gcc/bi-parser.c
+++ b/gcc/bi-parser.c
@@ -11,8 +11,8 @@
#line 22 "bi-parser.y"
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "bi-defs.h"
extern char yytext[];
diff --git a/gcc/bi-parser.y b/gcc/bi-parser.y
index 0a03d0f05ad..ff07c474f50 100644
--- a/gcc/bi-parser.y
+++ b/gcc/bi-parser.y
@@ -1,5 +1,5 @@
/* Bytecode definition file parser.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -21,8 +21,8 @@ Boston, MA 02111-1307, USA. */
%{
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "bi-defs.h"
extern char yytext[];
diff --git a/gcc/bi-reverse.c b/gcc/bi-reverse.c
index 6a84f827e73..cdddaafff2e 100644
--- a/gcc/bi-reverse.c
+++ b/gcc/bi-reverse.c
@@ -1,5 +1,5 @@
/* Reverse order of definitions obtained from bytecode definition file.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h"
+#include "system.h"
#include "bi-defs.h"
void
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index f982f46392a..a862a5ec12b 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -1,5 +1,5 @@
/* Functions to support general ended bitmaps.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -19,25 +19,16 @@ 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 "flags.h"
#include "obstack.h"
#include "regs.h"
#include "basic-block.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef NEED_DECLARATION_FREE
-extern void free PROTO((void *));
-#endif
-
/* 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-aux-info.c b/gcc/c-aux-info.c
index a14d6225664..53a0e0c08bc 100644
--- a/gcc/c-aux-info.c
+++ b/gcc/c-aux-info.c
@@ -1,7 +1,7 @@
/* Generate information regarding function declarations and definitions based
on information stored in GCC's tree structure. This code implements the
-aux-info option.
- Copyright (C) 1989, 1991, 1994, 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1989, 91, 94, 95, 97, 1998 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@segfault.us.com).
This file is part of GNU CC.
@@ -22,13 +22,11 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "flags.h"
#include "tree.h"
#include "c-tree.h"
-extern char *xmalloc ();
-
enum formals_style_enum {
ansi,
k_and_r_names,
@@ -36,7 +34,6 @@ enum formals_style_enum {
};
typedef enum formals_style_enum formals_style;
-
static char *data_type;
static char *concat PROTO((char *, char *));
diff --git a/gcc/c-common.c b/gcc/c-common.c
index a94154e6a79..5432305b51d 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -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 "c-lex.h"
#include "c-tree.h"
@@ -41,8 +41,9 @@ extern struct obstack permanent_obstack;
int skip_evaluation;
enum attrs {A_PACKED, A_NOCOMMON, A_COMMON, A_NORETURN, A_CONST, A_T_UNION,
- A_CONSTRUCTOR, A_DESTRUCTOR, A_MODE, A_SECTION, A_ALIGNED,
- A_UNUSED, A_FORMAT, A_FORMAT_ARG, A_WEAK, A_ALIAS};
+ A_NO_CHECK_MEMORY_USAGE, A_CONSTRUCTOR, A_DESTRUCTOR, A_MODE,
+ A_SECTION, A_ALIGNED, A_UNUSED, A_FORMAT, A_FORMAT_ARG, A_WEAK,
+ A_ALIAS};
enum format_type { printf_format_type, scanf_format_type,
strftime_format_type };
@@ -340,6 +341,7 @@ init_attributes ()
add_attribute (A_FORMAT_ARG, "format_arg", 1, 1, 1);
add_attribute (A_WEAK, "weak", 0, 0, 1);
add_attribute (A_ALIAS, "alias", 1, 1, 1);
+ add_attribute (A_NO_CHECK_MEMORY_USAGE, "no_check_memory_usage", 0, 0, 1);
}
/* Process the attributes listed in ATTRIBUTES and PREFIX_ATTRIBUTES
@@ -814,6 +816,19 @@ decl_attributes (node, attributes, prefix_attributes)
else
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
break;
+
+ case A_NO_CHECK_MEMORY_USAGE:
+ if (TREE_CODE (decl) != FUNCTION_DECL)
+ error_with_decl (decl,
+ "`%s' attribute applies only to functions",
+ IDENTIFIER_POINTER (name));
+ else if (DECL_INITIAL (decl))
+ error_with_decl (decl,
+ "can't set `%s' attribute after definition",
+ IDENTIFIER_POINTER (name));
+ else
+ DECL_NO_CHECK_MEMORY_USAGE (decl) = 1;
+ break;
}
}
}
diff --git a/gcc/c-convert.c b/gcc/c-convert.c
index 8ba93a9816a..ff354f0b9ef 100644
--- a/gcc/c-convert.c
+++ b/gcc/c-convert.c
@@ -1,5 +1,5 @@
/* Language-level data type conversion for GNU C.
- Copyright (C) 1987, 1988, 1991 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1991, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -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 9a40bd1f9d4..f0f27b95933 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
line numbers. For example, the CONST_DECLs for enum values. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "flags.h"
#include "output.h"
@@ -1884,10 +1884,17 @@ 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);
DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl);
+
+ DECL_NO_CHECK_MEMORY_USAGE (newdecl)
+ |= DECL_NO_CHECK_MEMORY_USAGE (olddecl);
}
pop_obstacks ();
@@ -3936,6 +3943,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,
@@ -7183,7 +7191,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))
{
@@ -7192,7 +7201,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-iterate.c b/gcc/c-iterate.c
index 121a9b90a34..1d44961c429 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.
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
both their declarations and the expansion of statements using them. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "c-tree.h"
#include "flags.h"
diff --git a/gcc/c-lang.c b/gcc/c-lang.c
index 036cc23a4a4..d2f28d7bc48 100644
--- a/gcc/c-lang.c
+++ b/gcc/c-lang.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "input.h"
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index fb9133c8992..51f985d091d 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -19,15 +19,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
#include <setjmp.h>
-
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
#include "rtl.h"
#include "tree.h"
#include "input.h"
@@ -38,24 +31,12 @@ Boston, MA 02111-1307, USA. */
#include "c-pragma.h"
#include "intl.h"
-#ifdef MAP_CHARACTER
-#include <ctype.h>
-#endif
-
-/* MULTIBYTE_CHARS support only works for native compilers.
- ??? Ideally what we want is to model widechar support after
- the current floating point support. */
-#ifdef CROSS_COMPILE
-#undef MULTIBYTE_CHARS
-#endif
-
#ifdef MULTIBYTE_CHARS
-#include <stdlib.h>
+#include "mbchar.h"
#include <locale.h>
+#ifndef GET_ENVIRONMENT
+#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ((ENV_VALUE) = getenv (ENV_NAME))
#endif
-
-#ifndef errno
-extern int errno;
#endif
#if USE_CPPLIB
@@ -242,6 +223,7 @@ init_lex ()
#ifdef MULTIBYTE_CHARS
/* Change to the native locale for multibyte conversions. */
setlocale (LC_CTYPE, "");
+ GET_ENVIRONMENT (literal_codeset, "LANG");
#endif
maxtoken = 40;
@@ -1348,8 +1330,8 @@ yylex ()
int parts[TOTAL_PARTS];
int overflow = 0;
- enum anon1 { NOT_FLOAT, AFTER_POINT, TOO_MANY_POINTS} floatflag
- = NOT_FLOAT;
+ enum anon1 { NOT_FLOAT, AFTER_POINT, TOO_MANY_POINTS, AFTER_EXPON}
+ floatflag = NOT_FLOAT;
for (count = 0; count < TOTAL_PARTS; count++)
parts[count] = 0;
@@ -1385,12 +1367,12 @@ yylex ()
{
if (c == '.')
{
- if (base == 16)
- error ("floating constant may not be in radix 16");
+ if (base == 16 && pedantic)
+ pedwarn ("floating constant may not be in radix 16");
if (floatflag == TOO_MANY_POINTS)
/* We have already emitted an error. Don't need another. */
;
- else if (floatflag == AFTER_POINT)
+ else if (floatflag == AFTER_POINT || floatflag == AFTER_EXPON)
{
error ("malformed floating constant");
floatflag = TOO_MANY_POINTS;
@@ -1401,7 +1383,8 @@ yylex ()
else
floatflag = AFTER_POINT;
- base = 10;
+ if (base == 8)
+ base = 10;
*p++ = c = GETC();
/* Accept '.' as the start of a floating-point number
only when it is followed by a digit.
@@ -1440,12 +1423,17 @@ yylex ()
if (c == 'e' || c == 'E')
{
base = 10;
- floatflag = AFTER_POINT;
+ floatflag = AFTER_EXPON;
break; /* start of exponent */
}
error ("nondigits in number and not hexadecimal");
c = 0;
}
+ else if (base == 16 && (c == 'p' || c == 'P'))
+ {
+ floatflag = AFTER_EXPON;
+ break; /* start of exponent */
+ }
else if (c >= 'a')
{
c = c - 'a' + 10;
@@ -1502,7 +1490,8 @@ yylex ()
/* Read explicit exponent if any, and put it in tokenbuf. */
- if ((c == 'e') || (c == 'E'))
+ if ((base == 10 && ((c == 'e') || (c == 'E')))
+ || (base == 16 && (c == 'p' || c == 'P')))
{
if (p >= token_buffer + maxtoken - 3)
p = extend_token_buffer (p);
@@ -1523,6 +1512,8 @@ yylex ()
c = GETC();
}
}
+ if (base == 16 && floatflag != AFTER_EXPON)
+ error ("hexadecimal floating constant has no exponent");
*p = 0;
@@ -1595,10 +1586,13 @@ yylex ()
type = float_type_node;
errno = 0;
- value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
+ if (base == 16)
+ value = REAL_VALUE_HTOF (copy, TYPE_MODE (type));
+ else
+ value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
conversion_errno = errno;
/* A diagnostic is required here by some ANSI C testsuites.
- This is not pedwarn, become some people don't want
+ This is not pedwarn, because some people don't want
an error for this. */
if (REAL_VALUE_ISINF (value) && pedantic)
warning ("floating point number exceeds range of `float'");
@@ -1607,7 +1601,10 @@ yylex ()
{
type = long_double_type_node;
errno = 0;
- value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
+ if (base == 16)
+ value = REAL_VALUE_HTOF (copy, TYPE_MODE (type));
+ else
+ value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
conversion_errno = errno;
if (REAL_VALUE_ISINF (value) && pedantic)
warning ("floating point number exceeds range of `long double'");
@@ -1615,7 +1612,10 @@ yylex ()
else
{
errno = 0;
- value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
+ if (base == 16)
+ value = REAL_VALUE_HTOF (copy, TYPE_MODE (type));
+ else
+ value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
conversion_errno = errno;
if (REAL_VALUE_ISINF (value) && pedantic)
warning ("floating point number exceeds range of `double'");
@@ -1842,30 +1842,27 @@ yylex ()
{
register int result = 0;
register int num_chars = 0;
+ int chars_seen = 0;
unsigned width = TYPE_PRECISION (char_type_node);
int max_chars;
-
- if (wide_flag)
- {
- width = WCHAR_TYPE_SIZE;
#ifdef MULTIBYTE_CHARS
- max_chars = MB_CUR_MAX;
-#else
- max_chars = 1;
+ int longest_char = local_mb_cur_max ();
+ (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
#endif
- }
- else
- max_chars = TYPE_PRECISION (integer_type_node) / width;
+
+ max_chars = TYPE_PRECISION (integer_type_node) / width;
+ if (wide_flag)
+ width = WCHAR_TYPE_SIZE;
while (1)
{
tryagain:
-
c = GETC();
if (c == '\'' || c == EOF)
break;
+ ++chars_seen;
if (c == '\\')
{
int ignore = 0;
@@ -1886,18 +1883,76 @@ yylex ()
pedwarn ("ANSI C forbids newline in character constant");
lineno++;
}
-#ifdef MAP_CHARACTER
else
- c = MAP_CHARACTER (c);
+ {
+#ifdef MULTIBYTE_CHARS
+ wchar_t wc;
+ int i;
+ int char_len = -1;
+ for (i = 1; i <= longest_char; ++i)
+ {
+ if (i > maxtoken - 4)
+ extend_token_buffer (token_buffer);
+
+ token_buffer[i] = c;
+ char_len = local_mbtowc (& wc,
+ token_buffer + 1,
+ i);
+ if (char_len != -1)
+ break;
+ c = GETC ();
+ }
+ if (char_len > 1)
+ {
+ /* mbtowc sometimes needs an extra char before accepting */
+ if (char_len < i)
+ UNGETC (c);
+ if (! wide_flag)
+ {
+ /* Merge character into result; ignore excess chars. */
+ for (i = 1; i <= char_len; ++i)
+ {
+ if (i > max_chars)
+ break;
+ if (width < HOST_BITS_PER_INT)
+ result = (result << width)
+ | (token_buffer[i]
+ & ((1 << width) - 1));
+ else
+ result = token_buffer[i];
+ }
+ num_chars += char_len;
+ goto tryagain;
+ }
+ c = wc;
+ }
+ else
+ {
+ if (char_len == -1)
+ warning ("Ignoring invalid multibyte character");
+ if (wide_flag)
+ c = wc;
+#ifdef MAP_CHARACTER
+ else
+ c = MAP_CHARACTER (c);
#endif
+ }
+#else /* ! MULTIBYTE_CHARS */
+#ifdef MAP_CHARACTER
+ c = MAP_CHARACTER (c);
+#endif
+#endif /* ! MULTIBYTE_CHARS */
+ }
- num_chars++;
- if (num_chars > maxtoken - 4)
- extend_token_buffer (token_buffer);
-
- token_buffer[num_chars] = c;
+ if (wide_flag)
+ {
+ if (chars_seen == 1) /* only keep the first one */
+ result = c;
+ goto tryagain;
+ }
/* Merge character into result; ignore excess chars. */
+ num_chars += (width / TYPE_PRECISION (char_type_node));
if (num_chars < max_chars + 1)
{
if (width < HOST_BITS_PER_INT)
@@ -1907,19 +1962,16 @@ yylex ()
}
}
- token_buffer[num_chars + 1] = '\'';
- token_buffer[num_chars + 2] = 0;
-
if (c != '\'')
- error ("malformatted character constant");
- else if (num_chars == 0)
+ error ("malformed character constant");
+ else if (chars_seen == 0)
error ("empty character constant");
else if (num_chars > max_chars)
{
num_chars = max_chars;
error ("character constant too long");
}
- else if (num_chars != 1 && ! flag_traditional)
+ else if (chars_seen != 1 && ! flag_traditional)
warning ("multi-character character constant");
/* If char type is signed, sign-extend the constant. */
@@ -1944,22 +1996,6 @@ yylex ()
}
else
{
-#ifdef MULTIBYTE_CHARS
- /* Set the initial shift state and convert the next sequence. */
- result = 0;
- /* In all locales L'\0' is zero and mbtowc will return zero,
- so don't use it. */
- if (num_chars > 1
- || (num_chars == 1 && token_buffer[1] != '\0'))
- {
- wchar_t wc;
- (void) mbtowc (NULL_PTR, NULL_PTR, 0);
- if (mbtowc (& wc, token_buffer + 1, num_chars) == num_chars)
- result = wc;
- else
- warning ("Ignoring invalid multibyte character");
- }
-#endif
yylval.ttype = build_int_2 (result, 0);
TREE_TYPE (yylval.ttype) = wchar_type_node;
}
@@ -1971,7 +2007,13 @@ yylex ()
case '"':
string_constant:
{
- c = GETC();
+ unsigned width = wide_flag ? WCHAR_TYPE_SIZE
+ : TYPE_PRECISION (char_type_node);
+#ifdef MULTIBYTE_CHARS
+ int longest_char = local_mb_cur_max ();
+ (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
+#endif
+ c = GETC ();
p = token_buffer + 1;
while (c != '"' && c >= 0)
@@ -1982,9 +2024,8 @@ yylex ()
c = readescape (&ignore);
if (ignore)
goto skipnewline;
- if (!wide_flag
- && TYPE_PRECISION (char_type_node) < HOST_BITS_PER_INT
- && c >= (1 << TYPE_PRECISION (char_type_node)))
+ if (width < HOST_BITS_PER_INT
+ && (unsigned) c >= (1 << width))
pedwarn ("escape sequence out of range for character");
}
else if (c == '\n')
@@ -1993,15 +2034,94 @@ yylex ()
pedwarn ("ANSI C forbids newline in string constant");
lineno++;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ wchar_t wc;
+ int i;
+ int char_len = -1;
+ for (i = 0; i < longest_char; ++i)
+ {
+ if (p + i == token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ p[i] = c;
- if (p == token_buffer + maxtoken)
- p = extend_token_buffer (p);
- *p++ = c;
+ char_len = local_mbtowc (& wc, p, i + 1);
+ if (char_len != -1)
+ break;
+ c = GETC ();
+ }
+ if (char_len == -1)
+ warning ("Ignoring invalid multibyte character");
+ else
+ {
+ /* mbtowc sometimes needs an extra char before accepting */
+ if (char_len <= i)
+ UNGETC (c);
+ if (wide_flag)
+ {
+ *(wchar_t *)p = wc;
+ p += sizeof (wc);
+ }
+ else
+ p += (i + 1);
+ c = GETC ();
+ continue;
+ }
+#endif /* MULTIBYTE_CHARS */
+ }
+
+ /* Add this single character into the buffer either as a wchar_t
+ or as a single byte. */
+ if (wide_flag)
+ {
+ unsigned width = TYPE_PRECISION (char_type_node);
+ unsigned bytemask = (1 << width) - 1;
+ int byte;
+
+ if (p + WCHAR_BYTES >= token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+
+ for (byte = 0; byte < WCHAR_BYTES; ++byte)
+ {
+ int value;
+ if (byte >= sizeof (c))
+ value = 0;
+ else
+ value = (c >> (byte * width)) & bytemask;
+ if (BYTES_BIG_ENDIAN)
+ p[WCHAR_BYTES - byte - 1] = value;
+ else
+ p[byte] = value;
+ }
+ p += WCHAR_BYTES;
+ }
+ else
+ {
+ if (p == token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ *p++ = c;
+ }
skipnewline:
- c = GETC();
+ c = GETC ();
+ }
+
+ /* Terminate the string value, either with a single byte zero
+ or with a wide zero. */
+ if (wide_flag)
+ {
+ if (p + WCHAR_BYTES >= token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ bzero (p, WCHAR_BYTES);
+ p += WCHAR_BYTES;
+ }
+ else
+ {
+ if (p == token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ *p++ = 0;
}
- *p = 0;
if (c < 0)
error ("Unterminated string constant");
@@ -2011,31 +2131,8 @@ yylex ()
if (wide_flag)
{
- /* If this is a L"..." wide-string, convert the multibyte string
- to a wide character string. */
- char *widep = (char *) alloca ((p - token_buffer) * WCHAR_BYTES);
- int len;
-
-#ifdef MULTIBYTE_CHARS
- len = mbstowcs ((wchar_t *) widep, token_buffer + 1, p - token_buffer);
- if (len < 0 || len >= (p - token_buffer))
- {
- warning ("Ignoring invalid multibyte string");
- len = 0;
- }
- bzero (widep + (len * WCHAR_BYTES), WCHAR_BYTES);
-#else
- {
- char *wp, *cp;
-
- wp = widep + (BYTES_BIG_ENDIAN ? WCHAR_BYTES - 1 : 0);
- bzero (widep, (p - token_buffer) * WCHAR_BYTES);
- for (cp = token_buffer + 1; cp < p; cp++)
- *wp = *cp, wp += WCHAR_BYTES;
- len = p - token_buffer - 1;
- }
-#endif
- yylval.ttype = build_string ((len + 1) * WCHAR_BYTES, widep);
+ yylval.ttype = build_string (p - (token_buffer + 1),
+ token_buffer + 1);
TREE_TYPE (yylval.ttype) = wchar_array_type_node;
value = STRING;
}
@@ -2043,14 +2140,15 @@ yylex ()
{
extern tree build_objc_string();
/* Return an Objective-C @"..." constant string object. */
- yylval.ttype = build_objc_string (p - token_buffer,
+ yylval.ttype = build_objc_string (p - (token_buffer + 1),
token_buffer + 1);
TREE_TYPE (yylval.ttype) = char_array_type_node;
value = OBJC_STRING;
}
else
{
- yylval.ttype = build_string (p - token_buffer, token_buffer + 1);
+ yylval.ttype = build_string (p - (token_buffer + 1),
+ token_buffer + 1);
TREE_TYPE (yylval.ttype) = char_array_type_node;
value = STRING;
}
diff --git a/gcc/c-parse.c b/gcc/c-parse.c
index 8a3dfec4bc3..74530d35d2f 100644
--- a/gcc/c-parse.c
+++ b/gcc/c-parse.c
@@ -68,11 +68,8 @@
#line 56 "c-parse.y"
#include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
#include <setjmp.h>
-
#include "tree.h"
#include "input.h"
#include "c-lex.h"
@@ -101,10 +98,10 @@ void yyerror ();
/* Cause the `yydebug' variable to be defined. */
#define YYDEBUG 1
-#line 94 "c-parse.y"
+#line 91 "c-parse.y"
typedef union {long itype; tree ttype; enum tree_code code;
char *filename; int lineno; int ends_in_label; } YYSTYPE;
-#line 210 "c-parse.y"
+#line 207 "c-parse.y"
/* Number of statements (loosely speaking) and compound statements
seen so far. */
@@ -360,46 +357,46 @@ static const short yyrhs[] = { -1,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 239, 244, 258, 260, 260, 261, 263, 265, 266, 274,
- 278, 289, 294, 299, 301, 303, 304, 305, 310, 317,
- 319, 324, 329, 335, 337, 342, 347, 353, 355, 360,
- 367, 369, 372, 374, 376, 378, 380, 382, 384, 388,
- 392, 395, 398, 401, 405, 407, 410, 413, 417, 445,
- 451, 454, 457, 460, 462, 466, 470, 474, 476, 479,
- 483, 510, 512, 514, 516, 518, 520, 522, 524, 526,
- 528, 530, 532, 534, 536, 540, 542, 546, 548, 551,
- 555, 557, 564, 567, 570, 576, 675, 676, 678, 684,
- 686, 700, 723, 725, 727, 731, 737, 739, 744, 746,
- 751, 753, 754, 764, 769, 771, 772, 773, 780, 786,
- 791, 794, 802, 807, 809, 810, 811, 818, 829, 833,
- 839, 844, 849, 854, 856, 858, 867, 870, 874, 876,
- 878, 883, 887, 890, 894, 897, 899, 911, 914, 916,
- 918, 922, 926, 928, 931, 944, 947, 951, 953, 961,
- 962, 963, 967, 969, 975, 976, 977, 980, 982, 985,
- 987, 990, 993, 999, 1006, 1008, 1015, 1022, 1025, 1032,
- 1035, 1039, 1042, 1046, 1051, 1054, 1058, 1061, 1063, 1065,
- 1067, 1074, 1076, 1077, 1078, 1083, 1085, 1090, 1098, 1103,
- 1107, 1110, 1112, 1117, 1120, 1122, 1124, 1128, 1131, 1131,
- 1134, 1134, 1137, 1137, 1140, 1140, 1143, 1145, 1156, 1164,
- 1168, 1179, 1187, 1194, 1196, 1201, 1204, 1209, 1211, 1213,
- 1220, 1222, 1230, 1236, 1238, 1240, 1247, 1249, 1255, 1261,
- 1263, 1265, 1267, 1274, 1276, 1279, 1284, 1286, 1290, 1292,
- 1294, 1296, 1300, 1302, 1305, 1308, 1311, 1314, 1318, 1320,
- 1323, 1325, 1329, 1332, 1337, 1339, 1341, 1355, 1362, 1367,
- 1373, 1378, 1380, 1385, 1387, 1391, 1395, 1399, 1409, 1411,
- 1416, 1421, 1424, 1428, 1431, 1435, 1438, 1441, 1444, 1448,
- 1451, 1455, 1459, 1461, 1463, 1465, 1467, 1469, 1471, 1473,
- 1483, 1491, 1493, 1495, 1499, 1501, 1504, 1507, 1518, 1520,
- 1525, 1527, 1530, 1544, 1547, 1550, 1552, 1554, 1562, 1570,
- 1581, 1586, 1589, 1603, 1612, 1616, 1620, 1624, 1630, 1634,
- 1639, 1642, 1647, 1650, 1651, 1668, 1673, 1676, 1688, 1690,
- 1700, 1710, 1711, 1719, 1722, 1734, 1738, 1755, 1765, 1774,
- 1779, 1784, 1789, 1793, 1797, 1808, 1815, 1822, 1829, 1840,
- 1846, 1849, 1854, 1877, 1911, 1942, 1973, 1988, 1999, 2003,
- 2007, 2010, 2015, 2017, 2020, 2022, 2026, 2031, 2034, 2040,
- 2045, 2050, 2052, 2061, 2062, 2068, 2070, 2080, 2082, 2086,
- 2089, 2095, 2105, 2114, 2123, 2133, 2147, 2152, 2157, 2159,
- 2168, 2171, 2176, 2179, 2183
+ 236, 241, 255, 257, 257, 258, 260, 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, 369, 371, 373, 375, 377, 379, 381, 385,
+ 389, 392, 395, 398, 402, 404, 407, 410, 414, 442,
+ 448, 451, 454, 457, 459, 463, 467, 471, 473, 476,
+ 480, 507, 509, 511, 513, 515, 517, 519, 521, 523,
+ 525, 527, 529, 531, 533, 537, 539, 543, 545, 548,
+ 552, 554, 561, 564, 567, 573, 672, 673, 675, 681,
+ 683, 697, 720, 722, 724, 728, 734, 736, 741, 743,
+ 748, 750, 751, 761, 766, 768, 769, 770, 777, 783,
+ 788, 791, 799, 804, 806, 807, 808, 815, 826, 830,
+ 836, 841, 846, 851, 853, 855, 864, 867, 871, 873,
+ 875, 880, 884, 887, 891, 894, 896, 908, 911, 913,
+ 915, 919, 923, 925, 928, 941, 944, 948, 950, 958,
+ 959, 960, 964, 966, 972, 973, 974, 977, 979, 982,
+ 984, 987, 990, 996, 1003, 1005, 1012, 1019, 1022, 1029,
+ 1032, 1036, 1039, 1043, 1048, 1051, 1055, 1058, 1060, 1062,
+ 1064, 1071, 1073, 1074, 1075, 1080, 1082, 1087, 1095, 1100,
+ 1104, 1107, 1109, 1114, 1117, 1119, 1121, 1125, 1128, 1128,
+ 1131, 1131, 1134, 1134, 1137, 1137, 1140, 1142, 1153, 1161,
+ 1165, 1176, 1184, 1191, 1193, 1198, 1201, 1206, 1208, 1210,
+ 1217, 1219, 1227, 1233, 1235, 1237, 1244, 1246, 1252, 1258,
+ 1260, 1262, 1264, 1271, 1273, 1276, 1281, 1283, 1287, 1289,
+ 1291, 1293, 1297, 1299, 1302, 1305, 1308, 1311, 1315, 1317,
+ 1320, 1322, 1326, 1329, 1334, 1336, 1338, 1352, 1359, 1364,
+ 1370, 1375, 1377, 1382, 1384, 1388, 1392, 1396, 1406, 1408,
+ 1413, 1418, 1421, 1425, 1428, 1432, 1435, 1438, 1441, 1445,
+ 1448, 1452, 1456, 1458, 1460, 1462, 1464, 1466, 1468, 1470,
+ 1480, 1488, 1490, 1492, 1496, 1498, 1501, 1504, 1515, 1517,
+ 1522, 1524, 1527, 1541, 1544, 1547, 1549, 1551, 1559, 1567,
+ 1578, 1583, 1586, 1600, 1609, 1613, 1617, 1621, 1627, 1631,
+ 1636, 1639, 1644, 1647, 1648, 1665, 1670, 1673, 1685, 1687,
+ 1697, 1707, 1708, 1716, 1719, 1731, 1735, 1752, 1762, 1771,
+ 1776, 1781, 1786, 1790, 1794, 1805, 1812, 1819, 1826, 1837,
+ 1843, 1846, 1851, 1874, 1908, 1939, 1970, 1985, 1996, 2000,
+ 2004, 2007, 2012, 2014, 2017, 2019, 2023, 2028, 2031, 2037,
+ 2042, 2047, 2049, 2058, 2059, 2065, 2067, 2077, 2079, 2083,
+ 2086, 2092, 2102, 2111, 2120, 2130, 2144, 2149, 2154, 2156,
+ 2165, 2168, 2173, 2176, 2180
};
#endif
@@ -1662,14 +1659,14 @@ yyreduce:
switch (yyn) {
case 1:
-#line 240 "c-parse.y"
+#line 237 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids an empty source file");
finish_file ();
;
break;}
case 2:
-#line 245 "c-parse.y"
+#line 242 "c-parse.y"
{
/* In case there were missing closebraces,
get us back to the global binding level. */
@@ -1679,15 +1676,15 @@ case 2:
;
break;}
case 3:
-#line 259 "c-parse.y"
+#line 256 "c-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
case 5:
-#line 260 "c-parse.y"
+#line 257 "c-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
case 9:
-#line 267 "c-parse.y"
+#line 264 "c-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)
@@ -1697,11 +1694,11 @@ case 9:
error ("argument of `asm' is not a constant string"); ;
break;}
case 10:
-#line 275 "c-parse.y"
+#line 272 "c-parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
case 11:
-#line 280 "c-parse.y"
+#line 277 "c-parse.y"
{ if (pedantic)
error ("ANSI C forbids data definition with no type or storage class");
else if (!flag_traditional)
@@ -1713,45 +1710,45 @@ case 11:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 12:
-#line 290 "c-parse.y"
+#line 287 "c-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 13:
-#line 295 "c-parse.y"
+#line 292 "c-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 300 "c-parse.y"
+#line 297 "c-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 15:
-#line 302 "c-parse.y"
+#line 299 "c-parse.y"
{ shadow_tag (yyvsp[-1].ttype); ;
break;}
case 18:
-#line 306 "c-parse.y"
+#line 303 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C does not allow extra `;' outside of a function"); ;
break;}
case 19:
-#line 312 "c-parse.y"
+#line 309 "c-parse.y"
{ if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 0))
YYERROR1;
reinit_parse_for_function (); ;
break;}
case 20:
-#line 317 "c-parse.y"
+#line 314 "c-parse.y"
{ store_parm_decls (); ;
break;}
case 21:
-#line 319 "c-parse.y"
+#line 316 "c-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -1759,25 +1756,25 @@ case 21:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 22:
-#line 325 "c-parse.y"
+#line 322 "c-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 23:
-#line 330 "c-parse.y"
+#line 327 "c-parse.y"
{ if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 0))
YYERROR1;
reinit_parse_for_function (); ;
break;}
case 24:
-#line 335 "c-parse.y"
+#line 332 "c-parse.y"
{ store_parm_decls (); ;
break;}
case 25:
-#line 337 "c-parse.y"
+#line 334 "c-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -1785,25 +1782,25 @@ case 25:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 26:
-#line 343 "c-parse.y"
+#line 340 "c-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 27:
-#line 348 "c-parse.y"
+#line 345 "c-parse.y"
{ if (! start_function (NULL_TREE, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 0))
YYERROR1;
reinit_parse_for_function (); ;
break;}
case 28:
-#line 353 "c-parse.y"
+#line 350 "c-parse.y"
{ store_parm_decls (); ;
break;}
case 29:
-#line 355 "c-parse.y"
+#line 352 "c-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -1811,72 +1808,72 @@ case 29:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 30:
-#line 361 "c-parse.y"
+#line 358 "c-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 33:
-#line 373 "c-parse.y"
+#line 370 "c-parse.y"
{ yyval.code = ADDR_EXPR; ;
break;}
case 34:
-#line 375 "c-parse.y"
+#line 372 "c-parse.y"
{ yyval.code = NEGATE_EXPR; ;
break;}
case 35:
-#line 377 "c-parse.y"
+#line 374 "c-parse.y"
{ yyval.code = CONVERT_EXPR; ;
break;}
case 36:
-#line 379 "c-parse.y"
+#line 376 "c-parse.y"
{ yyval.code = PREINCREMENT_EXPR; ;
break;}
case 37:
-#line 381 "c-parse.y"
+#line 378 "c-parse.y"
{ yyval.code = PREDECREMENT_EXPR; ;
break;}
case 38:
-#line 383 "c-parse.y"
+#line 380 "c-parse.y"
{ yyval.code = BIT_NOT_EXPR; ;
break;}
case 39:
-#line 385 "c-parse.y"
+#line 382 "c-parse.y"
{ yyval.code = TRUTH_NOT_EXPR; ;
break;}
case 40:
-#line 389 "c-parse.y"
+#line 386 "c-parse.y"
{ yyval.ttype = build_compound_expr (yyvsp[0].ttype); ;
break;}
case 41:
-#line 394 "c-parse.y"
+#line 391 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 43:
-#line 400 "c-parse.y"
+#line 397 "c-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 44:
-#line 402 "c-parse.y"
+#line 399 "c-parse.y"
{ chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 46:
-#line 408 "c-parse.y"
+#line 405 "c-parse.y"
{ yyval.ttype = build_indirect_ref (yyvsp[0].ttype, "unary *"); ;
break;}
case 47:
-#line 411 "c-parse.y"
+#line 408 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
case 48:
-#line 414 "c-parse.y"
+#line 411 "c-parse.y"
{ yyval.ttype = build_unary_op (yyvsp[-1].code, yyvsp[0].ttype, 0);
overflow_warning (yyval.ttype); ;
break;}
case 49:
-#line 418 "c-parse.y"
+#line 415 "c-parse.y"
{ tree label = lookup_label (yyvsp[0].ttype);
if (pedantic)
pedwarn ("ANSI C forbids `&&'");
@@ -1891,7 +1888,7 @@ case 49:
;
break;}
case 50:
-#line 446 "c-parse.y"
+#line 443 "c-parse.y"
{ skip_evaluation--;
if (TREE_CODE (yyvsp[0].ttype) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (yyvsp[0].ttype, 1)))
@@ -1899,49 +1896,49 @@ case 50:
yyval.ttype = c_sizeof (TREE_TYPE (yyvsp[0].ttype)); ;
break;}
case 51:
-#line 452 "c-parse.y"
+#line 449 "c-parse.y"
{ skip_evaluation--;
yyval.ttype = c_sizeof (groktypename (yyvsp[-1].ttype)); ;
break;}
case 52:
-#line 455 "c-parse.y"
+#line 452 "c-parse.y"
{ skip_evaluation--;
yyval.ttype = c_alignof_expr (yyvsp[0].ttype); ;
break;}
case 53:
-#line 458 "c-parse.y"
+#line 455 "c-parse.y"
{ skip_evaluation--;
yyval.ttype = c_alignof (groktypename (yyvsp[-1].ttype)); ;
break;}
case 54:
-#line 461 "c-parse.y"
+#line 458 "c-parse.y"
{ yyval.ttype = build_unary_op (REALPART_EXPR, yyvsp[0].ttype, 0); ;
break;}
case 55:
-#line 463 "c-parse.y"
+#line 460 "c-parse.y"
{ yyval.ttype = build_unary_op (IMAGPART_EXPR, yyvsp[0].ttype, 0); ;
break;}
case 56:
-#line 467 "c-parse.y"
+#line 464 "c-parse.y"
{ skip_evaluation++; ;
break;}
case 57:
-#line 471 "c-parse.y"
+#line 468 "c-parse.y"
{ skip_evaluation++; ;
break;}
case 59:
-#line 477 "c-parse.y"
+#line 474 "c-parse.y"
{ tree type = groktypename (yyvsp[-2].ttype);
yyval.ttype = build_c_cast (type, yyvsp[0].ttype); ;
break;}
case 60:
-#line 480 "c-parse.y"
+#line 477 "c-parse.y"
{ start_init (NULL_TREE, NULL, 0);
yyvsp[-2].ttype = groktypename (yyvsp[-2].ttype);
really_start_incremental_init (yyvsp[-2].ttype); ;
break;}
case 61:
-#line 484 "c-parse.y"
+#line 481 "c-parse.y"
{ char *name;
tree result = pop_init_level (0);
tree type = yyvsp[-5].ttype;
@@ -1968,90 +1965,90 @@ case 61:
;
break;}
case 63:
-#line 513 "c-parse.y"
+#line 510 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 64:
-#line 515 "c-parse.y"
+#line 512 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 65:
-#line 517 "c-parse.y"
+#line 514 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 66:
-#line 519 "c-parse.y"
+#line 516 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 67:
-#line 521 "c-parse.y"
+#line 518 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 68:
-#line 523 "c-parse.y"
+#line 520 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 69:
-#line 525 "c-parse.y"
+#line 522 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 70:
-#line 527 "c-parse.y"
+#line 524 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 71:
-#line 529 "c-parse.y"
+#line 526 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 72:
-#line 531 "c-parse.y"
+#line 528 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 73:
-#line 533 "c-parse.y"
+#line 530 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 74:
-#line 535 "c-parse.y"
+#line 532 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 75:
-#line 537 "c-parse.y"
+#line 534 "c-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_false_node; ;
break;}
case 76:
-#line 540 "c-parse.y"
+#line 537 "c-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 77:
-#line 543 "c-parse.y"
+#line 540 "c-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_true_node; ;
break;}
case 78:
-#line 546 "c-parse.y"
+#line 543 "c-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 79:
-#line 549 "c-parse.y"
+#line 546 "c-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_false_node; ;
break;}
case 80:
-#line 552 "c-parse.y"
+#line 549 "c-parse.y"
{ skip_evaluation += ((yyvsp[-4].ttype == boolean_true_node)
- (yyvsp[-4].ttype == boolean_false_node)); ;
break;}
case 81:
-#line 555 "c-parse.y"
+#line 552 "c-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 82:
-#line 558 "c-parse.y"
+#line 555 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids omitting the middle term of a ?: expression");
/* Make sure first operand is calculated only once. */
@@ -2060,23 +2057,23 @@ case 82:
skip_evaluation += yyvsp[-1].ttype == boolean_true_node; ;
break;}
case 83:
-#line 565 "c-parse.y"
+#line 562 "c-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 84:
-#line 568 "c-parse.y"
+#line 565 "c-parse.y"
{ yyval.ttype = build_modify_expr (yyvsp[-2].ttype, NOP_EXPR, yyvsp[0].ttype);
C_SET_EXP_ORIGINAL_CODE (yyval.ttype, MODIFY_EXPR); ;
break;}
case 85:
-#line 571 "c-parse.y"
+#line 568 "c-parse.y"
{ yyval.ttype = build_modify_expr (yyvsp[-2].ttype, yyvsp[-1].code, yyvsp[0].ttype);
/* This inhibits warnings in truthvalue_conversion. */
C_SET_EXP_ORIGINAL_CODE (yyval.ttype, ERROR_MARK); ;
break;}
case 86:
-#line 578 "c-parse.y"
+#line 575 "c-parse.y"
{
yyval.ttype = lastiddecl;
if (!yyval.ttype || yyval.ttype == error_mark_node)
@@ -2176,11 +2173,11 @@ case 86:
;
break;}
case 88:
-#line 677 "c-parse.y"
+#line 674 "c-parse.y"
{ yyval.ttype = combine_strings (yyvsp[0].ttype); ;
break;}
case 89:
-#line 679 "c-parse.y"
+#line 676 "c-parse.y"
{ char class = TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype));
if (class == 'e' || class == '1'
|| class == '2' || class == '<')
@@ -2188,11 +2185,11 @@ case 89:
yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 90:
-#line 685 "c-parse.y"
+#line 682 "c-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 91:
-#line 687 "c-parse.y"
+#line 684 "c-parse.y"
{ if (current_function_decl == 0)
{
error ("braced-group within expression allowed only inside a function");
@@ -2208,7 +2205,7 @@ case 91:
yyval.ttype = expand_start_stmt_expr (); ;
break;}
case 92:
-#line 701 "c-parse.y"
+#line 698 "c-parse.y"
{ tree rtl_exp;
if (pedantic)
pedwarn ("ANSI C forbids braced-groups within expressions");
@@ -2233,21 +2230,21 @@ case 92:
;
break;}
case 93:
-#line 724 "c-parse.y"
+#line 721 "c-parse.y"
{ yyval.ttype = build_function_call (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 94:
-#line 726 "c-parse.y"
+#line 723 "c-parse.y"
{ yyval.ttype = build_array_ref (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 95:
-#line 728 "c-parse.y"
+#line 725 "c-parse.y"
{
yyval.ttype = build_component_ref (yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
case 96:
-#line 732 "c-parse.y"
+#line 729 "c-parse.y"
{
tree expr = build_indirect_ref (yyvsp[-2].ttype, "->");
@@ -2255,56 +2252,56 @@ case 96:
;
break;}
case 97:
-#line 738 "c-parse.y"
+#line 735 "c-parse.y"
{ yyval.ttype = build_unary_op (POSTINCREMENT_EXPR, yyvsp[-1].ttype, 0); ;
break;}
case 98:
-#line 740 "c-parse.y"
+#line 737 "c-parse.y"
{ yyval.ttype = build_unary_op (POSTDECREMENT_EXPR, yyvsp[-1].ttype, 0); ;
break;}
case 100:
-#line 747 "c-parse.y"
+#line 744 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 103:
-#line 756 "c-parse.y"
+#line 753 "c-parse.y"
{ c_mark_varargs ();
if (pedantic)
pedwarn ("ANSI C does not permit use of `varargs.h'"); ;
break;}
case 104:
-#line 766 "c-parse.y"
+#line 763 "c-parse.y"
{ ;
break;}
case 109:
-#line 782 "c-parse.y"
+#line 779 "c-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 110:
-#line 787 "c-parse.y"
+#line 784 "c-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 111:
-#line 792 "c-parse.y"
+#line 789 "c-parse.y"
{ shadow_tag_warned (yyvsp[-1].ttype, 1);
pedwarn ("empty declaration"); ;
break;}
case 112:
-#line 795 "c-parse.y"
+#line 792 "c-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 113:
-#line 804 "c-parse.y"
+#line 801 "c-parse.y"
{ ;
break;}
case 118:
-#line 819 "c-parse.y"
+#line 816 "c-parse.y"
{ yyval.itype = suspend_momentary ();
pending_xref_error ();
declspec_stack = tree_cons (prefix_attributes,
@@ -2314,131 +2311,131 @@ case 118:
&current_declspecs, &prefix_attributes); ;
break;}
case 119:
-#line 830 "c-parse.y"
+#line 827 "c-parse.y"
{ prefix_attributes = chainon (prefix_attributes, yyvsp[0].ttype); ;
break;}
case 120:
-#line 835 "c-parse.y"
+#line 832 "c-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 840 "c-parse.y"
+#line 837 "c-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 845 "c-parse.y"
+#line 842 "c-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 123:
-#line 850 "c-parse.y"
+#line 847 "c-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 124:
-#line 855 "c-parse.y"
+#line 852 "c-parse.y"
{ shadow_tag (yyvsp[-1].ttype); ;
break;}
case 125:
-#line 857 "c-parse.y"
+#line 854 "c-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 126:
-#line 859 "c-parse.y"
+#line 856 "c-parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
case 127:
-#line 869 "c-parse.y"
+#line 866 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 128:
-#line 871 "c-parse.y"
+#line 868 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 129:
-#line 875 "c-parse.y"
+#line 872 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 130:
-#line 877 "c-parse.y"
+#line 874 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 131:
-#line 879 "c-parse.y"
+#line 876 "c-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 132:
-#line 884 "c-parse.y"
+#line 881 "c-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 133:
-#line 889 "c-parse.y"
+#line 886 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 134:
-#line 891 "c-parse.y"
+#line 888 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 135:
-#line 896 "c-parse.y"
+#line 893 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 136:
-#line 898 "c-parse.y"
+#line 895 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 137:
-#line 900 "c-parse.y"
+#line 897 "c-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 138:
-#line 913 "c-parse.y"
+#line 910 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 139:
-#line 915 "c-parse.y"
+#line 912 "c-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, NULL_TREE); ;
break;}
case 140:
-#line 917 "c-parse.y"
+#line 914 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 141:
-#line 919 "c-parse.y"
+#line 916 "c-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 142:
-#line 924 "c-parse.y"
+#line 921 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE);
TREE_STATIC (yyval.ttype) = 1; ;
break;}
case 143:
-#line 927 "c-parse.y"
+#line 924 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 144:
-#line 929 "c-parse.y"
+#line 926 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype);
TREE_STATIC (yyval.ttype) = 1; ;
break;}
case 145:
-#line 932 "c-parse.y"
+#line 929 "c-parse.y"
{ if (extra_warnings && TREE_STATIC (yyvsp[-1].ttype))
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyvsp[0].ttype));
@@ -2446,138 +2443,138 @@ case 145:
TREE_STATIC (yyval.ttype) = TREE_STATIC (yyvsp[-1].ttype); ;
break;}
case 146:
-#line 946 "c-parse.y"
+#line 943 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 147:
-#line 948 "c-parse.y"
+#line 945 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 148:
-#line 952 "c-parse.y"
+#line 949 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 149:
-#line 954 "c-parse.y"
+#line 951 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 152:
-#line 964 "c-parse.y"
+#line 961 "c-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 153:
-#line 968 "c-parse.y"
+#line 965 "c-parse.y"
{ yyval.ttype = TREE_TYPE (yyvsp[-1].ttype); ;
break;}
case 154:
-#line 970 "c-parse.y"
+#line 967 "c-parse.y"
{ yyval.ttype = groktypename (yyvsp[-1].ttype); ;
break;}
case 162:
-#line 992 "c-parse.y"
+#line 989 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 163:
-#line 994 "c-parse.y"
+#line 991 "c-parse.y"
{ if (TREE_CHAIN (yyvsp[-1].ttype)) yyvsp[-1].ttype = combine_strings (yyvsp[-1].ttype);
yyval.ttype = yyvsp[-1].ttype;
;
break;}
case 164:
-#line 1001 "c-parse.y"
+#line 998 "c-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 165:
-#line 1006 "c-parse.y"
+#line 1003 "c-parse.y"
{ finish_init ();
finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype); ;
break;}
case 166:
-#line 1009 "c-parse.y"
+#line 1006 "c-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 167:
-#line 1017 "c-parse.y"
+#line 1014 "c-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 168:
-#line 1022 "c-parse.y"
+#line 1019 "c-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 169:
-#line 1026 "c-parse.y"
+#line 1023 "c-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 170:
-#line 1034 "c-parse.y"
+#line 1031 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 171:
-#line 1036 "c-parse.y"
+#line 1033 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 172:
-#line 1041 "c-parse.y"
+#line 1038 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 173:
-#line 1043 "c-parse.y"
+#line 1040 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 174:
-#line 1048 "c-parse.y"
+#line 1045 "c-parse.y"
{ yyval.ttype = yyvsp[-2].ttype; ;
break;}
case 175:
-#line 1053 "c-parse.y"
+#line 1050 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 176:
-#line 1055 "c-parse.y"
+#line 1052 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 177:
-#line 1060 "c-parse.y"
+#line 1057 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 178:
-#line 1062 "c-parse.y"
+#line 1059 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 179:
-#line 1064 "c-parse.y"
+#line 1061 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, build_tree_list (NULL_TREE, yyvsp[-1].ttype)); ;
break;}
case 180:
-#line 1066 "c-parse.y"
+#line 1063 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-5].ttype, tree_cons (NULL_TREE, yyvsp[-3].ttype, yyvsp[-1].ttype)); ;
break;}
case 181:
-#line 1068 "c-parse.y"
+#line 1065 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 187:
-#line 1086 "c-parse.y"
+#line 1083 "c-parse.y"
{ really_start_incremental_init (NULL_TREE);
/* Note that the call to clear_momentary
is in process_init_element. */
push_momentary (); ;
break;}
case 188:
-#line 1091 "c-parse.y"
+#line 1088 "c-parse.y"
{ yyval.ttype = pop_init_level (0);
if (yyval.ttype == error_mark_node
&& ! (yychar == STRING || yychar == CONSTANT))
@@ -2586,48 +2583,48 @@ case 188:
pop_momentary_nofree (); ;
break;}
case 189:
-#line 1099 "c-parse.y"
+#line 1096 "c-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 190:
-#line 1105 "c-parse.y"
+#line 1102 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids empty initializer braces"); ;
break;}
case 194:
-#line 1119 "c-parse.y"
+#line 1116 "c-parse.y"
{ process_init_element (yyvsp[0].ttype); ;
break;}
case 195:
-#line 1121 "c-parse.y"
+#line 1118 "c-parse.y"
{ push_init_level (0); ;
break;}
case 196:
-#line 1123 "c-parse.y"
+#line 1120 "c-parse.y"
{ process_init_element (pop_init_level (0)); ;
break;}
case 198:
-#line 1129 "c-parse.y"
+#line 1126 "c-parse.y"
{ set_init_index (yyvsp[-4].ttype, yyvsp[-2].ttype); ;
break;}
case 200:
-#line 1132 "c-parse.y"
+#line 1129 "c-parse.y"
{ set_init_index (yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 202:
-#line 1135 "c-parse.y"
+#line 1132 "c-parse.y"
{ set_init_index (yyvsp[-1].ttype, NULL_TREE); ;
break;}
case 204:
-#line 1138 "c-parse.y"
+#line 1135 "c-parse.y"
{ set_init_label (yyvsp[-1].ttype); ;
break;}
case 206:
-#line 1141 "c-parse.y"
+#line 1138 "c-parse.y"
{ set_init_label (yyvsp[-1].ttype); ;
break;}
case 208:
-#line 1147 "c-parse.y"
+#line 1144 "c-parse.y"
{ push_c_function_context ();
if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 1))
@@ -2638,16 +2635,16 @@ case 208:
reinit_parse_for_function (); ;
break;}
case 209:
-#line 1156 "c-parse.y"
+#line 1153 "c-parse.y"
{ store_parm_decls (); ;
break;}
case 210:
-#line 1164 "c-parse.y"
+#line 1161 "c-parse.y"
{ finish_function (1);
pop_c_function_context (); ;
break;}
case 211:
-#line 1170 "c-parse.y"
+#line 1167 "c-parse.y"
{ push_c_function_context ();
if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 1))
@@ -2658,172 +2655,172 @@ case 211:
reinit_parse_for_function (); ;
break;}
case 212:
-#line 1179 "c-parse.y"
+#line 1176 "c-parse.y"
{ store_parm_decls (); ;
break;}
case 213:
-#line 1187 "c-parse.y"
+#line 1184 "c-parse.y"
{ finish_function (1);
pop_c_function_context (); ;
break;}
case 216:
-#line 1203 "c-parse.y"
+#line 1200 "c-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 217:
-#line 1205 "c-parse.y"
+#line 1202 "c-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 218:
-#line 1210 "c-parse.y"
+#line 1207 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 219:
-#line 1212 "c-parse.y"
+#line 1209 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 220:
-#line 1214 "c-parse.y"
+#line 1211 "c-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 221:
-#line 1221 "c-parse.y"
+#line 1218 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 223:
-#line 1232 "c-parse.y"
+#line 1229 "c-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 224:
-#line 1237 "c-parse.y"
+#line 1234 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 225:
-#line 1239 "c-parse.y"
+#line 1236 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 226:
-#line 1241 "c-parse.y"
+#line 1238 "c-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 227:
-#line 1248 "c-parse.y"
+#line 1245 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 229:
-#line 1257 "c-parse.y"
+#line 1254 "c-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 230:
-#line 1262 "c-parse.y"
+#line 1259 "c-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 231:
-#line 1264 "c-parse.y"
+#line 1261 "c-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 232:
-#line 1266 "c-parse.y"
+#line 1263 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 233:
-#line 1268 "c-parse.y"
+#line 1265 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 234:
-#line 1275 "c-parse.y"
+#line 1272 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 236:
-#line 1281 "c-parse.y"
+#line 1278 "c-parse.y"
{ yyval.ttype = start_struct (RECORD_TYPE, yyvsp[-1].ttype);
/* Start scope of tag before parsing components. */
;
break;}
case 237:
-#line 1285 "c-parse.y"
+#line 1282 "c-parse.y"
{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 238:
-#line 1287 "c-parse.y"
+#line 1284 "c-parse.y"
{ yyval.ttype = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
case 239:
-#line 1291 "c-parse.y"
+#line 1288 "c-parse.y"
{ yyval.ttype = xref_tag (RECORD_TYPE, yyvsp[0].ttype); ;
break;}
case 240:
-#line 1293 "c-parse.y"
+#line 1290 "c-parse.y"
{ yyval.ttype = start_struct (UNION_TYPE, yyvsp[-1].ttype); ;
break;}
case 241:
-#line 1295 "c-parse.y"
+#line 1292 "c-parse.y"
{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 242:
-#line 1297 "c-parse.y"
+#line 1294 "c-parse.y"
{ yyval.ttype = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
case 243:
-#line 1301 "c-parse.y"
+#line 1298 "c-parse.y"
{ yyval.ttype = xref_tag (UNION_TYPE, yyvsp[0].ttype); ;
break;}
case 244:
-#line 1303 "c-parse.y"
+#line 1300 "c-parse.y"
{ yyvsp[0].itype = suspend_momentary ();
yyval.ttype = start_enum (yyvsp[-1].ttype); ;
break;}
case 245:
-#line 1306 "c-parse.y"
+#line 1303 "c-parse.y"
{ yyval.ttype = finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), yyvsp[0].ttype);
resume_momentary (yyvsp[-5].itype); ;
break;}
case 246:
-#line 1309 "c-parse.y"
+#line 1306 "c-parse.y"
{ yyvsp[0].itype = suspend_momentary ();
yyval.ttype = start_enum (NULL_TREE); ;
break;}
case 247:
-#line 1312 "c-parse.y"
+#line 1309 "c-parse.y"
{ yyval.ttype = finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), yyvsp[0].ttype);
resume_momentary (yyvsp[-5].itype); ;
break;}
case 248:
-#line 1315 "c-parse.y"
+#line 1312 "c-parse.y"
{ yyval.ttype = xref_tag (ENUMERAL_TYPE, yyvsp[0].ttype); ;
break;}
case 252:
-#line 1326 "c-parse.y"
+#line 1323 "c-parse.y"
{ if (pedantic) pedwarn ("comma at end of enumerator list"); ;
break;}
case 253:
-#line 1331 "c-parse.y"
+#line 1328 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 254:
-#line 1333 "c-parse.y"
+#line 1330 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype);
pedwarn ("no semicolon at end of struct or union"); ;
break;}
case 255:
-#line 1338 "c-parse.y"
+#line 1335 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 256:
-#line 1340 "c-parse.y"
+#line 1337 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 257:
-#line 1342 "c-parse.y"
+#line 1339 "c-parse.y"
{ if (pedantic)
pedwarn ("extra semicolon in struct or union specified"); ;
break;}
case 258:
-#line 1357 "c-parse.y"
+#line 1354 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -2831,14 +2828,14 @@ case 258:
resume_momentary (yyvsp[-1].itype); ;
break;}
case 259:
-#line 1363 "c-parse.y"
+#line 1360 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids member declarations with no members");
shadow_tag(yyvsp[0].ttype);
yyval.ttype = NULL_TREE; ;
break;}
case 260:
-#line 1368 "c-parse.y"
+#line 1365 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -2846,140 +2843,140 @@ case 260:
resume_momentary (yyvsp[-1].itype); ;
break;}
case 261:
-#line 1374 "c-parse.y"
+#line 1371 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids member declarations with no members");
shadow_tag(yyvsp[0].ttype);
yyval.ttype = NULL_TREE; ;
break;}
case 262:
-#line 1379 "c-parse.y"
+#line 1376 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 263:
-#line 1381 "c-parse.y"
+#line 1378 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
case 265:
-#line 1388 "c-parse.y"
+#line 1385 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 266:
-#line 1393 "c-parse.y"
+#line 1390 "c-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 267:
-#line 1397 "c-parse.y"
+#line 1394 "c-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 268:
-#line 1400 "c-parse.y"
+#line 1397 "c-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 270:
-#line 1412 "c-parse.y"
+#line 1409 "c-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 271:
-#line 1417 "c-parse.y"
+#line 1414 "c-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 272:
-#line 1423 "c-parse.y"
+#line 1420 "c-parse.y"
{ yyval.ttype = build_enumerator (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 273:
-#line 1425 "c-parse.y"
+#line 1422 "c-parse.y"
{ yyval.ttype = build_enumerator (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 274:
-#line 1430 "c-parse.y"
+#line 1427 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 275:
-#line 1432 "c-parse.y"
+#line 1429 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 276:
-#line 1437 "c-parse.y"
+#line 1434 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 278:
-#line 1443 "c-parse.y"
+#line 1440 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 279:
-#line 1445 "c-parse.y"
+#line 1442 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 280:
-#line 1450 "c-parse.y"
+#line 1447 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 281:
-#line 1452 "c-parse.y"
+#line 1449 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 282:
-#line 1457 "c-parse.y"
+#line 1454 "c-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 283:
-#line 1460 "c-parse.y"
+#line 1457 "c-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 284:
-#line 1462 "c-parse.y"
+#line 1459 "c-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 285:
-#line 1464 "c-parse.y"
+#line 1461 "c-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 286:
-#line 1466 "c-parse.y"
+#line 1463 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 287:
-#line 1468 "c-parse.y"
+#line 1465 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 288:
-#line 1470 "c-parse.y"
+#line 1467 "c-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 289:
-#line 1472 "c-parse.y"
+#line 1469 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 290:
-#line 1474 "c-parse.y"
+#line 1471 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, NULL_TREE, NULL_TREE); ;
break;}
case 291:
-#line 1485 "c-parse.y"
+#line 1482 "c-parse.y"
{
if (pedantic && yyvsp[0].ends_in_label)
pedwarn ("ANSI C forbids label at end of compound statement");
;
break;}
case 293:
-#line 1494 "c-parse.y"
+#line 1491 "c-parse.y"
{ yyval.ends_in_label = yyvsp[0].ends_in_label; ;
break;}
case 294:
-#line 1496 "c-parse.y"
+#line 1493 "c-parse.y"
{ yyval.ends_in_label = 0; ;
break;}
case 298:
-#line 1508 "c-parse.y"
+#line 1505 "c-parse.y"
{ emit_line_note (input_filename, lineno);
pushlevel (0);
clear_last_expr ();
@@ -2988,12 +2985,12 @@ case 298:
;
break;}
case 300:
-#line 1521 "c-parse.y"
+#line 1518 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids label declarations"); ;
break;}
case 303:
-#line 1532 "c-parse.y"
+#line 1529 "c-parse.y"
{ tree link;
for (link = yyvsp[-1].ttype; link; link = TREE_CHAIN (link))
{
@@ -3004,19 +3001,19 @@ case 303:
;
break;}
case 304:
-#line 1546 "c-parse.y"
+#line 1543 "c-parse.y"
{;
break;}
case 306:
-#line 1550 "c-parse.y"
+#line 1547 "c-parse.y"
{ compstmt_count++; ;
break;}
case 307:
-#line 1553 "c-parse.y"
+#line 1550 "c-parse.y"
{ yyval.ttype = convert (void_type_node, integer_zero_node); ;
break;}
case 308:
-#line 1555 "c-parse.y"
+#line 1552 "c-parse.y"
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), 1, 0);
yyval.ttype = poplevel (1, 1, 0);
@@ -3026,7 +3023,7 @@ case 308:
pop_momentary (); ;
break;}
case 309:
-#line 1563 "c-parse.y"
+#line 1560 "c-parse.y"
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), kept_level_p (), 0);
yyval.ttype = poplevel (kept_level_p (), 0, 0);
@@ -3036,7 +3033,7 @@ case 309:
pop_momentary (); ;
break;}
case 310:
-#line 1571 "c-parse.y"
+#line 1568 "c-parse.y"
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), kept_level_p (), 0);
yyval.ttype = poplevel (kept_level_p (), 0, 0);
@@ -3046,7 +3043,7 @@ case 310:
pop_momentary (); ;
break;}
case 313:
-#line 1591 "c-parse.y"
+#line 1588 "c-parse.y"
{ emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
c_expand_start_cond (truthvalue_conversion (yyvsp[-1].ttype), 0,
compstmt_count);
@@ -3056,7 +3053,7 @@ case 313:
position_after_white_space (); ;
break;}
case 314:
-#line 1605 "c-parse.y"
+#line 1602 "c-parse.y"
{ stmt_count++;
compstmt_count++;
emit_line_note (yyvsp[-2].filename, yyvsp[-1].lineno);
@@ -3066,43 +3063,43 @@ case 314:
position_after_white_space (); ;
break;}
case 315:
-#line 1613 "c-parse.y"
+#line 1610 "c-parse.y"
{ expand_loop_continue_here (); ;
break;}
case 316:
-#line 1617 "c-parse.y"
+#line 1614 "c-parse.y"
{ yyval.filename = input_filename; ;
break;}
case 317:
-#line 1621 "c-parse.y"
+#line 1618 "c-parse.y"
{ yyval.lineno = lineno; ;
break;}
case 318:
-#line 1626 "c-parse.y"
+#line 1623 "c-parse.y"
{ ;
break;}
case 319:
-#line 1631 "c-parse.y"
+#line 1628 "c-parse.y"
{ ;
break;}
case 320:
-#line 1636 "c-parse.y"
+#line 1633 "c-parse.y"
{ yyval.ends_in_label = yyvsp[0].ends_in_label; ;
break;}
case 321:
-#line 1641 "c-parse.y"
+#line 1638 "c-parse.y"
{ yyval.ends_in_label = 0; ;
break;}
case 322:
-#line 1643 "c-parse.y"
+#line 1640 "c-parse.y"
{ yyval.ends_in_label = 1; ;
break;}
case 323:
-#line 1649 "c-parse.y"
+#line 1646 "c-parse.y"
{ stmt_count++; ;
break;}
case 325:
-#line 1652 "c-parse.y"
+#line 1649 "c-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
@@ -3121,19 +3118,19 @@ case 325:
clear_momentary (); ;
break;}
case 326:
-#line 1669 "c-parse.y"
+#line 1666 "c-parse.y"
{ c_expand_start_else ();
yyvsp[-1].itype = stmt_count;
position_after_white_space (); ;
break;}
case 327:
-#line 1673 "c-parse.y"
+#line 1670 "c-parse.y"
{ c_expand_end_cond ();
if (extra_warnings && stmt_count == yyvsp[-3].itype)
warning ("empty body in an else-statement"); ;
break;}
case 328:
-#line 1677 "c-parse.y"
+#line 1674 "c-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
@@ -3144,11 +3141,11 @@ case 328:
"empty body in an if-statement"); ;
break;}
case 329:
-#line 1689 "c-parse.y"
+#line 1686 "c-parse.y"
{ c_expand_end_cond (); ;
break;}
case 330:
-#line 1691 "c-parse.y"
+#line 1688 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-2].filename, yyvsp[-1].lineno);
/* The emit_nop used to come before emit_line_note,
@@ -3160,7 +3157,7 @@ case 330:
emit_nop (); ;
break;}
case 331:
-#line 1701 "c-parse.y"
+#line 1698 "c-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. */
@@ -3171,11 +3168,11 @@ case 331:
position_after_white_space (); ;
break;}
case 332:
-#line 1710 "c-parse.y"
+#line 1707 "c-parse.y"
{ expand_end_loop (); ;
break;}
case 333:
-#line 1713 "c-parse.y"
+#line 1710 "c-parse.y"
{ emit_line_note (input_filename, lineno);
expand_exit_loop_if_false (NULL_PTR,
truthvalue_conversion (yyvsp[-2].ttype));
@@ -3183,12 +3180,12 @@ case 333:
clear_momentary (); ;
break;}
case 334:
-#line 1720 "c-parse.y"
+#line 1717 "c-parse.y"
{ expand_end_loop ();
clear_momentary (); ;
break;}
case 335:
-#line 1724 "c-parse.y"
+#line 1721 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
/* See comment in `while' alternative, above. */
@@ -3201,12 +3198,12 @@ case 335:
;
break;}
case 336:
-#line 1736 "c-parse.y"
+#line 1733 "c-parse.y"
{ yyvsp[0].lineno = lineno;
yyval.filename = input_filename; ;
break;}
case 337:
-#line 1739 "c-parse.y"
+#line 1736 "c-parse.y"
{
/* Start the loop. Doing this after parsing
all the expressions ensures we will end the loop. */
@@ -3224,7 +3221,7 @@ case 337:
position_after_white_space (); ;
break;}
case 338:
-#line 1755 "c-parse.y"
+#line 1752 "c-parse.y"
{ /* Emit the increment expression, with a line number. */
emit_line_note (yyvsp[-4].filename, yyvsp[-5].lineno);
expand_loop_continue_here ();
@@ -3237,7 +3234,7 @@ case 338:
expand_end_loop (); ;
break;}
case 339:
-#line 1766 "c-parse.y"
+#line 1763 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
c_expand_start_case (yyvsp[-1].ttype);
@@ -3247,7 +3244,7 @@ case 339:
position_after_white_space (); ;
break;}
case 340:
-#line 1774 "c-parse.y"
+#line 1771 "c-parse.y"
{ expand_end_case (yyvsp[-3].ttype);
if (yychar == CONSTANT || yychar == STRING)
pop_momentary_nofree ();
@@ -3255,33 +3252,33 @@ case 340:
pop_momentary (); ;
break;}
case 341:
-#line 1780 "c-parse.y"
+#line 1777 "c-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 342:
-#line 1785 "c-parse.y"
+#line 1782 "c-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 343:
-#line 1790 "c-parse.y"
+#line 1787 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno);
c_expand_return (NULL_TREE); ;
break;}
case 344:
-#line 1794 "c-parse.y"
+#line 1791 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-4].filename, yyvsp[-3].lineno);
c_expand_return (yyvsp[-1].ttype); ;
break;}
case 345:
-#line 1798 "c-parse.y"
+#line 1795 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-7].filename, yyvsp[-6].lineno);
STRIP_NOPS (yyvsp[-2].ttype);
@@ -3293,7 +3290,7 @@ case 345:
error ("argument of `asm' is not a constant string"); ;
break;}
case 346:
-#line 1809 "c-parse.y"
+#line 1806 "c-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,
@@ -3301,7 +3298,7 @@ case 346:
input_filename, lineno); ;
break;}
case 347:
-#line 1816 "c-parse.y"
+#line 1813 "c-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,
@@ -3309,7 +3306,7 @@ case 347:
input_filename, lineno); ;
break;}
case 348:
-#line 1824 "c-parse.y"
+#line 1821 "c-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,
@@ -3317,7 +3314,7 @@ case 348:
input_filename, lineno); ;
break;}
case 349:
-#line 1830 "c-parse.y"
+#line 1827 "c-parse.y"
{ tree decl;
stmt_count++;
emit_line_note (yyvsp[-4].filename, yyvsp[-3].lineno);
@@ -3330,7 +3327,7 @@ case 349:
;
break;}
case 350:
-#line 1841 "c-parse.y"
+#line 1838 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids `goto *expr;'");
stmt_count++;
@@ -3338,7 +3335,7 @@ case 350:
expand_computed_goto (convert (ptr_type_node, yyvsp[-1].ttype)); ;
break;}
case 353:
-#line 1856 "c-parse.y"
+#line 1853 "c-parse.y"
{
/* The value returned by this action is */
/* 1 if everything is OK */
@@ -3361,14 +3358,14 @@ case 353:
;
break;}
case 354:
-#line 1877 "c-parse.y"
+#line 1874 "c-parse.y"
{
if (yyvsp[-1].itype)
iterator_for_loop_end (yyvsp[-3].ttype);
;
break;}
case 355:
-#line 1912 "c-parse.y"
+#line 1909 "c-parse.y"
{ register tree value = check_case_value (yyvsp[-1].ttype);
register tree label
= build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
@@ -3401,7 +3398,7 @@ case 355:
position_after_white_space (); ;
break;}
case 356:
-#line 1943 "c-parse.y"
+#line 1940 "c-parse.y"
{ register tree value1 = check_case_value (yyvsp[-3].ttype);
register tree value2 = check_case_value (yyvsp[-1].ttype);
register tree label
@@ -3434,7 +3431,7 @@ case 356:
position_after_white_space (); ;
break;}
case 357:
-#line 1974 "c-parse.y"
+#line 1971 "c-parse.y"
{
tree duplicate;
register tree label
@@ -3451,7 +3448,7 @@ case 357:
position_after_white_space (); ;
break;}
case 358:
-#line 1989 "c-parse.y"
+#line 1986 "c-parse.y"
{ tree label = define_label (input_filename, lineno, yyvsp[-1].ttype);
stmt_count++;
emit_nop ();
@@ -3460,52 +3457,52 @@ case 358:
position_after_white_space (); ;
break;}
case 359:
-#line 2001 "c-parse.y"
+#line 1998 "c-parse.y"
{ emit_line_note (input_filename, lineno);
yyval.ttype = NULL_TREE; ;
break;}
case 360:
-#line 2004 "c-parse.y"
+#line 2001 "c-parse.y"
{ emit_line_note (input_filename, lineno); ;
break;}
case 361:
-#line 2009 "c-parse.y"
+#line 2006 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 363:
-#line 2016 "c-parse.y"
+#line 2013 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 366:
-#line 2023 "c-parse.y"
+#line 2020 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 367:
-#line 2028 "c-parse.y"
+#line 2025 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 368:
-#line 2033 "c-parse.y"
+#line 2030 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, combine_strings (yyvsp[0].ttype), NULL_TREE); ;
break;}
case 369:
-#line 2035 "c-parse.y"
+#line 2032 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, combine_strings (yyvsp[0].ttype), yyvsp[-2].ttype); ;
break;}
case 370:
-#line 2041 "c-parse.y"
+#line 2038 "c-parse.y"
{ pushlevel (0);
clear_parm_order ();
declare_parm_level (0); ;
break;}
case 371:
-#line 2045 "c-parse.y"
+#line 2042 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
parmlist_tags_warning ();
poplevel (0, 0, 0); ;
break;}
case 373:
-#line 2053 "c-parse.y"
+#line 2050 "c-parse.y"
{ tree parm;
if (pedantic)
pedwarn ("ANSI C forbids forward parameter declarations");
@@ -3515,19 +3512,19 @@ case 373:
clear_parm_order (); ;
break;}
case 374:
-#line 2061 "c-parse.y"
+#line 2058 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 375:
-#line 2063 "c-parse.y"
+#line 2060 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE); ;
break;}
case 376:
-#line 2069 "c-parse.y"
+#line 2066 "c-parse.y"
{ yyval.ttype = get_parm_info (0); ;
break;}
case 377:
-#line 2071 "c-parse.y"
+#line 2068 "c-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.
@@ -3539,23 +3536,23 @@ case 377:
;
break;}
case 378:
-#line 2081 "c-parse.y"
+#line 2078 "c-parse.y"
{ yyval.ttype = get_parm_info (1); ;
break;}
case 379:
-#line 2083 "c-parse.y"
+#line 2080 "c-parse.y"
{ yyval.ttype = get_parm_info (0); ;
break;}
case 380:
-#line 2088 "c-parse.y"
+#line 2085 "c-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
case 381:
-#line 2090 "c-parse.y"
+#line 2087 "c-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
case 382:
-#line 2097 "c-parse.y"
+#line 2094 "c-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -3566,7 +3563,7 @@ case 382:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 383:
-#line 2106 "c-parse.y"
+#line 2103 "c-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -3577,7 +3574,7 @@ case 383:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 384:
-#line 2115 "c-parse.y"
+#line 2112 "c-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -3588,7 +3585,7 @@ case 384:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 385:
-#line 2124 "c-parse.y"
+#line 2121 "c-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -3599,7 +3596,7 @@ case 385:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 386:
-#line 2134 "c-parse.y"
+#line 2131 "c-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -3610,19 +3607,19 @@ case 386:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 387:
-#line 2148 "c-parse.y"
+#line 2145 "c-parse.y"
{ pushlevel (0);
clear_parm_order ();
declare_parm_level (1); ;
break;}
case 388:
-#line 2152 "c-parse.y"
+#line 2149 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
parmlist_tags_warning ();
poplevel (0, 0, 0); ;
break;}
case 390:
-#line 2160 "c-parse.y"
+#line 2157 "c-parse.y"
{ tree t;
for (t = yyvsp[-1].ttype; t; t = TREE_CHAIN (t))
if (TREE_VALUE (t) == NULL_TREE)
@@ -3630,23 +3627,23 @@ case 390:
yyval.ttype = tree_cons (NULL_TREE, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 391:
-#line 2170 "c-parse.y"
+#line 2167 "c-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 392:
-#line 2172 "c-parse.y"
+#line 2169 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 393:
-#line 2178 "c-parse.y"
+#line 2175 "c-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 394:
-#line 2180 "c-parse.y"
+#line 2177 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 395:
-#line 2185 "c-parse.y"
+#line 2182 "c-parse.y"
{ yyval.itype = pedantic;
pedantic = 0; ;
break;}
@@ -3848,5 +3845,5 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 2189 "c-parse.y"
+#line 2186 "c-parse.y"
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index ecbb8cd9f53..6fec8a92b8e 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -59,11 +59,8 @@ end ifc
%{
#include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
#include <setjmp.h>
-
#include "tree.h"
#include "input.h"
#include "c-lex.h"
diff --git a/gcc/c-parse.y b/gcc/c-parse.y
index 151d17d5cb7..a10582b4376 100644
--- a/gcc/c-parse.y
+++ b/gcc/c-parse.y
@@ -55,11 +55,8 @@ State 434 contains 2 shift/reduce conflicts. (Four ways to parse this.) */
%{
#include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
#include <setjmp.h>
-
#include "tree.h"
#include "input.h"
#include "c-lex.h"
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 83b9802075f..ae03b0ec7e0 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -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 "except.h"
#include "function.h"
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index c59eec254dd..ab21f486466 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -29,37 +29,17 @@ Boston, MA 02111-1307, USA. */
like a strange sort of assignment). */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "c-tree.h"
#include "flags.h"
#include "output.h"
#include "intl.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
/* Nonzero if we've already printed a "missing braces around initializer"
message within this initializer. */
static int missing_braces_mentioned;
-#ifdef NEED_DECLARATION_INDEX
-extern char *index ();
-#endif
-
-#ifdef NEED_DECLARATION_RINDEX
-extern char *rindex ();
-#endif
-
static tree qualify_type PROTO((tree, tree));
static int comp_target_types PROTO((tree, tree));
static int function_types_compatible_p PROTO((tree, tree));
@@ -3249,8 +3229,10 @@ lvalue_or_else (ref, msgid)
char *msgid;
{
int win = lvalue_p (ref);
+
if (! win)
error (msgid);
+
return win;
}
@@ -3896,8 +3878,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,
@@ -6753,7 +6734,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 a6d45ac4c11..25774af2b22 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, 1994, 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1989, 92, 94, 95, 97, 1998 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 "insn-config.h"
#include "flags.h"
@@ -144,11 +144,11 @@ init_caller_save ()
if (i == FIRST_PSEUDO_REGISTER)
abort ();
- addr_reg = gen_rtx (REG, Pmode, i);
+ addr_reg = gen_rtx_REG (Pmode, i);
for (offset = 1 << (HOST_BITS_PER_INT / 2); offset; offset >>= 1)
{
- address = gen_rtx (PLUS, Pmode, addr_reg, GEN_INT (offset));
+ address = gen_rtx_PLUS (Pmode, addr_reg, GEN_INT (offset));
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (regno_save_mode[i][1] != VOIDmode
@@ -172,10 +172,10 @@ init_caller_save ()
for (j = 1; j <= MOVE_MAX / UNITS_PER_WORD; j++)
if (regno_save_mode[i][j] != VOIDmode)
{
- rtx mem = gen_rtx (MEM, regno_save_mode[i][j], address);
- rtx reg = gen_rtx (REG, regno_save_mode[i][j], i);
- rtx savepat = gen_rtx (SET, VOIDmode, mem, reg);
- rtx restpat = gen_rtx (SET, VOIDmode, reg, mem);
+ rtx mem = gen_rtx_MEM (regno_save_mode[i][j], address);
+ rtx reg = gen_rtx_REG (regno_save_mode[i][j], i);
+ rtx savepat = gen_rtx_SET (VOIDmode, mem, reg);
+ rtx restpat = gen_rtx_SET (VOIDmode, reg, mem);
rtx saveinsn = emit_insn (savepat);
rtx restinsn = emit_insn (restpat);
int ok;
@@ -322,8 +322,8 @@ setup_save_areas (pchanged)
{
/* This should not depend on WORDS_BIG_ENDIAN.
The order of words in regs is the same as in memory. */
- rtx temp = gen_rtx (MEM, regno_save_mode[i+k][1],
- XEXP (regno_save_mem[i][j], 0));
+ rtx temp = gen_rtx_MEM (regno_save_mode[i+k][1],
+ XEXP (regno_save_mem[i][j], 0));
regno_save_mem[i+k][1]
= adj_offsettable_operand (temp, k * UNITS_PER_WORD);
@@ -692,8 +692,9 @@ insert_save_restore (insn, save_p, regno, insn_mode, maxrestore)
if (! ok)
continue;
- pat = gen_rtx (SET, VOIDmode, regno_save_mem[regno][i],
- gen_rtx (REG, GET_MODE (regno_save_mem[regno][i]), regno));
+ pat = gen_rtx_SET (VOIDmode, regno_save_mem[regno][i],
+ gen_rtx_REG (GET_MODE (regno_save_mem[regno][i]),
+ regno));
code = reg_save_code[regno][i];
/* Set hard_regs_saved for all the registers we saved. */
@@ -731,10 +732,10 @@ insert_save_restore (insn, save_p, regno, insn_mode, maxrestore)
if (! ok)
continue;
- pat = gen_rtx (SET, VOIDmode,
- gen_rtx (REG, GET_MODE (regno_save_mem[regno][i]),
- regno),
- regno_save_mem[regno][i]);
+ pat = gen_rtx_SET (VOIDmode,
+ gen_rtx_REG (GET_MODE (regno_save_mem[regno][i]),
+ regno),
+ regno_save_mem[regno][i]);
code = reg_restore_code[regno][i];
diff --git a/gcc/calls.c b/gcc/calls.c
index c3bfb4d7b5b..7f247c6779f 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -19,17 +19,12 @@ 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 "flags.h"
#include "expr.h"
#include "regs.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "insn-flags.h"
/* Decide whether a function's arguments should be processed
@@ -381,10 +376,10 @@ emit_call_1 (funexp, fndecl, funtype, stack_size, struct_value_size,
if (valreg)
pat = gen_call_value_pop (valreg,
- gen_rtx (MEM, FUNCTION_MODE, funexp),
+ gen_rtx_MEM (FUNCTION_MODE, funexp),
stack_size_rtx, next_arg_reg, n_pop);
else
- pat = gen_call_pop (gen_rtx (MEM, FUNCTION_MODE, funexp),
+ pat = gen_call_pop (gen_rtx_MEM (FUNCTION_MODE, funexp),
stack_size_rtx, next_arg_reg, n_pop);
emit_call_insn (pat);
@@ -399,11 +394,11 @@ emit_call_1 (funexp, fndecl, funtype, stack_size, struct_value_size,
{
if (valreg)
emit_call_insn (gen_call_value (valreg,
- gen_rtx (MEM, FUNCTION_MODE, funexp),
+ gen_rtx_MEM (FUNCTION_MODE, funexp),
stack_size_rtx, next_arg_reg,
NULL_RTX));
else
- emit_call_insn (gen_call (gen_rtx (MEM, FUNCTION_MODE, funexp),
+ emit_call_insn (gen_call (gen_rtx_MEM (FUNCTION_MODE, funexp),
stack_size_rtx, next_arg_reg,
struct_value_size_rtx));
}
@@ -455,8 +450,8 @@ emit_call_1 (funexp, fndecl, funtype, stack_size, struct_value_size,
{
if (!already_popped)
CALL_INSN_FUNCTION_USAGE (call_insn)
- = gen_rtx (EXPR_LIST, VOIDmode,
- gen_rtx (CLOBBER, VOIDmode, stack_pointer_rtx),
+ = gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_CLOBBER (VOIDmode, stack_pointer_rtx),
CALL_INSN_FUNCTION_USAGE (call_insn));
stack_size -= RETURN_POPS_ARGS (fndecl, funtype, stack_size);
stack_size_rtx = GEN_INT (stack_size);
@@ -596,7 +591,7 @@ expand_call (exp, target, ignore)
if -fcheck-memory-usage, code which invokes functions (and thus
damages some hard registers) can be inserted before using the value.
So, target is always a pseudo-register in that case. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
target = 0;
/* See if we can find a DECL-node for the actual function.
@@ -1085,14 +1080,15 @@ expand_call (exp, target, ignore)
pending_stack_adjust = 0;
}
- copy = gen_rtx (MEM, BLKmode,
- allocate_dynamic_stack_space (size_rtx,
- NULL_RTX,
- TYPE_ALIGN (type)));
+ copy = gen_rtx_MEM
+ (BLKmode,
+ allocate_dynamic_stack_space (size_rtx, NULL_RTX,
+ TYPE_ALIGN (type)));
}
else
{
int size = int_size_in_bytes (type);
+
copy = assign_stack_temp (TYPE_MODE (type), size, 0);
}
@@ -1554,20 +1550,20 @@ expand_call (exp, target, ignore)
if (GET_CODE (offset) == CONST_INT)
addr = plus_constant (arg_reg, INTVAL (offset));
else
- addr = gen_rtx (PLUS, Pmode, arg_reg, offset);
+ addr = gen_rtx_PLUS (Pmode, arg_reg, offset);
addr = plus_constant (addr, arg_offset);
- args[i].stack = gen_rtx (MEM, args[i].mode, addr);
+ args[i].stack = gen_rtx_MEM (args[i].mode, addr);
MEM_IN_STRUCT_P (args[i].stack)
= AGGREGATE_TYPE_P (TREE_TYPE (args[i].tree_value));
if (GET_CODE (slot_offset) == CONST_INT)
addr = plus_constant (arg_reg, INTVAL (slot_offset));
else
- addr = gen_rtx (PLUS, Pmode, arg_reg, slot_offset);
+ addr = gen_rtx_PLUS (Pmode, arg_reg, slot_offset);
addr = plus_constant (addr, arg_offset);
- args[i].stack_slot = gen_rtx (MEM, args[i].mode, addr);
+ args[i].stack_slot = gen_rtx_MEM (args[i].mode, addr);
}
}
@@ -1608,7 +1604,7 @@ expand_call (exp, target, ignore)
pop_temp_slots (); /* FUNEXP can't be BLKmode */
/* Check the function is executable. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_check_exec_libfunc, 1,
VOIDmode, 1,
funexp, ptr_mode);
@@ -1711,17 +1707,17 @@ expand_call (exp, target, ignore)
BIGGEST_ALIGNMENT / UNITS_PER_WORD) - 1)))
save_mode = BLKmode;
- stack_area = gen_rtx (MEM, save_mode,
- memory_address (save_mode,
+ stack_area = gen_rtx_MEM (save_mode,
+ memory_address (save_mode,
#ifdef ARGS_GROW_DOWNWARD
- plus_constant (argblock,
- - high_to_save)
+ plus_constant (argblock,
+ - high_to_save)
#else
- plus_constant (argblock,
- low_to_save)
+ plus_constant (argblock,
+ low_to_save)
#endif
- ));
+ ));
if (save_mode == BLKmode)
{
save_area = assign_stack_temp (BLKmode, num_to_save, 0);
@@ -1758,7 +1754,7 @@ expand_call (exp, target, ignore)
if (STRICT_ALIGNMENT)
for (i = 0; i < num_actuals; i++)
if (args[i].reg != 0 && ! args[i].pass_on_stack
- && args[i].mode == BLKmode
+ && args[i].mode == BLKmode
&& (TYPE_ALIGN (TREE_TYPE (args[i].tree_value))
< MIN (BIGGEST_ALIGNMENT, BITS_PER_WORD)))
{
@@ -1853,7 +1849,7 @@ expand_call (exp, target, ignore)
NULL_RTX)));
/* Mark the memory for the aggregate as write-only. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1,
VOIDmode, 3,
structure_value_addr, ptr_mode,
@@ -1910,7 +1906,7 @@ expand_call (exp, target, ignore)
else if (args[i].n_aligned_regs != 0)
for (j = 0; j < args[i].n_aligned_regs; j++)
- emit_move_insn (gen_rtx (REG, word_mode, REGNO (reg) + j),
+ emit_move_insn (gen_rtx_REG (word_mode, REGNO (reg) + j),
args[i].aligned_regs[j]);
else if (partial == 0 || args[i].pass_on_stack)
@@ -1953,12 +1949,12 @@ expand_call (exp, target, ignore)
arguments in order as well as the function name. */
#ifdef PUSH_ARGS_REVERSED
for (i = 0; i < num_actuals; i++)
- note = gen_rtx (EXPR_LIST, VOIDmode, args[i].initial_value, note);
+ note = gen_rtx_EXPR_LIST (VOIDmode, args[i].initial_value, note);
#else
for (i = num_actuals - 1; i >= 0; i--)
- note = gen_rtx (EXPR_LIST, VOIDmode, args[i].initial_value, note);
+ note = gen_rtx_EXPR_LIST (VOIDmode, args[i].initial_value, note);
#endif
- note = gen_rtx (EXPR_LIST, VOIDmode, funexp, note);
+ note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
insns = get_insns ();
end_sequence ();
@@ -2014,9 +2010,9 @@ expand_call (exp, target, ignore)
{
if (target == 0 || GET_CODE (target) != MEM)
{
- target = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
- memory_address (TYPE_MODE (TREE_TYPE (exp)),
- structure_value_addr));
+ target = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (exp)),
+ memory_address (TYPE_MODE (TREE_TYPE (exp)),
+ structure_value_addr));
MEM_IN_STRUCT_P (target) = AGGREGATE_TYPE_P (TREE_TYPE (exp));
}
}
@@ -2046,10 +2042,10 @@ expand_call (exp, target, ignore)
}
if (TYPE_MODE (TREE_TYPE (exp)) != BLKmode)
- emit_move_insn (target, gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
- copy_to_reg (valreg)));
+ emit_move_insn (target, gen_rtx_MEM (TYPE_MODE (TREE_TYPE (exp)),
+ copy_to_reg (valreg)));
else
- emit_block_move (target, gen_rtx (MEM, BLKmode, copy_to_reg (valreg)),
+ emit_block_move (target, gen_rtx_MEM (BLKmode, copy_to_reg (valreg)),
expr_size (exp),
TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT);
}
@@ -2065,7 +2061,8 @@ expand_call (exp, target, ignore)
preserve_temp_slots (target);
}
- emit_group_store (target, valreg);
+ if (! rtx_equal_p (target, valreg))
+ emit_group_store (target, valreg);
}
else if (target && GET_MODE (target) == TYPE_MODE (TREE_TYPE (exp))
&& GET_MODE (target) == GET_MODE (valreg))
@@ -2167,7 +2164,7 @@ expand_call (exp, target, ignore)
!= promote_mode (type, TYPE_MODE (type), &unsignedp, 1))
abort ();
- target = gen_rtx (SUBREG, TYPE_MODE (type), target, 0);
+ target = gen_rtx_SUBREG (TYPE_MODE (type), target, 0);
SUBREG_PROMOTED_VAR_P (target) = 1;
SUBREG_PROMOTED_UNSIGNED_P (target) = unsignedp;
}
@@ -2194,14 +2191,16 @@ expand_call (exp, target, ignore)
{
enum machine_mode save_mode = GET_MODE (save_area);
rtx stack_area
- = gen_rtx (MEM, save_mode,
- memory_address (save_mode,
+ = gen_rtx_MEM (save_mode,
+ memory_address (save_mode,
#ifdef ARGS_GROW_DOWNWARD
- plus_constant (argblock, - high_to_save)
+ plus_constant (argblock,
+ - high_to_save)
#else
- plus_constant (argblock, low_to_save)
+ plus_constant (argblock,
+ low_to_save)
#endif
- ));
+ ));
if (save_mode != BLKmode)
emit_move_insn (stack_area, save_area);
@@ -2218,9 +2217,9 @@ expand_call (exp, target, ignore)
{
enum machine_mode save_mode = GET_MODE (args[i].save_area);
rtx stack_area
- = gen_rtx (MEM, save_mode,
- memory_address (save_mode,
- XEXP (args[i].stack_slot, 0)));
+ = gen_rtx_MEM (save_mode,
+ memory_address (save_mode,
+ XEXP (args[i].stack_slot, 0)));
if (save_mode != BLKmode)
emit_move_insn (stack_area, args[i].save_area);
@@ -2271,7 +2270,7 @@ void
emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
int nargs, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
rtx orgfun;
int no_queue;
enum machine_mode outmode;
@@ -2318,7 +2317,7 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
VA_START (p, nargs);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
orgfun = va_arg (p, rtx);
no_queue = va_arg (p, int);
outmode = va_arg (p, enum machine_mode);
@@ -2545,17 +2544,17 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
BIGGEST_ALIGNMENT / UNITS_PER_WORD) - 1)))
save_mode = BLKmode;
- stack_area = gen_rtx (MEM, save_mode,
- memory_address (save_mode,
+ stack_area = gen_rtx_MEM (save_mode,
+ memory_address (save_mode,
#ifdef ARGS_GROW_DOWNWARD
- plus_constant (argblock,
- - high_to_save)
+ plus_constant (argblock,
+ - high_to_save)
#else
- plus_constant (argblock,
- low_to_save)
+ plus_constant (argblock,
+ low_to_save)
#endif
- ));
+ ));
if (save_mode == BLKmode)
{
save_area = assign_stack_temp (BLKmode, num_to_save, 0);
@@ -2614,9 +2613,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);
}
@@ -2710,14 +2713,14 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
{
enum machine_mode save_mode = GET_MODE (save_area);
rtx stack_area
- = gen_rtx (MEM, save_mode,
- memory_address (save_mode,
+ = gen_rtx_MEM (save_mode,
+ memory_address (save_mode,
#ifdef ARGS_GROW_DOWNWARD
- plus_constant (argblock, - high_to_save)
+ plus_constant (argblock, - high_to_save)
#else
- plus_constant (argblock, low_to_save)
+ plus_constant (argblock, low_to_save)
#endif
- ));
+ ));
if (save_mode != BLKmode)
emit_move_insn (stack_area, save_area);
@@ -2734,9 +2737,11 @@ 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)));
+ = gen_rtx_MEM (save_mode,
+ memory_address
+ (save_mode,
+ plus_constant (argblock,
+ argvec[count].offset.constant)));
emit_move_insn (stack_area, argvec[count].save_area);
}
@@ -2758,7 +2763,7 @@ rtx
emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
enum machine_mode outmode, int nargs, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
rtx orgfun;
rtx value;
int no_queue;
@@ -2811,7 +2816,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
VA_START (p, nargs);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
orgfun = va_arg (p, rtx);
value = va_arg (p, rtx);
no_queue = va_arg (p, int);
@@ -2830,7 +2835,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
rtx pointer_reg
= hard_function_value (build_pointer_type (type_for_mode (outmode, 0)),
0);
- mem_value = gen_rtx (MEM, outmode, pointer_reg);
+ mem_value = gen_rtx_MEM (outmode, pointer_reg);
pcc_struct_value = 1;
if (value == 0)
value = gen_reg_rtx (outmode);
@@ -3103,17 +3108,17 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
BIGGEST_ALIGNMENT / UNITS_PER_WORD) - 1)))
save_mode = BLKmode;
- stack_area = gen_rtx (MEM, save_mode,
- memory_address (save_mode,
-
+ stack_area = gen_rtx_MEM (save_mode,
+ memory_address (save_mode,
#ifdef ARGS_GROW_DOWNWARD
- plus_constant (argblock,
- - high_to_save)
+ plus_constant (argblock,
+ - high_to_save)
#else
plus_constant (argblock,
low_to_save)
#endif
));
+
if (save_mode == BLKmode)
{
save_area = assign_stack_temp (BLKmode, num_to_save, 0);
@@ -3172,10 +3177,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
@@ -3293,14 +3302,14 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
{
enum machine_mode save_mode = GET_MODE (save_area);
rtx stack_area
- = gen_rtx (MEM, save_mode,
- memory_address (save_mode,
+ = gen_rtx_MEM (save_mode,
+ memory_address (save_mode,
#ifdef ARGS_GROW_DOWNWARD
- plus_constant (argblock, - high_to_save)
+ plus_constant (argblock, - high_to_save)
#else
- plus_constant (argblock, low_to_save)
+ plus_constant (argblock, low_to_save)
#endif
- ));
+ ));
if (save_mode != BLKmode)
emit_move_insn (stack_area, save_area);
@@ -3317,9 +3326,11 @@ 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)));
+ = gen_rtx_MEM (save_mode,
+ memory_address
+ (save_mode,
+ plus_constant (argblock,
+ argvec[count].offset.constant)));
emit_move_insn (stack_area, argvec[count].save_area);
}
@@ -3361,11 +3372,11 @@ target_for_arg (type, size, args_addr, offset)
{
/* I have no idea how to guarantee that this
will work in the presence of register parameters. */
- target = gen_rtx (PLUS, Pmode, args_addr, offset_rtx);
+ target = gen_rtx_PLUS (Pmode, args_addr, offset_rtx);
target = memory_address (QImode, target);
}
- return gen_rtx (MEM, BLKmode, target);
+ return gen_rtx_MEM (BLKmode, target);
}
#endif
@@ -3444,8 +3455,9 @@ store_one_arg (arg, argblock, may_be_alloca, variable_size, fndecl,
enum machine_mode save_mode
= mode_for_size (arg->size.constant * BITS_PER_UNIT, MODE_INT, 1);
rtx stack_area
- = gen_rtx (MEM, save_mode,
- memory_address (save_mode, XEXP (arg->stack_slot, 0)));
+ = gen_rtx_MEM (save_mode,
+ memory_address (save_mode,
+ XEXP (arg->stack_slot, 0)));
if (save_mode == BLKmode)
{
@@ -3535,14 +3547,11 @@ store_one_arg (arg, argblock, may_be_alloca, variable_size, fndecl,
if (arg->value == arg->stack)
{
/* If the value is already in the stack slot, we are done. */
- if (flag_check_memory_usage && GET_CODE (arg->stack) == MEM)
+ if (current_function_check_memory_usage && GET_CODE (arg->stack) == MEM)
{
- if (arg->mode == BLKmode)
- abort ();
-
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
XEXP (arg->stack, 0), ptr_mode,
- GEN_INT (GET_MODE_SIZE (arg->mode)),
+ ARGS_SIZE_RTX (arg->size),
TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_RW),
TYPE_MODE (integer_type_node));
diff --git a/gcc/cccp.c b/gcc/cccp.c
index dcfd511fc2a..ae33aa4a1c6 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -19,71 +19,24 @@ Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <stdio.h>
+#include "system.h"
+#include "gansidecl.h"
#include <signal.h>
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-#endif
-#endif
-
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#include <errno.h>
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#endif
-
+#ifdef MULTIBYTE_CHARS
+#include "mbchar.h"
+#include <locale.h>
+#endif /* MULTIBYTE_CHARS */
+
typedef unsigned char U_CHAR;
-#include "gansidecl.h"
#include "pcp.h"
#include "intl.h"
-#ifdef NEED_DECLARATION_INDEX
-extern char *index ();
-#endif
-
-#ifdef NEED_DECLARATION_RINDEX
-extern char *rindex ();
-#endif
-
-#ifdef NEED_DECLARATION_GETENV
-extern char *getenv ();
-#endif
-
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __attribute__(x)
#endif
@@ -104,13 +57,11 @@ extern char *getenv ();
# define OBJECT_SUFFIX ".o"
#endif
-#if defined (__STDC__) && defined (HAVE_VPRINTF)
-# include <stdarg.h>
+#if defined (ANSI_PROTOTYPES) && defined (HAVE_VPRINTF)
# define PRINTF_ALIST(msg) char *msg, ...
# define PRINTF_DCL(msg)
# define PRINTF_PROTO(ARGS, m, n) PROTO (ARGS) __attribute__ ((format (__printf__, m, n)))
#else
-# include <varargs.h>
# define PRINTF_ALIST(msg) msg, va_alist
# define PRINTF_DCL(msg) char *msg; va_dcl
# define PRINTF_PROTO(ARGS, m, n) () __attribute__ ((format (__printf__, m, n)))
@@ -136,10 +87,12 @@ extern char *getenv ();
#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 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
@@ -209,8 +162,10 @@ extern char *update_path PROTO((char *, char *));
extern int sys_nerr;
extern char *sys_errlist[];
#else /* HAVE_STRERROR */
+#ifdef NEED_DECLARATION_STRERROR
char *strerror ();
#endif
+#endif
#else /* VMS */
char *strerror (int,...);
#endif
@@ -358,6 +313,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;
@@ -894,7 +853,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. */
@@ -913,7 +871,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
@@ -981,7 +939,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((char *, size_t));
int main PROTO((int, char **));
@@ -990,6 +947,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 *));
@@ -1069,7 +1027,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 *));
char *my_strerror PROTO((int));
static void notice PRINTF_PROTO_1((char *, ...));
@@ -1117,7 +1075,7 @@ static void append_include_chain PROTO((struct file_name_list *, struct file_nam
static int quote_string_for_make PROTO((char *, char *));
static void deps_output PROTO((char *, int));
-static void fatal PRINTF_PROTO_1((char *, ...)) __attribute__ ((noreturn));
+void fatal PRINTF_PROTO_1((char *, ...)) __attribute__ ((noreturn));
void fancy_abort PROTO((void)) __attribute__ ((noreturn));
static void perror_with_name PROTO((char *));
static void pfatal_with_name PROTO((char *)) __attribute__ ((noreturn));
@@ -1198,34 +1156,6 @@ safe_write (desc, ptr, len)
len -= written;
}
}
-
-/* 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)
- 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);
-}
-
int
main (argc, argv)
@@ -1336,6 +1266,12 @@ main (argc, argv)
bzero ((char *) pend_assertions, argc * sizeof (char *));
bzero ((char *) pend_includes, argc * sizeof (char *));
+#ifdef MULTIBYTE_CHARS
+ /* Change to the native locale for multibyte conversions. */
+ setlocale (LC_CTYPE, "");
+ literal_codeset = getenv ("LANG");
+#endif
+
/* Process switches and find input file name. */
for (i = 1; i < argc; i++) {
@@ -1353,14 +1289,18 @@ main (argc, argv)
if (!strcmp (argv[i], "-include")) {
if (i + 1 == argc)
fatal ("Filename missing after `-include' option");
- else
- simplify_filename (pend_includes[i] = argv[++i]);
+ else {
+ simplify_filename (pend_includes[i] = argv[i]);
+ i++;
+ }
}
if (!strcmp (argv[i], "-imacros")) {
if (i + 1 == argc)
fatal ("Filename missing after `-imacros' option");
- else
- simplify_filename (pend_files[i] = argv[++i]);
+ else {
+ simplify_filename (pend_files[i] = argv[i]);
+ i++;
+ }
}
if (!strcmp (argv[i], "-iprefix")) {
if (i + 1 == argc)
@@ -1526,6 +1466,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"))
@@ -1542,6 +1486,7 @@ main (argc, argv)
{
warn_trigraphs = 1;
warn_comments = 1;
+ warn_white_space = 1;
}
break;
@@ -1693,15 +1638,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);
}
}
@@ -2028,17 +1973,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;
}
@@ -2099,8 +2041,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.
@@ -2188,6 +2131,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, ""))
@@ -2398,13 +2344,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)
@@ -2413,21 +2389,22 @@ 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;
-
- /* What follows the backslash-newlines is not embarrassing. */
+ } while (*p == '\\');
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) {
@@ -2446,20 +2423,22 @@ 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;
-
- /* What follows the backslash-newlines is not embarrassing. */
+ } while (*p == '\\');
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) {
@@ -2537,7 +2516,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.
@@ -2731,9 +2710,27 @@ do { ip = &instack[indepth]; \
bp += 2;
else if (*bp == '/' && bp[1] == '*') {
bp += 2;
- while (!(*bp == '*' && bp[1] == '/'))
- bp++;
- bp += 2;
+ while (1)
+ {
+ if (*bp == '*')
+ {
+ if (bp[1] == '/')
+ {
+ bp += 2;
+ break;
+ }
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, limit - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
+ bp++;
+ }
}
/* There is no point in trying to deal with C++ // comments here,
because if there is one, then this # must be part of the
@@ -2843,6 +2840,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.
@@ -2870,9 +2869,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;
@@ -2881,8 +2881,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++;
@@ -2894,6 +2896,24 @@ do { ip = &instack[indepth]; \
if (ibp[-1] == c)
goto while2end;
break;
+#ifdef MULTIBYTE_CHARS
+ default:
+ {
+ int length;
+ --ibp;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 0)
+ {
+ --obp;
+ bcopy (ibp, obp, length);
+ obp += length;
+ ibp += length;
+ }
+ else
+ ++ibp;
+ }
+ break;
+#endif
}
}
while2end:
@@ -2902,7 +2922,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 == '/'))
@@ -2940,6 +2960,15 @@ do { ip = &instack[indepth]; \
*obp++ = '\n';
++op->lineno;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ ibp += (length - 1);
+#endif
+ }
}
break;
}
@@ -3005,7 +3034,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;
@@ -3028,6 +3057,16 @@ do { ip = &instack[indepth]; \
goto limit_reached;
}
break;
+#ifdef MULTIBYTE_CHARS
+ default:
+ {
+ int length;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ ibp += (length - 1);
+ }
+ break;
+#endif
}
}
comment_end:
@@ -3366,7 +3405,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) {
@@ -3379,7 +3418,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;
@@ -3390,11 +3429,27 @@ randomchar:
break;
}
}
- if (*ibp == '\n') {
+ else if (*ibp == '\n') {
/* Newline in a file. Count it. */
++ip->lineno;
++op->lineno;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ {
+ if (put_out_comments)
+ {
+ bcopy (ibp, obp, length - 1);
+ obp += length - 1;
+ }
+ ibp += (length - 1);
+ }
+#endif
+ }
if (put_out_comments)
*obp++ = *ibp;
}
@@ -3405,9 +3460,32 @@ randomchar:
} else if (! traditional) {
*obp++ = ' ';
}
- for (ibp += 2; *ibp != '\n' || ibp[-1] == '\\'; ibp++)
- if (put_out_comments)
- *obp++ = *ibp;
+ for (ibp += 2; ; ibp++)
+ {
+ if (*ibp == '\n')
+ {
+ if (ibp[-1] != '\\')
+ break;
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ {
+ if (put_out_comments)
+ {
+ bcopy (ibp, obp, length - 1);
+ obp += length - 1;
+ }
+ ibp += (length - 1);
+ }
+#endif
+ }
+ if (put_out_comments)
+ *obp++ = *ibp;
+ }
} else
break;
}
@@ -3590,9 +3668,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;
}
@@ -3638,7 +3713,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;
@@ -3659,7 +3734,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++;
@@ -3749,14 +3824,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 '"':
@@ -3808,7 +3881,7 @@ handle_directive (ip, op)
break;
case '/':
- if (*bp == '\\' && bp[1] == '\n')
+ if (*bp == '\\')
newline_fix (bp);
if (*bp == '*'
|| (cplusplus_comments && *bp == '/')) {
@@ -3891,12 +3964,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++;
@@ -3943,8 +4017,16 @@ handle_directive (ip, op)
register U_CHAR *bp1
= skip_quoted_string (xp - 1, bp, ip->lineno,
NULL_PTR, NULL_PTR, NULL_PTR);
- while (xp != bp1)
- *cp++ = *xp++;
+ while (xp != bp1) {
+ if ((*cp++ = *xp++) == '\n') {
+ if (xp[-2] == '\\')
+ cp -= 2;
+ else {
+ cp[-1] = '\\';
+ *cp++ = 'n';
+ }
+ }
+ }
}
break;
@@ -3981,7 +4063,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;
@@ -4010,7 +4093,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
@@ -4032,12 +4115,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",
@@ -5163,6 +5253,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);
@@ -5376,7 +5469,7 @@ pcfinclude (buf, limit, 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;
@@ -5400,6 +5493,7 @@ pcfinclude (buf, limit, 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);
@@ -5411,20 +5505,19 @@ pcfinclude (buf, limit, 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;
@@ -5985,7 +6078,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++;
@@ -6100,6 +6193,25 @@ collect_expansion (buf, end, nargs, arglist)
}
}
+#ifdef MULTIBYTE_CHARS
+ /* Handle multibyte characters inside string and character literals. */
+ if (expected_delimiter != '\0')
+ {
+ int length;
+ --p;
+ length = local_mblen (p, limit - p);
+ if (length > 1)
+ {
+ --exp_p;
+ bcopy (p, exp_p, length);
+ p += length;
+ exp_p += length;
+ continue;
+ }
+ ++p;
+ }
+#endif
+
/* Handle the start of a symbol. */
if (is_idchar[c] && nargs > 0) {
U_CHAR *id_beg = p - 1;
@@ -6634,6 +6746,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)) {
@@ -6676,10 +6789,6 @@ do_line (buf, limit, op, keyword)
p = bp;
for (;;)
switch ((*p++ = *bp++)) {
- case '\0':
- error ("invalid format `#line' directive");
- return 0;
-
case '\\':
{
char *bpc = (char *) bp;
@@ -6804,8 +6913,7 @@ do_undef (buf, limit, op, keyword)
}
/* 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)
@@ -6818,32 +6926,22 @@ do_error (buf, limit, op, keyword)
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;
- 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);
+ 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;
}
@@ -6915,14 +7013,15 @@ do_pragma (buf, limit, op, keyword)
been included yet. */
int h;
- U_CHAR *p = buf + 14, *fname;
+ U_CHAR *p = buf + 14, *f, *fname;
SKIP_WHITE_SPACE (p);
if (*p != '\"')
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;
@@ -7027,7 +7126,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");
}
@@ -7067,7 +7167,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);
@@ -7246,7 +7346,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 == '/')) {
@@ -7326,9 +7426,27 @@ skip_if_group (ip, any, op)
bp += 2;
else if (*bp == '/' && bp[1] == '*') {
bp += 2;
- while (!(*bp == '*' && bp[1] == '/'))
- bp++;
- bp += 2;
+ while (1)
+ {
+ if (*bp == '*')
+ {
+ if (bp[1] == '/')
+ {
+ bp += 2;
+ break;
+ }
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, endb - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
+ bp++;
+ }
}
/* There is no point in trying to deal with C++ // comments here,
because if there is one, then this # must be part of the
@@ -7358,7 +7476,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++) {
@@ -7367,11 +7485,20 @@ 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;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, endb - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
}
bp += 2;
} else if (bp[1] == '/' && cplusplus_comments) {
@@ -7383,6 +7510,15 @@ skip_if_group (ip, any, op)
warning ("multiline `//' comment");
ip->lineno++;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, endb - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
}
} else
break;
@@ -7400,7 +7536,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++;
@@ -7569,7 +7705,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");
}
@@ -7678,6 +7815,15 @@ validate_else (p, limit)
break;
}
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (p, limit - p);
+ if (length > 1)
+ p += (length - 1);
+#endif
+ }
}
}
else if (cplusplus_comments && p[1] == '/')
@@ -7731,6 +7877,22 @@ skip_to_end_of_comment (ip, line_counter, nowarn)
if (op)
++op->lineno;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, limit - bp);
+ if (length > 1)
+ {
+ if (op)
+ {
+ bcopy (bp, op->bufp, length - 1);
+ op->bufp += (length - 1);
+ }
+ bp += (length - 1);
+ }
+#endif
+ }
if (op)
*op->bufp++ = *bp;
}
@@ -7759,7 +7921,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)
@@ -7768,6 +7930,23 @@ skip_to_end_of_comment (ip, line_counter, nowarn)
return bp;
}
break;
+#ifdef MULTIBYTE_CHARS
+ default:
+ {
+ int length;
+ bp--;
+ length = local_mblen (bp, limit - bp);
+ if (length <= 0)
+ length = 1;
+ if (op)
+ {
+ op->bufp--;
+ bcopy (bp, op->bufp, length);
+ op->bufp += length;
+ }
+ bp += length;
+ }
+#endif
}
}
@@ -7785,7 +7964,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.
@@ -7841,15 +8021,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),
@@ -7858,6 +8041,16 @@ skip_quoted_string (bp, limit, start_line, count_newlines, backslash_newlines_p,
}
} else if (c == match)
break;
+#ifdef MULTIBYTE_CHARS
+ {
+ int length;
+ --bp;
+ length = local_mblen (bp, limit - bp);
+ if (length <= 0)
+ length = 1;
+ bp += length;
+ }
+#endif
}
return bp;
}
@@ -8029,9 +8222,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.
@@ -8040,8 +8233,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;
@@ -8092,8 +8285,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;
}
@@ -8187,7 +8380,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. */
@@ -8202,13 +8395,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++;
@@ -8265,27 +8465,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 = ' ';
}
@@ -8296,15 +8497,36 @@ macroexpand (hp, op)
else {
if (c == '\\')
escaped = 1;
- if (in_string) {
+ else if (in_string) {
if (c == in_string)
in_string = 0;
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (arg->raw + i, arglen - i);
+ if (length > 1)
+ {
+ bcopy (arg->raw + i, xbuf + totlen, length);
+ i += length - 1;
+ totlen += length;
+ continue;
+ }
+#endif
+ }
} else if (c == '\"' || c == '\'')
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.
@@ -8380,8 +8602,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);
}
}
@@ -8458,23 +8679,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 {
@@ -8483,13 +8704,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) {
@@ -8500,18 +8720,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,
@@ -8523,13 +8742,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 ();
@@ -8563,10 +8782,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;
}
@@ -8615,7 +8834,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;
@@ -8625,13 +8844,22 @@ 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++;
break;
}
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, limit - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
}
} else if (bp[1] == '/' && cplusplus_comments) {
*comments = 1;
@@ -8643,6 +8871,15 @@ macarg1 (start, limit, macro, depthptr, newlines, comments, rest_args)
if (warn_comments)
warning ("multiline `//' comment");
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, limit - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
}
}
break;
@@ -8650,22 +8887,31 @@ 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;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, limit - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
}
}
break;
@@ -8736,15 +8982,30 @@ 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] == '/') {
/* Comments are equivalent to spaces. */
obp[-1] = ' ';
ibp++;
- while (ibp < limit && (*ibp != '\n' || ibp[-1] == '\\'))
- ibp++;
+ while (ibp < limit)
+ {
+ if (*ibp == '\n')
+ {
+ if (ibp[-1] != '\\')
+ break;
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ ibp += (length - 1);
+#endif
+ }
+ ibp++;
+ }
break;
}
if (ibp[0] != '*' || ibp + 1 >= limit)
@@ -8757,13 +9018,21 @@ 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;
break;
}
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ ibp += (length - 1);
+#endif
+ }
}
break;
@@ -8778,9 +9047,12 @@ discard_comments (start, length, newlines)
*obp++ = c = *ibp++;
if (c == quotec)
break;
- if (c == '\n' && quotec == '\'')
- break;
- if (c == '\\') {
+ if (c == '\n')
+ {
+ if (quotec == '\'')
+ break;
+ }
+ else if (c == '\\') {
if (ibp < limit && *ibp == '\n') {
ibp++;
obp--;
@@ -8791,6 +9063,23 @@ discard_comments (start, length, newlines)
*obp++ = *ibp++;
}
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ ibp--;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ {
+ obp--;
+ bcopy (ibp, obp, length);
+ ibp += length;
+ obp += length;
+ }
+ else
+ ibp++;
+#endif
+ }
}
}
break;
@@ -8800,27 +9089,26 @@ 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;
- register int c;
ibp = start;
limit = start + length;
obp = start;
while (ibp < limit) {
- *obp++ = c = *ibp++;
- switch (c) {
+ switch ((*obp++ = *ibp++)) {
case '\n':
/* If this is a NEWLINE NEWLINE, then this is a real newline in the
string. Skip past the newline and its duplicate.
@@ -8835,22 +9123,67 @@ change_newlines (start, length)
case '\'':
case '\"':
- /* Notice and skip strings, so that we don't delete newlines in them. */
+ /* Notice and skip strings, to handle their newlines properly. */
{
- int quotec = c;
- while (ibp < limit) {
- *obp++ = c = *ibp++;
- if (c == quotec && ibp[-2] != '\\')
+ U_CHAR *ibp1 = skip_quoted_string (ibp - 1, limit, 0,
+ NULL_PTR, NULL_PTR, NULL_PTR);
+ while (ibp != ibp1) {
+ switch ((*obp++ = *ibp++)) {
+ case '\\':
+ /* Replace backslash-newline with nothing. */
+ if (*ibp == '\n') {
+ ++ibp;
+ --obp;
+ }
break;
- if (c == '\n' && quotec == '\'')
+
+ case '\n':
+ /* Replace non-backslashed newline with backslash-'n',
+ replacing the arg buffer with a new one if this hasn't
+ been done already. */
+
+ if (start == arg->expanded) {
+ int olength = obp - arg->expanded;
+ U_CHAR *newbuf;
+ arg->expand_size = 2 * arg->expand_length;
+ newbuf = (U_CHAR *) xmalloc (arg->expand_size);
+ arg->free2 = arg->expanded = newbuf;
+ obp = newbuf + olength;
+ bcopy ((char *) start, (char *) newbuf, olength);
+ }
+
+ obp[-1] = '\\';
+ *obp++ = 'n';
break;
+
+#ifdef MULTIBYTE_CHARS
+ default:
+ {
+ int length;
+ ibp--;
+ length = local_mblen (ibp, ibp1 - ibp);
+ if (length > 1)
+ {
+ obp--;
+ bcopy (ibp, obp, length);
+ ibp += length;
+ obp += length;
+ }
+ else
+ ibp++;
+ }
+#endif
+ }
}
}
break;
}
}
- return obp - start;
+ arg->expand_length = obp - arg->expanded;
+
+ if (start != arg->expanded)
+ free (start);
}
/* my_strerror - return the descriptive text associated with an
@@ -8936,7 +9269,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);
@@ -8963,7 +9297,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);
}
@@ -9008,7 +9343,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: ");
@@ -9017,7 +9353,7 @@ vwarning (msgid, args)
}
static void
-#if defined (__STDC__) && defined (HAVE_VPRINTF)
+#if defined (ANSI_PROTOTYPES) && defined (HAVE_VPRINTF)
error_with_line (int line, PRINTF_ALIST (msgid))
#else
error_with_line (line, PRINTF_ALIST (msgid))
@@ -9050,7 +9386,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);
@@ -9059,7 +9396,7 @@ verror_with_line (line, msgid, args)
}
static void
-#if defined (__STDC__) && defined (HAVE_VPRINTF)
+#if defined (ANSI_PROTOTYPES) && defined (HAVE_VPRINTF)
warning_with_line (int line, PRINTF_ALIST (msgid))
#else
warning_with_line (line, PRINTF_ALIST (msgid))
@@ -9098,7 +9435,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: ");
@@ -9123,7 +9461,7 @@ pedwarn (PRINTF_ALIST (msgid))
}
void
-#if defined (__STDC__) && defined (HAVE_VPRINTF)
+#if defined (ANSI_PROTOTYPES) && defined (HAVE_VPRINTF)
pedwarn_with_line (int line, PRINTF_ALIST (msgid))
#else
pedwarn_with_line (line, PRINTF_ALIST (msgid))
@@ -9145,7 +9483,7 @@ pedwarn_with_line (line, PRINTF_ALIST (msgid))
giving specified file name and line number, not current. */
static void
-#if defined (__STDC__) && defined (HAVE_VPRINTF)
+#if defined (ANSI_PROTOTYPES) && defined (HAVE_VPRINTF)
pedwarn_with_file_and_line (char *file, size_t file_len, int line,
PRINTF_ALIST (msgid))
#else
@@ -9161,7 +9499,7 @@ pedwarn_with_file_and_line (file, file_len, line, PRINTF_ALIST (msgid))
if (!pedantic_errors && inhibit_warnings)
return;
if (file) {
- eprint_string (file, file_len);
+ fwrite (file, sizeof file[0], file_len, stderr);
fprintf (stderr, ":%d: ", line);
}
if (pedantic_errors)
@@ -9223,7 +9561,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)
@@ -9820,8 +10159,18 @@ make_definition (str, op)
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. */
@@ -10182,7 +10531,7 @@ deps_output (string, spacer)
deps_buffer[deps_size] = 0;
}
-static void
+void
fatal (PRINTF_ALIST (msgid))
PRINTF_DCL (msgid)
{
@@ -10562,4 +10911,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 334560a3e29..db96699fb8f 100644
--- a/gcc/cexp.c
+++ b/gcc/cexp.c
@@ -22,28 +22,20 @@
#line 27 "cexp.y"
#include "config.h"
+#include "system.h"
#include <setjmp.h>
+#include "gansidecl.h"
/* #define YYDEBUG 1 */
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#ifdef MULTIBYTE_CHARS
+#include "mbchar.h"
#include <locale.h>
#endif
-#include <stdio.h>
-
typedef unsigned char U_CHAR;
/* This is used for communicating lists of keywords with cccp.c. */
@@ -119,13 +111,11 @@ struct arglist {
#if defined (__STDC__) && defined (HAVE_VPRINTF)
# include <stdarg.h>
-# define VA_START(va_list, var) va_start (va_list, var)
# define PRINTF_ALIST(msg) char *msg, ...
# define PRINTF_DCL(msg)
# define PRINTF_PROTO(ARGS, m, n) PROTO (ARGS) __attribute__ ((format (__printf__, m, n)))
#else
# include <varargs.h>
-# define VA_START(va_list, var) va_start (va_list)
# define PRINTF_ALIST(msg) msg, va_alist
# define PRINTF_DCL(msg) char *msg; va_dcl
# define PRINTF_PROTO(ARGS, m, n) () __attribute__ ((format (__printf__, m, n)))
@@ -231,6 +221,7 @@ HOST_WIDE_INT parse_escape PROTO((char **, HOST_WIDE_INT));
int check_assertion PROTO((U_CHAR *, int, int, struct arglist *));
struct hashnode *lookup PROTO((U_CHAR *, int, int));
void error PRINTF_PROTO_1((char *, ...));
+void fatal PRINTF_PROTO_1((char *, ...)) __attribute__ ((noreturn));
void verror PROTO((char *, va_list));
void pedwarn PRINTF_PROTO_1((char *, ...));
void warning PRINTF_PROTO_1((char *, ...));
@@ -244,7 +235,7 @@ static void integer_overflow PROTO((void));
#define SIGNED (~0)
#define UNSIGNED 0
-#line 252 "cexp.y"
+#line 243 "cexp.y"
typedef union {
struct constant {HOST_WIDE_INT value; int signedp;} integer;
struct name {U_CHAR *address; int length;} name;
@@ -325,10 +316,10 @@ static const short yyrhs[] = { 35,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 282, 292, 293, 300, 305, 308, 310, 313, 317, 319,
- 324, 329, 342, 359, 372, 378, 384, 390, 396, 399,
- 402, 409, 416, 423, 430, 433, 436, 439, 442, 445,
- 448, 451, 453, 456, 459, 461, 463, 471, 473, 486
+ 273, 283, 284, 291, 296, 299, 301, 304, 308, 310,
+ 315, 320, 333, 350, 363, 369, 375, 381, 387, 390,
+ 393, 400, 407, 414, 421, 424, 427, 430, 433, 436,
+ 439, 442, 444, 447, 450, 452, 454, 462, 464, 477
};
#endif
@@ -926,7 +917,7 @@ yyreduce:
switch (yyn) {
case 1:
-#line 283 "cexp.y"
+#line 274 "cexp.y"
{
expression_value = yyvsp[0].integer.value;
#ifdef TEST_EXP_READER
@@ -935,55 +926,55 @@ case 1:
;
break;}
case 3:
-#line 294 "cexp.y"
+#line 285 "cexp.y"
{ if (pedantic)
pedwarn ("comma operator in operand of `#if'");
yyval.integer = yyvsp[0].integer; ;
break;}
case 4:
-#line 301 "cexp.y"
+#line 292 "cexp.y"
{ yyval.integer.value = - yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[0].integer.signedp;
if ((yyval.integer.value & yyvsp[0].integer.value & yyval.integer.signedp) < 0)
integer_overflow (); ;
break;}
case 5:
-#line 306 "cexp.y"
+#line 297 "cexp.y"
{ yyval.integer.value = ! yyvsp[0].integer.value;
yyval.integer.signedp = SIGNED; ;
break;}
case 6:
-#line 309 "cexp.y"
+#line 300 "cexp.y"
{ yyval.integer = yyvsp[0].integer; ;
break;}
case 7:
-#line 311 "cexp.y"
+#line 302 "cexp.y"
{ yyval.integer.value = ~ yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[0].integer.signedp; ;
break;}
case 8:
-#line 314 "cexp.y"
+#line 305 "cexp.y"
{ yyval.integer.value = check_assertion (yyvsp[0].name.address, yyvsp[0].name.length,
0, NULL_PTR);
yyval.integer.signedp = SIGNED; ;
break;}
case 9:
-#line 318 "cexp.y"
+#line 309 "cexp.y"
{ keyword_parsing = 1; ;
break;}
case 10:
-#line 320 "cexp.y"
+#line 311 "cexp.y"
{ yyval.integer.value = check_assertion (yyvsp[-4].name.address, yyvsp[-4].name.length,
1, yyvsp[-1].keywords);
keyword_parsing = 0;
yyval.integer.signedp = SIGNED; ;
break;}
case 11:
-#line 325 "cexp.y"
+#line 316 "cexp.y"
{ yyval.integer = yyvsp[-1].integer; ;
break;}
case 12:
-#line 330 "cexp.y"
+#line 321 "cexp.y"
{ yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
if (yyval.integer.signedp)
{
@@ -998,7 +989,7 @@ case 12:
* yyvsp[0].integer.value); ;
break;}
case 13:
-#line 343 "cexp.y"
+#line 334 "cexp.y"
{ if (yyvsp[0].integer.value == 0)
{
if (!skip_evaluation)
@@ -1017,7 +1008,7 @@ case 13:
/ yyvsp[0].integer.value); ;
break;}
case 14:
-#line 360 "cexp.y"
+#line 351 "cexp.y"
{ if (yyvsp[0].integer.value == 0)
{
if (!skip_evaluation)
@@ -1032,7 +1023,7 @@ case 14:
% yyvsp[0].integer.value); ;
break;}
case 15:
-#line 373 "cexp.y"
+#line 364 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value + yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
if (overflow_sum_sign (yyvsp[-2].integer.value, yyvsp[0].integer.value,
@@ -1040,7 +1031,7 @@ case 15:
integer_overflow (); ;
break;}
case 16:
-#line 379 "cexp.y"
+#line 370 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value - yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
if (overflow_sum_sign (yyval.integer.value, yyvsp[0].integer.value,
@@ -1048,7 +1039,7 @@ case 16:
integer_overflow (); ;
break;}
case 17:
-#line 385 "cexp.y"
+#line 376 "cexp.y"
{ yyval.integer.signedp = yyvsp[-2].integer.signedp;
if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0)
yyval.integer.value = right_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value);
@@ -1056,7 +1047,7 @@ case 17:
yyval.integer.value = left_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ;
break;}
case 18:
-#line 391 "cexp.y"
+#line 382 "cexp.y"
{ yyval.integer.signedp = yyvsp[-2].integer.signedp;
if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0)
yyval.integer.value = left_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value);
@@ -1064,17 +1055,17 @@ case 18:
yyval.integer.value = right_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ;
break;}
case 19:
-#line 397 "cexp.y"
+#line 388 "cexp.y"
{ yyval.integer.value = (yyvsp[-2].integer.value == yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 20:
-#line 400 "cexp.y"
+#line 391 "cexp.y"
{ yyval.integer.value = (yyvsp[-2].integer.value != yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 21:
-#line 403 "cexp.y"
+#line 394 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value <= yyvsp[0].integer.value;
@@ -1083,7 +1074,7 @@ case 21:
<= yyvsp[0].integer.value); ;
break;}
case 22:
-#line 410 "cexp.y"
+#line 401 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value >= yyvsp[0].integer.value;
@@ -1092,7 +1083,7 @@ case 22:
>= yyvsp[0].integer.value); ;
break;}
case 23:
-#line 417 "cexp.y"
+#line 408 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value < yyvsp[0].integer.value;
@@ -1101,7 +1092,7 @@ case 23:
< yyvsp[0].integer.value); ;
break;}
case 24:
-#line 424 "cexp.y"
+#line 415 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value > yyvsp[0].integer.value;
@@ -1110,64 +1101,64 @@ case 24:
> yyvsp[0].integer.value); ;
break;}
case 25:
-#line 431 "cexp.y"
+#line 422 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value & yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 26:
-#line 434 "cexp.y"
+#line 425 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value ^ yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 27:
-#line 437 "cexp.y"
+#line 428 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value | yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 28:
-#line 440 "cexp.y"
+#line 431 "cexp.y"
{ skip_evaluation += !yyvsp[-1].integer.value; ;
break;}
case 29:
-#line 442 "cexp.y"
+#line 433 "cexp.y"
{ skip_evaluation -= !yyvsp[-3].integer.value;
yyval.integer.value = (yyvsp[-3].integer.value && yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 30:
-#line 446 "cexp.y"
+#line 437 "cexp.y"
{ skip_evaluation += !!yyvsp[-1].integer.value; ;
break;}
case 31:
-#line 448 "cexp.y"
+#line 439 "cexp.y"
{ skip_evaluation -= !!yyvsp[-3].integer.value;
yyval.integer.value = (yyvsp[-3].integer.value || yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 32:
-#line 452 "cexp.y"
+#line 443 "cexp.y"
{ skip_evaluation += !yyvsp[-1].integer.value; ;
break;}
case 33:
-#line 454 "cexp.y"
+#line 445 "cexp.y"
{ skip_evaluation += !!yyvsp[-4].integer.value - !yyvsp[-4].integer.value; ;
break;}
case 34:
-#line 456 "cexp.y"
+#line 447 "cexp.y"
{ skip_evaluation -= !!yyvsp[-6].integer.value;
yyval.integer.value = yyvsp[-6].integer.value ? yyvsp[-3].integer.value : yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-3].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 35:
-#line 460 "cexp.y"
+#line 451 "cexp.y"
{ yyval.integer = yylval.integer; ;
break;}
case 36:
-#line 462 "cexp.y"
+#line 453 "cexp.y"
{ yyval.integer = yylval.integer; ;
break;}
case 37:
-#line 464 "cexp.y"
+#line 455 "cexp.y"
{ if (warn_undef && !skip_evaluation)
warning ("`%.*s' is not defined",
yyvsp[0].name.length, yyvsp[0].name.address);
@@ -1175,11 +1166,11 @@ case 37:
yyval.integer.signedp = SIGNED; ;
break;}
case 38:
-#line 472 "cexp.y"
+#line 463 "cexp.y"
{ yyval.keywords = 0; ;
break;}
case 39:
-#line 474 "cexp.y"
+#line 465 "cexp.y"
{ struct arglist *temp;
yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist));
yyval.keywords->next = yyvsp[-2].keywords;
@@ -1194,7 +1185,7 @@ case 39:
temp->next->length = 1; ;
break;}
case 40:
-#line 487 "cexp.y"
+#line 478 "cexp.y"
{ yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist));
yyval.keywords->name = yyvsp[-1].name.address;
yyval.keywords->length = yyvsp[-1].name.length;
@@ -1398,7 +1389,7 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 492 "cexp.y"
+#line 483 "cexp.y"
/* During parsing of a C expression, the pointer to the next character
@@ -1532,7 +1523,7 @@ yylex ()
register unsigned char *tokstart;
register struct token *toktab;
int wide_flag;
- HOST_WIDE_INT mask;
+ HOST_WIDE_INT mask = ~ (HOST_WIDE_INT) 0;
retry:
@@ -1564,21 +1555,18 @@ yylex ()
{
lexptr++;
wide_flag = 1;
- mask = MAX_WCHAR_TYPE_MASK;
goto char_constant;
}
if (lexptr[1] == '"')
{
lexptr++;
wide_flag = 1;
- mask = MAX_WCHAR_TYPE_MASK;
goto string_constant;
}
break;
case '\'':
wide_flag = 0;
- mask = MAX_CHAR_TYPE_MASK;
char_constant:
lexptr++;
if (keyword_parsing) {
@@ -1586,7 +1574,7 @@ yylex ()
while (1) {
c = *lexptr++;
if (c == '\\')
- c = parse_escape (&lexptr, mask);
+ parse_escape (&lexptr, mask);
else if (c == '\'')
break;
}
@@ -1601,69 +1589,121 @@ yylex ()
{
register HOST_WIDE_INT result = 0;
register int num_chars = 0;
+ int chars_seen = 0;
unsigned width = MAX_CHAR_TYPE_SIZE;
int max_chars;
- char *token_buffer;
-
- if (wide_flag)
- {
- width = MAX_WCHAR_TYPE_SIZE;
#ifdef MULTIBYTE_CHARS
- max_chars = MB_CUR_MAX;
-#else
- max_chars = 1;
+ int longest_char = local_mb_cur_max ();
+ char *token_buffer = (char *) alloca (longest_char);
+ (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
#endif
- }
- else
- max_chars = MAX_LONG_TYPE_SIZE / width;
- token_buffer = (char *) alloca (max_chars + 1);
+ max_chars = MAX_LONG_TYPE_SIZE / width;
+ if (wide_flag)
+ width = MAX_WCHAR_TYPE_SIZE;
while (1)
{
+ HOST_WIDE_INT ch;
c = *lexptr++;
- if (c == '\'' || c == EOF)
+ if (c == '\'')
break;
+ ++chars_seen;
if (c == '\\')
{
- c = parse_escape (&lexptr, mask);
+ ch = parse_escape (&lexptr, mask);
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ wchar_t wc;
+ int i;
+ int char_len = -1;
+ for (i = 1; i <= longest_char; ++i)
+ {
+ token_buffer[i - 1] = c;
+ char_len = local_mbtowc (& wc, token_buffer, i);
+ if (char_len != -1)
+ break;
+ c = *lexptr++;
+ }
+ if (char_len > 1)
+ {
+ /* mbtowc sometimes needs an extra char before accepting */
+ if (char_len < i)
+ lexptr--;
+ if (! wide_flag)
+ {
+ /* Merge character into result; ignore excess chars. */
+ for (i = 1; i <= char_len; ++i)
+ {
+ if (i > max_chars)
+ break;
+ if (width < HOST_BITS_PER_INT)
+ result = (result << width)
+ | (token_buffer[i - 1]
+ & ((1 << width) - 1));
+ else
+ result = token_buffer[i - 1];
+ }
+ num_chars += char_len;
+ continue;
+ }
+ }
+ else
+ {
+ if (char_len == -1)
+ warning ("Ignoring invalid multibyte character");
+ }
+ if (wide_flag)
+ c = wc;
+#endif /* ! MULTIBYTE_CHARS */
+ ch = c & mask;
}
- num_chars++;
+ if (wide_flag)
+ {
+ if (chars_seen == 1) /* only keep the first one */
+ result = ch;
+ mask = MAX_WCHAR_TYPE_MASK;
+ continue;
+ }
+
+ mask = MAX_CHAR_TYPE_MASK;
/* Merge character into result; ignore excess chars. */
+ num_chars++;
if (num_chars <= max_chars)
{
if (width < HOST_BITS_PER_WIDE_INT)
- result = (result << width) | c;
+ result = (result << width) | ch;
else
- result = c;
- token_buffer[num_chars - 1] = c;
+ result = ch;
}
}
- token_buffer[num_chars] = 0;
-
if (c != '\'')
error ("malformatted character constant");
- else if (num_chars == 0)
+ else if (chars_seen == 0)
error ("empty character constant");
else if (num_chars > max_chars)
{
num_chars = max_chars;
error ("character constant too long");
}
- else if (num_chars != 1 && ! traditional)
+ else if (chars_seen != 1 && ! traditional)
warning ("multi-character character constant");
/* If char type is signed, sign-extend the constant. */
if (! wide_flag)
{
int num_bits = num_chars * width;
-
- if (lookup ((U_CHAR *) "__CHAR_UNSIGNED__",
+ if (num_bits == 0)
+ /* We already got an error; avoid invalid shift. */
+ yylval.integer.value = 0;
+ else if (lookup ((U_CHAR *) "__CHAR_UNSIGNED__",
sizeof ("__CHAR_UNSIGNED__") - 1, -1)
|| ((result >> (num_bits - 1)) & 1) == 0)
yylval.integer.value
@@ -1676,22 +1716,6 @@ yylex ()
}
else
{
-#ifdef MULTIBYTE_CHARS
- /* Set the initial shift state and convert the next sequence. */
- result = 0;
- /* In all locales L'\0' is zero and mbtowc will return zero,
- so don't use it. */
- if (num_chars > 1
- || (num_chars == 1 && token_buffer[0] != '\0'))
- {
- wchar_t wc;
- (void) mbtowc (NULL_PTR, NULL_PTR, 0);
- if (mbtowc (& wc, token_buffer, num_chars) == num_chars)
- result = wc;
- else
- pedwarn ("Ignoring invalid multibyte character");
- }
-#endif
yylval.integer.value = result;
}
}
@@ -1734,7 +1758,6 @@ yylex ()
return c;
case '"':
- mask = MAX_CHAR_TYPE_MASK;
string_constant:
if (keyword_parsing) {
char *start_ptr = lexptr;
@@ -1742,7 +1765,7 @@ yylex ()
while (1) {
c = *lexptr++;
if (c == '\\')
- c = parse_escape (&lexptr, mask);
+ parse_escape (&lexptr, mask);
else if (c == '"')
break;
}
@@ -1805,11 +1828,10 @@ yylex ()
RESULT_MASK is used to mask out the result;
an error is reported if bits are lost thereby.
- A negative value means the sequence \ newline was seen,
- which is supposed to be equivalent to nothing at all.
+ Returning -1 means an incomplete escape sequence was seen.
- If \ is followed by a null character, we return a negative
- value and leave the string pointer pointing at the null character.
+ Returning -2 means the sequence \ newline was seen,
+ which is supposed to be equivalent to nothing at all.
If \ is followed by 000, we return 0 and leave the string pointer
after the zeros. A value of 0 does not mean end of string. */
@@ -1819,33 +1841,45 @@ parse_escape (string_ptr, result_mask)
char **string_ptr;
HOST_WIDE_INT result_mask;
{
- register int c = *(*string_ptr)++;
+ register char *p = *string_ptr;
+ register int c;
+ register HOST_WIDE_INT i;
+
+ while ((c = *p++) == '\\' && *p == '\n')
+ p++;
+
switch (c)
{
case 'a':
- return TARGET_BELL;
+ i = TARGET_BELL;
+ break;
case 'b':
- return TARGET_BS;
+ i = TARGET_BS;
+ break;
case 'e':
case 'E':
if (pedantic)
pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c);
- return 033;
+ i = 033;
+ break;
case 'f':
- return TARGET_FF;
+ i = TARGET_FF;
+ break;
case 'n':
- return TARGET_NEWLINE;
+ i = TARGET_NEWLINE;
+ break;
case 'r':
- return TARGET_CR;
+ i = TARGET_CR;
+ break;
case 't':
- return TARGET_TAB;
+ i = TARGET_TAB;
+ break;
case 'v':
- return TARGET_VT;
+ i = TARGET_VT;
+ break;
case '\n':
- return -2;
- case 0:
- (*string_ptr)--;
- return 0;
+ i = -2;
+ break;
case '0':
case '1':
@@ -1856,16 +1890,17 @@ parse_escape (string_ptr, result_mask)
case '6':
case '7':
{
- register HOST_WIDE_INT i = c - '0';
register int count = 0;
+ i = c - '0';
while (++count < 3)
{
- c = *(*string_ptr)++;
+ while ((c = *p++) == '\\' && *p == '\n')
+ p++;
if (c >= '0' && c <= '7')
i = (i << 3) + c - '0';
else
{
- (*string_ptr)--;
+ p--;
break;
}
}
@@ -1874,15 +1909,16 @@ parse_escape (string_ptr, result_mask)
i &= result_mask;
pedwarn ("octal escape sequence out of range");
}
- return i;
}
+ break;
case 'x':
{
- register unsigned_HOST_WIDE_INT i = 0, overflow = 0;
+ register unsigned_HOST_WIDE_INT u = 0, overflow = 0;
register int digits_found = 0, digit;
for (;;)
{
- c = *(*string_ptr)++;
+ while ((c = *p++) == '\\' && *p == '\n')
+ p++;
if (c >= '0' && c <= '9')
digit = c - '0';
else if (c >= 'a' && c <= 'f')
@@ -1891,25 +1927,30 @@ parse_escape (string_ptr, result_mask)
digit = c - 'A' + 10;
else
{
- (*string_ptr)--;
+ p--;
break;
}
- overflow |= i ^ (i << 4 >> 4);
- i = (i << 4) + digit;
+ overflow |= u ^ (u << 4 >> 4);
+ u = (u << 4) + digit;
digits_found = 1;
}
if (!digits_found)
yyerror ("\\x used with no following hex digits");
- if (overflow | (i != (i & result_mask)))
+ if (overflow | (u != (u & result_mask)))
{
- i &= result_mask;
+ u &= result_mask;
pedwarn ("hex escape sequence out of range");
}
- return i;
+ i = u;
}
+ break;
default:
- return c;
+ i = c;
+ break;
}
+
+ *string_ptr = p;
+ return i;
}
static void
diff --git a/gcc/cexp.y b/gcc/cexp.y
index dc6a9533232..a920036d1c4 100644
--- a/gcc/cexp.y
+++ b/gcc/cexp.y
@@ -26,28 +26,20 @@ Boston, MA 02111-1307, USA.
%{
#include "config.h"
+#include "system.h"
#include <setjmp.h>
+#include "gansidecl.h"
/* #define YYDEBUG 1 */
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#ifdef MULTIBYTE_CHARS
+#include "mbchar.h"
#include <locale.h>
#endif
-#include <stdio.h>
-
typedef unsigned char U_CHAR;
/* This is used for communicating lists of keywords with cccp.c. */
@@ -123,13 +115,11 @@ struct arglist {
#if defined (__STDC__) && defined (HAVE_VPRINTF)
# include <stdarg.h>
-# define VA_START(va_list, var) va_start (va_list, var)
# define PRINTF_ALIST(msg) char *msg, ...
# define PRINTF_DCL(msg)
# define PRINTF_PROTO(ARGS, m, n) PROTO (ARGS) __attribute__ ((format (__printf__, m, n)))
#else
# include <varargs.h>
-# define VA_START(va_list, var) va_start (va_list)
# define PRINTF_ALIST(msg) msg, va_alist
# define PRINTF_DCL(msg) char *msg; va_dcl
# define PRINTF_PROTO(ARGS, m, n) () __attribute__ ((format (__printf__, m, n)))
@@ -235,6 +225,7 @@ HOST_WIDE_INT parse_escape PROTO((char **, HOST_WIDE_INT));
int check_assertion PROTO((U_CHAR *, int, int, struct arglist *));
struct hashnode *lookup PROTO((U_CHAR *, int, int));
void error PRINTF_PROTO_1((char *, ...));
+void fatal PRINTF_PROTO_1((char *, ...)) __attribute__ ((noreturn));
void verror PROTO((char *, va_list));
void pedwarn PRINTF_PROTO_1((char *, ...));
void warning PRINTF_PROTO_1((char *, ...));
@@ -622,7 +613,7 @@ yylex ()
register unsigned char *tokstart;
register struct token *toktab;
int wide_flag;
- HOST_WIDE_INT mask;
+ HOST_WIDE_INT mask = ~ (HOST_WIDE_INT) 0;
retry:
@@ -654,21 +645,18 @@ yylex ()
{
lexptr++;
wide_flag = 1;
- mask = MAX_WCHAR_TYPE_MASK;
goto char_constant;
}
if (lexptr[1] == '"')
{
lexptr++;
wide_flag = 1;
- mask = MAX_WCHAR_TYPE_MASK;
goto string_constant;
}
break;
case '\'':
wide_flag = 0;
- mask = MAX_CHAR_TYPE_MASK;
char_constant:
lexptr++;
if (keyword_parsing) {
@@ -676,7 +664,7 @@ yylex ()
while (1) {
c = *lexptr++;
if (c == '\\')
- c = parse_escape (&lexptr, mask);
+ parse_escape (&lexptr, mask);
else if (c == '\'')
break;
}
@@ -691,69 +679,121 @@ yylex ()
{
register HOST_WIDE_INT result = 0;
register int num_chars = 0;
+ int chars_seen = 0;
unsigned width = MAX_CHAR_TYPE_SIZE;
int max_chars;
- char *token_buffer;
-
- if (wide_flag)
- {
- width = MAX_WCHAR_TYPE_SIZE;
#ifdef MULTIBYTE_CHARS
- max_chars = MB_CUR_MAX;
-#else
- max_chars = 1;
+ int longest_char = local_mb_cur_max ();
+ char *token_buffer = (char *) alloca (longest_char);
+ (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
#endif
- }
- else
- max_chars = MAX_LONG_TYPE_SIZE / width;
- token_buffer = (char *) alloca (max_chars + 1);
+ max_chars = MAX_LONG_TYPE_SIZE / width;
+ if (wide_flag)
+ width = MAX_WCHAR_TYPE_SIZE;
while (1)
{
+ HOST_WIDE_INT ch;
c = *lexptr++;
- if (c == '\'' || c == EOF)
+ if (c == '\'')
break;
+ ++chars_seen;
if (c == '\\')
{
- c = parse_escape (&lexptr, mask);
+ ch = parse_escape (&lexptr, mask);
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ wchar_t wc;
+ int i;
+ int char_len = -1;
+ for (i = 1; i <= longest_char; ++i)
+ {
+ token_buffer[i - 1] = c;
+ char_len = local_mbtowc (& wc, token_buffer, i);
+ if (char_len != -1)
+ break;
+ c = *lexptr++;
+ }
+ if (char_len > 1)
+ {
+ /* mbtowc sometimes needs an extra char before accepting */
+ if (char_len < i)
+ lexptr--;
+ if (! wide_flag)
+ {
+ /* Merge character into result; ignore excess chars. */
+ for (i = 1; i <= char_len; ++i)
+ {
+ if (i > max_chars)
+ break;
+ if (width < HOST_BITS_PER_INT)
+ result = (result << width)
+ | (token_buffer[i - 1]
+ & ((1 << width) - 1));
+ else
+ result = token_buffer[i - 1];
+ }
+ num_chars += char_len;
+ continue;
+ }
+ }
+ else
+ {
+ if (char_len == -1)
+ warning ("Ignoring invalid multibyte character");
+ }
+ if (wide_flag)
+ c = wc;
+#endif /* ! MULTIBYTE_CHARS */
+ ch = c & mask;
}
- num_chars++;
+ if (wide_flag)
+ {
+ if (chars_seen == 1) /* only keep the first one */
+ result = ch;
+ mask = MAX_WCHAR_TYPE_MASK;
+ continue;
+ }
+
+ mask = MAX_CHAR_TYPE_MASK;
/* Merge character into result; ignore excess chars. */
+ num_chars++;
if (num_chars <= max_chars)
{
if (width < HOST_BITS_PER_WIDE_INT)
- result = (result << width) | c;
+ result = (result << width) | ch;
else
- result = c;
- token_buffer[num_chars - 1] = c;
+ result = ch;
}
}
- token_buffer[num_chars] = 0;
-
if (c != '\'')
error ("malformatted character constant");
- else if (num_chars == 0)
+ else if (chars_seen == 0)
error ("empty character constant");
else if (num_chars > max_chars)
{
num_chars = max_chars;
error ("character constant too long");
}
- else if (num_chars != 1 && ! traditional)
+ else if (chars_seen != 1 && ! traditional)
warning ("multi-character character constant");
/* If char type is signed, sign-extend the constant. */
if (! wide_flag)
{
int num_bits = num_chars * width;
-
- if (lookup ((U_CHAR *) "__CHAR_UNSIGNED__",
+ if (num_bits == 0)
+ /* We already got an error; avoid invalid shift. */
+ yylval.integer.value = 0;
+ else if (lookup ((U_CHAR *) "__CHAR_UNSIGNED__",
sizeof ("__CHAR_UNSIGNED__") - 1, -1)
|| ((result >> (num_bits - 1)) & 1) == 0)
yylval.integer.value
@@ -766,22 +806,6 @@ yylex ()
}
else
{
-#ifdef MULTIBYTE_CHARS
- /* Set the initial shift state and convert the next sequence. */
- result = 0;
- /* In all locales L'\0' is zero and mbtowc will return zero,
- so don't use it. */
- if (num_chars > 1
- || (num_chars == 1 && token_buffer[0] != '\0'))
- {
- wchar_t wc;
- (void) mbtowc (NULL_PTR, NULL_PTR, 0);
- if (mbtowc (& wc, token_buffer, num_chars) == num_chars)
- result = wc;
- else
- pedwarn ("Ignoring invalid multibyte character");
- }
-#endif
yylval.integer.value = result;
}
}
@@ -824,7 +848,6 @@ yylex ()
return c;
case '"':
- mask = MAX_CHAR_TYPE_MASK;
string_constant:
if (keyword_parsing) {
char *start_ptr = lexptr;
@@ -832,7 +855,7 @@ yylex ()
while (1) {
c = *lexptr++;
if (c == '\\')
- c = parse_escape (&lexptr, mask);
+ parse_escape (&lexptr, mask);
else if (c == '"')
break;
}
@@ -895,11 +918,10 @@ yylex ()
RESULT_MASK is used to mask out the result;
an error is reported if bits are lost thereby.
- A negative value means the sequence \ newline was seen,
- which is supposed to be equivalent to nothing at all.
+ Returning -1 means an incomplete escape sequence was seen.
- If \ is followed by a null character, we return a negative
- value and leave the string pointer pointing at the null character.
+ Returning -2 means the sequence \ newline was seen,
+ which is supposed to be equivalent to nothing at all.
If \ is followed by 000, we return 0 and leave the string pointer
after the zeros. A value of 0 does not mean end of string. */
@@ -909,33 +931,45 @@ parse_escape (string_ptr, result_mask)
char **string_ptr;
HOST_WIDE_INT result_mask;
{
- register int c = *(*string_ptr)++;
+ register char *p = *string_ptr;
+ register int c;
+ register HOST_WIDE_INT i;
+
+ while ((c = *p++) == '\\' && *p == '\n')
+ p++;
+
switch (c)
{
case 'a':
- return TARGET_BELL;
+ i = TARGET_BELL;
+ break;
case 'b':
- return TARGET_BS;
+ i = TARGET_BS;
+ break;
case 'e':
case 'E':
if (pedantic)
pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c);
- return 033;
+ i = 033;
+ break;
case 'f':
- return TARGET_FF;
+ i = TARGET_FF;
+ break;
case 'n':
- return TARGET_NEWLINE;
+ i = TARGET_NEWLINE;
+ break;
case 'r':
- return TARGET_CR;
+ i = TARGET_CR;
+ break;
case 't':
- return TARGET_TAB;
+ i = TARGET_TAB;
+ break;
case 'v':
- return TARGET_VT;
+ i = TARGET_VT;
+ break;
case '\n':
- return -2;
- case 0:
- (*string_ptr)--;
- return 0;
+ i = -2;
+ break;
case '0':
case '1':
@@ -946,16 +980,17 @@ parse_escape (string_ptr, result_mask)
case '6':
case '7':
{
- register HOST_WIDE_INT i = c - '0';
register int count = 0;
+ i = c - '0';
while (++count < 3)
{
- c = *(*string_ptr)++;
+ while ((c = *p++) == '\\' && *p == '\n')
+ p++;
if (c >= '0' && c <= '7')
i = (i << 3) + c - '0';
else
{
- (*string_ptr)--;
+ p--;
break;
}
}
@@ -964,15 +999,16 @@ parse_escape (string_ptr, result_mask)
i &= result_mask;
pedwarn ("octal escape sequence out of range");
}
- return i;
}
+ break;
case 'x':
{
- register unsigned_HOST_WIDE_INT i = 0, overflow = 0;
+ register unsigned_HOST_WIDE_INT u = 0, overflow = 0;
register int digits_found = 0, digit;
for (;;)
{
- c = *(*string_ptr)++;
+ while ((c = *p++) == '\\' && *p == '\n')
+ p++;
if (c >= '0' && c <= '9')
digit = c - '0';
else if (c >= 'a' && c <= 'f')
@@ -981,25 +1017,30 @@ parse_escape (string_ptr, result_mask)
digit = c - 'A' + 10;
else
{
- (*string_ptr)--;
+ p--;
break;
}
- overflow |= i ^ (i << 4 >> 4);
- i = (i << 4) + digit;
+ overflow |= u ^ (u << 4 >> 4);
+ u = (u << 4) + digit;
digits_found = 1;
}
if (!digits_found)
yyerror ("\\x used with no following hex digits");
- if (overflow | (i != (i & result_mask)))
+ if (overflow | (u != (u & result_mask)))
{
- i &= result_mask;
+ u &= result_mask;
pedwarn ("hex escape sequence out of range");
}
- return i;
+ i = u;
}
+ break;
default:
- return c;
+ i = c;
+ break;
}
+
+ *string_ptr = p;
+ return i;
}
static void
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 8e33cf32951..6980188dc30 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -1,6 +1,6 @@
/* Collect static initialization info into data structures that can be
traversed by C++ initialization and finalization routines.
- Copyright (C) 1992, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Contributed by Chris Smith (csmith@convex.com).
Heavily modified by Michael Meissner (meissner@cygnus.com),
Per Bothner (bothner@cygnus.com), and John Gilmore (gnu@cygnus.com).
@@ -26,25 +26,8 @@ Boston, MA 02111-1307, USA. */
/* Build tables of static constructors and destructors and run ld. */
#include "config.h"
-#include <sys/types.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
+#include "system.h"
#include <signal.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
#define COLLECT
@@ -53,44 +36,10 @@ Boston, MA 02111-1307, USA. */
#include "gansidecl.h"
#include "intl.h"
-#ifndef errno
-extern int errno;
-#endif
-
-#ifndef HAVE_STRERROR
-extern char *sys_errlist[];
-extern int sys_nerr;
-#else
-char *strerror();
-#endif
-
/* Obstack allocation and deallocation routines. */
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef USG
-#define vfork fork
-#endif
-
-#ifndef R_OK
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#endif
-
-#ifndef WIFSIGNALED
-#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
-#endif
-#ifndef WTERMSIG
-#define WTERMSIG(S) ((S) & 0x7f)
-#endif
-#ifndef WIFEXITED
-#define WIFEXITED(S) (((S) & 0xff) == 0)
-#endif
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
-#endif
-
extern char *choose_temp_base ();
/* On certain systems, we have code that works by scanning the object file
@@ -262,7 +211,6 @@ char * temporary_firstobj;
extern int prepends_underscore;
extern char *getenv ();
-extern char *mktemp ();
extern FILE *fdopen ();
/* Structure to hold all the directories in which to search for files to
diff --git a/gcc/combine.c b/gcc/combine.c
index cd98f827f85..92c66264175 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -75,15 +75,7 @@ Boston, MA 02111-1307, USA. */
combine anyway. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-/* Must precede rtl.h for FFS. */
-#include <stdio.h>
-
+#include "system.h"
#include "rtl.h"
#include "flags.h"
#include "regs.h"
@@ -714,7 +706,7 @@ setup_incoming_promotions ()
record_value_for_reg (reg, first,
gen_rtx (unsignedp ? ZERO_EXTEND : SIGN_EXTEND,
GET_MODE (reg),
- gen_rtx (CLOBBER, mode, const0_rtx)));
+ gen_rtx_CLOBBER (mode, const0_rtx)));
#endif
}
@@ -1439,8 +1431,9 @@ try_combine (i3, i2, i1)
as I2 will not cause a problem. */
subst_prev_insn = i1
- = gen_rtx (INSN, VOIDmode, INSN_UID (i2), NULL_RTX, i2,
- XVECEXP (PATTERN (i2), 0, 1), -1, NULL_RTX, NULL_RTX);
+ = gen_rtx_INSN (VOIDmode, INSN_UID (i2), NULL_RTX, i2,
+ XVECEXP (PATTERN (i2), 0, 1), -1, NULL_RTX,
+ NULL_RTX);
SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 0));
SUBST (XEXP (SET_SRC (PATTERN (i2)), 0),
@@ -1537,7 +1530,7 @@ try_combine (i3, i2, i1)
I2DEST. */
i2pat = (GET_CODE (PATTERN (i2)) == PARALLEL
- ? gen_rtx (SET, VOIDmode, i2dest, i2src)
+ ? gen_rtx_SET (VOIDmode, i2dest, i2src)
: PATTERN (i2));
if (added_sets_2)
@@ -1623,7 +1616,7 @@ try_combine (i3, i2, i1)
!= GET_MODE (SET_DEST (newpat))))
{
int regno = REGNO (SET_DEST (newpat));
- rtx new_dest = gen_rtx (REG, compare_mode, regno);
+ rtx new_dest = gen_rtx_REG (compare_mode, regno);
if (regno < FIRST_PSEUDO_REGISTER
|| (REG_N_SETS (regno) == 1 && ! added_sets_2
@@ -1717,7 +1710,7 @@ try_combine (i3, i2, i1)
{
rtvec old = XVEC (newpat, 0);
total_sets = XVECLEN (newpat, 0) + added_sets_1 + added_sets_2;
- newpat = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (total_sets));
+ newpat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (total_sets));
bcopy ((char *) &old->elem[0], (char *) XVEC (newpat, 0)->elem,
sizeof (old->elem[0]) * old->num_elem);
}
@@ -1725,27 +1718,27 @@ try_combine (i3, i2, i1)
{
rtx old = newpat;
total_sets = 1 + added_sets_1 + added_sets_2;
- newpat = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (total_sets));
+ newpat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (total_sets));
XVECEXP (newpat, 0, 0) = old;
}
if (added_sets_1)
XVECEXP (newpat, 0, --total_sets)
= (GET_CODE (PATTERN (i1)) == PARALLEL
- ? gen_rtx (SET, VOIDmode, i1dest, i1src) : PATTERN (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
@@ -1831,13 +1824,13 @@ try_combine (i3, i2, i1)
&& (REGNO (i2dest) < FIRST_PSEUDO_REGISTER
|| (REG_N_SETS (REGNO (i2dest)) == 1 && ! added_sets_2
&& ! REG_USERVAR_P (i2dest))))
- ni2dest = gen_rtx (REG, GET_MODE (SET_DEST (newpat)),
- REGNO (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,
+ m_split = split_insns (gen_rtx_PARALLEL
+ (VOIDmode,
+ gen_rtvec (2, newpat,
+ gen_rtx_CLOBBER (VOIDmode,
ni2dest))),
i3);
}
@@ -1930,7 +1923,7 @@ try_combine (i3, i2, i1)
validated that we can do this. */
if (GET_MODE (i2dest) != split_mode && split_mode != VOIDmode)
{
- newdest = gen_rtx (REG, split_mode, REGNO (i2dest));
+ newdest = gen_rtx_REG (split_mode, REGNO (i2dest));
if (REGNO (i2dest) >= FIRST_PSEUDO_REGISTER)
SUBST (regno_reg_rtx[REGNO (i2dest)], newdest);
@@ -2043,7 +2036,7 @@ try_combine (i3, i2, i1)
that destination. */
PATTERN (i3) = newpat;
- distribute_links (gen_rtx (INSN_LIST, VOIDmode, i3, NULL_RTX));
+ distribute_links (gen_rtx_INSN_LIST (VOIDmode, i3, NULL_RTX));
/* I3 now uses what used to be its destination and which is
now I2's destination. That means we need a LOG_LINK from
@@ -2349,12 +2342,12 @@ try_combine (i3, i2, i1)
REG_N_DEATHS (REGNO (i3dest_killed))++;
if (newi2pat && reg_set_p (i3dest_killed, newi2pat))
- distribute_notes (gen_rtx (EXPR_LIST, REG_DEAD, i3dest_killed,
- NULL_RTX),
+ distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i3dest_killed,
+ NULL_RTX),
NULL_RTX, i2, NULL_RTX, elim_i2, elim_i1);
else
- distribute_notes (gen_rtx (EXPR_LIST, REG_DEAD, i3dest_killed,
- NULL_RTX),
+ distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i3dest_killed,
+ NULL_RTX),
NULL_RTX, i3, newi2pat ? i2 : NULL_RTX,
elim_i2, elim_i1);
}
@@ -2365,10 +2358,10 @@ try_combine (i3, i2, i1)
REG_N_DEATHS (REGNO (i2dest))++;
if (newi2pat && reg_set_p (i2dest, newi2pat))
- distribute_notes (gen_rtx (EXPR_LIST, REG_DEAD, i2dest, NULL_RTX),
+ distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i2dest, NULL_RTX),
NULL_RTX, i2, NULL_RTX, NULL_RTX, NULL_RTX);
else
- distribute_notes (gen_rtx (EXPR_LIST, REG_DEAD, i2dest, NULL_RTX),
+ distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i2dest, NULL_RTX),
NULL_RTX, i3, newi2pat ? i2 : NULL_RTX,
NULL_RTX, NULL_RTX);
}
@@ -2379,10 +2372,10 @@ try_combine (i3, i2, i1)
REG_N_DEATHS (REGNO (i1dest))++;
if (newi2pat && reg_set_p (i1dest, newi2pat))
- distribute_notes (gen_rtx (EXPR_LIST, REG_DEAD, i1dest, NULL_RTX),
+ distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i1dest, NULL_RTX),
NULL_RTX, i2, NULL_RTX, NULL_RTX, NULL_RTX);
else
- distribute_notes (gen_rtx (EXPR_LIST, REG_DEAD, i1dest, NULL_RTX),
+ distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i1dest, NULL_RTX),
NULL_RTX, i3, newi2pat ? i2 : NULL_RTX,
NULL_RTX, NULL_RTX);
}
@@ -2566,7 +2559,7 @@ find_split_point (loc, insn)
&& ! memory_address_p (GET_MODE (x), XEXP (x, 0)))
{
rtx reg = regno_reg_rtx[FIRST_PSEUDO_REGISTER];
- rtx seq = split_insns (gen_rtx (SET, VOIDmode, reg, XEXP (x, 0)),
+ rtx seq = split_insns (gen_rtx_SET (VOIDmode, reg, XEXP (x, 0)),
subst_insn);
/* This should have produced two insns, each of which sets our
@@ -2968,7 +2961,7 @@ subst (x, from, to, in_dest, unique_copy)
So force this insn not to match in this (rare) case. */
if (! in_dest && code == REG && GET_CODE (from) == REG
&& REGNO (x) == REGNO (from))
- return gen_rtx (CLOBBER, GET_MODE (x), const0_rtx);
+ return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
/* If this is an object, we are done unless it is a MEM or LO_SUM, both
of which may contain things that can be combined. */
@@ -3050,7 +3043,7 @@ subst (x, from, to, in_dest, unique_copy)
&& ! (code == SET && i == 1 && XEXP (x, 0) == cc0_rtx)
#endif
)
- return gen_rtx (CLOBBER, VOIDmode, const0_rtx);
+ return gen_rtx_CLOBBER (VOIDmode, const0_rtx);
new = (unique_copy && n_occurrences ? copy_rtx (to) : to);
n_occurrences++;
@@ -3252,9 +3245,10 @@ simplify_rtx (x, op0_mode, last, in_dest)
gen_binary (reverse_condition (cond_code),
mode, cond, cop1));
else
- return gen_rtx (IF_THEN_ELSE, mode,
- gen_binary (cond_code, VOIDmode, cond, cop1),
- true, false);
+ return gen_rtx_IF_THEN_ELSE (mode,
+ gen_binary (cond_code, VOIDmode,
+ cond, cop1),
+ true, false);
code = GET_CODE (x);
op0_mode = VOIDmode;
@@ -3370,7 +3364,7 @@ simplify_rtx (x, op0_mode, last, in_dest)
if that would change the meaning of the address. */
if (MEM_VOLATILE_P (SUBREG_REG (x))
|| mode_dependent_address_p (XEXP (inner, 0)))
- return gen_rtx (CLOBBER, mode, const0_rtx);
+ return gen_rtx_CLOBBER (mode, const0_rtx);
if (BYTES_BIG_ENDIAN)
{
@@ -3382,10 +3376,10 @@ simplify_rtx (x, op0_mode, last, in_dest)
}
/* Note if the plus_constant doesn't make a valid address
then this combination won't be accepted. */
- x = gen_rtx (MEM, mode,
- plus_constant (XEXP (inner, 0),
- (SUBREG_WORD (x) * UNITS_PER_WORD
- + endian_offset)));
+ x = gen_rtx_MEM (mode,
+ plus_constant (XEXP (inner, 0),
+ (SUBREG_WORD (x) * UNITS_PER_WORD
+ + endian_offset)));
MEM_VOLATILE_P (x) = MEM_VOLATILE_P (inner);
RTX_UNCHANGING_P (x) = RTX_UNCHANGING_P (inner);
MEM_IN_STRUCT_P (x) = MEM_IN_STRUCT_P (inner);
@@ -3427,10 +3421,10 @@ simplify_rtx (x, op0_mode, last, in_dest)
{
if (HARD_REGNO_MODE_OK (REGNO (SUBREG_REG (x)) + SUBREG_WORD (x),
mode))
- return gen_rtx (REG, mode,
- REGNO (SUBREG_REG (x)) + SUBREG_WORD (x));
+ return gen_rtx_REG (mode,
+ REGNO (SUBREG_REG (x)) + SUBREG_WORD (x));
else
- return gen_rtx (CLOBBER, mode, const0_rtx);
+ return gen_rtx_CLOBBER (mode, const0_rtx);
}
/* For a constant, try to pick up the part we want. Handle a full
@@ -3504,8 +3498,8 @@ simplify_rtx (x, op0_mode, last, in_dest)
but this doesn't seem common enough to bother with. */
if (GET_CODE (XEXP (x, 0)) == ASHIFT
&& XEXP (XEXP (x, 0), 0) == const1_rtx)
- return gen_rtx (ROTATE, mode, gen_unary (NOT, mode, mode, const1_rtx),
- XEXP (XEXP (x, 0), 1));
+ return gen_rtx_ROTATE (mode, gen_unary (NOT, mode, mode, const1_rtx),
+ XEXP (XEXP (x, 0), 1));
if (GET_CODE (XEXP (x, 0)) == SUBREG
&& subreg_lowpart_p (XEXP (x, 0))
@@ -3516,9 +3510,10 @@ simplify_rtx (x, op0_mode, last, in_dest)
{
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (XEXP (x, 0)));
- x = gen_rtx (ROTATE, inner_mode,
- gen_unary (NOT, inner_mode, inner_mode, const1_rtx),
- XEXP (SUBREG_REG (XEXP (x, 0)), 1));
+ x = gen_rtx_ROTATE (inner_mode,
+ gen_unary (NOT, inner_mode, inner_mode,
+ const1_rtx),
+ XEXP (SUBREG_REG (XEXP (x, 0)), 1));
return gen_lowpart_for_combine (mode, x);
}
@@ -4478,7 +4473,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
@@ -4522,7 +4520,7 @@ simplify_set (x)
if (compare_mode != GET_MODE (dest))
{
int regno = REGNO (dest);
- rtx new_dest = gen_rtx (REG, compare_mode, regno);
+ rtx new_dest = gen_rtx_REG (compare_mode, regno);
if (regno < FIRST_PSEUDO_REGISTER
|| (REG_N_SETS (regno) == 1 && ! REG_USERVAR_P (dest)))
@@ -4727,6 +4725,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)
@@ -4909,9 +4969,9 @@ simplify_logical (x, last)
&& GET_CODE (XEXP (op1, 1)) == CONST_INT
&& (INTVAL (XEXP (op0, 1)) + INTVAL (XEXP (op1, 1))
== GET_MODE_BITSIZE (mode)))
- return gen_rtx (ROTATE, mode, XEXP (op0, 0),
- (GET_CODE (op0) == ASHIFT
- ? XEXP (op0, 1) : XEXP (op1, 1)));
+ return gen_rtx_ROTATE (mode, XEXP (op0, 0),
+ (GET_CODE (op0) == ASHIFT
+ ? XEXP (op0, 1) : XEXP (op1, 1)));
/* If OP0 is (ashiftrt (plus ...) C), it might actually be
a (sign_extend (plus ...)). If so, OP1 is a CONST_INT, and the PLUS
@@ -5093,7 +5153,7 @@ expand_compound_operation (x)
with a (use (mem ...)) construct that only combine understands
and is used only for this purpose. */
if (len + pos > GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))))
- SUBST (XEXP (x, 0), gen_rtx (USE, GET_MODE (x), XEXP (x, 0)));
+ SUBST (XEXP (x, 0), gen_rtx_USE (GET_MODE (x), XEXP (x, 0)));
if (BITS_BIG_ENDIAN)
pos = GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) - len - pos;
@@ -5169,7 +5229,7 @@ expand_compound_operation (x)
>> 1))
== 0))))
{
- rtx temp = gen_rtx (SIGN_EXTEND, GET_MODE (x), XEXP (x, 0));
+ rtx temp = gen_rtx_SIGN_EXTEND (GET_MODE (x), XEXP (x, 0));
if (rtx_cost (temp, SET) < rtx_cost (x, SET))
return expand_compound_operation (temp);
@@ -5259,7 +5319,7 @@ expand_field_assignment (x)
surround INNER with a USE to indicate this. */
if (GET_CODE (pos) == CONST_INT
&& INTVAL (pos) + len > GET_MODE_BITSIZE (GET_MODE (inner)))
- inner = gen_rtx (USE, GET_MODE (SET_DEST (x)), inner);
+ inner = gen_rtx_USE (GET_MODE (SET_DEST (x)), inner);
if (BITS_BIG_ENDIAN)
{
@@ -5288,9 +5348,10 @@ expand_field_assignment (x)
== ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (SET_DEST (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)));
+ x = gen_rtx_SET (VOIDmode, SUBREG_REG (SET_DEST (x)),
+ gen_lowpart_for_combine
+ (GET_MODE (SUBREG_REG (SET_DEST (x))),
+ SET_SRC (x)));
continue;
}
else
@@ -5310,22 +5371,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;
@@ -5455,7 +5516,7 @@ make_extraction (mode, inner, pos, pos_rtx, len,
else
offset = pos / BITS_PER_UNIT;
- new = gen_rtx (MEM, tmode, plus_constant (XEXP (inner, 0), offset));
+ new = gen_rtx_MEM (tmode, plus_constant (XEXP (inner, 0), offset));
RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (inner);
MEM_VOLATILE_P (new) = MEM_VOLATILE_P (inner);
MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (inner);
@@ -5465,14 +5526,15 @@ make_extraction (mode, inner, pos, pos_rtx, len,
/* We can't call gen_lowpart_for_combine here since we always want
a SUBREG and it would sometimes return a new hard register. */
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)
- - GET_MODE_SIZE (tmode))
- / UNITS_PER_WORD)
- - pos / BITS_PER_WORD)
- : pos / BITS_PER_WORD));
+ new = gen_rtx_SUBREG (tmode, inner,
+ (WORDS_BIG_ENDIAN
+ && (GET_MODE_SIZE (inner_mode)
+ > UNITS_PER_WORD)
+ ? (((GET_MODE_SIZE (inner_mode)
+ - GET_MODE_SIZE (tmode))
+ / UNITS_PER_WORD)
+ - pos / BITS_PER_WORD)
+ : pos / BITS_PER_WORD));
else
new = inner;
}
@@ -5489,7 +5551,7 @@ make_extraction (mode, inner, pos, pos_rtx, len,
if (in_dest)
return (GET_CODE (new) == MEM ? new
: (GET_CODE (new) != SUBREG
- ? gen_rtx (CLOBBER, tmode, const0_rtx)
+ ? gen_rtx_CLOBBER (tmode, const0_rtx)
: gen_rtx_combine (STRICT_LOW_PART, VOIDmode, new)));
/* Otherwise, sign- or zero-extend unless we already are in the
@@ -5507,12 +5569,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;
@@ -5629,8 +5691,8 @@ make_extraction (mode, inner, pos, pos_rtx, len,
if (offset != 0 || inner_mode != wanted_inner_mode)
{
- rtx newmem = gen_rtx (MEM, wanted_inner_mode,
- plus_constant (XEXP (inner, 0), offset));
+ rtx newmem = gen_rtx_MEM (wanted_inner_mode,
+ plus_constant (XEXP (inner, 0), offset));
RTX_UNCHANGING_P (newmem) = RTX_UNCHANGING_P (inner);
MEM_VOLATILE_P (newmem) = MEM_VOLATILE_P (inner);
MEM_IN_STRUCT_P (newmem) = MEM_IN_STRUCT_P (inner);
@@ -5829,10 +5891,10 @@ make_compound_operation (x, in_code)
{
/* Apply the distributive law, and then try to make extractions. */
new = gen_rtx_combine (GET_CODE (XEXP (x, 0)), mode,
- gen_rtx (AND, mode, XEXP (XEXP (x, 0), 0),
- XEXP (x, 1)),
- gen_rtx (AND, mode, XEXP (XEXP (x, 0), 1),
- XEXP (x, 1)));
+ gen_rtx_AND (mode, XEXP (XEXP (x, 0), 0),
+ XEXP (x, 1)),
+ gen_rtx_AND (mode, XEXP (XEXP (x, 0), 1),
+ XEXP (x, 1)));
new = make_compound_operation (new, in_code);
}
@@ -6895,7 +6957,7 @@ make_field_assignment (x)
assign = make_extraction (VOIDmode, dest, 0, XEXP (XEXP (src, 0), 1),
1, 1, 1, 0);
if (assign != 0)
- return gen_rtx (SET, VOIDmode, assign, const0_rtx);
+ return gen_rtx_SET (VOIDmode, assign, const0_rtx);
return x;
}
@@ -6911,7 +6973,7 @@ make_field_assignment (x)
XEXP (SUBREG_REG (XEXP (src, 0)), 1),
1, 1, 1, 0);
if (assign != 0)
- return gen_rtx (SET, VOIDmode, assign, const0_rtx);
+ return gen_rtx_SET (VOIDmode, assign, const0_rtx);
return x;
}
@@ -6924,7 +6986,7 @@ make_field_assignment (x)
assign = make_extraction (VOIDmode, dest, 0, XEXP (XEXP (src, 0), 1),
1, 1, 1, 0);
if (assign != 0)
- return gen_rtx (SET, VOIDmode, assign, const1_rtx);
+ return gen_rtx_SET (VOIDmode, assign, const1_rtx);
return x;
}
@@ -7857,8 +7919,9 @@ num_sign_bit_copies (x, mode)
return MAX (1, result);
case UDIV:
- /* The result must be <= the first operand. */
- return num_sign_bit_copies (XEXP (x, 0), mode);
+ /* The result must be <= the first operand, but the high bit may be on
+ in the first operand. */
+ return 1;
case UMOD:
/* The result must be <= the scond operand. */
@@ -8262,11 +8325,11 @@ simplify_shift_const (x, code, result_mode, varop, count)
MODE_INT, 1)) != BLKmode)
{
if (BYTES_BIG_ENDIAN)
- new = gen_rtx (MEM, tmode, XEXP (varop, 0));
+ new = gen_rtx_MEM (tmode, XEXP (varop, 0));
else
- new = gen_rtx (MEM, tmode,
- plus_constant (XEXP (varop, 0),
- count / BITS_PER_UNIT));
+ new = gen_rtx_MEM (tmode,
+ plus_constant (XEXP (varop, 0),
+ count / BITS_PER_UNIT));
RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (varop);
MEM_VOLATILE_P (new) = MEM_VOLATILE_P (varop);
MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (varop);
@@ -8899,10 +8962,11 @@ recog_for_combine (pnewpat, insn, pnotes, padded_scratches)
them. Then check to make sure that all of them are dead. */
if (num_clobbers_to_add)
{
- rtx newpat = gen_rtx (PARALLEL, VOIDmode,
- gen_rtvec (GET_CODE (pat) == PARALLEL
- ? XVECLEN (pat, 0) + num_clobbers_to_add
- : num_clobbers_to_add + 1));
+ rtx newpat = gen_rtx_PARALLEL (VOIDmode,
+ gen_rtvec (GET_CODE (pat) == PARALLEL
+ ? (XVECLEN (pat, 0)
+ + num_clobbers_to_add)
+ : num_clobbers_to_add + 1));
if (GET_CODE (pat) == PARALLEL)
for (i = 0; i < XVECLEN (pat, 0); i++)
@@ -8920,8 +8984,8 @@ recog_for_combine (pnewpat, insn, pnotes, padded_scratches)
return -1;
else if (GET_CODE (XEXP (XVECEXP (newpat, 0, i), 0)) == SCRATCH)
(*padded_scratches)++;
- notes = gen_rtx (EXPR_LIST, REG_UNUSED,
- XEXP (XVECEXP (newpat, 0, i), 0), notes);
+ notes = gen_rtx_EXPR_LIST (REG_UNUSED,
+ XEXP (XVECEXP (newpat, 0, i), 0), notes);
}
pat = newpat;
}
@@ -8961,7 +9025,7 @@ gen_lowpart_for_combine (mode, x)
&& (GET_CODE (x) == CONST_INT
|| GET_CODE (x) == CONST_DOUBLE))
|| GET_MODE_SIZE (GET_MODE (x)) == GET_MODE_SIZE (mode)))
- return gen_rtx (CLOBBER, GET_MODE (x), const0_rtx);
+ return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
/* X might be a paradoxical (subreg (mem)). In that case, gen_lowpart
won't know what to do. So we will strip off the SUBREG here and
@@ -8993,25 +9057,25 @@ gen_lowpart_for_combine (mode, x)
/* Refuse to work on a volatile memory ref or one with a mode-dependent
address. */
if (MEM_VOLATILE_P (x) || mode_dependent_address_p (XEXP (x, 0)))
- return gen_rtx (CLOBBER, GET_MODE (x), const0_rtx);
+ return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
/* If we want to refer to something bigger than the original memref,
generate a perverse subreg instead. That will force a reload
of the original memref X. */
if (GET_MODE_SIZE (GET_MODE (x)) < GET_MODE_SIZE (mode))
- return gen_rtx (SUBREG, mode, x, 0);
+ return gen_rtx_SUBREG (mode, x, 0);
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
- unchanged. */
- offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode))
- - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x))));
- }
- new = gen_rtx (MEM, mode, plus_constant (XEXP (x, 0), offset));
+ /* Adjust the address so that the address-after-the-data is
+ unchanged. */
+ offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode))
+ - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x))));
+
+ new = gen_rtx_MEM (mode, plus_constant (XEXP (x, 0), offset));
RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (x);
MEM_VOLATILE_P (new) = MEM_VOLATILE_P (x);
MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (x);
@@ -9034,7 +9098,7 @@ gen_lowpart_for_combine (mode, x)
word = ((GET_MODE_SIZE (GET_MODE (x))
- MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD))
/ UNITS_PER_WORD);
- return gen_rtx (SUBREG, mode, x, word);
+ return gen_rtx_SUBREG (mode, x, word);
}
}
@@ -9049,7 +9113,7 @@ gen_lowpart_for_combine (mode, x)
static rtx
gen_rtx_combine VPROTO((enum rtx_code code, enum machine_mode mode, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
enum rtx_code code;
enum machine_mode mode;
#endif
@@ -9063,7 +9127,7 @@ gen_rtx_combine VPROTO((enum rtx_code code, enum machine_mode mode, ...))
VA_START (p, mode);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
code = va_arg (p, enum rtx_code);
mode = va_arg (p, enum machine_mode);
#endif
@@ -9979,12 +10043,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))))
&& GET_CODE (XEXP (op0, 1)) == CONST_INT
&& mode_width <= HOST_BITS_PER_WIDE_INT
&& (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0))))
@@ -10509,7 +10578,7 @@ get_last_value_validate (loc, insn, tick, replace)
&& reg_last_set_label[j] > tick))
{
if (replace)
- *loc = gen_rtx (CLOBBER, GET_MODE (x), const0_rtx);
+ *loc = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
return replace;
}
@@ -10522,7 +10591,7 @@ get_last_value_validate (loc, insn, tick, replace)
&& INSN_CUID (insn) <= mem_last_set)
{
if (replace)
- *loc = gen_rtx (CLOBBER, GET_MODE (x), const0_rtx);
+ *loc = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
return replace;
}
@@ -10615,7 +10684,7 @@ get_last_value (x)
if (reg_mentioned_p (x, value))
value = replace_rtx (copy_rtx (value), x,
- gen_rtx (CLOBBER, GET_MODE (x), const0_rtx));
+ gen_rtx_CLOBBER (GET_MODE (x), const0_rtx));
if (reg_overlap_mentioned_p (x, value))
return 0;
@@ -10982,9 +11051,9 @@ move_deaths (x, maybe_kill_insn, from_cuid, to_insn, pnotes)
for (i = deadregno; i < deadend; i++)
if (i < regno || i >= ourend)
REG_NOTES (where_dead)
- = gen_rtx (EXPR_LIST, REG_DEAD,
- gen_rtx (REG, reg_raw_mode[i], i),
- REG_NOTES (where_dead));
+ = gen_rtx_EXPR_LIST (REG_DEAD,
+ gen_rtx_REG (reg_raw_mode[i], i),
+ REG_NOTES (where_dead));
}
/* If we didn't find any note, or if we found a REG_DEAD note that
covers only part of the given reg, and we have a multi-reg hard
@@ -11008,7 +11077,7 @@ move_deaths (x, maybe_kill_insn, from_cuid, to_insn, pnotes)
offset = 1;
for (i = regno + offset; i < ourend; i++)
- move_deaths (gen_rtx (REG, reg_raw_mode[i], i),
+ move_deaths (gen_rtx_REG (reg_raw_mode[i], i),
maybe_kill_insn, from_cuid, to_insn, &oldnotes);
}
@@ -11018,7 +11087,7 @@ move_deaths (x, maybe_kill_insn, from_cuid, to_insn, pnotes)
*pnotes = note;
}
else
- *pnotes = gen_rtx (EXPR_LIST, REG_DEAD, x, *pnotes);
+ *pnotes = gen_rtx_EXPR_LIST (REG_DEAD, x, *pnotes);
REG_N_DEATHS (regno)++;
}
@@ -11378,8 +11447,8 @@ 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),
- REG_NOTES (tem));
+ = gen_rtx_EXPR_LIST (REG_UNUSED, XEXP (note, 0),
+ REG_NOTES (tem));
}
else
{
@@ -11426,7 +11495,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
if (REG_NOTE_KIND (note) == REG_DEAD && place == 0 && tem != 0)
{
place
- = emit_insn_after (gen_rtx (USE, VOIDmode, XEXP (note, 0)),
+ = emit_insn_after (gen_rtx_USE (VOIDmode, XEXP (note, 0)),
tem);
/* If this insn was emitted between blocks, then update
@@ -11484,7 +11553,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
if (! refers_to_regno_p (i, i + 1, PATTERN (place), 0)
&& ! find_regno_fusage (place, USE, i))
{
- rtx piece = gen_rtx (REG, reg_raw_mode[i], i);
+ rtx piece = gen_rtx_REG (reg_raw_mode[i], i);
rtx p;
/* See if we already placed a USE note for this
@@ -11503,12 +11572,12 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
if (p)
{
rtx use_insn
- = emit_insn_before (gen_rtx (USE, VOIDmode,
- piece),
+ = emit_insn_before (gen_rtx_USE (VOIDmode,
+ piece),
p);
REG_NOTES (use_insn)
- = gen_rtx (EXPR_LIST, REG_DEAD, piece,
- REG_NOTES (use_insn));
+ = gen_rtx_EXPR_LIST (REG_DEAD, piece,
+ REG_NOTES (use_insn));
}
all_used = 0;
@@ -11531,7 +11600,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
for (i = regno; i < endregno; i++)
{
- rtx piece = gen_rtx (REG, reg_raw_mode[i], i);
+ rtx piece = gen_rtx_REG (reg_raw_mode[i], i);
if ((reg_referenced_p (piece, PATTERN (place))
|| (GET_CODE (place) == CALL_INSN
@@ -11539,9 +11608,9 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
&& ! dead_or_set_p (place, piece)
&& ! reg_bitfield_target_p (piece,
PATTERN (place)))
- REG_NOTES (place) = gen_rtx (EXPR_LIST, REG_DEAD,
- piece,
- REG_NOTES (place));
+ REG_NOTES (place)
+ = gen_rtx_EXPR_LIST (REG_DEAD, piece,
+ REG_NOTES (place));
}
place = 0;
diff --git a/gcc/config.in b/gcc/config.in
index 06418cc0a81..05a09ae9d7e 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1,7 +1,19 @@
/* config.in. Generated automatically from configure.in by autoheader. */
+/* Define if you can safely include both <string.h> and <strings.h>. */
+#undef STRING_WITH_STRINGS
+
+/* Define if printf supports "%p". */
+#undef HAVE_PRINTF_PTR
+
/* Define if you want expensive run-time checks. */
#undef ENABLE_CHECKING
+/* Define if your cpp understands the stringify operator. */
+#undef HAVE_CPP_STRINGIFY
+
+/* Define if your compiler understands volatile. */
+#undef HAVE_VOLATILE
+
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
@@ -20,6 +32,24 @@
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
+/* Define if you can safely include both <string.h> and <strings.h>. */
+#undef STRING_WITH_STRINGS
+
+/* Define if printf supports "%p". */
+#undef HAVE_PRINTF_PTR
+
+/* Define if you want expensive run-time checks. */
+#undef ENABLE_CHECKING
+
+/* Define if your cpp understands the stringify operator. */
+#undef HAVE_CPP_STRINGIFY
+
+/* Define if your compiler understands volatile. */
+#undef HAVE_VOLATILE
+
+/* Define if you have a working <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
/* Whether malloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_MALLOC
@@ -29,6 +59,15 @@
/* Whether calloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_CALLOC
+/* Whether bcopy must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_BCOPY
+
+/* Whether bcmp must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_BCMP
+
+/* Whether bzero must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_BZERO
+
/* Whether free must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_FREE
@@ -41,9 +80,33 @@
/* Whether getenv must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_GETENV
+/* Whether atol must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_ATOL
+
/* Whether sbrk must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_SBRK
+/* Whether abort must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_ABORT
+
+/* Whether strerror must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_STRERROR
+
+/* Whether strsignal must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_STRSIGNAL
+
+/* Whether getcwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETCWD
+
+/* Whether getwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETWD
+
+/* Whether getrlimit must be declared even if <sys/resource.h> is included. */
+#undef NEED_DECLARATION_GETRLIMIT
+
+/* Whether setrlimit must be declared even if <sys/resource.h> is included. */
+#undef NEED_DECLARATION_SETRLIMIT
+
/* Define to the name of the distribution. */
#undef PACKAGE
@@ -66,15 +129,30 @@
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
+/* Define if you don't have vprintf but do have _doprnt. */
+#undef HAVE_DOPRNT
+
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if you have <vfork.h>. */
+#undef HAVE_VFORK_H
+
+/* Define if you have the vprintf function. */
+#undef HAVE_VPRINTF
+
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef pid_t
+
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
@@ -96,6 +174,9 @@
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
+/* Define vfork as fork if vfork does not work. */
+#undef vfork
+
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
@@ -105,12 +186,21 @@
/* Define if you have the __argz_stringify function. */
#undef HAVE___ARGZ_STRINGIFY
+/* Define if you have the atoll function. */
+#undef HAVE_ATOLL
+
+/* Define if you have the atoq function. */
+#undef HAVE_ATOQ
+
/* Define if you have the bcmp function. */
#undef HAVE_BCMP
/* Define if you have the bcopy function. */
#undef HAVE_BCOPY
+/* Define if you have the bsearch function. */
+#undef HAVE_BSEARCH
+
/* Define if you have the bzero function. */
#undef HAVE_BZERO
@@ -126,9 +216,15 @@
/* Define if you have the getrlimit function. */
#undef HAVE_GETRLIMIT
+/* Define if you have the gettimeofday function. */
+#undef HAVE_GETTIMEOFDAY
+
/* Define if you have the index function. */
#undef HAVE_INDEX
+/* Define if you have the isascii function. */
+#undef HAVE_ISASCII
+
/* Define if you have the kill function. */
#undef HAVE_KILL
@@ -168,12 +264,15 @@
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
+/* Define if you have the strsignal function. */
+#undef HAVE_STRSIGNAL
+
+/* Define if you have the strtoul function. */
+#undef HAVE_STRTOUL
+
/* Define if you have the sysconf function. */
#undef HAVE_SYSCONF
-/* Define if you have the vprintf function. */
-#undef HAVE_VPRINTF
-
/* Define if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
@@ -216,12 +315,18 @@
/* Define if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
+/* Define if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <sys/times.h> header file. */
#undef HAVE_SYS_TIMES_H
+/* Define if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
/* Define if you have the <time.h> header file. */
#undef HAVE_TIME_H
diff --git a/gcc/config/1750a/1750a.c b/gcc/config/1750a/1750a.c
index ff9ae37e880..f35c087a456 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 "expr.h"
@@ -117,7 +116,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 2394165a2c4..3fa7066b4d5 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); \
} */
@@ -853,8 +853,8 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA
in one reasonably fast instruction. */
#define MOVE_MAX 65536
-/* MOVE_RATIO is the number of move instructions that is better than a
- block move. */
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction pairs, we will do a movstr or libcall instead. */
#define MOVE_RATIO 4
/* Define this if zero-extension is slow (more than one real instruction). */
diff --git a/gcc/config/1750a/1750a.md b/gcc/config/1750a/1750a.md
index 161d75d9bda..983cbf0f217 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, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
;; Contributed by O.M.Kellogg, DASA (oliver.kellogg@space.otn.dasa.de).
;; This file is part of GNU CC.
@@ -669,7 +669,7 @@
rtx new_opnds[4];
new_opnds[0] = operands[0];
new_opnds[1] = operands[1];
- new_opnds[2] = gen_rtx (CONST_INT, VOIDmode, -INTVAL(operands[2]));
+ new_opnds[2] = GEN_INT (-INTVAL(operands[2]));
new_opnds[3] = operands[3];
istr = \"disn\";
return mod_regno_adjust (istr, new_opnds);
@@ -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_rtx(CONST_INT,VOIDmode,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 4b28bba00bd..ad33bb95ef0 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 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 90-95, 97, 1998 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@nyu.edu)
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"
@@ -850,9 +850,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 03e7f73be39..94bf8957000 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..91e5f34be05 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 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 4c3c6c67294..7b809314778 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -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"
@@ -322,7 +322,7 @@ sext_add_operand (op, mode)
return ((unsigned HOST_WIDE_INT) INTVAL (op) < 255
|| (unsigned HOST_WIDE_INT) (- INTVAL (op)) < 255);
- return register_operand (op, mode);
+ return reg_not_elim_operand (op, mode);
}
/* Return 1 if OP is the constant 4 or 8. */
@@ -763,8 +763,8 @@ get_aligned_mem (ref, paligned_mem, pbitnum)
if (GET_CODE (base) == PLUS)
offset += INTVAL (XEXP (base, 1)), base = XEXP (base, 0);
- *paligned_mem = gen_rtx (MEM, SImode,
- plus_constant (base, offset & ~3));
+ *paligned_mem = gen_rtx_MEM (SImode,
+ plus_constant (base, offset & ~3));
MEM_IN_STRUCT_P (*paligned_mem) = MEM_IN_STRUCT_P (ref);
MEM_VOLATILE_P (*paligned_mem) = MEM_VOLATILE_P (ref);
RTX_UNCHANGING_P (*paligned_mem) = RTX_UNCHANGING_P (ref);
@@ -1628,9 +1628,9 @@ alpha_initialize_trampoline (tramp, fnaddr, cxt)
/* Store function address and CXT. */
addr = memory_address (Pmode, plus_constant (tramp, 16));
- emit_move_insn (gen_rtx (MEM, Pmode, addr), fnaddr);
+ emit_move_insn (gen_rtx_MEM (Pmode, addr), fnaddr);
addr = memory_address (Pmode, plus_constant (tramp, 24));
- emit_move_insn (gen_rtx (MEM, Pmode, addr), cxt);
+ emit_move_insn (gen_rtx_MEM (Pmode, addr), cxt);
/* Compute hint value. */
temp = force_operand (plus_constant (tramp, 12), NULL_RTX);
@@ -1641,18 +1641,18 @@ alpha_initialize_trampoline (tramp, fnaddr, cxt)
/* Merge in the hint. */
addr = memory_address (SImode, plus_constant (tramp, 8));
- 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
- emit_insn (gen_rtx (UNSPEC_VOLATILE, VOIDmode,
- gen_rtvec (1, const0_rtx), 0));
+ emit_insn (gen_rtx_UNSPEC_VOLATILE (VOIDmode,
+ gen_rtvec (1, const0_rtx), 0));
}
/* Do what is necessary for `va_start'. The argument is ignored;
@@ -1722,7 +1722,7 @@ alpha_builtin_saveregs (arglist)
dest = change_address (block, ptr_mode, XEXP (block, 0));
emit_move_insn (dest, addr);
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
dest, ptr_mode,
GEN_INT (GET_MODE_SIZE (ptr_mode)),
@@ -1736,7 +1736,7 @@ alpha_builtin_saveregs (arglist)
POINTER_SIZE/BITS_PER_UNIT));
emit_move_insn (dest, argsize);
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
dest, ptr_mode,
GEN_INT (GET_MODE_SIZE
@@ -1777,8 +1777,8 @@ alpha_return_addr ()
{
alpha_return_addr_rtx = ret = gen_reg_rtx (Pmode);
- emit_insn_after (gen_rtx (SET, VOIDmode, ret,
- gen_rtx (REG, Pmode, REG_RA)),
+ emit_insn_after (gen_rtx_SET (VOIDmode, ret,
+ gen_rtx_REG (Pmode, REG_RA)),
get_insns ());
}
@@ -1933,6 +1933,34 @@ alpha_sa_size ()
#endif /* ! OPEN_VMS */
+/* Returns 1 if OP is a register which is not eliminable (i.e., not SP or FP).
+
+ This is used in the patterns used for the integer multiply-add
+ insn to avoid creating complex expressions that will cause trouble
+ during reload and need numerous additional patterns to be
+ recognized. */
+
+int
+reg_not_elim_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ if (op == frame_pointer_rtx || op == arg_pointer_rtx)
+ return 0;
+
+ return register_operand (op, mode);
+}
+
+/* Likewise, but allow 8 bit constants as well. */
+
+int
+reg_not_elim_or_8bit_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ return reg_not_elim_operand (op, mode) || cint8_operand (op, mode);
+}
+
/* Return 1 if this function can directly return via $26. */
int
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index cbfbf0e52a2..a74731abc25 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -917,25 +917,24 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, ALL_REGS,
$f0 for floating-point functions. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx (REG, \
- ((INTEGRAL_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) == COMPLEX_TYPE)) \
- ? 32 : 0))
+ gen_rtx_REG (((INTEGRAL_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) == COMPLEX_TYPE)) \
+ ? 32 : 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, \
- (TARGET_FPREGS \
- && (GET_MODE_CLASS (MODE) == MODE_FLOAT \
- || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \
- ? 32 : 0))
+ gen_rtx_REG (MODE, \
+ (TARGET_FPREGS \
+ && (GET_MODE_CLASS (MODE) == MODE_FLOAT \
+ || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \
+ ? 32 : 0))
/* The definition of this macro implies that there are cases where
a scalar value cannot be returned in registers.
@@ -1013,11 +1012,12 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, ALL_REGS,
#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.
@@ -1071,15 +1071,15 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, ALL_REGS,
{ \
move_block_from_reg \
(16 + CUM, \
- gen_rtx (MEM, BLKmode, \
- plus_constant (virtual_incoming_args_rtx, \
- ((CUM) + 6)* UNITS_PER_WORD)), \
+ gen_rtx_MEM (BLKmode, \
+ plus_constant (virtual_incoming_args_rtx, \
+ ((CUM) + 6)* UNITS_PER_WORD)), \
6 - (CUM), (6 - (CUM)) * UNITS_PER_WORD); \
move_block_from_reg \
(16 + (TARGET_FPREGS ? 32 : 0) + CUM, \
- gen_rtx (MEM, BLKmode, \
- plus_constant (virtual_incoming_args_rtx, \
- (CUM) * UNITS_PER_WORD)), \
+ gen_rtx_MEM (BLKmode, \
+ plus_constant (virtual_incoming_args_rtx, \
+ (CUM) * UNITS_PER_WORD)), \
6 - (CUM), (6 - (CUM)) * UNITS_PER_WORD); \
} \
PRETEND_SIZE = 12 * UNITS_PER_WORD; \
@@ -1495,9 +1495,8 @@ extern void final_prescan_insn ();
#define FIXUNS_TRUNC_LIKE_FIX_TRUNC
-/* Max number of bytes we can move to or from memory
- in one reasonably fast instruction. */
-
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction pairs, we will do a movstr or libcall instead. */
#define MOVE_MAX 8
/* Largest number of bytes of an object that can be placed in a register.
@@ -2108,35 +2107,37 @@ literal_section () \
/* Define the codes that are matched by predicates in alpha.c. */
#define PREDICATE_CODES \
- {"reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \
- {"reg_or_6bit_operand", {SUBREG, REG, CONST_INT}}, \
- {"reg_or_8bit_operand", {SUBREG, REG, CONST_INT}}, \
- {"cint8_operand", {CONST_INT}}, \
- {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \
{"add_operand", {SUBREG, REG, CONST_INT}}, \
- {"sext_add_operand", {SUBREG, REG, CONST_INT}}, \
- {"const48_operand", {CONST_INT}}, \
- {"and_operand", {SUBREG, REG, CONST_INT}}, \
- {"or_operand", {SUBREG, REG, CONST_INT}}, \
- {"mode_mask_operand", {CONST_INT}}, \
- {"mul8_operand", {CONST_INT}}, \
- {"mode_width_operand", {CONST_INT}}, \
- {"reg_or_fp0_operand", {SUBREG, REG, CONST_DOUBLE}}, \
+ {"aligned_memory_operand", {MEM}}, \
{"alpha_comparison_operator", {EQ, LE, LT, LEU, LTU}}, \
{"alpha_swapped_comparison_operator", {EQ, GE, GT, GEU, GTU}}, \
- {"signed_comparison_operator", {EQ, NE, LE, LT, GE, GT}}, \
+ {"and_operand", {SUBREG, REG, CONST_INT}}, \
+ {"any_memory_operand", {MEM}}, \
+ {"call_operand", {REG, SYMBOL_REF}}, \
+ {"cint8_operand", {CONST_INT}}, \
+ {"const48_operand", {CONST_INT}}, \
+ {"current_file_function_operand", {SYMBOL_REF}}, \
{"divmod_operator", {DIV, MOD, UDIV, UMOD}}, \
{"fp0_operand", {CONST_DOUBLE}}, \
- {"current_file_function_operand", {SYMBOL_REF}}, \
- {"call_operand", {REG, SYMBOL_REF}}, \
{"input_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \
SYMBOL_REF, CONST, LABEL_REF}}, \
+ {"mode_mask_operand", {CONST_INT}}, \
+ {"mode_width_operand", {CONST_INT}}, \
+ {"mul8_operand", {CONST_INT}}, \
+ {"or_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_not_elim_operand", {SUBREG, REG}}, \
+ {"reg_not_elim_or_8bit_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_6bit_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_8bit_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_fp0_operand", {SUBREG, REG, CONST_DOUBLE}}, \
+ {"reg_or_unaligned_mem_operand", {SUBREG, REG, MEM}}, \
+ {"sext_add_operand", {SUBREG, REG, CONST_INT}}, \
+ {"signed_comparison_operator", {EQ, NE, LE, LT, GE, GT}}, \
{"some_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \
SYMBOL_REF, CONST, LABEL_REF}}, \
- {"aligned_memory_operand", {MEM}}, \
- {"unaligned_memory_operand", {MEM}}, \
- {"reg_or_unaligned_mem_operand", {SUBREG, REG, MEM}}, \
- {"any_memory_operand", {MEM}},
+ {"unaligned_memory_operand", {MEM}},
/* Tell collect that the object format is ECOFF. */
#define OBJECT_FORMAT_COFF
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 2f996de8c4c..d49309d6e22 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -234,10 +234,10 @@
(match_operand:SI 2 "add_operand" "")))]
""
"
-{ emit_insn (gen_rtx (SET, VOIDmode, gen_lowpart (DImode, operands[0]),
- gen_rtx (PLUS, DImode,
- gen_lowpart (DImode, operands[1]),
- gen_lowpart (DImode, operands[2]))));
+{ emit_insn (gen_rtx_SET (VOIDmode, gen_lowpart (DImode, operands[0]),
+ gen_rtx_PLUS (DImode,
+ gen_lowpart (DImode, operands[1]),
+ gen_lowpart (DImode, operands[2]))));
DONE;
} ")
@@ -282,9 +282,9 @@
(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 "register_operand" ""))]
+ (clobber (match_operand:SI 3 "reg_not_elim_operand" ""))]
"! sext_add_operand (operands[2], SImode) && INTVAL (operands[2]) > 0
&& INTVAL (operands[2]) % 4 == 0"
[(set (match_dup 3) (match_dup 4))
@@ -354,24 +354,24 @@
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r,r")
- (plus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "rJ,rJ")
+ (plus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r,r")
(match_operand:SI 2 "const48_operand" "I,I"))
(match_operand:SI 3 "sext_add_operand" "rI,O")))]
""
"@
- s%2addl %r1,%3,%0
- s%2subl %r1,%n3,%0")
+ s%2addl %1,%3,%0
+ s%2subl %1,%n3,%0")
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r,r")
(sign_extend:DI
- (plus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "rJ,rJ")
+ (plus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r,r")
(match_operand:SI 2 "const48_operand" "I,I"))
(match_operand:SI 3 "sext_add_operand" "rI,O"))))]
""
"@
- s%2addl %r1,%3,%0
- s%2subl %r1,%n3,%0")
+ s%2addl %1,%3,%0
+ s%2subl %1,%n3,%0")
(define_split
[(set (match_operand:DI 0 "register_operand" "")
@@ -380,8 +380,8 @@
[(match_operand 2 "" "")
(match_operand 3 "" "")])
(match_operand:SI 4 "const48_operand" ""))
- (match_operand:SI 5 "add_operand" ""))))
- (clobber (match_operand:DI 6 "register_operand" ""))]
+ (match_operand:SI 5 "sext_add_operand" ""))))
+ (clobber (match_operand:DI 6 "reg_not_elim_operand" ""))]
""
[(set (match_dup 6) (match_dup 7))
(set (match_dup 0)
@@ -396,105 +396,14 @@
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r,r")
- (plus:DI (mult:DI (match_operand:DI 1 "reg_or_0_operand" "rJ,rJ")
+ (plus:DI (mult:DI (match_operand:DI 1 "reg_not_elim_operand" "r,r")
(match_operand:DI 2 "const48_operand" "I,I"))
- (match_operand:DI 3 "reg_or_8bit_operand" "rI,O")))]
+ (match_operand:DI 3 "reg_not_elim_or_8bit_operand" "rI,O")))]
""
"@
- s%2addq %r1,%3,%0
+ 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")))]
@@ -520,10 +429,10 @@
(match_operand:SI 2 "reg_or_8bit_operand" "")))]
""
"
-{ emit_insn (gen_rtx (SET, VOIDmode, gen_lowpart (DImode, operands[0]),
- gen_rtx (MINUS, DImode,
- gen_lowpart (DImode, operands[1]),
- gen_lowpart (DImode, operands[2]))));
+{ emit_insn (gen_rtx_SET (VOIDmode, gen_lowpart (DImode, operands[0]),
+ gen_rtx_MINUS (DImode,
+ gen_lowpart (DImode, operands[1]),
+ gen_lowpart (DImode, operands[2]))));
DONE;
} ")
@@ -551,28 +460,28 @@
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r")
- (minus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
+ (minus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r")
(match_operand:SI 2 "const48_operand" "I"))
(match_operand:SI 3 "reg_or_8bit_operand" "rI")))]
""
- "s%2subl %r1,%3,%0")
+ "s%2subl %1,%3,%0")
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r")
(sign_extend:DI
- (minus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
+ (minus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r")
(match_operand:SI 2 "const48_operand" "I"))
(match_operand:SI 3 "reg_or_8bit_operand" "rI"))))]
""
- "s%2subl %r1,%3,%0")
+ "s%2subl %1,%3,%0")
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r")
- (minus:DI (mult:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
+ (minus:DI (mult:DI (match_operand:DI 1 "reg_not_elim_operand" "r")
(match_operand:DI 2 "const48_operand" "I"))
(match_operand:DI 3 "reg_or_8bit_operand" "rI")))]
""
- "s%2subq %r1,%3,%0")
+ "s%2subq %1,%3,%0")
(define_insn "mulsi3"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -1547,7 +1456,7 @@
"TARGET_FP && reload_completed"
[(set (match_dup 2) (fix:DI (match_dup 1)))
(set (match_dup 0) (unspec:SI [(match_dup 2)] 5))]
- "operands[2] = gen_rtx (REG, DImode, REGNO (operands[0]));")
+ "operands[2] = gen_rtx_REG (DImode, REGNO (operands[0]));")
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=f")
@@ -1618,7 +1527,7 @@
"TARGET_FP && reload_completed"
[(set (match_dup 2) (fix:DI (float_extend:DF (match_dup 1))))
(set (match_dup 0) (unspec:SI [(match_dup 2)] 5))]
- "operands[2] = gen_rtx (REG, DImode, REGNO (operands[0]));")
+ "operands[2] = gen_rtx_REG (DImode, REGNO (operands[0]));")
(define_insn "fix_truncsfsi2_tp"
[(set (match_operand:SI 0 "register_operand" "=&f")
@@ -2785,8 +2694,8 @@
{
enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;
operands[1] = gen_reg_rtx (mode);
- operands[2] = gen_rtx (LT, mode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (mode));
+ operands[2] = gen_rtx_LT (mode, alpha_compare_op0, alpha_compare_op1);
+ operands[3] = gen_rtx_NE (VOIDmode, operands[1], CONST0_RTX (mode));
}")
(define_expand "ble"
@@ -2800,8 +2709,8 @@
{
enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;
operands[1] = gen_reg_rtx (mode);
- operands[2] = gen_rtx (LE, mode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (mode));
+ operands[2] = gen_rtx_LE (mode, alpha_compare_op0, alpha_compare_op1);
+ operands[3] = gen_rtx_NE (VOIDmode, operands[1], CONST0_RTX (mode));
}")
(define_expand "bgt"
@@ -2816,14 +2725,14 @@
if (alpha_compare_fp_p)
{
operands[1] = gen_reg_rtx (DFmode);
- operands[2] = gen_rtx (LT, DFmode, alpha_compare_op1, alpha_compare_op0);
- operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (DFmode));
+ operands[2] = gen_rtx_LT (DFmode, alpha_compare_op1, alpha_compare_op0);
+ operands[3] = gen_rtx_NE (VOIDmode, operands[1], CONST0_RTX (DFmode));
}
else
{
operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx (LE, DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);
+ operands[2] = gen_rtx_LE (DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[3] = gen_rtx_EQ (VOIDmode, operands[1], const0_rtx);
}
}")
@@ -2839,14 +2748,14 @@
if (alpha_compare_fp_p)
{
operands[1] = gen_reg_rtx (DFmode);
- operands[2] = gen_rtx (LE, DFmode, alpha_compare_op1, alpha_compare_op0);
- operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (DFmode));
+ operands[2] = gen_rtx_LE (DFmode, alpha_compare_op1, alpha_compare_op0);
+ operands[3] = gen_rtx_NE (VOIDmode, operands[1], CONST0_RTX (DFmode));
}
else
{
operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx (LT, DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);
+ operands[2] = gen_rtx_LT (DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[3] = gen_rtx_EQ (VOIDmode, operands[1], const0_rtx);
}
}")
@@ -2860,8 +2769,8 @@
"
{
operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx (NE, VOIDmode, operands[1], const0_rtx);
+ operands[2] = gen_rtx_LTU (DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[3] = gen_rtx_NE (VOIDmode, operands[1], const0_rtx);
}")
(define_expand "bleu"
@@ -2874,8 +2783,8 @@
"
{
operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx (NE, VOIDmode, operands[1], const0_rtx);
+ operands[2] = gen_rtx_LEU (DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[3] = gen_rtx_NE (VOIDmode, operands[1], const0_rtx);
}")
(define_expand "bgtu"
@@ -2888,8 +2797,8 @@
"
{
operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);
+ operands[2] = gen_rtx_LEU (DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[3] = gen_rtx_EQ (VOIDmode, operands[1], const0_rtx);
}")
(define_expand "bgeu"
@@ -2902,8 +2811,8 @@
"
{
operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);
+ operands[2] = gen_rtx_LTU (DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[3] = gen_rtx_EQ (VOIDmode, operands[1], const0_rtx);
}")
(define_expand "seq"
@@ -2915,7 +2824,7 @@
if (alpha_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (EQ, DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[1] = gen_rtx_EQ (DImode, alpha_compare_op0, alpha_compare_op1);
}")
(define_expand "sne"
@@ -2928,7 +2837,7 @@
if (alpha_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (EQ, DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[1] = gen_rtx_EQ (DImode, alpha_compare_op0, alpha_compare_op1);
}")
(define_expand "slt"
@@ -2940,7 +2849,7 @@
if (alpha_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (LT, DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[1] = gen_rtx_LT (DImode, alpha_compare_op0, alpha_compare_op1);
}")
(define_expand "sle"
@@ -2952,7 +2861,7 @@
if (alpha_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (LE, DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[1] = gen_rtx_LE (DImode, alpha_compare_op0, alpha_compare_op1);
}")
(define_expand "sgt"
@@ -2964,8 +2873,8 @@
if (alpha_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (LT, DImode, force_reg (DImode, alpha_compare_op1),
- alpha_compare_op0);
+ operands[1] = gen_rtx_LT (DImode, force_reg (DImode, alpha_compare_op1),
+ alpha_compare_op0);
}")
(define_expand "sge"
@@ -2977,8 +2886,8 @@
if (alpha_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (LE, DImode, force_reg (DImode, alpha_compare_op1),
- alpha_compare_op0);
+ operands[1] = gen_rtx_LE (DImode, force_reg (DImode, alpha_compare_op1),
+ alpha_compare_op0);
}")
(define_expand "sltu"
@@ -2990,7 +2899,7 @@
if (alpha_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[1] = gen_rtx_LTU (DImode, alpha_compare_op0, alpha_compare_op1);
}")
(define_expand "sleu"
@@ -3002,7 +2911,7 @@
if (alpha_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);
+ operands[1] = gen_rtx_LEU (DImode, alpha_compare_op0, alpha_compare_op1);
}")
(define_expand "sgtu"
@@ -3014,8 +2923,8 @@
if (alpha_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (LTU, DImode, force_reg (DImode, alpha_compare_op1),
- alpha_compare_op0);
+ operands[1] = gen_rtx_LTU (DImode, force_reg (DImode, alpha_compare_op1),
+ alpha_compare_op0);
}")
(define_expand "sgeu"
@@ -3027,8 +2936,8 @@
if (alpha_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (LEU, DImode, force_reg (DImode, alpha_compare_op1),
- alpha_compare_op0);
+ operands[1] = gen_rtx_LEU (DImode, force_reg (DImode, alpha_compare_op1),
+ alpha_compare_op0);
}")
;; These are the main define_expand's used to make conditional moves.
@@ -3133,10 +3042,9 @@
&& extended_count (operands[3], DImode, unsignedp) >= 1))
{
if (GET_CODE (operands[3]) == CONST_INT)
- operands[7] = gen_rtx (PLUS, DImode, operands[2],
- GEN_INT (- INTVAL (operands[3])));
+ operands[7] = plus_constant (operands[2], - INTVAL (operands[3]));
else
- operands[7] = gen_rtx (MINUS, DImode, operands[2], operands[3]);
+ operands[7] = gen_rtx_MINUS (DImode, operands[2], operands[3]);
operands[8] = gen_rtx (code, VOIDmode, operands[6], const0_rtx);
}
@@ -3145,13 +3053,13 @@
|| code == LEU || code == LTU)
{
operands[7] = gen_rtx (code, DImode, operands[2], operands[3]);
- operands[8] = gen_rtx (NE, VOIDmode, operands[6], const0_rtx);
+ operands[8] = gen_rtx_NE (VOIDmode, operands[6], const0_rtx);
}
else
{
operands[7] = gen_rtx (reverse_condition (code), DImode, operands[2],
operands[3]);
- operands[8] = gen_rtx (EQ, VOIDmode, operands[6], const0_rtx);
+ operands[8] = gen_rtx_EQ (VOIDmode, operands[6], const0_rtx);
}
}")
@@ -3180,12 +3088,11 @@
FAIL;
if (GET_CODE (operands[3]) == CONST_INT)
- tem = gen_rtx (PLUS, SImode, operands[2],
- GEN_INT (- INTVAL (operands[3])));
+ tem = plus_constant (operands[2], - INTVAL (operands[3]));
else
- tem = gen_rtx (MINUS, SImode, operands[2], operands[3]);
+ tem = gen_rtx_MINUS (SImode, operands[2], operands[3]);
- operands[7] = gen_rtx (SIGN_EXTEND, DImode, tem);
+ operands[7] = gen_rtx_SIGN_EXTEND (DImode, tem);
operands[8] = gen_rtx (GET_CODE (operands[1]), VOIDmode, operands[6],
const0_rtx);
}")
@@ -3211,10 +3118,9 @@
&& extended_count (operands[3], DImode, unsignedp) >= 1))
{
if (GET_CODE (operands[3]) == CONST_INT)
- operands[5] = gen_rtx (PLUS, DImode, operands[2],
- GEN_INT (- INTVAL (operands[3])));
+ operands[5] = plus_constant (operands[2], - INTVAL (operands[3]));
else
- operands[5] = gen_rtx (MINUS, DImode, operands[2], operands[3]);
+ operands[5] = gen_rtx_MINUS (DImode, operands[2], operands[3]);
operands[6] = gen_rtx (code, VOIDmode, operands[4], const0_rtx);
}
@@ -3223,13 +3129,13 @@
|| code == LEU || code == LTU)
{
operands[5] = gen_rtx (code, DImode, operands[2], operands[3]);
- operands[6] = gen_rtx (NE, VOIDmode, operands[4], const0_rtx);
+ operands[6] = gen_rtx_NE (VOIDmode, operands[4], const0_rtx);
}
else
{
operands[5] = gen_rtx (reverse_condition (code), DImode, operands[2],
operands[3]);
- operands[6] = gen_rtx (EQ, VOIDmode, operands[4], const0_rtx);
+ operands[6] = gen_rtx_EQ (VOIDmode, operands[4], const0_rtx);
}
}")
@@ -3250,12 +3156,11 @@
{ rtx tem;
if (GET_CODE (operands[3]) == CONST_INT)
- tem = gen_rtx (PLUS, SImode, operands[2],
- GEN_INT (- INTVAL (operands[3])));
+ tem = plus_constant (operands[2], - INTVAL (operands[3]));
else
- tem = gen_rtx (MINUS, SImode, operands[2], operands[3]);
+ tem = gen_rtx_MINUS (SImode, operands[2], operands[3]);
- operands[5] = gen_rtx (SIGN_EXTEND, DImode, tem);
+ operands[5] = gen_rtx_SIGN_EXTEND (DImode, tem);
operands[6] = gen_rtx (GET_CODE (operands[1]), VOIDmode,
operands[4], const0_rtx);
}")
@@ -3320,7 +3225,7 @@
if (GET_CODE (operands[0]) != SYMBOL_REF
&& ! (GET_CODE (operands[0]) == REG && REGNO (operands[0]) == 27))
{
- rtx tem = gen_rtx (REG, DImode, 27);
+ rtx tem = gen_rtx_REG (DImode, 27);
emit_move_insn (tem, operands[0]);
operands[0] = tem;
}
@@ -3339,7 +3244,7 @@
if (GET_CODE (operands[1]) != SYMBOL_REF
&& ! (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == 27))
{
- rtx tem = gen_rtx (REG, DImode, 27);
+ rtx tem = gen_rtx_REG (DImode, 27);
emit_move_insn (tem, operands[1]);
operands[1] = tem;
}
@@ -3368,7 +3273,7 @@
indirect call differently. Load RA and set operands[2] to PV in
both cases. */
- emit_move_insn (gen_rtx (REG, DImode, 25), operands[1]);
+ emit_move_insn (gen_rtx_REG (DImode, 25), operands[1]);
if (GET_CODE (operands[0]) == SYMBOL_REF)
{
extern char *savealloc ();
@@ -3380,17 +3285,17 @@
strcpy (linksym, symbol);
strcat (linksym, \"..lk\");
- linkage = gen_rtx (SYMBOL_REF, Pmode, linksym);
-
- emit_move_insn (gen_rtx (REG, Pmode, 26), gen_rtx (MEM, Pmode, linkage));
+ linkage = gen_rtx_SYMBOL_REF (Pmode, linksym);
+ emit_move_insn (gen_rtx_REG (Pmode, 26),
+ gen_rtx_MEM (Pmode, linkage));
operands[2]
- = validize_mem (gen_rtx (MEM, Pmode, plus_constant (linkage, 8)));
+ = validize_mem (gen_rtx_MEM (Pmode, plus_constant (linkage, 8)));
}
else
{
- emit_move_insn (gen_rtx (REG, Pmode, 26),
- gen_rtx (MEM, Pmode, plus_constant (operands[0], 8)));
+ emit_move_insn (gen_rtx_REG (Pmode, 26),
+ gen_rtx_MEM (Pmode, plus_constant (operands[0], 8)));
operands[2] = operands[0];
}
@@ -3432,7 +3337,7 @@
if (GET_CODE (operands[1]) != SYMBOL_REF
&& ! (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == 27))
{
- rtx tem = gen_rtx (REG, DImode, 27);
+ rtx tem = gen_rtx_REG (DImode, 27);
emit_move_insn (tem, operands[1]);
operands[1] = tem;
}
@@ -3452,7 +3357,7 @@
if (GET_CODE (operands[1]) != SYMBOL_REF
&& ! (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == 27))
{
- rtx tem = gen_rtx (REG, DImode, 27);
+ rtx tem = gen_rtx_REG (DImode, 27);
emit_move_insn (tem, operands[1]);
operands[1] = tem;
}
@@ -3477,7 +3382,7 @@
indirect call differently. Load RA and set operands[3] to PV in
both cases. */
- emit_move_insn (gen_rtx (REG, DImode, 25), operands[2]);
+ emit_move_insn (gen_rtx_REG (DImode, 25), operands[2]);
if (GET_CODE (operands[1]) == SYMBOL_REF)
{
extern char *savealloc ();
@@ -3488,17 +3393,17 @@
alpha_need_linkage (symbol, 0);
strcpy (linksym, symbol);
strcat (linksym, \"..lk\");
- linkage = gen_rtx (SYMBOL_REF, Pmode, linksym);
+ linkage = gen_rtx_SYMBOL_REF (Pmode, linksym);
- emit_move_insn (gen_rtx (REG, Pmode, 26), gen_rtx (MEM, Pmode, linkage));
+ emit_move_insn (gen_rtx_REG (Pmode, 26), gen_rtx_MEM (Pmode, linkage));
operands[3]
- = validize_mem (gen_rtx (MEM, Pmode, plus_constant (linkage, 8)));
+ = validize_mem (gen_rtx_MEM (Pmode, plus_constant (linkage, 8)));
}
else
{
- emit_move_insn (gen_rtx (REG, Pmode, 26),
- gen_rtx (MEM, Pmode, plus_constant (operands[1], 8)));
+ emit_move_insn (gen_rtx_REG (Pmode, 26),
+ gen_rtx_MEM (Pmode, plus_constant (operands[1], 8)));
operands[3] = operands[1];
}
@@ -4349,7 +4254,7 @@
{
rtx aligned_mem, bitnum;
rtx scratch = (reload_in_progress
- ? gen_rtx (REG, SImode, REGNO (operands[0]))
+ ? gen_rtx_REG (SImode, REGNO (operands[0]))
: gen_reg_rtx (SImode));
get_aligned_mem (operands[1], &aligned_mem, &bitnum);
@@ -4461,7 +4366,7 @@
{
rtx aligned_mem, bitnum;
rtx scratch = (reload_in_progress
- ? gen_rtx (REG, SImode, REGNO (operands[0]))
+ ? gen_rtx_REG (SImode, REGNO (operands[0]))
: gen_reg_rtx (SImode));
get_aligned_mem (operands[1], &aligned_mem, &bitnum);
@@ -4542,11 +4447,11 @@
/* It is possible that one of the registers we got for operands[2]
might coincide with that of operands[0] (which is why we made
it TImode). Pick the other one to use as our scratch. */
- 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]));
rtx seq = gen_unaligned_loadqi (operands[0], addr, scratch,
- gen_rtx (REG, DImode, REGNO (operands[0])));
+ gen_rtx_REG (DImode, REGNO (operands[0])));
alpha_set_memflags (seq, operands[1]);
emit_insn (seq);
@@ -4564,11 +4469,11 @@
/* It is possible that one of the registers we got for operands[2]
might coincide with that of operands[0] (which is why we made
it TImode). Pick the other one to use as our scratch. */
- 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]));
rtx seq = gen_unaligned_loadhi (operands[0], addr, scratch,
- gen_rtx (REG, DImode, REGNO (operands[0])));
+ gen_rtx_REG (DImode, REGNO (operands[0])));
alpha_set_memflags (seq, operands[1]);
emit_insn (seq);
@@ -4590,15 +4495,15 @@
get_aligned_mem (operands[0], &aligned_mem, &bitnum);
emit_insn (gen_aligned_store (aligned_mem, operands[1], bitnum,
- gen_rtx (REG, SImode, REGNO (operands[2])),
- gen_rtx (REG, SImode,
- REGNO (operands[2]) + 1)));
+ gen_rtx_REG (SImode, REGNO (operands[2])),
+ gen_rtx_REG (SImode,
+ REGNO (operands[2]) + 1)));
}
else
{
rtx addr = get_unaligned_address (operands[0], 0);
- rtx scratch1 = gen_rtx (REG, DImode, REGNO (operands[2]));
- rtx scratch2 = gen_rtx (REG, DImode, REGNO (operands[2]) + 1);
+ rtx scratch1 = gen_rtx_REG (DImode, REGNO (operands[2]));
+ rtx scratch2 = gen_rtx_REG (DImode, REGNO (operands[2]) + 1);
rtx scratch3 = scratch1;
rtx seq;
@@ -4629,15 +4534,15 @@
get_aligned_mem (operands[0], &aligned_mem, &bitnum);
emit_insn (gen_aligned_store (aligned_mem, operands[1], bitnum,
- gen_rtx (REG, SImode, REGNO (operands[2])),
- gen_rtx (REG, SImode,
- REGNO (operands[2]) + 1)));
+ gen_rtx_REG (SImode, REGNO (operands[2])),
+ gen_rtx_REG (SImode,
+ REGNO (operands[2]) + 1)));
}
else
{
rtx addr = get_unaligned_address (operands[0], 0);
- rtx scratch1 = gen_rtx (REG, DImode, REGNO (operands[2]));
- rtx scratch2 = gen_rtx (REG, DImode, REGNO (operands[2]) + 1);
+ rtx scratch1 = gen_rtx_REG (DImode, REGNO (operands[2]));
+ rtx scratch2 = gen_rtx_REG (DImode, REGNO (operands[2]) + 1);
rtx scratch3 = scratch1;
rtx seq;
@@ -4659,8 +4564,8 @@
""
"
{
- operands[1] = gen_rtx (MEM, DImode, plus_constant (stack_pointer_rtx,
- INTVAL (operands[0])));
+ operands[1] = gen_rtx_MEM (DImode, plus_constant (stack_pointer_rtx,
+ INTVAL (operands[0])));
MEM_VOLATILE_P (operands[1]) = 1;
operands[0] = const0_rtx;
@@ -4722,16 +4627,16 @@
}
emit_label (loop_label);
- memref = gen_rtx (MEM, DImode, tmp);
+ memref = gen_rtx_MEM (DImode, tmp);
MEM_VOLATILE_P (memref) = 1;
emit_move_insn (memref, const0_rtx);
emit_insn (gen_adddi3 (tmp, tmp, GEN_INT(-8192)));
emit_insn (gen_cmpdi (tmp, want));
emit_jump_insn (gen_bgtu (loop_label));
if (obey_regdecls)
- gen_rtx (USE, VOIDmode, tmp);
+ emit_insn (gen_rtx_USE (VOIDmode, tmp));
- memref = gen_rtx (MEM, DImode, want);
+ memref = gen_rtx_MEM (DImode, want);
MEM_VOLATILE_P (memref) = 1;
emit_move_insn (memref, const0_rtx);
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index 8e4fd6dc858..97d7ac249b5 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -1,5 +1,5 @@
/* Output variables, constants and external declarations, for GNU compiler.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -135,7 +135,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
@@ -177,12 +177,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
@@ -234,7 +234,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 ()); \
} \
@@ -357,16 +357,16 @@ literals_section () \
CXT is an RTX for the static chain value for the function. */
#undef INITIALIZE_TRAMPOLINE
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- emit_move_insn (gen_rtx (MEM, Pmode, \
- memory_address (Pmode, \
- plus_constant ((TRAMP), 16))), \
- (FNADDR)); \
- emit_move_insn (gen_rtx (MEM, Pmode, \
- memory_address (Pmode, \
+#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
+{ \
+ emit_move_insn (gen_rtx_MEM (Pmode, \
+ memory_address (Pmode, \
+ plus_constant ((TRAMP), 16))), \
+ (FNADDR)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, \
+ memory_address (Pmode, \
plus_constant ((TRAMP), 24))), \
- (CXT)); \
+ (CXT)); \
}
#undef TRANSFER_FROM_TRAMPOLINE
diff --git a/gcc/config/alpha/x-alpha b/gcc/config/alpha/x-alpha
index 99197479798..86aab854ada 100644
--- a/gcc/config/alpha/x-alpha
+++ b/gcc/config/alpha/x-alpha
@@ -1 +1 @@
-CLIB=-lmld
+CLIB=-lmld -lexc
diff --git a/gcc/config/alpha/xm-alpha.h b/gcc/config/alpha/xm-alpha.h
index f7e870f5641..fb653e17101 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.
@@ -55,16 +55,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 e2f46e7c965..d0a90ea1d2d 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 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1997, 1998 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"
@@ -706,10 +706,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;
}
@@ -785,10 +785,10 @@ 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));
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 e259ce0a286..d588a61e430 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. */
@@ -723,7 +725,7 @@ extern int current_function_varargs;
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
@@ -813,11 +815,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. */
@@ -910,9 +912,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 328b1ebd991..0a66459a88e 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 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1997, 1998 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/arm/arm.c b/gcc/config/arm/arm.c
index 947504277d7..731bd225b5f 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -22,8 +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 "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -490,22 +489,22 @@ arm_split_constant (code, mode, val, target, source, subtargets)
{
/* Currently SET is the only monadic value for CODE, all
the rest are diadic. */
- emit_insn (gen_rtx (SET, VOIDmode, target, GEN_INT (val)));
+ emit_insn (gen_rtx_SET (VOIDmode, target, GEN_INT (val)));
return 1;
}
else
{
rtx temp = subtargets ? gen_reg_rtx (mode) : target;
- emit_insn (gen_rtx (SET, VOIDmode, temp, GEN_INT (val)));
+ emit_insn (gen_rtx_SET (VOIDmode, temp, GEN_INT (val)));
/* For MINUS, the value is subtracted from, since we never
have subtraction of a constant. */
if (code == MINUS)
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (code, mode, temp, source)));
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx (code, mode, temp, source)));
else
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (code, mode, source, temp)));
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx (code, mode, source, temp)));
return 2;
}
}
@@ -562,8 +561,8 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (remainder == 0xffffffff)
{
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target,
- GEN_INT (ARM_SIGN_EXTEND (val))));
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ GEN_INT (ARM_SIGN_EXTEND (val))));
return 1;
}
if (remainder == 0)
@@ -571,7 +570,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (reload_completed && rtx_equal_p (target, source))
return 0;
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target, source));
+ emit_insn (gen_rtx_SET (VOIDmode, target, source));
return 1;
}
break;
@@ -580,7 +579,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (remainder == 0)
{
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target, const0_rtx));
+ emit_insn (gen_rtx_SET (VOIDmode, target, const0_rtx));
return 1;
}
if (remainder == 0xffffffff)
@@ -588,7 +587,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (reload_completed && rtx_equal_p (target, source))
return 0;
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target, source));
+ emit_insn (gen_rtx_SET (VOIDmode, target, source));
return 1;
}
can_invert = 1;
@@ -600,14 +599,14 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (reload_completed && rtx_equal_p (target, source))
return 0;
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target, source));
+ emit_insn (gen_rtx_SET (VOIDmode, target, source));
return 1;
}
if (remainder == 0xffffffff)
{
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (NOT, mode, source)));
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_NOT (mode, source)));
return 1;
}
@@ -620,15 +619,16 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (remainder == 0)
{
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (NEG, mode, source)));
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_NEG (mode, source)));
return 1;
}
if (const_ok_for_arm (val))
{
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (MINUS, mode, GEN_INT (val), source)));
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_MINUS (mode, GEN_INT (val),
+ source)));
return 1;
}
can_negate = 1;
@@ -645,10 +645,10 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
|| (can_invert && const_ok_for_arm (~val)))
{
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target,
- (source ? gen_rtx (code, mode, source,
- GEN_INT (val))
- : GEN_INT (val))));
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ (source ? gen_rtx (code, mode, source,
+ GEN_INT (val))
+ : GEN_INT (val))));
return 1;
}
@@ -703,8 +703,8 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (generate)
{
new_src = subtargets ? gen_reg_rtx (mode) : target;
- emit_insn (gen_rtx (SET, VOIDmode, new_src,
- GEN_INT (temp1)));
+ emit_insn (gen_rtx_SET (VOIDmode, new_src,
+ GEN_INT (temp1)));
emit_insn (gen_ashrsi3 (target, new_src,
GEN_INT (set_sign_bit_copies - 1)));
}
@@ -718,8 +718,8 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (generate)
{
new_src = subtargets ? gen_reg_rtx (mode) : target;
- emit_insn (gen_rtx (SET, VOIDmode, new_src,
- GEN_INT (temp1)));
+ emit_insn (gen_rtx_SET (VOIDmode, new_src,
+ GEN_INT (temp1)));
emit_insn (gen_ashrsi3 (target, new_src,
GEN_INT (set_sign_bit_copies - 1)));
}
@@ -750,11 +750,12 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
source, subtargets, generate);
source = new_src;
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (IOR, mode,
- gen_rtx (ASHIFT, mode, source,
- GEN_INT (i)),
- source)));
+ emit_insn (gen_rtx_SET
+ (VOIDmode, target,
+ gen_rtx_IOR (mode,
+ gen_rtx_ASHIFT (mode, source,
+ GEN_INT (i)),
+ source)));
return insns + 1;
}
}
@@ -772,11 +773,13 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
source, subtargets, generate);
source = new_src;
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (IOR, mode,
- gen_rtx (LSHIFTRT, mode,
- source, GEN_INT (i)),
- source)));
+ emit_insn
+ (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_IOR
+ (mode,
+ gen_rtx_LSHIFTRT (mode, source,
+ GEN_INT (i)),
+ source)));
return insns + 1;
}
}
@@ -797,9 +800,9 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
{
rtx sub = subtargets ? gen_reg_rtx (mode) : target;
- emit_insn (gen_rtx (SET, VOIDmode, sub, GEN_INT (val)));
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (code, mode, source, sub)));
+ emit_insn (gen_rtx_SET (VOIDmode, sub, GEN_INT (val)));
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx (code, mode, source, sub)));
}
return 2;
}
@@ -816,14 +819,15 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
rtx sub = subtargets ? gen_reg_rtx (mode) : target;
rtx shift = GEN_INT (set_sign_bit_copies);
- emit_insn (gen_rtx (SET, VOIDmode, sub,
- gen_rtx (NOT, mode,
- gen_rtx (ASHIFT, mode, source,
- shift))));
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (NOT, mode,
- gen_rtx (LSHIFTRT, mode, sub,
+ emit_insn (gen_rtx_SET (VOIDmode, sub,
+ gen_rtx_NOT (mode,
+ gen_rtx_ASHIFT (mode,
+ source,
shift))));
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_NOT (mode,
+ gen_rtx_LSHIFTRT (mode, sub,
+ shift))));
}
return 2;
}
@@ -836,13 +840,14 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
rtx sub = subtargets ? gen_reg_rtx (mode) : target;
rtx shift = GEN_INT (set_zero_bit_copies);
- emit_insn (gen_rtx (SET, VOIDmode, sub,
- gen_rtx (NOT, mode,
- gen_rtx (LSHIFTRT, mode, source,
+ emit_insn (gen_rtx_SET (VOIDmode, sub,
+ gen_rtx_NOT (mode,
+ gen_rtx_LSHIFTRT (mode,
+ source,
shift))));
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (NOT, mode,
- gen_rtx (ASHIFT, mode, sub,
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_NOT (mode,
+ gen_rtx_ASHIFT (mode, sub,
shift))));
}
return 2;
@@ -853,16 +858,16 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (generate)
{
rtx sub = subtargets ? gen_reg_rtx (mode) : target;
- emit_insn (gen_rtx (SET, VOIDmode, sub,
- gen_rtx (NOT, mode, source)));
+ emit_insn (gen_rtx_SET (VOIDmode, sub,
+ gen_rtx_NOT (mode, source)));
source = sub;
if (subtargets)
sub = gen_reg_rtx (mode);
- emit_insn (gen_rtx (SET, VOIDmode, sub,
- gen_rtx (AND, mode, source,
- GEN_INT (temp1))));
- emit_insn (gen_rtx (SET, VOIDmode, target,
- gen_rtx (NOT, mode, sub)));
+ emit_insn (gen_rtx_SET (VOIDmode, sub,
+ gen_rtx_AND (mode, source,
+ GEN_INT (temp1))));
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_NOT (mode, sub)));
}
return 3;
}
@@ -1006,39 +1011,40 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (code == SET)
{
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode,
- new_src = (subtargets
- ? gen_reg_rtx (mode)
- : target),
- GEN_INT (can_invert ? ~temp1 : temp1)));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ new_src = (subtargets
+ ? gen_reg_rtx (mode)
+ : target),
+ GEN_INT (can_invert
+ ? ~temp1 : temp1)));
can_invert = 0;
code = PLUS;
}
else if (code == MINUS)
{
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode,
- new_src = (subtargets
- ? gen_reg_rtx (mode)
- : target),
- gen_rtx (code, mode, GEN_INT (temp1),
- source)));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ new_src = (subtargets
+ ? gen_reg_rtx (mode)
+ : target),
+ gen_rtx (code, mode, GEN_INT (temp1),
+ source)));
code = PLUS;
}
else
{
if (generate)
- emit_insn (gen_rtx (SET, VOIDmode,
- new_src = (remainder
- ? (subtargets
- ? gen_reg_rtx (mode)
- : target)
- : target),
- gen_rtx (code, mode, source,
- GEN_INT (can_invert ? ~temp1
- : (can_negate
- ? -temp1
- : temp1)))));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ new_src = (remainder
+ ? (subtargets
+ ? gen_reg_rtx (mode)
+ : target)
+ : target),
+ gen_rtx (code, mode, source,
+ GEN_INT (can_invert ? ~temp1
+ : (can_negate
+ ? -temp1
+ : temp1)))));
}
insns++;
@@ -1204,16 +1210,17 @@ legitimize_pic_address (orig, mode, reg)
emit_insn (gen_pic_load_addr (address, orig));
- pic_ref = gen_rtx (MEM, Pmode,
- gen_rtx (PLUS, Pmode, pic_offset_table_rtx, address));
+ pic_ref = gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode, pic_offset_table_rtx,
+ address));
RTX_UNCHANGING_P (pic_ref) = 1;
insn = emit_move_insn (reg, pic_ref);
#endif
current_function_uses_pic_offset_table = 1;
/* 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));
return reg;
}
else if (GET_CODE (orig) == CONST)
@@ -1265,7 +1272,7 @@ legitimize_pic_address (orig, mode, reg)
return reg;
}
- return gen_rtx (PLUS, Pmode, base, offset);
+ return gen_rtx_PLUS (Pmode, base, offset);
}
else if (GET_CODE (orig) == LABEL_REF)
current_function_uses_pic_offset_table = 1;
@@ -1300,20 +1307,15 @@ arm_finalize_pic ()
start_sequence ();
l1 = gen_label_rtx ();
- global_offset_table = gen_rtx (SYMBOL_REF, Pmode, "_GLOBAL_OFFSET_TABLE_");
+ global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
/* The PC contains 'dot'+8, but the label L1 is on the next
instruction, so the offset is only 'dot'+4. */
- pic_tmp = gen_rtx (CONST, VOIDmode,
- gen_rtx (PLUS, Pmode,
- gen_rtx (LABEL_REF, VOIDmode, l1),
- GEN_INT (4)));
- pic_tmp2 = gen_rtx (CONST, VOIDmode,
- gen_rtx (PLUS, Pmode,
- global_offset_table,
- pc_rtx));
-
- pic_rtx = gen_rtx (CONST, Pmode,
- gen_rtx (MINUS, Pmode, pic_tmp2, pic_tmp));
+ pic_tmp = plus_constant (gen_rtx_LABEL_REF (Pmode, l1),
+ GEN_INT (4));
+ pic_tmp2 = gen_rtx_CONST (VOIDmode,
+ gen_rtx_PLUS (Pmode, global_offset_table, pc_rtx));
+
+ pic_rtx = gen_rtx_CONST (Pmode, gen_rtx_MINUS (Pmode, pic_tmp2, pic_tmp));
emit_insn (gen_pic_load_addr (pic_offset_table_rtx, pic_rtx));
emit_jump_insn (gen_pic_add_dot_plus_eight(l1, pic_offset_table_rtx));
@@ -1325,7 +1327,7 @@ arm_finalize_pic ()
/* Need to emit this whether or not we obey regdecls,
since setjmp/longjmp can cause life info to screw up. */
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
#endif /* AOF_ASSEMBLER */
}
@@ -2804,30 +2806,29 @@ arm_gen_load_multiple (base_regno, count, from, up, write_back, unchanging_p,
int sign = up ? 1 : -1;
rtx mem;
- result = gen_rtx (PARALLEL, VOIDmode,
- rtvec_alloc (count + (write_back ? 2 : 0)));
+ result = gen_rtx_PARALLEL (VOIDmode,
+ rtvec_alloc (count + (write_back ? 2 : 0)));
if (write_back)
{
XVECEXP (result, 0, 0)
- = gen_rtx (SET, GET_MODE (from), from,
- plus_constant (from, count * 4 * sign));
+ = gen_rtx_SET (GET_MODE (from), from,
+ plus_constant (from, count * 4 * sign));
i = 1;
count++;
}
for (j = 0; i < count; i++, j++)
{
- mem = gen_rtx (MEM, SImode, plus_constant (from, j * 4 * sign));
+ mem = gen_rtx_MEM (SImode, plus_constant (from, j * 4 * sign));
RTX_UNCHANGING_P (mem) = unchanging_p;
MEM_IN_STRUCT_P (mem) = in_struct_p;
- XVECEXP (result, 0, i) = gen_rtx (SET, VOIDmode,
- gen_rtx (REG, SImode, base_regno + j),
- mem);
+ XVECEXP (result, 0, i)
+ = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, base_regno + j), mem);
}
if (write_back)
- XVECEXP (result, 0, i) = gen_rtx (CLOBBER, SImode, from);
+ XVECEXP (result, 0, i) = gen_rtx_CLOBBER (SImode, from);
return result;
}
@@ -2848,29 +2849,29 @@ arm_gen_store_multiple (base_regno, count, to, up, write_back, unchanging_p,
int sign = up ? 1 : -1;
rtx mem;
- result = gen_rtx (PARALLEL, VOIDmode,
- rtvec_alloc (count + (write_back ? 2 : 0)));
+ result = gen_rtx_PARALLEL (VOIDmode,
+ rtvec_alloc (count + (write_back ? 2 : 0)));
if (write_back)
{
XVECEXP (result, 0, 0)
- = gen_rtx (SET, GET_MODE (to), to,
- plus_constant (to, count * 4 * sign));
+ = gen_rtx_SET (GET_MODE (to), to,
+ plus_constant (to, count * 4 * sign));
i = 1;
count++;
}
for (j = 0; i < count; i++, j++)
{
- mem = gen_rtx (MEM, SImode, plus_constant (to, j * 4 * sign));
+ mem = gen_rtx_MEM (SImode, plus_constant (to, j * 4 * sign));
RTX_UNCHANGING_P (mem) = unchanging_p;
MEM_IN_STRUCT_P (mem) = in_struct_p;
- XVECEXP (result, 0, i) = gen_rtx (SET, VOIDmode, mem,
- gen_rtx (REG, SImode, base_regno + j));
+ XVECEXP (result, 0, i)
+ = gen_rtx_SET (VOIDmode, mem, gen_rtx_REG (SImode, base_regno + j));
}
if (write_back)
- XVECEXP (result, 0, i) = gen_rtx (CLOBBER, SImode, to);
+ XVECEXP (result, 0, i) = gen_rtx_CLOBBER (SImode, to);
return result;
}
@@ -2910,7 +2911,7 @@ arm_gen_movstrqi (operands)
last_bytes = INTVAL (operands[2]) & 3;
if (out_words_to_go != in_words_to_go && ((in_words_to_go - 1) & 3) != 0)
- part_bytes_reg = gen_rtx (REG, SImode, (in_words_to_go - 1) & 3);
+ part_bytes_reg = gen_rtx_REG (SImode, (in_words_to_go - 1) & 3);
for (i = 0; in_words_to_go >= 2; i+=4)
{
@@ -2937,10 +2938,10 @@ arm_gen_movstrqi (operands)
dst_in_struct_p));
else
{
- mem = gen_rtx (MEM, SImode, dst);
+ mem = gen_rtx_MEM (SImode, dst);
RTX_UNCHANGING_P (mem) = dst_unchanging_p;
MEM_IN_STRUCT_P (mem) = dst_in_struct_p;
- emit_move_insn (mem, gen_rtx (REG, SImode, 0));
+ emit_move_insn (mem, gen_rtx_REG (SImode, 0));
if (last_bytes != 0)
emit_insn (gen_addsi3 (dst, dst, GEN_INT (4)));
}
@@ -2955,13 +2956,13 @@ arm_gen_movstrqi (operands)
{
rtx sreg;
- mem = gen_rtx (MEM, SImode, src);
+ mem = gen_rtx_MEM (SImode, src);
RTX_UNCHANGING_P (mem) = src_unchanging_p;
MEM_IN_STRUCT_P (mem) = src_in_struct_p;
emit_move_insn (sreg = gen_reg_rtx (SImode), mem);
emit_move_insn (fin_src = gen_reg_rtx (SImode), plus_constant (src, 4));
- mem = gen_rtx (MEM, SImode, dst);
+ mem = gen_rtx_MEM (SImode, dst);
RTX_UNCHANGING_P (mem) = dst_unchanging_p;
MEM_IN_STRUCT_P (mem) = dst_in_struct_p;
emit_move_insn (mem, sreg);
@@ -2977,7 +2978,7 @@ arm_gen_movstrqi (operands)
if (in_words_to_go < 0)
abort ();
- mem = gen_rtx (MEM, SImode, src);
+ mem = gen_rtx_MEM (SImode, src);
RTX_UNCHANGING_P (mem) = src_unchanging_p;
MEM_IN_STRUCT_P (mem) = src_in_struct_p;
part_bytes_reg = copy_to_mode_reg (SImode, mem);
@@ -2997,10 +2998,10 @@ arm_gen_movstrqi (operands)
while (last_bytes)
{
- mem = gen_rtx (MEM, QImode, plus_constant (dst, last_bytes - 1));
+ mem = gen_rtx_MEM (QImode, plus_constant (dst, last_bytes - 1));
RTX_UNCHANGING_P (mem) = dst_unchanging_p;
MEM_IN_STRUCT_P (mem) = dst_in_struct_p;
- emit_move_insn (mem, gen_rtx (SUBREG, QImode, part_bytes_reg, 0));
+ emit_move_insn (mem, gen_rtx_SUBREG (QImode, part_bytes_reg, 0));
if (--last_bytes)
{
tmp = gen_reg_rtx (SImode);
@@ -3017,10 +3018,10 @@ arm_gen_movstrqi (operands)
if (part_bytes_reg == NULL)
abort ();
- mem = gen_rtx (MEM, QImode, dst);
+ mem = gen_rtx_MEM (QImode, dst);
RTX_UNCHANGING_P (mem) = dst_unchanging_p;
MEM_IN_STRUCT_P (mem) = dst_in_struct_p;
- emit_move_insn (mem, gen_rtx (SUBREG, QImode, part_bytes_reg, 0));
+ emit_move_insn (mem, gen_rtx_SUBREG (QImode, part_bytes_reg, 0));
if (--last_bytes)
{
rtx tmp = gen_reg_rtx (SImode);
@@ -3056,12 +3057,12 @@ gen_rotated_half_load (memref)
&& ((BYTES_BIG_ENDIAN ? 1 : 0) ^ ((offset & 2) == 0)))
return NULL;
- base = gen_rtx (MEM, SImode, plus_constant (base, offset & ~2));
+ base = gen_rtx_MEM (SImode, plus_constant (base, offset & ~2));
if ((BYTES_BIG_ENDIAN ? 1 : 0) ^ ((offset & 2) == 2))
return base;
- return gen_rtx (ROTATE, SImode, base, GEN_INT (16));
+ return gen_rtx_ROTATE (SImode, base, GEN_INT (16));
}
static enum machine_mode
@@ -3256,10 +3257,10 @@ gen_compare_reg (code, x, y, fp)
rtx x, y;
{
enum machine_mode mode = SELECT_CC_MODE (code, x, y);
- rtx cc_reg = gen_rtx (REG, mode, 24);
+ rtx cc_reg = gen_rtx_REG (mode, 24);
- 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;
}
@@ -3270,37 +3271,35 @@ arm_reload_in_hi (operands)
{
rtx base = find_replacement (&XEXP (operands[1], 0));
- emit_insn (gen_zero_extendqisi2 (operands[2], gen_rtx (MEM, QImode, base)));
+ emit_insn (gen_zero_extendqisi2 (operands[2], gen_rtx_MEM (QImode, base)));
/* Handle the case where the address is too complex to be offset by 1. */
if (GET_CODE (base) == MINUS
|| (GET_CODE (base) == PLUS && GET_CODE (XEXP (base, 1)) != CONST_INT))
{
- rtx base_plus = gen_rtx (REG, SImode, REGNO (operands[0]));
+ rtx base_plus = gen_rtx_REG (SImode, REGNO (operands[0]));
- emit_insn (gen_rtx (SET, VOIDmode, base_plus, base));
+ emit_insn (gen_rtx_SET (VOIDmode, base_plus, base));
base = base_plus;
}
- emit_insn (gen_zero_extendqisi2 (gen_rtx (SUBREG, SImode, operands[0], 0),
- gen_rtx (MEM, QImode,
- plus_constant (base, 1))));
+ emit_insn (gen_zero_extendqisi2 (gen_rtx_SUBREG (SImode, operands[0], 0),
+ gen_rtx_MEM (QImode,
+ plus_constant (base, 1))));
if (BYTES_BIG_ENDIAN)
- emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (SUBREG, SImode,
- operands[0], 0),
- gen_rtx (IOR, SImode,
- gen_rtx (ASHIFT, SImode,
- gen_rtx (SUBREG, SImode,
- operands[0], 0),
- GEN_INT (8)),
- operands[2])));
+ emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_SUBREG (SImode, operands[0], 0),
+ gen_rtx_IOR (SImode,
+ gen_rtx_ASHIFT
+ (SImode,
+ gen_rtx_SUBREG (SImode, operands[0], 0),
+ GEN_INT (8)),
+ operands[2])));
else
- emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (SUBREG, SImode,
- operands[0], 0),
- gen_rtx (IOR, SImode,
- gen_rtx (ASHIFT, SImode,
- operands[2],
- GEN_INT (8)),
- gen_rtx (SUBREG, SImode, operands[0], 0))));
+ emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_SUBREG (SImode, operands[0], 0),
+ gen_rtx_IOR (SImode,
+ gen_rtx_ASHIFT (SImode, operands[2],
+ GEN_INT (8)),
+ gen_rtx_SUBREG (SImode, operands[0],
+ 0))));
}
void
@@ -3311,23 +3310,23 @@ arm_reload_out_hi (operands)
if (BYTES_BIG_ENDIAN)
{
- emit_insn (gen_movqi (gen_rtx (MEM, QImode, plus_constant (base, 1)),
- gen_rtx (SUBREG, QImode, operands[1], 0)));
+ emit_insn (gen_movqi (gen_rtx_MEM (QImode, plus_constant (base, 1)),
+ gen_rtx_SUBREG (QImode, operands[1], 0)));
emit_insn (gen_lshrsi3 (operands[2],
- gen_rtx (SUBREG, SImode, operands[1], 0),
+ gen_rtx_SUBREG (SImode, operands[1], 0),
GEN_INT (8)));
- emit_insn (gen_movqi (gen_rtx (MEM, QImode, base),
- gen_rtx (SUBREG, QImode, operands[2], 0)));
+ emit_insn (gen_movqi (gen_rtx_MEM (QImode, base),
+ gen_rtx_SUBREG (QImode, operands[2], 0)));
}
else
{
- emit_insn (gen_movqi (gen_rtx (MEM, QImode, base),
- gen_rtx (SUBREG, QImode, operands[1], 0)));
+ emit_insn (gen_movqi (gen_rtx_MEM (QImode, base),
+ gen_rtx_SUBREG (QImode, operands[1], 0)));
emit_insn (gen_lshrsi3 (operands[2],
- gen_rtx (SUBREG, SImode, operands[1], 0),
+ gen_rtx_SUBREG (SImode, operands[1], 0),
GEN_INT (8)));
- emit_insn (gen_movqi (gen_rtx (MEM, QImode, plus_constant (base, 1)),
- gen_rtx (SUBREG, QImode, operands[2], 0)));
+ emit_insn (gen_movqi (gen_rtx_MEM (QImode, plus_constant (base, 1)),
+ gen_rtx_SUBREG (QImode, operands[2], 0)));
}
}
@@ -3680,8 +3679,8 @@ arm_reorg (first)
}
offset = add_constant (src, mode);
- addr = plus_constant (gen_rtx (LABEL_REF, VOIDmode,
- pool_vector_label),
+ addr = plus_constant (gen_rtx_LABEL_REF (VOIDmode,
+ pool_vector_label),
offset);
/* For wide moves to integer regs we need to split the
@@ -3693,20 +3692,20 @@ arm_reorg (first)
if (GET_MODE_SIZE (mode) > 4
&& (scratch = REGNO (dst)) < 16)
{
- rtx reg = gen_rtx (REG, SImode, scratch);
+ rtx reg = gen_rtx_REG (SImode, scratch);
newinsn = emit_insn_after (gen_movaddr (reg, addr),
newinsn);
addr = reg;
}
- newsrc = gen_rtx (MEM, mode, addr);
+ newsrc = gen_rtx_MEM (mode, addr);
/* Build a jump insn wrapper around the move instead
of an ordinary insn, because we want to have room for
the target label rtx in fld[7], which an ordinary
insn doesn't have. */
- newinsn = emit_jump_insn_after (gen_rtx (SET, VOIDmode,
- dst, newsrc),
+ newinsn = emit_jump_insn_after (gen_rtx_SET (VOIDmode,
+ dst, newsrc),
newinsn);
JUMP_LABEL (newinsn) = pool_vector_label;
@@ -3804,7 +3803,7 @@ output_call (operands)
if (REGNO (operands[0]) == 14)
{
- operands[0] = gen_rtx (REG, SImode, 12);
+ operands[0] = gen_rtx_REG (SImode, 12);
output_asm_insn ("mov%?\t%0, %|lr", operands);
}
output_asm_insn ("mov%?\t%|lr, %|pc", operands);
@@ -3827,7 +3826,7 @@ eliminate_lr2ip (x)
case REG:
if (REGNO (x0) == 14)
{
- *x = gen_rtx (REG, SImode, 12);
+ *x = gen_rtx_REG (SImode, 12);
return 1;
}
return 0;
@@ -3876,9 +3875,9 @@ output_mov_long_double_fpu_from_arm (operands)
if (arm_reg0 == 12)
abort();
- ops[0] = gen_rtx (REG, SImode, arm_reg0);
- ops[1] = gen_rtx (REG, SImode, 1 + arm_reg0);
- ops[2] = gen_rtx (REG, SImode, 2 + arm_reg0);
+ ops[0] = gen_rtx_REG (SImode, arm_reg0);
+ ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0);
+ ops[2] = gen_rtx_REG (SImode, 2 + arm_reg0);
output_asm_insn ("stm%?fd\t%|sp!, {%0, %1, %2}", ops);
output_asm_insn ("ldf%?e\t%0, [%|sp], #12", operands);
@@ -3899,9 +3898,9 @@ output_mov_long_double_arm_from_fpu (operands)
if (arm_reg0 == 12)
abort();
- ops[0] = gen_rtx (REG, SImode, arm_reg0);
- ops[1] = gen_rtx (REG, SImode, 1 + arm_reg0);
- ops[2] = gen_rtx (REG, SImode, 2 + arm_reg0);
+ ops[0] = gen_rtx_REG (SImode, arm_reg0);
+ ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0);
+ ops[2] = gen_rtx_REG (SImode, 2 + arm_reg0);
output_asm_insn ("stf%?e\t%1, [%|sp, #-12]!", operands);
output_asm_insn ("ldm%?fd\t%|sp!, {%0, %1, %2}", ops);
@@ -3925,8 +3924,8 @@ output_mov_long_double_arm_from_arm (operands)
{
for (i = 0; i < 3; i++)
{
- ops[0] = gen_rtx (REG, SImode, dest_start + i);
- ops[1] = gen_rtx (REG, SImode, src_start + i);
+ ops[0] = gen_rtx_REG (SImode, dest_start + i);
+ ops[1] = gen_rtx_REG (SImode, src_start + i);
output_asm_insn ("mov%?\t%0, %1", ops);
}
}
@@ -3934,8 +3933,8 @@ output_mov_long_double_arm_from_arm (operands)
{
for (i = 2; i >= 0; i--)
{
- ops[0] = gen_rtx (REG, SImode, dest_start + i);
- ops[1] = gen_rtx (REG, SImode, src_start + i);
+ ops[0] = gen_rtx_REG (SImode, dest_start + i);
+ ops[1] = gen_rtx_REG (SImode, src_start + i);
output_asm_insn ("mov%?\t%0, %1", ops);
}
}
@@ -3957,8 +3956,8 @@ output_mov_double_fpu_from_arm (operands)
if (arm_reg0 == 12)
abort();
- ops[0] = gen_rtx (REG, SImode, arm_reg0);
- ops[1] = gen_rtx (REG, SImode, 1 + arm_reg0);
+ ops[0] = gen_rtx_REG (SImode, arm_reg0);
+ ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0);
output_asm_insn ("stm%?fd\t%|sp!, {%0, %1}", ops);
output_asm_insn ("ldf%?d\t%0, [%|sp], #8", operands);
return "";
@@ -3978,8 +3977,8 @@ output_mov_double_arm_from_fpu (operands)
if (arm_reg0 == 12)
abort();
- ops[0] = gen_rtx (REG, SImode, arm_reg0);
- ops[1] = gen_rtx (REG, SImode, 1 + arm_reg0);
+ ops[0] = gen_rtx_REG (SImode, arm_reg0);
+ ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0);
output_asm_insn ("stf%?d\t%1, [%|sp, #-8]!", operands);
output_asm_insn ("ldm%?fd\t%|sp!, {%0, %1}", ops);
return "";
@@ -4001,7 +4000,7 @@ output_move_double (operands)
{
int reg0 = REGNO (operands[0]);
- otherops[0] = gen_rtx (REG, SImode, 1 + reg0);
+ otherops[0] = gen_rtx_REG (SImode, 1 + reg0);
if (code1 == REG)
{
int reg1 = REGNO (operands[1]);
@@ -4206,7 +4205,7 @@ output_move_double (operands)
default:
otherops[0] = adj_offsettable_operand (operands[0], 4);
- otherops[1] = gen_rtx (REG, SImode, 1 + REGNO (operands[1]));
+ otherops[1] = gen_rtx_REG (SImode, 1 + REGNO (operands[1]));
output_asm_insn ("str%?\t%1, %0", operands);
output_asm_insn ("str%?\t%1, %0", otherops);
}
@@ -4677,7 +4676,7 @@ output_return_instruction (operand, really_return, reverse)
/* Otherwise, trap an attempted return by aborting. */
ops[0] = operand;
- ops[1] = gen_rtx (SYMBOL_REF, Pmode, "abort");
+ ops[1] = gen_rtx_SYMBOL_REF (Pmode, "abort");
assemble_external_libcall (ops[1]);
output_asm_insn (reverse ? "bl%D0\t%a1" : "bl%d0\t%a1", ops);
return "";
@@ -4872,7 +4871,7 @@ output_func_epilogue (f, frame_size)
/* A volatile function should never return. Call abort. */
if (volatile_func)
{
- rtx op = gen_rtx (SYMBOL_REF, Pmode, "abort");
+ rtx op = gen_rtx_SYMBOL_REF (Pmode, "abort");
assemble_external_libcall (op);
output_asm_insn ("bl\t%a0", &op);
goto epilogue_done;
@@ -5032,8 +5031,7 @@ output_func_epilogue (f, frame_size)
{
/* Unwind the pre-pushed regs */
operands[0] = operands[1] = stack_pointer_rtx;
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- current_function_pretend_args_size);
+ operands[2] = GEN_INT (current_function_pretend_args_size);
output_add_immediate (operands);
}
/* And finally, go home */
@@ -5066,19 +5064,21 @@ emit_multi_reg_push (mask)
if (num_regs == 0 || num_regs > 16)
abort ();
- par = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (num_regs));
+ par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (num_regs));
for (i = 0; i < 16; i++)
{
if (mask & (1 << i))
{
XVECEXP (par, 0, 0)
- = gen_rtx (SET, VOIDmode, gen_rtx (MEM, BLKmode,
- gen_rtx (PRE_DEC, BLKmode,
- stack_pointer_rtx)),
- gen_rtx (UNSPEC, BLKmode,
- gen_rtvec (1, gen_rtx (REG, SImode, i)),
- 2));
+ = gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (BLKmode,
+ gen_rtx_PRE_DEC (BLKmode,
+ stack_pointer_rtx)),
+ gen_rtx_UNSPEC (BLKmode,
+ gen_rtvec (1,
+ gen_rtx_REG (SImode, i)),
+ 2));
break;
}
}
@@ -5088,7 +5088,7 @@ emit_multi_reg_push (mask)
if (mask & (1 << i))
{
XVECEXP (par, 0, j)
- = gen_rtx (USE, VOIDmode, gen_rtx (REG, SImode, i));
+ = gen_rtx_USE (VOIDmode, gen_rtx_REG (SImode, i));
j++;
}
}
@@ -5104,19 +5104,20 @@ emit_sfm (base_reg, count)
rtx par;
int i;
- par = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (count));
+ par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
+
+ XVECEXP (par, 0, 0)
+ = gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (BLKmode,
+ gen_rtx_PRE_DEC (BLKmode, stack_pointer_rtx)),
+ gen_rtx_UNSPEC (BLKmode,
+ gen_rtvec (1, gen_rtx_REG (XFmode,
+ base_reg++)),
+ 2));
- XVECEXP (par, 0, 0) = gen_rtx (SET, VOIDmode,
- gen_rtx (MEM, BLKmode,
- gen_rtx (PRE_DEC, BLKmode,
- stack_pointer_rtx)),
- gen_rtx (UNSPEC, BLKmode,
- gen_rtvec (1, gen_rtx (REG, XFmode,
- base_reg++)),
- 2));
for (i = 1; i < count; i++)
- XVECEXP (par, 0, i) = gen_rtx (USE, VOIDmode,
- gen_rtx (REG, XFmode, base_reg++));
+ XVECEXP (par, 0, i) = gen_rtx_USE (VOIDmode,
+ gen_rtx_REG (XFmode, base_reg++));
emit_insn (par);
}
@@ -5152,7 +5153,7 @@ arm_expand_prologue ()
if (frame_pointer_needed)
{
live_regs_mask |= 0xD800;
- emit_insn (gen_movsi (gen_rtx (REG, SImode, 12),
+ emit_insn (gen_movsi (gen_rtx_REG (SImode, 12),
stack_pointer_rtx));
}
@@ -5182,11 +5183,12 @@ arm_expand_prologue ()
{
for (reg = 23; reg > 15; reg--)
if (regs_ever_live[reg] && ! call_used_regs[reg])
- emit_insn (gen_rtx (SET, VOIDmode,
- gen_rtx (MEM, XFmode,
- gen_rtx (PRE_DEC, XFmode,
- stack_pointer_rtx)),
- gen_rtx (REG, XFmode, reg)));
+ emit_insn (gen_rtx_SET
+ (VOIDmode,
+ gen_rtx_MEM (XFmode,
+ gen_rtx_PRE_DEC (XFmode,
+ stack_pointer_rtx)),
+ gen_rtx_REG (XFmode, reg)));
}
else
{
@@ -5216,15 +5218,15 @@ arm_expand_prologue ()
}
if (frame_pointer_needed)
- emit_insn (gen_addsi3 (hard_frame_pointer_rtx, gen_rtx (REG, SImode, 12),
+ emit_insn (gen_addsi3 (hard_frame_pointer_rtx, gen_rtx_REG (SImode, 12),
(GEN_INT
(-(4 + current_function_pretend_args_size)))));
if (amount != const0_rtx)
{
emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, amount));
- emit_insn (gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (MEM, BLKmode, stack_pointer_rtx)));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_MEM (BLKmode, stack_pointer_rtx)));
}
/* If we are profiling, make sure no instructions are scheduled before
@@ -5891,7 +5893,7 @@ aof_pic_entry (x)
{
/* This needs to persist throughout the compilation. */
end_temporary_allocation ();
- aof_pic_label = gen_rtx (SYMBOL_REF, Pmode, "x$adcons");
+ aof_pic_label = gen_rtx_SYMBOL_REF (Pmode, "x$adcons");
resume_temporary_allocation ();
}
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index bb756809ba8..542d6049e42 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -938,15 +938,15 @@ enum reg_class
otherwise, FUNC is 0. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
(GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_FLOAT && TARGET_HARD_FLOAT \
- ? 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. */
#define LIBCALL_VALUE(MODE) \
(GET_MODE_CLASS (MODE) == MODE_FLOAT && TARGET_HARD_FLOAT \
- ? 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 ARM, only r0 and f0 can return results. */
@@ -985,7 +985,7 @@ enum reg_class
stack if necessary). */
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
((NAMED) \
- ? ((CUM) >= 16 ? 0 : gen_rtx (REG, MODE, (CUM) / 4)) \
+ ? ((CUM) >= 16 ? 0 : gen_rtx_REG (MODE, (CUM) / 4)) \
: 0)
/* For an arg passed partly in registers and partly in memory,
@@ -1178,9 +1178,9 @@ enum reg_class
CXT is an RTX for the static chain value for the function. */
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \
- 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)); \
}
@@ -1476,14 +1476,14 @@ extern struct rtx_def *legitimize_pic_address ();
n -= low_n; \
} \
base_reg = gen_reg_rtx (SImode); \
- val = force_operand (gen_rtx (PLUS, SImode, xop0, \
- GEN_INT (n)), NULL_RTX); \
+ val = force_operand (gen_rtx_PLUS (SImode, xop0, \
+ GEN_INT (n)), NULL_RTX); \
emit_move_insn (base_reg, val); \
(X) = (low_n == 0 ? base_reg \
- : gen_rtx (PLUS, SImode, base_reg, GEN_INT (low_n))); \
+ : gen_rtx_PLUS (SImode, base_reg, GEN_INT (low_n))); \
} \
else if (xop0 != XEXP (X, 0) || xop1 != XEXP (x, 1)) \
- (X) = gen_rtx (PLUS, SImode, xop0, xop1); \
+ (X) = gen_rtx_PLUS (SImode, xop0, xop1); \
} \
else if (GET_CODE (X) == MINUS) \
{ \
@@ -1495,7 +1495,7 @@ extern struct rtx_def *legitimize_pic_address ();
if (CONSTANT_P (xop1) && ! symbol_mentioned_p (xop1)) \
xop1 = force_reg (SImode, xop1); \
if (xop0 != XEXP (X, 0) || xop1 != XEXP (X, 1)) \
- (X) = gen_rtx (MINUS, SImode, xop0, xop1); \
+ (X) = gen_rtx_MINUS (SImode, xop0, xop1); \
} \
if (flag_pic) \
(X) = legitimize_pic_address (OLDX, MODE, NULL_RTX); \
@@ -1939,7 +1939,7 @@ do { \
#define RETURN_ADDR_RTX(COUNT, FRAME) \
((COUNT == 0) \
- ? gen_rtx (MEM, Pmode, plus_constant (FRAME, -4)) \
+ ? gen_rtx_MEM (Pmode, plus_constant (FRAME, -4)) \
: NULL_RTX)
/* Used to mask out junk bits from the return address, such as
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index ee4a9086ed7..3ec838b30ca 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -1251,8 +1251,8 @@
emit_insn (gen_ashlsi3 (op0, operands[3],
GEN_INT (32 - INTVAL (operands[1]))));
- emit_insn (gen_iorsi3 (op1, gen_rtx (LSHIFTRT, SImode, operands[0],
- operands[1]),
+ emit_insn (gen_iorsi3 (op1, gen_rtx_LSHIFTRT (SImode, operands[0],
+ operands[1]),
op0));
emit_insn (gen_rotlsi3 (subtarget, op1, operands[1]));
}
@@ -1269,8 +1269,8 @@
GEN_INT (32 - INTVAL (operands[1]))));
emit_insn (gen_ashlsi3 (op1, operands[0], operands[1]));
emit_insn (gen_iorsi3 (subtarget,
- gen_rtx (LSHIFTRT, SImode, op1,
- operands[1]), op0));
+ gen_rtx_LSHIFTRT (SImode, op1, operands[1]),
+ op0));
}
else
{
@@ -1306,12 +1306,12 @@
}
if (INTVAL (operands[2]) != 0)
- op0 = gen_rtx (ASHIFT, SImode, op0, operands[2]);
+ op0 = gen_rtx_ASHIFT (SImode, op0, operands[2]);
emit_insn (gen_andsi_notsi_si (op2, operands[0], op0));
}
if (INTVAL (operands[2]) != 0)
- op1 = gen_rtx (ASHIFT, SImode, op1, operands[2]);
+ op1 = gen_rtx_ASHIFT (SImode, op1, operands[2]);
emit_insn (gen_iorsi3 (subtarget, op1, op2));
}
@@ -2139,8 +2139,8 @@
{
if (arm_arch4 && GET_CODE (operands[1]) == MEM)
{
- 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;
}
if (TARGET_SHORT_BY_BYTES && GET_CODE (operands[1]) == MEM)
@@ -2241,8 +2241,8 @@
{
if (arm_arch4 && GET_CODE (operands[1]) == MEM)
{
- emit_insn (gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (SIGN_EXTEND, SImode, operands[1])));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_SIGN_EXTEND (SImode, operands[1])));
DONE;
}
@@ -2333,8 +2333,8 @@
{
if (arm_arch4 && GET_CODE (operands[1]) == MEM)
{
- emit_insn (gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (SIGN_EXTEND, HImode, operands[1])));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_SIGN_EXTEND (HImode, operands[1])));
DONE;
}
if (! s_register_operand (operands[1], QImode))
@@ -2363,8 +2363,8 @@
{
if (arm_arch4 && GET_CODE (operands[1]) == MEM)
{
- emit_insn (gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (SIGN_EXTEND, SImode, operands[1])));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_SIGN_EXTEND (SImode, operands[1])));
DONE;
}
if (! s_register_operand (operands[1], QImode))
@@ -2755,7 +2755,7 @@
}
emit_insn (gen_movsi (reg, GEN_INT (val)));
- operands[1] = gen_rtx (SUBREG, HImode, reg, 0);
+ operands[1] = gen_rtx_SUBREG (HImode, reg, 0);
}
else if (! arm_arch4)
{
@@ -2775,8 +2775,11 @@
{
HOST_WIDE_INT new_offset = INTVAL (offset) & ~2;
- emit_insn (gen_movsi (reg, gen_rtx (MEM, SImode,
- plus_constant (base, new_offset))));
+ emit_insn (gen_movsi (reg,
+ gen_rtx_MEM
+ (SImode,
+ plus_constant (base,
+ new_offset))));
if (((INTVAL (offset) & 2) != 0)
^ (BYTES_BIG_ENDIAN ? 1 : 0))
{
@@ -2808,15 +2811,16 @@
if ((INTVAL (offset) & 2) == 2)
{
HOST_WIDE_INT new_offset = INTVAL (offset) ^ 2;
- new_mem = gen_rtx (MEM, SImode,
- plus_constant (base, new_offset));
+ new_mem = gen_rtx_MEM (SImode,
+ plus_constant (base,
+ new_offset));
emit_insn (gen_movsi (reg, new_mem));
}
else
{
- new_mem = gen_rtx (MEM, SImode,
- XEXP (operands[1], 0));
+ new_mem = gen_rtx_MEM (SImode,
+ XEXP (operands[1], 0));
emit_insn (gen_rotated_loadsi (reg, new_mem));
}
@@ -2841,7 +2845,7 @@
if (GET_CODE (operands[0]) != REG)
abort ();
- operands[0] = gen_rtx (SUBREG, SImode, operands[0], 0);
+ operands[0] = gen_rtx_SUBREG (SImode, operands[0], 0);
emit_insn (gen_movsi (operands[0], operands[1]));
DONE;
}
@@ -2858,7 +2862,7 @@
rtx ops[2];
ops[0] = operands[0];
- ops[1] = gen_rtx (MEM, SImode, plus_constant (XEXP (operands[1], 0), 2));
+ ops[1] = gen_rtx_MEM (SImode, plus_constant (XEXP (operands[1], 0), 2));
output_asm_insn (\"ldr%?\\t%0, %1\\t%@ load-rotate\", ops);
return \"\";
}"
@@ -3002,7 +3006,7 @@
rtx reg = gen_reg_rtx (SImode);
emit_insn (gen_movsi (reg, operands[1]));
- operands[1] = gen_rtx (SUBREG, QImode, reg, 0);
+ operands[1] = gen_rtx_SUBREG (QImode, reg, 0);
}
if (GET_CODE (operands[0]) == MEM)
operands[1] = force_reg (QImode, operands[1]);
@@ -3090,8 +3094,8 @@
operands[2] = XEXP (operands[0], 0);
else if (code == POST_INC || code == PRE_DEC)
{
- operands[0] = gen_rtx (SUBREG, DImode, operands[0], 0);
- operands[1] = gen_rtx (SUBREG, DImode, operands[1], 0);
+ operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
+ operands[1] = gen_rtx_SUBREG (DImode, operands[1], 0);
emit_insn (gen_movdi (operands[0], operands[1]));
DONE;
}
@@ -3107,8 +3111,8 @@
emit_insn (gen_addsi3 (operands[2], XEXP (XEXP (operands[0], 0), 0),
XEXP (XEXP (operands[0], 0), 1)));
- emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (MEM, DFmode, operands[2]),
- operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_MEM (DFmode, operands[2]),
+ operands[1]));
if (code == POST_DEC)
emit_insn (gen_addsi3 (operands[2], operands[2], GEN_INT (-8)));
@@ -5992,8 +5996,8 @@
enum machine_mode mode = SELECT_CC_MODE (GET_CODE (operands[1]), operands[2],
operands[3]);
- operands[6] = gen_rtx (REG, mode, 24);
- operands[7] = gen_rtx (COMPARE, mode, operands[2], operands[3]);
+ operands[6] = gen_rtx_REG (mode, 24);
+ operands[7] = gen_rtx_COMPARE (mode, operands[2], operands[3]);
}
")
diff --git a/gcc/config/clipper/clipper.c b/gcc/config/clipper/clipper.c
index f3bae7eead4..d0efbaf2859 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 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1991, 1997, 1998 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"
@@ -42,16 +42,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 */
@@ -69,17 +67,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;
@@ -387,58 +383,45 @@ clipper_builtin_saveregs (arglist)
addr = copy_to_reg (XEXP (block, 0));
- f0_addr = gen_rtx (PLUS, Pmode, addr, gen_rtx (CONST_INT, Pmode, 24));
- f1_addr = gen_rtx (PLUS, Pmode, addr, gen_rtx (CONST_INT, Pmode, 32));
- r0_addr = gen_rtx (PLUS, Pmode, addr, gen_rtx (CONST_INT, Pmode, 40));
- r1_addr = gen_rtx (PLUS, Pmode, addr, gen_rtx (CONST_INT, Pmode, 44));
+ f0_addr = plus_constant (addr, 24);
+ f1_addr = plus_constant (addr, 32);
+ r0_addr = plus_constant (addr, 40);
+ r1_addr = plus_constant (addr, 44);
/* Store float regs */
- emit_move_insn (gen_rtx (MEM, DFmode, f0_addr), gen_rtx (REG, DFmode, 16));
- emit_move_insn (gen_rtx (MEM, DFmode, f1_addr), gen_rtx (REG, DFmode, 17));
+ emit_move_insn (gen_rtx_MEM (DFmode, f0_addr), gen_rtx_REG (DFmode, 16));
+ emit_move_insn (gen_rtx_MEM (DFmode, f1_addr), gen_rtx_REG (DFmode, 17));
/* Store int regs */
- emit_move_insn (gen_rtx (MEM, SImode, r0_addr), gen_rtx (REG, SImode, 0));
- emit_move_insn (gen_rtx (MEM, SImode, r1_addr), gen_rtx (REG, SImode, 1));
+ emit_move_insn (gen_rtx_MEM (SImode, r0_addr), gen_rtx_REG (SImode, 0));
+ emit_move_insn (gen_rtx_MEM (SImode, r1_addr), gen_rtx_REG (SImode, 1));
/* Store the arg pointer in the __va_stk member. */
- emit_move_insn (gen_rtx (MEM, SImode, addr),
+ emit_move_insn (gen_rtx_MEM (SImode, addr),
copy_to_reg (virtual_incoming_args_rtx));
-
/* now move addresses of the saved regs into the pointer array */
scratch = gen_reg_rtx (Pmode);
emit_move_insn (scratch, r0_addr);
- emit_move_insn (gen_rtx (MEM, SImode,
- gen_rtx (PLUS, Pmode, addr,
- gen_rtx (CONST_INT, Pmode, 4))),
- scratch);
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 4)), scratch);
emit_move_insn (scratch, f0_addr);
- emit_move_insn (gen_rtx (MEM, SImode,
- gen_rtx (PLUS, Pmode, addr,
- gen_rtx (CONST_INT, Pmode, 8))),
- scratch);
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 8)), scratch);
emit_move_insn (scratch, r1_addr);
- emit_move_insn (gen_rtx (MEM, SImode,
- gen_rtx (PLUS, Pmode, addr,
- gen_rtx (CONST_INT, Pmode, 12))),
- scratch);
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 12)), scratch);
emit_move_insn (scratch, f1_addr);
- emit_move_insn (gen_rtx (MEM, SImode,
- gen_rtx (PLUS, Pmode, addr,
- gen_rtx (CONST_INT, Pmode, 16))),
- scratch);
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 16)), scratch);
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
{
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
addr, ptr_mode,
diff --git a/gcc/config/clipper/clipper.h b/gcc/config/clipper/clipper.h
index 9600df34177..e0f04bf0817 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-95, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 91, 93-96, 1998 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. */
@@ -814,8 +815,10 @@ do \
in one reasonably fast instruction. */
#define MOVE_MAX 4
-/* MOVE_RATIO is the number of move instructions that is better than a
- block move. Make this large on clipper, since the block move is very
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction pairs, we will do a movstr or libcall instead.
+
+ Make this large on clipper, since the block move is very
inefficient with small blocks, and the hard register needs of the
block move require much reload work. */
diff --git a/gcc/config/clipper/clipper.md b/gcc/config/clipper/clipper.md
index e045ce9acc8..8f694e77a1f 100644
--- a/gcc/config/clipper/clipper.md
+++ b/gcc/config/clipper/clipper.md
@@ -1,5 +1,5 @@
;;- 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, 1998 Free Software Foundation, Inc.
;; Contributed by Holger Teutsch (holger@hotbso.rhein-main.de)
;; This file is part of GNU CC.
@@ -178,7 +178,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 +189,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 +215,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 +317,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 \"\";
}
@@ -340,12 +340,10 @@
abort ();
yoperands[0] = operands[0];
- yoperands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[1]));
+ yoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
output_asm_insn (\"loadi %1,%0\", yoperands);
- xoperands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (operands[1]));
+ xoperands[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
output_asm_insn (\"loadi %1,%0\", xoperands);
return \"\";
}
@@ -368,7 +366,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 \"\";
}"
@@ -698,9 +696,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 \"\";
}"
@@ -735,7 +733,7 @@
val = -val;
xops[0] = operands[0];
- xops[1] = gen_rtx (CONST_INT, VOIDmode, val);
+ xops[1] = GEN_INT (val);
if (val >= 16)
output_asm_insn (\"subi %1,%0\", xops);
@@ -769,9 +767,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 \"\";
}"
@@ -993,7 +991,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 ""
@@ -1020,7 +1018,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 ""
@@ -1090,7 +1088,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 ""
@@ -1117,7 +1115,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 ""
@@ -1148,7 +1146,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 ""
@@ -1175,7 +1173,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 cd2eb55c964..7606becc52d 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, 1993, 1994, 1997, 1998 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"
@@ -359,8 +359,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. */
@@ -397,7 +397,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..a118513fed4 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 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 4a0b34bc622..433891c5fec 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"
@@ -1705,7 +1705,7 @@ rtx *operands;
REAL_VALUE_FROM_CONST_DOUBLE (d, src);
REAL_VALUE_TO_TARGET_SINGLE (d, value);
- operands[1] = gen_rtx (CONST_INT, VOIDmode, value);
+ operands[1] = GEN_INT (value);
output_asm_insn ("%u0=%U1\n\t%w0=%H1", operands);
#else
fatal ("inline float constants not supported on this host");
@@ -1780,10 +1780,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_rtx (CONST_INT, VOIDmode, 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)
@@ -1791,10 +1792,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_rtx (CONST_INT, VOIDmode, 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)
@@ -1802,10 +1804,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_rtx (CONST_INT, VOIDmode, 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)
@@ -1813,10 +1816,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_rtx (CONST_INT, VOIDmode, 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;
}
}
@@ -2070,7 +2074,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;
}
@@ -2120,14 +2124,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");
@@ -2150,54 +2154,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.h b/gcc/config/dsp16xx/dsp16xx.h
index 7ce0c133b86..1666ce5455c 100644
--- a/gcc/config/dsp16xx/dsp16xx.h
+++ b/gcc/config/dsp16xx/dsp16xx.h
@@ -1130,11 +1130,11 @@ extern struct dsp16xx_frame_info current_frame_info;
#define VALUE_REGNO(MODE) (REG_Y)
#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx (REG, TYPE_MODE (VALTYPE), VALUE_REGNO(TYPE_MODE(VALTYPE)))
+ gen_rtx_REG (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. */
-#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, VALUE_REGNO(MODE))
+#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, VALUE_REGNO(MODE))
/* 1 if N is a possible register number for a function value. */
#define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_Y)
diff --git a/gcc/config/dsp16xx/dsp16xx.md b/gcc/config/dsp16xx/dsp16xx.md
index adf1cc7c557..c82285dcee1 100644
--- a/gcc/config/dsp16xx/dsp16xx.md
+++ b/gcc/config/dsp16xx/dsp16xx.md
@@ -195,15 +195,15 @@
{
rtx xoperands[2];
- xoperands[0] = gen_rtx (REG, HImode, REG_A0);
+ xoperands[0] = gen_rtx_REG (HImode, REG_A0);
xoperands[1] = operands[0];
double_reg_from_memory (xoperands);
}
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);
}
@@ -218,7 +218,7 @@
{
rtx xoperands[2];
- xoperands[0] = gen_rtx (REG, HImode, REG_A1);
+ xoperands[0] = gen_rtx_REG (HImode, REG_A1);
xoperands[1] = operands[1];
double_reg_from_memory (xoperands);
}
@@ -302,7 +302,7 @@
"
{
if (!dsp16xx_cmphf3_libcall)
- dsp16xx_cmphf3_libcall = gen_rtx (SYMBOL_REF, Pmode, CMPHF3_LIBCALL);
+ dsp16xx_cmphf3_libcall = gen_rtx_SYMBOL_REF (Pmode, CMPHF3_LIBCALL);
dsp16xx_compare_gen = gen_compare_reg;
dsp16xx_compare_op0 = operands[0];
@@ -426,7 +426,7 @@
"
{
if (!dsp16xx_addhf3_libcall)
- dsp16xx_addhf3_libcall = gen_rtx (SYMBOL_REF, Pmode, ADDHF3_LIBCALL);
+ dsp16xx_addhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, ADDHF3_LIBCALL);
emit_library_call (dsp16xx_addhf3_libcall, 1, HFmode, 2,
operands[1], HFmode,
@@ -506,7 +506,7 @@
"
{
if (!dsp16xx_subhf3_libcall)
- dsp16xx_subhf3_libcall = gen_rtx (SYMBOL_REF, Pmode, SUBHF3_LIBCALL);
+ dsp16xx_subhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, SUBHF3_LIBCALL);
emit_library_call (dsp16xx_subhf3_libcall, 1, HFmode, 2,
operands[1], HFmode,
@@ -529,7 +529,7 @@
"
{
if (!dsp16xx_neghf2_libcall)
- dsp16xx_neghf2_libcall = gen_rtx (SYMBOL_REF, Pmode, NEGHF2_LIBCALL);
+ dsp16xx_neghf2_libcall = gen_rtx_SYMBOL_REF (Pmode, NEGHF2_LIBCALL);
emit_library_call (dsp16xx_neghf2_libcall, 1, HFmode, 1,
operands[1], HFmode);
@@ -553,7 +553,7 @@
"
{
if (!dsp16xx_mulhi3_libcall)
- dsp16xx_mulhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, MULHI3_LIBCALL);
+ dsp16xx_mulhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, MULHI3_LIBCALL);
emit_library_call (dsp16xx_mulhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -595,7 +595,7 @@
"
{
if (!dsp16xx_mulhf3_libcall)
- dsp16xx_mulhf3_libcall = gen_rtx (SYMBOL_REF, Pmode, MULHF3_LIBCALL);
+ dsp16xx_mulhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, MULHF3_LIBCALL);
emit_library_call (dsp16xx_mulhf3_libcall, 1, HFmode, 2,
operands[1], HFmode,
@@ -620,7 +620,7 @@
"
{
if (!dsp16xx_divhi3_libcall)
- dsp16xx_divhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, DIVHI3_LIBCALL);
+ dsp16xx_divhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, DIVHI3_LIBCALL);
emit_library_call (dsp16xx_divhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -637,7 +637,7 @@
"
{
if (!dsp16xx_udivhi3_libcall)
- dsp16xx_udivhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, UDIVHI3_LIBCALL);
+ dsp16xx_udivhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UDIVHI3_LIBCALL);
emit_library_call (dsp16xx_udivhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -654,7 +654,7 @@
"
{
if (!dsp16xx_divqi3_libcall)
- dsp16xx_divqi3_libcall = gen_rtx (SYMBOL_REF, Pmode, DIVQI3_LIBCALL);
+ dsp16xx_divqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, DIVQI3_LIBCALL);
emit_library_call (dsp16xx_divqi3_libcall, 1, QImode, 2,
operands[1], QImode,
@@ -671,7 +671,7 @@
"
{
if (!dsp16xx_udivqi3_libcall)
- dsp16xx_udivqi3_libcall = gen_rtx (SYMBOL_REF, Pmode, UDIVQI3_LIBCALL);
+ dsp16xx_udivqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UDIVQI3_LIBCALL);
emit_library_call (dsp16xx_udivqi3_libcall, 1, QImode, 2,
operands[1], QImode,
@@ -695,7 +695,7 @@
"
{
if (!dsp16xx_modhi3_libcall)
- dsp16xx_modhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, MODHI3_LIBCALL);
+ dsp16xx_modhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, MODHI3_LIBCALL);
emit_library_call (dsp16xx_modhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -712,7 +712,7 @@
"
{
if (!dsp16xx_umodhi3_libcall)
- dsp16xx_umodhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, UMODHI3_LIBCALL);
+ dsp16xx_umodhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UMODHI3_LIBCALL);
emit_library_call (dsp16xx_umodhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -729,7 +729,7 @@
"
{
if (!dsp16xx_modqi3_libcall)
- dsp16xx_modqi3_libcall = gen_rtx (SYMBOL_REF, Pmode, MODQI3_LIBCALL);
+ dsp16xx_modqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, MODQI3_LIBCALL);
emit_library_call (dsp16xx_modqi3_libcall, 1, QImode, 2,
operands[1], QImode,
@@ -746,7 +746,7 @@
"
{
if (!dsp16xx_umodqi3_libcall)
- dsp16xx_umodqi3_libcall = gen_rtx (SYMBOL_REF, Pmode, UMODQI3_LIBCALL);
+ dsp16xx_umodqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UMODQI3_LIBCALL);
emit_library_call (dsp16xx_umodqi3_libcall, 1, QImode, 2,
operands[1], QImode,
@@ -763,7 +763,7 @@
"
{
if (!dsp16xx_divhf3_libcall)
- dsp16xx_divhf3_libcall = gen_rtx (SYMBOL_REF, Pmode, DIVHF3_LIBCALL);
+ dsp16xx_divhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, DIVHF3_LIBCALL);
emit_library_call (dsp16xx_divhf3_libcall, 1, HFmode, 2,
operands[1], HFmode,
@@ -1059,11 +1059,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;
}")
@@ -1261,7 +1263,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"
@@ -1311,7 +1313,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);
}")
@@ -1322,7 +1324,7 @@
"
{
if (!dsp16xx_floathihf2_libcall)
- dsp16xx_floathihf2_libcall = gen_rtx (SYMBOL_REF, Pmode, FLOATHIHF2_LIBCALL);
+ dsp16xx_floathihf2_libcall = gen_rtx_SYMBOL_REF (Pmode, FLOATHIHF2_LIBCALL);
emit_library_call (dsp16xx_floathihf2_libcall, 1, HFmode, 1,
operands[1], HImode);
@@ -1337,7 +1339,7 @@
"
{
if (!dsp16xx_fixhfhi2_libcall)
- dsp16xx_fixhfhi2_libcall = gen_rtx (SYMBOL_REF, Pmode, FIXHFHI2_LIBCALL);
+ dsp16xx_fixhfhi2_libcall = gen_rtx_SYMBOL_REF (Pmode, FIXHFHI2_LIBCALL);
emit_library_call (dsp16xx_fixhfhi2_libcall, 1, HImode, 1,
operands[1], HFmode);
@@ -1367,8 +1369,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);
@@ -1382,7 +1384,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;
}
}")
@@ -1448,7 +1450,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,
@@ -1572,7 +1575,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,
@@ -1714,11 +1718,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
@@ -2038,8 +2042,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 ""
@@ -2069,8 +2073,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 b8818531b84..6485cbbe14c 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 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"
extern char *reg_names[];
diff --git a/gcc/config/elxsi/elxsi.h b/gcc/config/elxsi/elxsi.h
index d0d4c73807d..4b21451f146 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 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. */
@@ -482,11 +482,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 4e8f42086d3..075d38fab5e 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 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"
@@ -152,14 +152,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;
}
@@ -182,14 +182,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 b56834a372c..aa9abf5bf1a 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 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 6862767d764..fff50cd1eb4 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 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).
@@ -244,7 +244,7 @@
&& (unsigned) INTVAL (operands[1]) < 8"
"*
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, 7 - INTVAL (operands[1]));
+ operands[1] = GEN_INT (7 - INTVAL (operands[1]));
return output_btst (operands, operands[1], operands[0], insn, 7);
}")
@@ -260,12 +260,10 @@
{
operands[0] = adj_offsettable_operand (operands[0],
INTVAL (operands[1]) / 8);
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- 7 - INTVAL (operands[1]) % 8);
+ operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8);
return output_btst (operands, operands[1], operands[0], insn, 7);
}
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- 31 - INTVAL (operands[1]));
+ operands[1] = GEN_INT (31 - INTVAL (operands[1]));
return output_btst (operands, operands[1], operands[0], insn, 31);
}")
@@ -417,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. */
@@ -430,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 \"\";
@@ -539,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\";
@@ -551,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\";
@@ -572,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\";
@@ -584,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\";
@@ -951,8 +947,7 @@
if (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) >= -8)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- - INTVAL (operands[2]));
+ operands[2] = GEN_INT (- INTVAL (operands[2]));
return (ADDRESS_REG_P (operands[0])
? \"subq%.w %2,%0\"
: \"subq%.l %2,%0\");
@@ -1343,8 +1338,7 @@
{
if (GET_CODE (operands[0]) != REG)
operands[0] = adj_offsettable_operand (operands[0], 2);
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[2]) & 0xffff);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
/* Do not delete a following tstl %0 insn; that would be incorrect. */
CC_STATUS_INIT;
if (operands[2] == const0_rtx)
@@ -1396,11 +1390,12 @@
|| offsettable_memref_p (operands[0])))
{
if (DATA_REG_P (operands[0]))
- operands[1] = gen_rtx (CONST_INT, VOIDmode, logval);
+ operands[1] = GEN_INT (logval);
else
{
- operands[0] = adj_offsettable_operand (operands[0], 3 - (logval / 8));
- operands[1] = gen_rtx (CONST_INT, VOIDmode, logval % 8);
+ operands[0]
+ = adj_offsettable_operand (operands[0], 3 - (logval / 8));
+ operands[1] = GEN_INT (logval % 8);
}
return \"bset %1,%0\";
}
@@ -1900,11 +1895,8 @@
&& GET_CODE (operands[2]) == CONST_INT)
{
int width = GET_CODE (operands[0]) == REG ? 31 : 7;
- return output_btst (operands,
- gen_rtx (CONST_INT, VOIDmode,
- 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. */
@@ -1927,11 +1919,8 @@
&& GET_CODE (operands[2]) == CONST_INT)
{
int width = GET_CODE (operands[0]) == REG ? 31 : 7;
- return output_btst (operands,
- gen_rtx (CONST_INT, VOIDmode,
- 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. */
@@ -2298,10 +2287,9 @@
table_elt_addr
= memory_address_noforce
(HImode,
- gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode, index_diff,
- gen_rtx (CONST_INT, VOIDmode, 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;
@@ -2404,11 +2392,11 @@
output_asm_insn (\"sub%.l a0,a0\;jbsr %0\", operands);
else
{
- xoperands[1] = gen_rtx (CONST_INT, VOIDmode, size/4);
+ xoperands[1] = GEN_INT (size/4);
output_asm_insn (\"mov%.l sp,a0\;pea %a1\", xoperands);
output_asm_insn (\"jbsr %0\", operands);
size = size + 4;
- xoperands[1] = gen_rtx (CONST_INT, VOIDmode, size);
+ xoperands[1] = GEN_INT (size);
if (size <= 8)
output_asm_insn (\"addq%.l %1,sp\", xoperands);
else if (size < 0x8000)
@@ -2435,11 +2423,11 @@
output_asm_insn(\"sub%.l a0,a0\;jbsr %1\", operands);
else
{
- xoperands[2] = gen_rtx (CONST_INT, VOIDmode, size/4);
+ xoperands[2] = GEN_INT (size/4);
output_asm_insn (\"mov%.l sp,a0\;pea %a2\", xoperands);
output_asm_insn (\"jbsr %1\", operands);
size = size + 4;
- xoperands[2] = gen_rtx (CONST_INT, VOIDmode, size);
+ xoperands[2] = GEN_INT (size);
if (size <= 8)
output_asm_insn (\"addq%.l %2,sp\", xoperands);
else if (size < 0x8000)
@@ -2514,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 2911c9772c8..9dfbb9d25f7 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 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"
@@ -499,14 +497,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;
}
@@ -529,14 +527,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)
@@ -634,18 +632,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[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (operands[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_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[1]));
+ 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 *
@@ -760,7 +754,7 @@ add_imm_word (imm, dest, immp)
if (imm < 0)
{
- *immp = gen_rtx (CONST_INT, VOIDmode, -imm);
+ *immp = GEN_INT (-imm);
return sub_imm_word (-imm, dest);
}
@@ -795,7 +789,7 @@ sub_imm_word (imm, dest, immp)
if (imm < 0 && imm != 0x80000000)
{
- *immp = gen_rtx (CONST_INT, VOIDmode, -imm);
+ *immp = GEN_INT (-imm);
return add_imm_word (-imm, dest);
}
diff --git a/gcc/config/gmicro/gmicro.h b/gcc/config/gmicro/gmicro.h
index 29701f25fd7..77771120e2c 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, 96, 97, 1998 Free Software Foundation, Inc.
Contributed by Masanobu Yuhara, Fujitsu Laboratories LTD.
(yuhara@flab.fujitsu.co.jp)
@@ -478,9 +478,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.
@@ -547,7 +548,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.
@@ -831,25 +832,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 0fc44875b6d..bbe1fbd3129 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 Free Software Foundation, Inc.
;; Contributed by M.Yuhara, Fujitsu Laboratories LTD.
;; This file is part of GNU CC.
@@ -271,7 +271,7 @@
"*
{
register int log = exact_log2 (INTVAL (operands[1]));
- operands[1] = gen_rtx (CONST_INT, VOIDmode, log);
+ operands[1] = GEN_INT (log);
return \"btst %1,%0.b\";
}")
@@ -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
@@ -746,8 +746,7 @@
return \"mov.w @(12,r0),@(12,r1)\";
}
- operands[2] =
- gen_rtx (CONST_INT, VOIDmode, op2const);
+ operands[2] = GEN_INT (op2const);
output_asm_insn (\"mov.w %2,r2\", operands);
return \"smov/n/f.w\";
}
@@ -833,7 +832,7 @@
}
else
{
- xoperands[0] = gen_rtx (CONST_INT, VOIDmode, wlen);
+ xoperands[0] = GEN_INT (wlen);
output_asm_insn (\"mov.w %0,r2\", xoperands);
output_asm_insn (\"smov/n/f.w\", operands);
}
@@ -1517,8 +1516,7 @@
{
if (GET_CODE (operands[0]) != REG)
operands[0] = adj_offsettable_operand (operands[0], 2);
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[2]) & 0xffff);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
/* Do not delete a following tstl %0 insn; that would be incorrect. */
CC_STATUS_INIT;
return \"and.h %2,%0\";
@@ -1595,16 +1593,17 @@
{
if (logval < 7)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, 7 - logval);
+ operands[1] = GEN_INT (7 - logval);
return \"bset.b %1,%0\";
}
- operands[1] = gen_rtx (CONST_INT, VOIDmode, 31 - logval);
+ operands[1] = GEN_INT (31 - logval);
return \"bset.w %1,%0\";
}
else
{
- operands[0] = adj_offsettable_operand (operands[0], 3 - (logval / 8));
- operands[1] = gen_rtx (CONST_INT, VOIDmode, 7 - (logval % 8));
+ operands[0]
+ = adj_offsettable_operand (operands[0], 3 - (logval / 8));
+ operands[1] = GEN_INT (7 - (logval % 8));
}
return \"bset.b %1,%0\";
}
@@ -1866,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 ""
@@ -1891,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 ""
@@ -1916,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 ""
@@ -2255,7 +2254,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_rtx (CONST_INT, VOIDmode, -(32 - INTVAL (operands[2])));
+ operands[2] = GEN_INT (-(32 - INTVAL (operands[2])));
return \"sha.w %3,%0\";
}")
@@ -2272,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_rtx (CONST_INT, VOIDmode, -(32 - INTVAL (operands[2])));
+ operands[2] = GEN_INT (- (32 - INTVAL (operands[2])));
return \"shl.w %3,%0\";
}")
@@ -2732,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..a33cba907d8 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 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 c0941821947..67e2e2c5a6d 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -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"
@@ -39,7 +39,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));
@@ -956,16 +955,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;
@@ -1843,12 +1842,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;
}
@@ -2338,7 +2339,7 @@ get_shift_alg (cpu, shift_type, mode, count, assembler_p,
switch (shift_type)
{
case SHIFT_ASHIFT:
- *assembler_p = "mov.b\t%y0,%z0n\tmov.b\t%x0,%y0\n\tmov.b\t%w0,%x0\n\tsub.b\t%w0,%w0";
+ *assembler_p = "mov.b\t%y0,%z0\n\tmov.b\t%x0,%y0\n\tmov.b\t%w0,%x0\n\tsub.b\t%w0,%w0";
*cc_valid_p = 0;
return SHIFT_SPECIAL;
case SHIFT_LSHIFTRT:
@@ -2776,9 +2777,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_IN_STRUCT_P (mem) = MEM_IN_STRUCT_P (operands[0]);
MEM_VOLATILE_P (mem) = MEM_VOLATILE_P (operands[0]);
@@ -2787,9 +2788,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_IN_STRUCT_P (mem) = MEM_IN_STRUCT_P (operands[1]);
MEM_VOLATILE_P (mem) = MEM_VOLATILE_P (operands[1]);
@@ -2804,8 +2805,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 9002098777c..96308566464 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler.
Hitachi H8/300 version generating coff
- Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com),
Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
@@ -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. */
@@ -1378,15 +1379,15 @@ do { char dstr[30]; \
#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 55189825540..b40c159d75d 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, 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
Contributed by Jan Stein (jan@cd.chalmers.se).
Modified for MVS C/370 by Dave Pitts (dpitts@nyx.cs.du.edu)
@@ -21,9 +21,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 "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -35,12 +33,6 @@ Boston, MA 02111-1307, USA. */
#include "insn-attr.h"
#include "flags.h"
#include "recog.h"
-#ifdef sun
-#include <sys/types.h>
-#include <ctype.h>
-#endif
-#include <time.h>
-
/* Label node, this structure is used to keep track of labels on the
current page. */
diff --git a/gcc/config/i370/i370.h b/gcc/config/i370/i370.h
index e3d540f08ac..4f8b905c333 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 Free Software Foundation, Inc.
Contributed by Jan Stein (jan@cd.chalmers.se).
Modified for C/370 MVS by Dave Pitts (dpitts@nyx.cs.du.edu)
@@ -467,12 +467,12 @@ enum reg_class
/* On the 370 the return value is in R15 or R16. */
#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 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. */
@@ -577,13 +577,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); \
@@ -598,8 +597,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); \
}
/* Output assembler code to FILE to increment profiler label # LABELNO
@@ -770,17 +769,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/cygwin32.h b/gcc/config/i386/cygwin32.h
index 0e162869603..d639847c3b3 100644
--- a/gcc/config/i386/cygwin32.h
+++ b/gcc/config/i386/cygwin32.h
@@ -144,7 +144,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/i386/i386.c b/gcc/config/i386/i386.c
index 6558bb9dfde..244d28a9521 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -19,9 +19,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include <setjmp.h>
-#include <ctype.h>
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -100,7 +99,7 @@ struct processor_costs pentiumpro_cost = {
struct processor_costs *ix86_cost = &pentium_cost;
-#define AT_BP(mode) (gen_rtx (MEM, (mode), frame_pointer_rtx))
+#define AT_BP(mode) (gen_rtx_MEM ((mode), frame_pointer_rtx))
extern FILE *asm_out_file;
extern char *strcat ();
@@ -761,7 +760,7 @@ function_arg (cum, mode, type, named)
case HImode:
case QImode:
if (words <= cum->nregs)
- ret = gen_rtx (REG, mode, cum->regno);
+ ret = gen_rtx_REG (mode, cum->regno);
break;
}
@@ -831,11 +830,11 @@ output_op_from_reg (src, template)
if (size > 2 * UNITS_PER_WORD)
{
- high = gen_rtx (REG, SImode, REGNO (src) + 2);
+ high = gen_rtx_REG (SImode, REGNO (src) + 2);
output_asm_insn (AS1 (push%L0,%0), &high);
}
- high = gen_rtx (REG, SImode, REGNO (src) + 1);
+ high = gen_rtx_REG (SImode, REGNO (src) + 1);
output_asm_insn (AS1 (push%L0,%0), &high);
}
@@ -905,7 +904,7 @@ output_to_reg (dest, dies, scratch_mem)
if (size > UNITS_PER_WORD)
{
- dest = gen_rtx (REG, SImode, REGNO (dest) + 1);
+ dest = gen_rtx_REG (SImode, REGNO (dest) + 1);
if (! scratch_mem)
output_asm_insn (AS1 (pop%L0,%0), &dest);
else
@@ -917,7 +916,7 @@ output_to_reg (dest, dies, scratch_mem)
if (size > 2 * UNITS_PER_WORD)
{
- dest = gen_rtx (REG, SImode, REGNO (dest) + 1);
+ dest = gen_rtx_REG (SImode, REGNO (dest) + 1);
if (! scratch_mem)
output_asm_insn (AS1 (pop%L0,%0), &dest);
else
@@ -1071,11 +1070,11 @@ output_move_double (operands)
operands[0] = XEXP (XEXP (operands[0], 0), 0);
asm_add (-size, operands[0]);
if (GET_MODE (operands[1]) == XFmode)
- operands[0] = gen_rtx (MEM, XFmode, operands[0]);
+ operands[0] = gen_rtx_MEM (XFmode, operands[0]);
else if (GET_MODE (operands[0]) == DFmode)
- operands[0] = gen_rtx (MEM, DFmode, operands[0]);
+ operands[0] = gen_rtx_MEM (DFmode, operands[0]);
else
- operands[0] = gen_rtx (MEM, DImode, operands[0]);
+ operands[0] = gen_rtx_MEM (DImode, operands[0]);
optype0 = OFFSOP;
}
@@ -1085,11 +1084,11 @@ output_move_double (operands)
operands[1] = XEXP (XEXP (operands[1], 0), 0);
asm_add (-size, operands[1]);
if (GET_MODE (operands[1]) == XFmode)
- operands[1] = gen_rtx (MEM, XFmode, operands[1]);
+ operands[1] = gen_rtx_MEM (XFmode, operands[1]);
else if (GET_MODE (operands[1]) == DFmode)
- operands[1] = gen_rtx (MEM, DFmode, operands[1]);
+ operands[1] = gen_rtx_MEM (DFmode, operands[1]);
else
- operands[1] = gen_rtx (MEM, DImode, operands[1]);
+ operands[1] = gen_rtx_MEM (DImode, operands[1]);
optype1 = OFFSOP;
}
@@ -1115,8 +1114,8 @@ output_move_double (operands)
{
if (optype0 == REGOP)
{
- middlehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
- latehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 2);
+ middlehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
+ latehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 2);
}
else if (optype0 == OFFSOP)
{
@@ -1131,8 +1130,8 @@ output_move_double (operands)
if (optype1 == REGOP)
{
- middlehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
- latehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 2);
+ middlehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
+ latehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
}
else if (optype1 == OFFSOP)
{
@@ -1167,14 +1166,14 @@ output_move_double (operands)
/* Size is not 12. */
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)
@@ -1212,13 +1211,13 @@ output_move_double (operands)
output_asm_insn (AS2 (lea%L0,%a1,%0), xops);
if (GET_MODE (operands[1]) == XFmode)
{
- operands[1] = gen_rtx (MEM, XFmode, latehalf[0]);
+ operands[1] = gen_rtx_MEM (XFmode, latehalf[0]);
middlehalf[1] = adj_offsettable_operand (operands[1], size-8);
latehalf[1] = adj_offsettable_operand (operands[1], size-4);
}
else
{
- operands[1] = gen_rtx (MEM, DImode, latehalf[0]);
+ operands[1] = gen_rtx_MEM (DImode, latehalf[0]);
latehalf[1] = adj_offsettable_operand (operands[1], size-4);
}
}
@@ -1945,17 +1944,17 @@ load_pic_register (do_rtl)
LABEL_NAME (pic_label_rtx) = pic_label_name;
}
- xops[1] = gen_rtx (MEM, QImode,
- gen_rtx (SYMBOL_REF, Pmode,
- LABEL_NAME (pic_label_rtx)));
-
+ xops[1] = gen_rtx_MEM (QImode,
+ gen_rtx_SYMBOL_REF (Pmode,
+ LABEL_NAME (pic_label_rtx)));
+
if (do_rtl)
{
emit_insn (gen_prologue_get_pc (xops[0], xops[1]));
- emit_insn (gen_prologue_set_got (xops[0],
- gen_rtx (SYMBOL_REF, Pmode,
- "$_GLOBAL_OFFSET_TABLE_"),
- xops[1]));
+ emit_insn (gen_prologue_set_got
+ (xops[0],
+ gen_rtx_SYMBOL_REF (Pmode, "$_GLOBAL_OFFSET_TABLE_"),
+ xops[1]));
}
else
{
@@ -2016,11 +2015,12 @@ ix86_prologue (do_rtl)
{
if (do_rtl)
{
- insn = emit_insn (gen_rtx (SET, VOIDmode,
- gen_rtx (MEM, SImode,
- gen_rtx (PRE_DEC, SImode,
- stack_pointer_rtx)),
- frame_pointer_rtx));
+ insn = emit_insn (gen_rtx_SET
+ (VOIDmode,
+ gen_rtx_MEM (SImode,
+ gen_rtx_PRE_DEC (SImode,
+ stack_pointer_rtx)),
+ frame_pointer_rtx));
RTX_FRAME_RELATED_P (insn) = 1;
insn = emit_move_insn (xops[1], xops[0]);
@@ -2077,17 +2077,17 @@ ix86_prologue (do_rtl)
}
else
{
- xops[3] = gen_rtx (REG, SImode, 0);
+ xops[3] = gen_rtx_REG (SImode, 0);
if (do_rtl)
emit_move_insn (xops[3], xops[2]);
else
output_asm_insn (AS2 (mov%L0,%2,%3), xops);
- xops[3] = gen_rtx (MEM, FUNCTION_MODE,
- gen_rtx (SYMBOL_REF, Pmode, "_alloca"));
+ xops[3] = gen_rtx_MEM (FUNCTION_MODE,
+ gen_rtx_SYMBOL_REF (Pmode, "_alloca"));
if (do_rtl)
- emit_call_insn (gen_rtx (CALL, VOIDmode, xops[3], const0_rtx));
+ emit_call_insn (gen_rtx_CALL (VOIDmode, xops[3], const0_rtx));
else
output_asm_insn (AS1 (call,%P3), xops);
}
@@ -2107,14 +2107,16 @@ ix86_prologue (do_rtl)
if ((regs_ever_live[regno] && ! call_used_regs[regno])
|| (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
{
- xops[0] = gen_rtx (REG, SImode, regno);
+ xops[0] = gen_rtx_REG (SImode, regno);
if (do_rtl)
{
- insn = emit_insn (gen_rtx (SET, VOIDmode,
- gen_rtx (MEM, SImode,
- gen_rtx (PRE_DEC, SImode,
- stack_pointer_rtx)),
- xops[0]));
+ insn
+ = emit_insn (gen_rtx_SET
+ (VOIDmode,
+ gen_rtx_MEM (SImode,
+ gen_rtx_PRE_DEC (SImode,
+ stack_pointer_rtx)),
+ xops[0]));
RTX_FRAME_RELATED_P (insn) = 1;
}
@@ -2268,7 +2270,7 @@ ix86_epilogue (do_rtl)
if ((regs_ever_live[regno] && ! call_used_regs[regno])
|| (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
{
- xops[0] = gen_rtx (REG, SImode, regno);
+ xops[0] = gen_rtx_REG (SImode, regno);
if (do_rtl)
emit_insn (gen_pop (xops[0]));
@@ -2282,7 +2284,7 @@ ix86_epilogue (do_rtl)
if ((regs_ever_live[regno] && ! call_used_regs[regno])
|| (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
{
- xops[0] = gen_rtx (REG, SImode, regno);
+ xops[0] = gen_rtx_REG (SImode, regno);
xops[1] = adj_offsettable_operand (AT_BP (Pmode), offset);
if (do_rtl)
@@ -2328,8 +2330,8 @@ ix86_epilogue (do_rtl)
xops[0] = GEN_INT (tsize);
if (do_rtl)
- emit_insn (gen_rtx (SET, VOIDmode, xops[2],
- gen_rtx (PLUS, SImode, xops[2], xops[0])));
+ emit_insn (gen_rtx_SET (VOIDmode, xops[2],
+ gen_rtx_PLUS (SImode, xops[2], xops[0])));
else
output_asm_insn (AS2 (add%L2,%0,%2), xops);
}
@@ -2352,13 +2354,14 @@ ix86_epilogue (do_rtl)
if (current_function_pops_args >= 32768)
{
/* ??? Which register to use here? */
- xops[0] = gen_rtx (REG, SImode, 2);
+ xops[0] = gen_rtx_REG (SImode, 2);
if (do_rtl)
{
emit_insn (gen_pop (xops[0]));
- emit_insn (gen_rtx (SET, VOIDmode, xops[2],
- gen_rtx (PLUS, SImode, xops[1], xops[2])));
+ emit_insn (gen_rtx_SET (VOIDmode, xops[2],
+ gen_rtx_PLUS (SImode, xops[1],
+ xops[2])));
emit_jump_insn (xops[0]);
}
else
@@ -2675,10 +2678,11 @@ legitimize_pic_address (orig, reg)
if ((GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_FLAG (addr))
|| GET_CODE (addr) == LABEL_REF)
- new = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
+ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, orig);
else
- new = gen_rtx (MEM, Pmode,
- gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig));
+ new = gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode, pic_offset_table_rtx,
+ orig));
emit_move_insn (reg, new);
}
@@ -2712,11 +2716,11 @@ legitimize_pic_address (orig, reg)
if (GET_CODE (addr) == PLUS && CONSTANT_P (XEXP (addr, 1)))
{
- base = gen_rtx (PLUS, Pmode, base, XEXP (addr, 0));
+ base = gen_rtx_PLUS (Pmode, base, XEXP (addr, 0));
addr = XEXP (addr, 1);
}
- return gen_rtx (PLUS, Pmode, base, addr);
+ return gen_rtx_PLUS (Pmode, base, addr);
}
return new;
}
@@ -2782,8 +2786,8 @@ legitimize_address (x, oldx, mode)
&& (log = (unsigned)exact_log2 (INTVAL (XEXP (x, 1)))) < 4)
{
changed = 1;
- x = gen_rtx (MULT, Pmode, force_reg (Pmode, XEXP (x, 0)),
- GEN_INT (1 << log));
+ x = gen_rtx_MULT (Pmode, force_reg (Pmode, XEXP (x, 0)),
+ GEN_INT (1 << log));
}
if (GET_CODE (x) == PLUS)
@@ -2795,9 +2799,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
@@ -2805,9 +2809,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. */
@@ -2826,10 +2830,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
@@ -2858,10 +2862,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)));
}
}
@@ -3670,8 +3674,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]))
split_double (operands[num], &lo_half[num], &hi_half[num]);
@@ -4048,7 +4052,7 @@ output_fp_cc0_set (insn)
rtx next;
enum rtx_code code;
- xops[0] = gen_rtx (REG, HImode, 0);
+ xops[0] = gen_rtx_REG (HImode, 0);
output_asm_insn (AS1 (fnsts%W0,%0), xops);
if (! TARGET_IEEE_FP)
@@ -4107,7 +4111,7 @@ output_fp_cc0_set (insn)
else
abort ();
- xops[0] = gen_rtx (REG, QImode, 0);
+ xops[0] = gen_rtx_REG (QImode, 0);
switch (code)
{
@@ -4383,10 +4387,11 @@ rewrite_address (mem_rtx)
{
/* This part is utilized by the combiner. */
ret_rtx
- = gen_rtx (PLUS, GET_MODE (mem_addr),
- gen_rtx (PLUS, GET_MODE (XEXP (mem_addr, 1)),
- XEXP (mem_addr, 0), XEXP (XEXP (mem_addr, 1), 0)),
- XEXP (XEXP (mem_addr, 1), 1));
+ = gen_rtx_PLUS (GET_MODE (mem_addr),
+ gen_rtx_PLUS (GET_MODE (XEXP (mem_addr, 1)),
+ XEXP (mem_addr, 0),
+ XEXP (XEXP (mem_addr, 1), 0)),
+ XEXP (XEXP (mem_addr, 1), 1));
if (memory_address_p (GET_MODE (mem_rtx), ret_rtx))
{
@@ -4561,38 +4566,38 @@ rewrite_address (mem_rtx)
{
if (scale != 1)
{
- ret_rtx = gen_rtx (PLUS, GET_MODE (base_rtx),
- gen_rtx (MULT, GET_MODE (index_rtx),
- index_rtx, scale_rtx),
- base_rtx);
+ ret_rtx = gen_rtx_PLUS (GET_MODE (base_rtx),
+ gen_rtx_MULT (GET_MODE (index_rtx),
+ index_rtx, scale_rtx),
+ base_rtx);
if (GET_CODE (offset_rtx) != CONST_INT
|| INTVAL (offset_rtx) != 0)
- ret_rtx = gen_rtx (PLUS, GET_MODE (ret_rtx),
- ret_rtx, offset_rtx);
+ ret_rtx = gen_rtx_PLUS (GET_MODE (ret_rtx),
+ ret_rtx, offset_rtx);
}
else
{
- ret_rtx = gen_rtx (PLUS, GET_MODE (index_rtx),
- index_rtx, base_rtx);
+ ret_rtx = gen_rtx_PLUS (GET_MODE (index_rtx),
+ index_rtx, base_rtx);
if (GET_CODE (offset_rtx) != CONST_INT
|| INTVAL (offset_rtx) != 0)
- ret_rtx = gen_rtx (PLUS, GET_MODE (ret_rtx),
- ret_rtx, offset_rtx);
+ ret_rtx = gen_rtx_PLUS (GET_MODE (ret_rtx),
+ ret_rtx, offset_rtx);
}
}
else
{
if (scale != 1)
{
- ret_rtx = gen_rtx (MULT, GET_MODE (index_rtx),
- index_rtx, scale_rtx);
+ ret_rtx = gen_rtx_MULT (GET_MODE (index_rtx),
+ index_rtx, scale_rtx);
if (GET_CODE (offset_rtx) != CONST_INT
|| INTVAL (offset_rtx) != 0)
- ret_rtx = gen_rtx (PLUS, GET_MODE (ret_rtx),
- ret_rtx, offset_rtx);
+ ret_rtx = gen_rtx_PLUS (GET_MODE (ret_rtx),
+ ret_rtx, offset_rtx);
}
else
{
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 77bf539ce99..77789f6d0a6 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -945,14 +945,14 @@ enum reg_class
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), \
- VALUE_REGNO (TYPE_MODE (VALTYPE)))
+ gen_rtx_REG (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. */
#define LIBCALL_VALUE(MODE) \
- gen_rtx (REG, MODE, VALUE_REGNO (MODE))
+ gen_rtx_REG (MODE, VALUE_REGNO (MODE))
/* Define the size of the result block used for communication between
untyped_call and untyped_return. The block contains a DImode value
@@ -1145,9 +1145,9 @@ do \
\
ASM_GENERATE_INTERNAL_LABEL (block_table, "LPBX", 0); \
\
- xops[1] = gen_rtx (SYMBOL_REF, VOIDmode, block_table); \
+ xops[1] = gen_rtx_SYMBOL_REF (VOIDmode, block_table); \
xops[5] = stack_pointer_rtx; \
- xops[7] = gen_rtx (REG, Pmode, 0); /* eax */ \
+ xops[7] = gen_rtx_REG (Pmode, 0); /* eax */ \
\
CONSTANT_POOL_ADDRESS_P (xops[1]) = TRUE; \
\
@@ -1157,7 +1157,9 @@ do \
case 2: \
\
xops[2] = GEN_INT ((BLOCK_OR_LABEL)); \
- xops[3] = gen_rtx (MEM, Pmode, gen_rtx (SYMBOL_REF, VOIDmode, "__bb_init_trace_func")); \
+ xops[3] = gen_rtx_MEM (Pmode, \
+ gen_rtx_SYMBOL_REF (VOIDmode, \
+ "__bb_init_trace_func")); \
xops[6] = GEN_INT (8); \
\
output_asm_insn (AS1(push%L2,%2), xops); \
@@ -1179,9 +1181,12 @@ do \
ASM_GENERATE_INTERNAL_LABEL (false_label, "LPBZ", num_func); \
\
xops[0] = const0_rtx; \
- xops[2] = gen_rtx (MEM, Pmode, gen_rtx (SYMBOL_REF, VOIDmode, false_label)); \
- xops[3] = gen_rtx (MEM, Pmode, gen_rtx (SYMBOL_REF, VOIDmode, "__bb_init_func")); \
- xops[4] = gen_rtx (MEM, Pmode, xops[1]); \
+ xops[2] = gen_rtx_MEM (Pmode, \
+ gen_rtx_SYMBOL_REF (VOIDmode, false_label)); \
+ xops[3] = gen_rtx_MEM (Pmode, \
+ gen_rtx_SYMBOL_REF (VOIDmode, \
+ "__bb_init_func")); \
+ xops[4] = gen_rtx_MEM (Pmode, xops[1]); \
xops[6] = GEN_INT (4); \
\
CONSTANT_POOL_ADDRESS_P (xops[2]) = TRUE; \
@@ -1287,13 +1292,15 @@ do \
\
ASM_GENERATE_INTERNAL_LABEL (block_table, "LPBX", 0); \
\
- xops[1] = gen_rtx (SYMBOL_REF, VOIDmode, block_table); \
+ xops[1] = gen_rtx_SYMBOL_REF (VOIDmode, block_table); \
xops[2] = GEN_INT ((BLOCKNO)); \
- xops[3] = gen_rtx (MEM, Pmode, gen_rtx (SYMBOL_REF, VOIDmode, "__bb_trace_func")); \
- xops[4] = gen_rtx (SYMBOL_REF, VOIDmode, "__bb"); \
+ xops[3] = gen_rtx_MEM (Pmode, \
+ gen_rtx_SYMBOL_REF (VOIDmode, \
+ "__bb_trace_func")); \
+ xops[4] = gen_rtx_SYMBOL_REF (VOIDmode, "__bb"); \
xops[5] = plus_constant (xops[4], 4); \
- xops[0] = gen_rtx (MEM, SImode, xops[4]); \
- xops[6] = gen_rtx (MEM, SImode, xops[5]); \
+ xops[0] = gen_rtx_MEM (SImode, xops[4]); \
+ xops[6] = gen_rtx_MEM (SImode, xops[5]); \
\
CONSTANT_POOL_ADDRESS_P (xops[1]) = TRUE; \
\
@@ -1301,7 +1308,7 @@ do \
output_asm_insn (AS2(mov%L0,%2,%0), xops); \
if (flag_pic) \
{ \
- xops[7] = gen_rtx (REG, Pmode, 0); /* eax */ \
+ xops[7] = gen_rtx_REG (Pmode, 0); /* eax */ \
output_asm_insn (AS1(push%L7,%7), xops); \
output_asm_insn (AS2(lea%L7,%a1,%7), xops); \
output_asm_insn (AS2(mov%L6,%7,%6), xops); \
@@ -1317,16 +1324,16 @@ do \
default: \
\
ASM_GENERATE_INTERNAL_LABEL (counts, "LPBX", 2); \
- cnt_rtx = gen_rtx (SYMBOL_REF, VOIDmode, counts); \
+ cnt_rtx = gen_rtx_SYMBOL_REF (VOIDmode, counts); \
SYMBOL_REF_FLAG (cnt_rtx) = TRUE; \
\
if (BLOCKNO) \
cnt_rtx = plus_constant (cnt_rtx, (BLOCKNO)*4); \
\
if (flag_pic) \
- cnt_rtx = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, cnt_rtx); \
+ cnt_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, cnt_rtx); \
\
- xops[0] = gen_rtx (MEM, SImode, cnt_rtx); \
+ xops[0] = gen_rtx_MEM (SImode, cnt_rtx); \
output_asm_insn (AS1(inc%L0,%0), xops); \
\
break; \
@@ -1362,7 +1369,8 @@ do \
{ \
rtx xops[1]; \
\
- xops[0] = gen_rtx (MEM, Pmode, gen_rtx (SYMBOL_REF, VOIDmode, "__bb_trace_ret")); \
+ xops[0] = gen_rtx_MEM (Pmode, \
+ gen_rtx_SYMBOL_REF (VOIDmode, "__bb_trace_ret")); \
\
output_asm_insn (AS1(call,%P0), xops); \
\
@@ -1470,8 +1478,8 @@ do { \
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 1)), CXT); \
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 6)), FNADDR); \
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 1)), CXT); \
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 6)), FNADDR); \
}
/* Definitions for register eliminations.
@@ -1805,10 +1813,10 @@ while (0)
in one reasonably fast instruction. */
#define MOVE_MAX 4
-/* The number of scalar move insns which 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.
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction pairs, we will do a movstr or libcall instead.
+ Increasing the value will always make code faster, but eventually
+ incurs high cost in increased code size.
If you don't define this, a reasonable default is used.
@@ -2366,13 +2374,13 @@ 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))
-
+ 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
@@ -2625,7 +2633,7 @@ extern char *qi_high_reg_name[];
#define ASM_OPERAND_LETTER '#'
#define RET return ""
-#define AT_SP(mode) (gen_rtx (MEM, (mode), stack_pointer_rtx))
+#define AT_SP(mode) (gen_rtx_MEM ((mode), stack_pointer_rtx))
/* Helper macros to expand a binary/unary operator if needed */
#define IX86_EXPAND_BINARY_OPERATOR(OP, MODE, OPERANDS) \
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index c324a8be705..0d7b603dbd1 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1043,7 +1043,7 @@
""
"*
{
- operands[1] = gen_rtx (REG, HImode, REGNO (operands[1]));
+ operands[1] = gen_rtx_REG (HImode, REGNO (operands[1]));
return AS1 (push%W0,%1);
}")
@@ -1220,13 +1220,14 @@
if (flag_pic)
current_function_uses_pic_offset_table = 1;
- insn = emit_insn (gen_rtx (SET, SFmode, operands[0], fp_const));
+ insn = emit_insn (gen_rtx_SET (SFmode, operands[0], fp_const));
note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
if (note)
XEXP (note, 0) = operands[1];
else
- 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));
}
}")
@@ -1368,13 +1369,14 @@
if (flag_pic)
current_function_uses_pic_offset_table = 1;
- insn = emit_insn (gen_rtx (SET, DFmode, operands[0], fp_const));
+ insn = emit_insn (gen_rtx_SET (DFmode, operands[0], fp_const));
note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
if (note)
XEXP (note, 0) = operands[1];
else
- 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));
}
}")
@@ -1517,13 +1519,14 @@
if (flag_pic)
current_function_uses_pic_offset_table = 1;
- insn = emit_insn (gen_rtx (SET, XFmode, operands[0], fp_const));
+ insn = emit_insn (gen_rtx_SET (XFmode, operands[0], fp_const));
note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
if (note)
XEXP (note, 0) = operands[1];
else
- 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));
}
}")
@@ -1663,7 +1666,7 @@
if (TARGET_ZERO_EXTEND_WITH_AND)
{
xops[0] = operands[0];
- xops[1] = gen_rtx (CONST_INT, VOIDmode, 0xffff);
+ xops[1] = GEN_INT (0xffff);
if (i386_aligned_p (operands[1]))
output_asm_insn (AS2 (mov%L0,%k1,%k0),operands);
else
@@ -1687,7 +1690,7 @@
(const_int 0))
(set (strict_low_part (match_dup 2))
(match_dup 1))]
- "operands[2] = gen_rtx (REG, HImode, true_regnum (operands[0]));")
+ "operands[2] = gen_rtx_REG (HImode, true_regnum (operands[0]));")
(define_split
@@ -1699,7 +1702,7 @@
(set (match_dup 0)
(and:SI (match_dup 0)
(const_int 65535)))]
- "operands[2] = gen_rtx (REG, HImode, true_regnum (operands[0]));")
+ "operands[2] = gen_rtx_REG (HImode, true_regnum (operands[0]));")
(define_insn "zero_extendqihi2"
[(set (match_operand:HI 0 "register_operand" "=q,&q,?r")
@@ -1728,7 +1731,7 @@
else
{
xops[0] = operands[0];
- xops[1] = gen_rtx (CONST_INT, VOIDmode, 0xff);
+ xops[1] = GEN_INT (0xff);
output_asm_insn (AS2 (mov%B0,%1,%b0),operands);
output_asm_insn (AS2 (and%L0,%1,%k0), xops);
}
@@ -1751,7 +1754,7 @@
(const_int 0))
(set (strict_low_part (match_dup 2))
(match_dup 1))]
- "operands[2] = gen_rtx (REG, QImode, REGNO (operands[0]));")
+ "operands[2] = gen_rtx_REG (QImode, REGNO (operands[0]));")
(define_split
@@ -1764,7 +1767,7 @@
(set (match_dup 0)
(and:HI (match_dup 0)
(const_int 255)))]
- "operands[2] = gen_rtx (REG, QImode, REGNO (operands[0]));")
+ "operands[2] = gen_rtx_REG (QImode, REGNO (operands[0]));")
(define_split
[(set (match_operand:HI 0 "register_operand" "")
@@ -1780,7 +1783,7 @@
if (GET_CODE (operands[0]) != REG || GET_CODE (operands[1]) != REG
|| REGNO (operands[0]) == REGNO (operands[1]))
FAIL;
- operands[2] = gen_rtx (REG, HImode, REGNO (operands[1]));")
+ operands[2] = gen_rtx_REG (HImode, REGNO (operands[1]));")
(define_insn "zero_extendqisi2"
[(set (match_operand:SI 0 "register_operand" "=q,&q,?r")
@@ -1809,7 +1812,7 @@
else
{
xops[0] = operands[0];
- xops[1] = gen_rtx (CONST_INT, VOIDmode, 0xff);
+ xops[1] = GEN_INT (0xff);
output_asm_insn (AS2 (mov%B0,%1,%b0), operands);
output_asm_insn (AS2 (and%L0,%1,%k0), xops);
}
@@ -1819,8 +1822,8 @@
if (TARGET_ZERO_EXTEND_WITH_AND && GET_CODE (operands[1]) == REG)
{
xops[0] = operands[0];
- xops[1] = gen_rtx (CONST_INT, VOIDmode, 0xff);
- operands[1] = gen_rtx (REG, SImode, REGNO (operands[1]));
+ xops[1] = GEN_INT (0xff);
+ operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]));
output_asm_insn (AS2 (mov%L0,%1,%0), operands);
output_asm_insn (AS2 (and%L0,%1,%k0), xops);
RET;
@@ -1842,7 +1845,7 @@
(const_int 0))
(set (strict_low_part (match_dup 2))
(match_dup 1))]
- "operands[2] = gen_rtx (REG, QImode, REGNO (operands[0]));")
+ "operands[2] = gen_rtx_REG (QImode, REGNO (operands[0]));")
(define_split
@@ -1855,7 +1858,7 @@
(set (match_dup 0)
(and:SI (match_dup 0)
(const_int 255)))]
- "operands[2] = gen_rtx (REG, QImode, REGNO (operands[0]));")
+ "operands[2] = gen_rtx_REG (QImode, REGNO (operands[0]));")
(define_split
[(set (match_operand:SI 0 "register_operand" "")
@@ -1867,7 +1870,7 @@
(set (match_dup 0)
(and:SI (match_dup 0)
(const_int 255)))]
- "operands[2] = gen_rtx (REG, SImode, true_regnum (operands[1]));")
+ "operands[2] = gen_rtx_REG (SImode, true_regnum (operands[1]));")
(define_insn "zero_extendsidi2"
[(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?m")
@@ -1880,7 +1883,7 @@
if (REG_P (operands[0]) && REG_P (operands[1])
&& REGNO (operands[0]) == REGNO (operands[1]))
{
- operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
return AS2 (xor%L0,%0,%0);
}
@@ -1917,7 +1920,7 @@
#endif
}
- operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
output_asm_insn (AS2 (mov%L0,%0,%1), operands);
operands[0] = GEN_INT (31);
@@ -3036,7 +3039,7 @@
; xops[0] = operands[0];
; xops[1] = operands[1];
; xops[2] = operands[2];
-; xops[3] = gen_rtx (MEM, SImode, stack_pointer_rtx);
+; xops[3] = gen_rtx_MEM (SImode, stack_pointer_rtx);
; output_asm_insn (\"push%z1 %1\", xops);
; output_asm_insn (AS2 (add%z3,%2,%3), xops);
; RET;
@@ -4451,8 +4454,8 @@ byte_xor_operation:
output_asm_insn (AS2 (mov%L0,%1,%0), operands);
operands[1] = operands[0];
}
- operands[1] = gen_rtx (MULT, SImode, operands[1],
- GEN_INT (1 << INTVAL (operands[2])));
+ operands[1] = gen_rtx_MULT (SImode, operands[1],
+ GEN_INT (1 << INTVAL (operands[2])));
return AS2 (lea%L0,%a1,%0);
}
}
@@ -4912,7 +4915,7 @@ byte_xor_operation:
}
else
{
- operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]));
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));
if (INTVAL (operands[2]))
output_asm_insn (AS2 (ror%L0,%2,%0), operands);
output_asm_insn (AS3 (shrd%L0,%1,%3,%0), operands);
@@ -5345,7 +5348,7 @@ byte_xor_operation:
else
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x4000);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (jne,%l0);
@@ -5385,7 +5388,7 @@ byte_xor_operation:
else
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x4000);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (je,%l0);
@@ -5419,7 +5422,7 @@ byte_xor_operation:
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x4100);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (je,%l0);
@@ -5471,7 +5474,7 @@ byte_xor_operation:
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x100);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (jne,%l0);
@@ -5522,7 +5525,7 @@ byte_xor_operation:
return AS1 (je,%l0);
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x100);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (je,%l0);
@@ -5573,7 +5576,7 @@ byte_xor_operation:
return AS1 (jb,%l0);
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x4100);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (jne,%l0);
@@ -5617,7 +5620,7 @@ byte_xor_operation:
else
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x4000);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (je,%l0);
@@ -5639,7 +5642,7 @@ byte_xor_operation:
else
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x4000);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (jne,%l0);
@@ -5661,7 +5664,7 @@ byte_xor_operation:
return AS1 (jne,%l0);
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x4100);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (jne,%l0);
@@ -5692,7 +5695,7 @@ byte_xor_operation:
return AS1 (jne,%l0);
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x100);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (je,%l0);
@@ -5724,7 +5727,7 @@ byte_xor_operation:
return AS1 (jne,%l0);
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x100);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (jne,%l0);
@@ -5756,7 +5759,7 @@ byte_xor_operation:
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx (REG, SImode, 0);
+ operands[1] = gen_rtx_REG (SImode, 0);
operands[2] = GEN_INT (0x4100);
output_asm_insn (AS2 (testl,%2,%1), operands);
return AS1 (je,%l0);
@@ -6302,8 +6305,8 @@ byte_xor_operation:
value. */
emit_call_insn (TARGET_80387
- ? gen_call_value (gen_rtx (REG, XCmode, FIRST_FLOAT_REG),
- operands[0], const0_rtx)
+ ? gen_call_value (gen_rtx_REG (XCmode, FIRST_FLOAT_REG),
+ operands[0], const0_rtx)
: gen_call (operands[0], const0_rtx));
for (i = 0; i < XVECLEN (operands[2], 0); i++)
@@ -6566,7 +6569,7 @@ byte_xor_operation:
operands[3] = gen_reg_rtx (SImode);
operands[5] = addr0;
- operands[0] = gen_rtx (MEM, BLKmode, addr0);
+ operands[0] = gen_rtx_MEM (BLKmode, addr0);
}")
;; It might seem that operand 0 could use predicate register_operand.
@@ -6632,9 +6635,8 @@ byte_xor_operation:
operands[5] = addr1;
operands[6] = addr2;
- operands[1] = gen_rtx (MEM, BLKmode, addr1);
- operands[2] = gen_rtx (MEM, BLKmode, addr2);
-
+ operands[1] = gen_rtx_MEM (BLKmode, addr1);
+ operands[2] = gen_rtx_MEM (BLKmode, addr2);
}")
;; memcmp recognizers. The `cmpsb' opcode does nothing if the count is
@@ -6697,7 +6699,7 @@ byte_xor_operation:
cc_status.flags |= CC_NOT_SIGNED;
- xops[0] = gen_rtx (REG, QImode, 0);
+ xops[0] = gen_rtx_REG (QImode, 0);
xops[1] = CONST0_RTX (QImode);
output_asm_insn (\"cld\", operands);
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 5ae1926d1cd..c15ad64553f 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -66,14 +66,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 fd4c3a8eb28..6c2dd3e85a0 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 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1992, 1993, 1996, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -221,8 +221,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, \
@@ -294,7 +294,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 60c0bb6a1f6..d87d8e4ed4a 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 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 dd9a6f56329..12e916469b6 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 "regs.h"
@@ -519,7 +519,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];
@@ -624,14 +624,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)
@@ -690,7 +690,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;
@@ -744,7 +744,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]))
{
@@ -753,8 +753,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))
@@ -779,8 +779,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)))
@@ -1113,8 +1113,7 @@ output_size_for_block_move (size, reg, align)
output_asm_insn ("sub %2,%1,%0", xoperands);
else
{
- xoperands[1]
- = gen_rtx (CONST_INT, VOIDmode, 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);
}
@@ -1153,7 +1152,7 @@ output_block_move (operands)
if (align > 4)
{
align = 4;
- alignrtx = gen_rtx (CONST_INT, VOIDmode, 4);
+ alignrtx = GEN_INT (4);
}
/* Recognize special cases of block moves. These occur
@@ -1238,7 +1237,7 @@ output_block_move (operands)
/* Generate number for unique label. */
- xoperands[3] = gen_rtx (CONST_INT, VOIDmode, movstrsi_label++);
+ xoperands[3] = GEN_INT (movstrsi_label++);
/* Calculate the size of the chunks we will be trying to move first. */
@@ -1253,7 +1252,7 @@ output_block_move (operands)
/* Copy the increment (negative) to a register for bla insn. */
- xoperands[4] = gen_rtx (CONST_INT, VOIDmode, - chunk_size);
+ xoperands[4] = GEN_INT (- chunk_size);
xoperands[5] = operands[5];
output_asm_insn ("adds %4,%?r0,%5", xoperands);
@@ -1425,8 +1424,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 47eb7dcfd1d..cc1495a58af 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-97, 1998 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)
@@ -618,11 +618,11 @@ struct cumulative_args { int ints, floats; };
or #BOTTOM_OF_STATIC,r29,r29 */
#define TRAMPOLINE_TEMPLATE(FILE) \
{ \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0xec1f0000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0xe7ff0000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0xec1d0000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4000f800)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0xe7bd0000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0xec1f0000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0xe7ff0000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0xec1d0000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x4000f800)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0xe7bd0000)); \
}
/* Length in units of the trampoline for entering a nested function. */
@@ -644,13 +644,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)); \
}
@@ -803,25 +803,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 b5649f59e49..bc91febacac 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 Free Software Foundation, Inc.
;; This file is part of GNU CC.
@@ -88,8 +88,7 @@
int pos = 8 - width - INTVAL (operands[1]);
CC_STATUS_PARTIAL_INIT;
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- ~((-1) << width) << pos);
+ operands[2] = GEN_INT (~((-1) << width) << pos);
return \"and %2,%0,%?r0\";
}")
@@ -136,7 +135,7 @@
else
{
cc_status.flags |= CC_REVERSED;
- operands[1] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[1]));
+ operands[1] = GEN_INT (- INTVAL (operands[1]));
return \"adds %1,%0,%?r0\";
}
}")
@@ -153,7 +152,7 @@
else
{
cc_status.flags |= CC_REVERSED;
- operands[0] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[0]));
+ operands[0] = GEN_INT (- INTVAL (operands[0]));
return \"adds %0,%1,%?r0\";
}
}")
@@ -171,7 +170,7 @@
else
{
cc_status.flags |= CC_REVERSED;
- operands[0] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[0]));
+ operands[0] = GEN_INT (- INTVAL (operands[0]));
return \"adds %0,%1,%?r0\";
}
}")
@@ -189,7 +188,7 @@
else
{
cc_status.flags |= CC_REVERSED;
- operands[1] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[1]));
+ operands[1] = GEN_INT (- INTVAL (operands[1]));
return \"adds %1,%0,%?r0\";
}
}")
@@ -228,7 +227,7 @@
else
{
cc_status.flags |= CC_REVERSED;
- operands[1] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[1]));
+ operands[1] = GEN_INT (- INTVAL (operands[1]));
return \"addu %1,%0,%?r0\";
}
}
@@ -250,7 +249,7 @@
else
{
cc_status.flags |= CC_REVERSED;
- operands[0] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[0]));
+ operands[0] = GEN_INT (- INTVAL (operands[0]));
return \"addu %0,%1,%?r0\";
}
}
@@ -1528,8 +1527,7 @@
"*
{
CC_STATUS_PARTIAL_INIT;
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- (INTVAL (operands[2]) << INTVAL (operands[1])));
+ operands[2] = GEN_INT (INTVAL (operands[2]) << INTVAL (operands[1]));
return \"and %2,%0,%?r0\";
}")
@@ -1544,8 +1542,7 @@
"*
{
CC_STATUS_PARTIAL_INIT;
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- (INTVAL (operands[2]) << INTVAL (operands[1])));
+ operands[2] = GEN_INT (INTVAL (operands[2]) << INTVAL (operands[1]));
return \"and %2,%0,%?r0\";
}")
@@ -1682,7 +1679,7 @@
CC_STATUS_PARTIAL_INIT;
if (REG_P (operands[2]))
return \"subu %1,%2,%0\";
- operands[2] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[2]));
+ operands[2] = GEN_INT (- INTVAL (operands[2]));
return \"addu %2,%1,%0\";
}")
@@ -1769,16 +1766,15 @@
return \"and %2,%1,%0\";
if ((INTVAL (operands[2]) & 0xffff) == 0)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- (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_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[2]) & 0xffff);
+ xop[2] = GEN_INT (~INTVAL (operands[2]) & 0xffff);
output_asm_insn (\"andnot %2,%1,%0\", xop);
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- ~(unsigned) INTVAL (operands[2]) >> 16);
+ operands[2] = GEN_INT (~(unsigned HOST_WIDE_INT) INTVAL (operands[2]) >> 16);
return \"andnoth %2,%0,%0\";
}")
@@ -1796,16 +1792,15 @@
return \"andnot %1,%2,%0\";
if ((INTVAL (operands[1]) & 0xffff) == 0)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- (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_rtx (CONST_INT, VOIDmode, (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_rtx (CONST_INT, VOIDmode,
- (unsigned) INTVAL (operands[1]) >> 16);
+ operands[1] = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (operands[1]) >> 16);
return \"andnoth %1,%0,%0\";
}")
@@ -1823,16 +1818,15 @@
return \"or %2,%1,%0\";
if ((INTVAL (operands[2]) & 0xffff) == 0)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- (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_rtx (CONST_INT, VOIDmode, (INTVAL (operands[2]) & 0xffff));
+ xop[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
output_asm_insn (\"or %2,%1,%0\", xop);
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- (unsigned) INTVAL (operands[2]) >> 16);
+ operands[2] = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) >> 16);
return \"orh %2,%0,%0\";
}")
@@ -1850,16 +1844,15 @@
return \"xor %2,%1,%0\";
if ((INTVAL (operands[2]) & 0xffff) == 0)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- (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_rtx (CONST_INT, VOIDmode, (INTVAL (operands[2]) & 0xffff));
+ xop[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
output_asm_insn (\"xor %2,%1,%0\", xop);
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- (unsigned) INTVAL (operands[2]) >> 16);
+ operands[2] = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) >> 16);
return \"xorh %2,%0,%0\";
}")
@@ -2128,7 +2121,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));
}
}")
@@ -2196,7 +2189,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 902ed0bbb01..490884807f3 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.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 "regs.h"
#include "hard-reg-set.h"
@@ -509,9 +509,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;
}
@@ -600,12 +600,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;
}
@@ -656,8 +656,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 "";
@@ -725,8 +725,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);
@@ -789,7 +789,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);
@@ -808,11 +808,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);
@@ -827,8 +827,8 @@ 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[1] = gen_rtx (CONST_INT, VOIDmode, value);
+ operands[0] = gen_rtx_REG (SImode, REGNO (dst));
+ operands[1] = GEN_INT (value);
output_asm_insn (i960_output_ldconst (operands[0], operands[1]),
operands);
return "";
@@ -863,7 +863,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);
@@ -899,7 +899,7 @@ i960_output_ldconst (dst, src)
{
if (i960_last_insn_type == I_TYPE_REG && TARGET_C_SERIES)
return "lda %1,%0";
- operands[1] = gen_rtx (CONST_INT, VOIDmode, rsrc1 - 31);
+ operands[1] = GEN_INT (rsrc1 - 31);
output_asm_insn ("addo\t31,%1,%0\t# ldconst %3,%0", operands);
return "";
}
@@ -910,7 +910,7 @@ i960_output_ldconst (dst, src)
if (rsrc1 >= -31)
{
/* return 'sub -(%1),0,%0' */
- operands[1] = gen_rtx (CONST_INT, VOIDmode, - rsrc1);
+ operands[1] = GEN_INT (- rsrc1);
output_asm_insn ("subo\t%1,0,%0\t# ldconst %3,%0", operands);
return "";
}
@@ -918,7 +918,7 @@ i960_output_ldconst (dst, src)
/* ldconst -32 -> not 31,X */
if (rsrc1 == -32)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, ~rsrc1);
+ operands[1] = GEN_INT (~rsrc1);
output_asm_insn ("not\t%1,%0 # ldconst %3,%0", operands);
return "";
}
@@ -927,7 +927,7 @@ i960_output_ldconst (dst, src)
/* If const is a single bit. */
if (bitpos (rsrc1) >= 0)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, bitpos (rsrc1));
+ operands[1] = GEN_INT (bitpos (rsrc1));
output_asm_insn ("setbit\t%1,0,%0\t# ldconst %3,%0", operands);
return "";
}
@@ -940,8 +940,8 @@ i960_output_ldconst (dst, src)
if (bitstr (rsrc1, &s, &e) < 6)
{
rsrc2 = ((unsigned int) rsrc1) >> s;
- operands[1] = gen_rtx (CONST_INT, VOIDmode, rsrc2);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, s);
+ operands[1] = GEN_INT (rsrc2);
+ operands[2] = GEN_INT (s);
output_asm_insn ("shlo\t%2,%1,%0\t# ldconst %3,%0", operands);
return "";
}
@@ -2008,9 +2008,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)). */
@@ -2035,10 +2035,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;
@@ -2330,7 +2330,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;
@@ -2462,17 +2462,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 for now. */
- regblock = gen_rtx (MEM, BLKmode,
+ regblock = gen_rtx_MEM (BLKmode,
plus_constant (arg_pointer_rtx,
first_reg * 4));
move_block_from_reg (first_reg, regblock,
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index bd4330db514..c3076d31b5d 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -755,7 +755,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.
@@ -859,7 +859,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. */
@@ -1469,11 +1469,11 @@ extern struct rtx_def *gen_compare_reg ();
#define TRAMPOLINE_TEMPLATE(FILE) \
{ \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x8C203000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x8C183000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x84212000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x8C203000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x8C183000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x84212000)); \
}
/* Length in units of the trampoline for entering a nested function. */
@@ -1486,10 +1486,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 6cd13dbd9f2..b86205b6908 100644
--- a/gcc/config/i960/i960.md
+++ b/gcc/config/i960/i960.md
@@ -876,7 +876,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\";
}"
@@ -958,7 +958,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);
@@ -991,27 +991,27 @@
from = memory_address (SImode, XEXP (operands[0], 0));
while (count >= 4 && ((regno & 3) == 0))
{
- emit_insn (gen_rtx (SET, VOIDmode,
- gen_rtx (MEM, TImode, from),
- gen_rtx (REG, TImode, regno)));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (TImode, from),
+ gen_rtx_REG (TImode, regno)));
count -= 4;
regno += 4;
from = memory_address (TImode, plus_constant (from, 16));
}
while (count >= 2 && ((regno & 1) == 0))
{
- emit_insn (gen_rtx (SET, VOIDmode,
- gen_rtx (MEM, DImode, from),
- gen_rtx (REG, DImode, regno)));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (DImode, from),
+ gen_rtx_REG (DImode, regno)));
count -= 2;
regno += 2;
from = memory_address (DImode, plus_constant (from, 8));
}
while (count > 0)
{
- emit_insn (gen_rtx (SET, VOIDmode,
- gen_rtx (MEM, SImode, from),
- gen_rtx (REG, SImode, regno)));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (SImode, from),
+ gen_rtx_REG (SImode, regno)));
count -= 1;
regno += 1;
from = memory_address (SImode, plus_constant (from, 4));
@@ -1185,7 +1185,7 @@
&& GET_CODE (XEXP (operand1, 0)) == REG))
{
rtx temp = gen_reg_rtx (SImode);
- rtx shift_16 = gen_rtx (CONST_INT, VOIDmode, 16);
+ rtx shift_16 = GEN_INT (16);
int op1_subreg_word = 0;
if (GET_CODE (operand1) == SUBREG)
@@ -1193,7 +1193,7 @@
op1_subreg_word = SUBREG_WORD (operand1);
operand1 = SUBREG_REG (operand1);
}
- operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word);
+ operand1 = gen_rtx_SUBREG (SImode, operand1, op1_subreg_word);
emit_insn (gen_ashlsi3 (temp, operand1, shift_16));
emit_insn (gen_ashrsi3 (operand0, temp, shift_16));
@@ -1219,7 +1219,7 @@
&& GET_CODE (XEXP (operand1, 0)) == REG))
{
rtx temp = gen_reg_rtx (SImode);
- rtx shift_24 = gen_rtx (CONST_INT, VOIDmode, 24);
+ rtx shift_24 = GEN_INT (24);
int op1_subreg_word = 0;
if (GET_CODE (operand1) == SUBREG)
@@ -1227,7 +1227,7 @@
op1_subreg_word = SUBREG_WORD (operand1);
operand1 = SUBREG_REG (operand1);
}
- operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word),
+ operand1 = gen_rtx_SUBREG (SImode, operand1, op1_subreg_word),
emit_insn (gen_ashlsi3 (temp, operand1, shift_24));
emit_insn (gen_ashrsi3 (operand0, temp, shift_24));
@@ -1254,7 +1254,7 @@
&& GET_CODE (XEXP (operand1, 0)) == REG))
{
rtx temp = gen_reg_rtx (SImode);
- rtx shift_24 = gen_rtx (CONST_INT, VOIDmode, 24);
+ rtx shift_24 = GEN_INT (24);
int op0_subreg_word = 0;
int op1_subreg_word = 0;
@@ -1263,7 +1263,7 @@
op1_subreg_word = SUBREG_WORD (operand1);
operand1 = SUBREG_REG (operand1);
}
- operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word);
+ operand1 = gen_rtx_SUBREG (SImode, operand1, op1_subreg_word);
if (GET_CODE (operand0) == SUBREG)
{
@@ -1271,7 +1271,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));
@@ -1298,7 +1298,7 @@
&& GET_CODE (XEXP (operand1, 0)) == REG))
{
rtx temp = gen_reg_rtx (SImode);
- rtx shift_16 = gen_rtx (CONST_INT, VOIDmode, 16);
+ rtx shift_16 = GEN_INT (16);
int op1_subreg_word = 0;
if (GET_CODE (operand1) == SUBREG)
@@ -1306,7 +1306,7 @@
op1_subreg_word = SUBREG_WORD (operand1);
operand1 = SUBREG_REG (operand1);
}
- operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word);
+ operand1 = gen_rtx_SUBREG (SImode, operand1, op1_subreg_word);
emit_insn (gen_ashlsi3 (temp, operand1, shift_16));
emit_insn (gen_lshrsi3 (operand0, temp, shift_16));
@@ -1337,7 +1337,7 @@
&& GET_CODE (XEXP (operand1, 0)) == REG))
{
rtx temp = gen_reg_rtx (SImode);
- rtx shift_24 = gen_rtx (CONST_INT, VOIDmode, 24);
+ rtx shift_24 = GEN_INT (24);
int op1_subreg_word = 0;
if (GET_CODE (operand1) == SUBREG)
@@ -1345,7 +1345,7 @@
op1_subreg_word = SUBREG_WORD (operand1);
operand1 = SUBREG_REG (operand1);
}
- operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word);
+ operand1 = gen_rtx_SUBREG (SImode, operand1, op1_subreg_word);
emit_insn (gen_ashlsi3 (temp, operand1, shift_24));
emit_insn (gen_lshrsi3 (operand0, temp, shift_24));
@@ -1372,7 +1372,7 @@
&& GET_CODE (XEXP (operand1, 0)) == REG))
{
rtx temp = gen_reg_rtx (SImode);
- rtx shift_24 = gen_rtx (CONST_INT, VOIDmode, 24);
+ rtx shift_24 = GEN_INT (24);
int op0_subreg_word = 0;
int op1_subreg_word = 0;
@@ -1381,7 +1381,7 @@
op1_subreg_word = SUBREG_WORD (operand1);
operand1 = SUBREG_REG (operand1);
}
- operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word);
+ operand1 = gen_rtx_SUBREG (SImode, operand1, op1_subreg_word);
if (GET_CODE (operand0) == SUBREG)
{
@@ -1389,7 +1389,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));
@@ -1472,11 +1472,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;
}")
@@ -1494,11 +1495,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;
}")
@@ -1626,7 +1628,7 @@
;; (match_operand:SI 2 "power2_operand" "nI")))]
;; ""
;; "*{
-;; operands[2] = gen_rtx(CONST_INT, VOIDmode,bitpos (INTVAL (operands[2])));
+;; operands[2] = GEN_INT (bitpos (INTVAL (operands[2])));
;; return \"shrdi %2,%1,%0\";
;; }"
@@ -1688,8 +1690,7 @@
""
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- bitpos (~INTVAL (operands[2])));
+ operands[2] = GEN_INT (bitpos (~INTVAL (operands[2])));
return \"clrbit %2,%1,%0\";
}")
@@ -1740,8 +1741,7 @@
""
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- bitpos (INTVAL (operands[2])));
+ operands[2] = GEN_INT (bitpos (INTVAL (operands[2])));
return \"setbit %2,%1,%0\";
}")
@@ -1792,8 +1792,7 @@
""
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- bitpos (INTVAL (operands[2])));
+ operands[2] = GEN_INT (bitpos (INTVAL (operands[2])));
return \"notbit %2,%1,%0\";
}")
@@ -2342,22 +2341,18 @@
saved $rip value on the stack. Once we ret below, that value
will be loaded into the pc (IP). */
- emit_move_insn (gen_rtx (MEM, SImode,
- plus_constant (fp, 8)),
- new_pc);
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (fp, 8)), new_pc);
/* Next, we put the value into the static chain register's save
area on the stack. After the ret below, this will be loaded into
r3 (the static chain). */
- emit_move_insn (gen_rtx (MEM, SImode,
- plus_constant (fp, 12)),
- val);
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (fp, 12)), val);
/* We now load pfp (the previous frame pointer) with the value that
we want fp to be. */
- emit_move_insn (gen_rtx (REG, SImode, 16), fp);
+ emit_move_insn (gen_rtx_REG (SImode, 16), fp);
/* And finally, we can now just ret to get all the values saved
above into all the right registers, and also, all the local
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 48504a06e14..0684dc15bc3 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 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 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"
@@ -941,7 +941,7 @@ gen_compare (code, x, y)
{
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);
+ rtx cc_reg = gen_rtx_REG (mode, CARRY_REGNUM);
int swap_p = 0;
switch (code)
@@ -1077,9 +1077,9 @@ m32r_setup_incoming_varargs (cum, 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)));
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 c0df171dcfe..7019f45a794 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -678,10 +678,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. */
@@ -883,14 +885,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
@@ -988,11 +990,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. */
@@ -1072,13 +1074,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 4c8b2e54ffb..43baf114857 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 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
;; This file is part of GNU CC.
@@ -340,7 +340,8 @@
rtx mem = force_const_mem (DImode, operands[1]);
rtx reg = ((reload_in_progress || reload_completed)
? copy_to_suggested_reg (XEXP (mem, 0),
- gen_rtx (REG, Pmode, REGNO (operands[0])),
+ gen_rtx_REG (Pmode,
+ REGNO (operands[0])),
Pmode)
: force_reg (Pmode, XEXP (mem, 0)));
operands[1] = change_address (mem, DImode, reg);
@@ -408,8 +409,8 @@
(set (match_dup 3) (match_dup 5))]
"
{
- operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
- operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
+ operands[2] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN == 0);
+ operands[3] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN != 0);
split_double (operands[1], operands + 4, operands + 5);
}")
@@ -477,7 +478,8 @@
rtx mem = force_const_mem (DFmode, operands[1]);
rtx reg = ((reload_in_progress || reload_completed)
? copy_to_suggested_reg (XEXP (mem, 0),
- gen_rtx (REG, Pmode, REGNO (operands[0])),
+ gen_rtx_REG (Pmode,
+ REGNO (operands[0])),
Pmode)
: force_reg (Pmode, XEXP (mem, 0)));
operands[1] = change_address (mem, DFmode, reg);
@@ -598,7 +600,7 @@
"
{
rtx temp = gen_reg_rtx (SImode);
- rtx shift_24 = gen_rtx (CONST_INT, VOIDmode, 24);
+ rtx shift_24 = GEN_INT (24);
int op1_subword = 0;
int op0_subword = 0;
@@ -612,11 +614,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;
}")
@@ -635,7 +637,7 @@
"
{
rtx temp = gen_reg_rtx (SImode);
- rtx shift_24 = gen_rtx (CONST_INT, VOIDmode, 24);
+ rtx shift_24 = GEN_INT (24);
int op1_subword = 0;
if (GET_CODE (operand1) == SUBREG)
@@ -644,8 +646,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;
@@ -665,7 +666,7 @@
"
{
rtx temp = gen_reg_rtx (SImode);
- rtx shift_16 = gen_rtx (CONST_INT, VOIDmode, 16);
+ rtx shift_16 = GEN_INT (16);
int op1_subword = 0;
if (GET_CODE (operand1) == SUBREG)
@@ -674,8 +675,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 69ecb537224..2af1b9468cf 100644
--- a/gcc/config/m68k/a-ux.h
+++ b/gcc/config/m68k/a-ux.h
@@ -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.
@@ -167,9 +167,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..44101c850bd 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 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..9bce32b5496 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 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 9f2399da1e1..e2d01ad9d37 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 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -266,10 +266,10 @@ Boston, MA 02111-1307, USA. */
#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
@@ -295,8 +295,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. */
@@ -326,7 +326,7 @@ do { \
#undef FINALIZE_TRAMPOLINE
#define FINALIZE_TRAMPOLINE(TRAMP) \
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__clear_cache"), \
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \
0, VOIDmode, 2, TRAMP, Pmode, \
plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode);
diff --git a/gcc/config/m68k/lynx.h b/gcc/config/m68k/lynx.h
index 8c54b8bc13f..2a786127dc6 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, 1994, 1995, 1996, 1998 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 572ff14a303..111375c73db 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -18,10 +18,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. */
-
-/* Some output-actions in m68k.md need these. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -135,7 +133,7 @@ finalize_pic ()
{
if (flag_pic && current_function_uses_pic_offset_table)
{
- rtx insn = gen_rtx (USE, VOIDmode, pic_offset_table_rtx);
+ rtx insn = gen_rtx_USE (VOIDmode, pic_offset_table_rtx);
emit_insn_after (insn, get_insns ());
emit_insn (insn);
}
@@ -1027,14 +1025,14 @@ output_scc_di(op, operand1, operand2, dest)
}
loperands[0] = operand1;
if (GET_CODE (operand1) == REG)
- loperands[1] = gen_rtx (REG, SImode, REGNO (operand1) + 1);
+ loperands[1] = gen_rtx_REG (SImode, REGNO (operand1) + 1);
else
loperands[1] = adj_offsettable_operand (operand1, 4);
if (operand2 != const0_rtx)
{
loperands[2] = operand2;
if (GET_CODE (operand2) == REG)
- loperands[3] = gen_rtx (REG, SImode, REGNO (operand2) + 1);
+ loperands[3] = gen_rtx_REG (SImode, REGNO (operand2) + 1);
else
loperands[3] = adj_offsettable_operand (operand2, 4);
}
@@ -1308,9 +1306,9 @@ legitimize_pic_address (orig, mode, reg)
if (reg == 0)
abort ();
- pic_ref = gen_rtx (MEM, Pmode,
- gen_rtx (PLUS, Pmode,
- pic_offset_table_rtx, orig));
+ pic_ref = gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode,
+ pic_offset_table_rtx, orig));
current_function_uses_pic_offset_table = 1;
if (reload_in_progress)
regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
@@ -1341,7 +1339,7 @@ legitimize_pic_address (orig, mode, reg)
if (GET_CODE (orig) == CONST_INT)
return plus_constant_for_output (base, INTVAL (orig));
- pic_ref = gen_rtx (PLUS, Pmode, base, orig);
+ pic_ref = gen_rtx_PLUS (Pmode, base, orig);
/* Likewise, should we set special REG_NOTEs here? */
}
return pic_ref;
@@ -1423,14 +1421,14 @@ output_move_const_into_data_reg (operands)
return "moveq %1,%0";
#endif
case NOTB :
- operands[1] = gen_rtx (CONST_INT, VOIDmode, i ^ 0xff);
+ operands[1] = GEN_INT (i ^ 0xff);
#if defined (MOTOROLA) && !defined (CRDS)
return "moveq%.l %1,%0\n\tnot%.b %0";
#else
return "moveq %1,%0\n\tnot%.b %0";
#endif
case NOTW :
- operands[1] = gen_rtx (CONST_INT, VOIDmode, i ^ 0xffff);
+ operands[1] = GEN_INT (i ^ 0xffff);
#if defined (MOTOROLA) && !defined (CRDS)
return "moveq%.l %1,%0\n\tnot%.w %0";
#else
@@ -1446,7 +1444,7 @@ output_move_const_into_data_reg (operands)
{
unsigned u = i;
- operands[1] = gen_rtx (CONST_INT, VOIDmode, (u << 16) | (u >> 16));
+ operands[1] = GEN_INT ((u << 16) | (u >> 16));
#if defined (MOTOROLA) && !defined (CRDS)
return "moveq%.l %1,%0\n\tswap %0";
#else
@@ -1595,8 +1593,8 @@ output_move_qimode (operands)
{
xoperands[1] = operands[1];
xoperands[2]
- = gen_rtx (MEM, QImode,
- gen_rtx (PLUS, VOIDmode, stack_pointer_rtx, const1_rtx));
+ = gen_rtx_MEM (QImode,
+ gen_rtx_PLUS (VOIDmode, stack_pointer_rtx, const1_rtx));
/* Just pushing a byte puts it in the high byte of the halfword. */
/* We must put it in the low-order, high-numbered byte. */
if (!reg_mentioned_p (stack_pointer_rtx, operands[1]))
@@ -1765,11 +1763,11 @@ output_move_double (operands)
else
output_asm_insn ("subq%.l %#8,%0", operands);
if (GET_MODE (operands[1]) == XFmode)
- operands[0] = gen_rtx (MEM, XFmode, operands[0]);
+ operands[0] = gen_rtx_MEM (XFmode, operands[0]);
else if (GET_MODE (operands[0]) == DFmode)
- operands[0] = gen_rtx (MEM, DFmode, operands[0]);
+ operands[0] = gen_rtx_MEM (DFmode, operands[0]);
else
- operands[0] = gen_rtx (MEM, DImode, operands[0]);
+ operands[0] = gen_rtx_MEM (DImode, operands[0]);
optype0 = OFFSOP;
}
if (optype0 == POPOP && optype1 == PUSHOP)
@@ -1780,11 +1778,11 @@ output_move_double (operands)
else
output_asm_insn ("subq%.l %#8,%1", operands);
if (GET_MODE (operands[1]) == XFmode)
- operands[1] = gen_rtx (MEM, XFmode, operands[1]);
+ operands[1] = gen_rtx_MEM (XFmode, operands[1]);
else if (GET_MODE (operands[1]) == DFmode)
- operands[1] = gen_rtx (MEM, DFmode, operands[1]);
+ operands[1] = gen_rtx_MEM (DFmode, operands[1]);
else
- operands[1] = gen_rtx (MEM, DImode, operands[1]);
+ operands[1] = gen_rtx_MEM (DImode, operands[1]);
optype1 = OFFSOP;
}
@@ -1810,8 +1808,8 @@ output_move_double (operands)
{
if (optype0 == REGOP)
{
- latehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 2);
- middlehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ latehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 2);
+ middlehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
}
else if (optype0 == OFFSOP)
{
@@ -1826,8 +1824,8 @@ output_move_double (operands)
if (optype1 == REGOP)
{
- latehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 2);
- middlehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+ latehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
+ middlehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
}
else if (optype1 == OFFSOP)
{
@@ -1868,14 +1866,14 @@ output_move_double (operands)
/* size is not 12: */
{
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], size - 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], size - 4);
else if (optype1 == CNSTOP)
@@ -1900,7 +1898,7 @@ output_move_double (operands)
if (optype0 == REGOP
&& (optype1 == OFFSOP || optype1 == MEMOP))
{
- rtx testlow = gen_rtx (REG, SImode, REGNO (operands[0]));
+ rtx testlow = gen_rtx_REG (SImode, REGNO (operands[0]));
if (reg_overlap_mentioned_p (testlow, XEXP (operands[1], 0))
&& reg_overlap_mentioned_p (latehalf[0], XEXP (operands[1], 0)))
@@ -1914,13 +1912,13 @@ compadr:
output_asm_insn ("lea %a1,%0", xops);
if( GET_MODE (operands[1]) == XFmode )
{
- operands[1] = gen_rtx (MEM, XFmode, latehalf[0]);
+ operands[1] = gen_rtx_MEM (XFmode, latehalf[0]);
middlehalf[1] = adj_offsettable_operand (operands[1], size-8);
latehalf[1] = adj_offsettable_operand (operands[1], size-4);
}
else
{
- operands[1] = gen_rtx (MEM, DImode, latehalf[0]);
+ operands[1] = gen_rtx_MEM (DImode, latehalf[0]);
latehalf[1] = adj_offsettable_operand (operands[1], size-4);
}
}
@@ -2123,8 +2121,7 @@ output_addsi3 (operands)
if (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) >= -8)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- - 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
@@ -2135,15 +2132,13 @@ output_addsi3 (operands)
if (INTVAL (operands[2]) > 8
&& INTVAL (operands[2]) <= 16)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[2]) - 8);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
return "addq%.l %#8,%0\n\taddq%.l %2,%0";
}
if (INTVAL (operands[2]) < -8
&& INTVAL (operands[2]) >= -16)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- - INTVAL (operands[2]) - 8);
+ operands[2] = GEN_INT (- INTVAL (operands[2]) - 8);
return "subq%.l %#8,%0\n\tsubq%.l %2,%0";
}
}
@@ -3255,8 +3250,7 @@ output_andsi3 (operands)
{
if (GET_CODE (operands[0]) != REG)
operands[0] = adj_offsettable_operand (operands[0], 2);
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[2]) & 0xffff);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
/* Do not delete a following tstl %0 insn; that would be incorrect. */
CC_STATUS_INIT;
if (operands[2] == const0_rtx)
@@ -3270,12 +3264,12 @@ output_andsi3 (operands)
{
if (DATA_REG_P (operands[0]))
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, logval);
+ operands[1] = GEN_INT (logval);
}
else
{
operands[0] = adj_offsettable_operand (operands[0], 3 - (logval / 8));
- operands[1] = gen_rtx (CONST_INT, VOIDmode, logval % 8);
+ operands[1] = GEN_INT (logval % 8);
}
/* This does not set condition codes in a standard way. */
CC_STATUS_INIT;
@@ -3310,12 +3304,12 @@ output_iorsi3 (operands)
{
if (DATA_REG_P (operands[0]))
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, logval);
+ operands[1] = GEN_INT (logval);
}
else
{
operands[0] = adj_offsettable_operand (operands[0], 3 - (logval / 8));
- operands[1] = gen_rtx (CONST_INT, VOIDmode, logval % 8);
+ operands[1] = GEN_INT (logval % 8);
}
CC_STATUS_INIT;
return "bset %1,%0";
@@ -3348,12 +3342,12 @@ output_xorsi3 (operands)
{
if (DATA_REG_P (operands[0]))
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, logval);
+ operands[1] = GEN_INT (logval);
}
else
{
operands[0] = adj_offsettable_operand (operands[0], 3 - (logval / 8));
- operands[1] = gen_rtx (CONST_INT, VOIDmode, logval % 8);
+ operands[1] = GEN_INT (logval % 8);
}
CC_STATUS_INIT;
return "bchg %1,%0";
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 1ede7cf453d..7782c73f40b 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -887,14 +887,14 @@ extern enum reg_class regno_reg_class[];
/* On the 68000 the return value is in D0 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 68000 the return value is in D0 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 68000, d0 is the only register thus used. */
@@ -964,7 +964,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.
@@ -1234,11 +1234,11 @@ while(0)
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \
- emit_move_insn (gen_rtx (MEM, HImode, TRAMP), GEN_INT(0x207C)); \
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 2)), CXT); \
- emit_move_insn (gen_rtx (MEM, HImode, plus_constant (TRAMP, 6)), \
+ emit_move_insn (gen_rtx_MEM (HImode, TRAMP), GEN_INT(0x207C)); \
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 2)), CXT); \
+ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), \
GEN_INT(0x4EF9)); \
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 8)), FNADDR); \
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 8)), FNADDR); \
FINALIZE_TRAMPOLINE(TRAMP); \
}
@@ -1798,7 +1798,7 @@ __transfer_from_trampoline () \
/* Before the prologue, RA is at 0(%sp). */
#define INCOMING_RETURN_ADDR_RTX \
- gen_rtx (MEM, VOIDmode, gen_rtx (REG, VOIDmode, STACK_POINTER_REGNUM))
+ gen_rtx_MEM (VOIDmode, gen_rtx_REG (VOIDmode, STACK_POINTER_REGNUM))
/* We must not use the DBX register numbers for the DWARF 2 CFA column
numbers because that maps to numbers beyond FIRST_PSEUDO_REGISTER.
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 7b9d3860594..5424f53e46f 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -813,7 +813,7 @@
"(unsigned) INTVAL (operands[1]) < 8 && !TARGET_5200"
"*
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, 7 - INTVAL (operands[1]));
+ operands[1] = GEN_INT (7 - INTVAL (operands[1]));
return output_btst (operands, operands[1], operands[0], insn, 7);
}")
@@ -828,12 +828,10 @@
{
operands[0] = adj_offsettable_operand (operands[0],
INTVAL (operands[1]) / 8);
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- 7 - INTVAL (operands[1]) % 8);
+ operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8);
return output_btst (operands, operands[1], operands[0], insn, 7);
}
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- 31 - INTVAL (operands[1]));
+ operands[1] = GEN_INT (31 - INTVAL (operands[1]));
return output_btst (operands, operands[1], operands[0], insn, 31);
}")
@@ -851,12 +849,10 @@
{
operands[0] = adj_offsettable_operand (operands[0],
INTVAL (operands[1]) / 8);
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- 7 - INTVAL (operands[1]) % 8);
+ operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8);
return output_btst (operands, operands[1], operands[0], insn, 7);
}
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- 31 - INTVAL (operands[1]));
+ operands[1] = GEN_INT (31 - INTVAL (operands[1]));
return output_btst (operands, operands[1], operands[0], insn, 31);
}")
@@ -1182,7 +1178,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\";
@@ -1196,7 +1192,7 @@
if (REG_P (operands[0]))
{
output_asm_insn (\"fmove%.d %f1,%-\;move%.l %+,%0\", operands);
- operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
return \"move%.l %+,%0\";
}
else
@@ -1240,9 +1236,9 @@
if (REG_P (operands[1]))
{
rtx xoperands[2];
- xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 2);
+ xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
output_asm_insn (\"move%.l %1,%-\", xoperands);
- 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 \"fmove%.x %+,%0\";
@@ -1254,9 +1250,9 @@
if (REG_P (operands[0]))
{
output_asm_insn (\"fmove%.x %f1,%-\;move%.l %+,%0\", operands);
- operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
output_asm_insn (\"move%.l %+,%0\", operands);
- operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
return \"move%.l %+,%0\";
}
return \"fmove%.x %f1,%0\";
@@ -1276,9 +1272,9 @@
if (REG_P (operands[1]))
{
rtx xoperands[2];
- xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 2);
+ xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
output_asm_insn (\"move%.l %1,%-\", xoperands);
- 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 \"fmove%.x %+,%0\";
@@ -1292,9 +1288,9 @@
if (REG_P (operands[0]))
{
output_asm_insn (\"fmove%.x %f1,%-\;move%.l %+,%0\", operands);
- operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
output_asm_insn (\"move%.l %+,%0\", operands);
- operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
return \"move%.l %+,%0\";
}
else
@@ -1340,7 +1336,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 \"fmove%.d %+,%0\";
@@ -1354,7 +1350,7 @@
if (REG_P (operands[0]))
{
output_asm_insn (\"fmove%.d %f1,%-\;move%.l %+,%0\", operands);
- operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
return \"move%.l %+,%0\";
}
else
@@ -1456,7 +1452,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\";
}")
@@ -1467,7 +1463,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\";
}")
@@ -1480,7 +1476,7 @@
{
CC_STATUS_INIT;
if (GET_CODE (operands[0]) == REG)
- operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
return \"move%.l %1,%0\;clr%.l %0\";
else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
@@ -1506,10 +1502,10 @@
{
operands[1] = make_safe_from (operands[1], operands[0]);
if (GET_CODE (operands[0]) == SUBREG)
- operands[2] = gen_rtx (SUBREG, HImode, SUBREG_REG (operands[0]),
- SUBREG_WORD (operands[0]));
+ operands[2] = gen_rtx_SUBREG (HImode, SUBREG_REG (operands[0]),
+ SUBREG_WORD (operands[0]));
else
- operands[2] = gen_rtx (SUBREG, HImode, operands[0], 0);
+ operands[2] = gen_rtx_SUBREG (HImode, operands[0], 0);
}")
(define_expand "zero_extendqihi2"
@@ -1522,10 +1518,10 @@
{
operands[1] = make_safe_from (operands[1], operands[0]);
if (GET_CODE (operands[0]) == SUBREG)
- operands[2] = gen_rtx (SUBREG, QImode, SUBREG_REG (operands[0]),
- SUBREG_WORD (operands[0]));
+ operands[2] = gen_rtx_SUBREG (QImode, SUBREG_REG (operands[0]),
+ SUBREG_WORD (operands[0]));
else
- operands[2] = gen_rtx (SUBREG, QImode, operands[0], 0);
+ operands[2] = gen_rtx_SUBREG (QImode, operands[0], 0);
}")
(define_expand "zero_extendqisi2"
@@ -1538,10 +1534,10 @@
{
operands[1] = make_safe_from (operands[1], operands[0]);
if (GET_CODE (operands[0]) == SUBREG)
- operands[2] = gen_rtx (SUBREG, QImode, SUBREG_REG (operands[0]),
- SUBREG_WORD (operands[0]));
+ operands[2] = gen_rtx_SUBREG (QImode, SUBREG_REG (operands[0]),
+ SUBREG_WORD (operands[0]));
else
- operands[2] = gen_rtx (SUBREG, QImode, operands[0], 0);
+ operands[2] = gen_rtx_SUBREG (QImode, operands[0], 0);
}")
;; Patterns to recognize zero-extend insns produced by the combiner.
@@ -1600,8 +1596,8 @@
== STACK_POINTER_REGNUM)
{
output_asm_insn (\"clr%.w %-\", operands);
- operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
- plus_constant (stack_pointer_rtx, 1));
+ operands[0] = gen_rtx_MEM (GET_MODE (operands[0]),
+ plus_constant (stack_pointer_rtx, 1));
return \"move%.b %1,%0\";
}
else
@@ -1678,7 +1674,7 @@
"*
{
CC_STATUS_INIT;
- operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
if (TARGET_68020 || TARGET_5200)
return \"move%.b %1,%2\;extb%.l %2\;smi %0\;extb%.l %0\";
else
@@ -1693,7 +1689,7 @@
"*
{
CC_STATUS_INIT;
- operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
if (TARGET_68020 || TARGET_5200)
return \"move%.w %1,%2\;ext%.l %2\;smi %0\;extb%.l %0\";
else
@@ -1708,7 +1704,7 @@
"*
{
CC_STATUS_INIT;
- operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
if (TARGET_68020 || TARGET_5200)
return \"move%.l %1,%2\;smi %0\;extb%.l %0\";
else
@@ -1727,7 +1723,7 @@
"*
{
CC_STATUS_INIT;
- operands[3] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
if (GET_CODE (operands[1]) == CONST_INT
&& (unsigned) INTVAL (operands[1]) > 8)
{
@@ -1811,7 +1807,7 @@
if (DATA_REG_P (operands[0]) && FP_REG_P (operands[1]))
{
output_asm_insn (\"fmove%.d %f1,%-\;move%.l %+,%0\", operands);
- operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
return \"move%.l %+,%0\";
}
return \"fmove%.d %f1,%0\";
@@ -2052,12 +2048,12 @@
""
"*
{
- operands[3] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
if (REG_P (operands[1]) && REGNO (operands[1]) == REGNO (operands[0]))
return
\"move%.l %1,%2\;add%.l %2,%2\;subx%.l %2,%2\;sub%.l %2,%3\;subx%.l %2,%0\";
if (GET_CODE (operands[1]) == REG)
- operands[4] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+ operands[4] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
else if (GET_CODE (XEXP (operands[1], 0)) == POST_INC
|| GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)
operands[4] = operands[1];
@@ -2109,7 +2105,7 @@
{
CC_STATUS_INIT;
if (GET_CODE (operands[0]) == REG)
- operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
else
operands[2] = adj_offsettable_operand (operands[0], 4);
return \"add%.l %1,%2\;negx%.l %0\;neg%.l %0\";
@@ -2128,7 +2124,7 @@
{
CC_STATUS_INIT;
if (GET_CODE (operands[1]) == REG)
- operands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+ operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
else
operands[1] = adj_offsettable_operand (operands[1], 4);
return \"add%.l %1,%0\";
@@ -2148,32 +2144,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)
{
@@ -2206,9 +2203,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_rtx (CONST_INT, VOIDmode, -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)
@@ -2237,9 +2233,9 @@
if (GET_CODE (operands[0]) == MEM)
{
if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
- operands[0] = gen_rtx (MEM, SImode, XEXP (XEXP (operands[0], 0), 0));
+ operands[0] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
- operands[2] = gen_rtx (MEM, SImode, XEXP (XEXP (operands[0], 0), 0));
+ operands[2] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
}
output_asm_insn (\"move%.l %1,%0\", operands);
#ifdef MOTOROLA
@@ -2306,8 +2302,7 @@
which could confuse us. */
if (INTVAL (operands[2]) >= 32768)
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[2]) - 65536);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 65536);
if (INTVAL (operands[2]) > 0
&& INTVAL (operands[2]) <= 8)
@@ -2315,8 +2310,7 @@
if (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) >= -8)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- - 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
@@ -2327,15 +2321,13 @@
if (INTVAL (operands[2]) > 8
&& INTVAL (operands[2]) <= 16)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[2]) - 8);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
return \"addq%.w %#8,%0\;addq%.w %2,%0\";
}
if (INTVAL (operands[2]) < -8
&& INTVAL (operands[2]) >= -16)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- - INTVAL (operands[2]) - 8);
+ operands[2] = GEN_INT (- INTVAL (operands[2]) - 8);
return \"subq%.w %#8,%0\;subq%.w %2,%0\";
}
}
@@ -2372,8 +2364,7 @@
which could confuse us. */
if (INTVAL (operands[1]) >= 32768)
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[1]) - 65536);
+ operands[1] = GEN_INT (INTVAL (operands[1]) - 65536);
if (INTVAL (operands[1]) > 0
&& INTVAL (operands[1]) <= 8)
@@ -2381,8 +2372,7 @@
if (INTVAL (operands[1]) < 0
&& INTVAL (operands[1]) >= -8)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- - 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
@@ -2393,15 +2383,13 @@
if (INTVAL (operands[1]) > 8
&& INTVAL (operands[1]) <= 16)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[1]) - 8);
+ operands[1] = GEN_INT (INTVAL (operands[1]) - 8);
return \"addq%.w %#8,%0\;addq%.w %1,%0\";
}
if (INTVAL (operands[1]) < -8
&& INTVAL (operands[1]) >= -16)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- - INTVAL (operands[1]) - 8);
+ operands[1] = GEN_INT (- INTVAL (operands[1]) - 8);
return \"subq%.w %#8,%0\;subq%.w %1,%0\";
}
}
@@ -2432,8 +2420,7 @@
which could confuse us. */
if (INTVAL (operands[1]) >= 32768)
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[1]) - 65536);
+ operands[1] = GEN_INT (INTVAL (operands[1]) - 65536);
if (INTVAL (operands[1]) > 0
&& INTVAL (operands[1]) <= 8)
@@ -2441,8 +2428,7 @@
if (INTVAL (operands[1]) < 0
&& INTVAL (operands[1]) >= -8)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- - 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
@@ -2453,15 +2439,13 @@
if (INTVAL (operands[1]) > 8
&& INTVAL (operands[1]) <= 16)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[1]) - 8);
+ operands[1] = GEN_INT (INTVAL (operands[1]) - 8);
return \"addq%.w %#8,%0\;addq%.w %1,%0\";
}
if (INTVAL (operands[1]) < -8
&& INTVAL (operands[1]) >= -16)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- - INTVAL (operands[1]) - 8);
+ operands[1] = GEN_INT (- INTVAL (operands[1]) - 8);
return \"subq%.w %#8,%0\;subq%.w %1,%0\";
}
}
@@ -2487,15 +2471,14 @@
if (GET_CODE (operands[2]) == CONST_INT)
{
if (INTVAL (operands[2]) >= 128)
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[2]) - 256);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 256);
if (INTVAL (operands[2]) > 0
&& INTVAL (operands[2]) <= 8)
return \"addq%.b %2,%0\";
if (INTVAL (operands[2]) < 0 && INTVAL (operands[2]) >= -8)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[2]));
+ operands[2] = GEN_INT (- INTVAL (operands[2]));
return \"subq%.b %2,%0\";
}
}
@@ -2514,15 +2497,14 @@
if (GET_CODE (operands[1]) == CONST_INT)
{
if (INTVAL (operands[1]) >= 128)
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[1]) - 256);
+ operands[1] = GEN_INT (INTVAL (operands[1]) - 256);
if (INTVAL (operands[1]) > 0
&& INTVAL (operands[1]) <= 8)
return \"addq%.b %1,%0\";
if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[1]));
+ operands[1] = GEN_INT (- INTVAL (operands[1]));
return \"subq%.b %1,%0\";
}
}
@@ -2541,15 +2523,14 @@
if (GET_CODE (operands[1]) == CONST_INT)
{
if (INTVAL (operands[1]) >= 128)
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[1]) - 256);
+ operands[1] = GEN_INT (INTVAL (operands[1]) - 256);
if (INTVAL (operands[1]) > 0
&& INTVAL (operands[1]) <= 8)
return \"addq%.b %1,%0\";
if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[1]));
+ operands[1] = GEN_INT (- INTVAL (operands[1]));
return \"subq%.b %1,%0\";
}
}
@@ -2699,7 +2680,7 @@
{
CC_STATUS_INIT;
if (GET_CODE (operands[1]) == REG)
- operands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+ operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
else
operands[1] = adj_offsettable_operand (operands[1], 4);
return \"sub%.l %1,%0\";
@@ -2724,27 +2705,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)
{
@@ -2777,9 +2761,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_rtx (CONST_INT, VOIDmode, -8)));
+ operands[1]
+ = 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)
@@ -3276,7 +3259,7 @@
&& floating_exact_log2 (operands[2]) && !TARGET_68040 && !TARGET_68060)
{
int i = floating_exact_log2 (operands[2]);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, i);
+ operands[2] = GEN_INT (i);
return \"fscale%.l %2,%0\";
}
if (REG_P (operands[2]))
@@ -3598,21 +3581,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 :
@@ -3630,7 +3604,7 @@
}
}
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);
switch (INTVAL (lo))
@@ -3747,7 +3721,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)
@@ -3771,21 +3745,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 :
@@ -3805,7 +3770,7 @@
}
}
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);
switch (INTVAL (lo))
@@ -3958,21 +3923,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 :
@@ -3992,7 +3949,7 @@
}
}
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);
switch (INTVAL (lo))
@@ -4120,7 +4077,7 @@
if (which_alternative == 0)
return \"neg%.l %0\;negx%.l %0\";
if (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);
else
operands[1] = adj_offsettable_operand (operands[0], 4);
if (ADDRESS_REG_P (operands[0]))
@@ -4135,7 +4092,7 @@
"TARGET_5200"
"*
{
- operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
return \"neg%.l %1\;negx%.l %0\";
} ")
@@ -4204,7 +4161,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 ();
@@ -4231,7 +4188,7 @@
{
if (DATA_REG_P (operands[0]))
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, 31);
+ operands[1] = GEN_INT (31);
return \"bchg %1,%0\";
}
if (REG_P (operands[1]) && ! DATA_REG_P (operands[1]))
@@ -4255,7 +4212,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 ();
@@ -4287,7 +4244,7 @@
{
if (DATA_REG_P (operands[0]))
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, 31);
+ operands[1] = GEN_INT (31);
return \"bchg %1,%0\";
}
if (REG_P (operands[1]) && ! DATA_REG_P (operands[1]))
@@ -4338,7 +4295,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 ();
@@ -4384,7 +4341,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 ();
@@ -4430,7 +4387,7 @@
{
CC_STATUS_INIT;
if (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);
else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC
|| GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
operands[1] = operands[0];
@@ -4502,7 +4459,7 @@
{
CC_STATUS_INIT;
if (GET_CODE (operands[0]) == REG)
- operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
else
operands[2] = adj_offsettable_operand (operands[0], 4);
if (ADDRESS_REG_P (operands[0]))
@@ -4547,11 +4504,11 @@
{
CC_STATUS_INIT;
if (GET_CODE (operands[1]) == REG)
- operands[3] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+ operands[3] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
else
operands[3] = adj_offsettable_operand (operands[1], 4);
if (GET_CODE (operands[0]) == REG)
- operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
return \"clr%.l %0\;move%.l %3,%0\";
else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
@@ -4574,7 +4531,7 @@
|| (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63))"
"*
{
- operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
if (INTVAL (operands[2]) == 1)
return \"add%.l %1,%1\;addx%.l %0,%0\";
else if (INTVAL (operands[2]) == 8)
@@ -4589,7 +4546,7 @@
return \"add%.l %1,%1\;addx%.l %0,%0\;add%.l %1,%1\;addx%.l %0,%0\;add%.l %1,%1\;addx%.l %0,%0\";
else /* 32 < INTVAL (operands[2]) <= 63 */
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) - 32);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
output_asm_insn (INTVAL (operands[2]) <= 8 ? \"asl%.l %2,%1\" :
\"moveq %2,%0\;asl%.l %0,%1\", operands);
return \"mov%.l %1,%0\;moveq %#0,%1\";
@@ -4638,7 +4595,7 @@
{
CC_STATUS_INIT;
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) - 16);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 16);
return \"lsl%.w %2,%0\;swap %0\;clr%.w %0\";
}")
@@ -4704,7 +4661,7 @@
&& INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 24)"
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) - 16);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 16);
return \"swap %0\;asr%.w %2,%0\;ext%.l %0\";
}")
@@ -4738,7 +4695,7 @@
"*
{
CC_STATUS_INIT;
- operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
if (TARGET_68020)
return \"move%.l %1,%2\;smi %0\;extb%.l %0\";
else
@@ -4776,7 +4733,7 @@
|| (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63))"
"*
{
- operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
if (INTVAL (operands[2]) == 63)
return \"add%.l %0,%0\;subx%.l %0,%0\;move%.l %0,%1\";
CC_STATUS_INIT;
@@ -4796,7 +4753,7 @@
return \"asr%.l %#1,%0\;roxr%.l %#1,%1\;asr%.l %#1,%0\;roxr%.l %#1,%1\;asr%.l %#1,%0\;roxr%.l %#1,%1\";
else /* 32 < INTVAL (operands[2]) <= 63 */
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) - 32);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
output_asm_insn (INTVAL (operands[2]) <= 8 ? \"asr%.l %2,%0\" :
\"moveq %2,%1\;asr%.l %1,%0\", operands);
output_asm_insn (\"mov%.l %0,%1\;smi %0\", operands);
@@ -4893,7 +4850,7 @@
;; "*
;;{
;; if (GET_CODE (operands[1]) == REG)
-;; operands[2] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+;; operands[2] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
;; else
;; operands[2] = adj_offsettable_operand (operands[1], 4);
;; return \"move%.l %0,%2\;clr%.l %1\";
@@ -4922,11 +4879,11 @@
if (which_alternative == 2)
return \"clr%.l %0\;move%.l %1,%0\";
if (GET_CODE (operands[0]) == REG)
- operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
else
operands[2] = adj_offsettable_operand (operands[0], 4);
if (GET_CODE (operands[1]) == REG)
- operands[3] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+ operands[3] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
else
operands[3] = adj_offsettable_operand (operands[1], 4);
if (ADDRESS_REG_P (operands[0]))
@@ -4946,7 +4903,7 @@
|| (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63))"
"*
{
- operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
if (INTVAL (operands[2]) == 63)
return \"add%.l %0,%0\;clr%.l %0\;clr%.l %1\;addx%.l %1,%1\";
CC_STATUS_INIT;
@@ -4964,7 +4921,7 @@
return \"lsr%.l %#1,%0\;roxr%.l %#1,%1\;lsr%.l %#1,%0\;roxr%.l %#1,%1\;lsr%.l %#1,%0\;roxr%.l %#1,%1\";
else /* 32 < INTVAL (operands[2]) <= 63 */
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) - 32);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
output_asm_insn (INTVAL (operands[2]) <= 8 ? \"lsr%.l %2,%0\" :
\"moveq %2,%1\;lsr%.l %1,%0\", operands);
return \"mov%.l %0,%1\;moveq %#0,%0\";
@@ -5021,7 +4978,7 @@
"*
{
/* I think lsr%.w sets the CC properly. */
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) - 16);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 16);
return \"clr%.w %0\;swap %0\;lsr%.w %2,%0\";
}")
@@ -5073,7 +5030,7 @@
return \"swap %0\";
else if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 16)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, 32 - INTVAL (operands[2]));
+ operands[2] = GEN_INT (32 - INTVAL (operands[2]));
return \"ror%.l %2,%0\";
}
else
@@ -5089,7 +5046,7 @@
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 8)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, 16 - INTVAL (operands[2]));
+ operands[2] = GEN_INT (16 - INTVAL (operands[2]));
return \"ror%.w %2,%0\";
}
else
@@ -5105,7 +5062,7 @@
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 8)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, 16 - INTVAL (operands[2]));
+ operands[2] = GEN_INT (16 - INTVAL (operands[2]));
return \"ror%.w %2,%0\";
}
else
@@ -5121,7 +5078,7 @@
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 4)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, 8 - INTVAL (operands[2]));
+ operands[2] = GEN_INT (8 - INTVAL (operands[2]));
return \"ror%.b %2,%0\";
}
else
@@ -5137,7 +5094,7 @@
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 4)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, 8 - INTVAL (operands[2]));
+ operands[2] = GEN_INT (8 - INTVAL (operands[2]));
return \"ror%.b %2,%0\";
}
else
@@ -5593,10 +5550,8 @@
{
int width = GET_CODE (operands[0]) == REG ? 31 : 7;
return output_btst (operands,
- gen_rtx (CONST_INT, VOIDmode,
- width - INTVAL (operands[2])),
- operands[0],
- insn, 1000);
+ 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. */
@@ -5620,11 +5575,8 @@
&& GET_CODE (operands[2]) == CONST_INT)
{
int width = GET_CODE (operands[0]) == REG ? 31 : 7;
- return output_btst (operands,
- gen_rtx (CONST_INT, VOIDmode,
- 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. */
@@ -5898,7 +5850,7 @@
#endif
}
if (GET_CODE (operands[0]) == REG)
- operands[3] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
else
operands[3] = adj_offsettable_operand (operands[0], 4);
if (! ADDRESS_REG_P (operands[0]))
@@ -5959,7 +5911,7 @@
}
CC_STATUS_INIT;
if (GET_CODE (operands[0]) == REG)
- operands[3] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
else
operands[3] = adj_offsettable_operand (operands[0], 4);
if (!ADDRESS_REG_P (operands[0]))
@@ -6425,8 +6377,8 @@
"
{
#ifdef CASE_VECTOR_PC_RELATIVE
- operands[0] = gen_rtx (PLUS, SImode, pc_rtx,
- gen_rtx (SIGN_EXTEND, SImode, operands[0]));
+ operands[0] = gen_rtx_PLUS (SImode, pc_rtx,
+ gen_rtx_SIGN_EXTEND (SImode, operands[0]));
#endif
}")
@@ -6904,8 +6856,7 @@
"NEED_PROBE"
"*
{
- operands[0] = gen_rtx (PLUS, SImode, stack_pointer_rtx,
- gen_rtx (CONST_INT, VOIDmode, NEED_PROBE));
+ operands[0] = plus_constant (stack_pointer_rtx, NEED_PROBE);
return \"tstl %a0\";
}")
@@ -6917,7 +6868,7 @@
{
if (current_function_pops_args == 0)
return \"rts\";
- operands[0] = gen_rtx (CONST_INT, VOIDmode, current_function_pops_args);
+ operands[0] = GEN_INT (current_function_pops_args);
return \"rtd %0\";
}")
@@ -6981,7 +6932,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 (\"move%.l %1,%@\", xoperands);
output_asm_insn (\"move%.l %1,%-\", operands);
return \"fmove%.d %+,%0\";
@@ -7005,7 +6956,7 @@
{
rtx xoperands[2];
xoperands[0] = stack_pointer_rtx;
- xoperands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[0]) - 4);
+ xoperands[1] = GEN_INT (INTVAL (operands[0]) - 4);
#ifndef NO_ADDSUB_Q
if (INTVAL (xoperands[1]) <= 8)
{
@@ -7016,8 +6967,7 @@
}
else if (TARGET_CPU32 && INTVAL (xoperands[1]) <= 16)
{
- xoperands[1] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (xoperands[1]) - 8);
+ xoperands[1] = GEN_INT (INTVAL (xoperands[1]) - 8);
output_asm_insn (\"addq%.w %#8,%0\;addq%.w %1,%0\", xoperands);
}
else
@@ -7056,7 +7006,7 @@
{
rtx xoperands[2];
xoperands[0] = stack_pointer_rtx;
- xoperands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[0]) - 4);
+ xoperands[1] = GEN_INT (INTVAL (operands[0]) - 4);
#ifndef NO_ADDSUB_Q
if (INTVAL (xoperands[1]) <= 8)
{
@@ -7067,8 +7017,7 @@
}
else if (TARGET_CPU32 && INTVAL (xoperands[1]) <= 16)
{
- xoperands[1] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (xoperands[1]) - 8);
+ xoperands[1] = GEN_INT (INTVAL (xoperands[1]) - 8);
output_asm_insn (\"addq%.w %#8,%0\;addq%.w %1,%0\", xoperands);
}
else
@@ -7110,9 +7059,7 @@
xoperands[1] = operands[1];
xoperands[2]
- = gen_rtx (MEM, QImode,
- gen_rtx (PLUS, VOIDmode, stack_pointer_rtx,
- gen_rtx (CONST_INT, VOIDmode, 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);
@@ -7455,7 +7402,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\";
@@ -7477,7 +7424,7 @@
if (REG_P (operands[0]))
{
output_asm_insn (\"fmove%.d %f1,%-\;move%.l %+,%0\", operands);
- operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
return \"move%.l %+,%0\";
}
return \"fmove%.d %f1,%0\";
@@ -7687,7 +7634,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 ();
@@ -7736,7 +7683,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 4c02e1be6e6..79b47a28487 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 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 a40d919990d..90cef1d2688 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 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
@@ -196,8 +196,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_rtx (CONST_INT, VOIDmode, 0x227a)); \
- ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 8)); \
- ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x2f3a)); \
- ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 8)); \
- ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 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 65c2f476043..a90332efff5 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 Free Software Foundation, Inc.
+ Copyright (C) 1987, 93, 94, 95, 96, 97, 1998 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).
@@ -295,20 +295,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. */
@@ -769,8 +770,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) \
@@ -812,5 +813,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..c786b33e96f 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, 97, 1998 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..562820c6c3b 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, 1998 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..63daa6537ce 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, 1998 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 7c2debe018e..c11dadc9186 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 Free Software Foundation, Inc.
+ Copyright (C) 1988, 92-97, 1998 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@mcc.com)
Currently maintained by (gcc@dg-rtp.dg.com)
@@ -21,12 +21,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"
@@ -42,8 +37,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;
@@ -238,7 +231,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;
}
}
@@ -248,7 +241,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)
@@ -270,7 +263,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);
}
}
@@ -317,28 +310,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)
@@ -382,7 +380,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? */
}
}
@@ -396,15 +394,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_VOLATILE_P (new) = MEM_VOLATILE_P (orig);
MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (orig);
@@ -529,7 +527,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,
@@ -537,7 +535,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,26 +594,25 @@ block_move_loop (dest, dest_mem, src, src_mem, size, align)
GET_MODE_NAME (mode), MOVSTR_LOOP, units * align);
entry_name = get_identifier (entry);
- offset_rtx = gen_rtx (CONST_INT, VOIDmode,
- MOVSTR_LOOP + (1 - units) * 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_VOLATILE_P (value_rtx) = MEM_VOLATILE_P (src_mem);
MEM_IN_STRUCT_P (value_rtx) = MEM_IN_STRUCT_P (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 (CONST_INT, VOIDmode, count)));
+ 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);
}
@@ -654,12 +651,13 @@ block_move_no_loop (dest, dest_mem, src, src_mem, size, align)
GET_MODE_NAME (mode), most, size - remainder);
entry_name = get_identifier (entry);
- offset_rtx = gen_rtx (CONST_INT, VOIDmode, most - (size - remainder));
+ 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_VOLATILE_P (value_rtx) = MEM_VOLATILE_P (src_mem);
MEM_IN_STRUCT_P (value_rtx) = MEM_IN_STRUCT_P (src_mem);
@@ -668,13 +666,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);
}
@@ -729,14 +727,13 @@ 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_rtx (CONST_INT, SImode, 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_VOLATILE_P (srcp) = MEM_VOLATILE_P (src_mem);
MEM_IN_STRUCT_P (srcp) = MEM_IN_STRUCT_P (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;
}
@@ -744,14 +741,14 @@ 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_rtx (CONST_INT, SImode, 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_VOLATILE_P (dstp) = MEM_VOLATILE_P (dest_mem);
MEM_IN_STRUCT_P (dstp) = MEM_IN_STRUCT_P (dest_mem);
- emit_insn (gen_rtx (SET, VOIDmode, dstp, temp[phase]));
+ emit_insn (gen_rtx_SET (VOIDmode, dstp, temp[phase]));
offset_st += amount[phase];
}
}
@@ -934,9 +931,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;
@@ -1167,7 +1164,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;
@@ -1993,13 +1990,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));
@@ -2102,10 +2099,11 @@ emit_add (dstreg, srcreg, amount)
rtx srcreg;
int amount;
{
- rtx incr = gen_rtx (CONST_INT, VOIDmode, abs (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;
}
@@ -2218,22 +2216,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_rtx (CONST_INT, VOIDmode, offset);
- rtx temp = gen_rtx (REG, SImode, TEMP_REGNUM);
- rtx regi = gen_rtx (PLUS, SImode, stack_pointer_rtx, temp);
+ rtx disp = GEN_INT (offset);
+ 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)
@@ -2572,9 +2571,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'. The argument is ignored;
@@ -2599,7 +2597,7 @@ m88k_builtin_saveregs (arglist)
{
fixed = (XINT (current_function_arg_offset_rtx, 0)
+ argadj) / UNITS_PER_WORD;
- argsize = gen_rtx (CONST_INT, VOIDmode, fixed);
+ argsize = GEN_INT (fixed);
}
else
{
@@ -2645,7 +2643,7 @@ m88k_builtin_saveregs (arglist)
UNITS_PER_WORD * (8 - fixed));
}
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
{
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
block, ptr_mode,
@@ -2691,15 +2689,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
@@ -2728,7 +2725,7 @@ emit_bcnd (op, label)
{
if (SMALL_INTVAL (-value))
emit_insn (gen_addsi3 (zero, reg,
- gen_rtx (CONST_INT, VOIDmode, -value)));
+ GEN_INT (-value)));
else
emit_insn (gen_xorsi3 (zero, reg, constant));
diff --git a/gcc/config/m88k/m88k.h b/gcc/config/m88k/m88k.h
index 100922de129..5c069a51847 100644
--- a/gcc/config/m88k/m88k.h
+++ b/gcc/config/m88k/m88k.h
@@ -198,13 +198,13 @@ extern char * reg_names[];
Redefined in sysv4.h, and luna.h. */
#define VERSION_INFO1 "m88k, "
#ifndef VERSION_INFO2
-#define VERSION_INFO2 "$Revision: 1.76 $"
+#define VERSION_INFO2 "$Revision: 1.77 $"
#endif
#ifndef VERSION_STRING
#define VERSION_STRING version_string
#ifdef __STDC__
-#define TM_RCS_ID "@(#)" __FILE__ " $Revision: 1.76 $ " __DATE__
+#define TM_RCS_ID "@(#)" __FILE__ " $Revision: 1.77 $ " __DATE__
#else
#define TM_RCS_ID "$What: <@(#) m88k.h,v 1.1.1.2.2.2> $"
#endif /* __STDC__ */
@@ -992,9 +992,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) ... */
@@ -1014,7 +1013,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. */
@@ -1241,8 +1240,8 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
#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 ***/
@@ -1420,23 +1419,23 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
#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 9bf439cbc76..9af9d17e17a 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, 93, 94, 95, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 92, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
;; Contributed by Michael Tiemann (tiemann@mcc.com)
;; Currently maintained by (gcc@dg-rtp.dg.com)
@@ -367,8 +367,7 @@
"mak_mask_p (INTVAL (operands[3]) >> INTVAL (operands[2]))"
"*
{
- operands[4] = gen_rtx (CONST_INT, SImode,
- exact_log2 (1 + (INTVAL (operands[3])
+ operands[4] = GEN_INT (exact_log2 (1 + (INTVAL (operands[3])
>> INTVAL(operands[2]))));
return \"mak %0,%1,%4<%2>\";
}"
@@ -386,8 +385,7 @@
"*
{
operands[2]
- = gen_rtx (CONST_INT, SImode,
- ((1 << INTVAL (operands[2])) - 1) << INTVAL (operands[4]));
+ = GEN_INT (((1 << INTVAL (operands[2])) - 1) << INTVAL (operands[4]));
return output_and (operands);
}"
[(set_attr "type" "marith")]) ; arith,bit,marith. length is 1 or 2.
@@ -434,25 +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_rtx (CONST_INT, VOIDmode,
- ((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
@@ -472,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
@@ -481,9 +479,8 @@
int cv1 = condition_value (operands[1]);
int cv2 = condition_value (operands[3]);
- operands[4] = gen_rtx (ROTATE, CCmode, operands[4],
- gen_rtx (CONST_INT, VOIDmode,
- (cv2 - cv1) & 0x1f));
+ operands[4] = gen_rtx_ROTATE (CCmode, operands[4],
+ GEN_INT ((cv2 - cv1) & 0x1f));
}")
(define_split
@@ -503,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])))
;
@@ -513,9 +510,9 @@
int cv1 = condition_value (operands[1]);
int cv2 = condition_value (operands[3]);
- operands[2] = gen_rtx (ROTATE, CCmode, operands[2],
- gen_rtx (CONST_INT, VOIDmode,
- ((cv1 & ~1) - (cv2 & ~1)) & 0x1f));
+ operands[2] = gen_rtx_ROTATE (CCmode, operands[2],
+ GEN_INT (((cv1 & ~1) - (cv2 & ~1))
+ & 0x1f));
}")
(define_split
@@ -534,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")
@@ -554,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")
@@ -571,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")
@@ -590,24 +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_rtx (CONST_INT, VOIDmode,
- ((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
@@ -627,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
@@ -635,9 +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_rtx (CONST_INT, VOIDmode,
- (cv2 - cv1) & 0x1f));
+ operands[4] = gen_rtx_ROTATE (CCmode, operands[4],
+ GEN_INT ((cv2 - cv1) & 0x1f));
}")
(define_split
@@ -657,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])))
;
@@ -666,9 +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_rtx (CONST_INT, VOIDmode,
- ((cv1 & ~1) - (cv2 & ~1)) & 0x1f));
+ operands[2] = gen_rtx_ROTATE (CCmode, operands[2],
+ GEN_INT (((cv1 & ~1) - (cv2 & ~1))
+ & 0x1f));
}")
(define_split
@@ -687,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")
@@ -707,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")
@@ -724,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.
@@ -1794,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;
}")
@@ -2298,8 +2294,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;
}
}")
@@ -2871,7 +2867,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 ();
@@ -2892,7 +2888,7 @@
if (INTVAL (op1) < 0)
{
neg = TRUE;
- op1 = gen_rtx (CONST_INT, VOIDmode, -INTVAL (op1));
+ op1 = GEN_INT (-INTVAL (op1));
}
op1 = force_reg (SImode, op1);
@@ -2900,7 +2896,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));
@@ -2910,7 +2906,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));
}
@@ -2924,7 +2920,7 @@
if (INTVAL (op2) < 0)
{
neg = TRUE;
- op2 = gen_rtx (CONST_INT, VOIDmode, -INTVAL (op2));
+ op2 = GEN_INT (-INTVAL (op2));
}
else if (! SMALL_INT (operands[2]))
op2 = force_reg (SImode, op2);
@@ -2933,7 +2929,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));
@@ -2941,7 +2937,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));
}
@@ -2963,7 +2959,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)
{
@@ -2977,7 +2973,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)
{
@@ -2994,13 +2990,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);
@@ -3035,8 +3031,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]));
@@ -3204,10 +3200,9 @@
|| integer_ok_for_set (~value)))
{
emit_insn (gen_andsi3 (operands[0], operands[1],
- gen_rtx (CONST_INT, VOIDmode,
- value | 0xffff)));
+ GEN_INT (value | 0xffff)));
operands[1] = operands[0];
- operands[2] = gen_rtx (CONST_INT, VOIDmode, value | 0xffff0000);
+ operands[2] = GEN_INT (value | 0xffff0000);
}
}
}")
@@ -3276,10 +3271,9 @@
|| integer_ok_for_set (value)))
{
emit_insn (gen_iorsi3 (operands[0], operands[1],
- gen_rtx (CONST_INT, VOIDmode,
- value & 0xffff0000)));
+ GEN_INT (value & 0xffff0000)));
operands[1] = operands[0];
- operands[2] = gen_rtx (CONST_INT, VOIDmode, value & 0xffff);
+ operands[2] = GEN_INT (value & 0xffff);
}
}
}")
@@ -3351,10 +3345,9 @@
|| (value & 0xffff) == 0))
{
emit_insn (gen_xorsi3 (operands[0], operands[1],
- gen_rtx (CONST_INT, VOIDmode,
- value & 0xffff0000)));
+ GEN_INT (value & 0xffff0000)));
operands[1] = operands[0];
- operands[2] = gen_rtx (CONST_INT, VOIDmode, value & 0xffff);
+ operands[2] = GEN_INT (value & 0xffff);
}
}
}")
@@ -3487,7 +3480,7 @@
{
if (TARGET_TRAP_LARGE_SHIFT)
emit_insn (gen_tbnd (force_reg (SImode, operands[2]),
- gen_rtx (CONST_INT, VOIDmode, 31)));
+ GEN_INT (31)));
else
emit_move_insn (operands[0], const0_rtx);
DONE;
@@ -3495,12 +3488,12 @@
}
else if (TARGET_TRAP_LARGE_SHIFT)
- emit_insn (gen_tbnd (operands[2], gen_rtx (CONST_INT, VOIDmode, 31)));
+ emit_insn (gen_tbnd (operands[2], GEN_INT (31)));
else if (TARGET_HANDLE_LARGE_SHIFT)
{
rtx reg = gen_reg_rtx (SImode);
- emit_insn (gen_cmpsi (operands[2], gen_rtx (CONST_INT, VOIDmode, 31)));
+ emit_insn (gen_cmpsi (operands[2], GEN_INT (31)));
emit_insn (gen_sleu (reg));
emit_insn (gen_andsi3 (reg, operands[1], reg));
operands[1] = reg;
@@ -3531,21 +3524,21 @@
if (TARGET_TRAP_LARGE_SHIFT)
{
emit_insn (gen_tbnd (force_reg (SImode, operands[2]),
- gen_rtx (CONST_INT, VOIDmode, 31)));
+ GEN_INT (31)));
DONE;
}
else
- operands[2] = gen_rtx (CONST_INT, VOIDmode, 31);
+ operands[2] = GEN_INT (31);
}
}
else if (TARGET_TRAP_LARGE_SHIFT)
- emit_insn (gen_tbnd (operands[2], gen_rtx (CONST_INT, VOIDmode, 31)));
+ emit_insn (gen_tbnd (operands[2], GEN_INT (31)));
else if (TARGET_HANDLE_LARGE_SHIFT)
{
rtx reg = gen_reg_rtx (SImode);
- emit_insn (gen_cmpsi (operands[2], gen_rtx (CONST_INT, VOIDmode, 31)));
+ emit_insn (gen_cmpsi (operands[2], GEN_INT (31)));
emit_insn (gen_sgtu (reg));
emit_insn (gen_iorsi3 (reg, operands[2], reg));
operands[2] = reg;
@@ -3578,7 +3571,7 @@
{
if (TARGET_TRAP_LARGE_SHIFT)
emit_insn (gen_tbnd (force_reg (SImode, operands[2]),
- gen_rtx (CONST_INT, VOIDmode, 31)));
+ GEN_INT (31)));
else
emit_move_insn (operands[0], const0_rtx);
DONE;
@@ -3586,12 +3579,12 @@
}
else if (TARGET_TRAP_LARGE_SHIFT)
- emit_insn (gen_tbnd (operands[2], gen_rtx (CONST_INT, VOIDmode, 31)));
+ emit_insn (gen_tbnd (operands[2], GEN_INT (31)));
else if (TARGET_HANDLE_LARGE_SHIFT)
{
rtx reg = gen_reg_rtx (SImode);
- emit_insn (gen_cmpsi (operands[2], gen_rtx (CONST_INT, VOIDmode, 31)));
+ emit_insn (gen_cmpsi (operands[2], GEN_INT (31)));
emit_insn (gen_sleu (reg));
emit_insn (gen_andsi3 (reg, operands[1], reg));
operands[1] = reg;
@@ -3619,8 +3612,7 @@
{
if (GET_CODE (operands[2]) == CONST_INT
&& (unsigned) INTVAL (operands[2]) >= 32)
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- (32 - INTVAL (operands[2])) % 32);
+ operands[2] = GEN_INT ((32 - INTVAL (operands[2])) % 32);
else
{
rtx op = gen_reg_rtx (SImode);
@@ -3674,8 +3666,7 @@
""
"*
{
- operands[4] = gen_rtx (CONST_INT, SImode,
- (32 - INTVAL (operands[2])) - INTVAL (operands[3]));
+ operands[4] = GEN_INT ((32 - INTVAL (operands[2])) - INTVAL (operands[3]));
return \"ext %0,%1,%2<%4>\"; /* <(32-%2-%3)> */
}"
[(set_attr "type" "bit")])
@@ -3696,8 +3687,7 @@
""
"*
{
- operands[4] = gen_rtx (CONST_INT, SImode,
- (32 - INTVAL (operands[2])) - INTVAL (operands[3]));
+ operands[4] = GEN_INT ((32 - INTVAL (operands[2])) - INTVAL (operands[3]));
return \"extu %0,%1,%2<%4>\"; /* <(32-%2-%3)> */
}"
[(set_attr "type" "bit")])
@@ -3710,8 +3700,7 @@
""
"*
{
- operands[3] = gen_rtx (CONST_INT, SImode,
- (32 - INTVAL (operands[1])) - INTVAL (operands[2]));
+ operands[3] = GEN_INT ((32 - INTVAL (operands[1])) - INTVAL (operands[2]));
return \"clr %0,%0,%1<%3>\"; /* <(32-%1-%2)> */
}"
[(set_attr "type" "bit")])
@@ -3724,8 +3713,7 @@
""
"*
{
- operands[3] = gen_rtx (CONST_INT, SImode,
- (32 - INTVAL (operands[1])) - INTVAL (operands[2]));
+ operands[3] = GEN_INT ((32 - INTVAL (operands[1])) - INTVAL (operands[2]));
return \"set %0,%0,%1<%3>\"; /* <(32-%1-%2)> */
}"
[(set_attr "type" "bit")])
@@ -3743,11 +3731,10 @@
if (INTVAL (operands[1]) < 32)
value &= (1 << INTVAL (operands[1])) - 1;
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- 32 - (INTVAL(operands[1]) + INTVAL(operands[2])));
+ operands[2] = GEN_INT (32 - (INTVAL(operands[1]) + INTVAL(operands[2])));
value <<= INTVAL (operands[2]);
- operands[3] = gen_rtx (CONST_INT, VOIDmode, value);
+ operands[3] = GEN_INT (value);
if (SMALL_INTVAL (value))
return \"clr %0,%0,%1<%2>\;or %0,%0,%3\";
@@ -3828,8 +3815,8 @@
"
{
register rtx index_diff = gen_reg_rtx (SImode);
- register rtx low = gen_rtx (CONST_INT, VOIDmode, -INTVAL (operands[1]));
- register rtx label = gen_rtx (LABEL_REF, VOIDmode, operands[3]);
+ register rtx low = GEN_INT (-INTVAL (operands[1]));
+ register rtx label = gen_rtx_LABEL_REF (Pmode, operands[3]);
register rtx base;
if (! CASE_VECTOR_INSNS)
@@ -3907,8 +3894,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 ""
@@ -3929,8 +3916,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 ef351897398..edf37a44099 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 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1991, 1997, 1998 Free Software Foundation, Inc.
Contributed by Ray Essick (ressick@mot.com)
Enhanced by Tom Wood (Tom_Wood@NeXT.com)
@@ -141,10 +141,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 188939497ce..280435d0401 100644
--- a/gcc/config/mips/abi64.h
+++ b/gcc/config/mips/abi64.h
@@ -127,7 +127,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 \
@@ -160,15 +160,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; \
@@ -186,8 +186,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 14d4d1ad4e7..9c6fa741e41 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
be replaced with something better designed. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -44,19 +44,10 @@ Boston, MA 02111-1307, USA. */
#undef MIN
#include <signal.h>
-#include <sys/types.h>
-#include <sys/file.h>
-#include <ctype.h>
#include "tree.h"
#include "expr.h"
#include "flags.h"
-#ifndef R_OK
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#endif
-
#if defined(USG) || defined(NO_STAB_H)
#include "gstab.h" /* If doing DBX on sysV, use our own stab.h. */
#else
@@ -69,9 +60,6 @@ Boston, MA 02111-1307, USA. */
#define STAB_CODE_TYPE int
#endif
-extern void abort ();
-extern int atoi ();
-extern char *getenv ();
extern char *mktemp ();
extern rtx adj_offsettable_operand ();
@@ -965,14 +953,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
{
@@ -1133,9 +1121,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. */
@@ -2169,19 +2158,19 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert)
if (test == ITEST_NE)
{
- convert_move (result, gen_rtx (GTU, mode, reg, const0_rtx), 0);
+ convert_move (result, gen_rtx_GTU (mode, reg, const0_rtx), 0);
invert = 0;
}
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;
}
if (invert)
- convert_move (result, gen_rtx (XOR, mode, reg, const1_rtx), 0);
+ convert_move (result, gen_rtx_XOR (mode, reg, const1_rtx), 0);
return result;
}
@@ -2227,7 +2216,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);
@@ -2235,10 +2224,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;
@@ -2252,7 +2241,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)
@@ -2261,10 +2250,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
@@ -2343,14 +2333,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.
@@ -2467,13 +2458,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)),
@@ -2867,23 +2858,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);
@@ -2896,17 +2887,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)
@@ -3166,7 +3157,7 @@ function_arg (cum, mode, type, named)
if (! type || TREE_CODE (type) != RECORD_TYPE || mips_abi == ABI_32
|| mips_abi == ABI_EABI || ! 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
@@ -3186,7 +3177,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
@@ -3205,7 +3196,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;
@@ -3224,14 +3215,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++;
@@ -3267,7 +3258,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);
@@ -3277,8 +3268,8 @@ function_arg (cum, mode, type, named)
}
if (mode == VOIDmode && cum->num_adjusts > 0)
- ret = gen_rtx (PARALLEL, VOIDmode,
- gen_rtvec_v (cum->num_adjusts, cum->adjust));
+ ret = gen_rtx_PARALLEL (VOIDmode,
+ gen_rtvec_v (cum->num_adjusts, cum->adjust));
return ret;
}
@@ -4871,7 +4862,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)
{
@@ -4894,7 +4885,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)
{
@@ -4949,11 +4940,11 @@ save_restore_insns (store_p, large_reg, large_offset, file)
{
if (file == 0)
{
- rtx reg_rtx = gen_rtx (REG, word_mode, regno);
+ rtx reg_rtx = gen_rtx_REG (word_mode, regno);
rtx mem_rtx
- = gen_rtx (MEM, word_mode,
- gen_rtx (PLUS, Pmode, base_reg_rtx,
- GEN_INT (gp_offset - base_offset)));
+ = gen_rtx_MEM (word_mode,
+ plus_constant (base_reg_rtx,
+ gp_offset - base_offset));
if (store_p)
{
@@ -5010,7 +5001,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)
{
@@ -5034,7 +5025,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)
{
@@ -5092,11 +5083,11 @@ save_restore_insns (store_p, large_reg, large_offset, file)
{
enum machine_mode sz
= TARGET_SINGLE_FLOAT ? SFmode : DFmode;
- rtx reg_rtx = gen_rtx (REG, sz, regno);
- rtx mem_rtx = gen_rtx (MEM, sz,
- gen_rtx (PLUS, Pmode, base_reg_rtx,
- GEN_INT (fp_offset
- - base_offset)));
+ rtx reg_rtx = gen_rtx_REG (sz, regno);
+ rtx mem_rtx = gen_rtx_MEM (sz,
+ plus_constant (base_reg_rtx,
+ fp_offset
+ - base_offset));
if (store_p)
{
@@ -5323,9 +5314,10 @@ mips_expand_prologue ()
for (; regno <= GP_ARG_LAST; regno++)
{
if (offset != 0)
- ptr = gen_rtx (PLUS, Pmode, stack_pointer_rtx, GEN_INT (offset));
- emit_move_insn (gen_rtx (MEM, word_mode, ptr),
- gen_rtx (REG, word_mode, regno));
+ ptr = plus_constant (stack_pointer_rtx, offset);
+
+ emit_move_insn (gen_rtx_MEM (word_mode, ptr),
+ gen_rtx_REG (word_mode, regno));
offset += UNITS_PER_WORD;
}
}
@@ -5341,7 +5333,7 @@ mips_expand_prologue ()
if (tsize > 32767)
{
- tmp_rtx = gen_rtx (REG, Pmode, MIPS_TEMP1_REGNUM);
+ tmp_rtx = gen_rtx_REG (Pmode, MIPS_TEMP1_REGNUM);
/* Instruction splitting doesn't preserve the RTX_FRAME_RELATED_P
bit, so make sure that we don't emit anything that can be
@@ -5394,7 +5386,7 @@ mips_expand_prologue ()
if (TARGET_ABICALLS && mips_abi != ABI_32)
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
@@ -5511,7 +5503,7 @@ mips_expand_epilogue ()
if (tsize > 32767)
{
- 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;
}
@@ -5711,12 +5703,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)
@@ -5730,23 +5723,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
@@ -5761,6 +5755,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 611319b5afe..0e5123dd327 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -991,7 +991,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) \
@@ -1904,7 +1904,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
@@ -2124,12 +2124,12 @@ extern struct mips_frame_info current_frame_info;
assuming the value has mode MODE. */
#define LIBCALL_VALUE(MODE) \
- gen_rtx (REG, MODE, \
- ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
- && (! TARGET_SINGLE_FLOAT \
- || GET_MODE_SIZE (MODE) <= 4)) \
- ? FP_RETURN \
- : GP_RETURN))
+ gen_rtx_REG (MODE, \
+ ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
+ && (! TARGET_SINGLE_FLOAT \
+ || GET_MODE_SIZE (MODE) <= 4)) \
+ ? FP_RETURN \
+ : GP_RETURN))
/* Define how to find the value returned by a function.
VALTYPE is the data type of the value (as a tree).
@@ -2382,19 +2382,19 @@ typedef struct mips_args {
rtx addr = ADDR; \
if (TARGET_LONG64) \
{ \
- 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)); \
@@ -2686,8 +2686,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; \
} \
\
@@ -2701,7 +2703,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 \
@@ -2733,12 +2735,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 3254cc5973d..560eed76451 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-97, 1998 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-97, 1998 Free Software Foundation, Inc.
;; This file is part of GNU CC.
@@ -1079,7 +1079,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);
@@ -1148,7 +1148,7 @@
rtx xoperands[10];
xoperands[0] = operands[0];
- xoperands[1] = gen_rtx (REG, DImode, LO_REGNUM);
+ 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);
@@ -2439,7 +2439,7 @@ move\\t%0,%z4\\n\\
{
rtx op1 = gen_lowpart (DImode, operands[1]);
rtx temp = gen_reg_rtx (DImode);
- rtx shift = gen_rtx (CONST_INT, VOIDmode, 32);
+ rtx shift = GEN_INT (32);
emit_insn (gen_ashldi3 (temp, op1, shift));
emit_insn (gen_lshrdi3 (operands[0], temp, shift));
@@ -2603,7 +2603,7 @@ move\\t%0,%z4\\n\\
{
rtx op1 = gen_lowpart (DImode, operands[1]);
rtx temp = gen_reg_rtx (DImode);
- rtx shift = gen_rtx (CONST_INT, VOIDmode, 48);
+ rtx shift = GEN_INT (48);
emit_insn (gen_ashldi3 (temp, op1, shift));
emit_insn (gen_ashrdi3 (operands[0], temp, shift));
@@ -2633,7 +2633,7 @@ move\\t%0,%z4\\n\\
{
rtx op1 = gen_lowpart (SImode, operands[1]);
rtx temp = gen_reg_rtx (SImode);
- rtx shift = gen_rtx (CONST_INT, VOIDmode, 16);
+ rtx shift = GEN_INT (16);
emit_insn (gen_ashlsi3 (temp, op1, shift));
emit_insn (gen_ashrsi3 (operands[0], temp, shift));
@@ -2664,7 +2664,7 @@ move\\t%0,%z4\\n\\
rtx op0 = gen_lowpart (SImode, operands[0]);
rtx op1 = gen_lowpart (SImode, operands[1]);
rtx temp = gen_reg_rtx (SImode);
- rtx shift = gen_rtx (CONST_INT, VOIDmode, 24);
+ rtx shift = GEN_INT (24);
emit_insn (gen_ashlsi3 (temp, op1, shift));
emit_insn (gen_ashrsi3 (op0, temp, shift));
@@ -2695,7 +2695,7 @@ move\\t%0,%z4\\n\\
{
rtx op1 = gen_lowpart (SImode, operands[1]);
rtx temp = gen_reg_rtx (SImode);
- rtx shift = gen_rtx (CONST_INT, VOIDmode, 24);
+ rtx shift = GEN_INT (24);
emit_insn (gen_ashlsi3 (temp, op1, shift));
emit_insn (gen_ashrsi3 (operands[0], temp, shift));
@@ -2725,7 +2725,7 @@ move\\t%0,%z4\\n\\
{
rtx op1 = gen_lowpart (DImode, operands[1]);
rtx temp = gen_reg_rtx (DImode);
- rtx shift = gen_rtx (CONST_INT, VOIDmode, 56);
+ rtx shift = GEN_INT (56);
emit_insn (gen_ashldi3 (temp, op1, shift));
emit_insn (gen_ashrdi3 (operands[0], temp, shift));
@@ -2971,13 +2971,13 @@ 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 (reg3, gen_rtx (CONST_INT, VOIDmode, 0x80000000));
+ 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));
emit_insn (gen_iorsi3 (operands[0], operands[0], reg3));
@@ -2986,7 +2986,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;
}
}")
@@ -3014,13 +3014,13 @@ 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 (reg3, gen_rtx (CONST_INT, VOIDmode, 0x80000000));
+ 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)));
emit_insn (gen_fix_truncdfdi2 (operands[0], reg2));
@@ -3030,7 +3030,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;
}
}")
@@ -3058,13 +3058,13 @@ 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 (reg3, gen_rtx (CONST_INT, VOIDmode, 0x80000000));
+ 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));
emit_insn (gen_iorsi3 (operands[0], operands[0], reg3));
@@ -3073,7 +3073,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;
}
}")
@@ -3101,13 +3101,13 @@ 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 (reg3, gen_rtx (CONST_INT, VOIDmode, 0x80000000));
+ 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)));
emit_insn (gen_fix_truncsfdi2 (operands[0], reg2));
@@ -3117,7 +3117,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;
}
}")
@@ -3319,10 +3319,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
@@ -3336,8 +3336,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;
}
@@ -3352,7 +3352,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;
}
@@ -3421,10 +3421,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)
{
@@ -3434,7 +3434,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);
@@ -3449,26 +3449,26 @@ 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_move_insn (gen_rtx_REG (SImode, 65), scratch);
}
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));
+ emit_insn (gen_movdi (gen_rtx_REG (DImode, 65), scratch));
}
DONE;
}
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));
DONE;
@@ -3491,10 +3491,10 @@ move\\t%0,%z4\\n\\
if (GET_CODE (operands[0]) == REG && REGNO (operands[0]) == HILO_REGNUM)
{
emit_insn (gen_ashrdi3 (operands[2], operands[1], GEN_INT (32)));
- emit_insn (gen_movdi (gen_rtx (REG, DImode, 64), operands[2]));
+ emit_insn (gen_movdi (gen_rtx_REG (DImode, 64), operands[2]));
emit_insn (gen_ashldi3 (operands[2], operands[1], GEN_INT (32)));
emit_insn (gen_ashrdi3 (operands[2], operands[2], GEN_INT (32)));
- emit_insn (gen_movdi (gen_rtx (REG, DImode, 65), operands[2]));
+ emit_insn (gen_movdi (gen_rtx_REG (DImode, 65), operands[2]));
DONE;
}
if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == HILO_REGNUM)
@@ -3505,7 +3505,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);
@@ -3519,17 +3519,17 @@ 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);
}
else
{
- emit_insn (gen_movdi (operands[2], gen_rtx (REG, DImode, 65)));
+ emit_insn (gen_movdi (operands[2], gen_rtx_REG (DImode, 65)));
emit_insn (gen_ashldi3 (operands[2], operands[2], GEN_INT (32)));
emit_insn (gen_lshrdi3 (operands[2], operands[2], 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], operands[2]));
}
@@ -3554,8 +3554,8 @@ move\\t%0,%z4\\n\\
(match_dup 3)))]
"
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) & 0xffff0000);
- operands[3] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) & 0x0000ffff);
+ operands[2] = GEN_INT (INTVAL (operands[1]) & 0xffff0000);
+ operands[3] = GEN_INT (INTVAL (operands[1]) & 0x0000ffff);
}")
;; Unlike most other insns, the move insns can't be split with
@@ -3574,10 +3574,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
@@ -3591,8 +3591,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;
}
@@ -3607,7 +3607,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;
}
@@ -3661,9 +3661,9 @@ move\\t%0,%z4\\n\\
{
if (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_movsi (gen_rtx_REG (SImode, 64), operands[2]));
DONE;
}
/* This handles moves between a float register and HI/LO. */
@@ -3711,17 +3711,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;
}")
@@ -3811,7 +3811,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")
@@ -3821,7 +3821,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")
@@ -3831,7 +3831,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")
@@ -3841,7 +3841,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")
@@ -4218,7 +4218,7 @@ move\\t%0,%z4\\n\\
"*
{
if (GET_CODE (operands[2]) == CONST_INT)
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
return \"sll\\t%0,%1,%2\";
}"
@@ -4288,7 +4288,7 @@ move\\t%0,%z4\\n\\
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && (INTVAL (operands[2]) & 32) != 0"
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
operands[4] = const0_rtx;
return \"sll\\t%M0,%L1,%2\;move\\t%L0,%z4\";
}"
@@ -4310,7 +4310,7 @@ move\\t%0,%z4\\n\\
[(set (subreg:SI (match_dup 0) 1) (ashift:SI (subreg:SI (match_dup 1) 0) (match_dup 2)))
(set (subreg:SI (match_dup 0) 0) (const_int 0))]
- "operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);")
+ "operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);")
(define_split
@@ -4326,7 +4326,7 @@ move\\t%0,%z4\\n\\
[(set (subreg:SI (match_dup 0) 0) (ashift:SI (subreg:SI (match_dup 1) 1) (match_dup 2)))
(set (subreg:SI (match_dup 0) 1) (const_int 0))]
- "operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);")
+ "operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);")
(define_insn "ashldi3_internal3"
@@ -4341,9 +4341,9 @@ move\\t%0,%z4\\n\\
{
int amount = INTVAL (operands[2]);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
+ operands[2] = GEN_INT (amount & 31);
operands[4] = const0_rtx;
- operands[5] = gen_rtx (CONST_INT, VOIDmode, ((-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\";
}"
@@ -4381,8 +4381,8 @@ move\\t%0,%z4\\n\\
"
{
int amount = INTVAL (operands[2]);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
- operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
+ operands[2] = GEN_INT (amount & 31);
+ operands[4] = GEN_INT ((-amount) & 31);
}")
@@ -4415,8 +4415,8 @@ move\\t%0,%z4\\n\\
"
{
int amount = INTVAL (operands[2]);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
- operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
+ operands[2] = GEN_INT (amount & 31);
+ operands[4] = GEN_INT ((-amount) & 31);
}")
@@ -4445,7 +4445,7 @@ move\\t%0,%z4\\n\\
"*
{
if (GET_CODE (operands[2]) == CONST_INT)
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
return \"sra\\t%0,%1,%2\";
}"
@@ -4515,7 +4515,7 @@ move\\t%0,%z4\\n\\
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && (INTVAL (operands[2]) & 32) != 0"
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
return \"sra\\t%L0,%M1,%2\;sra\\t%M0,%M1,31\";
}"
[(set_attr "type" "darith")
@@ -4536,7 +4536,7 @@ move\\t%0,%z4\\n\\
[(set (subreg:SI (match_dup 0) 0) (ashiftrt:SI (subreg:SI (match_dup 1) 1) (match_dup 2)))
(set (subreg:SI (match_dup 0) 1) (ashiftrt:SI (subreg:SI (match_dup 1) 1) (const_int 31)))]
- "operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);")
+ "operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);")
(define_split
@@ -4552,7 +4552,7 @@ move\\t%0,%z4\\n\\
[(set (subreg:SI (match_dup 0) 1) (ashiftrt:SI (subreg:SI (match_dup 1) 0) (match_dup 2)))
(set (subreg:SI (match_dup 0) 0) (ashiftrt:SI (subreg:SI (match_dup 1) 0) (const_int 31)))]
- "operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);")
+ "operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);")
(define_insn "ashrdi3_internal3"
@@ -4567,8 +4567,8 @@ move\\t%0,%z4\\n\\
{
int amount = INTVAL (operands[2]);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
- operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-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\";
}"
@@ -4606,8 +4606,8 @@ move\\t%0,%z4\\n\\
"
{
int amount = INTVAL (operands[2]);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
- operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
+ operands[2] = GEN_INT (amount & 31);
+ operands[4] = GEN_INT ((-amount) & 31);
}")
@@ -4640,8 +4640,8 @@ move\\t%0,%z4\\n\\
"
{
int amount = INTVAL (operands[2]);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
- operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
+ operands[2] = GEN_INT (amount & 31);
+ operands[4] = GEN_INT ((-amount) & 31);
}")
@@ -4670,7 +4670,7 @@ move\\t%0,%z4\\n\\
"*
{
if (GET_CODE (operands[2]) == CONST_INT)
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
return \"srl\\t%0,%1,%2\";
}"
@@ -4740,7 +4740,7 @@ move\\t%0,%z4\\n\\
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && (INTVAL (operands[2]) & 32) != 0"
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
operands[4] = const0_rtx;
return \"srl\\t%L0,%M1,%2\;move\\t%M0,%z4\";
}"
@@ -4762,7 +4762,7 @@ move\\t%0,%z4\\n\\
[(set (subreg:SI (match_dup 0) 0) (lshiftrt:SI (subreg:SI (match_dup 1) 1) (match_dup 2)))
(set (subreg:SI (match_dup 0) 1) (const_int 0))]
- "operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);")
+ "operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);")
(define_split
@@ -4778,7 +4778,7 @@ move\\t%0,%z4\\n\\
[(set (subreg:SI (match_dup 0) 1) (lshiftrt:SI (subreg:SI (match_dup 1) 0) (match_dup 2)))
(set (subreg:SI (match_dup 0) 0) (const_int 0))]
- "operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0x1f);")
+ "operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);")
(define_insn "lshrdi3_internal3"
@@ -4793,8 +4793,8 @@ move\\t%0,%z4\\n\\
{
int amount = INTVAL (operands[2]);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
- operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-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\";
}"
@@ -4832,8 +4832,8 @@ move\\t%0,%z4\\n\\
"
{
int amount = INTVAL (operands[2]);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
- operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
+ operands[2] = GEN_INT (amount & 31);
+ operands[4] = GEN_INT ((-amount) & 31);
}")
@@ -4866,8 +4866,8 @@ move\\t%0,%z4\\n\\
"
{
int amount = INTVAL (operands[2]);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (amount & 31));
- operands[4] = gen_rtx (CONST_INT, VOIDmode, ((-amount) & 31));
+ operands[2] = GEN_INT (amount & 31);
+ operands[4] = GEN_INT ((-amount) & 31);
}")
@@ -5732,7 +5732,7 @@ move\\t%0,%z4\\n\\
"INTVAL (operands[2]) < 32767"
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2])+1);
+ operands[2] = GEN_INT (INTVAL (operands[2])+1);
return \"slt\\t%0,%1,%2\";
}"
[(set_attr "type" "arith")
@@ -5746,7 +5746,7 @@ move\\t%0,%z4\\n\\
"TARGET_64BIT && INTVAL (operands[2]) < 32767"
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2])+1);
+ operands[2] = GEN_INT (INTVAL (operands[2])+1);
return \"slt\\t%0,%1,%2\";
}"
[(set_attr "type" "arith")
@@ -5990,7 +5990,7 @@ move\\t%0,%z4\\n\\
"INTVAL (operands[2]) < 32767"
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2])+1);
+ operands[2] = GEN_INT (INTVAL (operands[2]) + 1);
return \"sltu\\t%0,%1,%2\";
}"
[(set_attr "type" "arith")
@@ -6004,7 +6004,7 @@ move\\t%0,%z4\\n\\
"TARGET_64BIT && INTVAL (operands[2]) < 32767"
"*
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2])+1);
+ operands[2] = GEN_INT (INTVAL (operands[2]) + 1);
return \"sltu\\t%0,%1,%2\";
}"
[(set_attr "type" "arith")
@@ -6478,8 +6478,8 @@ move\\t%0,%z4\\n\\
rtx label = gen_label_rtx ();
emit_label (label);
- emit_insn (gen_loadgp (gen_rtx (LABEL_REF, Pmode, label),
- gen_rtx (REG, DImode, 31)));
+ emit_insn (gen_loadgp (gen_rtx_LABEL_REF (Pmode, label),
+ gen_rtx_REG (DImode, 31)));
emit_insn (gen_blockage ());
}")
@@ -6607,7 +6607,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;
}
}")
@@ -6763,7 +6764,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;
}
@@ -6773,7 +6774,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;
}
@@ -6990,7 +6992,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 5435f773c8d..cfb96ed4670 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 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 "regs.h"
#include "hard-reg-set.h"
@@ -275,7 +275,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);
@@ -594,12 +594,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);
}
}
@@ -611,12 +611,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);
}
}
@@ -638,14 +638,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);
@@ -670,11 +670,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;
}
}
@@ -683,10 +682,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))));
}
}
@@ -764,11 +763,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;
}
}
@@ -778,7 +775,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)
{
@@ -972,14 +969,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;
}
@@ -1374,10 +1371,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 7eb26dd7c0d..b191a0a76a6 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 Free Software Foundation, Inc.
Contributed by Jeff Law (law@cygnus.com).
This file is part of GNU CC.
@@ -524,12 +524,12 @@ extern struct rtx_def *function_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. */
@@ -590,9 +590,9 @@ extern struct rtx_def *function_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)); \
}
@@ -601,7 +601,7 @@ extern struct rtx_def *function_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)
@@ -1052,9 +1052,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 9dc753c3023..fe719f756f8 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 Free Software Foundation, Inc.
-
+;; Copyright (C) 1997, 1998 Free Software Foundation, Inc.
;; Contributed by Jeff Law (law@cygnus.com).
;; This file is part of GNU CC.
@@ -399,13 +398,13 @@
extern rtx emit_library_call_value ();
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 (ASHIFT, SImode, operands[1], operands[2]));
+ gen_rtx_ASHIFT (SImode, operands[1], operands[2]));
DONE;
}
else
@@ -477,13 +476,13 @@
extern rtx emit_library_call_value ();
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 (ASHIFT, SImode, operands[1], operands[2]));
+ gen_rtx_ASHIFT (SImode, operands[1], operands[2]));
DONE;
}
else
@@ -1274,9 +1273,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;
@@ -1313,9 +1312,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;
@@ -1352,9 +1352,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;
@@ -1406,9 +1406,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;
@@ -1483,9 +1483,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 @@
extern rtx emit_library_call_value ();
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;
@@ -1557,13 +1557,13 @@
extern rtx emit_library_call_value ();
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
@@ -1601,9 +1601,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;
@@ -1616,13 +1616,13 @@
extern rtx emit_library_call_value ();
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..325ee5a5a6b 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 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 f46e4232083..8e22aa7829f 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 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 "regs.h"
#include "hard-reg-set.h"
@@ -244,7 +244,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);
@@ -325,9 +325,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;
@@ -456,12 +456,12 @@ expand_prologue ()
if (!regs_ever_live[2])
{
regs_ever_live[2] = 1;
- zero_dreg = gen_rtx (REG, SImode, 2);
+ zero_dreg = gen_rtx_REG (SImode, 2);
}
else
{
regs_ever_live[3] = 1;
- zero_dreg = gen_rtx (REG, SImode, 3);
+ zero_dreg = gen_rtx_REG (SImode, 3);
}
}
else
@@ -475,12 +475,12 @@ expand_prologue ()
if (!regs_ever_live[6])
{
regs_ever_live[6] = 1;
- zero_areg = gen_rtx (REG, SImode, 6);
+ zero_areg = gen_rtx_REG (SImode, 6);
}
else
{
regs_ever_live[7] = 1;
- zero_areg = gen_rtx (REG, SImode, 7);
+ zero_areg = gen_rtx_REG (SImode, 7);
}
}
else
@@ -503,14 +503,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
@@ -774,12 +772,12 @@ mn10300_builtin_saveregs (arglist)
else
offset = current_function_arg_offset_rtx;
- emit_move_insn (gen_rtx (MEM, SImode, current_function_internal_arg_pointer),
- gen_rtx (REG, SImode, 0));
- emit_move_insn (gen_rtx (MEM, SImode,
- plus_constant
- (current_function_internal_arg_pointer, 4)),
- gen_rtx (REG, SImode, 1));
+ emit_move_insn (gen_rtx_MEM (SImode, current_function_internal_arg_pointer),
+ gen_rtx_REG (SImode, 0));
+ emit_move_insn (gen_rtx_MEM (SImode,
+ plus_constant
+ (current_function_internal_arg_pointer, 4)),
+ gen_rtx_REG (SImode, 1));
return copy_to_reg (expand_binop (Pmode, add_optab,
current_function_internal_arg_pointer,
offset, 0, 0, OPTAB_LIB_WIDEN));
@@ -826,10 +824,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;
@@ -1058,7 +1056,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 9ebcec147c1..d10f3d7ef59 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 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 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 2ff8a8162ea..3a08df606fe 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 Free Software Foundation, Inc.
+;; Contributed by Jeff Law (law@cygnus.com).
;; This file is part of GNU CC.
@@ -171,8 +170,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));
}
@@ -183,8 +183,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));
}
@@ -382,7 +383,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
@@ -543,7 +544,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
@@ -675,7 +676,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..bdbe17c5d37 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 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 2e8a4a24de6..0d2d2ef343a 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, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -18,9 +18,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. */
-/* Some output-actions in ns32k.md need these. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -206,10 +205,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_rtx (CONST_INT, VOIDmode, 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;
}
@@ -243,8 +242,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]))
{
@@ -321,14 +320,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)
@@ -379,7 +378,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);
@@ -677,7 +676,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;
@@ -772,7 +771,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 70cd9f201ae..5c2d8b8a0d1 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, 95, 96, 97, 1998 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC.
@@ -421,8 +421,8 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
#define FUNCTION_VALUE(VALTYPE, FUNC) \
(TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_32081 \
- ? 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))
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
@@ -432,8 +432,8 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
#define LIBCALL_VALUE(MODE) \
(((MODE) == DFmode || (MODE) == SFmode) && TARGET_32081 \
- ? gen_rtx (REG, MODE, 8) \
- : gen_rtx (REG, MODE, 0))
+ ? gen_rtx_REG (MODE, 8) \
+ : gen_rtx_REG (MODE, 0))
/* Define this if PCC uses the nonreentrant convention for returning
structure and union values. */
@@ -498,7 +498,7 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
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.
@@ -784,8 +784,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 28e65e6df91..56e18d22dcd 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 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1994, 1996, 1998 Free Software Foundation, Inc.
;; Contributed by Michael Tiemann (tiemann@cygnus.com)
;; This file is part of GNU CC.
@@ -125,7 +125,7 @@
{
cc_status.flags |= CC_REVERSED;
if (INTVAL (operands[1]) > 7)
- operands[1] = gen_rtx(CONST_INT, VOIDmode, i);
+ operands[1] = GEN_INT (i);
return \"cmpqw %1,%0\";
}
}
@@ -136,7 +136,7 @@
if (i <= 7 && i >= -8)
{
if (INTVAL (operands[0]) > 7)
- operands[0] = gen_rtx(CONST_INT, VOIDmode, i);
+ operands[0] = GEN_INT (i);
return \"cmpqw %0,%1\";
}
}
@@ -157,7 +157,7 @@
{
cc_status.flags |= CC_REVERSED;
if (INTVAL (operands[1]) > 7)
- operands[1] = gen_rtx(CONST_INT, VOIDmode, i);
+ operands[1] = GEN_INT (i);
return \"cmpqb %1,%0\";
}
}
@@ -168,7 +168,7 @@
if (i <= 7 && i >= -8)
{
if (INTVAL (operands[0]) > 7)
- operands[0] = gen_rtx(CONST_INT, VOIDmode, i);
+ operands[0] = GEN_INT (i);
return \"cmpqb %0,%1\";
}
}
@@ -202,7 +202,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\";
@@ -214,7 +214,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
@@ -259,7 +259,7 @@
convrt.f = convrt.d;
/* Is there a better machine-independent way to to this? */
- operands[1] = gen_rtx (CONST_INT, VOIDmode, convrt.i[0]);
+ operands[1] = GEN_INT (convrt.i[0]);
return \"movd %1,%0\";
}
#endif
@@ -285,7 +285,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\";
@@ -297,7 +297,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
@@ -338,8 +338,7 @@
&& REGNO (operands[0]) == FRAME_POINTER_REGNUM)
return \"lprd fp,%1\";
if (GET_CODE (operands[1]) == CONST_DOUBLE)
- operands[1]
- = gen_rtx (CONST_INT, VOIDmode, 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]);
@@ -400,7 +399,7 @@
rtx xoperands[3];
xoperands[0] = operands[0];
xoperands[1] = XEXP (operands[1], 0);
- xoperands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (XEXP (operands[1], 1)) >> 1);
+ xoperands[2] = GEN_INT (INTVAL (XEXP (operands[1], 1)) >> 1);
return output_shift_insn (xoperands);
}
return \"addr %a1,%0\";
@@ -418,8 +417,7 @@
if (i <= 7 && i >= -8)
{
if (INTVAL (operands[1]) > 7)
- operands[1] =
- gen_rtx (CONST_INT, VOIDmode, i);
+ operands[1] = GEN_INT (i);
return \"movqw %1,%0\";
}
return \"movw %1,%0\";
@@ -464,8 +462,7 @@
if (char_val <= 7 && char_val >= -8)
{
if (INTVAL (operands[1]) > 7)
- operands[1] =
- gen_rtx (CONST_INT, VOIDmode, char_val);
+ operands[1] = GEN_INT (char_val);
return \"movqb %1,%0\";
}
return \"movb %1,%0\";
@@ -543,7 +540,7 @@
#ifdef UTEK_ASM
if (GET_CODE (operands[2]) == CONST_INT && (INTVAL (operands[2]) & 0x3) == 0)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) >> 2);
+ operands[2] = GEN_INT (INTVAL (operands[2]) >> 2);
if ((unsigned) INTVAL (operands[2]) <= 7)
return \"movqd %2,r0\;movsd $0\";
else
@@ -556,7 +553,7 @@
#else
if (GET_CODE (operands[2]) == CONST_INT && (INTVAL (operands[2]) & 0x3) == 0)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) >> 2);
+ operands[2] = GEN_INT (INTVAL (operands[2]) >> 2);
if ((unsigned) INTVAL (operands[2]) <= 7)
return \"movqd %2,r0\;movsd\";
else
@@ -1217,7 +1214,7 @@
""
"*
{
- operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
return \"deid %2,%0\;movd %1,%0\";
}")
@@ -1228,7 +1225,7 @@
""
"*
{
- operands[1] = gen_rtx (REG, HImode, REGNO (operands[0]) + 1);
+ operands[1] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
return \"deiw %2,%0\;movw %1,%0\";
}")
@@ -1239,7 +1236,7 @@
""
"*
{
- operands[1] = gen_rtx (REG, QImode, REGNO (operands[0]) + 1);
+ operands[1] = gen_rtx_REG (QImode, REGNO (operands[0]) + 1);
return \"deib %2,%0\;movb %1,%0\";
}")
@@ -1314,8 +1311,7 @@
return \"movqb %$0,%0\";
else
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[2]) & 0xff);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0xff);
return \"andb %2,%0\";
}
}
@@ -1325,8 +1321,7 @@
return \"movqw %$0,%0\";
else
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[2]) & 0xffff);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffff);
return \"andw %2,%0\";
}
}
@@ -1348,8 +1343,7 @@
return \"movqb %$0,%0\";
else
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- INTVAL (operands[2]) & 0xff);
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0xff);
return \"andb %2,%0\";
}
}
@@ -1602,7 +1596,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 ""
@@ -1627,7 +1621,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 ""
@@ -1652,7 +1646,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 ""
@@ -1680,7 +1674,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 ""
@@ -1705,7 +1699,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 ""
@@ -1730,7 +1724,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 ""
@@ -1779,7 +1773,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 ""
@@ -1804,7 +1798,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 ""
@@ -1829,7 +1823,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 ""
@@ -1865,7 +1859,7 @@
rtx xoperands[3];
xoperands[0] = operands[0];
xoperands[1] = XEXP (operands[1], 0);
- xoperands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (XEXP (operands[1], 1)) >> 1);
+ xoperands[2] = GEN_INT (INTVAL (XEXP (operands[1], 1)) >> 1);
return output_shift_insn (xoperands);
}
return \"addr %a1,%0\";
@@ -2040,7 +2034,7 @@
{
operands[0] = adj_offsettable_operand (operands[0],
INTVAL (operands[2]) / 8);
- operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) % 8);
+ operands[2] = GEN_INT (INTVAL (operands[2]) % 8);
}
if (INTVAL (operands[1]) <= 8)
return \"inssb %3,%0,%2,%1\";
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index d2265e6efba..98d481ca6f0 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -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"
@@ -602,13 +602,18 @@ legitimize_pic_address (orig, mode, reg)
if (flag_pic == 2)
{
emit_insn (gen_pic2_highpart (reg, pic_offset_table_rtx, orig));
- pic_ref = gen_rtx (MEM, Pmode,
- gen_rtx (LO_SUM, Pmode, reg,
- gen_rtx (UNSPEC, SImode, gen_rtvec (1, orig), 0)));
+ pic_ref
+ = gen_rtx_MEM (Pmode,
+ gen_rtx_LO_SUM (Pmode, reg,
+ gen_rtx_UNSPEC (SImode,
+ gen_rtvec (1, orig),
+ 0)));
}
else
- pic_ref = gen_rtx (MEM, Pmode,
- gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig));
+ pic_ref = gen_rtx_MEM (Pmode,
+ 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);
@@ -638,7 +643,7 @@ legitimize_pic_address (orig, mode, reg)
return plus_constant_for_output (base, INTVAL (orig));
orig = force_reg (Pmode, orig);
}
- pic_ref = gen_rtx (PLUS, Pmode, base, orig);
+ pic_ref = gen_rtx_PLUS (Pmode, base, orig);
/* Likewise, should we set special REG_NOTEs here? */
}
return pic_ref;
@@ -716,7 +721,7 @@ hppa_legitimize_address (x, oldx, mode)
&& GET_CODE (XEXP (x, 1)) == SYMBOL_REF)
{
rtx reg = force_reg (SImode, XEXP (x, 1));
- return force_reg (SImode, gen_rtx (PLUS, SImode, reg, XEXP (x, 0)));
+ return force_reg (SImode, gen_rtx_PLUS (SImode, reg, XEXP (x, 0)));
}
/* Note we must reject symbols which represent function addresses
@@ -748,17 +753,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));
+ 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
{
@@ -768,9 +770,9 @@ hppa_legitimize_address (x, oldx, mode)
int_part = GEN_INT (newoffset);
ptr_reg = force_reg (Pmode,
- gen_rtx (PLUS, Pmode,
- force_reg (Pmode, XEXP (x, 0)),
- int_part));
+ gen_rtx_PLUS (Pmode,
+ force_reg (Pmode, XEXP (x, 0)),
+ int_part));
}
return plus_constant (ptr_reg, offset - newoffset);
}
@@ -795,10 +797,11 @@ hppa_legitimize_address (x, oldx, mode)
if (GET_CODE (reg2) != REG)
reg2 = force_reg (Pmode, force_operand (reg2, 0));
- return force_reg (Pmode, gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode,
- reg2, GEN_INT (val)),
- reg1));
+ return force_reg (Pmode, gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode,
+ reg2,
+ GEN_INT (val)),
+ reg1));
}
/* Similarly for (plus (plus (mult (a) (shadd_constant)) (b)) (c)).
@@ -837,11 +840,11 @@ hppa_legitimize_address (x, oldx, mode)
{
base = reg1;
orig_base = XEXP (XEXP (x, 0), 1);
- idx = gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode,
- XEXP (XEXP (XEXP (x, 0), 0), 0),
- XEXP (XEXP (XEXP (x, 0), 0), 1)),
- XEXP (x, 1));
+ idx = gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode,
+ XEXP (XEXP (XEXP (x, 0), 0), 0),
+ XEXP (XEXP (XEXP (x, 0), 0), 1)),
+ XEXP (x, 1));
}
else if (GET_CODE (reg2) == REG
&& REGNO_POINTER_FLAG (REGNO (reg2)))
@@ -869,13 +872,15 @@ hppa_legitimize_address (x, oldx, mode)
if (GET_CODE (reg1) != REG)
reg1 = force_reg (Pmode, force_operand (reg1, 0));
- reg1 = force_reg (Pmode, gen_rtx (PLUS, Pmode, reg1, GEN_INT (val)));
+ 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. */
@@ -886,16 +891,17 @@ hppa_legitimize_address (x, oldx, mode)
int val = INTVAL (XEXP (XEXP (idx, 0), 1));
rtx reg1, reg2;
- reg1 = force_reg (Pmode, gen_rtx (PLUS, Pmode, base, XEXP (idx, 1)));
+ reg1 = force_reg (Pmode, gen_rtx_PLUS (Pmode, base, XEXP (idx, 1)));
reg2 = XEXP (XEXP (idx, 0), 0);
if (GET_CODE (reg2) != CONST_INT)
reg2 = force_reg (Pmode, force_operand (reg2, 0));
- return force_reg (Pmode, gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode,
- reg2, GEN_INT (val)),
- reg1));
+ return force_reg (Pmode, gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode,
+ reg2,
+ GEN_INT (val)),
+ reg1));
}
/* Get the index into a register, then add the base + index and
@@ -911,13 +917,14 @@ hppa_legitimize_address (x, oldx, mode)
if (GET_CODE (reg2) != REG)
reg2 = force_reg (Pmode, force_operand (reg2, 0));
- reg1 = force_reg (Pmode, gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode, reg1,
- XEXP (XEXP (idx, 0), 1)),
- reg2));
+ reg1 = force_reg (Pmode,
+ gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode, reg1,
+ XEXP (XEXP (idx, 0), 1)),
+ reg2));
/* Add the result to our base register and return. */
- return force_reg (Pmode, gen_rtx (PLUS, Pmode, base, reg1));
+ return force_reg (Pmode, gen_rtx_PLUS (Pmode, base, reg1));
}
@@ -976,10 +983,12 @@ hppa_legitimize_address (x, oldx, mode)
if (GET_CODE (reg2) != REG)
reg2 = force_reg (Pmode, force_operand (reg2, 0));
- return force_reg (Pmode, gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode,
- reg2, GEN_INT (val)),
- reg1));
+ return force_reg (Pmode,
+ gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode,
+ reg2,
+ GEN_INT (val)),
+ reg1));
}
else if ((mode == DFmode || mode == SFmode)
&& GET_CODE (XEXP (y, 0)) == SYMBOL_REF
@@ -997,10 +1006,11 @@ hppa_legitimize_address (x, oldx, mode)
regx2 = force_reg (Pmode, force_operand (regx2, 0));
regx2 = force_reg (Pmode, gen_rtx (GET_CODE (y), Pmode,
regx2, regx1));
- return force_reg (Pmode,
- gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode, regx2,
- XEXP (XEXP (x, 0), 1)),
+ 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
@@ -1020,7 +1030,7 @@ hppa_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));
}
}
}
@@ -1089,11 +1099,11 @@ emit_move_sequence (operands, mode, scratch_reg)
if (reload_in_progress && GET_CODE (operand0) == MEM
&& ((tem = find_replacement (&XEXP (operand0, 0)))
!= XEXP (operand0, 0)))
- operand0 = gen_rtx (MEM, GET_MODE (operand0), tem);
+ operand0 = gen_rtx_MEM (GET_MODE (operand0), tem);
if (reload_in_progress && GET_CODE (operand1) == MEM
&& ((tem = find_replacement (&XEXP (operand1, 0)))
!= XEXP (operand1, 0)))
- operand1 = gen_rtx (MEM, GET_MODE (operand1), tem);
+ operand1 = gen_rtx_MEM (GET_MODE (operand1), tem);
/* Handle secondary reloads for loads/stores of FP registers from
REG+D addresses where D does not fit in 5 bits, including
@@ -1109,7 +1119,7 @@ emit_move_sequence (operands, mode, scratch_reg)
if (GET_CODE (operand1) == SUBREG)
operand1 = XEXP (operand1, 0);
- scratch_reg = gen_rtx (REG, SImode, REGNO (scratch_reg));
+ scratch_reg = gen_rtx_REG (SImode, REGNO (scratch_reg));
/* D might not fit in 14 bits either; for such cases load D into
scratch reg. */
@@ -1123,8 +1133,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)
@@ -1138,7 +1148,7 @@ emit_move_sequence (operands, mode, scratch_reg)
if (GET_CODE (operand0) == SUBREG)
operand0 = XEXP (operand0, 0);
- scratch_reg = gen_rtx (REG, SImode, REGNO (scratch_reg));
+ scratch_reg = gen_rtx_REG (SImode, REGNO (scratch_reg));
/* D might not fit in 14 bits either; for such cases load D into
scratch reg. */
if (!memory_address_p (SImode, XEXP (operand0, 0)))
@@ -1151,8 +1161,8 @@ emit_move_sequence (operands, mode, scratch_reg)
}
else
emit_move_insn (scratch_reg, XEXP (operand0, 0));
- emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (MEM, mode, scratch_reg),
- operand1));
+ emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_MEM (mode, scratch_reg),
+ operand1));
return 1;
}
/* Handle secondary reloads for loads of FP registers from constant
@@ -1177,8 +1187,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
@@ -1201,8 +1211,8 @@ emit_move_sequence (operands, mode, scratch_reg)
SImode,
XEXP (XEXP (operand1, 0), 0),
scratch_reg));
- emit_move_insn (scratch_reg, gen_rtx (MEM, GET_MODE (operand1),
- scratch_reg));
+ emit_move_insn (scratch_reg, gen_rtx_MEM (GET_MODE (operand1),
+ scratch_reg));
}
else
emit_move_insn (scratch_reg, operand1);
@@ -1221,7 +1231,7 @@ emit_move_sequence (operands, mode, scratch_reg)
|| 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;
}
}
@@ -1232,14 +1242,14 @@ emit_move_sequence (operands, mode, scratch_reg)
{
rtx temp = gen_reg_rtx (DFmode);
- emit_insn (gen_rtx (SET, VOIDmode, temp, operand1));
- emit_insn (gen_rtx (SET, VOIDmode, operand0, temp));
+ emit_insn (gen_rtx_SET (VOIDmode, temp, operand1));
+ emit_insn (gen_rtx_SET (VOIDmode, operand0, temp));
return 1;
}
if (register_operand (operand1, mode) || operand1 == CONST0_RTX (mode))
{
/* 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))
@@ -1301,7 +1311,7 @@ emit_move_sequence (operands, mode, scratch_reg)
/* Now load from the memory location into our destination
register. */
- operands[1] = gen_rtx (MEM, Pmode, operands[0]);
+ operands[1] = gen_rtx_MEM (Pmode, operands[0]);
emit_move_sequence (operands, mode, scratch_reg);
/* And add back in the constant part. */
@@ -1337,7 +1347,7 @@ emit_move_sequence (operands, mode, scratch_reg)
else
{
operands[1] = legitimize_pic_address (operand1, mode, temp);
- emit_insn (gen_rtx (SET, VOIDmode, operand0, operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operand0, operands[1]));
}
}
/* On the HPPA, references to data space are supposed to use dp,
@@ -1362,15 +1372,15 @@ emit_move_sequence (operands, mode, scratch_reg)
if (REGNO (temp) >= FIRST_PSEUDO_REGISTER)
REGNO_POINTER_FLAG (REGNO (temp)) = 1;
if (ishighonly)
- set = gen_rtx (SET, mode, operand0, temp);
+ set = gen_rtx_SET (mode, operand0, temp);
else
- set = gen_rtx (SET, VOIDmode,
- operand0,
- gen_rtx (LO_SUM, mode, temp, operand1));
+ set = gen_rtx_SET (VOIDmode,
+ operand0,
+ gen_rtx_LO_SUM (mode, temp, operand1));
- emit_insn (gen_rtx (SET, VOIDmode,
- temp,
- gen_rtx (HIGH, mode, operand1)));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ temp,
+ gen_rtx_HIGH (mode, operand1)));
emit_insn (set);
}
@@ -1386,9 +1396,9 @@ emit_move_sequence (operands, mode, scratch_reg)
else
temp = gen_reg_rtx (mode);
- emit_insn (gen_rtx (SET, VOIDmode, temp,
- gen_rtx (HIGH, mode, operand1)));
- operands[1] = gen_rtx (LO_SUM, mode, temp, operand1);
+ emit_insn (gen_rtx_SET (VOIDmode, temp,
+ gen_rtx_HIGH (mode, operand1)));
+ operands[1] = gen_rtx_LO_SUM (mode, temp, operand1);
}
}
/* Now have insn-emit do whatever it normally does. */
@@ -1597,7 +1607,7 @@ output_move_double (operands)
rtx addr = XEXP (operands[0], 0);
if (GET_CODE (addr) == POST_INC || GET_CODE (addr) == POST_DEC)
{
- rtx high_reg = gen_rtx (SUBREG, SImode, operands[1], 0);
+ rtx high_reg = gen_rtx_SUBREG (SImode, operands[1], 0);
operands[0] = XEXP (addr, 0);
if (GET_CODE (operands[1]) != REG || GET_CODE (operands[0]) != REG)
@@ -1617,7 +1627,7 @@ output_move_double (operands)
}
else if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC)
{
- rtx high_reg = gen_rtx (SUBREG, SImode, operands[1], 0);
+ rtx high_reg = gen_rtx_SUBREG (SImode, operands[1], 0);
operands[0] = XEXP (addr, 0);
if (GET_CODE (operands[1]) != REG || GET_CODE (operands[0]) != REG)
@@ -1644,7 +1654,7 @@ output_move_double (operands)
rtx addr = XEXP (operands[1], 0);
if (GET_CODE (addr) == POST_INC || GET_CODE (addr) == POST_DEC)
{
- rtx high_reg = gen_rtx (SUBREG, SImode, operands[0], 0);
+ rtx high_reg = gen_rtx_SUBREG (SImode, operands[0], 0);
operands[1] = XEXP (addr, 0);
if (GET_CODE (operands[0]) != REG || GET_CODE (operands[1]) != REG)
@@ -1671,7 +1681,7 @@ output_move_double (operands)
}
else if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC)
{
- rtx high_reg = gen_rtx (SUBREG, SImode, operands[0], 0);
+ rtx high_reg = gen_rtx_SUBREG (SImode, operands[0], 0);
operands[1] = XEXP (addr, 0);
if (GET_CODE (operands[0]) != REG || GET_CODE (operands[1]) != REG)
@@ -1699,7 +1709,7 @@ output_move_double (operands)
else if (GET_CODE (addr) == PLUS
&& GET_CODE (XEXP (addr, 0)) == MULT)
{
- rtx high_reg = gen_rtx (SUBREG, SImode, operands[0], 0);
+ rtx high_reg = gen_rtx_SUBREG (SImode, operands[0], 0);
if (!reg_overlap_mentioned_p (high_reg, addr))
{
@@ -1744,14 +1754,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)
@@ -1842,7 +1852,7 @@ output_fp_move_double (operands)
if (GET_CODE (operands[0]) == REG)
{
rtx xoperands[2];
- xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
xoperands[0] = operands[0];
output_asm_insn ("copy %%r0,%0\n\tcopy %%r0,%1", xoperands);
}
@@ -2383,28 +2393,26 @@ 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, SImode,
- gen_rtx (PLUS, SImode,
- gen_rtx (REG, SImode, base),
- GEN_INT (disp))),
- gen_rtx (REG, SImode, reg));
- }
+ emit_move_insn (gen_rtx_MEM (SImode,
+ plus_constant (gen_rtx_REG (SImode, base),
+ disp)),
+ gen_rtx_REG (SImode, reg));
else
{
- emit_insn (gen_add_high_const (gen_rtx (REG, SImode, 1),
- gen_rtx (REG, SImode, base),
+ emit_insn (gen_add_high_const (gen_rtx_REG (SImode, 1),
+ gen_rtx_REG (SImode, base),
GEN_INT (disp)));
- emit_move_insn (gen_rtx (MEM, SImode,
- gen_rtx (LO_SUM, SImode,
- gen_rtx (REG, SImode, 1),
- GEN_INT (disp))),
- gen_rtx (REG, SImode, reg));
+ emit_move_insn (gen_rtx_MEM (SImode,
+ gen_rtx_LO_SUM (SImode,
+ gen_rtx_REG (SImode, 1),
+ GEN_INT (disp))),
+ gen_rtx_REG (SImode, reg));
}
}
@@ -2413,28 +2421,26 @@ 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, SImode, reg),
- gen_rtx (MEM, SImode,
- gen_rtx (PLUS, SImode,
- gen_rtx (REG, SImode, base),
- GEN_INT (disp))));
- }
+ emit_move_insn (gen_rtx_REG (SImode, reg),
+ gen_rtx_MEM (SImode,
+ plus_constant (gen_rtx_REG (SImode, base),
+ disp)));
else
{
- emit_insn (gen_add_high_const (gen_rtx (REG, SImode, 1),
- gen_rtx (REG, SImode, base),
+ emit_insn (gen_add_high_const (gen_rtx_REG (SImode, 1),
+ gen_rtx_REG (SImode, base),
GEN_INT (disp)));
- emit_move_insn (gen_rtx (REG, SImode, reg),
- gen_rtx (MEM, SImode,
- gen_rtx (LO_SUM, SImode,
- gen_rtx (REG, SImode, 1),
- GEN_INT (disp))));
+ emit_move_insn (gen_rtx_REG (SImode, reg),
+ gen_rtx_MEM (SImode,
+ gen_rtx_LO_SUM (SImode,
+ gen_rtx_REG (SImode, 1),
+ GEN_INT (disp))));
}
}
@@ -2443,26 +2449,23 @@ 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, SImode, reg),
- gen_rtx (PLUS, SImode,
- gen_rtx (REG, SImode, base),
- GEN_INT (disp)));
- }
+ emit_move_insn (gen_rtx_REG (SImode, reg),
+ plus_constant (gen_rtx_REG (SImode, base), disp));
else
{
- emit_insn (gen_add_high_const (gen_rtx (REG, SImode, 1),
- gen_rtx (REG, SImode, base),
+ emit_insn (gen_add_high_const (gen_rtx_REG (SImode, 1),
+ gen_rtx_REG (SImode, base),
GEN_INT (disp)));
- emit_move_insn (gen_rtx (REG, SImode, reg),
- gen_rtx (LO_SUM, SImode,
- gen_rtx (REG, SImode, 1),
- GEN_INT (disp)));
+ emit_move_insn (gen_rtx_REG (SImode, reg),
+ gen_rtx_LO_SUM (SImode,
+ gen_rtx_REG (SImode, 1),
+ GEN_INT (disp)));
}
}
@@ -2604,7 +2607,7 @@ hppa_expand_prologue()
actual_fsize = compute_frame_size (size, &save_fregs);
/* Compute a few things we will use often. */
- tmpreg = gen_rtx (REG, SImode, 1);
+ tmpreg = gen_rtx_REG (SImode, 1);
size_rtx = GEN_INT (actual_fsize);
/* Handle out of line prologues and epilogues. */
@@ -2667,16 +2670,16 @@ hppa_expand_prologue()
if (inline_insn_count > outline_insn_count)
{
/* Put the local_fisze into %r19. */
- operands[0] = gen_rtx (REG, SImode, 19);
+ operands[0] = gen_rtx_REG (SImode, 19);
operands[1] = GEN_INT (local_fsize);
emit_move_insn (operands[0], operands[1]);
/* Put the stack size into %r21. */
- operands[0] = gen_rtx (REG, SImode, 21);
+ operands[0] = gen_rtx_REG (SImode, 21);
operands[1] = size_rtx;
emit_move_insn (operands[0], operands[1]);
- operands[0] = gen_rtx (REG, SImode, 22);
+ operands[0] = gen_rtx_REG (SImode, 22);
operands[1] = GEN_INT (saves);
emit_move_insn (operands[0], operands[1]);
@@ -2780,8 +2783,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, SImode,
- hp_profile_label_name);
+ hp_profile_label_rtx = gen_rtx_SYMBOL_REF (SImode,
+ hp_profile_label_name);
if (current_function_returns_struct)
store_reg (STRUCT_VALUE_REGNUM, - 12 - offsetadj, basereg);
@@ -2793,10 +2796,10 @@ hppa_expand_prologue()
pc_offset += VAL_14_BITS_P (arg_offset) ? 4 : 8;
}
- emit_move_insn (gen_rtx (REG, SImode, 26), gen_rtx (REG, SImode, 2));
- emit_move_insn (tmpreg, gen_rtx (HIGH, SImode, hp_profile_label_rtx));
- emit_move_insn (gen_rtx (REG, SImode, 24),
- gen_rtx (LO_SUM, SImode, tmpreg, hp_profile_label_rtx));
+ emit_move_insn (gen_rtx_REG (SImode, 26), gen_rtx_REG (SImode, 2));
+ emit_move_insn (tmpreg, gen_rtx_HIGH (SImode, hp_profile_label_rtx));
+ emit_move_insn (gen_rtx_REG (SImode, 24),
+ gen_rtx_LO_SUM (SImode, tmpreg, hp_profile_label_rtx));
/* %r25 is set from within the output pattern. */
emit_insn (gen_call_profiler (GEN_INT (- pc_offset - 20)));
@@ -2838,7 +2841,7 @@ hppa_expand_prologue()
{
merge_sp_adjust_with_store = 0;
emit_insn (gen_post_stwm (stack_pointer_rtx,
- gen_rtx (REG, SImode, i),
+ gen_rtx_REG (SImode, i),
GEN_INT (-offset)));
}
else
@@ -2873,9 +2876,9 @@ hppa_expand_prologue()
{
if (regs_ever_live[i] || regs_ever_live[i + 1])
{
- emit_move_insn (gen_rtx (MEM, DFmode,
- gen_rtx (POST_INC, DFmode, tmpreg)),
- gen_rtx (REG, DFmode, i));
+ emit_move_insn (gen_rtx_MEM (DFmode,
+ gen_rtx_POST_INC (DFmode, tmpreg)),
+ gen_rtx_REG (DFmode, i));
fr_saved++;
}
}
@@ -2899,8 +2902,8 @@ hppa_expand_prologue()
Avoid this if the callee saved register wasn't used (these are
leaf functions). */
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM_SAVED])
- emit_move_insn (gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED),
- gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM));
+ emit_move_insn (gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM_SAVED),
+ gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM));
}
@@ -2973,16 +2976,16 @@ hppa_expand_epilogue ()
emit_insn (gen_blockage ());
/* Put the local_fisze into %r19. */
- operands[0] = gen_rtx (REG, SImode, 19);
+ operands[0] = gen_rtx_REG (SImode, 19);
operands[1] = GEN_INT (local_fsize);
emit_move_insn (operands[0], operands[1]);
/* Put the stack size into %r21. */
- operands[0] = gen_rtx (REG, SImode, 21);
+ operands[0] = gen_rtx_REG (SImode, 21);
operands[1] = GEN_INT (actual_fsize);
emit_move_insn (operands[0], operands[1]);
- operands[0] = gen_rtx (REG, SImode, 22);
+ operands[0] = gen_rtx_REG (SImode, 22);
operands[1] = GEN_INT (saves);
emit_move_insn (operands[0], operands[1]);
@@ -2992,7 +2995,7 @@ hppa_expand_epilogue ()
}
/* We will use this often. */
- tmpreg = gen_rtx (REG, SImode, 1);
+ tmpreg = gen_rtx_REG (SImode, 1);
/* Try to restore RP early to avoid load/use interlocks when
RP gets used in the return (bv) instruction. This appears to still
@@ -3054,9 +3057,9 @@ hppa_expand_epilogue ()
{
if (regs_ever_live[i] || regs_ever_live[i + 1])
{
- emit_move_insn (gen_rtx (REG, DFmode, i),
- gen_rtx (MEM, DFmode,
- gen_rtx (POST_INC, DFmode, tmpreg)));
+ emit_move_insn (gen_rtx_REG (DFmode, i),
+ gen_rtx_MEM (DFmode,
+ gen_rtx_POST_INC (DFmode, tmpreg)));
}
}
}
@@ -3098,8 +3101,8 @@ hppa_expand_epilogue ()
}
/* If we were deferring a callee register restore, do it now. */
else if (! frame_pointer_needed && merge_sp_adjust_with_load)
- emit_insn (gen_pre_ldwm (gen_rtx (REG, SImode,
- merge_sp_adjust_with_load),
+ emit_insn (gen_pre_ldwm (gen_rtx_REG (SImode,
+ merge_sp_adjust_with_load),
stack_pointer_rtx,
GEN_INT (- actual_fsize)));
else if (actual_fsize != 0)
@@ -3155,9 +3158,9 @@ return_addr_rtx (count, frameaddr)
privilege level from the two low order bits of the return address
pointer here so that ins will point to the start of the first
instruction that would have been executed if we returned. */
- ins = copy_to_reg (gen_rtx (AND, Pmode,
- copy_to_reg (gen_rtx (MEM, Pmode, saved_rp)),
- MASK_RETURN_ADDR));
+ ins = copy_to_reg (gen_rtx_AND (Pmode,
+ copy_to_reg (gen_rtx_MEM (Pmode, saved_rp)),
+ MASK_RETURN_ADDR));
label = gen_label_rtx ();
/* Check the instruction stream at the normal return address for the
@@ -3171,22 +3174,22 @@ return_addr_rtx (count, frameaddr)
If it is an export stub, than our return address is really in
-24[frameaddr]. */
- emit_cmp_insn (gen_rtx (MEM, SImode, ins),
+ emit_cmp_insn (gen_rtx_MEM (SImode, ins),
GEN_INT (0x4bc23fd1),
NE, NULL_RTX, SImode, 1, 0);
emit_jump_insn (gen_bne (label));
- emit_cmp_insn (gen_rtx (MEM, SImode, plus_constant (ins, 4)),
+ emit_cmp_insn (gen_rtx_MEM (SImode, plus_constant (ins, 4)),
GEN_INT (0x004010a1),
NE, NULL_RTX, SImode, 1, 0);
emit_jump_insn (gen_bne (label));
- emit_cmp_insn (gen_rtx (MEM, SImode, plus_constant (ins, 8)),
+ emit_cmp_insn (gen_rtx_MEM (SImode, plus_constant (ins, 8)),
GEN_INT (0x00011820),
NE, NULL_RTX, SImode, 1, 0);
emit_jump_insn (gen_bne (label));
- emit_cmp_insn (gen_rtx (MEM, SImode, plus_constant (ins, 12)),
+ emit_cmp_insn (gen_rtx_MEM (SImode, plus_constant (ins, 12)),
GEN_INT (0xe0400002),
NE, NULL_RTX, SImode, 1, 0);
@@ -3203,7 +3206,7 @@ return_addr_rtx (count, frameaddr)
emit_move_insn (saved_rp, plus_constant (frameaddr, -6 * UNITS_PER_WORD));
emit_label (label);
- return gen_rtx (MEM, Pmode, memory_address (Pmode, saved_rp));
+ return gen_rtx_MEM (Pmode, memory_address (Pmode, saved_rp));
}
/* This is only valid once reload has completed because it depends on
@@ -3228,13 +3231,15 @@ emit_bcond_fp (code, operand0)
enum rtx_code code;
rtx operand0;
{
- emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx,
- gen_rtx (IF_THEN_ELSE, VOIDmode,
- gen_rtx (code, VOIDmode,
- gen_rtx (REG, CCFPmode, 0),
- const0_rtx),
- gen_rtx (LABEL_REF, VOIDmode, operand0),
- pc_rtx)));
+ emit_jump_insn (gen_rtx_SET
+ (VOIDmode, pc_rtx,
+ gen_rtx_IF_THEN_ELSE (VOIDmode,
+ gen_rtx (code, VOIDmode,
+ gen_rtx_REG (CCFPmode, 0),
+ const0_rtx),
+ gen_rtx_LABEL_REF (VOIDmode,
+ operand0),
+ pc_rtx)));
}
@@ -3243,8 +3248,8 @@ gen_cmp_fp (code, operand0, operand1)
enum rtx_code code;
rtx operand0, operand1;
{
- return gen_rtx (SET, VOIDmode, gen_rtx (REG, CCFPmode, 0),
- gen_rtx (code, CCFPmode, operand0, operand1));
+ return gen_rtx_SET (VOIDmode, gen_rtx_REG (CCFPmode, 0),
+ gen_rtx (code, CCFPmode, operand0, operand1));
}
/* Adjust the cost of a scheduling dependency. Return the new cost of
@@ -3943,8 +3948,8 @@ output_deferred_plabels (file)
for (i = 0; i < n_deferred_plabels; i++)
{
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (deferred_plabels[i].internal_label));
- assemble_integer (gen_rtx (SYMBOL_REF, VOIDmode,
- deferred_plabels[i].name), 4, 1);
+ assemble_integer (gen_rtx_SYMBOL_REF (VOIDmode,
+ deferred_plabels[i].name), 4, 1);
}
}
@@ -3981,7 +3986,7 @@ output_mul_insn (unsignedp, insn)
rtx insn;
{
import_milli (mulI);
- return output_millicode_call (insn, gen_rtx (SYMBOL_REF, SImode, "$$mulI"));
+ return output_millicode_call (insn, gen_rtx_SYMBOL_REF (SImode, "$$mulI"));
}
/* Emit the rtl for doing a division by a constant. */
@@ -4017,19 +4022,19 @@ emit_hpdiv_const (operands, unsignedp)
&& INTVAL (operands[2]) < 16
&& magic_milli[INTVAL (operands[2])])
{
- emit_move_insn ( gen_rtx (REG, SImode, 26), operands[1]);
+ emit_move_insn ( gen_rtx_REG (SImode, 26), operands[1]);
emit
- (gen_rtx
- (PARALLEL, VOIDmode,
- gen_rtvec (5, gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, 29),
- gen_rtx (unsignedp ? UDIV : DIV, SImode,
- gen_rtx (REG, SImode, 26),
- operands[2])),
- gen_rtx (CLOBBER, VOIDmode, operands[3]),
- gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 26)),
- gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 25)),
- gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 31)))));
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 29));
+ (gen_rtx_PARALLEL (VOIDmode,
+ gen_rtvec (5, gen_rtx_SET (VOIDmode,
+ gen_rtx (REG, SImode, 29),
+ gen_rtx (unsignedp ? UDIV : DIV, SImode,
+ gen_rtx_REG (SImode, 26),
+ operands[2])),
+ gen_rtx_CLOBBER (VOIDmode, operands[3]),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, 26)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, 25)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, 31)))));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 29));
return 1;
}
return 0;
@@ -4061,13 +4066,13 @@ output_div_insn (operands, unsignedp, insn)
{
sprintf (buf, "$$divU_%d", INTVAL (operands[0]));
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, buf));
+ gen_rtx_SYMBOL_REF (SImode, buf));
}
else
{
sprintf (buf, "$$divI_%d", INTVAL (operands[0]));
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, buf));
+ gen_rtx_SYMBOL_REF (SImode, buf));
}
}
/* Divisor isn't a special constant. */
@@ -4077,13 +4082,13 @@ output_div_insn (operands, unsignedp, insn)
{
import_milli (divU);
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, "$$divU"));
+ gen_rtx_SYMBOL_REF (SImode, "$$divU"));
}
else
{
import_milli (divI);
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, "$$divI"));
+ gen_rtx_SYMBOL_REF (SImode, "$$divI"));
}
}
}
@@ -4099,13 +4104,13 @@ output_mod_insn (unsignedp, insn)
{
import_milli (remU);
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, "$$remU"));
+ gen_rtx_SYMBOL_REF (SImode, "$$remU"));
}
else
{
import_milli (remI);
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, "$$remI"));
+ gen_rtx_SYMBOL_REF (SImode, "$$remI"));
}
}
@@ -4321,8 +4326,9 @@ hppa_builtin_saveregs (arglist)
offset = current_function_arg_offset_rtx;
/* Store general registers on the stack. */
- dest = gen_rtx (MEM, BLKmode,
- plus_constant (current_function_internal_arg_pointer, -16));
+ dest = gen_rtx_MEM (BLKmode,
+ plus_constant (current_function_internal_arg_pointer,
+ -16));
move_block_from_reg (23, dest, 4, 4 * UNITS_PER_WORD);
/* move_block_from_reg will emit code to store the argument registers
@@ -4336,7 +4342,7 @@ hppa_builtin_saveregs (arglist)
last argument register store. So we emit a blockage insn here. */
emit_insn (gen_blockage ());
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
dest, ptr_mode,
GEN_INT (4 * UNITS_PER_WORD), TYPE_MODE (sizetype),
@@ -5258,14 +5264,14 @@ output_call (insn, call_dest)
if (arg_mode == SFmode)
{
xoperands[0] = XEXP (use, 0);
- xoperands[1] = gen_rtx (REG, SImode, 26 - (regno - 32) / 2);
+ xoperands[1] = gen_rtx_REG (SImode, 26 - (regno - 32) / 2);
output_asm_insn ("fstws %0,-16(%%sr0,%%r30)", xoperands);
output_asm_insn ("ldw -16(%%sr0,%%r30),%1", xoperands);
}
else
{
xoperands[0] = XEXP (use, 0);
- xoperands[1] = gen_rtx (REG, DImode, 25 - (regno - 34) / 2);
+ xoperands[1] = gen_rtx_REG (DImode, 25 - (regno - 34) / 2);
output_asm_insn ("fstds %0,-16(%%sr0,%%r30)", xoperands);
output_asm_insn ("ldw -12(%%sr0,%%r30),%R1", xoperands);
output_asm_insn ("ldw -16(%%sr0,%%r30),%1", xoperands);
@@ -6112,7 +6118,7 @@ pa_combine_instructions (insns)
may be combined with "floating" insns. As the name implies,
"anchor" instructions don't move, while "floating" insns may
move around. */
- new = gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2, NULL_RTX, NULL_RTX));
+ new = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, NULL_RTX, NULL_RTX));
new = make_insn_raw (new);
for (anchor = get_insns (); anchor; anchor = NEXT_INSN (anchor))
@@ -6247,17 +6253,19 @@ 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))),
+ 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;
/* Emit a special USE insn for FLOATER, then delete
the floating insn. */
- emit_insn_before (gen_rtx (USE, VOIDmode, floater), floater);
+ emit_insn_before (gen_rtx_USE (VOIDmode, floater), floater);
delete_insn (floater);
continue;
@@ -6267,10 +6275,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;
@@ -6278,7 +6289,7 @@ pa_combine_instructions (insns)
/* Emit a special USE insn for FLOATER, then delete
the floating insn. */
- emit_insn_before (gen_rtx (USE, VOIDmode, floater), floater);
+ emit_insn_before (gen_rtx_USE (VOIDmode, floater), floater);
delete_insn (floater);
continue;
}
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 79f2bfe4859..787360a3a77 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for the HP Spectrum.
- Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support
and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for
Software Science at the University of Utah.
@@ -781,7 +781,7 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FP_REGS, GENERAL_OR_FP_REGS,
/* Return the stack location to use for secondary memory needed reloads. */
#define SECONDARY_MEMORY_NEEDED_RTX(MODE) \
- gen_rtx (MEM, MODE, gen_rtx (PLUS, Pmode, stack_pointer_rtx, GEN_INT (-16)))
+ gen_rtx_MEM (MODE, gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (-16)))
/* Return the maximum number of consecutive registers
needed to represent mode MODE in a register of class CLASS. */
@@ -873,18 +873,18 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FP_REGS, GENERAL_OR_FP_REGS,
#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx (REG, TYPE_MODE (VALTYPE), ((! TARGET_SOFT_FLOAT \
- && (TYPE_MODE (VALTYPE) == SFmode || \
- TYPE_MODE (VALTYPE) == DFmode)) ? \
- 32 : 28))
+ gen_rtx_REG (TYPE_MODE (VALTYPE), ((! TARGET_SOFT_FLOAT \
+ && (TYPE_MODE (VALTYPE) == SFmode || \
+ TYPE_MODE (VALTYPE) == DFmode)) ? \
+ 32 : 28))
/* 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_SOFT_FLOAT \
- && ((MODE) == SFmode || (MODE) == DFmode) ? 32 : 28))
+ gen_rtx_REG (MODE, \
+ (! TARGET_SOFT_FLOAT \
+ && ((MODE) == SFmode || (MODE) == DFmode) ? 32 : 28))
/* 1 if N is a possible register number for a function value
as seen by the caller. */
@@ -1008,42 +1008,43 @@ struct hppa_args {int words, nargs_prototype, indirect; };
? (!TARGET_PORTABLE_RUNTIME || (TYPE) == 0 \
|| !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))))))\
+ ? 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))))))\
/* 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.
@@ -1305,9 +1306,9 @@ extern union tree_node *current_function_decl;
rtx start_addr, end_addr; \
\
start_addr = memory_address (Pmode, plus_constant ((TRAMP), 36)); \
- emit_move_insn (gen_rtx (MEM, Pmode, start_addr), (FNADDR)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (FNADDR)); \
start_addr = memory_address (Pmode, plus_constant ((TRAMP), 40)); \
- emit_move_insn (gen_rtx (MEM, Pmode, start_addr), (CXT)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (CXT)); \
/* fdc and fic only use registers for the address to flush, \
they do not accept integer displacements. */ \
start_addr = force_reg (SImode, (TRAMP)); \
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 8e61fd46349..95285105825 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -1306,7 +1306,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;
}")
@@ -1321,7 +1321,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;
}")
@@ -2180,7 +2180,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;
}")
@@ -2195,7 +2195,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;
}")
@@ -2331,7 +2331,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;
}")
@@ -2346,7 +2346,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;
}")
@@ -2485,7 +2485,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;
}")
@@ -2500,7 +2500,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;
}")
@@ -2927,7 +2927,7 @@
}
else if (cint_ok_for_move (-intval))
{
- emit_insn (gen_rtx (SET, VOIDmode, operands[4], GEN_INT (-intval)));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[4], GEN_INT (-intval)));
emit_insn (gen_subsi3 (operands[0], operands[1], operands[4]));
DONE;
}
@@ -3009,9 +3009,8 @@
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],
- gen_rtx (SUBREG, SImode, scratch, 1)));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_SUBREG (SImode, scratch, 1)));
DONE;
}
operands[3] = gen_reg_rtx (SImode);
@@ -4018,7 +4017,7 @@
if (TARGET_BIG_SWITCH)
{
rtx temp = gen_reg_rtx (SImode);
- emit_move_insn (temp, gen_rtx (PLUS, SImode, operands[0], operands[0]));
+ emit_move_insn (temp, gen_rtx_PLUS (SImode, operands[0], operands[0]));
operands[0] = temp;
}
emit_jump_insn (gen_casesi0 (operands[0], operands[3]));
@@ -4063,7 +4062,7 @@
call_insn = emit_call_insn (gen_call_internal_symref (op, operands[1]));
else
{
- rtx tmpreg = gen_rtx (REG, SImode, 22);
+ rtx tmpreg = gen_rtx_REG (SImode, 22);
emit_move_insn (tmpreg, force_reg (SImode, op));
call_insn = emit_call_insn (gen_call_internal_reg (operands[1]));
}
@@ -4078,8 +4077,8 @@
This will set regs_ever_live for the callee saved register we
stored the PIC register in. */
emit_move_insn (pic_offset_table_rtx,
- gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED));
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
+ gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM_SAVED));
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
/* Gross. We have to keep the scheduler from moving the restore
of the PIC register away from the call. SCHED_GROUP_P is
@@ -4103,7 +4102,7 @@
"*
{
output_arg_descriptor (insn);
- return output_call (insn, operands[0], gen_rtx (REG, SImode, 2));
+ return output_call (insn, operands[0], gen_rtx_REG (SImode, 2));
}"
[(set_attr "type" "call")
(set (attr "length")
@@ -4220,7 +4219,7 @@
operands[2]));
else
{
- rtx tmpreg = gen_rtx (REG, SImode, 22);
+ rtx tmpreg = gen_rtx_REG (SImode, 22);
emit_move_insn (tmpreg, force_reg (SImode, op));
call_insn = emit_call_insn (gen_call_value_internal_reg (operands[0],
operands[2]));
@@ -4235,8 +4234,8 @@
This will set regs_ever_live for the callee saved register we
stored the PIC register in. */
emit_move_insn (pic_offset_table_rtx,
- gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED));
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
+ gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM_SAVED));
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
/* Gross. We have to keep the scheduler from moving the restore
of the PIC register away from the call. SCHED_GROUP_P is
@@ -4262,7 +4261,7 @@
"*
{
output_arg_descriptor (insn);
- return output_call (insn, operands[1], gen_rtx (REG, SImode, 2));
+ return output_call (insn, operands[1], gen_rtx_REG (SImode, 2));
}"
[(set_attr "type" "call")
(set (attr "length")
@@ -5103,7 +5102,7 @@
/* Else call $$sh_func_adrs to extract the function's real add24. */
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode,
+ gen_rtx_SYMBOL_REF (SImode,
\"$$sh_func_adrs\"));
}"
[(set_attr "type" "multi")
@@ -5150,8 +5149,8 @@
/* 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)));
+ 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 20628d42792..2aea783a4b5 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 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1997, 1998 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"
@@ -365,14 +365,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;
}
@@ -395,14 +395,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)
@@ -412,10 +412,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_rtx(CONST_INT, VOIDmode,
- INTVAL(operands[1])>>16);
- operands[1] = gen_rtx(CONST_INT, VOIDmode,
- 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)
{
@@ -579,14 +577,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;
}
@@ -609,14 +607,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)
@@ -633,21 +631,15 @@ output_move_quad (operands)
abort();
#ifndef HOST_WORDS_BIG_ENDIAN
- latehalf[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[1]));
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (operands[1]));
+ latehalf[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
+ operands[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
#else /* HOST_WORDS_BIG_ENDIAN */
- latehalf[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (operands[1]));
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[1]));
+ 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_rtx (CONST_INT, VOIDmode, 0);
- }
+ latehalf[1] = GEN_INT (0);
else
abort();
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index 9f755c1227e..a995f637ff2 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for the pdp-11
- Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1998 Free Software Foundation, Inc.
Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
This file is part of GNU CC.
@@ -542,18 +542,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.
@@ -1256,14 +1256,14 @@ MV #STATIC, $4 0x940Y 0x0000 <- STATIC; Y = STATIC_CHAIN_REGNUM
JMP FUNCTION 0x0058 0x0000 <- FUNCTION
*/
-#define TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- if (TARGET_SPLIT) \
- abort(); \
- \
- ASM_OUTPUT_INT (FILE, gen_rtx(CONST_INT, VOIDmode, 0x9400+STATIC_CHAIN_REGNUM)); \
+#define TRAMPOLINE_TEMPLATE(FILE) \
+{ \
+ if (TARGET_SPLIT) \
+ abort(); \
+ \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \
ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_INT (FILE, gen_rtx(CONST_INT, VOIDmode, 0x0058)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x0058)); \
ASM_OUTPUT_INT (FILE, const0_rtx); \
}
@@ -1279,8 +1279,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 ec6a43f66d1..a585ab34d1e 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 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
;; Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
;; This file is part of GNU CC.
@@ -731,7 +731,7 @@
{
output_asm_insn(\"stcdf %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 \"\";
}
@@ -804,8 +804,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);
@@ -856,7 +856,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);
@@ -882,7 +882,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);
@@ -917,7 +917,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);
@@ -951,7 +951,7 @@
output_asm_insn(\"stcdl %1, -(sp)\", operands);
output_asm_insn(\"seti\", operands);
output_asm_insn(\"mov (sp)+, %0\", operands);
- operands[0] = gen_rtx(REG, HImode, REGNO (operands[0])+1);
+ operands[0] = gen_rtx_REG (HImode, REGNO (operands[0]) + 1);
output_asm_insn(\"mov (sp)+, %0\", operands);
return \"\";
}
@@ -997,7 +997,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);
@@ -1006,7 +1006,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);
@@ -1016,8 +1016,8 @@
return \"\";
}
- lateoperands[2] = gen_rtx(CONST_INT, VOIDmode, (INTVAL(operands[2]) >> 16) & 0xffff);
- operands[2] = gen_rtx(CONST_INT, VOIDmode, 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]))
{
@@ -1096,14 +1096,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);
@@ -1154,7 +1154,7 @@
{
extern rtx expand_unop ();
if (GET_CODE (operands[2]) == CONST_INT)
- operands[2] = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[2]));
+ operands[2] = GEN_INT (~INTVAL (operands[2]));
else
operands[2] = expand_unop (SImode, one_cmpl_optab, operands[2], 0, 1);
}")
@@ -1168,7 +1168,7 @@
{
extern rtx expand_unop ();
if (GET_CODE (operands[2]) == CONST_INT)
- operands[2] = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[2]));
+ operands[2] = GEN_INT (~INTVAL (operands[2]));
else
operands[2] = expand_unop (HImode, one_cmpl_optab, operands[2], 0, 1);
}")
@@ -1183,8 +1183,7 @@
extern rtx expand_unop ();
rtx op = operands[2];
if (GET_CODE (op) == CONST_INT)
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- ((1 << 8) - 1) & ~INTVAL (op));
+ operands[2] = GEN_INT (((1 << 8) - 1) & ~INTVAL (op));
else
operands[2] = expand_unop (QImode, one_cmpl_optab, op, 0, 1);
}")
@@ -1205,7 +1204,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);
@@ -1214,7 +1213,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);
@@ -1223,8 +1222,8 @@
return \"\";
}
- lateoperands[2] = gen_rtx(CONST_INT, VOIDmode, (INTVAL(operands[2]) >> 16) & 0xffff);
- operands[2] = gen_rtx(CONST_INT, VOIDmode, 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! */
@@ -1271,26 +1270,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_rtx(CONST_INT, VOIDmode, (INTVAL(operands[2]) >> 16) & 0xffff);
- operands[2] = gen_rtx(CONST_INT, VOIDmode, 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! */
@@ -1332,26 +1331,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);
+
+ return \"\";
+ }
- lateoperands[2] = gen_rtx(CONST_INT, VOIDmode, (INTVAL(operands[2]) >> 16) & 0xffff);
- operands[2] = gen_rtx(CONST_INT, VOIDmode, 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]))
+ 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 \"\";
@@ -1608,7 +1607,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 46ea25c0374..9c20d2f5e2a 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 Free, 1998 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"
@@ -256,9 +256,9 @@ extend_const (x, extop, from_mode, to_mode)
else
val = val & ~((-1) << (GET_MODE_BITSIZE (from_mode)));
if (GET_MODE_BITSIZE (to_mode) == HOST_BITS_PER_INT)
- return gen_rtx (CONST_INT, VOIDmode, val);
- return gen_rtx (CONST_INT, VOIDmode,
- val & ~((-1) << (GET_MODE_BITSIZE (to_mode))));
+ return GEN_INT (val);
+
+ return GEN_INT (val & ~((-1) << (GET_MODE_BITSIZE (to_mode))));
}
rtx
@@ -296,7 +296,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 +338,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)));
}
}
@@ -625,16 +625,13 @@ output_move_double (operands)
|| (CONST_DOUBLE_HIGH (const_op) == -1
&& CONST_DOUBLE_LOW (const_op) < 0))
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (const_op));
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (const_op));
return "movl %1,%0";
}
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (const_op));
+ 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[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (const_op));
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (const_op));
return "movw %1,%0";
}
else
@@ -646,16 +643,13 @@ output_move_double (operands)
|| (CONST_DOUBLE_LOW (const_op) == -1
&& CONST_DOUBLE_HIGH (const_op) < 0))
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (const_op));
+ operands[1] = GEN_INT (CONST_DOUBLE_HIGH (const_op));
return "movl %1,%0";
}
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (const_op));
+ 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[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (const_op));
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
+ operands[1] = GEN_INT (CONST_DOUBLE_HIGH (const_op));
return "movw %1,%0";
}
}
@@ -680,7 +674,7 @@ output_shift (pattern, op2, mod)
cc_status = cc_prev_status;
return "";
}
- op2 = gen_rtx (CONST_INT, VOIDmode, cnt);
+ op2 = GEN_INT (cnt);
}
return pattern;
}
diff --git a/gcc/config/pyr/pyr.h b/gcc/config/pyr/pyr.h
index ea88ee4ba10..2ed5ee534f5 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, 1995, 1996, 1997, 1998 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)
@@ -736,10 +736,10 @@ extern void* pyr_function_arg ();
jump $<func> # S2R
*/
#define TRAMPOLINE_TEMPLATE(FILE) \
-{ ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x2100001C)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x40000000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); }
+{ ASM_OUTPUT_INT (FILE, GEN_INT (0x2100001C)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x40000000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); }
#define TRAMPOLINE_SIZE 16
#define TRAMPOLINE_ALIGNMENT 32
@@ -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 97d91014595..973e80acd5f 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, 1990, 1995, 1997, 1998 Free Software Foundation, Inc.
;; This file is part of GNU CC.
@@ -720,8 +720,7 @@
"*
{
if (GET_CODE (operands[1]) == CONST_DOUBLE)
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[1]));
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
return \"movl %1,%0\";
}")
@@ -1097,7 +1096,7 @@
int dealloc_size = current_function_pretend_args_size;
if (current_function_pops_args)
dealloc_size += current_function_args_size;
- operands[0] = gen_rtx (CONST_INT, VOIDmode, dealloc_size);
+ operands[0] = GEN_INT (dealloc_size);
return \"retd %0\";
}
else
@@ -1258,15 +1257,13 @@
{
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_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[2]));
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (operands[2]));
+ xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2]));
+ operands[2] = GEN_INT (CONST_DOUBLE_HIGH (operands[2]));
}
output_asm_insn (\"addw %1,%0\", xoperands);
return \"addwc %2,%0\";
@@ -1281,15 +1278,13 @@
{
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_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[2]));
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (operands[2]));
+ xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2]));
+ operands[2] = GEN_INT (CONST_DOUBLE_HIGH (operands[2]));
}
output_asm_insn (\"subw %1,%0\", xoperands);
return \"subwb %2,%0\";
@@ -1304,15 +1299,13 @@
{
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_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[2]));
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (operands[2]));
+ xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2]));
+ operands[2] = GEN_INT (CONST_DOUBLE_HIGH (operands[2]));
}
output_asm_insn (\"orw %1,%0\", xoperands);
return \"orw %2,%0\";
@@ -1327,15 +1320,13 @@
{
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_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[2]));
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (operands[2]));
+ xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2]));
+ operands[2] = GEN_INT (CONST_DOUBLE_HIGH (operands[2]));
}
output_asm_insn (\"andw %1,%0\", xoperands);
return \"andw %2,%0\";
@@ -1350,15 +1341,13 @@
{
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_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[2]));
- operands[2] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (operands[2]));
+ xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[2]));
+ operands[2] = GEN_INT (CONST_DOUBLE_HIGH (operands[2]));
}
output_asm_insn (\"xorw %1,%0\", xoperands);
return \"xorw %2,%0\";
diff --git a/gcc/config/romp/romp.c b/gcc/config/romp/romp.c
index ed36259f652..9a73d2360f5 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, 1998 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"
@@ -824,8 +824,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;
@@ -1221,8 +1221,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_rtx (CONST_INT, VOIDmode, 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,
@@ -1348,9 +1347,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 ();
}
@@ -1739,8 +1738,7 @@ output_loadsave_fpregs (file, code, addr)
if (mask)
fprintf (file, "\t%s\n",
- output_fpop (code, gen_rtx (CONST_INT, VOIDmode, 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 be12d367fbb..727ed363292 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, 1998 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_rtx (CONST_INT, VOIDmode, -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_rtx (CONST_INT, VOIDmode, -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; \
} \
@@ -812,29 +811,29 @@ struct rt_cargs {int gregs, fregs; };
rtx _val; \
\
_temp = expand_binop (SImode, add_optab, ADDR, \
- gen_rtx (CONST_INT, VOIDmode, 4), \
+ 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,12 +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_rtx (CONST_INT, VOIDmode, \
- high_int << 16)), 0),\
- gen_rtx (CONST_INT, VOIDmode, low_int)); \
+ (X) = gen_rtx_PLUS (SImode, \
+ force_operand (plus_constant (XEXP (X, 0), \
+ high_int << 16)), \
+ GEN_INT (low_int)); \
} \
}
@@ -1130,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 +1581,8 @@ extern int romp_debugger_arg_correction();
else if (GET_CODE (addr) == SYMBOL_REF \
&& CONSTANT_POOL_ADDRESS_P (addr)) \
{ \
- offset = gen_rtx (CONST_INT, VOIDmode, 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 +1593,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 2177c191065..10b7365ec38 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, 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 91, 93, 94, 95, 1998 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_rtx (CONST_INT, VOIDmode, - const_val));
+ emit_move_insn (operands[0], GEN_INT (- const_val));
emit_insn (gen_negsi2 (operands[0], operands[0]));
DONE;
}
@@ -195,10 +194,9 @@
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_rtx (CONST_INT, VOIDmode, low_part));
+ emit_move_insn (operands[0], GEN_INT (low_part));
emit_insn (gen_iorsi3 (operands[0], operands[0],
- gen_rtx (CONST_INT, VOIDmode, high_part)));
+ 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_rtx (CONST_INT, VOIDmode, 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_rtx (CONST_INT, VOIDmode, 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_rtx (CONST_INT, VOIDmode, 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_rtx (CONST_INT, VOIDmode, 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,10 +1200,9 @@
if (low & 0x8000)
high++, low |= 0xffff0000;
- emit_insn (gen_addsi3 (operands[0], operands[1],
- gen_rtx (CONST_INT, VOIDmode, high << 16)));
+ emit_insn (gen_addsi3 (operands[0], operands[1], GEN_INT (high << 16)));
operands[1] = operands[0];
- operands[2] = gen_rtx (CONST_INT, VOIDmode, low);
+ operands[2] = GEN_INT (low);
}
}")
@@ -1259,8 +1250,7 @@
if (GET_CODE (operands [2]) == CONST_INT)
{
emit_insn (gen_addsi3 (operands[0], operands[1],
- gen_rtx (CONST_INT,
- VOIDmode, - INTVAL (operands[2]))));
+ GEN_INT (- INTVAL (operands[2]))));
DONE;
}
else
@@ -1367,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;
}")
@@ -1417,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;
}")
@@ -1516,10 +1506,9 @@
if (top != 0 && top != 0xffff && bottom != 0 && bottom != 0xffff)
{
emit_insn (gen_andsi3 (operands[0], operands[1],
- gen_rtx (CONST_INT, VOIDmode,
- (top << 16) | 0xffff)));
+ GEN_INT ((top << 16) | 0xffff)));
operands[1] = operands[0];
- operands[2] = gen_rtx (CONST_INT, VOIDmode, 0xffff0000 | bottom);
+ operands[2] = GEN_INT (0xffff0000 | bottom);
}
}
}");
@@ -1552,9 +1541,9 @@
if (top != 0 && bottom != 0)
{
emit_insn (gen_iorsi3 (operands[0], operands[1],
- gen_rtx (CONST_INT, VOIDmode, (top << 16))));
+ GEN_INT (top << 16))));
operands[1] = operands[0];
- operands[2] = gen_rtx (CONST_INT, VOIDmode, bottom);
+ operands[2] = GEN_INT (bottom);
}
}
}");
@@ -1592,9 +1581,9 @@
else if (top != 0 && bottom != 0)
{
emit_insn (gen_xorsi3 (operands[0], operands[1],
- gen_rtx (CONST_INT, VOIDmode, (top << 16))));
+ GEN_INT (top << 16)));
operands[1] = operands[0];
- operands[2] = gen_rtx (CONST_INT, VOIDmode, bottom);
+ operands[2] = GEN_INT (bottom);
}
}
}");
@@ -1666,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)
@@ -1676,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]));
@@ -1690,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);
}
@@ -1725,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)
@@ -1749,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);
}
@@ -1979,8 +1968,7 @@
result = expand_binop (SImode, xor_optab,
operand_subword_force (operands[1], 0, SFmode),
- gen_rtx (CONST_INT, VOIDmode, 0x80000000),
- target, 0, OPTAB_WIDEN);
+ GEN_INT (0x80000000), target, 0, OPTAB_WIDEN);
if (result == 0)
abort ();
@@ -2013,8 +2001,7 @@
start_sequence ();
result = expand_binop (SImode, xor_optab,
operand_subword_force (operands[1], 0, DFmode),
- gen_rtx (CONST_INT, VOIDmode, 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 144c001eeed..cff05e91832 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.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 "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -39,10 +38,6 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "function.h"
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
#ifndef TARGET_NO_PROTOTYPE
#define TARGET_NO_PROTOTYPE 0
#endif
@@ -1444,28 +1439,29 @@ function_arg (cum, mode, type, named)
&& (DEFAULT_ABI != ABI_AIX
|| ! TARGET_XL_CALL
|| (align_words < GP_ARG_NUM_REG))))
- return gen_rtx (REG, mode, cum->fregno);
-
- return gen_rtx (PARALLEL, mode,
- gen_rtvec
- (2,
- gen_rtx (EXPR_LIST, VOIDmode,
- ((align_words >= GP_ARG_NUM_REG)
- ? NULL_RTX
- : (align_words
- + RS6000_ARG_SIZE (mode, type, named)
- > GP_ARG_NUM_REG
- /* If this is partially on the stack, then
- we only include the portion actually
- in registers here. */
- ? gen_rtx (REG, SImode,
- GP_ARG_MIN_REG + align_words)
- : gen_rtx (REG, mode,
- GP_ARG_MIN_REG + align_words))),
- const0_rtx),
- gen_rtx (EXPR_LIST, VOIDmode,
- gen_rtx (REG, mode, cum->fregno),
- const0_rtx)));
+ return gen_rtx_REG (mode, cum->fregno);
+
+ return gen_rtx_PARALLEL
+ (mode,
+ gen_rtvec
+ (2,
+ gen_rtx_EXPR_LIST (VOIDmode,
+ ((align_words >= GP_ARG_NUM_REG)
+ ? NULL_RTX
+ : (align_words
+ + RS6000_ARG_SIZE (mode, type, named)
+ > GP_ARG_NUM_REG
+ /* If this is partially on the stack, then
+ we only include the portion actually
+ in registers here. */
+ ? gen_rtx_REG (SImode,
+ GP_ARG_MIN_REG + align_words)
+ : gen_rtx_REG (mode,
+ GP_ARG_MIN_REG + align_words))),
+ const0_rtx),
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (mode, cum->fregno),
+ const0_rtx)));
}
/* Long longs won't be split between register and stack;
@@ -1478,7 +1474,7 @@ function_arg (cum, mode, type, named)
}
else if (align_words < GP_ARG_NUM_REG)
- return gen_rtx (REG, mode, GP_ARG_MIN_REG + align_words);
+ return gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words);
return NULL_RTX;
}
@@ -1600,8 +1596,9 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
if (!no_rtl && first_reg_offset != GP_ARG_NUM_REG)
move_block_from_reg
(GP_ARG_MIN_REG + first_reg_offset,
- gen_rtx (MEM, BLKmode,
- plus_constant (save_area, first_reg_offset * reg_size)),
+ gen_rtx_MEM (BLKmode,
+ plus_constant (save_area,
+ first_reg_offset * reg_size)),
GP_ARG_NUM_REG - first_reg_offset,
(GP_ARG_NUM_REG - first_reg_offset) * UNITS_PER_WORD);
@@ -1616,21 +1613,24 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
if (num_fp_reg >= 0)
{
- rtx cr1 = gen_rtx (REG, CCmode, 69);
+ rtx cr1 = gen_rtx_REG (CCmode, 69);
rtx lab = gen_label_rtx ();
int off = (GP_ARG_NUM_REG * reg_size) + ((fregno - FP_ARG_MIN_REG) * 8);
- emit_jump_insn (gen_rtx (SET, VOIDmode,
- pc_rtx,
- gen_rtx (IF_THEN_ELSE, VOIDmode,
- gen_rtx (NE, VOIDmode, cr1, const0_rtx),
- gen_rtx (LABEL_REF, VOIDmode, lab),
- pc_rtx)));
+ emit_jump_insn (gen_rtx_SET
+ (VOIDmode,
+ pc_rtx,
+ gen_rtx_IF_THEN_ELSE
+ (VOIDmode,
+ gen_rtx_NE (VOIDmode, cr1, const0_rtx),
+ gen_rtx_LABEL_REF (VOIDmode, lab),
+ pc_rtx)));
while ( num_fp_reg-- >= 0)
{
- emit_move_insn (gen_rtx (MEM, DFmode, plus_constant (save_area, off)),
- gen_rtx (REG, DFmode, fregno++));
+ emit_move_insn (gen_rtx_MEM (DFmode,
+ plus_constant (save_area, off)),
+ gen_rtx_REG (DFmode, fregno++));
off += 8;
}
@@ -1672,7 +1672,7 @@ expand_block_move_mem (mode, addr, orig_mem)
rtx addr;
rtx orig_mem;
{
- rtx mem = gen_rtx (MEM, mode, addr);
+ rtx mem = gen_rtx_MEM (mode, addr);
RTX_UNCHANGING_P (mem) = RTX_UNCHANGING_P (orig_mem);
MEM_VOLATILE_P (mem) = MEM_VOLATILE_P (orig_mem);
@@ -1848,8 +1848,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 */
@@ -2255,7 +2255,7 @@ rs6000_got_register (value)
fatal_insn ("internal error -- needed new GOT register during reload phase to load:", value);
current_function_uses_pic_offset_table = 1;
- pic_offset_table_rtx = gen_rtx (REG, Pmode, GOT_TOC_REGNUM);
+ pic_offset_table_rtx = gen_rtx_REG (Pmode, GOT_TOC_REGNUM);
}
return pic_offset_table_rtx;
@@ -2376,7 +2376,7 @@ rs6000_finalize_pic ()
rtx init = gen_init_v4_pic (reg);
emit_insn_before (init, first_insn);
if (!optimize && last_insn)
- emit_insn_after (gen_rtx (USE, VOIDmode, reg), last_insn);
+ emit_insn_after (gen_rtx_USE (VOIDmode, reg), last_insn);
}
}
}
@@ -2391,7 +2391,7 @@ rs6000_reorg (insn)
{
if (flag_pic && (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS))
{
- rtx got_reg = gen_rtx (REG, Pmode, GOT_TOC_REGNUM);
+ rtx got_reg = gen_rtx_REG (Pmode, GOT_TOC_REGNUM);
for ( ; insn != NULL_RTX; insn = NEXT_INSN (insn))
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
&& reg_mentioned_p (got_reg, PATTERN (insn)))
@@ -2838,7 +2838,7 @@ print_operand (file, x, code)
{
val = (GET_CODE (x) == CONST_INT ? INTVAL (x) : CONST_DOUBLE_HIGH (x));
- if (val == (-1 << (HOST_BITS_PER_WIDE_INT-1)))
+ if (val == ((HOST_WIDE_INT)-1 << (HOST_BITS_PER_WIDE_INT-1)))
i = 0;
else
for (i = 1; i < HOST_BITS_PER_WIDE_INT; i++)
@@ -2852,7 +2852,7 @@ print_operand (file, x, code)
if (val == 0)
--i;
- else if (val == (-1 << (HOST_BITS_PER_WIDE_INT-1)))
+ else if (val == ((HOST_WIDE_INT)-1 << (HOST_BITS_PER_WIDE_INT-1)))
;
else
for (i = 33; i < 64; i++)
@@ -3305,7 +3305,7 @@ rs6000_stack_info ()
#endif
{
if (0 == strcmp (IDENTIFIER_POINTER (DECL_NAME (current_function_decl)),
- "main"))
+ "main")
&& DECL_CONTEXT (current_function_decl) == NULL_TREE)
{
info_ptr->main_p = 1;
@@ -4897,8 +4897,9 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
abort ();
/* 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_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)))
/* Under AIX, just build the 3 word function descriptor */
case ABI_AIX:
@@ -4917,7 +4918,7 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
case ABI_V4:
case ABI_SOLARIS:
case ABI_AIX_NODESC:
- emit_library_call (gen_rtx (SYMBOL_REF, SImode, "__trampoline_setup"),
+ emit_library_call (gen_rtx_SYMBOL_REF (SImode, "__trampoline_setup"),
FALSE, VOIDmode, 4,
addr, pmode,
GEN_INT (rs6000_trampoline_size ()), SImode,
@@ -4934,7 +4935,7 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
rtx fn_reg = gen_reg_rtx (pmode);
rtx toc_reg = gen_reg_rtx (pmode);
- emit_move_insn (tramp_reg, gen_rtx (SYMBOL_REF, pmode, "..LTRAMP1..0"));
+ emit_move_insn (tramp_reg, gen_rtx_SYMBOL_REF (pmode, "..LTRAMP1..0"));
addr = force_reg (pmode, addr);
emit_move_insn (fn_reg, MEM_DEREF (fnaddr));
emit_move_insn (toc_reg, MEM_PLUS (fnaddr, regsize));
@@ -4942,7 +4943,7 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
emit_move_insn (MEM_PLUS (addr, regsize), addr);
emit_move_insn (MEM_PLUS (addr, 2*regsize), fn_reg);
emit_move_insn (MEM_PLUS (addr, 3*regsize), ctx_reg);
- emit_move_insn (MEM_PLUS (addr, 4*regsize), gen_rtx (REG, pmode, 2));
+ emit_move_insn (MEM_PLUS (addr, 4*regsize), gen_rtx_REG (pmode, 2));
}
break;
}
@@ -5079,8 +5080,8 @@ rs6000_dll_import_ref (call_ref)
strcat (p, call_name);
node = get_identifier (p);
- reg1 = force_reg (Pmode, gen_rtx (SYMBOL_REF, VOIDmode, IDENTIFIER_POINTER (node)));
- emit_move_insn (reg2, gen_rtx (MEM, Pmode, reg1));
+ reg1 = force_reg (Pmode, gen_rtx_SYMBOL_REF (VOIDmode, IDENTIFIER_POINTER (node)));
+ emit_move_insn (reg2, gen_rtx_MEM (Pmode, reg1));
return reg2;
}
@@ -5104,7 +5105,7 @@ rs6000_longcall_ref (call_ref)
call_name++;
node = get_identifier (call_name);
- call_ref = gen_rtx (SYMBOL_REF, VOIDmode, IDENTIFIER_POINTER (node));
+ call_ref = gen_rtx_SYMBOL_REF (VOIDmode, IDENTIFIER_POINTER (node));
}
return force_reg (Pmode, call_ref);
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 054e12be9ea..5bf7caa717f 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */
/* Names to predefine in the preprocessor for this target machine. */
-#define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 \
+#define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_LONG_LONG\
-Asystem(unix) -Asystem(aix) -Acpu(rs6000) -Amachine(rs6000)"
/* Print subsidiary information on the compiler version in use. */
@@ -1304,14 +1304,15 @@ extern int rs6000_sysv_varargs_p;
fp1, unless -msoft-float. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx (REG, TYPE_MODE (VALTYPE), \
- TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT ? 33 : 3)
+ gen_rtx_REG (TYPE_MODE (VALTYPE), \
+ TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT ? 33 : 3)
/* 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 && 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.
@@ -1624,12 +1625,15 @@ typedef struct rs6000_args
frame pointer. */
#define RETURN_ADDR_RTX(count, frame) \
((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))))
+ ? gen_rtx_REG (Pmode, 65) \
+ : gen_rtx_MEM (Pmode, \
+ memory_address \
+ (Pmode, \
+ plus_constant (copy_to_reg \
+ (gen_rtx_MEM (Pmode, \
+ memory_address (Pmode, \
+ frame))), \
+ RETURN_ADDRESS_OFFSET))))
/* Definitions for register eliminations.
@@ -1900,9 +1904,9 @@ typedef struct rs6000_args
low_int = INTVAL (XEXP (X, 1)) & 0xffff; \
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); \
- (X) = gen_rtx (PLUS, Pmode, sum, GEN_INT (low_int)); \
+ sum = force_operand (gen_rtx_PLUS (Pmode, XEXP (X, 0), \
+ GEN_INT (high_int)), 0); \
+ (X) = gen_rtx_PLUS (Pmode, sum, GEN_INT (low_int)); \
goto WIN; \
} \
else if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \
@@ -1911,8 +1915,8 @@ typedef struct rs6000_args
&& (TARGET_64BIT || (MODE) != DImode) \
&& (MODE) != TImode) \
{ \
- (X) = gen_rtx (PLUS, Pmode, XEXP (X, 0), \
- force_reg (Pmode, force_operand (XEXP (X, 1), 0))); \
+ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \
+ force_reg (Pmode, force_operand (XEXP (X, 1), 0))); \
goto WIN; \
} \
else if (TARGET_ELF && TARGET_32BIT && TARGET_NO_TOC \
@@ -1924,7 +1928,7 @@ typedef struct rs6000_args
{ \
rtx reg = gen_reg_rtx (Pmode); \
emit_insn (gen_elf_high (reg, (X))); \
- (X) = gen_rtx (LO_SUM, Pmode, reg, (X)); \
+ (X) = gen_rtx_LO_SUM (Pmode, reg, (X)); \
} \
}
@@ -2079,12 +2083,10 @@ typedef struct rs6000_args
#define FASCIST_ASSEMBLER
-#ifndef ASM_OUTPUT_CONSTRUCTOR
-#define ASM_OUTPUT_CONSTRUCTOR(file, name)
-#endif
-#ifndef ASM_OUTPUT_DESTRUCTOR
-#define ASM_OUTPUT_DESTRUCTOR(file, name)
-#endif
+/* AIX does not have any init/fini or ctor/dtor sections, so create
+ static constructors and destructors as normal functions. */
+/* #define ASM_OUTPUT_CONSTRUCTOR(file, name) */
+/* #define ASM_OUTPUT_DESTRUCTOR(file, name) */
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
is done just by pretending it is already truncated. */
@@ -2971,7 +2973,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, 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 e6be7d75608..0c095f95c2c 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -1370,11 +1370,11 @@
{
if (! TARGET_POWER && ! TARGET_POWERPC)
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_divss_call ());
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
- emit_move_insn (operands[3], gen_rtx (REG, SImode, 4));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
+ emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
DONE;
}
}")
@@ -1398,10 +1398,10 @@
{
if (! TARGET_POWER && ! TARGET_POWERPC)
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_quous_call ());
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
DONE;
}
else if (TARGET_POWER)
@@ -1455,10 +1455,10 @@
FAIL;
else
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_quoss_call ());
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
DONE;
}
}")
@@ -1607,11 +1607,11 @@
{
if (! TARGET_POWERPC)
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_divus_call ());
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
- emit_move_insn (operands[3], gen_rtx (REG, SImode, 4));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
+ emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
DONE;
}
else
@@ -3705,7 +3705,7 @@
"
{
operands[6] = GEN_INT (0x80000000);
- operands[7] = gen_rtx (REG, DFmode, FPMEM_REGNUM);
+ operands[7] = gen_rtx_REG (DFmode, FPMEM_REGNUM);
}")
(define_expand "floatunssidf2"
@@ -3759,7 +3759,7 @@
(set (match_dup 0)
(minus:DF (match_dup 0)
(match_dup 3)))]
- "operands[5] = gen_rtx (REG, DFmode, FPMEM_REGNUM);")
+ "operands[5] = gen_rtx_REG (DFmode, FPMEM_REGNUM);")
;; Load up scratch register with base address + offset if needed
(define_insn "*floatsidf2_loadaddr"
@@ -3800,11 +3800,11 @@
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))));
+ = gen_rtx_MEM (SImode,
+ plus_constant (indx,
+ (((rs6000_fpmem_offset & 0xffff) ^ 0x8000)
+ - 0x8000)
+ + ((WORDS_BIG_ENDIAN != 0) * 4)));
return \"{st|stw} %0,%2\";
}"
@@ -3828,11 +3828,11 @@
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))));
+ = gen_rtx_MEM (SImode,
+ plus_constant (indx,
+ (((rs6000_fpmem_offset & 0xffff) ^ 0x8000)
+ - 0x8000)
+ + ((WORDS_BIG_ENDIAN == 0) * 4)));
return \"{st|stw} %0,%2\";
}"
@@ -3858,8 +3858,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\";
}"
@@ -3877,13 +3876,13 @@
if (!TARGET_POWER2 && !TARGET_POWERPC)
{
emit_insn (gen_trunc_call (operands[0], operands[1],
- gen_rtx (SYMBOL_REF, Pmode, RS6000_ITRUNC)));
+ gen_rtx_SYMBOL_REF (Pmode, RS6000_ITRUNC)));
DONE;
}
operands[2] = gen_reg_rtx (DImode);
operands[3] = gen_reg_rtx (Pmode);
- operands[4] = gen_rtx (REG, DImode, FPMEM_REGNUM);
+ operands[4] = gen_rtx_REG (DImode, FPMEM_REGNUM);
}")
(define_insn "*fix_truncdfsi2_internal"
@@ -3913,7 +3912,7 @@
(set (match_operand:SI 0 "gpc_reg_operand" "")
(unspec [(match_dup 4)
(match_dup 3)] 16))]
- "operands[4] = gen_rtx (REG, DImode, FPMEM_REGNUM);")
+ "operands[4] = gen_rtx_REG (DImode, FPMEM_REGNUM);")
(define_insn "*fix_truncdfsi2_store"
[(set (reg:DI 76)
@@ -3931,11 +3930,10 @@
else
indx = stack_pointer_rtx;
- operands[2] = gen_rtx (MEM, DFmode,
- gen_rtx (PLUS, Pmode,
- indx,
- GEN_INT ((((rs6000_fpmem_offset & 0xffff)
- ^ 0x8000) - 0x8000))));
+ operands[2] = gen_rtx_MEM (DFmode,
+ plus_constant (indx,
+ (((rs6000_fpmem_offset & 0xffff)
+ ^ 0x8000) - 0x8000)));
return \"stfd %0,%w2\";
}"
@@ -3958,11 +3956,11 @@
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))));
+ = gen_rtx_MEM (DFmode,
+ plus_constant (indx,
+ (((rs6000_fpmem_offset & 0xffff) ^ 0x8000)
+ - 0x8000)
+ + ((WORDS_BIG_ENDIAN) ? 4 : 0)));
return \"{l|lwz} %0,%2\";
}"
@@ -3975,7 +3973,7 @@
"
{
emit_insn (gen_trunc_call (operands[0], operands[1],
- gen_rtx (SYMBOL_REF, Pmode, RS6000_UITRUNC)));
+ gen_rtx_SYMBOL_REF (Pmode, RS6000_UITRUNC)));
DONE;
}")
@@ -3990,9 +3988,9 @@
rtx first = XVECEXP (insns, 0, 0);
rtx last = XVECEXP (insns, 0, XVECLEN (insns, 0) - 1);
- REG_NOTES (first) = gen_rtx (INSN_LIST, REG_LIBCALL, last,
- REG_NOTES (first));
- REG_NOTES (last) = gen_rtx (INSN_LIST, REG_RETVAL, first, REG_NOTES (last));
+ REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
+ REG_NOTES (first));
+ REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last));
emit_insn (insns);
DONE;
@@ -4097,17 +4095,17 @@
{
if (! TARGET_POWER && ! TARGET_POWERPC)
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_mull_call ());
if (WORDS_BIG_ENDIAN)
- emit_move_insn (operands[0], gen_rtx (REG, DImode, 3));
+ emit_move_insn (operands[0], gen_rtx_REG (DImode, 3));
else
{
emit_move_insn (operand_subword (operands[0], 0, 0, DImode),
- gen_rtx (REG, SImode, 3));
+ gen_rtx_REG (SImode, 3));
emit_move_insn (operand_subword (operands[0], 1, 0, DImode),
- gen_rtx (REG, SImode, 4));
+ gen_rtx_REG (SImode, 4));
}
DONE;
}
@@ -4238,10 +4236,10 @@
{
if (! TARGET_POWER && ! TARGET_POWERPC)
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_mulh_call ());
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
DONE;
}
else if (TARGET_POWER)
@@ -5467,7 +5465,7 @@
|| GET_CODE (operands[1]) == CONST)
&& small_data_operand (operands[1], SImode))
{
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
DONE;
}
@@ -5497,7 +5495,7 @@
rtx new_ref;
while (*name == '.')
name++;
- new_ref = gen_rtx (SYMBOL_REF, Pmode, name);
+ new_ref = gen_rtx_SYMBOL_REF (Pmode, name);
CONSTANT_POOL_ADDRESS_P (new_ref)
= CONSTANT_POOL_ADDRESS_P (operands[1]);
SYMBOL_REF_FLAG (new_ref) = SYMBOL_REF_FLAG (operands[1]);
@@ -5548,7 +5546,7 @@
This should not be done for operands that contain LABEL_REFs.
For now, we just handle the obvious case. */
if (GET_CODE (operands[1]) != LABEL_REF)
- emit_insn (gen_rtx (USE, VOIDmode, operands[1]));
+ emit_insn (gen_rtx_USE (VOIDmode, operands[1]));
/* If we are to limit the number of things we put in the TOC and
this is a symbol plus a constant we can add in one insn,
@@ -6172,7 +6170,7 @@
This should not be done for operands that contain LABEL_REFs.
For now, we just handle the obvious case. */
if (GET_CODE (operands[1]) != LABEL_REF)
- emit_insn (gen_rtx (USE, VOIDmode, operands[1]));
+ emit_insn (gen_rtx_USE (VOIDmode, operands[1]));
/* If we are to limit the number of things we put in the TOC and
this is a symbol plus a constant we can add in one insn,
@@ -6258,8 +6256,8 @@
(set (match_dup 3) (match_dup 1))]
"
{
- operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
- operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
+ operands[2] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN == 0);
+ operands[3] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN != 0);
operands[4] = ((INTVAL (operands[1]) & 0x80000000)
? constm1_rtx : const0_rtx);
}")
@@ -6272,8 +6270,8 @@
(set (match_dup 3) (match_dup 5))]
"
{
- operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
- operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
+ operands[2] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN == 0);
+ operands[3] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN != 0);
operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
}")
@@ -6636,14 +6634,14 @@
count = INTVAL (operands[2]);
regno = REGNO (operands[0]);
- operands[3] = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (count));
+ operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
from = force_reg (SImode, XEXP (operands[1], 0));
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)));
+ = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno + i),
+ change_address (operands[1], SImode,
+ plus_constant (from, i * 4)));
}")
(define_insn ""
@@ -6678,7 +6676,7 @@
else if (i == 0)
{
xop[0] = operands[1];
- xop[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+ xop[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
xop[2] = GEN_INT (4 * (words-1));
output_asm_insn (\"{cal %0,4(%0)|addi %0,%0,4}\;{lsi|lswi} %1,%0,%2\;{l|lwz} %0,-4(%0)\", xop);
return \"\";
@@ -6688,7 +6686,7 @@
for (j = 0; j < words; j++)
if (j != i)
{
- xop[0] = gen_rtx (REG, SImode, REGNO (operands[1]) + j);
+ xop[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + j);
xop[1] = operands[2];
xop[2] = GEN_INT (j * 4);
output_asm_insn (\"{l|lwz} %0,%2(%1)\", xop);
@@ -6733,21 +6731,21 @@
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));
to = force_reg (SImode, XEXP (operands[0], 0));
XVECEXP (operands[3], 0, 0)
- = gen_rtx (SET, VOIDmode, change_address (operands[0], SImode, to),
- operands[1]);
- XVECEXP (operands[3], 0, 1) = gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (SCRATCH, SImode));
+ = gen_rtx_SET (VOIDmode, change_address (operands[0], SImode, to),
+ operands[1]);
+ XVECEXP (operands[3], 0, 1) = gen_rtx_CLOBBER (VOIDmode,
+ 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));
+ = gen_rtx_SET (VOIDmode,
+ change_address (operands[0], SImode,
+ plus_constant (to, i * 4)),
+ gen_rtx_REG (SImode, regno + i));
}")
(define_insn ""
@@ -7309,7 +7307,7 @@
""
"
{ rtx chain = gen_reg_rtx (Pmode);
- rtx stack_bot = gen_rtx (MEM, Pmode, stack_pointer_rtx);
+ rtx stack_bot = gen_rtx_MEM (Pmode, stack_pointer_rtx);
rtx neg_op0;
emit_move_insn (chain, stack_bot);
@@ -7321,7 +7319,7 @@
&& (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,
+ emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode,
\"__allocate_stack\"),
tmp, 0, Pmode, 1, operands[1], Pmode);
emit_insn (gen_set_sp (tmp));
@@ -7350,7 +7348,7 @@
{
emit_insn ((* ((TARGET_32BIT) ? gen_addsi3 : gen_adddi3))
(stack_pointer_rtx, stack_pointer_rtx, neg_op0));
- emit_move_insn (gen_rtx (MEM, Pmode, stack_pointer_rtx), chain);
+ emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), chain);
}
emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
@@ -7395,7 +7393,7 @@
"
{
operands[2] = gen_reg_rtx (Pmode);
- operands[3] = gen_rtx (MEM, Pmode, operands[0]);
+ operands[3] = gen_rtx_MEM (Pmode, operands[0]);
}")
(define_expand "save_stack_nonlocal"
@@ -7407,7 +7405,7 @@
rtx temp = gen_reg_rtx (Pmode);
/* Copy the backchain to the first word, sp to the second. */
- emit_move_insn (temp, gen_rtx (MEM, Pmode, operands[1]));
+ emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
emit_move_insn (operand_subword (operands[0], 0, 0,
(TARGET_32BIT ? DImode : TImode)),
temp);
@@ -7432,7 +7430,7 @@
emit_move_insn (operands[0],
operand_subword (operands[1], 1, 0,
(TARGET_32BIT ? DImode : TImode)));
- emit_move_insn (gen_rtx (MEM, Pmode, operands[0]), temp);
+ emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
DONE;
}")
@@ -7660,14 +7658,14 @@
operands[1], operands[2]));
else
{
- rtx toc_reg = gen_rtx (REG, Pmode, 2);
+ rtx toc_reg = gen_rtx_REG (Pmode, 2);
rtx toc_addr = RS6000_SAVE_TOC;
if (DEFAULT_ABI == ABI_AIX)
{
/* AIX function pointers are really pointers to a three word
area. */
- rtx static_chain = gen_rtx (REG, Pmode, STATIC_CHAIN_REGNUM);
+ rtx static_chain = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
emit_call_insn (TARGET_32BIT
? gen_call_indirect_aix32
(force_reg (Pmode, operands[0]),
@@ -7728,14 +7726,14 @@
operands[3]));
else
{
- rtx toc_reg = gen_rtx (REG, Pmode, 2);
+ rtx toc_reg = gen_rtx_REG (Pmode, 2);
rtx toc_addr = RS6000_SAVE_TOC;
if (DEFAULT_ABI == ABI_AIX)
{
/* AIX function pointers are really pointers to a three word
area. */
- rtx static_chain = gen_rtx (REG, Pmode, STATIC_CHAIN_REGNUM);
+ rtx static_chain = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
emit_call_insn (TARGET_32BIT
? gen_call_value_indirect_aix32
(operands[0],
@@ -8131,8 +8129,8 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8146,8 +8144,8 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8161,8 +8159,8 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8176,8 +8174,8 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8191,8 +8189,8 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8206,8 +8204,8 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8220,8 +8218,8 @@
(pc)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
- rs6000_compare_op0, rs6000_compare_op1);
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -8234,8 +8232,8 @@
(pc)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
- rs6000_compare_op0, rs6000_compare_op1);
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -8248,8 +8246,8 @@
(pc)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
- rs6000_compare_op0, rs6000_compare_op1);
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -8262,8 +8260,8 @@
(pc)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
- rs6000_compare_op0, rs6000_compare_op1);
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -8279,8 +8277,8 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8293,8 +8291,8 @@
{ if (! rs6000_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (COMPARE, CCFPmode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (CCFPmode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCFPmode);
}")
@@ -8310,8 +8308,8 @@
if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
FAIL;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8327,8 +8325,8 @@
if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
FAIL;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8339,8 +8337,8 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8356,8 +8354,8 @@
if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
FAIL;
- operands[1] = gen_rtx (COMPARE, mode,
- rs6000_compare_op0, rs6000_compare_op1);
+ operands[1] = gen_rtx_COMPARE (mode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -8367,8 +8365,8 @@
(gtu:SI (match_dup 2) (const_int 0)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
- rs6000_compare_op0, rs6000_compare_op1);
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -8378,8 +8376,8 @@
(ltu:SI (match_dup 2) (const_int 0)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
- rs6000_compare_op0, rs6000_compare_op1);
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -8389,8 +8387,8 @@
(geu:SI (match_dup 2) (const_int 0)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
- rs6000_compare_op0, rs6000_compare_op1);
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -8400,8 +8398,8 @@
(leu:SI (match_dup 2) (const_int 0)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
- rs6000_compare_op0, rs6000_compare_op1);
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+ rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -9848,7 +9846,7 @@
""
"
{ 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);
}")
@@ -9861,7 +9859,7 @@
""
"
{ 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 2a09788ae9d..dc1f5031430 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.
-
Cloned from sparc/xm-sysv4.h by Michael Meissner (meissner@cygnus.com).
This file is part of GNU CC.
@@ -57,12 +56,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 b4be01e76ec..b05b2b18727 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, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 1998 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"
@@ -280,16 +277,17 @@ 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)));
+
emit_insn (gen_move_insn (r4, XEXP (operands[0], 0)));
emit_insn (gen_move_insn (r5, XEXP (operands[1], 0)));
emit_insn (gen_block_move_real (func_addr_rtx));
@@ -303,15 +301,16 @@ 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)));
+
emit_insn (gen_move_insn (r4, XEXP (operands[0], 0)));
emit_insn (gen_move_insn (r5, XEXP (operands[1], 0)));
@@ -366,7 +365,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;
@@ -407,10 +406,10 @@ prepare_scc_operands (code)
|| TARGET_SH3E && GET_MODE_CLASS (mode) == MODE_FLOAT)
sh_compare_op1 = force_reg (mode, sh_compare_op1);
- emit_insn (gen_rtx (SET, VOIDmode, t_reg,
- gen_rtx (code, SImode, sh_compare_op0,
- sh_compare_op1)));
-
+ emit_insn (gen_rtx_SET (VOIDmode, t_reg,
+ gen_rtx (code, SImode, sh_compare_op0,
+ sh_compare_op1)));
+
return t_reg;
}
@@ -442,9 +441,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));
emit_insn (insn);
}
@@ -580,7 +580,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);
@@ -1083,13 +1083,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;
}
@@ -2403,7 +2403,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
@@ -2704,8 +2704,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
@@ -2910,10 +2910,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;
@@ -2927,8 +2927,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);
}
@@ -3132,7 +3132,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
@@ -3150,20 +3150,19 @@ machine_dependent_reorg (first)
*last_float_addr = r0_inc_rtx;
last_float_move = scan;
last_float = src;
- newsrc = gen_rtx (MEM, mode,
- (REGNO (dst) == FPUL_REG
- ? r0_inc_rtx
- : r0_rtx));
+ newsrc = gen_rtx_MEM (mode,
+ (REGNO (dst) == FPUL_REG
+ ? r0_inc_rtx : r0_rtx));
last_float_addr = &XEXP (newsrc, 0);
}
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;
}
}
@@ -3568,7 +3567,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
@@ -3596,13 +3595,14 @@ push (rn)
rtx x;
if ((rn >= FIRST_FP_REG && rn <= LAST_FP_REG)
|| rn == FPUL_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. */
@@ -3614,13 +3614,14 @@ pop (rn)
rtx x;
if ((rn >= FIRST_FP_REG && rn <= LAST_FP_REG)
|| rn == FPUL_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. */
@@ -3831,9 +3832,10 @@ sh_builtin_saveregs (arglist)
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.
@@ -3851,8 +3853,8 @@ sh_builtin_saveregs (arglist)
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. */
@@ -3971,8 +3973,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 a3aa90253e6..e63279e02fc 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, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com).
Improved by Jim Wilson (wilson@cygnus.com).
@@ -726,7 +726,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) \
@@ -836,8 +836,8 @@ struct sh_args {
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
((PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \
&& ((NAMED) || TARGET_SH3E)) \
- ? gen_rtx (REG, (MODE), \
- (BASE_ARG_REG (MODE) + ROUND_REG ((CUM), (MODE)))) \
+ ? gen_rtx_REG ((MODE), \
+ (BASE_ARG_REG (MODE) + ROUND_REG ((CUM), (MODE)))) \
: 0)
/* For an arg passed partly in registers and partly in memory,
@@ -918,13 +918,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)); \
}
@@ -935,7 +935,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().
@@ -1164,7 +1164,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 35432aa665d..eacc18127c6 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -1,5 +1,5 @@
;;- Machine description for the Hitachi SH.
-;; Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
;; Contributed by Steve Chamberlain (sac@cygnus.com).
;; Improved by Jim Wilson (wilson@cygnus.com).
@@ -432,10 +432,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));
@@ -496,10 +498,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));
@@ -768,9 +772,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;
}
}")
@@ -801,9 +805,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;
}
}")
@@ -2062,7 +2066,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;
}")
@@ -2087,7 +2091,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;
}")
@@ -2524,7 +2528,7 @@
{
rtx lab = gen_label_rtx ();
emit_jump_insn (gen_casesi_jump_2 (reg2,
- gen_rtx (LABEL_REF, VOIDmode, lab),
+ gen_rtx_LABEL_REF (VOIDmode, lab),
operands[3]));
emit_label (lab);
/* Put a fake jump after the label, lest some optimization might
@@ -2728,15 +2732,15 @@
{
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 ();
- emit_insn (gen_rtx (SET, VOIDmode, t_reg,
- gen_rtx (EQ, SImode, sh_compare_op0,
- sh_compare_op1)));
+ emit_insn (gen_rtx_SET (VOIDmode, t_reg,
+ gen_rtx_EQ (SImode, sh_compare_op0,
+ sh_compare_op1)));
emit_jump_insn (gen_branch_true (lab));
- emit_insn (gen_rtx (SET, VOIDmode, t_reg,
- gen_rtx (GT, SImode, sh_compare_op0,
- sh_compare_op1)));
+ emit_insn (gen_rtx_SET (VOIDmode, t_reg,
+ gen_rtx_GT (SImode, sh_compare_op0,
+ sh_compare_op1)));
emit_label (lab);
emit_insn (gen_movt (operands[0]));
}
@@ -3154,14 +3158,14 @@
emit_insn (gen_addsi3 (addr_target, orig_address, GEN_INT (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.c b/gcc/config/sparc/sparc.c
index 8641d61728f..d4dd9d12e5f 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.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 "tree.h"
#include "rtl.h"
#include "regs.h"
@@ -1038,18 +1038,18 @@ gen_compare_reg (code, x, y)
prev_args[reg][1] = y;
next_fcc_reg = (next_fcc_reg + 1) & 3;
}
- cc_reg = gen_rtx (REG, mode, reg + SPARC_FIRST_V9_FCC_REG);
+ cc_reg = gen_rtx_REG (mode, reg + SPARC_FIRST_V9_FCC_REG);
}
#else
cc_reg = gen_reg_rtx (mode);
#endif /* ! experiment */
else if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
- cc_reg = gen_rtx (REG, mode, SPARC_FCC_REG);
+ cc_reg = gen_rtx_REG (mode, SPARC_FCC_REG);
else
- cc_reg = gen_rtx (REG, mode, SPARC_ICC_REG);
+ cc_reg = gen_rtx_REG (mode, SPARC_ICC_REG);
- 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;
}
@@ -1115,17 +1115,16 @@ gen_v9_scc (compare_code, operands)
&& GET_MODE (operands[0]) == DImode
&& GET_MODE (op0) == DImode)
{
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], op0));
- emit_insn (gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (IF_THEN_ELSE, DImode,
- gen_rtx (compare_code, DImode,
- op0, const0_rtx),
- const1_rtx,
- operands[0])));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], op0));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_IF_THEN_ELSE
+ (DImode, gen_rtx (compare_code, DImode,
+ op0, const0_rtx),
+ const1_rtx, operands[0])));
return 1;
}
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], const0_rtx));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], const0_rtx));
if (GET_MODE (op0) != DImode)
{
temp = gen_reg_rtx (DImode);
@@ -1133,12 +1132,12 @@ gen_v9_scc (compare_code, operands)
}
else
temp = op0;
- emit_insn (gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (IF_THEN_ELSE, GET_MODE (operands[0]),
- gen_rtx (compare_code, DImode,
- temp, const0_rtx),
- const1_rtx,
- operands[0])));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_IF_THEN_ELSE
+ (GET_MODE (operands[0]),
+ gen_rtx (compare_code, DImode,
+ temp, const0_rtx),
+ const1_rtx, operands[0])));
return 1;
}
else
@@ -1155,13 +1154,13 @@ gen_v9_scc (compare_code, operands)
default :
abort ();
}
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], const0_rtx));
- emit_insn (gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (IF_THEN_ELSE, GET_MODE (operands[0]),
- gen_rtx (compare_code,
- GET_MODE (operands[1]),
- operands[1], const0_rtx),
- const1_rtx, operands[0])));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], const0_rtx));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_IF_THEN_ELSE
+ (GET_MODE (operands[0]),
+ gen_rtx (compare_code, GET_MODE (operands[1]),
+ operands[1], const0_rtx),
+ const1_rtx, operands[0])));
return 1;
}
}
@@ -1175,13 +1174,13 @@ emit_v9_brxx_insn (code, op0, label)
enum rtx_code code;
rtx op0, label;
{
- emit_jump_insn (gen_rtx (SET, VOIDmode,
- pc_rtx,
- gen_rtx (IF_THEN_ELSE, VOIDmode,
- gen_rtx (code, GET_MODE (op0),
- op0, const0_rtx),
- gen_rtx (LABEL_REF, VOIDmode, label),
- pc_rtx)));
+ emit_jump_insn (gen_rtx_SET (VOIDmode,
+ pc_rtx,
+ gen_rtx_IF_THEN_ELSE
+ (VOIDmode,
+ gen_rtx (code, GET_MODE (op0),
+ op0, const0_rtx),
+ gen_rtx_LABEL_REF (VOIDmode, label), pc_rtx)));
}
/* Return nonzero if a return peephole merging return with
@@ -1419,16 +1418,17 @@ legitimize_pic_address (orig, mode, reg)
else
address = orig;
- pic_ref = gen_rtx (MEM, Pmode,
- gen_rtx (PLUS, Pmode,
- pic_offset_table_rtx, address));
+ pic_ref = gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode,
+ pic_offset_table_rtx, address));
+
current_function_uses_pic_offset_table = 1;
RTX_UNCHANGING_P (pic_ref) = 1;
insn = emit_move_insn (reg, pic_ref);
/* 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));
return reg;
}
else if (GET_CODE (orig) == CONST)
@@ -1466,7 +1466,7 @@ legitimize_pic_address (orig, mode, reg)
/* If we reach here, then something is seriously wrong. */
abort ();
}
- return gen_rtx (PLUS, Pmode, base, offset);
+ return gen_rtx_PLUS (Pmode, base, offset);
}
else if (GET_CODE (orig) == LABEL_REF)
/* ??? Why do we do this? */
@@ -1496,18 +1496,18 @@ pic_setup_code ()
/* If -O0, show the PIC register remains live before this. */
if (obey_regdecls)
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
l1 = gen_label_rtx ();
- pic_pc_rtx = gen_rtx (CONST, Pmode,
- gen_rtx (MINUS, Pmode,
- global_offset_table,
- gen_rtx (CONST, Pmode,
- gen_rtx (MINUS, Pmode,
- gen_rtx (LABEL_REF,
- VOIDmode, l1),
- pc_rtx))));
+ pic_pc_rtx
+ = gen_rtx_CONST (Pmode,
+ gen_rtx_MINUS
+ (Pmode, global_offset_table,
+ gen_rtx_CONST (Pmode,
+ gen_rtx_MINUS
+ (Pmode, gen_rtx_LABEL_REF (VOIDmode, l1),
+ pc_rtx))));
/* sparc64: the RDPC instruction doesn't pair, and puts 4 bubbles in the
pipe to boot. So don't use it here, especially when we're
@@ -1519,29 +1519,29 @@ pic_setup_code ()
/* Iff we are doing delay branch optimization, slot the sethi up
here so that it will fill the delay slot of the call. */
if (flag_delayed_branch)
- emit_insn (gen_rtx (SET, VOIDmode, pic_offset_table_rtx,
- gen_rtx (HIGH, Pmode, pic_pc_rtx)));
-
+ emit_insn (gen_rtx_SET (VOIDmode, pic_offset_table_rtx,
+ gen_rtx_HIGH (Pmode, pic_pc_rtx)));
+
/* Note that we pun calls and jumps here! */
emit_jump_insn (gen_get_pc_via_call (l2, l1));
emit_label (l2);
if (!flag_delayed_branch)
- emit_insn (gen_rtx (SET, VOIDmode, pic_offset_table_rtx,
- gen_rtx (HIGH, Pmode, pic_pc_rtx)));
-
- emit_insn (gen_rtx (SET, VOIDmode,
- pic_offset_table_rtx,
- gen_rtx (LO_SUM, Pmode,
- pic_offset_table_rtx, pic_pc_rtx)));
- emit_insn (gen_rtx (SET, VOIDmode,
- pic_offset_table_rtx,
- gen_rtx (PLUS, Pmode,
- pic_offset_table_rtx,
- gen_rtx (REG, Pmode, 15))));
-
- /* emit_insn (gen_rtx (ASM_INPUT, VOIDmode, "!#PROLOGUE# 1")); */
+ emit_insn (gen_rtx_SET (VOIDmode, pic_offset_table_rtx,
+ gen_rtx_HIGH (Pmode, pic_pc_rtx)));
+
+ emit_insn (gen_rtx_SET (VOIDmode,
+ pic_offset_table_rtx,
+ gen_rtx_LO_SUM (Pmode,
+ pic_offset_table_rtx, pic_pc_rtx)));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ pic_offset_table_rtx,
+ gen_rtx_PLUS (Pmode,
+ pic_offset_table_rtx,
+ gen_rtx_REG (Pmode, 15))));
+
+ /* emit_insn (gen_rtx_ASM_INPUT (VOIDmode, "!#PROLOGUE# 1")); */
LABEL_PRESERVE_P (l1) = 1;
LABEL_PRESERVE_P (l2) = 1;
@@ -1568,7 +1568,7 @@ finalize_pic ()
/* Initialize every time through, since we can't easily
know this to be permanent. */
- global_offset_table = gen_rtx (SYMBOL_REF, Pmode, "_GLOBAL_OFFSET_TABLE_");
+ global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
flag_pic = 0;
emit_insn_after (pic_setup_code (), get_insns ());
@@ -1585,7 +1585,7 @@ finalize_pic ()
since setjmp/longjmp can cause life info to screw up.
??? In the case where we don't obey regdecls, this is not sufficient
since we may not fall out the bottom. */
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
}
/* Emit insns to move operands[1] into operands[0].
@@ -1618,7 +1618,7 @@ emit_move_sequence (operands, mode)
|| 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;
}
}
@@ -1628,7 +1628,7 @@ emit_move_sequence (operands, mode)
|| (operand1 == const0_rtx && ! TARGET_LIVE_G0))
{
/* 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)
@@ -1698,14 +1698,14 @@ emit_move_sequence (operands, mode)
if (TARGET_ARCH64 && mode == DImode)
emit_insn (gen_sethi_di_sp64 (temp, operand1));
else
- emit_insn (gen_rtx (SET, VOIDmode, temp,
- gen_rtx (HIGH, mode, operand1)));
+ emit_insn (gen_rtx_SET (VOIDmode, temp,
+ gen_rtx_HIGH (mode, operand1)));
if (GET_CODE (operand1) == CONST_INT)
operand1 = GEN_INT (INTVAL (operand1) & 0xffffffff);
else if (GET_CODE (operand1) == CONST_DOUBLE)
operand1 = GEN_INT (CONST_DOUBLE_LOW (operand1) & 0xffffffff);
- operands[1] = gen_rtx (LO_SUM, mode, temp, operand1);
+ operands[1] = gen_rtx_LO_SUM (mode, temp, operand1);
}
}
@@ -1952,14 +1952,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 (op0) + 1);
+ latehalf[0] = gen_rtx_REG (SImode, REGNO (op0) + 1);
else if (optype0 == OFFSOP)
latehalf[0] = adj_offsettable_operand (op0, 4);
else
latehalf[0] = op0;
if (optype1 == REGOP)
- latehalf[1] = gen_rtx (REG, SImode, REGNO (op1) + 1);
+ latehalf[1] = gen_rtx_REG (SImode, REGNO (op1) + 1);
else if (optype1 == OFFSOP)
latehalf[1] = adj_offsettable_operand (op1, 4);
else if (optype1 == CNSTOP)
@@ -1968,8 +1968,7 @@ output_move_double (operands)
{
if (arith_double_operand (op1, DImode))
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (op1));
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (op1));
return "mov %1,%0";
}
else
@@ -2057,7 +2056,7 @@ output_move_double (operands)
xops[0] = latehalf[0];
xops[1] = op0;
output_asm_insn ("add %1,%0,%1", xops);
- operands[1] = gen_rtx (MEM, DImode, op0);
+ operands[1] = gen_rtx_MEM (DImode, op0);
latehalf[1] = adj_offsettable_operand (operands[1], 4);
addreg1 = 0;
highest_first = 1;
@@ -2163,12 +2162,12 @@ output_move_quad (operands)
if (optype0 == REGOP)
{
- wordpart[0][0] = gen_rtx (REG, word_mode, REGNO (op0) + 0);
- wordpart[1][0] = gen_rtx (REG, word_mode, REGNO (op0) + 1);
+ wordpart[0][0] = gen_rtx_REG (word_mode, REGNO (op0) + 0);
+ wordpart[1][0] = gen_rtx_REG (word_mode, REGNO (op0) + 1);
if (TARGET_ARCH32)
{
- wordpart[2][0] = gen_rtx (REG, word_mode, REGNO (op0) + 2);
- wordpart[3][0] = gen_rtx (REG, word_mode, REGNO (op0) + 3);
+ wordpart[2][0] = gen_rtx_REG (word_mode, REGNO (op0) + 2);
+ wordpart[3][0] = gen_rtx_REG (word_mode, REGNO (op0) + 3);
}
}
else if (optype0 == OFFSOP)
@@ -2193,12 +2192,12 @@ output_move_quad (operands)
if (optype1 == REGOP)
{
- wordpart[0][1] = gen_rtx (REG, word_mode, REGNO (op1) + 0);
- wordpart[1][1] = gen_rtx (REG, word_mode, REGNO (op1) + 1);
+ wordpart[0][1] = gen_rtx_REG (word_mode, REGNO (op1) + 0);
+ wordpart[1][1] = gen_rtx_REG (word_mode, REGNO (op1) + 1);
if (TARGET_ARCH32)
{
- wordpart[2][1] = gen_rtx (REG, word_mode, REGNO (op1) + 2);
- wordpart[3][1] = gen_rtx (REG, word_mode, REGNO (op1) + 3);
+ wordpart[2][1] = gen_rtx_REG (word_mode, REGNO (op1) + 2);
+ wordpart[3][1] = gen_rtx_REG (word_mode, REGNO (op1) + 3);
}
}
else if (optype1 == OFFSOP)
@@ -2628,8 +2627,7 @@ output_size_for_block_move (size, reg, align)
output_asm_insn ("sub %1,%2,%0", xoperands);
else
{
- xoperands[1]
- = gen_rtx (CONST_INT, VOIDmode, INTVAL (size) - INTVAL (align));
+ xoperands[1] = GEN_INT (INTVAL (size) - INTVAL (align));
output_asm_insn ("set %1,%0", xoperands);
}
}
@@ -2667,7 +2665,7 @@ output_block_move (operands)
if (align > UNITS_PER_WORD)
{
align = UNITS_PER_WORD;
- alignrtx = gen_rtx (CONST_INT, VOIDmode, UNITS_PER_WORD);
+ alignrtx = GEN_INT (UNITS_PER_WORD);
}
/* We consider 8 ld/st pairs, for a total of 16 inline insns to be
@@ -2763,11 +2761,11 @@ output_block_move (operands)
}
if (align != INTVAL (alignrtx))
- alignrtx = gen_rtx (CONST_INT, VOIDmode, align);
+ alignrtx = GEN_INT (align);
- xoperands[3] = gen_rtx (CONST_INT, VOIDmode, movstrsi_label++);
- xoperands[4] = gen_rtx (CONST_INT, VOIDmode, align);
- xoperands[5] = gen_rtx (CONST_INT, VOIDmode, movstrsi_label++);
+ xoperands[3] = GEN_INT (movstrsi_label++);
+ xoperands[4] = GEN_INT (align);
+ xoperands[5] = GEN_INT (movstrsi_label++);
ASM_GENERATE_INTERNAL_LABEL (label3, "Lm", INTVAL (xoperands[3]));
ASM_GENERATE_INTERNAL_LABEL (label5, "Lm", INTVAL (xoperands[5]));
@@ -3540,12 +3538,16 @@ output_function_epilogue (file, size, leaf_function)
/* If we wound up with things in our delay slot, flush them here. */
if (current_function_epilogue_delay_list)
{
- rtx insn = emit_jump_insn_after (gen_rtx (RETURN, VOIDmode),
+ rtx insn = emit_jump_insn_after (gen_rtx_RETURN (VOIDmode),
get_last_insn ());
- PATTERN (insn) = gen_rtx (PARALLEL, VOIDmode,
- gen_rtvec (2,
- PATTERN (XEXP (current_function_epilogue_delay_list, 0)),
- PATTERN (insn)));
+ PATTERN (insn)
+ = gen_rtx_PARALLEL
+ (VOIDmode,
+ gen_rtvec (2,
+ PATTERN
+ (XEXP (current_function_epilogue_delay_list, 0)),
+ PATTERN (insn)));
+
final_scan_insn (insn, file, 1, 0, 1);
}
else
@@ -3844,7 +3846,7 @@ function_arg (cum, mode, type, named, incoming_p)
if (TARGET_ARCH32)
{
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
return reg;
}
@@ -3856,7 +3858,7 @@ function_arg (cum, mode, type, named, incoming_p)
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
&& SPARC_FP_REG_P (regno))
{
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
if (cum->prototype_p || cum->libcall_p)
{
/* "* 2" because fp reg numbers are recorded in 4 byte
@@ -3866,12 +3868,11 @@ function_arg (cum, mode, type, named, incoming_p)
value in the reg but reserve space on the stack. That's an
optimization, and is deferred [for a bit]. */
if ((regno - SPARC_FP_ARG_FIRST) >= SPARC_INT_ARG_MAX * 2)
- return gen_rtx (PARALLEL, mode,
- gen_rtvec (2,
- gen_rtx (EXPR_LIST, VOIDmode,
- NULL_RTX, const0_rtx),
- gen_rtx (EXPR_LIST, VOIDmode,
- reg, const0_rtx)));
+ return gen_rtx_PARALLEL
+ (mode,
+ gen_rtvec (2,
+ gen_rtx_EXPR_LIST (VOIDmode, NULL_RTX, const0_rtx),
+ gen_rtx_EXPR_LIST (VOIDmode, reg, const0_rtx)));
else
return reg;
}
@@ -3883,21 +3884,21 @@ function_arg (cum, mode, type, named, incoming_p)
? SPARC_INCOMING_INT_ARG_FIRST
: SPARC_OUTGOING_INT_ARG_FIRST);
int intreg = regbase + (regno - SPARC_FP_ARG_FIRST) / 2;
- return gen_rtx (PARALLEL, mode,
- gen_rtvec (2,
- gen_rtx (EXPR_LIST, VOIDmode,
- gen_rtx (REG, mode, intreg),
- const0_rtx),
- gen_rtx (EXPR_LIST, VOIDmode,
- reg, const0_rtx)));
+
+ return gen_rtx_PARALLEL
+ (mode,
+ gen_rtvec (2,
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (mode, intreg),
+ const0_rtx),
+ gen_rtx_EXPR_LIST (VOIDmode, reg, const0_rtx)));
}
else
- return gen_rtx (PARALLEL, mode,
- gen_rtvec (2,
- gen_rtx (EXPR_LIST, VOIDmode,
- NULL_RTX, const0_rtx),
- gen_rtx (EXPR_LIST, VOIDmode,
- reg, const0_rtx)));
+ return gen_rtx_PARALLEL
+ (mode,
+ gen_rtvec (2,
+ gen_rtx_EXPR_LIST (VOIDmode, NULL_RTX, const0_rtx),
+ gen_rtx_EXPR_LIST (VOIDmode, reg, const0_rtx)));
}
}
else if (type && TREE_CODE (type) == RECORD_TYPE)
@@ -3974,12 +3975,11 @@ function_arg (cum, mode, type, named, incoming_p)
if (nregs == 0)
abort ();
- ret = gen_rtx (PARALLEL, BLKmode, rtvec_alloc (nregs + 1));
+ ret = gen_rtx_PARALLEL (BLKmode, rtvec_alloc (nregs + 1));
/* ??? This causes the entire struct to be passed in memory.
This isn't necessary, but is left for later. */
- XVECEXP (ret, 0, 0) = gen_rtx (EXPR_LIST, VOIDmode, NULL_RTX,
- const0_rtx);
+ XVECEXP (ret, 0, 0) = gen_rtx_EXPR_LIST (VOIDmode, NULL_RTX, const0_rtx);
/* Fill in the entries. */
start_int_bitpos = -1;
@@ -3996,12 +3996,13 @@ function_arg (cum, mode, type, named, incoming_p)
&& ! packed_p
&& named)
{
- reg = gen_rtx (REG, DECL_MODE (field),
- (SPARC_FP_ARG_FIRST + this_slotno * 2
- + (DECL_MODE (field) == SFmode
- && (bitpos & 32) != 0)));
- XVECEXP (ret, 0, i) = gen_rtx (EXPR_LIST, VOIDmode, reg,
- GEN_INT (bitpos / BITS_PER_UNIT));
+ reg = gen_rtx_REG (DECL_MODE (field),
+ (SPARC_FP_ARG_FIRST + this_slotno * 2
+ + (DECL_MODE (field) == SFmode
+ && (bitpos & 32) != 0)));
+ XVECEXP (ret, 0, i)
+ = gen_rtx_EXPR_LIST (VOIDmode, reg,
+ GEN_INT (bitpos / BITS_PER_UNIT));
i++;
start_int_bitpos = -1;
}
@@ -4025,9 +4026,10 @@ function_arg (cum, mode, type, named, incoming_p)
mode = word_mode;
regno = regbase + this_slotno;
- reg = gen_rtx (REG, mode, regno);
- XVECEXP (ret, 0, i) = gen_rtx (EXPR_LIST, VOIDmode, reg,
- GEN_INT (bitpos / BITS_PER_UNIT));
+ reg = gen_rtx_REG (mode, regno);
+ XVECEXP (ret, 0, i)
+ = gen_rtx_EXPR_LIST (VOIDmode, reg,
+ GEN_INT (bitpos / BITS_PER_UNIT));
i++;
if (start_int_bitpos == -1)
start_int_bitpos = bitpos;
@@ -4049,12 +4051,12 @@ function_arg (cum, mode, type, named, incoming_p)
abort ();
mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 0);
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
}
else
{
/* Scalar or complex int. */
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
}
return reg;
@@ -4261,20 +4263,17 @@ sparc_builtin_saveregs (arglist)
int regno;
for (regno = first_reg; regno < NPARM_REGS (word_mode); regno++)
- emit_move_insn (gen_rtx (MEM, word_mode,
- gen_rtx (PLUS, Pmode,
- frame_pointer_rtx,
- GEN_INT (STACK_POINTER_OFFSET
- + UNITS_PER_WORD * regno))),
- gen_rtx (REG, word_mode,
- BASE_INCOMING_ARG_REG (word_mode) + regno));
-
- address = gen_rtx (PLUS, Pmode,
- frame_pointer_rtx,
- GEN_INT (STACK_POINTER_OFFSET
- + UNITS_PER_WORD * first_reg));
-
- if (flag_check_memory_usage
+ emit_move_insn (gen_rtx_MEM (word_mode,
+ plus_constant (frame_pointer_rtx,
+ (STACK_POINTER_OFFSET
+ + UNITS_PER_WORD * regno))),
+ gen_rtx_REG (word_mode,
+ BASE_INCOMING_ARG_REG (word_mode) + regno));
+
+ address = plus_constant (frame_pointer_rtx,
+ STACK_POINTER_OFFSET + UNITS_PER_WORD * first_reg);
+
+ if (current_function_check_memory_usage
&& first_reg < NPARM_REGS (word_mode))
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
address, ptr_mode,
@@ -4549,7 +4548,7 @@ output_return (operands)
the stack pointer might have been adjusted. Output code to
restore it now. */
- operands[0] = gen_rtx (CONST_INT, VOIDmode, actual_fsize);
+ operands[0] = GEN_INT (actual_fsize);
/* Use sub of negated value in first two cases instead of add to
allow actual_fsize == 4096. */
@@ -4563,7 +4562,7 @@ output_return (operands)
}
else if (actual_fsize <= 8192)
{
- operands[0] = gen_rtx (CONST_INT, VOIDmode, actual_fsize - 4096);
+ operands[0] = GEN_INT (actual_fsize - 4096);
if (SKIP_CALLERS_UNIMP_P)
return "sub %%sp,-4096,%%sp\n\tjmp %%o7+12\n\tsub %%sp,-%0,%%sp";
else
@@ -5002,8 +5001,8 @@ output_double_int (file, value)
high = (xword >> 32) & 0xffffffff;
low = xword & 0xffffffff;
- ASM_OUTPUT_INT (file, gen_rtx (CONST_INT, VOIDmode, high));
- ASM_OUTPUT_INT (file, gen_rtx (CONST_INT, VOIDmode, low));
+ ASM_OUTPUT_INT (file, GEN_INT (high));
+ ASM_OUTPUT_INT (file, GEN_INT (low));
#else
if (INTVAL (value) < 0)
ASM_OUTPUT_INT (file, constm1_rtx);
@@ -5014,10 +5013,8 @@ output_double_int (file, value)
}
else if (GET_CODE (value) == CONST_DOUBLE)
{
- ASM_OUTPUT_INT (file, gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (value)));
- ASM_OUTPUT_INT (file, gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (value)));
+ ASM_OUTPUT_INT (file, GEN_INT (CONST_DOUBLE_HIGH (value)));
+ ASM_OUTPUT_INT (file, GEN_INT (CONST_DOUBLE_LOW (value)));
}
else if (GET_CODE (value) == SYMBOL_REF
|| GET_CODE (value) == CONST
@@ -5212,34 +5209,30 @@ sparc_initialize_trampoline (tramp, fnaddr, cxt)
size_int (10), 0, 1);
rtx high_fn = expand_shift (RSHIFT_EXPR, SImode, fnaddr,
size_int (10), 0, 1);
- rtx low_cxt = expand_and (cxt, gen_rtx (CONST_INT, VOIDmode, 0x3ff), 0);
- rtx low_fn = expand_and (fnaddr, gen_rtx (CONST_INT, VOIDmode, 0x3ff), 0);
- rtx g1_sethi = gen_rtx (HIGH, SImode,
- gen_rtx (CONST_INT, VOIDmode, 0x03000000));
- rtx g2_sethi = gen_rtx (HIGH, SImode,
- gen_rtx (CONST_INT, VOIDmode, 0x05000000));
- rtx g1_ori = gen_rtx (HIGH, SImode,
- gen_rtx (CONST_INT, VOIDmode, 0x82106000));
- rtx g2_ori = gen_rtx (HIGH, SImode,
- gen_rtx (CONST_INT, VOIDmode, 0x8410A000));
+ rtx low_cxt = expand_and (cxt, GEN_INT (0x3ff), 0);
+ rtx low_fn = expand_and (fnaddr, GEN_INT (0x3ff), 0);
+ rtx g1_sethi = gen_rtx_HIGH (SImode, GEN_INT (0x03000000));
+ rtx g2_sethi = gen_rtx_HIGH (SImode, GEN_INT (0x05000000));
+ rtx g1_ori = gen_rtx_HIGH (SImode, GEN_INT (0x82106000));
+ rtx g2_ori = gen_rtx_HIGH (SImode, GEN_INT (0x8410A000));
rtx tem = gen_reg_rtx (SImode);
emit_move_insn (tem, g1_sethi);
emit_insn (gen_iorsi3 (high_fn, high_fn, tem));
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 0)), high_fn);
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 0)), high_fn);
emit_move_insn (tem, g1_ori);
emit_insn (gen_iorsi3 (low_fn, low_fn, tem));
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 4)), low_fn);
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 4)), low_fn);
emit_move_insn (tem, g2_sethi);
emit_insn (gen_iorsi3 (high_cxt, high_cxt, tem));
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 8)), high_cxt);
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 8)), high_cxt);
emit_move_insn (tem, g2_ori);
emit_insn (gen_iorsi3 (low_cxt, low_cxt, tem));
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 16)), low_cxt);
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, SImode, tramp))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, SImode,
- plus_constant (tramp, 8)))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, SImode,
- plus_constant (tramp, 16)))));
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 16)), low_cxt);
+ emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode, tramp))));
+ emit_insn (gen_flush (validize_mem
+ (gen_rtx_MEM (SImode, plus_constant (tramp, 8)))));
+ emit_insn (gen_flush (validize_mem
+ (gen_rtx_MEM (SImode, plus_constant (tramp, 16)))));
}
/* The 64 bit version is simpler because it makes more sense to load the
@@ -5250,17 +5243,17 @@ void
sparc64_initialize_trampoline (tramp, fnaddr, cxt)
rtx tramp, fnaddr, cxt;
{
- emit_move_insn (gen_rtx (MEM, DImode, plus_constant (tramp, 24)), cxt);
- emit_move_insn (gen_rtx (MEM, DImode, plus_constant (tramp, 32)), fnaddr);
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode, tramp))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode,
- plus_constant (tramp, 8)))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode,
- plus_constant (tramp, 16)))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode,
- plus_constant (tramp, 24)))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode,
- plus_constant (tramp, 32)))));
+ emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 24)), cxt);
+ emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 32)), fnaddr);
+ emit_insn (gen_flush (validize_mem (gen_rtx_MEM (DImode, tramp))));
+ emit_insn (gen_flush (validize_mem
+ (gen_rtx_MEM (DImode, plus_constant (tramp, 8)))));
+ emit_insn (gen_flush (validize_mem
+ (gen_rtx_MEM (DImode, plus_constant (tramp, 16)))));
+ emit_insn (gen_flush (validize_mem
+ (gen_rtx_MEM (DImode, plus_constant (tramp, 24)))));
+ emit_insn (gen_flush (validize_mem
+ (gen_rtx_MEM (DImode, plus_constant (tramp, 32)))));
}
/* Subroutines to support a flat (single) register window calling
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 186cf8fca3b..5578a063d19 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -807,7 +807,7 @@ if (TARGET_ARCH64 \
/* Argument passing regs. */
#define SPARC_OUTGOING_INT_ARG_FIRST 8
-#define SPARC_INCOMING_INT_ARG_FIRST 24
+#define SPARC_INCOMING_INT_ARG_FIRST (TARGET_FLAT ? 8 : 24)
#define SPARC_FP_ARG_FIRST 32
/* 1 for registers that have pervasive standard uses
@@ -1070,15 +1070,14 @@ extern int sparc_mode_class[];
#define STRUCT_VALUE \
(TARGET_ARCH64 \
? 0 \
- : gen_rtx (MEM, Pmode, \
- gen_rtx (PLUS, Pmode, stack_pointer_rtx, \
- gen_rtx (CONST_INT, VOIDmode, 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_rtx (CONST_INT, VOIDmode, 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.
@@ -1340,8 +1339,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.
@@ -1474,19 +1473,21 @@ extern char leaf_reg_remap[];
/* On SPARC the value is found in the first "output" register. */
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx (REG, TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG (TYPE_MODE (VALTYPE)))
+#define FUNCTION_VALUE(VALTYPE, FUNC) \
+ gen_rtx_REG (TYPE_MODE (VALTYPE), \
+ BASE_RETURN_VALUE_REG (TYPE_MODE (VALTYPE)))
/* But the called function leaves it in the first "input" register. */
#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \
- gen_rtx (REG, TYPE_MODE (VALTYPE), BASE_OUTGOING_VALUE_REG (TYPE_MODE (VALTYPE)))
+ gen_rtx_REG (TYPE_MODE (VALTYPE), \
+ BASE_OUTGOING_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))
+ 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.
@@ -2094,11 +2095,11 @@ do { \
} \
else \
{ \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x81C04000)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x00000000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x81C04000)); \
+ ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); \
} \
} while (0)
@@ -2148,8 +2149,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_rtx (CONST_INT, VOIDmode, 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
@@ -2168,16 +2168,17 @@ extern struct rtx_def *sparc_builtin_saveregs ();
returns, and +12 for structure returns. */
#define RETURN_ADDR_RTX(count, frame) \
((count == -1) \
- ? gen_rtx (REG, Pmode, 31) \
- : gen_rtx (MEM, Pmode, \
- memory_address (Pmode, plus_constant (frame, 15 * UNITS_PER_WORD))))
+ ? gen_rtx_REG (Pmode, 31) \
+ : gen_rtx_MEM (Pmode, \
+ 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
@@ -2413,30 +2414,31 @@ extern struct rtx_def *legitimize_pic_address ();
#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
{ 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)); \
+ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 1), \
+ 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)); \
+ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \
+ 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)); \
+ (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 (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))); \
+ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \
+ 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))); \
+ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 1), \
+ 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) = 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); \
if (memory_address_p (MODE, X)) \
goto WIN; }
@@ -2485,7 +2487,7 @@ extern struct rtx_def *legitimize_pic_address ();
/* This is how to refer to the variable errno. */
#define GEN_ERRNO_RTX \
- gen_rtx (MEM, SImode, gen_rtx (SYMBOL_REF, Pmode, "errno"))
+ gen_rtx_MEM (SImode, gen_rtx_SYMBOL_REF (Pmode, "errno"))
#endif /* 0 */
/* Define if operations between registers always perform the operation
@@ -2618,32 +2620,32 @@ extern struct rtx_def *legitimize_pic_address ();
#define INIT_TARGET_OPTABS \
do { \
add_optab->handlers[(int) TFmode].libfunc \
- = gen_rtx (SYMBOL_REF, Pmode, ADDTF3_LIBCALL); \
+ = gen_rtx_SYMBOL_REF (Pmode, ADDTF3_LIBCALL); \
sub_optab->handlers[(int) TFmode].libfunc \
- = gen_rtx (SYMBOL_REF, Pmode, SUBTF3_LIBCALL); \
+ = gen_rtx_SYMBOL_REF (Pmode, SUBTF3_LIBCALL); \
neg_optab->handlers[(int) TFmode].libfunc \
- = gen_rtx (SYMBOL_REF, Pmode, NEGTF2_LIBCALL); \
+ = gen_rtx_SYMBOL_REF (Pmode, NEGTF2_LIBCALL); \
smul_optab->handlers[(int) TFmode].libfunc \
- = gen_rtx (SYMBOL_REF, Pmode, MULTF3_LIBCALL); \
+ = gen_rtx_SYMBOL_REF (Pmode, MULTF3_LIBCALL); \
flodiv_optab->handlers[(int) TFmode].libfunc \
- = gen_rtx (SYMBOL_REF, Pmode, DIVTF3_LIBCALL); \
- eqtf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, EQTF2_LIBCALL); \
- netf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, NETF2_LIBCALL); \
- gttf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, GTTF2_LIBCALL); \
- getf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, GETF2_LIBCALL); \
- lttf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, LTTF2_LIBCALL); \
- letf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, LETF2_LIBCALL); \
- trunctfsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, TRUNCTFSF2_LIBCALL); \
- trunctfdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, TRUNCTFDF2_LIBCALL); \
- extendsftf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, EXTENDSFTF2_LIBCALL); \
- extenddftf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, EXTENDDFTF2_LIBCALL); \
- floatsitf_libfunc = gen_rtx (SYMBOL_REF, Pmode, FLOATSITF2_LIBCALL); \
- fixtfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, FIX_TRUNCTFSI2_LIBCALL); \
+ = gen_rtx_SYMBOL_REF (Pmode, DIVTF3_LIBCALL); \
+ eqtf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, EQTF2_LIBCALL); \
+ netf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, NETF2_LIBCALL); \
+ gttf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, GTTF2_LIBCALL); \
+ getf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, GETF2_LIBCALL); \
+ lttf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, LTTF2_LIBCALL); \
+ letf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, LETF2_LIBCALL); \
+ trunctfsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, TRUNCTFSF2_LIBCALL); \
+ trunctfdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, TRUNCTFDF2_LIBCALL); \
+ extendsftf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, EXTENDSFTF2_LIBCALL); \
+ extenddftf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, EXTENDDFTF2_LIBCALL); \
+ floatsitf_libfunc = gen_rtx_SYMBOL_REF (Pmode, FLOATSITF2_LIBCALL); \
+ fixtfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFSI2_LIBCALL); \
fixunstfsi_libfunc \
- = gen_rtx (SYMBOL_REF, Pmode, FIXUNS_TRUNCTFSI2_LIBCALL); \
+ = gen_rtx_SYMBOL_REF (Pmode, FIXUNS_TRUNCTFSI2_LIBCALL); \
if (TARGET_FPU) \
sqrt_optab->handlers[(int) TFmode].libfunc \
- = gen_rtx (SYMBOL_REF, Pmode, "_Q_sqrt"); \
+ = gen_rtx_SYMBOL_REF (Pmode, "_Q_sqrt"); \
INIT_SUBTARGET_OPTABS; \
} while (0)
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index d6bca782ade..ed137fc2ff3 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -1,5 +1,5 @@
;;- Machine description for SPARC chip for GNU C compiler
-;; Copyright (C) 1987, 88, 89, 92-96, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1987, 88, 89, 92-97, 1998 Free Software Foundation, Inc.
;; Contributed by Michael Tiemann (tiemann@cygnus.com)
;; 64 bit SPARC V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
;; at Cygnus Support.
@@ -1804,7 +1804,9 @@
(define_insn "*sethi_di_medium_pic"
[(set (match_operand:DI 0 "register_operand" "=r")
- (high:DI (match_operand 1 "sp64_medium_pic_operand" "")))]
+ (high:DI (match_operand 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 %%hi(%a1),%0"
[(set_attr "type" "move")
@@ -2872,8 +2874,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;
@@ -2950,8 +2951,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;
@@ -3044,8 +3044,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;
@@ -3079,11 +3078,10 @@
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;
}")
@@ -3111,8 +3109,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;
@@ -3141,8 +3138,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;
@@ -3171,8 +3167,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;
@@ -3579,12 +3574,15 @@
{
if (! TARGET_ARCH64)
{
- emit_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2,
- gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (PLUS, DImode, operands[1],
- operands[2])),
- gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (REG, SImode, SPARC_ICC_REG)))));
+ emit_insn (gen_rtx_PARALLEL
+ (VOIDmode,
+ gen_rtvec (2,
+ gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_PLUS (DImode, operands[1],
+ operands[2])),
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (SImode,
+ SPARC_ICC_REG)))));
DONE;
}
}")
@@ -3681,12 +3679,15 @@
{
if (! TARGET_ARCH64)
{
- emit_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2,
- gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (MINUS, DImode, operands[1],
- operands[2])),
- gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (REG, SImode, SPARC_ICC_REG)))));
+ emit_insn (gen_rtx_PARALLEL
+ (VOIDmode,
+ gen_rtvec (2,
+ gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_MINUS (DImode, operands[1],
+ operands[2])),
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (SImode,
+ SPARC_ICC_REG)))));
DONE;
}
}")
@@ -4517,11 +4518,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, SImode, 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 (SImode,
+ SPARC_ICC_REG)))));
DONE;
}
}")
@@ -5118,21 +5122,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;
}
@@ -5152,17 +5154,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
@@ -5285,19 +5287,19 @@
#if 0
if (operands[3])
- nregs_rtx = gen_rtx (CONST_INT, VOIDmode, REGNO (operands[3]) - 8);
+ nregs_rtx = GEN_INT (REGNO (operands[3]) - 8);
else
- nregs_rtx = gen_rtx (CONST_INT, VOIDmode, 6);
+ nregs_rtx = GEN_INT (6);
#else
nregs_rtx = const0_rtx;
#endif
vec = gen_rtvec (2,
- gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (CALL, VOIDmode, fn_rtx, nregs_rtx)),
- gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, Pmode, 15)));
+ gen_rtx_SET (VOIDmode, operands[0],
+ 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));
+ emit_call_insn (gen_rtx_PARALLEL (VOIDmode, vec));
DONE;
}")
@@ -5387,20 +5389,20 @@
""
"
{
- rtx valreg1 = gen_rtx (REG, DImode, 24);
- rtx valreg2 = gen_rtx (REG, TARGET_ARCH64 ? TFmode : DFmode, 32);
+ rtx valreg1 = gen_rtx_REG (DImode, 24);
+ rtx valreg2 = gen_rtx_REG (TARGET_ARCH64 ? TFmode : DFmode, 32);
rtx result = operands[0];
if (! TARGET_ARCH64)
{
- rtx rtnreg = gen_rtx (REG, SImode, (leaf_function ? 15 : 31));
+ rtx rtnreg = gen_rtx_REG (SImode, (leaf_function ? 15 : 31));
rtx value = gen_reg_rtx (SImode);
/* Fetch the instruction where we will return to and see if it's an unimp
instruction (the most significant 10 bits will be zero). If so,
update the return address to skip the unimp instruction. */
emit_move_insn (value,
- gen_rtx (MEM, SImode, plus_constant (rtnreg, 8)));
+ gen_rtx_MEM (SImode, plus_constant (rtnreg, 8)));
emit_insn (gen_lshrsi3 (value, value, GEN_INT (22)));
emit_insn (gen_update_return (rtnreg, value));
}
@@ -5412,8 +5414,8 @@
plus_constant (XEXP (result, 0), 8)));
/* Put USE insns before the return. */
- emit_insn (gen_rtx (USE, VOIDmode, valreg1));
- emit_insn (gen_rtx (USE, VOIDmode, valreg2));
+ emit_insn (gen_rtx_USE (VOIDmode, valreg1));
+ emit_insn (gen_rtx_USE (VOIDmode, valreg2));
/* Construct the return. */
expand_null_return ();
@@ -5481,7 +5483,7 @@
emit_move_insn (virtual_stack_vars_rtx, operands[0]);
/* Find the containing function's current nonlocal goto handler,
which will do any cleanups and then jump to the label. */
- emit_move_insn (gen_rtx (REG, Pmode, 8), operands[1]);
+ emit_move_insn (gen_rtx_REG (Pmode, 8), operands[1]);
/* Restore %fp from stack pointer value for containing function.
The restore insn that follows will move this to %sp,
and reload the appropriate value into %fp. */
@@ -5490,9 +5492,9 @@
emit_move_insn (static_chain_rtx, operands[3]);
/* USE of frame_pointer_rtx added for consistency; not clear if
really needed. */
- emit_insn (gen_rtx (USE, VOIDmode, frame_pointer_rtx));
- emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
- emit_insn (gen_rtx (USE, VOIDmode, static_chain_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, frame_pointer_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, static_chain_rtx));
/* Return, restoring reg window and jumping to goto handler. */
emit_insn (gen_goto_handler_and_restore ());
emit_barrier ();
@@ -5601,8 +5603,9 @@
"
{
operands[3] = XEXP (operands[0], 0);
- operands[4] = gen_rtx (MEM, GET_MODE (operands[0]),
- gen_rtx (LO_SUM, SImode, operands[2], operands[3]));
+ operands[4] = gen_rtx_MEM (GET_MODE (operands[0]),
+ gen_rtx_LO_SUM (SImode, operands[2],
+ operands[3]));
MEM_IN_STRUCT_P (operands[4]) = MEM_IN_STRUCT_P (operands[0]);
MEM_VOLATILE_P (operands[4]) = MEM_VOLATILE_P (operands[0]);
RTX_UNCHANGING_P (operands[4]) = RTX_UNCHANGING_P (operands[0]);
@@ -5619,7 +5622,7 @@
rtx addr = legitimize_pic_address (XEXP (operands[0], 0),
GET_MODE (operands[0]),
operands[2]);
- operands[3] = gen_rtx (MEM, GET_MODE (operands[0]), addr);
+ operands[3] = gen_rtx_MEM (GET_MODE (operands[0]), addr);
MEM_IN_STRUCT_P (operands[3]) = MEM_IN_STRUCT_P (operands[0]);
MEM_VOLATILE_P (operands[3]) = MEM_VOLATILE_P (operands[0]);
RTX_UNCHANGING_P (operands[3]) = RTX_UNCHANGING_P (operands[0]);
@@ -5635,7 +5638,7 @@
rtx addr = legitimize_pic_address (XEXP (operands[1], 0),
GET_MODE (operands[1]),
operands[0]);
- operands[2] = gen_rtx (MEM, GET_MODE (operands[1]), addr);
+ operands[2] = gen_rtx_MEM (GET_MODE (operands[1]), addr);
MEM_IN_STRUCT_P (operands[2]) = MEM_IN_STRUCT_P (operands[1]);
MEM_VOLATILE_P (operands[2]) = MEM_VOLATILE_P (operands[1]);
RTX_UNCHANGING_P (operands[2]) = RTX_UNCHANGING_P (operands[1]);
@@ -5653,7 +5656,7 @@
rtx addr = legitimize_pic_address (XEXP (operands[2], 0),
GET_MODE (operands[2]),
operands[0]);
- operands[3] = gen_rtx (MEM, GET_MODE (operands[2]), addr);
+ operands[3] = gen_rtx_MEM (GET_MODE (operands[2]), addr);
MEM_IN_STRUCT_P (operands[3]) = MEM_IN_STRUCT_P (operands[2]);
MEM_VOLATILE_P (operands[3]) = MEM_VOLATILE_P (operands[2]);
RTX_UNCHANGING_P (operands[3]) = RTX_UNCHANGING_P (operands[2]);
@@ -5968,8 +5971,9 @@
{
/* Go by way of output_move_double in case the register in operand 2
is not properly aligned for ldd. */
- operands[1] = gen_rtx (MEM, DFmode,
- gen_rtx (LO_SUM, SImode, operands[0], operands[1]));
+ operands[1] = gen_rtx_MEM (DFmode,
+ gen_rtx_LO_SUM (SImode, operands[0],
+ operands[1]));
operands[0] = operands[2];
return output_move_double (operands);
}")
diff --git a/gcc/config/spur/spur.c b/gcc/config/spur/spur.c
index 4145af261de..c2683244ffa 100644
--- a/gcc/config/spur/spur.c
+++ b/gcc/config/spur/spur.c
@@ -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"
@@ -139,24 +139,22 @@ 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)
{
if (GET_CODE (operands[1]) == CONST_DOUBLE)
{
- latehalf[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (operands[1]));
- operands[1] = gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_LOW (operands[1]));
+ latehalf[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
}
else if (CONSTANT_P (operands[1]))
latehalf[1] = const0_rtx;
@@ -225,11 +223,11 @@ 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[0] = gen_rtx (CONST_INT, VOIDmode, offset + 4);
+ 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];
- xoperands[0] = gen_rtx (CONST_INT, VOIDmode, offset);
+ xoperands[0] = GEN_INT (offset);
output_asm_insn ("st_32 %1,r25,%0", xoperands);
xoperands[1] = operands[0];
output_asm_insn ("ld_dbl %1,r25,%0\n\tnop", xoperands);
@@ -243,13 +241,13 @@ output_fp_move_double (operands)
{
rtx xoperands[2];
int offset = - get_frame_size () - 8;
- xoperands[0] = gen_rtx (CONST_INT, VOIDmode, offset);
+ xoperands[0] = GEN_INT (offset);
xoperands[1] = operands[1];
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[0] = gen_rtx (CONST_INT, VOIDmode, offset + 4);
+ 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 "";
}
@@ -298,7 +296,7 @@ output_add_large_offset (target, reg, offset)
(unsigned) (high + 0x2000) >= 0x4000;
high >>= 1, n += 1)
;
- operands[2] = gen_rtx (CONST_INT, VOIDmode, high);
+ operands[2] = GEN_INT (high);
output_asm_insn ("add_nt r2,r0,%2", operands);
i = n;
while (i >= 3)
@@ -310,7 +308,7 @@ output_add_large_offset (target, reg, offset)
output_asm_insn ("add_nt %0,r2,%1", operands);
if (offset - (high << n) != 0)
{
- operands[2] = gen_rtx (CONST_INT, VOIDmode, offset - (high << n));
+ operands[2] = GEN_INT (offset - (high << n));
output_asm_insn ("add_nt %0,%0,%2", operands);
}
return "";
diff --git a/gcc/config/spur/spur.h b/gcc/config/spur/spur.h
index 51e1add1b27..fddc6f69051 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 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,
@@ -714,17 +714,17 @@ extern int current_function_pretend_args_size;
#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 f95e8e04695..ccb9da7b5c1 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 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_rtx (CONST_INT, VOIDmode, 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_rtx (CONST_INT, VOIDmode, 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;
}")
@@ -376,7 +376,7 @@
; && (unsigned) INTVAL (operands[1]) < 32"
; "*
;{
-; operands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) / 8);
+; operands[1] = GEN_INT (INTVAL (operands[1]) / 8);
; return \"wr_insert 0,0,%1\;insert %0,%0,%2\";
;}")
@@ -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.
@@ -467,9 +467,8 @@
(set (mem:SI (match_dup 0))
(match_dup 2))]
""
- " operands[5] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) & 255);
- operands[6] = gen_rtx (CONST_INT, VOIDmode,
- (INTVAL (operands[1]) >> 8) & 255);
+ " operands[5] = GEN_INT (INTVAL (operands[1]) & 255);
+ operands[6] = GEN_INT (INTVAL (operands[1]) >> 8) & 255);
")
;; Main entry for generating insns to move halfwords.
@@ -491,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)
{
@@ -512,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;
}")
@@ -563,7 +562,7 @@
; && (unsigned) INTVAL (operands[1]) < 32"
; "*
;{
-; operands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) / 8);
+; operands[1] = GEN_INT (INTVAL (operands[1]) / 8);
; return \"wr_insert 0,0,%1\;insert %0,%0,%2\";
;}")
@@ -580,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)
@@ -631,7 +630,7 @@
rtx xoperands[2];
int offset = - get_frame_size () - 8;
xoperands[1] = operands[1];
- xoperands[0] = gen_rtx (CONST_INT, VOIDmode, offset);
+ xoperands[0] = GEN_INT (offset);
output_asm_insn (\"st_32 %1,r25,%0\", xoperands);
xoperands[1] = operands[0];
output_asm_insn (\"ld_sgl %1,r25,%0\;nop\", xoperands);
@@ -645,7 +644,7 @@
{
rtx xoperands[2];
int offset = - get_frame_size () - 8;
- xoperands[0] = gen_rtx (CONST_INT, VOIDmode, offset);
+ xoperands[0] = GEN_INT (offset);
xoperands[1] = operands[1];
output_asm_insn (\"st_sgl %1,r25,%0\", xoperands);
xoperands[1] = operands[0];
@@ -700,12 +699,12 @@
"
{
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_rtx (CONST_INT, VOIDmode, 65535));
+ operands[2] = force_reg (SImode, GEN_INT (65535));
}")
(define_insn "zero_extendqihi2"
@@ -737,15 +736,15 @@
"
{
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);
- operands[4] = force_reg (SImode, gen_rtx (CONST_INT, VOIDmode, 65535));
- operands[5] = force_reg (SImode, gen_rtx (CONST_INT, VOIDmode, -32768));
+ operands[4] = force_reg (SImode, GEN_INT (65535));
+ operands[5] = force_reg (SImode, GEN_INT (-32768));
}")
(define_expand "extendqihi2"
@@ -760,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);
@@ -780,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 9dd189bde2f..e0a19fb5fc8 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 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"
@@ -31,21 +35,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. */
@@ -60,13 +49,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;
@@ -97,8 +88,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))
@@ -111,38 +102,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)
@@ -151,39 +126,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)
@@ -199,8 +169,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)
@@ -208,65 +178,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)
@@ -284,21 +258,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;
@@ -311,214 +289,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 "";
@@ -532,33 +529,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 b4076ce53b3..1591d7928e9 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 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 0fdbb0cb775..ee6de24a6cb 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, 1996, 1997, 1998 Free Software Foundation, Inc.
;; This file is part of GNU CC.
@@ -1015,7 +1015,7 @@
"*
{
if (INTVAL (operands[1]) > 32767)
- operands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) + 0xffff0000);
+ operands[1] = GEN_INT (INTVAL (operands[1]) + 0xffff0000);
return \"cmpw %0,%1\";
}")
@@ -1062,7 +1062,7 @@
"*
{
if (INTVAL (operands[1]) > 127)
- operands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) + 0xffffff00);
+ operands[1] = GEN_INT (INTVAL (operands[1]) + 0xffffff00);
return \"cmpb %0,%1\";
}")
@@ -1591,7 +1591,7 @@
""
"*
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, (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_rtx (CONST_INT, VOIDmode, (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_rtx (CONST_INT, VOIDmode, 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_rtx (CONST_INT, VOIDmode, 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_rtx (CONST_INT, VOIDmode, 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 88d3a411a8e..9e374599805 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 "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -142,16 +141,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;
@@ -490,9 +489,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;
@@ -719,7 +717,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 "";
}
@@ -765,7 +763,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);
}
@@ -1014,15 +1012,15 @@ 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;
int i;
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)
@@ -1076,8 +1074,9 @@ substitute_ep_register (first_insn, last_insn, uses, regno, p_r1, p_ep)
< ep_memory_offset (GET_MODE (*p_mem),
unsignedp)))
*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)));
}
}
}
@@ -1091,10 +1090,10 @@ substitute_ep_register (first_insn, last_insn, uses, regno, p_r1, p_ep)
&& 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);
}
@@ -1423,10 +1422,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;
}
}
@@ -1438,14 +1437,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 << 31) & reg_saved) != 0)
{
- save_regs[num_save++] = gen_rtx (REG, Pmode, 31);
+ save_regs[num_save++] = gen_rtx_REG (Pmode, 31);
default_stack = 16;
}
@@ -1475,27 +1474,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));
+ = 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]);
+ = gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (Pmode,
+ plus_constant (stack_pointer_rtx,
+ offset)),
+ save_regs[i]);
offset -= 4;
}
@@ -1546,18 +1548,18 @@ expand_prologue ()
/* Save the return pointer first. */
if (num_save > 0 && REGNO (save_regs[num_save-1]) == 31)
{
- 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;
}
@@ -1576,7 +1578,7 @@ expand_prologue ()
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));
}
@@ -1622,14 +1624,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 << 31) & reg_saved) != 0)
{
- restore_regs[num_restore++] = gen_rtx (REG, Pmode, 31);
+ restore_regs[num_restore++] = gen_rtx_REG (Pmode, 31);
default_stack = 16;
}
@@ -1658,23 +1660,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;
}
@@ -1692,7 +1695,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,
@@ -1735,7 +1738,7 @@ expand_epilogue ()
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,
@@ -1756,18 +1759,18 @@ expand_epilogue ()
if (num_restore > 0 && REGNO (restore_regs[num_restore-1]) == 31)
{
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 19eab5fdaf8..661d1cd941a 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. NEC V850 series
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Jeff Law (law@cygnus.com).
This file is part of GNU CC.
@@ -740,13 +740,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. */
@@ -796,9 +796,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 0ba10ca0cc0..7ca67bfd96e 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 Free Software Foundation, Inc.
-
-;; Contributed by Jeff Law (law@cygnus.com).
+;; Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+;; Contributed by Jeff Law (law@cygnus.com).
;; This file is part of GNU CC.
@@ -163,10 +162,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;
}
}")
@@ -407,8 +406,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 \"\";
@@ -426,8 +425,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 \"\";
@@ -474,8 +473,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);
}
@@ -498,8 +498,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);
}
@@ -547,8 +548,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);
}
@@ -571,8 +573,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);
}
@@ -937,11 +940,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..ee07cf5ec0d 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 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 bac442a467d..e65563ed73b 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -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"
@@ -52,11 +52,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 c0fe4699077..81eef130072 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-97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -343,8 +343,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_rtx (CONST_INT, VOIDmode, 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.
@@ -373,14 +372,14 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CONST_INT, VOIDmode, 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. */
@@ -526,14 +525,14 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CONST_INT, VOIDmode, 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_rtx (CONST_INT, VOIDmode, 0x8fd0)); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_BYTE (FILE, 0x50+STATIC_CHAIN_REGNUM); \
- ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 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. */
@@ -548,12 +547,12 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CONST_INT, VOIDmode, 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)); \
}
@@ -569,7 +568,7 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CONST_INT, VOIDmode, 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 18f916bfc28..d7db0a7c41b 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 Free Software Foundation, Inc.
;; This file is part of GNU CC.
@@ -874,7 +874,7 @@
"*
{
if (CONST_DOUBLE_HIGH (operands[3]))
- operands[3] = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_LOW (operands[3]));
+ operands[3] = GEN_INT (CONST_DOUBLE_LOW (operands[3]));
return \"emul %1,%2,%3,%0\";
}")
@@ -956,7 +956,7 @@
}
if (GET_CODE (op1) == CONST_INT)
- operands[1] = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (op1));
+ operands[1] = GEN_INT (~INTVAL (op1));
else
operands[1] = expand_unop (SImode, one_cmpl_optab, op1, 0, 1);
}")
@@ -978,7 +978,7 @@
}
if (GET_CODE (op1) == CONST_INT)
- operands[1] = gen_rtx (CONST_INT, VOIDmode, 65535 & ~INTVAL (op1));
+ operands[1] = GEN_INT (65535 & ~INTVAL (op1));
else
operands[1] = expand_unop (HImode, one_cmpl_optab, op1, 0, 1);
}")
@@ -1000,7 +1000,7 @@
}
if (GET_CODE (op1) == CONST_INT)
- operands[1] = gen_rtx (CONST_INT, VOIDmode, 255 & ~INTVAL (op1));
+ operands[1] = GEN_INT (255 & ~INTVAL (op1));
else
operands[1] = expand_unop (QImode, one_cmpl_optab, op1, 0, 1);
}")
@@ -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"
@@ -1850,7 +1850,7 @@
if (INTVAL (operands[1]) > 255 * 4)
/* Vax `calls' really uses only one byte of #args, so pop explicitly. */
return \"calls $0,%0\;addl2 %1,sp\";
- operands[1] = gen_rtx (CONST_INT, VOIDmode, (INTVAL (operands[1]) + 3)/ 4);
+ operands[1] = GEN_INT ((INTVAL (operands[1]) + 3)/ 4);
return \"calls %1,%0\";
")
@@ -1865,7 +1865,7 @@
if (INTVAL (operands[2]) > 255 * 4)
/* Vax `calls' really uses only one byte of #args, so pop explicitly. */
return \"calls $0,%1\;addl2 %2,sp\";
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (INTVAL (operands[2]) + 3)/ 4);
+ operands[2] = GEN_INT ((INTVAL (operands[2]) + 3)/ 4);
return \"calls %2,%1\";
")
@@ -1880,7 +1880,7 @@
if (INTVAL (operands[1]) > 255 * 4)
/* Vax `calls' really uses only one byte of #args, so pop explicitly. */
return \"calls $0,%0\;addl2 %1,sp\";
- operands[1] = gen_rtx (CONST_INT, VOIDmode, (INTVAL (operands[1]) + 3)/ 4);
+ operands[1] = GEN_INT ((INTVAL (operands[1]) + 3)/ 4);
return \"calls %1,%0\";
")
@@ -1894,7 +1894,7 @@
if (INTVAL (operands[2]) > 255 * 4)
/* Vax `calls' really uses only one byte of #args, so pop explicitly. */
return \"calls $0,%1\;addl2 %2,sp\";
- operands[2] = gen_rtx (CONST_INT, VOIDmode, (INTVAL (operands[2]) + 3)/ 4);
+ operands[2] = GEN_INT ((INTVAL (operands[2]) + 3)/ 4);
return \"calls %2,%1\";
")
@@ -2113,7 +2113,7 @@
unsigned long mask2 = (1 << (32 - INTVAL (operands[2]))) - 1;
if ((mask1 & mask2) != mask1)
- operands[3] = gen_rtx (CONST_INT, VOIDmode, mask1 & mask2);
+ operands[3] = GEN_INT (mask1 & mask2);
return \"rotl %R2,%1,%0\;bicl2 %N3,%0\";
}")
@@ -2131,7 +2131,7 @@
""
"*
{
- operands[3] = gen_rtx (CONST_INT, VOIDmode,
- 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 091f3c6680b..7bb23f296ee 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 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,11 +21,10 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "real.h"
-
void
output_move_double (operands)
rtx *operands;
@@ -36,7 +35,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]))
@@ -46,7 +45,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]))
@@ -85,10 +84,8 @@ output_move_double (operands)
}
else if (GET_CODE (operands[1]) == CONST_DOUBLE)
{
- lsw_operands[1] = gen_rtx (CONST_INT, SImode,
- CONST_DOUBLE_HIGH (operands[1]));
- operands[1] = gen_rtx (CONST_INT, SImode,
- CONST_DOUBLE_LOW (operands[1]));
+ lsw_operands[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
}
else if (GET_CODE (operands[1]) == CONST_INT)
{
@@ -117,15 +114,13 @@ 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_rtx (CONST_INT, SImode,
- CONST_DOUBLE_HIGH (operands[0]));
- operands[0] = gen_rtx (CONST_INT, SImode,
- CONST_DOUBLE_LOW (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 460fc3d2820..fef0db2dd81 100644
--- a/gcc/config/we32k/we32k.h
+++ b/gcc/config/we32k/we32k.h
@@ -1,5 +1,5 @@
/* 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, 1998 Free Software Foundation, Inc.
Contributed by John Wehle (john@feith1.uucp)
This file is part of GNU CC.
@@ -319,14 +319,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 +478,15 @@ enum reg_class { NO_REGS, GENERAL_REGS,
mov #STATIC,%r8
jmp #FUNCTION */
-#define TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x844f)); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_CHAR (FILE, gen_rtx (CONST_INT, VOIDmode, 0x48)); \
- ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 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 +499,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 216b1ff04e2..a8b6565c4c7 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 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,17 +133,15 @@
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);
else
if (GET_CODE (operands[2]) == CONST_DOUBLE)
{
- lsw_operands[2] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_HIGH(operands[2]));
- operands[2] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_LOW(operands[2]));
+ lsw_operands[2] = GEN_INT (CONST_DOUBLE_HIGH(operands[2]));
+ operands[2] = GEN_INT (CONST_DOUBLE_LOW(operands[2]));
}
else
if (GET_CODE (operands[2]) == CONST_INT)
@@ -177,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);
@@ -185,17 +183,15 @@
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);
else
if (GET_CODE (operands[1]) == CONST_DOUBLE)
{
- lsw_operands[1] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_HIGH(operands[1]));
- operands[1] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_LOW(operands[1]));
+ lsw_operands[1] = GEN_INT (CONST_DOUBLE_HIGH(operands[1]));
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW(operands[1]));
}
else
if (GET_CODE (operands[1]) == CONST_INT)
@@ -207,17 +203,15 @@
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);
else
if (GET_CODE (operands[2]) == CONST_DOUBLE)
{
- lsw_operands[2] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_HIGH(operands[2]));
- operands[2] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_LOW(operands[2]));
+ lsw_operands[2] = GEN_INT (CONST_DOUBLE_HIGH(operands[2]));
+ operands[2] = GEN_INT (CONST_DOUBLE_LOW(operands[2]));
}
else
if (GET_CODE (operands[2]) == CONST_INT)
@@ -295,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);
@@ -303,17 +297,15 @@
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);
else
if (GET_CODE (operands[2]) == CONST_DOUBLE)
{
- lsw_operands[2] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_HIGH(operands[2]));
- operands[2] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_LOW(operands[2]));
+ lsw_operands[2] = GEN_INT (CONST_DOUBLE_HIGH(operands[2]));
+ operands[2] = GEN_INT (CONST_DOUBLE_LOW(operands[2]));
}
else
if (GET_CODE (operands[2]) == CONST_INT)
@@ -347,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);
@@ -355,17 +347,15 @@
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);
else
if (GET_CODE (operands[1]) == CONST_DOUBLE)
{
- lsw_operands[1] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_HIGH(operands[1]));
- operands[1] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_LOW(operands[1]));
+ lsw_operands[1] = GEN_INT (CONST_DOUBLE_HIGH(operands[1]));
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW(operands[1]));
}
else
if (GET_CODE (operands[1]) == CONST_INT)
@@ -377,17 +367,15 @@
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);
else
if (GET_CODE (operands[2]) == CONST_DOUBLE)
{
- lsw_operands[2] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_HIGH(operands[2]));
- operands[2] = gen_rtx(CONST_INT, SImode,
- CONST_DOUBLE_LOW(operands[2]));
+ lsw_operands[2] = GEN_INT (CONST_DOUBLE_HIGH(operands[2]));
+ operands[2] = GEN_INT (CONST_DOUBLE_LOW(operands[2]));
}
else
if (GET_CODE (operands[2]) == CONST_INT)
@@ -770,7 +758,7 @@
if (GET_CODE (operands[1]) == CONST_INT &&
((unsigned long)INTVAL (operands[1]) & 0x8000L))
- operands[1] = gen_rtx(CONST_INT, SImode, INTVAL(operands[1]) | 0xffff0000L);
+ operands[1] = GEN_INT (INTVAL (operands[1]) | 0xffff0000L);
output_asm_insn(\"CMPH %1, %0\",operands);
@@ -786,7 +774,7 @@
if (GET_CODE (operands[1]) == CONST_INT &&
((unsigned long)INTVAL (operands[1]) & 0x80L))
- operands[1] = gen_rtx(CONST_INT, SImode, INTVAL(operands[1]) | 0xffffff00L);
+ operands[1] = GEN_INT (INTVAL(operands[1]) | 0xffffff00L);
output_asm_insn(\"CMPB {sbyte}%1, {sbyte}%0\",operands);
@@ -910,7 +898,7 @@
"*
{
- operands[2] = gen_rtx(CONST_INT, SImode, INTVAL(operands[2]) - 1);
+ operands[2] = GEN_INT (INTVAL(operands[2]) - 1);
output_asm_insn(\"EXTFW %2, %3, %1, %0\",operands);
return \"\";
@@ -925,7 +913,7 @@
"*
{
- operands[2] = gen_rtx(CONST_INT, SImode, INTVAL(operands[2]) - 1);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 1);
output_asm_insn(\"EXTFH %2, %3, {uhalf}%1, {uword}%0\",operands);
return \"\";
@@ -940,7 +928,7 @@
"*
{
- operands[2] = gen_rtx(CONST_INT, SImode, INTVAL(operands[2]) - 1);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 1);
output_asm_insn(\"EXTFB %2, %3, {ubyte}%1, {uword}%0\",operands);
return \"\";
@@ -955,7 +943,7 @@
"*
{
- operands[1] = gen_rtx(CONST_INT, SImode, INTVAL(operands[1]) - 1);
+ operands[1] = GEN_INT (INTVAL (operands[1]) - 1);
output_asm_insn(\"INSFW %1, %2, %3, %0\",operands);
return \"\";
@@ -970,7 +958,7 @@
"*
{
- operands[1] = gen_rtx(CONST_INT, SImode, INTVAL(operands[1]) - 1);
+ operands[1] = GEN_INT (INTVAL(operands[1]) - 1);
output_asm_insn(\"INSFH %1, %2, {uword}%3, {uhalf}%0\",operands);
return \"\";
@@ -985,7 +973,7 @@
"*
{
- operands[1] = gen_rtx(CONST_INT, SImode, INTVAL(operands[1]) - 1);
+ operands[1] = GEN_INT (INTVAL(operands[1]) - 1);
output_asm_insn(\"INSFB %1, %2, {uword}%3, {ubyte}%0\",operands);
return \"\";
diff --git a/gcc/configure b/gcc/configure
index 76b2218f22e..94ea0416ffc 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -29,6 +29,8 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-c-cpplib Use cpplib for C."
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
@@ -649,6 +651,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
@@ -731,7 +743,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:735: checking host system type" >&5
+echo "configure:747: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -752,7 +764,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:756: checking target system type" >&5
+echo "configure:768: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -770,7 +782,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:774: checking build system type" >&5
+echo "configure:786: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -797,7 +809,7 @@ test "$host_alias" != "$target_alias" &&
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:801: checking for $ac_word" >&5
+echo "configure:813: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -826,7 +838,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:830: checking for $ac_word" >&5
+echo "configure:842: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -874,7 +886,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:878: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:890: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -884,11 +896,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 888 "configure"
+#line 900 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -908,12 +920,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:912: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:924: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:917: checking whether we are using GNU C" >&5
+echo "configure:929: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -922,7 +934,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -937,7 +949,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:941: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:953: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -965,7 +977,7 @@ else
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:969: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:981: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -998,7 +1010,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1002: checking for $ac_word" >&5
+echo "configure:1014: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1029,7 +1041,7 @@ done
# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1033: checking for $ac_word" >&5
+echo "configure:1045: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1062,7 +1074,7 @@ then
*) ac_lib=l ;;
esac
echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1066: checking for yywrap in -l$ac_lib" >&5
+echo "configure:1078: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1070,7 +1082,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1074 "configure"
+#line 1086 "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
@@ -1081,7 +1093,7 @@ int main() {
yywrap()
; return 0; }
EOF
-if { (eval echo configure:1085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1103,10 +1115,43 @@ fi
fi
+echo $ac_n "checking for volatile""... $ac_c" 1>&6
+echo "configure:1120: checking for volatile" >&5
+if eval "test \"`echo '$''{'gcc_cv_c_volatile'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1125 "configure"
+#include "confdefs.h"
+
+int main() {
+volatile int foo;
+; return 0; }
+EOF
+if { (eval echo configure:1132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gcc_cv_c_volatile=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gcc_cv_c_volatile=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gcc_cv_c_volatile" 1>&6
+if test $gcc_cv_c_volatile = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_VOLATILE 1
+EOF
+
+fi
+
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1110: checking for $ac_word" >&5
+echo "configure:1155: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1137,7 +1182,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1141: checking for $ac_word" >&5
+echo "configure:1186: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1177,7 +1222,7 @@ test -n "$YACC" || YACC="yacc"
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1181: checking for a BSD compatible install" >&5
+echo "configure:1226: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1228,7 +1273,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1232: checking how to run the C preprocessor" >&5
+echo "configure:1277: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1243,13 +1288,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1247 "configure"
+#line 1292 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1298: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1260,13 +1305,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1264 "configure"
+#line 1309 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1289,12 +1334,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1293: checking for ANSI C header files" >&5
+echo "configure:1338: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1298 "configure"
+#line 1343 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1302,7 +1347,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1319,7 +1364,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1323 "configure"
+#line 1368 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1337,7 +1382,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1341 "configure"
+#line 1386 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1358,7 +1403,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1362 "configure"
+#line 1407 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1369,7 +1414,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1393,12 +1438,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1397: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1442: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1402 "configure"
+#line 1447 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -1407,7 +1452,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -1427,56 +1472,47 @@ 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
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1435: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
+echo "configure:1477: checking whether string.h and strings.h may both be included" >&5
+if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1440 "configure"
+#line 1482 "configure"
#include "confdefs.h"
-#include <$ac_hdr>
+#include <string.h>
+#include <strings.h>
+int main() {
+
+; return 0; }
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
+if { (eval echo configure:1490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ gcc_cv_header_string=yes
else
- echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ gcc_cv_header_string=no
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+
+echo "$ac_t""$gcc_cv_header_string" 1>&6
+if test $gcc_cv_header_string = yes; then
+ cat >> confdefs.h <<\EOF
+#define STRING_WITH_STRINGS 1
EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
+fi
-# Use <inttypes.h> only if it exists,
-# doesn't clash with <sys/types.h>, and declares intmax_t.
echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6
-echo "configure:1475: checking for inttypes.h" >&5
+echo "configure:1511: checking for inttypes.h" >&5
if eval "test \"`echo '$''{'gcc_cv_header_inttypes_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1480 "configure"
+#line 1516 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <inttypes.h>
@@ -1484,7 +1520,7 @@ int main() {
intmax_t i = -1;
; return 0; }
EOF
-if { (eval echo configure:1488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_inttypes_h=yes
else
@@ -1504,109 +1540,83 @@ EOF
fi
-for ac_func in strerror
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1511: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
+echo "configure:1545: checking for sys/wait.h that is POSIX.1 compatible" >&5
+if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1516 "configure"
+#line 1550 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
-
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+int main() {
+int s;
+wait (&s);
+s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:1539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ ac_cv_header_sys_wait_h=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ ac_cv_header_sys_wait_h=no
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
+if test $ac_cv_header_sys_wait_h = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_SYS_WAIT_H 1
EOF
-
-else
- echo "$ac_t""no" 1>&6
+
fi
-done
-for ac_func in putenv
+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 malloc.h \
+ sys/resource.h sys/param.h sys/times.h sys/types.h sys/stat.h
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1566: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1592: 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 1571 "configure"
+#line 1597 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
+#include <$ac_hdr>
EOF
-if { (eval echo configure:1594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_header_$ac_safe=yes"
else
+ echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+#define $ac_tr_hdr 1
EOF
else
@@ -1614,15 +1624,18 @@ else
fi
done
-for ac_func in popen
+
+for ac_func in strtoul bsearch strerror putenv popen bcopy bzero bcmp index \
+ rindex kill getrlimit setrlimit atoll atoq sysconf isascii \
+ gettimeofday strsignal
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1621: checking for $ac_func" >&5
+echo "configure:1634: 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 1626 "configure"
+#line 1639 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1645,7 +1658,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1669,627 +1682,436 @@ else
fi
done
-for ac_func in vprintf
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1676: 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 1681 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-for ac_func in bcopy
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1731: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+echo $ac_n "checking for vprintf""... $ac_c" 1>&6
+echo "configure:1689: checking for vprintf" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1736 "configure"
+#line 1694 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
+ which can conflict with char vprintf(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char vprintf();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined (__stub_vprintf) || defined (__stub___vprintf)
choke me
#else
-$ac_func();
+vprintf();
#endif
; return 0; }
EOF
-if { (eval echo configure:1759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_func_vprintf=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_func_vprintf=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+ cat >> confdefs.h <<\EOF
+#define HAVE_VPRINTF 1
EOF
-
+
else
echo "$ac_t""no" 1>&6
fi
-done
-for ac_func in bzero
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1786: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+if test "$ac_cv_func_vprintf" != yes; then
+echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
+echo "configure:1741: checking for _doprnt" >&5
+if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1791 "configure"
+#line 1746 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
+ which can conflict with char _doprnt(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char _doprnt();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined (__stub__doprnt) || defined (__stub____doprnt)
choke me
#else
-$ac_func();
+_doprnt();
#endif
; return 0; }
EOF
-if { (eval echo configure:1814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_func__doprnt=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_func__doprnt=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+ cat >> confdefs.h <<\EOF
+#define HAVE_DOPRNT 1
EOF
-
+
else
echo "$ac_t""no" 1>&6
fi
-done
-for ac_func in bcmp
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1841: 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 1846 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+vfprintf=
+doprint=
+if test $ac_cv_func_vprintf != yes ; then
+ vfprintf=vfprintf.o
+ if test $ac_cv_func__doprnt != yes ; then
+ doprint=doprint.o
+ fi
fi
-done
-for ac_func in index
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1896: 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 1901 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-for ac_func in rindex
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1951: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
+echo "configure:1805: checking whether the printf functions support %p" >&5
+if eval "test \"`echo '$''{'gcc_cv_func_printf_ptr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
+ if test "$cross_compiling" = yes; then
+ gcc_cv_func_printf_ptr=no
+else
cat > conftest.$ac_ext <<EOF
-#line 1956 "configure"
+#line 1813 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
+#include <stdio.h>
-; return 0; }
+main()
+{
+ char buf[64];
+ char *p = buf, *q = NULL;
+ sprintf(buf, "%p", p);
+ sscanf(buf, "%p", &q);
+ exit (p != q);
+}
EOF
-if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ gcc_cv_func_printf_ptr=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ rm -fr conftest*
+ gcc_cv_func_printf_ptr=no
fi
-rm -f conftest*
+rm -fr conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+rm -f core core.* *.core
fi
-done
-
-for ac_func in kill
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2006: 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 2011 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-; return 0; }
+echo "$ac_t""$gcc_cv_func_printf_ptr" 1>&6
+if test $gcc_cv_func_printf_ptr = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRINTF_PTR 1
EOF
-if { (eval echo configure:2034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
-done
-for ac_func in getrlimit
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2061: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+echo $ac_n "checking for pid_t""... $ac_c" 1>&6
+echo "configure:1850: checking for pid_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2066 "configure"
+#line 1855 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
#endif
-
-; return 0; }
EOF
-if { (eval echo configure:2089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ ac_cv_type_pid_t=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ ac_cv_type_pid_t=no
fi
rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+fi
+echo "$ac_t""$ac_cv_type_pid_t" 1>&6
+if test $ac_cv_type_pid_t = no; then
+ cat >> confdefs.h <<\EOF
+#define pid_t int
EOF
-
-else
- echo "$ac_t""no" 1>&6
+
fi
-done
-for ac_func in setrlimit
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2116: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
+echo "configure:1884: checking for vfork.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 2121 "configure"
+#line 1889 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
+#include <vfork.h>
EOF
-if { (eval echo configure:2144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_header_$ac_safe=yes"
else
+ echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+ cat >> confdefs.h <<\EOF
+#define HAVE_VFORK_H 1
EOF
-
+
else
echo "$ac_t""no" 1>&6
fi
-done
-for ac_func in sysconf
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2171: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+echo $ac_n "checking for working vfork""... $ac_c" 1>&6
+echo "configure:1919: checking for working vfork" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ echo $ac_n "checking for vfork""... $ac_c" 1>&6
+echo "configure:1925: checking for vfork" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2176 "configure"
+#line 1930 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
+ which can conflict with char vfork(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char vfork();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined (__stub_vfork) || defined (__stub___vfork)
choke me
#else
-$ac_func();
+vfork();
#endif
; return 0; }
EOF
-if { (eval echo configure:2199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_func_vfork=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_func_vfork=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
+ :
else
echo "$ac_t""no" 1>&6
fi
-done
-
-echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:2225: checking whether malloc must be declared" >&5
-if eval "test \"`echo '$''{'gcc_cv_decl_needed_malloc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2230 "configure"
+#line 1974 "configure"
#include "confdefs.h"
-
+/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+#include <sys/types.h>
+#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifndef HAVE_RINDEX
-#define rindex strrchr
+#ifdef HAVE_VFORK_H
+#include <vfork.h>
#endif
-#ifndef HAVE_INDEX
-#define index strchr
+/* On some sparc systems, changes by the child to local and incoming
+ argument registers are propagated back to the parent.
+ The compiler is told about this with #include <vfork.h>,
+ but some compilers (e.g. gcc -O) don't grok <vfork.h>.
+ Test for this by using a static variable whose address
+ is put into a register that is clobbered by the vfork. */
+static
+#ifdef __cplusplus
+sparc_address_test (int arg)
+#else
+sparc_address_test (arg) int arg;
#endif
-int main() {
-char *(*pfn) = (char *(*)) malloc
-; return 0; }
+{
+ static pid_t child;
+ if (!child) {
+ child = vfork ();
+ if (child < 0) {
+ perror ("vfork");
+ _exit(2);
+ }
+ if (!child) {
+ arg = getpid();
+ write(-1, "", 0);
+ _exit (arg);
+ }
+ }
+}
+main() {
+ pid_t parent = getpid ();
+ pid_t child;
+
+ sparc_address_test ();
+
+ child = vfork ();
+
+ if (child == 0) {
+ /* Here is another test for sparc vfork register problems.
+ This test uses lots of local variables, at least
+ as many local variables as main has allocated so far
+ including compiler temporaries. 4 locals are enough for
+ gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
+ A buggy compiler should reuse the register of parent
+ for one of the local variables, since it will think that
+ parent can't possibly be used any more in this routine.
+ Assigning to the local variable will thus munge parent
+ in the parent process. */
+ pid_t
+ p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+ p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+ /* Convince the compiler that p..p7 are live; otherwise, it might
+ use the same hardware register for all 8 local variables. */
+ if (p != p1 || p != p2 || p != p3 || p != p4
+ || p != p5 || p != p6 || p != p7)
+ _exit(1);
+
+ /* On some systems (e.g. IRIX 3.3),
+ vfork doesn't separate parent from child file descriptors.
+ If the child closes a descriptor before it execs or exits,
+ this munges the parent's descriptor as well.
+ Test for this by closing stdout in the child. */
+ _exit(close(fileno(stdout)) != 0);
+ } else {
+ int status;
+ struct stat st;
+
+ while (wait(&status) != child)
+ ;
+ exit(
+ /* Was there some problem with vforking? */
+ child < 0
+
+ /* Did the child fail? (This shouldn't happen.) */
+ || status
+
+ /* Did the vfork/compiler bug occur? */
+ || parent != getpid()
+
+ /* Did the file descriptor bug occur? */
+ || fstat(fileno(stdout), &st) != 0
+ );
+ }
+}
EOF
-if { (eval echo configure:2257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- gcc_cv_decl_needed_malloc=no
+if { (eval echo configure:2069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_vfork_works=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
- rm -rf conftest*
- gcc_cv_decl_needed_malloc=yes
+ rm -fr conftest*
+ ac_cv_func_vfork_works=no
fi
-rm -f conftest*
+rm -fr conftest*
fi
-echo "$ac_t""$gcc_cv_decl_needed_malloc" 1>&6
-if test $gcc_cv_decl_needed_malloc = yes; then
- gcc_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $gcc_tr_decl 1
+fi
+
+echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
+if test $ac_cv_func_vfork_works = no; then
+ cat >> confdefs.h <<\EOF
+#define vfork fork
EOF
fi
-echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:2279: checking whether realloc must be declared" >&5
-if eval "test \"`echo '$''{'gcc_cv_decl_needed_realloc'+set}'`\" = set"; then
+
+for ac_func in bcopy bzero bcmp index rindex getenv atol sbrk abort \
+ strerror getcwd getwd strsignal
+do
+echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6
+echo "configure:2096: 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 2284 "configure"
+#line 2101 "configure"
#include "confdefs.h"
#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
+#ifdef STRING_WITH_STRINGS
+# include <string.h>
+# include <strings.h>
#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
+# 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>
@@ -2303,101 +2125,60 @@ else
#ifndef HAVE_INDEX
#define index strchr
#endif
+
int main() {
-char *(*pfn) = (char *(*)) realloc
+char *(*pfn) = (char *(*)) $ac_func
; return 0; }
EOF
-if { (eval echo configure:2311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- gcc_cv_decl_needed_realloc=no
+ eval "gcc_cv_decl_needed_$ac_func=no"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- gcc_cv_decl_needed_realloc=yes
+ eval "gcc_cv_decl_needed_$ac_func=yes"
fi
rm -f conftest*
fi
-echo "$ac_t""$gcc_cv_decl_needed_realloc" 1>&6
-if test $gcc_cv_decl_needed_realloc = yes; then
- gcc_tr_decl=NEED_DECLARATION_`echo realloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+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
-fi
-
-echo $ac_n "checking whether calloc must be declared""... $ac_c" 1>&6
-echo "configure:2333: checking whether calloc must be declared" >&5
-if eval "test \"`echo '$''{'gcc_cv_decl_needed_calloc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2338 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#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
-int main() {
-char *(*pfn) = (char *(*)) calloc
-; return 0; }
-EOF
-if { (eval echo configure:2365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- gcc_cv_decl_needed_calloc=no
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gcc_cv_decl_needed_calloc=yes
-fi
-rm -f conftest*
+ echo "$ac_t""no" 1>&6
fi
-echo "$ac_t""$gcc_cv_decl_needed_calloc" 1>&6
-if test $gcc_cv_decl_needed_calloc = yes; then
- gcc_tr_decl=NEED_DECLARATION_`echo calloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $gcc_tr_decl 1
-EOF
+done
-fi
-echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:2387: checking whether free must be declared" >&5
-if eval "test \"`echo '$''{'gcc_cv_decl_needed_free'+set}'`\" = set"; then
+for ac_func in getrlimit setrlimit
+do
+echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6
+echo "configure:2163: 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 2392 "configure"
+#line 2168 "configure"
#include "confdefs.h"
#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
+#ifdef STRING_WITH_STRINGS
+# include <string.h>
+# include <strings.h>
#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
+# 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>
@@ -2411,101 +2192,64 @@ else
#ifndef HAVE_INDEX
#define index strchr
#endif
+#include <sys/types.h>
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
int main() {
-char *(*pfn) = (char *(*)) free
+char *(*pfn) = (char *(*)) $ac_func
; return 0; }
EOF
-if { (eval echo configure:2419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- gcc_cv_decl_needed_free=no
+ eval "gcc_cv_decl_needed_$ac_func=no"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- gcc_cv_decl_needed_free=yes
+ eval "gcc_cv_decl_needed_$ac_func=yes"
fi
rm -f conftest*
fi
-echo "$ac_t""$gcc_cv_decl_needed_free" 1>&6
-if test $gcc_cv_decl_needed_free = yes; then
- gcc_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+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
-fi
-
-echo $ac_n "checking whether index must be declared""... $ac_c" 1>&6
-echo "configure:2441: checking whether index must be declared" >&5
-if eval "test \"`echo '$''{'gcc_cv_decl_needed_index'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2446 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#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
-int main() {
-char *(*pfn) = (char *(*)) index
-; return 0; }
-EOF
-if { (eval echo configure:2473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- gcc_cv_decl_needed_index=no
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gcc_cv_decl_needed_index=yes
-fi
-rm -f conftest*
+ echo "$ac_t""no" 1>&6
fi
-echo "$ac_t""$gcc_cv_decl_needed_index" 1>&6
-if test $gcc_cv_decl_needed_index = yes; then
- gcc_tr_decl=NEED_DECLARATION_`echo index | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $gcc_tr_decl 1
-EOF
+done
-fi
-echo $ac_n "checking whether rindex must be declared""... $ac_c" 1>&6
-echo "configure:2495: checking whether rindex must be declared" >&5
-if eval "test \"`echo '$''{'gcc_cv_decl_needed_rindex'+set}'`\" = set"; then
+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:2234: 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 2500 "configure"
+#line 2239 "configure"
#include "confdefs.h"
#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
+#ifdef STRING_WITH_STRINGS
+# include <string.h>
+# include <strings.h>
#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
+# 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>
@@ -2519,147 +2263,81 @@ else
#ifndef HAVE_INDEX
#define index strchr
#endif
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+
int main() {
-char *(*pfn) = (char *(*)) rindex
+char *(*pfn) = (char *(*)) $ac_func
; return 0; }
EOF
-if { (eval echo configure:2527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- gcc_cv_decl_needed_rindex=no
+ eval "gcc_cv_decl_needed_$ac_func=no"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- gcc_cv_decl_needed_rindex=yes
+ eval "gcc_cv_decl_needed_$ac_func=yes"
fi
rm -f conftest*
fi
-echo "$ac_t""$gcc_cv_decl_needed_rindex" 1>&6
-if test $gcc_cv_decl_needed_rindex = yes; then
- gcc_tr_decl=NEED_DECLARATION_`echo rindex | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+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
-fi
-
-echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:2549: checking whether getenv must be declared" >&5
-if eval "test \"`echo '$''{'gcc_cv_decl_needed_getenv'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2554 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#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
-int main() {
-char *(*pfn) = (char *(*)) getenv
-; return 0; }
-EOF
-if { (eval echo configure:2581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- gcc_cv_decl_needed_getenv=no
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gcc_cv_decl_needed_getenv=yes
-fi
-rm -f conftest*
+ echo "$ac_t""no" 1>&6
fi
-echo "$ac_t""$gcc_cv_decl_needed_getenv" 1>&6
-if test $gcc_cv_decl_needed_getenv = yes; then
- gcc_tr_decl=NEED_DECLARATION_`echo getenv | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $gcc_tr_decl 1
-EOF
+done
-fi
-echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-echo "configure:2603: checking whether sbrk must be declared" >&5
-if eval "test \"`echo '$''{'gcc_cv_decl_needed_sbrk'+set}'`\" = set"; then
+echo $ac_n "checking whether cpp understands the stringify operator""... $ac_c" 1>&6
+echo "configure:2302: checking whether cpp understands the stringify operator" >&5
+if eval "test \"`echo '$''{'gcc_cv_c_have_stringify'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2608 "configure"
+#line 2307 "configure"
#include "confdefs.h"
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#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
int main() {
-char *(*pfn) = (char *(*)) sbrk
+#define S(x) #x
+char *test = S(foo);
; return 0; }
EOF
-if { (eval echo configure:2635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- gcc_cv_decl_needed_sbrk=no
+ gcc_cv_c_have_stringify=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- gcc_cv_decl_needed_sbrk=yes
+ gcc_cv_c_have_stringify=no
fi
rm -f conftest*
fi
-echo "$ac_t""$gcc_cv_decl_needed_sbrk" 1>&6
-if test $gcc_cv_decl_needed_sbrk = yes; then
- gcc_tr_decl=NEED_DECLARATION_`echo sbrk | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $gcc_tr_decl 1
+echo "$ac_t""$gcc_cv_c_have_stringify" 1>&6
+if test $gcc_cv_c_have_stringify = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_CPP_STRINGIFY 1
EOF
fi
-
echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:2658: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+echo "configure:2336: 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 2663 "configure"
+#line 2341 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -2671,7 +2349,7 @@ int main() {
char *msg = *(sys_siglist + 1);
; return 0; }
EOF
-if { (eval echo configure:2675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_decl_sys_siglist=yes
else
@@ -2896,6 +2574,13 @@ for machine in $build $host $target; do
;;
alpha*-*-vxworks*)
tm_file="${tm_file} dbx.h alpha/vxworks.h"
+ # If we're on an Alpha, we assume we use the system assembler,
+ # so check it to see if we should put in .arch lines.
+ case $host in
+ *-*-osf4.0[b-z] | *-*-osf4.[1-9]*)
+ target_cpu_default=MASK_SUPPORT_ARCH
+ ;;
+ esac
if x$gas != xyes
then
extra_passes="mips-tfile mips-tdump"
@@ -5454,6 +5139,37 @@ fi
# the first file included by config.h.
null_defines=
host_xm_file="auto-config.h ${host_xm_file}"
+
+# If host=build, it is correct to have hconfig include auto-config.h
+# as well. If host!=build, we are in error and need to do more
+# work to find out the build config parameters.
+if test x$host = x$build
+then
+ build_xm_file="auto-config.h ${build_xm_file}"
+else
+ # We create a subdir, then run autoconf in the subdir.
+ # To prevent recursion we set host and build for the new
+ # invocation of configure to the build for this invocation
+ # of configure.
+ tempdir=build.$$
+ rm -rf $tempdir
+ mkdir $tempdir
+ cd $tempdir
+ case ${srcdir} in
+ /*) realsrcdir=${srcdir};;
+ *) realsrcdir=../${srcdir};;
+ esac
+ CC=${CC_FOR_BUILD} ${realsrcdir}/configure \
+ --target=$target --host=$build --build=$build
+
+ # We just finished tests for the build machine, so rename
+ # the file auto-build.h in the gcc directory.
+ mv auto-config.h ../auto-build.h
+ cd ..
+ rm -rf $tempdir
+ build_xm_file="auto-build.h ${build_xm_file}"
+fi
+
vars="host_xm_file tm_file xm_file build_xm_file"
links="config.h tm.h tconfig.h hconfig.h"
defines="host_xm_defines null_defines xm_defines build_xm_defines"
@@ -5547,7 +5263,7 @@ fi
echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:5551: checking for strerror in -lcposix" >&5
+echo "configure:5267: 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
@@ -5555,7 +5271,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5559 "configure"
+#line 5275 "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
@@ -5566,7 +5282,7 @@ int main() {
strerror()
; return 0; }
EOF
-if { (eval echo configure:5570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5589,12 +5305,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5593: checking for working const" >&5
+echo "configure:5309: 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 5598 "configure"
+#line 5314 "configure"
#include "confdefs.h"
int main() {
@@ -5643,7 +5359,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:5647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -5664,21 +5380,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:5668: checking for inline" >&5
+echo "configure:5384: 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 5675 "configure"
+#line 5391 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:5682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -5704,12 +5420,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:5708: checking for off_t" >&5
+echo "configure:5424: 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 5713 "configure"
+#line 5429 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5737,12 +5453,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:5741: checking for size_t" >&5
+echo "configure:5457: 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 5746 "configure"
+#line 5462 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5772,19 +5488,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:5776: checking for working alloca.h" >&5
+echo "configure:5492: 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 5781 "configure"
+#line 5497 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:5788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -5805,12 +5521,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:5809: checking for alloca" >&5
+echo "configure:5525: 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 5814 "configure"
+#line 5530 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -5833,7 +5549,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:5837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -5865,12 +5581,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:5869: checking whether alloca needs Cray hooks" >&5
+echo "configure:5585: 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 5874 "configure"
+#line 5590 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -5895,12 +5611,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:5899: checking for $ac_func" >&5
+echo "configure:5615: 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 5904 "configure"
+#line 5620 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5923,7 +5639,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5950,7 +5666,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:5954: checking stack direction for C alloca" >&5
+echo "configure:5670: 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
@@ -5958,7 +5674,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 5962 "configure"
+#line 5678 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -5977,7 +5693,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:5981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -6002,17 +5718,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:6006: checking for $ac_hdr" >&5
+echo "configure:5722: 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 6011 "configure"
+#line 5727 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6041,12 +5757,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6045: checking for $ac_func" >&5
+echo "configure:5761: 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 6050 "configure"
+#line 5766 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6069,7 +5785,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6094,7 +5810,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6098: checking for working mmap" >&5
+echo "configure:5814: 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
@@ -6102,7 +5818,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 6106 "configure"
+#line 5822 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6242,7 +5958,7 @@ main()
}
EOF
-if { (eval echo configure:6246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -6270,17 +5986,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:6274: checking for $ac_hdr" >&5
+echo "configure:5990: 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 6279 "configure"
+#line 5995 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6310,12 +6026,12 @@ done
strdup __argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6314: checking for $ac_func" >&5
+echo "configure:6030: 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 6319 "configure"
+#line 6035 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6338,7 +6054,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6367,12 +6083,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6371: checking for $ac_func" >&5
+echo "configure:6087: 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 6376 "configure"
+#line 6092 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6395,7 +6111,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6429,19 +6145,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:6433: checking for LC_MESSAGES" >&5
+echo "configure:6149: 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 6438 "configure"
+#line 6154 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:6445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -6462,7 +6178,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:6466: checking whether NLS is requested" >&5
+echo "configure:6182: 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"
@@ -6482,7 +6198,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:6486: checking whether included gettext is requested" >&5
+echo "configure:6202: 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"
@@ -6501,17 +6217,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:6505: checking for libintl.h" >&5
+echo "configure:6221: 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 6510 "configure"
+#line 6226 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6515: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6528,19 +6244,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:6532: checking for gettext in libc" >&5
+echo "configure:6248: 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 6537 "configure"
+#line 6253 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:6544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -6556,7 +6272,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:6560: checking for bindtextdomain in -lintl" >&5
+echo "configure:6276: 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
@@ -6564,7 +6280,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6568 "configure"
+#line 6284 "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
@@ -6575,7 +6291,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:6579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6591,12 +6307,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:6595: checking for gettext in libintl" >&5
+echo "configure:6311: 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:6600: checking for gettext in -lintl" >&5
+echo "configure:6316: 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
@@ -6604,7 +6320,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6608 "configure"
+#line 6324 "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
@@ -6615,7 +6331,7 @@ int main() {
gettext()
; return 0; }
EOF
-if { (eval echo configure:6619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6654,7 +6370,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:6658: checking for $ac_word" >&5
+echo "configure:6374: 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
@@ -6688,12 +6404,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6692: checking for $ac_func" >&5
+echo "configure:6408: 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 6697 "configure"
+#line 6413 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6716,7 +6432,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6743,7 +6459,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:6747: checking for $ac_word" >&5
+echo "configure:6463: 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
@@ -6775,7 +6491,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:6779: checking for $ac_word" >&5
+echo "configure:6495: 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
@@ -6807,7 +6523,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 6811 "configure"
+#line 6527 "configure"
#include "confdefs.h"
int main() {
@@ -6815,7 +6531,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:6819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -6838,7 +6554,7 @@ fi
if test "$CATOBJEXT" = "NONE"; then
echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
-echo "configure:6842: checking whether catgets can be used" >&5
+echo "configure:6558: 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"
@@ -6851,7 +6567,7 @@ fi
if test "$nls_cv_use_catgets" = "yes"; then
echo $ac_n "checking for main in -li""... $ac_c" 1>&6
-echo "configure:6855: checking for main in -li" >&5
+echo "configure:6571: 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
@@ -6859,14 +6575,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-li $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6863 "configure"
+#line 6579 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6894,12 +6610,12 @@ else
fi
echo $ac_n "checking for catgets""... $ac_c" 1>&6
-echo "configure:6898: checking for catgets" >&5
+echo "configure:6614: 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 6903 "configure"
+#line 6619 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char catgets(); below. */
@@ -6922,7 +6638,7 @@ catgets();
; return 0; }
EOF
-if { (eval echo configure:6926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_catgets=yes"
else
@@ -6944,7 +6660,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:6948: checking for $ac_word" >&5
+echo "configure:6664: 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
@@ -6976,7 +6692,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:6980: checking for $ac_word" >&5
+echo "configure:6696: 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
@@ -7009,7 +6725,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:7013: checking for $ac_word" >&5
+echo "configure:6729: 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
@@ -7044,7 +6760,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:7048: checking for $ac_word" >&5
+echo "configure:6764: 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
@@ -7102,7 +6818,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:7106: checking for $ac_word" >&5
+echo "configure:6822: 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
@@ -7136,7 +6852,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:7140: checking for $ac_word" >&5
+echo "configure:6856: 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
@@ -7168,7 +6884,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:7172: checking for $ac_word" >&5
+echo "configure:6888: 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
@@ -7261,7 +6977,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:7265: checking for catalogs to be installed" >&5
+echo "configure:6981: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -7289,17 +7005,17 @@ echo "configure:7265: 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:7293: checking for linux/version.h" >&5
+echo "configure:7009: 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 7298 "configure"
+#line 7014 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -7436,12 +7152,20 @@ done
host_xm_file_list=
for f in $host_xm_file; do
- host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f"
+ if [ $f != "auto-config.h" ]; then
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f"
+ else
+ host_xm_file_list="${host_xm_file_list} $f"
+ fi
done
build_xm_file_list=
for f in $build_xm_file; do
- build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f"
+ if [ $f != "auto-config.h" -a $f != "auto-build.h" ]; then
+ build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f"
+ else
+ build_xm_file_list="${build_xm_file_list} $f"
+ fi
done
# Define macro CROSS_COMPILE in compilation
@@ -7897,6 +7621,8 @@ s%@YACC@%$YACC%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@CPP@%$CPP%g
+s%@vfprintf@%$vfprintf%g
+s%@doprint@%$doprint%g
s%@manext@%$manext%g
s%@objext@%$objext%g
s%@PACKAGE@%$PACKAGE%g
diff --git a/gcc/configure.in b/gcc/configure.in
index 3b5cf0dfc90..a6d751be87b 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -93,6 +93,13 @@ if [[[ x$enable_c_cpplib != xno ]]]; then
extra_c_flags=-DUSE_CPPLIB=1
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
@@ -134,52 +141,46 @@ AC_PROG_MAKE_SET
# Find some useful tools
AC_PROG_AWK
AC_PROG_LEX
+GCC_C_VOLATILE
AC_PROG_RANLIB
AC_PROG_YACC
AC_PROG_INSTALL
AC_HEADER_STDC
AC_HEADER_TIME
-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)
-
-# Use <inttypes.h> only if it exists,
-# doesn't clash with <sys/types.h>, and declares intmax_t.
-AC_MSG_CHECKING(for inttypes.h)
-AC_CACHE_VAL(gcc_cv_header_inttypes_h,
-[AC_TRY_COMPILE(
- [#include <sys/types.h>
-#include <inttypes.h>],
- [intmax_t i = -1;],
- gcc_cv_header_inttypes_h=yes,
- gcc_cv_header_inttypes_h=no)])
-AC_MSG_RESULT($gcc_cv_header_inttypes_h)
-if test $gcc_cv_header_inttypes_h = yes; then
- AC_DEFINE(HAVE_INTTYPES_H)
-fi
+GCC_HEADER_STRING
+GCC_HEADER_INTTYPES
+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 malloc.h \
+ sys/resource.h sys/param.h sys/times.h sys/types.h sys/stat.h)
+
+AC_CHECK_FUNCS(strtoul bsearch strerror putenv popen bcopy bzero bcmp index \
+ rindex kill getrlimit setrlimit atoll atoq sysconf isascii \
+ gettimeofday strsignal)
+
+
+GCC_FUNC_VFPRINTF_DOPRNT
+GCC_FUNC_PRINTF_PTR
+AC_FUNC_VFORK
+
+GCC_NEED_DECLARATIONS(bcopy bzero bcmp index rindex getenv atol sbrk abort \
+ strerror getcwd getwd strsignal)
+
+GCC_NEED_DECLARATIONS(getrlimit setrlimit, [
+#include <sys/types.h>
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+])
-AC_CHECK_FUNCS(strerror)
-AC_CHECK_FUNCS(putenv)
-AC_CHECK_FUNCS(popen)
-AC_CHECK_FUNCS(vprintf)
-AC_CHECK_FUNCS(bcopy)
-AC_CHECK_FUNCS(bzero)
-AC_CHECK_FUNCS(bcmp)
-AC_CHECK_FUNCS(index)
-AC_CHECK_FUNCS(rindex)
-AC_CHECK_FUNCS(kill)
-AC_CHECK_FUNCS(getrlimit)
-AC_CHECK_FUNCS(setrlimit)
-AC_CHECK_FUNCS(sysconf)
-
-GCC_NEED_DECLARATION(malloc)
-GCC_NEED_DECLARATION(realloc)
-GCC_NEED_DECLARATION(calloc)
-GCC_NEED_DECLARATION(free)
-GCC_NEED_DECLARATION(index)
-GCC_NEED_DECLARATION(rindex)
-GCC_NEED_DECLARATION(getenv)
-GCC_NEED_DECLARATION(sbrk)
+GCC_NEED_DECLARATIONS(malloc realloc calloc free, [
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+])
+GCC_CHECK_STRINGIFY
AC_DECL_SYS_SIGLIST
# File extensions
@@ -386,6 +387,13 @@ for machine in $build $host $target; do
;;
alpha*-*-vxworks*)
tm_file="${tm_file} dbx.h alpha/vxworks.h"
+ # If we're on an Alpha, we assume we use the system assembler,
+ # so check it to see if we should put in .arch lines.
+ case $host in
+ *-*-osf4.0[[b-z]] | *-*-osf4.[[1-9]]*)
+ target_cpu_default=MASK_SUPPORT_ARCH
+ ;;
+ esac
if [ x$gas != xyes ]
then
extra_passes="mips-tfile mips-tdump"
@@ -2944,6 +2952,37 @@ fi
# the first file included by config.h.
null_defines=
host_xm_file="auto-config.h ${host_xm_file}"
+
+# If host=build, it is correct to have hconfig include auto-config.h
+# as well. If host!=build, we are in error and need to do more
+# work to find out the build config parameters.
+if test x$host = x$build
+then
+ build_xm_file="auto-config.h ${build_xm_file}"
+else
+ # We create a subdir, then run autoconf in the subdir.
+ # To prevent recursion we set host and build for the new
+ # invocation of configure to the build for this invocation
+ # of configure.
+ tempdir=build.$$
+ rm -rf $tempdir
+ mkdir $tempdir
+ cd $tempdir
+ case ${srcdir} in
+ /*) realsrcdir=${srcdir};;
+ *) realsrcdir=../${srcdir};;
+ esac
+ CC=${CC_FOR_BUILD} ${realsrcdir}/configure \
+ --target=$target --host=$build --build=$build
+
+ # We just finished tests for the build machine, so rename
+ # the file auto-build.h in the gcc directory.
+ mv auto-config.h ../auto-build.h
+ cd ..
+ rm -rf $tempdir
+ build_xm_file="auto-build.h ${build_xm_file}"
+fi
+
vars="host_xm_file tm_file xm_file build_xm_file"
links="config.h tm.h tconfig.h hconfig.h"
defines="host_xm_defines null_defines xm_defines build_xm_defines"
@@ -3098,12 +3137,20 @@ done
host_xm_file_list=
for f in $host_xm_file; do
- host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f"
+ if [[ $f != "auto-config.h" ]]; then
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f"
+ else
+ host_xm_file_list="${host_xm_file_list} $f"
+ fi
done
build_xm_file_list=
for f in $build_xm_file; do
- build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f"
+ if [[ $f != "auto-config.h" -a $f != "auto-build.h" ]]; then
+ build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f"
+ else
+ build_xm_file_list="${build_xm_file_list} $f"
+ fi
done
# Define macro CROSS_COMPILE in compilation
diff --git a/gcc/convert.c b/gcc/convert.c
index 8bfe4627c65..195c2dd78ed 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/ChangeLog b/gcc/cp/ChangeLog
index ac75f9e7005..f5c972896f3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+Sat Jan 9 10:44:28 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * tree.c (system.h): Include.
+ (stdarg.h, varargs.h, stdlib.h): No longer include.
+ (free): Remove conditional declaration.
+ (build_min{,_vt}): Test ANSI_PROTOTYPES, not __STDC__.
+
Sun Apr 12 22:31:19 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* cvt.c (cp_convert_to_pointer): Use TYPE_PRECISION.
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 98b1a6d3b77..3dddf36e473 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1,5 +1,5 @@
/* Language-dependent node constructors for parse phase of GNU compiler.
- Copyright (C) 1987, 88, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 92-96, 1998 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC.
@@ -20,25 +20,14 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
+#include "system.h"
#include <stdio.h>
#include "obstack.h"
#include "tree.h"
#include "cp-tree.h"
#include "flags.h"
#include "rtl.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef NEED_DECLARATION_FREE
-extern void free PROTO((void *));
-#endif
extern void compiler_error ();
@@ -1773,7 +1762,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;
@@ -1784,7 +1773,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
@@ -1811,7 +1800,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
@@ -1823,7 +1812,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 fb730e2ef23..7e6f583845f 100644
--- a/gcc/cpp.texi
+++ b/gcc/cpp.texi
@@ -2619,10 +2619,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 (assuming they are enabled).
-
@item -Wcomment
@findex -Wcomment
@ignore
@@ -2635,10 +2631,19 @@ Warn if any trigraphs are encountered (assuming they are enabled).
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 9db9db5d244..d7ab1413135 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 by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -23,7 +23,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
what you give them. Help stamp out software-hoarding! */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "cpplib.h"
static void
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index 6272de8f512..0a5241fd4cd 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -26,10 +26,15 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#endif /* not EMACS */
-#include "cpplib.h"
+#ifdef IN_GCC
+#include "system.h"
+#else
#include <stdio.h>
-#include "intl.h"
#include <errno.h>
+#endif
+
+#include "cpplib.h"
+#include "intl.h"
/* Print the file names and line numbers of the #include
commands which led to the current file. */
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index 681542325d2..63d527e10f8 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -25,6 +25,7 @@ Written by Per Bothner 1994. */
/* Parse a C expression from text in a string */
#include "config.h"
+#include "system.h"
#include "cpplib.h"
#include "gansidecl.h"
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 737ac39ef11..0f052db71a0 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -1,5 +1,5 @@
/* Part of CPP library. (Macro hash table support.)
- Copyright (C) 1986, 87, 89, 92-95, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1986, 87, 89, 92-96, 1998 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -22,6 +22,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
You are forbidden to forbid anyone else to use, share and improve
what you give them. Help stamp out software-hoarding! */
+#include "config.h"
+#include "system.h"
#include "cpplib.h"
#include "cpphash.h"
#include "gansidecl.h"
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 877b1c79d4e..9c730860b7e 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -19,84 +19,25 @@ along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
+#include "system.h"
#ifndef STDC_VALUE
#define STDC_VALUE 1
#endif
-#include <ctype.h>
-#include <stdio.h>
#include <signal.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-#endif
-#endif
-
-#ifdef HAVE_SYS_TIMES_H
-#include <sys/times.h>
-#endif
-
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
-#ifdef HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-# else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#endif
-
-/* This defines "errno" properly for VMS, and gives us EACCES. */
-#include <errno.h>
-
#include "cpplib.h"
#include "cpphash.h"
#include "gansidecl.h"
#include "intl.h"
-#ifdef NEED_DECLARATION_INDEX
-extern char *index ();
-#endif
-
-#ifdef NEED_DECLARATION_RINDEX
-extern char *rindex ();
-#endif
-
-#ifdef NEED_DECLARATION_GETENV
-extern char *getenv ();
-#endif
-
extern char *update_path ();
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
#undef MIN
#undef MAX
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
@@ -124,14 +65,6 @@ extern char *update_path ();
# endif
#endif
-#ifndef S_ISREG
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif
-
-#ifndef S_ISDIR
-#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#endif
-
/* By default, colon separates directories in a path. */
#ifndef PATH_SEPARATOR
#define PATH_SEPARATOR ':'
diff --git a/gcc/cppmain.c b/gcc/cppmain.c
index 8952d31405f..50d63f5187c 100644
--- a/gcc/cppmain.c
+++ b/gcc/cppmain.c
@@ -24,28 +24,20 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#endif /* not EMACS */
-#include "cpplib.h"
+#ifdef IN_GCC
+#include "system."
+#else
#include <stdio.h>
-#include "intl.h"
-
extern char *getenv ();
+#endif
+
+#include "cpplib.h"
+#include "intl.h"
char *progname;
cpp_reader parse_in;
cpp_options options;
-
-#ifdef abort
-/* More 'friendly' abort that prints the line and file.
- config.h can #define abort fancy_abort if you like that sort of thing. */
-
-void
-fancy_abort ()
-{
- fatal ("Internal gcc abort.");
-}
-#endif
-
int
main (argc, argv)
diff --git a/gcc/cse.c b/gcc/cse.c
index b4721e8f553..ea823c90b57 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1,5 +1,5 @@
/* Common subexpression elimination for GNU compiler.
- Copyright (C) 1987, 88, 89, 92-7, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 92-97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,9 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-/* Must precede rtl.h for FFS. */
-#include <stdio.h>
-
+#include "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -2615,7 +2613,7 @@ canon_reg (x, insn)
first = qty_first_reg[reg_qty[REGNO (x)]];
return (first >= FIRST_PSEUDO_REGISTER ? regno_reg_rtx[first]
: REGNO_REG_CLASS (first) == NO_REGS ? x
- : gen_rtx (REG, qty_mode[reg_qty[REGNO (x)]], first));
+ : gen_rtx_REG (qty_mode[reg_qty[REGNO (x)]], first));
}
default:
@@ -3817,11 +3815,11 @@ simplify_binary_operation (code, mode, op0, op1)
/* Change subtraction from zero into negation. */
if (op0 == CONST0_RTX (mode))
- return gen_rtx (NEG, mode, op1);
+ return gen_rtx_NEG (mode, op1);
/* (-1 - a) is ~a. */
if (op0 == constm1_rtx)
- return gen_rtx (NOT, mode, op1);
+ return gen_rtx_NOT (mode, op1);
/* Subtracting 0 has no effect. */
if (op1 == CONST0_RTX (mode))
@@ -3905,9 +3903,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;
@@ -3916,7 +3916,7 @@ simplify_binary_operation (code, mode, op0, op1)
{
tem = simplify_unary_operation (NEG, mode, op0, mode);
- return tem ? tem : gen_rtx (NEG, mode, op0);
+ return tem ? tem : gen_rtx_NEG (mode, op0);
}
/* In IEEE floating point, x*0 is not always 0. */
@@ -3942,7 +3942,7 @@ simplify_binary_operation (code, mode, op0, op1)
&& (width <= HOST_BITS_PER_WIDE_INT
|| val != HOST_BITS_PER_WIDE_INT - 1)
&& ! rtx_equal_function_value_matters)
- return gen_rtx (ASHIFT, mode, op0, GEN_INT (val));
+ return gen_rtx_ASHIFT (mode, op0, GEN_INT (val));
if (GET_CODE (op1) == CONST_DOUBLE
&& GET_MODE_CLASS (GET_MODE (op1)) == MODE_FLOAT)
@@ -3962,10 +3962,10 @@ simplify_binary_operation (code, mode, op0, op1)
/* x*2 is x+x and x*(-1) is -x */
if (op1is2 && GET_MODE (op0) == mode)
- return gen_rtx (PLUS, mode, op0, copy_rtx (op0));
+ return gen_rtx_PLUS (mode, op0, copy_rtx (op0));
else if (op1ism1 && GET_MODE (op0) == mode)
- return gen_rtx (NEG, mode, op0);
+ return gen_rtx_NEG (mode, op0);
}
break;
@@ -3990,7 +3990,7 @@ simplify_binary_operation (code, mode, op0, op1)
return op0;
if (GET_CODE (op1) == CONST_INT
&& (INTVAL (op1) & GET_MODE_MASK (mode)) == GET_MODE_MASK (mode))
- return gen_rtx (NOT, mode, op0);
+ return gen_rtx_NOT (mode, op0);
if (op0 == op1 && ! side_effects_p (op0)
&& GET_MODE_CLASS (mode) != MODE_CC)
return const0_rtx;
@@ -4018,7 +4018,7 @@ simplify_binary_operation (code, mode, op0, op1)
below). */
if (GET_CODE (op1) == CONST_INT
&& (arg1 = exact_log2 (INTVAL (op1))) > 0)
- return gen_rtx (LSHIFTRT, mode, op0, GEN_INT (arg1));
+ return gen_rtx_LSHIFTRT (mode, op0, GEN_INT (arg1));
/* ... fall through ... */
@@ -4049,10 +4049,11 @@ simplify_binary_operation (code, mode, op0, op1)
{
#if defined (REAL_ARITHMETIC)
REAL_ARITHMETIC (d, rtx_to_tree_code (DIV), dconst1, d);
- return gen_rtx (MULT, mode, op0,
- CONST_DOUBLE_FROM_REAL_VALUE (d, mode));
+ return gen_rtx_MULT (mode, op0,
+ CONST_DOUBLE_FROM_REAL_VALUE (d, mode));
#else
- return gen_rtx (MULT, mode, op0,
+ return
+ gen_rtx_MULT (mode, op0,
CONST_DOUBLE_FROM_REAL_VALUE (1./d, mode));
#endif
}
@@ -4064,7 +4065,7 @@ simplify_binary_operation (code, mode, op0, op1)
/* Handle modulus by power of two (mod with 1 handled below). */
if (GET_CODE (op1) == CONST_INT
&& exact_log2 (INTVAL (op1)) > 0)
- return gen_rtx (AND, mode, op0, GEN_INT (INTVAL (op1) - 1));
+ return gen_rtx_AND (mode, op0, GEN_INT (INTVAL (op1) - 1));
/* ... fall through ... */
@@ -4496,7 +4497,7 @@ simplify_plus_minus (code, mode, op0, op1)
for (i = 1; i < n_ops; i++)
result = cse_gen_binary (negs[i] ? MINUS : PLUS, mode, result, ops[i]);
- return negate ? gen_rtx (NEG, mode, result) : result;
+ return negate ? gen_rtx_NEG (mode, result) : result;
}
/* Make a binary operation by properly ordering the operands and
@@ -4891,6 +4892,21 @@ fold_rtx (x, insn)
switch (code)
{
case CONST:
+ /* If the operand is a CONSTANT_P_RTX, see if what's inside it
+ is known to be constant and replace the whole thing with a
+ CONST_INT of either zero or one. Note that this code assumes
+ that an insn that recognizes a CONST will also recognize a
+ CONST_INT, but that seems to be a safe assumption. */
+ if (GET_CODE (XEXP (x, 0)) == CONSTANT_P_RTX)
+ {
+ x = equiv_constant (fold_rtx (XEXP (XEXP (x, 0), 0), 0));
+ return (x != 0 && (GET_CODE (x) == CONST_INT
+ || GET_CODE (x) == CONST_DOUBLE)
+ ? const1_rtx : const0_rtx);
+ }
+
+ /* ... fall through ... */
+
case CONST_INT:
case CONST_DOUBLE:
case SYMBOL_REF:
@@ -4924,7 +4940,7 @@ fold_rtx (x, insn)
&& GET_CODE (NEXT_INSN (next)) == JUMP_INSN
&& (GET_CODE (PATTERN (NEXT_INSN (next))) == ADDR_VEC
|| GET_CODE (PATTERN (NEXT_INSN (next))) == ADDR_DIFF_VEC))
- return gen_rtx (LABEL_REF, Pmode, next);
+ return gen_rtx_LABEL_REF (Pmode, next);
}
break;
@@ -5223,17 +5239,17 @@ fold_rtx (x, insn)
< XVECLEN (table, 1)))
{
offset /= GET_MODE_SIZE (GET_MODE (table));
- new = gen_rtx (MINUS, Pmode, XVECEXP (table, 1, offset),
- XEXP (table, 0));
+ new = gen_rtx_MINUS (Pmode, XVECEXP (table, 1, offset),
+ XEXP (table, 0));
if (GET_MODE (table) != Pmode)
- new = gen_rtx (TRUNCATE, GET_MODE (table), new);
+ new = gen_rtx_TRUNCATE (GET_MODE (table), new);
/* Indicate this is a constant. This isn't a
valid form of CONST, but it will only be used
to fold the next insns and then discarded, so
it should be safe. */
- return gen_rtx (CONST, GET_MODE (new), new);
+ return gen_rtx_CONST (GET_MODE (new), new);
}
}
}
@@ -5433,7 +5449,7 @@ fold_rtx (x, insn)
const_arg0 ? const_arg0 : folded_arg0,
mode_arg0);
if (new != 0 && is_const)
- new = gen_rtx (CONST, mode, new);
+ new = gen_rtx_CONST (mode, new);
}
break;
@@ -5884,7 +5900,7 @@ gen_lowpart_if_possible (mode, x)
unchanged. */
offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode))
- MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x))));
- new = gen_rtx (MEM, mode, plus_constant (XEXP (x, 0), offset));
+ new = gen_rtx_MEM (mode, plus_constant (XEXP (x, 0), offset));
if (! memory_address_p (mode, XEXP (new, 0)))
return 0;
MEM_VOLATILE_P (new) = MEM_VOLATILE_P (x);
@@ -5980,7 +5996,7 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
rtx tem = gen_lowpart_if_possible (inner_mode, op1);
record_jump_cond (code, mode, SUBREG_REG (op0),
- tem ? tem : gen_rtx (SUBREG, inner_mode, op1, 0),
+ tem ? tem : gen_rtx_SUBREG (inner_mode, op1, 0),
reversed_nonequality);
}
@@ -5992,7 +6008,7 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
rtx tem = gen_lowpart_if_possible (inner_mode, op0);
record_jump_cond (code, mode, SUBREG_REG (op1),
- tem ? tem : gen_rtx (SUBREG, inner_mode, op0, 0),
+ tem ? tem : gen_rtx_SUBREG (inner_mode, op0, 0),
reversed_nonequality);
}
@@ -6012,7 +6028,7 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
rtx tem = gen_lowpart_if_possible (inner_mode, op1);
record_jump_cond (code, mode, SUBREG_REG (op0),
- tem ? tem : gen_rtx (SUBREG, inner_mode, op1, 0),
+ tem ? tem : gen_rtx_SUBREG (inner_mode, op1, 0),
reversed_nonequality);
}
@@ -6025,7 +6041,7 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
rtx tem = gen_lowpart_if_possible (inner_mode, op0);
record_jump_cond (code, mode, SUBREG_REG (op1),
- tem ? tem : gen_rtx (SUBREG, inner_mode, op0, 0),
+ tem ? tem : gen_rtx_SUBREG (inner_mode, op0, 0),
reversed_nonequality);
}
@@ -6733,7 +6749,7 @@ cse_insn (insn, in_libcall_block)
&& GET_MODE_SIZE (mode) < UNITS_PER_WORD)
{
enum machine_mode tmode;
- rtx new_and = gen_rtx (AND, VOIDmode, NULL_RTX, XEXP (src, 1));
+ rtx new_and = gen_rtx_AND (VOIDmode, NULL_RTX, XEXP (src, 1));
for (tmode = GET_MODE_WIDER_MODE (mode);
GET_MODE_SIZE (tmode) <= UNITS_PER_WORD;
@@ -6995,7 +7011,7 @@ cse_insn (insn, in_libcall_block)
&& (GET_CODE (PATTERN (NEXT_INSN (trial))) == ADDR_DIFF_VEC
|| GET_CODE (PATTERN (NEXT_INSN (trial))) == ADDR_VEC))
- trial = gen_rtx (LABEL_REF, Pmode, get_label_after (trial));
+ trial = gen_rtx_LABEL_REF (Pmode, get_label_after (trial));
SET_SRC (sets[i].rtl) = trial;
cse_jumps_altered = 1;
@@ -7049,9 +7065,10 @@ cse_insn (insn, in_libcall_block)
&& 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. */
{
@@ -7059,7 +7076,7 @@ cse_insn (insn, in_libcall_block)
src = SET_SRC (sets[i].rtl)
= first >= FIRST_PSEUDO_REGISTER ? regno_reg_rtx[first]
- : gen_rtx (REG, GET_MODE (src), first);
+ : gen_rtx_REG (GET_MODE (src), first);
/* If we had a constant that is cheaper than what we are now
setting SRC to, use that constant. We ignored it when we
@@ -7098,8 +7115,8 @@ cse_insn (insn, in_libcall_block)
if (tem)
XEXP (tem, 0) = src_const;
else
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL,
- src_const, REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL,
+ src_const, REG_NOTES (insn));
/* If storing a constant value in a register that
previously held the constant value 0,
@@ -7125,8 +7142,9 @@ cse_insn (insn, in_libcall_block)
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));
}
}
}
@@ -7301,8 +7319,8 @@ cse_insn (insn, in_libcall_block)
this_insn_cc0 = src_const && mode != VOIDmode ? src_const : src;
this_insn_cc0_mode = mode;
if (FLOAT_MODE_P (mode))
- this_insn_cc0 = gen_rtx (COMPARE, VOIDmode, this_insn_cc0,
- CONST0_RTX (mode));
+ this_insn_cc0 = gen_rtx_COMPARE (VOIDmode, this_insn_cc0,
+ CONST0_RTX (mode));
}
#endif
}
@@ -7579,7 +7597,7 @@ cse_insn (insn, in_libcall_block)
new_src = gen_lowpart_if_possible (new_mode, elt->exp);
if (new_src == 0)
- new_src = gen_rtx (SUBREG, new_mode, elt->exp, 0);
+ new_src = gen_rtx_SUBREG (new_mode, elt->exp, 0);
src_hash = HASH (new_src, new_mode);
src_elt = lookup (new_src, src_hash, new_mode);
@@ -8438,7 +8456,7 @@ cse_main (f, nregs, after_loop, file)
/* Allocate scratch rtl here. cse_insn will fill in the memory reference
and change the code and mode as appropriate. */
- memory_extend_rtx = gen_rtx (ZERO_EXTEND, VOIDmode, NULL_RTX);
+ memory_extend_rtx = gen_rtx_ZERO_EXTEND (VOIDmode, NULL_RTX);
#endif
/* Discard all the free elements of the previous function
@@ -8594,7 +8612,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/dbxout.c b/gcc/dbxout.c
index 803b764bcab..2e5812b7c9a 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -68,10 +68,7 @@ Boston, MA 02111-1307, USA. */
For more on data type definitions, see `dbxout_type'. */
#include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
-
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "flags.h"
@@ -81,10 +78,6 @@ Boston, MA 02111-1307, USA. */
#include "defaults.h"
#include "output.h" /* ASM_OUTPUT_SOURCE_LINE may refer to sdb functions. */
-#ifndef errno
-extern int errno;
-#endif
-
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h"
#endif
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index e983475a0b4..4b36b1e400c 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -27,8 +27,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
information. */
#include "config.h"
+#include "system.h"
#include "defaults.h"
-#include <stdio.h>
#include "tree.h"
#include "flags.h"
#include "rtl.h"
@@ -40,6 +40,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "expr.h"
#include "except.h"
#include "dwarf2.h"
+#include "dyn-string.h"
/* We cannot use <assert.h> in GCC source, since that would include
GCC's assert.h, which may not be compatible with the host compiler. */
@@ -396,27 +397,27 @@ static unsigned reg_number PROTO((rtx));
.debug_frame. */
#define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \
- assemble_integer (gen_rtx (SYMBOL_REF, Pmode, LABEL), PTR_SIZE, 1)
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, LABEL), PTR_SIZE, 1)
#define ASM_OUTPUT_DWARF_OFFSET(FILE,LABEL) \
- assemble_integer (gen_rtx (SYMBOL_REF, SImode, LABEL), 4, 1)
+ assemble_integer (gen_rtx_SYMBOL_REF (SImode, LABEL), 4, 1)
#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)), \
+ assemble_integer (gen_rtx_MINUS (HImode, \
+ 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)), \
+ assemble_integer (gen_rtx_MINUS (SImode, \
+ 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)), \
+ assemble_integer (gen_rtx_MINUS (Pmode, \
+ gen_rtx_SYMBOL_REF (Pmode, LABEL1), \
+ gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \
PTR_SIZE, 1)
#define ASM_OUTPUT_DWARF_DELTA(FILE,LABEL1,LABEL2) \
@@ -426,7 +427,7 @@ static unsigned reg_number PROTO((rtx));
assemble_integer (GEN_INT (VALUE), 4, 1)
#define ASM_OUTPUT_DWARF_VALUE4(FILE,LABEL) \
- assemble_integer (gen_rtx (SYMBOL_REF, Pmode, LABEL), 4, 1)
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, LABEL), 4, 1)
#endif /* UNALIGNED_INT_ASM_OP */
@@ -2250,7 +2251,7 @@ static tree dwarf_last_decl;
/* Forward declarations for functions defined in this file. */
-static void addr_const_to_string PROTO((char *, rtx));
+static void addr_const_to_string PROTO((dyn_string_t, rtx));
static char *addr_to_string PROTO((rtx));
static int is_pseudo_reg PROTO((rtx));
static tree type_main_variant PROTO((tree));
@@ -2509,9 +2510,9 @@ static char text_end_label[MAX_ARTIFICIAL_LABEL_BYTES];
#define ASM_NAME_TO_STRING(STR, NAME) \
do { \
if ((NAME)[0] == '*') \
- strcpy (STR, NAME+1); \
+ dyn_string_append (STR, NAME + 1); \
else \
- strcpy (STR, NAME); \
+ dyn_string_append (STR, NAME); \
} \
while (0)
#endif
@@ -2524,50 +2525,44 @@ static char text_end_label[MAX_ARTIFICIAL_LABEL_BYTES];
static void
addr_const_to_string (str, x)
- char *str;
+ dyn_string_t str;
rtx x;
{
char buf1[256];
- char buf2[256];
restart:
- str[0] = '\0';
switch (GET_CODE (x))
{
case PC:
if (flag_pic)
- strcat (str, ",");
+ dyn_string_append (str, ",");
else
abort ();
break;
case SYMBOL_REF:
- ASM_NAME_TO_STRING (buf1, XSTR (x, 0));
- strcat (str, buf1);
+ ASM_NAME_TO_STRING (str, XSTR (x, 0));
break;
case LABEL_REF:
ASM_GENERATE_INTERNAL_LABEL (buf1, "L", CODE_LABEL_NUMBER (XEXP (x, 0)));
- ASM_NAME_TO_STRING (buf2, buf1);
- strcat (str, buf2);
+ ASM_NAME_TO_STRING (str, buf1);
break;
case CODE_LABEL:
ASM_GENERATE_INTERNAL_LABEL (buf1, "L", CODE_LABEL_NUMBER (x));
- ASM_NAME_TO_STRING (buf2, buf1);
- strcat (str, buf2);
+ ASM_NAME_TO_STRING (str, buf1);
break;
case CONST_INT:
sprintf (buf1, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
- strcat (str, buf1);
+ dyn_string_append (str, buf1);
break;
case CONST:
/* This used to output parentheses around the expression, but that does
not work on the 386 (either ATT or BSD assembler). */
- addr_const_to_string (buf1, XEXP (x, 0));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 0));
break;
case CONST_DOUBLE:
@@ -2582,7 +2577,7 @@ restart:
else
sprintf (buf1, HOST_WIDE_INT_PRINT_DEC,
CONST_DOUBLE_LOW (x));
- strcat (str, buf1);
+ dyn_string_append (str, buf1);
}
else
/* We can't handle floating point constants; PRINT_OPERAND must
@@ -2594,23 +2589,19 @@ restart:
/* Some assemblers need integer constants to appear last (eg masm). */
if (GET_CODE (XEXP (x, 0)) == CONST_INT)
{
- addr_const_to_string (buf1, XEXP (x, 1));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 1));
if (INTVAL (XEXP (x, 0)) >= 0)
- strcat (str, "+");
+ dyn_string_append (str, "+");
- addr_const_to_string (buf1, XEXP (x, 0));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 0));
}
else
{
- addr_const_to_string (buf1, XEXP (x, 0));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 0));
if (INTVAL (XEXP (x, 1)) >= 0)
- strcat (str, "+");
+ dyn_string_append (str, "+");
- addr_const_to_string (buf1, XEXP (x, 1));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 1));
}
break;
@@ -2621,28 +2612,22 @@ restart:
if (GET_CODE (x) != MINUS)
goto restart;
- addr_const_to_string (buf1, XEXP (x, 0));
- strcat (str, buf1);
- strcat (str, "-");
+ addr_const_to_string (str, XEXP (x, 0));
+ dyn_string_append (str, "-");
if (GET_CODE (XEXP (x, 1)) == CONST_INT
&& INTVAL (XEXP (x, 1)) < 0)
{
- strcat (str, ASM_OPEN_PAREN);
- addr_const_to_string (buf1, XEXP (x, 1));
- strcat (str, buf1);
- strcat (str, ASM_CLOSE_PAREN);
+ dyn_string_append (str, ASM_OPEN_PAREN);
+ addr_const_to_string (str, XEXP (x, 1));
+ dyn_string_append (str, ASM_CLOSE_PAREN);
}
else
- {
- addr_const_to_string (buf1, XEXP (x, 1));
- strcat (str, buf1);
- }
+ addr_const_to_string (str, XEXP (x, 1));
break;
case ZERO_EXTEND:
case SIGN_EXTEND:
- addr_const_to_string (buf1, XEXP (x, 0));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 0));
break;
default:
@@ -2657,9 +2642,16 @@ static char *
addr_to_string (x)
rtx x;
{
- char buf[1024];
- addr_const_to_string (buf, x);
- return xstrdup (buf);
+ dyn_string_t ds = dyn_string_new (256);
+ char *s;
+
+ addr_const_to_string (ds, x);
+
+ /* Return the dynamically allocated string, but free the
+ dyn_string_t itself. */
+ s = ds->s;
+ free (ds);
+ return s;
}
/* Test if rtl node points to a pseudo register. */
@@ -7071,7 +7063,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/dwarfout.c b/gcc/dwarfout.c
index 7f42d061ab1..c0c5ce6b5e2 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -1,5 +1,5 @@
/* Output Dwarf format symbol table information from the GNU C compiler.
- Copyright (C) 1992, 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 95, 96, 97, 1998 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com) of Network Computing Devices.
This file is part of GNU CC.
@@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#ifdef DWARF_DEBUGGING_INFO
-#include <stdio.h>
+#include "system.h"
#include "dwarf.h"
#include "tree.h"
#include "flags.h"
@@ -33,31 +33,6 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "defaults.h"
-#if defined(DWARF_TIMESTAMPS)
-#if defined(POSIX)
-#include <time.h>
-#else /* !defined(POSIX) */
-#include <sys/types.h>
-#if defined(__STDC__)
-extern time_t time (time_t *);
-#else /* !defined(__STDC__) */
-extern time_t time ();
-#endif /* !defined(__STDC__) */
-#endif /* !defined(POSIX) */
-#endif /* defined(DWARF_TIMESTAMPS) */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
/* We cannot use <assert.h> in GCC source, since that would include
GCC's assert.h, which may not be compatible with the host compiler. */
#undef assert
@@ -69,14 +44,6 @@ extern time_t time ();
extern char *getpwd ();
-#ifdef NEED_DECLARATION_INDEX
-extern char *index ();
-#endif
-
-#ifdef NEED_DECLARATION_RINDEX
-extern char *rindex ();
-#endif
-
/* IMPORTANT NOTE: Please see the file README.DWARF for important details
regarding the GNU implementation of Dwarf. */
diff --git a/gcc/dyn-string.c b/gcc/dyn-string.c
index cfcace95584..d35de7c46df 100644
--- a/gcc/dyn-string.c
+++ b/gcc/dyn-string.c
@@ -2,21 +2,23 @@
Copyright (C) 1998 Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
- This file is part of GNU CC.
+This file is part of GNU CC.
- GNU CC is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+GNU CC is 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. */
- You should have received a copy of the GNU General Public License
- along with GNU CC; see the file COPYING. If not, write to the Free
- Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include "system.h"
@@ -26,9 +28,9 @@
extern char *xmalloc ();
extern char *xrealloc ();
-/* 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)
@@ -36,13 +38,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';
@@ -59,8 +60,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)
@@ -68,16 +68,19 @@ dyn_string_append (ds, s)
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)
@@ -93,7 +96,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 ed8071f8b08..f2691e73746 100644
--- a/gcc/dyn-string.h
+++ b/gcc/dyn-string.h
@@ -2,27 +2,29 @@
Copyright (C) 1998 Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
- This file is part of GNU CC.
+This file is part of GNU CC.
- GNU CC is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+GNU CC is 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. */
- You should have received a copy of the GNU General Public License
- along with GNU CC; see the file COPYING. If not, write to the Free
- Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
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 664f0d6fb39..8f41f301526 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -35,12 +35,7 @@ Boston, MA 02111-1307, USA. */
is the kind of rtx's they make and what arguments they use. */
#include "config.h"
-#include <stdio.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
+#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -177,7 +172,7 @@ rtx virtual_outgoing_args_rtx; /* (REG:Pmode VIRTUAL_OUTGOING_ARGS_REGNUM) */
#define MAX_SAVED_CONST_INT 64
-static rtx const_int_rtx[MAX_SAVED_CONST_INT * 2 + 1];
+static struct rtx_def const_int_rtx[MAX_SAVED_CONST_INT * 2 + 1];
/* The ends of the doubly-linked chain of rtl for the current function.
Both are reset to null at the start of rtl generation for the function.
@@ -265,6 +260,86 @@ static rtx make_jump_insn_raw PROTO((rtx));
static rtx make_call_insn_raw PROTO((rtx));
static rtx find_line_node PROTO((rtx));
+
+/* 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;
+ HOST_WIDE_INT arg;
+{
+ if (arg >= - MAX_SAVED_CONST_INT && arg <= MAX_SAVED_CONST_INT)
+ return &const_int_rtx[arg + MAX_SAVED_CONST_INT];
+
+#if STORE_FLAG_VALUE != 1 && STORE_FLAG_VALUE != -1
+ if (const_true_rtx && arg == STORE_FLAG_VALUE)
+ return const_true_rtx;
+#endif
+
+ return gen_rtx_raw_CONST_INT (mode, arg);
+}
+
+rtx
+gen_rtx_REG (mode, regno)
+ enum machine_mode mode;
+ int regno;
+{
+ /* In case the MD file explicitly references the frame pointer, have
+ all such references point to the same frame pointer. This is
+ used during frame pointer elimination to distinguish the explicit
+ references to these registers from pseudos that happened to be
+ assigned to them.
+
+ If we have eliminated the frame pointer or arg pointer, we will
+ be using it as a normal register, for example as a spill
+ register. In such cases, we might be accessing it in a mode that
+ is not Pmode and therefore cannot use the pre-allocated rtx.
+
+ Also don't do this when we are making new REGs in reload, since
+ we don't want to get confused with the real pointers. */
+
+ if (mode == Pmode && !reload_in_progress)
+ {
+ if (frame_pointer_rtx != 0 && regno == FRAME_POINTER_REGNUM)
+ return frame_pointer_rtx;
+#if FRAME_POINTER_REGNUM != 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 (arg_pointer_rtx != 0 && regno == ARG_POINTER_REGNUM)
+ return arg_pointer_rtx;
+#endif
+#ifdef RETURN_ADDRESS_POINTER_REGNUM
+ if (return_address_pointer_rtx != 0
+ && regno == RETURN_ADDRESS_POINTER_REGNUM)
+ return return_address_pointer_rtx;
+#endif
+ if (stack_pointer_rtx != 0 && regno == STACK_POINTER_REGNUM)
+ return stack_pointer_rtx;
+ }
+
+ return gen_rtx_raw_REG (mode, regno);
+}
+
+rtx
+gen_rtx_MEM (mode, addr)
+ enum machine_mode mode;
+ rtx addr;
+{
+ rtx rt = gen_rtx_raw_MEM (mode, addr);
+
+#ifdef MEM_ALIAS_SET
+ /* This field is not cleared by the mere allocation of the rtx, so
+ we clear it here. */
+ MEM_ALIAS_SET (rt) = 0;
+#endif
+
+ return rt;
+}
+
/* rtx gen_rtx (code, mode, [element1, ..., elementn])
**
** This routine generates an RTX of the size specified by
@@ -295,7 +370,7 @@ static rtx find_line_node PROTO((rtx));
rtx
gen_rtx VPROTO((enum rtx_code code, enum machine_mode mode, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
enum rtx_code code;
enum machine_mode mode;
#endif
@@ -306,71 +381,17 @@ gen_rtx VPROTO((enum rtx_code code, enum machine_mode mode, ...))
VA_START (p, mode);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
code = va_arg (p, enum rtx_code);
mode = va_arg (p, enum machine_mode);
#endif
if (code == CONST_INT)
- {
- HOST_WIDE_INT arg = va_arg (p, HOST_WIDE_INT);
-
- if (arg >= - MAX_SAVED_CONST_INT && arg <= MAX_SAVED_CONST_INT)
- return const_int_rtx[arg + MAX_SAVED_CONST_INT];
-
- if (const_true_rtx && arg == STORE_FLAG_VALUE)
- return const_true_rtx;
-
- rt_val = rtx_alloc (code);
- INTVAL (rt_val) = arg;
- }
+ return gen_rtx_CONST_INT (mode, va_arg (p, HOST_WIDE_INT));
else if (code == REG)
- {
- int regno = va_arg (p, int);
-
- /* In case the MD file explicitly references the frame pointer, have
- all such references point to the same frame pointer. This is used
- during frame pointer elimination to distinguish the explicit
- references to these registers from pseudos that happened to be
- assigned to them.
-
- If we have eliminated the frame pointer or arg pointer, we will
- be using it as a normal register, for example as a spill register.
- In such cases, we might be accessing it in a mode that is not
- Pmode and therefore cannot use the pre-allocated rtx.
-
- Also don't do this when we are making new REGs in reload,
- since we don't want to get confused with the real pointers. */
-
- if (frame_pointer_rtx && regno == FRAME_POINTER_REGNUM && mode == Pmode
- && ! reload_in_progress)
- return frame_pointer_rtx;
-#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- if (hard_frame_pointer_rtx && regno == HARD_FRAME_POINTER_REGNUM
- && mode == Pmode && ! reload_in_progress)
- return hard_frame_pointer_rtx;
-#endif
-#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && HARD_FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
- if (arg_pointer_rtx && regno == ARG_POINTER_REGNUM && mode == Pmode
- && ! reload_in_progress)
- return arg_pointer_rtx;
-#endif
-#ifdef RETURN_ADDRESS_POINTER_REGNUM
- if (return_address_pointer_rtx && regno == RETURN_ADDRESS_POINTER_REGNUM
- && mode == Pmode && ! reload_in_progress)
- return return_address_pointer_rtx;
-#endif
- if (stack_pointer_rtx && regno == STACK_POINTER_REGNUM && mode == Pmode
- && ! reload_in_progress)
- return stack_pointer_rtx;
- else
- {
- rt_val = rtx_alloc (code);
- rt_val->mode = mode;
- REGNO (rt_val) = regno;
- return rt_val;
- }
- }
+ return gen_rtx_REG (mode, va_arg (p, int));
+ else if (code == MEM)
+ return gen_rtx_MEM (mode, va_arg (p, rtx));
else
{
rt_val = rtx_alloc (code); /* Allocate the storage space. */
@@ -424,7 +445,7 @@ gen_rtx VPROTO((enum rtx_code code, enum machine_mode mode, ...))
rtvec
gen_rtvec VPROTO((int n, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
int n;
#endif
int i;
@@ -433,7 +454,7 @@ gen_rtvec VPROTO((int n, ...))
VA_START (p, n);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
n = va_arg (p, int);
#endif
@@ -521,7 +542,7 @@ gen_reg_rtx (mode)
realpart = gen_reg_rtx (partmode);
imagpart = gen_reg_rtx (partmode);
- return gen_rtx (CONCAT, mode, realpart, imagpart);
+ return gen_rtx_CONCAT (mode, realpart, imagpart);
}
/* Make sure regno_pointer_flag and regno_reg_rtx are large
@@ -551,7 +572,7 @@ gen_reg_rtx (mode)
regno_pointer_flag_length *= 2;
}
- val = gen_rtx (REG, mode, reg_rtx_no);
+ val = gen_rtx_REG (mode, reg_rtx_no);
regno_reg_rtx[reg_rtx_no++] = val;
return val;
}
@@ -670,7 +691,7 @@ gen_lowpart_common (mode, x)
|| GET_MODE_SIZE (mode) == GET_MODE_UNIT_SIZE (GET_MODE (x))))
return (GET_MODE (SUBREG_REG (x)) == mode && SUBREG_WORD (x) == 0
? SUBREG_REG (x)
- : gen_rtx (SUBREG, mode, SUBREG_REG (x), SUBREG_WORD (x)));
+ : gen_rtx_SUBREG (mode, SUBREG_REG (x), SUBREG_WORD (x)));
else if (GET_CODE (x) == REG)
{
/* If the register is not valid for MODE, return 0. If we don't
@@ -702,9 +723,9 @@ gen_lowpart_common (mode, x)
&& x != arg_pointer_rtx
#endif
&& x != stack_pointer_rtx)
- return gen_rtx (REG, mode, REGNO (x) + word);
+ return gen_rtx_REG (mode, REGNO (x) + word);
else
- return gen_rtx (SUBREG, mode, x, word);
+ return gen_rtx_SUBREG (mode, x, word);
}
/* If X is a CONST_INT or a CONST_DOUBLE, extract the appropriate bits
from the low-order part of the constant. */
@@ -764,6 +785,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
@@ -802,6 +826,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
@@ -996,8 +1022,7 @@ gen_highpart (mode, x)
&& GET_MODE_CLASS (GET_MODE (x)) != MODE_FLOAT
#endif
)
- return gen_rtx (CONST_INT, VOIDmode,
- CONST_DOUBLE_HIGH (x) & GET_MODE_MASK (mode));
+ return GEN_INT (CONST_DOUBLE_HIGH (x) & GET_MODE_MASK (mode));
else if (GET_CODE (x) == CONST_INT)
return const0_rtx;
else if (GET_CODE (x) == MEM)
@@ -1050,9 +1075,9 @@ gen_highpart (mode, x)
&& x != arg_pointer_rtx
#endif
&& x != stack_pointer_rtx)
- return gen_rtx (REG, mode, REGNO (x) + word);
+ return gen_rtx_REG (mode, REGNO (x) + word);
else
- return gen_rtx (SUBREG, mode, x, word);
+ return gen_rtx_SUBREG (mode, x, word);
}
else
abort ();
@@ -1143,12 +1168,12 @@ operand_subword (op, i, validate_address, mode)
|| op == arg_pointer_rtx
#endif
|| op == stack_pointer_rtx)
- return gen_rtx (SUBREG, word_mode, op, i);
+ return gen_rtx_SUBREG (word_mode, op, i);
else
- return gen_rtx (REG, word_mode, REGNO (op) + i);
+ return gen_rtx_REG (word_mode, REGNO (op) + i);
}
else if (GET_CODE (op) == SUBREG)
- return gen_rtx (SUBREG, word_mode, SUBREG_REG (op), i + SUBREG_WORD (op));
+ return gen_rtx_SUBREG (word_mode, SUBREG_REG (op), i + SUBREG_WORD (op));
else if (GET_CODE (op) == CONCAT)
{
int partwords = GET_MODE_UNIT_SIZE (GET_MODE (op)) / UNITS_PER_WORD;
@@ -1175,7 +1200,7 @@ operand_subword (op, i, validate_address, mode)
addr = memory_address (word_mode, addr);
}
- new = gen_rtx (MEM, word_mode, addr);
+ new = gen_rtx_MEM (word_mode, addr);
MEM_VOLATILE_P (new) = MEM_VOLATILE_P (op);
MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (op);
@@ -1402,8 +1427,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
@@ -1444,7 +1469,7 @@ change_address (memref, mode, addr)
if (rtx_equal_p (addr, XEXP (memref, 0)) && mode == GET_MODE (memref))
return memref;
- new = gen_rtx (MEM, mode, addr);
+ new = gen_rtx_MEM (mode, addr);
MEM_VOLATILE_P (new) = MEM_VOLATILE_P (memref);
RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (memref);
MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (memref);
@@ -1459,9 +1484,10 @@ gen_label_rtx ()
register rtx label;
label = (output_bytecode
- ? gen_rtx (CODE_LABEL, VOIDmode, NULL, bc_get_bytecode_label ())
- : gen_rtx (CODE_LABEL, VOIDmode, 0, NULL_RTX,
- NULL_RTX, label_num++, NULL_PTR));
+ ? gen_rtx_CODE_LABEL (VOIDmode, 0, NULL_RTX,
+ (rtx) bc_get_bytecode_label (), 0, NULL_PTR)
+ : gen_rtx_CODE_LABEL (VOIDmode, 0, NULL_RTX,
+ NULL_RTX, label_num++, NULL_PTR));
LABEL_NUSES (label) = 0;
return label;
@@ -1493,16 +1519,17 @@ gen_inline_header_rtx (first_insn, first_parm_insn, first_labelno,
char *regno_align;
rtvec parm_reg_stack_loc;
{
- rtx header = gen_rtx (INLINE_HEADER, VOIDmode,
- cur_insn_uid++, NULL_RTX,
- first_insn, first_parm_insn,
- first_labelno, last_labelno,
- max_parm_regnum, max_regnum, args_size, pops_args,
- stack_slots, forced_labels, function_flags,
- outgoing_args_size, original_arg_vector,
- original_decl_initial,
- regno_rtx, regno_flag, regno_align,
- parm_reg_stack_loc);
+ rtx header = gen_rtx_INLINE_HEADER (VOIDmode,
+ cur_insn_uid++, NULL_RTX,
+ first_insn, first_parm_insn,
+ first_labelno, last_labelno,
+ max_parm_regnum, max_regnum, args_size,
+ pops_args, stack_slots, forced_labels,
+ function_flags, outgoing_args_size,
+ original_arg_vector,
+ original_decl_initial,
+ regno_rtx, regno_flag, regno_align,
+ parm_reg_stack_loc);
return header;
}
@@ -2097,9 +2124,9 @@ 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 (insn) = gen_rtx (INSN_LIST, REG_CC_USER, user, REG_NOTES (insn));
+ 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));
}
/* Return the next insn that uses CC0 after INSN, which is assumed to
@@ -3244,7 +3271,7 @@ gen_sequence ()
cache it. */
push_obstacks_nochange ();
rtl_in_saveable_obstack ();
- result = gen_rtx (SEQUENCE, VOIDmode, rtvec_alloc (len));
+ result = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (len));
pop_obstacks ();
}
@@ -3384,16 +3411,16 @@ init_emit_once (line_numbers)
/* Create the unique rtx's for certain rtx codes and operand values. */
- pc_rtx = gen_rtx (PC, VOIDmode);
- cc0_rtx = gen_rtx (CC0, VOIDmode);
+ pc_rtx = gen_rtx_PC (VOIDmode);
+ cc0_rtx = gen_rtx_CC0 (VOIDmode);
/* 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++)
{
- const_int_rtx[i + MAX_SAVED_CONST_INT] = rtx_alloc (CONST_INT);
- PUT_MODE (const_int_rtx[i + MAX_SAVED_CONST_INT], VOIDmode);
- INTVAL (const_int_rtx[i + MAX_SAVED_CONST_INT]) = i;
+ PUT_CODE (&const_int_rtx[i + MAX_SAVED_CONST_INT], CONST_INT);
+ PUT_MODE (&const_int_rtx[i + MAX_SAVED_CONST_INT], VOIDmode);
+ INTVAL (&const_int_rtx[i + MAX_SAVED_CONST_INT]) = i;
}
/* These four calls obtain some of the rtx expressions made above. */
@@ -3444,13 +3471,13 @@ init_emit_once (line_numbers)
mode = GET_MODE_WIDER_MODE (mode))
const_tiny_rtx[0][(int) mode] = const0_rtx;
- stack_pointer_rtx = gen_rtx (REG, Pmode, STACK_POINTER_REGNUM);
- frame_pointer_rtx = gen_rtx (REG, Pmode, FRAME_POINTER_REGNUM);
+ stack_pointer_rtx = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
+ frame_pointer_rtx = gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM);
if (HARD_FRAME_POINTER_REGNUM == FRAME_POINTER_REGNUM)
hard_frame_pointer_rtx = frame_pointer_rtx;
else
- hard_frame_pointer_rtx = gen_rtx (REG, Pmode, HARD_FRAME_POINTER_REGNUM);
+ hard_frame_pointer_rtx = gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM);
if (FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM)
arg_pointer_rtx = frame_pointer_rtx;
@@ -3459,29 +3486,29 @@ init_emit_once (line_numbers)
else if (STACK_POINTER_REGNUM == ARG_POINTER_REGNUM)
arg_pointer_rtx = stack_pointer_rtx;
else
- arg_pointer_rtx = gen_rtx (REG, Pmode, ARG_POINTER_REGNUM);
+ arg_pointer_rtx = gen_rtx_REG (Pmode, ARG_POINTER_REGNUM);
#ifdef RETURN_ADDRESS_POINTER_REGNUM
- return_address_pointer_rtx = gen_rtx (REG, Pmode,
- RETURN_ADDRESS_POINTER_REGNUM);
+ return_address_pointer_rtx = gen_rtx_REG (Pmode,
+ RETURN_ADDRESS_POINTER_REGNUM);
#endif
/* Create the virtual registers. Do so here since the following objects
might reference them. */
- virtual_incoming_args_rtx = gen_rtx (REG, Pmode,
- VIRTUAL_INCOMING_ARGS_REGNUM);
- virtual_stack_vars_rtx = gen_rtx (REG, Pmode,
- VIRTUAL_STACK_VARS_REGNUM);
- virtual_stack_dynamic_rtx = gen_rtx (REG, Pmode,
- VIRTUAL_STACK_DYNAMIC_REGNUM);
- virtual_outgoing_args_rtx = gen_rtx (REG, Pmode,
- VIRTUAL_OUTGOING_ARGS_REGNUM);
+ virtual_incoming_args_rtx = gen_rtx_REG (Pmode,
+ VIRTUAL_INCOMING_ARGS_REGNUM);
+ virtual_stack_vars_rtx = gen_rtx_REG (Pmode,
+ VIRTUAL_STACK_VARS_REGNUM);
+ virtual_stack_dynamic_rtx = gen_rtx_REG (Pmode,
+ VIRTUAL_STACK_DYNAMIC_REGNUM);
+ virtual_outgoing_args_rtx = gen_rtx_REG (Pmode,
+ VIRTUAL_OUTGOING_ARGS_REGNUM);
#ifdef STRUCT_VALUE
struct_value_rtx = STRUCT_VALUE;
#else
- struct_value_rtx = gen_rtx (REG, Pmode, STRUCT_VALUE_REGNUM);
+ struct_value_rtx = gen_rtx_REG (Pmode, STRUCT_VALUE_REGNUM);
#endif
#ifdef STRUCT_VALUE_INCOMING
@@ -3489,18 +3516,19 @@ init_emit_once (line_numbers)
#else
#ifdef STRUCT_VALUE_INCOMING_REGNUM
struct_value_incoming_rtx
- = gen_rtx (REG, Pmode, STRUCT_VALUE_INCOMING_REGNUM);
+ = gen_rtx_REG (Pmode, STRUCT_VALUE_INCOMING_REGNUM);
#else
struct_value_incoming_rtx = struct_value_rtx;
#endif
#endif
#ifdef STATIC_CHAIN_REGNUM
- static_chain_rtx = gen_rtx (REG, Pmode, STATIC_CHAIN_REGNUM);
+ static_chain_rtx = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
#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;
@@ -3517,6 +3545,6 @@ init_emit_once (line_numbers)
#endif
#ifdef PIC_OFFSET_TABLE_REGNUM
- pic_offset_table_rtx = gen_rtx (REG, Pmode, PIC_OFFSET_TABLE_REGNUM);
+ pic_offset_table_rtx = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
#endif
}
diff --git a/gcc/except.c b/gcc/except.c
index 6aea0ec09f7..174e4e6953c 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -389,8 +389,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
+#include "system.h"
#include "defaults.h"
-#include <stdio.h>
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -795,7 +795,7 @@ get_dynamic_cleanup_chain ()
current_function_dcc = copy_to_reg (dcc);
/* We don't want a copy of the dcc, but rather, the single dcc. */
- return gen_rtx (MEM, Pmode, current_function_dcc);
+ return gen_rtx_MEM (Pmode, current_function_dcc);
}
/* Generate code to evaluate X and jump to LABEL if the value is nonzero.
@@ -862,10 +862,10 @@ start_dynamic_cleanup (func, arg)
/* Store func and arg into the cleanup list element. */
- new_func = gen_rtx (MEM, Pmode, plus_constant (XEXP (buf, 0),
- GET_MODE_SIZE (Pmode)));
- new_arg = gen_rtx (MEM, Pmode, plus_constant (XEXP (buf, 0),
- GET_MODE_SIZE (Pmode)*2));
+ new_func = gen_rtx_MEM (Pmode, plus_constant (XEXP (buf, 0),
+ GET_MODE_SIZE (Pmode)));
+ new_arg = gen_rtx_MEM (Pmode, plus_constant (XEXP (buf, 0),
+ GET_MODE_SIZE (Pmode)*2));
x = expand_expr (func, new_func, Pmode, 0);
if (x != new_func)
emit_move_insn (new_func, x);
@@ -918,8 +918,8 @@ start_dynamic_handler ()
/* Store dhc into the first word of the newly allocated buffer. */
dhc = get_dynamic_handler_chain ();
- dcc = gen_rtx (MEM, Pmode, plus_constant (XEXP (arg, 0),
- GET_MODE_SIZE (Pmode)));
+ dcc = gen_rtx_MEM (Pmode, plus_constant (XEXP (arg, 0),
+ GET_MODE_SIZE (Pmode)));
emit_move_insn (arg, dhc);
/* Zero out the start of the cleanup chain. */
@@ -1240,7 +1240,7 @@ void
expand_internal_throw (context)
rtx context;
{
- expand_internal_throw_indirect (gen_rtx (LABEL_REF, Pmode, context));
+ expand_internal_throw_indirect (gen_rtx_LABEL_REF (Pmode, context));
}
/* Called from expand_exception_blocks and expand_end_catch_block to
@@ -1611,15 +1611,15 @@ output_exception_table_entry (file, n)
rtx sym;
ASM_GENERATE_INTERNAL_LABEL (buf, "LEHB", n);
- sym = gen_rtx (SYMBOL_REF, Pmode, buf);
+ sym = gen_rtx_SYMBOL_REF (Pmode, buf);
assemble_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
ASM_GENERATE_INTERNAL_LABEL (buf, "LEHE", n);
- sym = gen_rtx (SYMBOL_REF, Pmode, buf);
+ sym = gen_rtx_SYMBOL_REF (Pmode, buf);
assemble_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
ASM_GENERATE_INTERNAL_LABEL (buf, "L", n);
- sym = gen_rtx (SYMBOL_REF, Pmode, buf);
+ sym = gen_rtx_SYMBOL_REF (Pmode, buf);
assemble_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
putc ('\n', file); /* blank line */
@@ -1661,9 +1661,9 @@ output_exception_table ()
void
register_exception_table ()
{
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__register_exceptions"), 0,
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__register_exceptions"), 0,
VOIDmode, 1,
- gen_rtx (SYMBOL_REF, Pmode, "__EXCEPTION_TABLE__"),
+ gen_rtx_SYMBOL_REF (Pmode, "__EXCEPTION_TABLE__"),
Pmode);
}
@@ -1749,7 +1749,7 @@ end_eh_unwinder ()
emit_move_insn (ret_val, throw_libfunc);
#else
label = gen_label_rtx ();
- emit_move_insn (ret_val, gen_rtx (LABEL_REF, Pmode, label));
+ emit_move_insn (ret_val, gen_rtx_LABEL_REF (Pmode, label));
#endif
#ifdef RETURN_ADDR_OFFSET
@@ -1908,8 +1908,8 @@ find_exception_handler_labels ()
if (label)
exception_handler_labels
- = gen_rtx (EXPR_LIST, VOIDmode,
- label, exception_handler_labels);
+ = gen_rtx_EXPR_LIST (VOIDmode,
+ label, exception_handler_labels);
else
warning ("didn't find handler for EH region %d",
NOTE_BLOCK_NUMBER (insn));
@@ -2331,7 +2331,7 @@ eh_regs (r1, r2, outgoing)
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
if (call_used_regs[i] && ! fixed_regs[i] && i != REGNO (reg1))
{
- reg2 = gen_rtx (REG, Pmode, i);
+ reg2 = gen_rtx_REG (Pmode, i);
break;
}
@@ -2363,7 +2363,7 @@ expand_builtin_eh_stub ()
emit_indirect_jump (handler);
emit_label (after_stub);
- return gen_rtx (LABEL_REF, Pmode, stub_start);
+ return gen_rtx_LABEL_REF (Pmode, stub_start);
}
/* Set up the registers for passing the handler address and stack offset
@@ -2381,6 +2381,6 @@ expand_builtin_set_eh_regs (handler, offset)
store_expr (handler, reg1, 0);
/* These will be used by the stub. */
- emit_insn (gen_rtx (USE, VOIDmode, reg1));
- emit_insn (gen_rtx (USE, VOIDmode, reg2));
+ emit_insn (gen_rtx_USE (VOIDmode, reg1));
+ emit_insn (gen_rtx_USE (VOIDmode, reg2));
}
diff --git a/gcc/explow.c b/gcc/explow.c
index 6e3923e64d1..f23e85a5ffc 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -33,6 +33,7 @@ Boston, MA 02111-1307, USA. */
static rtx break_out_memory_refs PROTO((rtx));
static void emit_stack_probe PROTO((rtx));
+
/* Return an rtx for the sum of X and the integer C.
This function should be used via the `plus_constant' macro. */
@@ -118,13 +119,11 @@ plus_constant_wide (x, c)
if (GET_CODE (XEXP (x, 1)) == CONST_INT)
return plus_constant (XEXP (x, 0), c + INTVAL (XEXP (x, 1)));
else if (CONSTANT_P (XEXP (x, 0)))
- return gen_rtx (PLUS, mode,
- plus_constant (XEXP (x, 0), c),
- XEXP (x, 1));
+ return gen_rtx_PLUS (mode,
+ plus_constant (XEXP (x, 0), c), XEXP (x, 1));
else if (CONSTANT_P (XEXP (x, 1)))
- return gen_rtx (PLUS, mode,
- XEXP (x, 0),
- plus_constant (XEXP (x, 1), c));
+ return gen_rtx_PLUS (mode, XEXP (x, 0),
+ plus_constant (XEXP (x, 1), c));
break;
default:
@@ -132,12 +131,12 @@ plus_constant_wide (x, c)
}
if (c != 0)
- x = gen_rtx (PLUS, mode, x, GEN_INT (c));
+ x = gen_rtx_PLUS (mode, x, GEN_INT (c));
if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
return x;
else if (all_constant)
- return gen_rtx (CONST, mode, x);
+ return gen_rtx_CONST (mode, x);
else
return x;
}
@@ -156,8 +155,8 @@ plus_constant_for_output_wide (x, c)
int all_constant = 0;
if (GET_CODE (x) == LO_SUM)
- return gen_rtx (LO_SUM, mode, XEXP (x, 0),
- plus_constant_for_output (XEXP (x, 1), c));
+ return gen_rtx_LO_SUM (mode, XEXP (x, 0),
+ plus_constant_for_output (XEXP (x, 1), c));
else
return plus_constant (x, c);
@@ -198,7 +197,7 @@ eliminate_constant_term (x, constptr)
&& GET_CODE (tem) == CONST_INT)
{
*constptr = tem;
- return gen_rtx (PLUS, GET_MODE (x), x0, x1);
+ return gen_rtx_PLUS (GET_MODE (x), x0, x1);
}
return x;
@@ -327,19 +326,19 @@ convert_memory_address (to_mode, x)
return x;
case LABEL_REF:
- temp = gen_rtx (LABEL_REF, to_mode, XEXP (x, 0));
+ temp = gen_rtx_LABEL_REF (to_mode, XEXP (x, 0));
LABEL_REF_NONLOCAL_P (temp) = LABEL_REF_NONLOCAL_P (x);
return temp;
case SYMBOL_REF:
- temp = gen_rtx (SYMBOL_REF, to_mode, XSTR (x, 0));
+ temp = gen_rtx_SYMBOL_REF (to_mode, XSTR (x, 0));
SYMBOL_REF_FLAG (temp) = SYMBOL_REF_FLAG (x);
CONSTANT_POOL_ADDRESS_P (temp) = CONSTANT_POOL_ADDRESS_P (x);
return temp;
case CONST:
- return gen_rtx (CONST, to_mode,
- convert_memory_address (to_mode, XEXP (x, 0)));
+ return gen_rtx_CONST (to_mode,
+ convert_memory_address (to_mode, XEXP (x, 0)));
case PLUS:
case MULT:
@@ -477,7 +476,7 @@ memory_address (mode, x)
x = force_operand (x, NULL_RTX);
else
{
- y = gen_rtx (PLUS, GET_MODE (x), copy_to_reg (y), constant_term);
+ y = gen_rtx_PLUS (GET_MODE (x), copy_to_reg (y), constant_term);
if (! memory_address_p (mode, y))
x = force_operand (x, NULL_RTX);
else
@@ -586,7 +585,7 @@ stabilize (x)
rtx mem;
if (GET_CODE (temp) != REG)
temp = copy_to_reg (temp);
- mem = gen_rtx (MEM, GET_MODE (x), temp);
+ mem = gen_rtx_MEM (GET_MODE (x), temp);
/* Mark returned memref with in_struct if it's in an array or
structure. Copy const and volatile from original memref. */
@@ -682,7 +681,7 @@ force_reg (mode, x)
if (note)
XEXP (note, 0) = x;
else
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL, x, REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, x, REG_NOTES (insn));
}
return temp;
}
@@ -1133,6 +1132,9 @@ allocate_dynamic_stack_space (size, target, known_align)
(target, Pmode)))
target = copy_to_mode_reg (Pmode, target);
mode = insn_operand_mode[(int) CODE_FOR_allocate_stack][1];
+ 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])
@@ -1190,7 +1192,7 @@ static void
emit_stack_probe (address)
rtx address;
{
- rtx memref = gen_rtx (MEM, word_mode, address);
+ rtx memref = gen_rtx_MEM (word_mode, address);
MEM_VOLATILE_P (memref) = 1;
@@ -1229,9 +1231,9 @@ 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 = copy_to_mode_reg (Pmode, last_addr);
- emit_insn (gen_check_stack (last_address));
+ emit_insn (gen_check_stack (last_addr));
return;
}
#endif
@@ -1310,7 +1312,7 @@ probe_stack_range (first, size)
/* If will be doing stupid optimization, show test_addr is still live. */
if (obey_regdecls)
- emit_insn (gen_rtx (USE, VOIDmode, test_addr));
+ emit_insn (gen_rtx_USE (VOIDmode, test_addr));
emit_stack_probe (last_addr);
}
diff --git a/gcc/expmed.c b/gcc/expmed.c
index eb481335abb..62fe884ebc9 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -65,8 +65,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];
@@ -95,26 +95,28 @@ 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);
-
- shift_insn = emit_insn (gen_rtx (SET, VOIDmode, reg,
- gen_rtx (ASHIFT, word_mode, reg,
- const0_rtx)));
-
- shiftadd_insn = emit_insn (gen_rtx (SET, VOIDmode, reg,
- gen_rtx (PLUS, word_mode,
- gen_rtx (MULT, word_mode,
- reg, const0_rtx),
- reg)));
-
- shiftsub_insn = emit_insn (gen_rtx (SET, VOIDmode, reg,
- gen_rtx (MINUS, word_mode,
- gen_rtx (MULT, word_mode,
- reg, const0_rtx),
- reg)));
+ add_cost = rtx_cost (gen_rtx_PLUS (word_mode, reg, reg), SET);
+
+ shift_insn = emit_insn (gen_rtx_SET (VOIDmode, reg,
+ gen_rtx_ASHIFT (word_mode, reg,
+ const0_rtx)));
+
+ shiftadd_insn
+ = emit_insn (gen_rtx_SET (VOIDmode, reg,
+ gen_rtx_PLUS (word_mode,
+ gen_rtx_MULT (word_mode,
+ reg, const0_rtx),
+ reg)));
+
+ shiftsub_insn
+ = emit_insn (gen_rtx_SET (VOIDmode, reg,
+ gen_rtx_MINUS (word_mode,
+ gen_rtx_MULT (word_mode,
+ reg, const0_rtx),
+ reg)));
init_recog ();
@@ -140,13 +142,13 @@ init_expmed ()
shiftsub_cost[m] = rtx_cost (SET_SRC (PATTERN (shiftsub_insn)), SET);
}
- negate_cost = rtx_cost (gen_rtx (NEG, word_mode, reg), SET);
+ negate_cost = rtx_cost (gen_rtx_NEG (word_mode, reg), SET);
sdiv_pow2_cheap
- = (rtx_cost (gen_rtx (DIV, word_mode, reg, GEN_INT (32)), SET)
+ = (rtx_cost (gen_rtx_DIV (word_mode, reg, GEN_INT (32)), SET)
<= 2 * add_cost);
smod_pow2_cheap
- = (rtx_cost (gen_rtx (MOD, word_mode, reg, GEN_INT (32)), SET)
+ = (rtx_cost (gen_rtx_MOD (word_mode, reg, GEN_INT (32)), SET)
<= 2 * add_cost);
for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
@@ -160,19 +162,20 @@ init_expmed ()
if (wider_mode != VOIDmode)
{
mul_widen_cost[(int) wider_mode]
- = rtx_cost (gen_rtx (MULT, wider_mode,
- gen_rtx (ZERO_EXTEND, wider_mode, reg),
- gen_rtx (ZERO_EXTEND, wider_mode, reg)),
+ = rtx_cost (gen_rtx_MULT (wider_mode,
+ gen_rtx_ZERO_EXTEND (wider_mode, reg),
+ gen_rtx_ZERO_EXTEND (wider_mode, reg)),
SET);
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)))),
+ = 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)))),
SET);
}
}
@@ -278,7 +281,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
if (GET_MODE (op0) != fieldmode)
{
if (GET_CODE (op0) == REG)
- op0 = gen_rtx (SUBREG, fieldmode, op0, offset);
+ op0 = gen_rtx_SUBREG (fieldmode, op0, offset);
else
op0 = change_address (op0, fieldmode,
plus_constant (XEXP (op0, 0), offset));
@@ -313,7 +316,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
if(! (*insn_operand_predicate[icode][1]) (value, fieldmode))
value = copy_to_mode_reg (fieldmode, value);
emit_insn (GEN_FCN (icode)
- (gen_rtx (SUBREG, fieldmode, op0, offset), value));
+ (gen_rtx_SUBREG (fieldmode, op0, offset), value));
}
return value;
}
@@ -370,8 +373,8 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
{
if (offset != 0
|| GET_MODE_SIZE (GET_MODE (op0)) > UNITS_PER_WORD)
- op0 = gen_rtx (SUBREG, TYPE_MODE (type_for_size (BITS_PER_WORD, 0)),
- op0, offset);
+ op0 = gen_rtx_SUBREG (TYPE_MODE (type_for_size (BITS_PER_WORD, 0)),
+ op0, offset);
offset = 0;
}
else
@@ -387,7 +390,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
{
if (GET_CODE (value) != REG)
value = copy_to_reg (value);
- value = gen_rtx (SUBREG, word_mode, value, 0);
+ value = gen_rtx_SUBREG (word_mode, value, 0);
}
/* Now OFFSET is nonzero only if OP0 is memory
@@ -470,9 +473,9 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
if (GET_CODE (xop0) == SUBREG)
/* We can't just change the mode, because this might clobber op0,
and we will need the original value of op0 if insv fails. */
- xop0 = gen_rtx (SUBREG, maxmode, SUBREG_REG (xop0), SUBREG_WORD (xop0));
+ xop0 = gen_rtx_SUBREG (maxmode, SUBREG_REG (xop0), SUBREG_WORD (xop0));
if (GET_CODE (xop0) == REG && GET_MODE (xop0) != maxmode)
- xop0 = gen_rtx (SUBREG, maxmode, xop0, 0);
+ xop0 = gen_rtx_SUBREG (maxmode, xop0, 0);
/* On big-endian machines, we count bits from the most significant.
If the bit field insn does not, we must invert. */
@@ -502,7 +505,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
/* Avoid making subreg of a subreg, or of a mem. */
if (GET_CODE (value1) != REG)
value1 = copy_to_reg (value1);
- value1 = gen_rtx (SUBREG, maxmode, value1, 0);
+ value1 = gen_rtx_SUBREG (maxmode, value1, 0);
}
else
value1 = gen_lowpart (maxmode, value1);
@@ -961,7 +964,7 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
if (mode1 != GET_MODE (op0))
{
if (GET_CODE (op0) == REG)
- op0 = gen_rtx (SUBREG, mode1, op0, offset);
+ op0 = gen_rtx_SUBREG (mode1, op0, offset);
else
op0 = change_address (op0, mode1,
plus_constant (XEXP (op0, 0), offset));
@@ -987,7 +990,7 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
target = gen_reg_rtx (mode);
/* Indicate for flow that the entire target reg is being set. */
- emit_insn (gen_rtx (CLOBBER, VOIDmode, target));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
for (i = 0; i < nwords; i++)
{
@@ -1056,8 +1059,8 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
{
if (offset != 0
|| GET_MODE_SIZE (GET_MODE (op0)) > UNITS_PER_WORD)
- op0 = gen_rtx (SUBREG, TYPE_MODE (type_for_size (BITS_PER_WORD, 0)),
- op0, offset);
+ op0 = gen_rtx_SUBREG (TYPE_MODE (type_for_size (BITS_PER_WORD, 0)),
+ op0, offset);
offset = 0;
}
else
@@ -1145,7 +1148,7 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
if (GET_CODE (xop0) == SUBREG && GET_MODE (xop0) != maxmode)
goto extzv_loses;
if (GET_CODE (xop0) == REG && GET_MODE (xop0) != maxmode)
- xop0 = gen_rtx (SUBREG, maxmode, xop0, 0);
+ xop0 = gen_rtx_SUBREG (maxmode, xop0, 0);
/* On big-endian machines, we count bits from the most significant.
If the bit field insn does not, we must invert. */
@@ -1279,7 +1282,7 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
if (GET_CODE (xop0) == SUBREG && GET_MODE (xop0) != maxmode)
goto extv_loses;
if (GET_CODE (xop0) == REG && GET_MODE (xop0) != maxmode)
- xop0 = gen_rtx (SUBREG, maxmode, xop0, 0);
+ xop0 = gen_rtx_SUBREG (maxmode, xop0, 0);
/* On big-endian machines, we count bits from the most significant.
If the bit field insn does not, we must invert. */
@@ -1358,7 +1361,7 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
target, unsignedp);
if (GET_CODE (target) != REG)
target = copy_to_reg (target);
- return gen_rtx (SUBREG, tmode, target, 0);
+ return gen_rtx_SUBREG (tmode, target, 0);
}
else
return convert_to_mode (tmode, target, unsignedp);
@@ -2199,7 +2202,7 @@ expand_mult (mode, op0, op1, target, unsignedp)
and then negate, do the multiplication directly, or do multiplication
by OP1 - 1. */
- mult_cost = rtx_cost (gen_rtx (MULT, mode, op0, op1), SET);
+ mult_cost = rtx_cost (gen_rtx_MULT (mode, op0, op1), SET);
mult_cost = MIN (12 * add_cost, mult_cost);
synth_mult (&alg, val, mult_cost);
@@ -2271,16 +2274,18 @@ expand_mult (mode, op0, op1, target, unsignedp)
case alg_add_t_m2:
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);
+ accum = force_operand (gen_rtx_PLUS (mode, accum, tem),
+ add_target
+ ? add_target : accum_target);
val_so_far += (HOST_WIDE_INT) 1 << log;
break;
case alg_sub_t_m2:
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);
+ accum = force_operand (gen_rtx_MINUS (mode, accum, tem),
+ add_target
+ ? add_target : accum_target);
val_so_far -= (HOST_WIDE_INT) 1 << log;
break;
@@ -2288,8 +2293,9 @@ expand_mult (mode, op0, op1, target, unsignedp)
accum = expand_shift (LSHIFT_EXPR, mode, accum,
build_int_2 (log, 0), shift_subtarget,
0);
- accum = force_operand (gen_rtx (PLUS, mode, accum, op0),
- add_target ? add_target : accum_target);
+ accum = force_operand (gen_rtx_PLUS (mode, accum, op0),
+ add_target
+ ? add_target : accum_target);
val_so_far = (val_so_far << log) + 1;
break;
@@ -2297,23 +2303,25 @@ expand_mult (mode, op0, op1, target, unsignedp)
accum = expand_shift (LSHIFT_EXPR, mode, accum,
build_int_2 (log, 0), shift_subtarget,
0);
- accum = force_operand (gen_rtx (MINUS, mode, accum, op0),
- add_target ? add_target : accum_target);
+ accum = force_operand (gen_rtx_MINUS (mode, accum, op0),
+ add_target
+ ? add_target : accum_target);
val_so_far = (val_so_far << log) - 1;
break;
case alg_add_factor:
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);
+ accum = force_operand (gen_rtx_PLUS (mode, accum, tem),
+ add_target
+ ? add_target : accum_target);
val_so_far += val_so_far << log;
break;
case alg_sub_factor:
tem = expand_shift (LSHIFT_EXPR, mode, accum,
build_int_2 (log, 0), NULL_RTX, 0);
- accum = force_operand (gen_rtx (MINUS, mode, tem, accum),
+ accum = force_operand (gen_rtx_MINUS (mode, tem, accum),
(add_target ? add_target
: preserve ? 0 : tem));
val_so_far = (val_so_far << log) - val_so_far;
@@ -2328,9 +2336,10 @@ expand_mult (mode, op0, op1, target, unsignedp)
insn = get_last_insn ();
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (MULT, mode, op0, GEN_INT (val_so_far)),
- REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_MULT (mode, op0,
+ GEN_INT (val_so_far)),
+ REG_NOTES (insn));
}
if (variant == negate_variant)
@@ -2341,7 +2350,7 @@ expand_mult (mode, op0, op1, target, unsignedp)
else if (variant == add_variant)
{
val_so_far = val_so_far + 1;
- accum = force_operand (gen_rtx (PLUS, mode, accum, op0), target);
+ accum = force_operand (gen_rtx_PLUS (mode, accum, op0), target);
}
if (val != val_so_far)
@@ -2958,13 +2967,13 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
max_cost - extra_cost);
if (t1 == 0)
goto fail1;
- t2 = force_operand (gen_rtx (MINUS, compute_mode,
- op0, t1),
+ t2 = force_operand (gen_rtx_MINUS (compute_mode,
+ op0, t1),
NULL_RTX);
t3 = expand_shift (RSHIFT_EXPR, compute_mode, t2,
build_int_2 (1, 0), NULL_RTX,1);
- t4 = force_operand (gen_rtx (PLUS, compute_mode,
- t1, t3),
+ t4 = force_operand (gen_rtx_PLUS (compute_mode,
+ t1, t3),
NULL_RTX);
quotient
= expand_shift (RSHIFT_EXPR, compute_mode, t4,
@@ -3000,9 +3009,9 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
&& (set = single_set (insn)) != 0
&& SET_DEST (set) == quotient)
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (UDIV, compute_mode, op0, op1),
- REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_UDIV (compute_mode, op0, op1),
+ REG_NOTES (insn));
}
else /* TRUNC_DIV, signed */
{
@@ -3060,8 +3069,8 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
t2 = expand_shift (RSHIFT_EXPR, compute_mode, t1,
build_int_2 (size - lgup, 0),
NULL_RTX, 1);
- t3 = force_operand (gen_rtx (PLUS, compute_mode,
- op0, t2),
+ t3 = force_operand (gen_rtx_PLUS (compute_mode,
+ op0, t2),
NULL_RTX);
quotient = expand_shift (RSHIFT_EXPR, compute_mode, t3,
build_int_2 (lgup, 0),
@@ -3077,9 +3086,10 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
&& (set = single_set (insn)) != 0
&& SET_DEST (set) == quotient)
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (DIV, compute_mode, op0,
- GEN_INT (abs_d)),
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_DIV (compute_mode,
+ op0,
+ GEN_INT (abs_d)),
REG_NOTES (insn));
quotient = expand_unop (compute_mode, neg_optab,
@@ -3106,11 +3116,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
{
@@ -3124,18 +3138,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 */
@@ -3146,9 +3167,9 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
&& (set = single_set (insn)) != 0
&& SET_DEST (set) == quotient)
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (DIV, compute_mode, op0, op1),
- REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_DIV (compute_mode, op0, op1),
+ REG_NOTES (insn));
}
break;
}
@@ -3216,13 +3237,13 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
else
{
rtx nsign, t1, t2, t3, t4;
- t1 = force_operand (gen_rtx (PLUS, compute_mode,
- op0, constm1_rtx), NULL_RTX);
+ t1 = force_operand (gen_rtx_PLUS (compute_mode,
+ op0, constm1_rtx), NULL_RTX);
t2 = expand_binop (compute_mode, ior_optab, op0, t1, NULL_RTX,
0, OPTAB_WIDEN);
nsign = expand_shift (RSHIFT_EXPR, compute_mode, t2,
build_int_2 (size - 1, 0), NULL_RTX, 0);
- t3 = force_operand (gen_rtx (MINUS, compute_mode, t1, nsign),
+ t3 = force_operand (gen_rtx_MINUS (compute_mode, t1, nsign),
NULL_RTX);
t4 = expand_divmod (0, TRUNC_DIV_EXPR, compute_mode, t3, op1,
NULL_RTX, 0);
@@ -3231,8 +3252,8 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
rtx t5;
t5 = expand_unop (compute_mode, one_cmpl_optab, nsign,
NULL_RTX, 0);
- quotient = force_operand (gen_rtx (PLUS, compute_mode,
- t4, t5),
+ quotient = force_operand (gen_rtx_PLUS (compute_mode,
+ t4, t5),
tquotient);
}
}
@@ -3353,8 +3374,8 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
quotient = t1;
}
else
- quotient = force_operand (gen_rtx (PLUS, compute_mode,
- t1, t3),
+ quotient = force_operand (gen_rtx_PLUS (compute_mode,
+ t1, t3),
tquotient);
break;
}
@@ -3451,8 +3472,8 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
quotient = t1;
}
else
- quotient = force_operand (gen_rtx (PLUS, compute_mode,
- t1, t3),
+ quotient = force_operand (gen_rtx_PLUS (compute_mode,
+ t1, t3),
tquotient);
break;
}
@@ -3562,10 +3583,10 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
insn = get_last_insn ();
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (unsignedp ? UDIV : DIV, compute_mode,
- op0, op1),
- REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx (unsignedp ? UDIV : DIV,
+ compute_mode, op0, op1),
+ REG_NOTES (insn));
}
break;
@@ -4072,7 +4093,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 dfa1b4bec97..cfec566d692 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "machmode.h"
#include "rtl.h"
#include "tree.h"
@@ -111,8 +111,8 @@ static rtx saveregs_value;
static rtx apply_args_value;
/* Don't check memory usage, since code is being emitted to check a memory
- usage. Used when flag_check_memory_usage is true, to avoid infinite
- recursion. */
+ usage. Used when current_function_check_memory_usage is true, to avoid
+ infinite recursion. */
static int in_check_memory_usage;
/* This structure is used by move_by_pieces to describe the move to
@@ -124,11 +124,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;
@@ -165,14 +167,18 @@ static int queued_subexp_p PROTO((rtx));
static void init_queue PROTO((void));
static void move_by_pieces PROTO((rtx, rtx, int, int));
static int move_by_pieces_ninsns PROTO((unsigned int, int));
-static void move_by_pieces_1 PROTO((rtx (*) (), enum machine_mode,
+static void move_by_pieces_1 PROTO((rtx (*) PVPROTO((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 (*) (), enum machine_mode,
+static void clear_by_pieces_1 PROTO((rtx (*) PVPROTO((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 PROTO((tree, rtx, int));
+static void store_constructor_field PROTO((rtx, int, int, enum machine_mode,
+ 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));
static tree save_noncopied_parts PROTO((tree, tree));
@@ -222,8 +228,8 @@ extern tree truthvalue_conversion PROTO((tree));
static char direct_load[NUM_MACHINE_MODES];
static char direct_store[NUM_MACHINE_MODES];
-/* MOVE_RATIO is the number of move instructions that is better than
- a block move. */
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction sequences, we will do a movstr or libcall instead. */
#ifndef MOVE_RATIO
#if defined (HAVE_movstrqi) || defined (HAVE_movstrhi) || defined (HAVE_movstrsi) || defined (HAVE_movstrdi) || defined (HAVE_movstrti)
@@ -303,10 +309,10 @@ init_expr_once ()
/* Try indexing by frame ptr and try by stack ptr.
It is known that on the Convex the stack ptr isn't a valid index.
With luck, one or the other is valid on any machine. */
- mem = gen_rtx (MEM, VOIDmode, stack_pointer_rtx);
- mem1 = gen_rtx (MEM, VOIDmode, frame_pointer_rtx);
+ mem = gen_rtx_MEM (VOIDmode, stack_pointer_rtx);
+ mem1 = gen_rtx_MEM (VOIDmode, frame_pointer_rtx);
- insn = emit_insn (gen_rtx (SET, 0, NULL_RTX, NULL_RTX));
+ insn = emit_insn (gen_rtx_SET (0, NULL_RTX, NULL_RTX));
pat = PATTERN (insn);
for (mode = VOIDmode; (int) mode < NUM_MACHINE_MODES;
@@ -331,7 +337,7 @@ init_expr_once ()
if (! HARD_REGNO_MODE_OK (regno, mode))
continue;
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
SET_SRC (pat) = mem;
SET_DEST (pat) = reg;
@@ -426,8 +432,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;
}
@@ -470,7 +476,7 @@ protect_from_queue (x, modify)
&& GET_CODE (XEXP (x, 0)) == QUEUED && !modify)
{
register rtx y = XEXP (x, 0);
- register rtx new = gen_rtx (MEM, GET_MODE (x), QUEUED_VAR (y));
+ register rtx new = gen_rtx_MEM (GET_MODE (x), QUEUED_VAR (y));
MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (x);
RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (x);
@@ -897,7 +903,7 @@ convert_move (to, from, unsignedp)
!= CODE_FOR_nothing))
{
if (GET_CODE (to) == REG)
- emit_insn (gen_rtx (CLOBBER, VOIDmode, to));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, to));
convert_move (gen_lowpart (word_mode, to), from, unsignedp);
emit_unop_insn (code, to,
gen_lowpart (word_mode, to), equiv_code);
@@ -1453,6 +1459,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)
@@ -1578,7 +1586,7 @@ move_by_pieces_ninsns (l, align)
static void
move_by_pieces_1 (genfun, mode, data)
- rtx (*genfun) ();
+ rtx (*genfun) PVPROTO((rtx, ...));
enum machine_mode mode;
struct move_by_pieces *data;
{
@@ -1590,19 +1598,21 @@ move_by_pieces_1 (genfun, mode, data)
if (data->reverse) data->offset -= size;
to1 = (data->autinc_to
- ? gen_rtx (MEM, mode, data->to_addr)
+ ? gen_rtx_MEM (mode, data->to_addr)
: copy_rtx (change_address (data->to, mode,
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
- ? gen_rtx (MEM, mode, data->from_addr)
+ ? gen_rtx_MEM (mode, data->from_addr)
: copy_rtx (change_address (data->from, mode,
plus_constant (data->from_addr,
data->offset))));
MEM_IN_STRUCT_P (from1) = data->from_struct;
+ RTX_UNCHANGING_P (from1) = data->from_readonly;
#ifdef HAVE_PRE_DECREMENT
if (data->explicit_inc_to < 0)
@@ -1762,7 +1772,7 @@ move_block_to_reg (regno, x, nregs, mode)
if (HAVE_load_multiple)
{
last = get_last_insn ();
- pat = gen_load_multiple (gen_rtx (REG, word_mode, regno), x,
+ pat = gen_load_multiple (gen_rtx_REG (word_mode, regno), x,
GEN_INT (nregs));
if (pat)
{
@@ -1775,7 +1785,7 @@ move_block_to_reg (regno, x, nregs, mode)
#endif
for (i = 0; i < nregs; i++)
- emit_move_insn (gen_rtx (REG, word_mode, regno + i),
+ emit_move_insn (gen_rtx_REG (word_mode, regno + i),
operand_subword_force (x, i, mode));
}
@@ -1801,7 +1811,7 @@ move_block_from_reg (regno, x, nregs, size)
&& (mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0)) != BLKmode)
{
emit_move_insn (change_address (x, mode, NULL),
- gen_rtx (REG, mode, regno));
+ gen_rtx_REG (mode, regno));
return;
}
@@ -1817,7 +1827,7 @@ move_block_from_reg (regno, x, nregs, size)
abort ();
shift = expand_shift (LSHIFT_EXPR, word_mode,
- gen_rtx (REG, word_mode, regno),
+ gen_rtx_REG (word_mode, regno),
build_int_2 ((UNITS_PER_WORD - size)
* BITS_PER_UNIT, 0), NULL_RTX, 0);
emit_move_insn (tem, shift);
@@ -1829,7 +1839,7 @@ move_block_from_reg (regno, x, nregs, size)
if (HAVE_store_multiple)
{
last = get_last_insn ();
- pat = gen_store_multiple (x, gen_rtx (REG, word_mode, regno),
+ pat = gen_store_multiple (x, gen_rtx_REG (word_mode, regno),
GEN_INT (nregs));
if (pat)
{
@@ -1848,7 +1858,7 @@ move_block_from_reg (regno, x, nregs, size)
if (tem == 0)
abort ();
- emit_move_insn (tem, gen_rtx (REG, word_mode, regno + i));
+ emit_move_insn (tem, gen_rtx_REG (word_mode, regno + i));
}
}
@@ -1963,8 +1973,8 @@ use_reg (call_fusage, reg)
abort();
*call_fusage
- = gen_rtx (EXPR_LIST, VOIDmode,
- gen_rtx (USE, VOIDmode, reg), *call_fusage);
+ = gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_USE (VOIDmode, reg), *call_fusage);
}
/* Add USE expressions to *CALL_FUSAGE for each of NREGS consecutive regs,
@@ -1982,7 +1992,7 @@ use_regs (call_fusage, regno, nregs)
abort ();
for (i = 0; i < nregs; i++)
- use_reg (call_fusage, gen_rtx (REG, reg_raw_mode[regno + i], regno + i));
+ use_reg (call_fusage, gen_rtx_REG (reg_raw_mode[regno + i], regno + i));
}
/* Add USE expressions to *CALL_FUSAGE for each REG contained in the
@@ -2103,7 +2113,7 @@ clear_by_pieces (to, len, align)
static void
clear_by_pieces_1 (genfun, mode, data)
- rtx (*genfun) ();
+ rtx (*genfun) PVPROTO((rtx, ...));
enum machine_mode mode;
struct clear_by_pieces *data;
{
@@ -2115,7 +2125,7 @@ clear_by_pieces_1 (genfun, mode, data)
if (data->reverse) data->offset -= size;
to1 = (data->autinc_to
- ? gen_rtx (MEM, mode, data->to_addr)
+ ? gen_rtx_MEM (mode, data->to_addr)
: copy_rtx (change_address (data->to, mode,
plus_constant (data->to_addr,
data->offset))));
@@ -2326,17 +2336,17 @@ emit_move_insn_1 (x, y)
regardless of machine's endianness. */
#ifdef STACK_GROWS_DOWNWARD
emit_insn (GEN_FCN (mov_optab->handlers[(int) submode].insn_code)
- (gen_rtx (MEM, submode, (XEXP (x, 0))),
+ (gen_rtx_MEM (submode, (XEXP (x, 0))),
gen_imagpart (submode, y)));
emit_insn (GEN_FCN (mov_optab->handlers[(int) submode].insn_code)
- (gen_rtx (MEM, submode, (XEXP (x, 0))),
+ (gen_rtx_MEM (submode, (XEXP (x, 0))),
gen_realpart (submode, y)));
#else
emit_insn (GEN_FCN (mov_optab->handlers[(int) submode].insn_code)
- (gen_rtx (MEM, submode, (XEXP (x, 0))),
+ (gen_rtx_MEM (submode, (XEXP (x, 0))),
gen_realpart (submode, y)));
emit_insn (GEN_FCN (mov_optab->handlers[(int) submode].insn_code)
- (gen_rtx (MEM, submode, (XEXP (x, 0))),
+ (gen_rtx_MEM (submode, (XEXP (x, 0))),
gen_imagpart (submode, y)));
#endif
}
@@ -2372,7 +2382,7 @@ emit_move_insn_1 (x, y)
/* Show the output dies here. */
if (x != y)
- emit_insn (gen_rtx (CLOBBER, VOIDmode, x));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, x));
for (i = 0;
i < (GET_MODE_SIZE (mode) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD;
@@ -2445,11 +2455,11 @@ push_block (size, extra, below)
temp = plus_constant (virtual_outgoing_args_rtx,
- INTVAL (size) - (below ? 0 : extra));
else if (extra != 0 && !below)
- temp = gen_rtx (PLUS, Pmode, virtual_outgoing_args_rtx,
- negate_rtx (Pmode, plus_constant (size, extra)));
+ temp = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx,
+ negate_rtx (Pmode, plus_constant (size, extra)));
else
- temp = gen_rtx (PLUS, Pmode, virtual_outgoing_args_rtx,
- negate_rtx (Pmode, size));
+ temp = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx,
+ negate_rtx (Pmode, size));
#endif
return memory_address (GET_CLASS_NARROWEST_MODE (MODE_INT), temp);
@@ -2471,9 +2481,9 @@ get_push_address (size)
register rtx temp;
if (STACK_PUSH_CODE == POST_DEC)
- temp = gen_rtx (PLUS, Pmode, stack_pointer_rtx, GEN_INT (size));
+ temp = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (size));
else if (STACK_PUSH_CODE == POST_INC)
- temp = gen_rtx (MINUS, Pmode, stack_pointer_rtx, GEN_INT (size));
+ temp = gen_rtx_MINUS (Pmode, stack_pointer_rtx, GEN_INT (size));
else
temp = stack_pointer_rtx;
@@ -2598,10 +2608,10 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
&& where_pad != none && where_pad != stack_direction)
anti_adjust_stack (GEN_INT (extra));
- move_by_pieces (gen_rtx (MEM, BLKmode, gen_push_operand ()), xinner,
+ move_by_pieces (gen_rtx_MEM (BLKmode, gen_push_operand ()), xinner,
INTVAL (size) - used, align);
- if (flag_check_memory_usage && ! in_check_memory_usage)
+ if (current_function_check_memory_usage && ! in_check_memory_usage)
{
rtx temp;
@@ -2654,10 +2664,11 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
skip + INTVAL (args_so_far)));
else
temp = memory_address (BLKmode,
- plus_constant (gen_rtx (PLUS, Pmode,
- args_addr, args_so_far),
+ plus_constant (gen_rtx_PLUS (Pmode,
+ args_addr,
+ args_so_far),
skip));
- if (flag_check_memory_usage && ! in_check_memory_usage)
+ if (current_function_check_memory_usage && ! in_check_memory_usage)
{
rtx target;
@@ -2682,7 +2693,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
&& (move_by_pieces_ninsns ((unsigned) INTVAL (size), align)
< MOVE_RATIO))
{
- move_by_pieces (gen_rtx (MEM, BLKmode, temp), xinner,
+ move_by_pieces (gen_rtx_MEM (BLKmode, temp), xinner,
INTVAL (size), align);
goto ret;
}
@@ -2690,7 +2701,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
{
rtx opalign = GEN_INT (align);
enum machine_mode mode;
- rtx target = gen_rtx (MEM, BLKmode, temp);
+ rtx target = gen_rtx_MEM (BLKmode, temp);
for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
mode != VOIDmode;
@@ -2850,14 +2861,14 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
plus_constant (args_addr,
INTVAL (args_so_far)));
else
- addr = memory_address (mode, gen_rtx (PLUS, Pmode, args_addr,
- args_so_far));
+ addr = memory_address (mode, gen_rtx_PLUS (Pmode, args_addr,
+ args_so_far));
target = addr;
}
- emit_move_insn (gen_rtx (MEM, mode, addr), x);
+ emit_move_insn (gen_rtx_MEM (mode, addr), x);
- if (flag_check_memory_usage && ! in_check_memory_usage)
+ if (current_function_check_memory_usage && ! in_check_memory_usage)
{
in_check_memory_usage = 1;
if (target == 0)
@@ -2978,9 +2989,11 @@ expand_assignment (to, from, want_value, suggest_reg)
if (GET_CODE (to_rtx) != MEM)
abort ();
to_rtx = change_address (to_rtx, VOIDmode,
- gen_rtx (PLUS, ptr_mode, XEXP (to_rtx, 0),
- force_reg (ptr_mode, offset_rtx)));
+ gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0),
+ force_reg (ptr_mode,
+ offset_rtx)));
}
+
if (volatilep)
{
if (GET_CODE (to_rtx) == MEM)
@@ -3011,7 +3024,7 @@ expand_assignment (to, from, want_value, suggest_reg)
}
/* Check the access. */
- if (flag_check_memory_usage && GET_CODE (to_rtx) == MEM)
+ if (current_function_check_memory_usage && GET_CODE (to_rtx) == MEM)
{
rtx to_addr;
int size;
@@ -3131,7 +3144,7 @@ expand_assignment (to, from, want_value, suggest_reg)
EXPAND_MEMORY_USE_DONT);
/* Copy the rights of the bitmap. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3,
XEXP (to_rtx, 0), ptr_mode,
XEXP (from_rtx, 0), ptr_mode,
@@ -3353,7 +3366,7 @@ store_expr (exp, target, want_value)
temp = convert_modes (GET_MODE (target), TYPE_MODE (TREE_TYPE (exp)),
temp, TREE_UNSIGNED (TREE_TYPE (exp)));
- if (flag_check_memory_usage
+ if (current_function_check_memory_usage
&& GET_CODE (target) == MEM
&& AGGREGATE_TYPE_P (TREE_TYPE (exp)))
{
@@ -3454,7 +3467,7 @@ store_expr (exp, target, want_value)
if (size != const0_rtx)
{
/* Be sure we can write on ADDR. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
addr, ptr_mode,
size, TYPE_MODE (sizetype),
@@ -3587,7 +3600,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
@@ -3596,11 +3609,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
@@ -3614,20 +3628,21 @@ 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,
+ store_field (target, bitsize, bitpos, mode, exp, VOIDmode, 0,
+ (align + BITS_PER_UNIT - 1) / BITS_PER_UNIT,
int_size_in_bytes (type));
}
/* 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 cleared;
@@ -3656,7 +3671,7 @@ store_constructor (exp, target, cleared)
/* Inform later passes that the whole union value is dead. */
if (TREE_CODE (type) == UNION_TYPE
|| TREE_CODE (type) == QUAL_UNION_TYPE)
- emit_insn (gen_rtx (CLOBBER, VOIDmode, target));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
/* If we are building a static constructor into a register,
set the initial value as zero so we can fold the value into
@@ -3680,13 +3695,13 @@ 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
/* Inform later passes that the old value is dead. */
- emit_insn (gen_rtx (CLOBBER, VOIDmode, target));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
/* Store each element of the constructor into
the corresponding field of TARGET. */
@@ -3745,9 +3760,11 @@ 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)));
+ gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0),
+ force_reg (ptr_mode,
+ offset_rtx)));
}
+
if (TREE_READONLY (field))
{
if (GET_CODE (to_rtx) == MEM)
@@ -3756,8 +3773,11 @@ store_constructor (exp, target, cleared)
RTX_UNCHANGING_P (to_rtx) = 1;
}
- store_constructor_field (to_rtx, bitsize, bitpos,
- mode, TREE_VALUE (elt), 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)
@@ -3817,12 +3837,12 @@ 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
/* Inform later passes that the old value is dead. */
- emit_insn (gen_rtx (CLOBBER, VOIDmode, target));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
/* Store each element of the constructor into
the corresponding element of TARGET, determined
@@ -3836,6 +3856,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;
@@ -3871,8 +3892,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
@@ -3908,10 +3929,10 @@ store_constructor (exp, target, cleared)
TYPE_MIN_VALUE (domain)),
position);
pos_rtx = expand_expr (position, 0, VOIDmode, 0);
- addr = gen_rtx (PLUS, Pmode, XEXP (target, 0), pos_rtx);
+ 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);
@@ -3928,7 +3949,7 @@ store_constructor (exp, target, cleared)
/* Needed by stupid register allocation. to extend the
lifetime of pseudo-regs used by target past the end
of the loop. */
- emit_insn (gen_rtx (USE, GET_MODE (target), target));
+ emit_insn (gen_rtx_USE (GET_MODE (target), target));
}
}
else if ((index != 0 && TREE_CODE (index) != INTEGER_CST)
@@ -3947,7 +3968,7 @@ store_constructor (exp, target, cleared)
size_int (BITS_PER_UNIT));
position = size_binop (MULT_EXPR, index, position);
pos_rtx = expand_expr (position, 0, VOIDmode, 0);
- addr = gen_rtx (PLUS, Pmode, XEXP (target, 0), pos_rtx);
+ addr = gen_rtx_PLUS (Pmode, XEXP (target, 0), pos_rtx);
xtarget = change_address (target, mode, addr);
store_expr (value, xtarget, 0);
}
@@ -3958,8 +3979,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);
}
}
}
@@ -4132,7 +4153,7 @@ store_constructor (exp, target, cleared)
else
#endif
{
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__setbits"),
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__setbits"),
0, VOIDmode, 4, XEXP (targetx, 0), Pmode,
bitlength_rtx, TYPE_MODE (sizetype),
startbit_rtx, TYPE_MODE (sizetype),
@@ -5036,8 +5057,9 @@ expand_expr (exp, target, tmode, modifier)
push_obstacks (p->function_obstack,
p->function_maybepermanent_obstack);
- p->forced_labels = gen_rtx (EXPR_LIST, VOIDmode,
- label_rtx (exp), p->forced_labels);
+ p->forced_labels
+ = gen_rtx_EXPR_LIST (VOIDmode, label_rtx (exp),
+ p->forced_labels);
p->addresses_labels = 1;
pop_obstacks ();
}
@@ -5045,12 +5067,12 @@ expand_expr (exp, target, tmode, modifier)
{
current_function_addresses_labels = 1;
if (modifier == EXPAND_INITIALIZER)
- forced_labels = gen_rtx (EXPR_LIST, VOIDmode,
- label_rtx (exp), forced_labels);
+ forced_labels
+ = gen_rtx_EXPR_LIST (VOIDmode, label_rtx (exp), forced_labels);
}
- temp = gen_rtx (MEM, FUNCTION_MODE,
- gen_rtx (LABEL_REF, Pmode, label_rtx (exp)));
+ temp = gen_rtx_MEM (FUNCTION_MODE,
+ gen_rtx_LABEL_REF (Pmode, label_rtx (exp)));
if (function != current_function_decl
&& function != inline_function_decl && function != 0)
LABEL_REF_NONLOCAL_P (XEXP (temp, 0)) = 1;
@@ -5079,13 +5101,16 @@ expand_expr (exp, target, tmode, modifier)
pop_obstacks ();
}
- /* Only check automatic variables. Currently, function arguments are
- not checked (this can be done at compile-time with prototypes).
- Aggregates are not checked. */
- if (flag_check_memory_usage && code == VAR_DECL
+ /* Although static-storage variables start off initialized, according to
+ ANSI C, a memcpy could overwrite them with uninitialized values. So
+ we check them too. This also lets us check for read-only variables
+ accessed via a non-const declaration, in case it won't be detected
+ any other way (e.g., in an embedded system or OS kernel without
+ memory protection).
+
+ Aggregates are not checked here; they're handled elsewhere. */
+ if (current_function_check_memory_usage && code == VAR_DECL
&& GET_CODE (DECL_RTL (exp)) == MEM
- && DECL_CONTEXT (exp) != NULL_TREE
- && ! TREE_STATIC (exp)
&& ! AGGREGATE_TYPE_P (TREE_TYPE (exp)))
{
enum memory_use_mode memory_usage;
@@ -5144,8 +5169,8 @@ expand_expr (exp, target, tmode, modifier)
abort ();
addr = XEXP (DECL_RTL (exp), 0);
if (GET_CODE (addr) == MEM)
- addr = gen_rtx (MEM, Pmode,
- fix_lexical_addr (XEXP (addr, 0), exp));
+ addr = gen_rtx_MEM (Pmode,
+ fix_lexical_addr (XEXP (addr, 0), exp));
else
addr = fix_lexical_addr (addr, exp);
temp = change_address (DECL_RTL (exp), mode, addr);
@@ -5199,7 +5224,7 @@ expand_expr (exp, target, tmode, modifier)
!= promote_mode (type, DECL_MODE (exp), &unsignedp, 0))
abort ();
- temp = gen_rtx (SUBREG, mode, DECL_RTL (exp), 0);
+ temp = gen_rtx_SUBREG (mode, DECL_RTL (exp), 0);
SUBREG_PROMOTED_VAR_P (temp) = 1;
SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp;
return temp;
@@ -5290,8 +5315,8 @@ expand_expr (exp, target, tmode, modifier)
SAVE_EXPR_RTL (exp) = temp;
if (!optimize && GET_CODE (temp) == REG)
- save_expr_regs = gen_rtx (EXPR_LIST, VOIDmode, temp,
- save_expr_regs);
+ save_expr_regs = gen_rtx_EXPR_LIST (VOIDmode, temp,
+ save_expr_regs);
/* If the mode of TEMP does not match that of the expression, it
must be a promoted value. We pass store_expr a SUBREG of the
@@ -5301,7 +5326,7 @@ expand_expr (exp, target, tmode, modifier)
if (GET_CODE (temp) == REG && GET_MODE (temp) != mode)
{
- temp = gen_rtx (SUBREG, mode, SAVE_EXPR_RTL (exp), 0);
+ temp = gen_rtx_SUBREG (mode, SAVE_EXPR_RTL (exp), 0);
SUBREG_PROMOTED_VAR_P (temp) = 1;
SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp;
}
@@ -5324,7 +5349,7 @@ expand_expr (exp, target, tmode, modifier)
{
/* Compute the signedness and make the proper SUBREG. */
promote_mode (type, mode, &unsignedp, 0);
- temp = gen_rtx (SUBREG, mode, SAVE_EXPR_RTL (exp), 0);
+ temp = gen_rtx_SUBREG (mode, SAVE_EXPR_RTL (exp), 0);
SUBREG_PROMOTED_VAR_P (temp) = 1;
SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp;
return temp;
@@ -5503,7 +5528,7 @@ expand_expr (exp, target, tmode, modifier)
&& (move_by_pieces_ninsns
(TREE_INT_CST_LOW (TYPE_SIZE (type))/BITS_PER_UNIT,
TYPE_ALIGN (type) / BITS_PER_UNIT)
- > MOVE_RATIO)
+ >= MOVE_RATIO)
&& ! mostly_zeros_p (exp))))
|| (modifier == EXPAND_INITIALIZER && TREE_CONSTANT (exp)))
{
@@ -5541,7 +5566,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;
}
@@ -5553,7 +5578,8 @@ expand_expr (exp, target, tmode, modifier)
op0 = expand_expr (exp1, NULL_RTX, VOIDmode, EXPAND_SUM);
op0 = memory_address (mode, op0);
- if (flag_check_memory_usage && !AGGREGATE_TYPE_P (TREE_TYPE (exp)))
+ if (current_function_check_memory_usage
+ && ! AGGREGATE_TYPE_P (TREE_TYPE (exp)))
{
enum memory_use_mode memory_usage;
memory_usage = get_memory_usage_from_modifier (modifier);
@@ -5571,7 +5597,7 @@ expand_expr (exp, target, tmode, modifier)
}
}
- temp = gen_rtx (MEM, mode, op0);
+ temp = gen_rtx_MEM (mode, op0);
/* If address was computed by addition,
mark this as an element of an aggregate. */
if (TREE_CODE (exp1) == PLUS_EXPR
@@ -5806,8 +5832,9 @@ expand_expr (exp, target, tmode, modifier)
if (GET_CODE (op0) != MEM)
abort ();
op0 = change_address (op0, VOIDmode,
- gen_rtx (PLUS, ptr_mode, XEXP (op0, 0),
- force_reg (ptr_mode, offset_rtx)));
+ gen_rtx_PLUS (ptr_mode, XEXP (op0, 0),
+ force_reg (ptr_mode,
+ offset_rtx)));
}
/* Don't forget about volatility even if this is a bitfield. */
@@ -5818,7 +5845,7 @@ expand_expr (exp, target, tmode, modifier)
}
/* Check the access. */
- if (flag_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);
@@ -5934,8 +5961,8 @@ expand_expr (exp, target, tmode, modifier)
/* Get a reference to just this component. */
if (modifier == EXPAND_CONST_ADDRESS
|| modifier == EXPAND_SUM || modifier == EXPAND_INITIALIZER)
- op0 = gen_rtx (MEM, mode1, plus_constant (XEXP (op0, 0),
- (bitpos / BITS_PER_UNIT)));
+ op0 = gen_rtx_MEM (mode1, plus_constant (XEXP (op0, 0),
+ (bitpos / BITS_PER_UNIT)));
else
op0 = change_address (op0, mode1,
plus_constant (XEXP (op0, 0),
@@ -6053,7 +6080,7 @@ expand_expr (exp, target, tmode, modifier)
/* Extract the bit we want to examine */
bit = expand_shift (RSHIFT_EXPR, byte_mode,
- gen_rtx (MEM, byte_mode, addr),
+ gen_rtx_MEM (byte_mode, addr),
make_tree (TREE_TYPE (index), rem),
NULL_RTX, 1);
result = expand_binop (byte_mode, and_optab, bit, const1_rtx,
@@ -6298,9 +6325,9 @@ expand_expr (exp, target, tmode, modifier)
op0 = temp;
/* Ensure that MULT comes first if there is one. */
else if (GET_CODE (op0) == MULT)
- op0 = gen_rtx (PLUS, mode, op0, XEXP (op1, 0));
+ op0 = gen_rtx_PLUS (mode, op0, XEXP (op1, 0));
else
- op0 = gen_rtx (PLUS, mode, XEXP (op1, 0), op0);
+ op0 = gen_rtx_PLUS (mode, XEXP (op1, 0), op0);
/* Let's also eliminate constants from op0 if possible. */
op0 = eliminate_constant_term (op0, &constant_term);
@@ -6314,7 +6341,7 @@ expand_expr (exp, target, tmode, modifier)
if (temp != 0)
op1 = temp;
else
- op1 = gen_rtx (PLUS, mode, constant_term, XEXP (op1, 1));
+ op1 = gen_rtx_PLUS (mode, constant_term, XEXP (op1, 1));
}
/* Put a constant term last and put a multiplication first. */
@@ -6322,7 +6349,7 @@ expand_expr (exp, target, tmode, modifier)
temp = op1, op1 = op0, op0 = temp;
temp = simplify_binary_operation (PLUS, mode, op0, op1);
- return temp ? temp : gen_rtx (PLUS, mode, op0, op1);
+ return temp ? temp : gen_rtx_PLUS (mode, op0, op1);
case MINUS_EXPR:
/* For initializers, we are allowed to return a MINUS of two
@@ -6344,7 +6371,7 @@ expand_expr (exp, target, tmode, modifier)
if (GET_CODE (op1) == CONST_INT)
return plus_constant (op0, - INTVAL (op1));
else
- return gen_rtx (MINUS, mode, op0, op1);
+ return gen_rtx_MINUS (mode, op0, op1);
}
/* Convert A - const to A + (-const). */
if (TREE_CODE (TREE_OPERAND (exp, 1)) == INTEGER_CST)
@@ -6401,18 +6428,22 @@ 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,
+ return
+ gen_rtx_MULT (mode, op0,
GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1))));
}
@@ -7287,10 +7318,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))),
@@ -7302,7 +7332,7 @@ expand_expr (exp, target, tmode, modifier)
}
else if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG
- || GET_CODE (op0) == CONCAT)
+ || GET_CODE (op0) == CONCAT || GET_CODE (op0) == ADDRESSOF)
{
/* If this object is in a register, it must be not
be BLKmode. */
@@ -7450,14 +7480,14 @@ expand_expr (exp, target, tmode, modifier)
case POPDCC_EXPR:
{
rtx dcc = get_dynamic_cleanup_chain ();
- emit_move_insn (dcc, validize_mem (gen_rtx (MEM, Pmode, dcc)));
+ emit_move_insn (dcc, validize_mem (gen_rtx_MEM (Pmode, dcc)));
return const0_rtx;
}
case POPDHC_EXPR:
{
rtx dhc = get_dynamic_handler_chain ();
- emit_move_insn (dhc, validize_mem (gen_rtx (MEM, Pmode, dhc)));
+ emit_move_insn (dhc, validize_mem (gen_rtx_MEM (Pmode, dhc)));
return const0_rtx;
}
@@ -8213,7 +8243,7 @@ expand_builtin_return_addr (fndecl_code, count, tem)
tem = DYNAMIC_CHAIN_ADDRESS (tem);
#endif
tem = memory_address (Pmode, tem);
- tem = copy_to_reg (gen_rtx (MEM, Pmode, tem));
+ tem = copy_to_reg (gen_rtx_MEM (Pmode, tem));
}
/* For __builtin_frame_address, return what we've got. */
@@ -8227,7 +8257,7 @@ expand_builtin_return_addr (fndecl_code, count, tem)
#else
tem = memory_address (Pmode,
plus_constant (tem, GET_MODE_SIZE (Pmode)));
- tem = gen_rtx (MEM, Pmode, tem);
+ tem = gen_rtx_MEM (Pmode, tem);
#endif
return tem;
}
@@ -8296,18 +8326,18 @@ expand_builtin_setjmp (buf_addr, target)
#define BUILTIN_SETJMP_FRAME_VALUE virtual_stack_vars_rtx
#endif
- emit_move_insn (gen_rtx (MEM, Pmode, buf_addr), BUILTIN_SETJMP_FRAME_VALUE);
+ emit_move_insn (gen_rtx_MEM (Pmode, buf_addr), BUILTIN_SETJMP_FRAME_VALUE);
emit_move_insn
- (validize_mem (gen_rtx (MEM, Pmode,
- plus_constant (buf_addr,
- GET_MODE_SIZE (Pmode)))),
- gen_rtx (LABEL_REF, Pmode, lab1));
+ (validize_mem (gen_rtx_MEM (Pmode,
+ plus_constant (buf_addr,
+ GET_MODE_SIZE (Pmode)))),
+ gen_rtx_LABEL_REF (Pmode, lab1));
- stack_save = gen_rtx (MEM, sa_mode,
- plus_constant (buf_addr,
- 2 * GET_MODE_SIZE (Pmode)));
+ stack_save = gen_rtx_MEM (sa_mode,
+ plus_constant (buf_addr,
+ 2 * GET_MODE_SIZE (Pmode)));
emit_stack_save (SAVE_NONLOCAL, &stack_save, NULL_RTX);
#ifdef HAVE_setjmp
@@ -8323,11 +8353,11 @@ expand_builtin_setjmp (buf_addr, target)
/* Note that setjmp clobbers FP when we get here, so we have to make
sure it's marked as used by this function. */
- emit_insn (gen_rtx (USE, VOIDmode, hard_frame_pointer_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
/* Mark the static chain as clobbered here so life information
doesn't get messed up for it. */
- emit_insn (gen_rtx (CLOBBER, VOIDmode, static_chain_rtx));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, static_chain_rtx));
/* Now put in the code to restore the frame pointer, and argument
pointer, if needed. The code below is from expand_end_bindings
@@ -8385,13 +8415,13 @@ expand_builtin_setjmp (buf_addr, target)
op0 = memory_address (FUNCTION_MODE, op0);
INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE,
- gen_rtx (SYMBOL_REF, Pmode, "__dummy"), 1);
+ gen_rtx_SYMBOL_REF (Pmode, "__dummy"), 1);
next_arg_reg = FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1);
#ifndef ACCUMULATE_OUTGOING_ARGS
#ifdef HAVE_call_pop
if (HAVE_call_pop)
- emit_call_insn (gen_call_pop (gen_rtx (MEM, FUNCTION_MODE, op0),
+ emit_call_insn (gen_call_pop (gen_rtx_MEM (FUNCTION_MODE, op0),
const0_rtx, next_arg_reg,
GEN_INT (return_pops)));
else
@@ -8400,7 +8430,7 @@ expand_builtin_setjmp (buf_addr, target)
#ifdef HAVE_call
if (HAVE_call)
- emit_call_insn (gen_call (gen_rtx (MEM, FUNCTION_MODE, op0),
+ emit_call_insn (gen_call (gen_rtx_MEM (FUNCTION_MODE, op0),
const0_rtx, next_arg_reg, const0_rtx));
else
#endif
@@ -8530,7 +8560,7 @@ expand_builtin (exp, target, subtarget, mode, ignore)
rtx errno_rtx = GEN_ERRNO_RTX;
#else
rtx errno_rtx
- = gen_rtx (MEM, word_mode, gen_rtx (SYMBOL_REF, Pmode, "errno"));
+ = gen_rtx_MEM (word_mode, gen_rtx_SYMBOL_REF (Pmode, "errno"));
#endif
emit_move_insn (errno_rtx, GEN_INT (TARGET_EDOM));
@@ -8830,11 +8860,45 @@ expand_builtin (exp, target, subtarget, mode, ignore)
{
tree arg = TREE_VALUE (arglist);
+ /* We return 1 for a numeric type that's known to be a constant
+ value at compile-time or for an aggregate type that's a
+ literal constant. */
STRIP_NOPS (arg);
- return (TREE_CODE_CLASS (TREE_CODE (arg)) == 'c'
- || (TREE_CODE (arg) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (arg, 0)) == STRING_CST)
- ? const1_rtx : const0_rtx);
+
+ /* If we know this is a constant, emit the constant of one. */
+ if (TREE_CODE_CLASS (TREE_CODE (arg)) == 'c'
+ || (TREE_CODE (arg) == CONSTRUCTOR
+ && TREE_CONSTANT (arg))
+ || (TREE_CODE (arg) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (arg, 0)) == STRING_CST))
+ return const1_rtx;
+
+ /* If we aren't going to be running CSE or this expression
+ has side effects, show we don't know it to be a constant.
+ Likewise if it's a pointer or aggregate type since in those
+ case we only want literals, since those are only optimized
+ when generating RTL, not later. */
+ else if (TREE_SIDE_EFFECTS (arg) || cse_not_expected
+ || AGGREGATE_TYPE_P (TREE_TYPE (arg))
+ || POINTER_TYPE_P (TREE_TYPE (arg)))
+ return const0_rtx;
+
+ /* Otherwise, emit (const (constant_p_rtx (ARG))) and let CSE
+ get a chance to see if it can deduce whether ARG is constant.
+ We always generate the CONST in ptr_mode since that's
+ certain to be valid on this machine, then convert it to
+ whatever we need. */
+ else
+ return
+ convert_to_mode
+ (mode,
+ gen_rtx_CONST
+ (ptr_mode,
+ gen_rtx_CONSTANT_P_RTX (ptr_mode,
+ expand_expr (arg, NULL_RTX,
+ VOIDmode, 0))),
+ 0);
+
}
case BUILT_IN_FRAME_ADDRESS:
@@ -8986,7 +9050,7 @@ expand_builtin (exp, target, subtarget, mode, ignore)
src_rtx = copy_to_mode_reg (Pmode, src_rtx);
/* Check the string is readable and has an end. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_check_str_libfunc, 1, VOIDmode, 2,
src_rtx, ptr_mode,
GEN_INT (MEMORY_USE_RO),
@@ -8998,7 +9062,7 @@ expand_builtin (exp, target, subtarget, mode, ignore)
char_rtx = copy_to_mode_reg (char_mode, char_rtx);
emit_insn (GEN_FCN (icode) (result,
- gen_rtx (MEM, BLKmode, src_rtx),
+ gen_rtx_MEM (BLKmode, src_rtx),
char_rtx, GEN_INT (align)));
/* Return the value in the proper mode for this function. */
@@ -9075,20 +9139,20 @@ expand_builtin (exp, target, subtarget, mode, ignore)
}
dest_rtx = expand_expr (dest, NULL_RTX, ptr_mode, EXPAND_SUM);
- dest_mem = gen_rtx (MEM, BLKmode,
- memory_address (BLKmode, dest_rtx));
+ dest_mem = gen_rtx_MEM (BLKmode,
+ memory_address (BLKmode, dest_rtx));
/* There could be a void* cast on top of the object. */
while (TREE_CODE (dest) == NOP_EXPR)
dest = TREE_OPERAND (dest, 0);
type = TREE_TYPE (TREE_TYPE (dest));
MEM_IN_STRUCT_P (dest_mem) = AGGREGATE_TYPE_P (type);
src_rtx = expand_expr (src, NULL_RTX, ptr_mode, EXPAND_SUM);
- src_mem = gen_rtx (MEM, BLKmode,
- memory_address (BLKmode, src_rtx));
+ src_mem = gen_rtx_MEM (BLKmode,
+ memory_address (BLKmode, src_rtx));
len_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0);
/* Just copy the rights of SRC to the rights of DEST. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3,
dest_rtx, ptr_mode,
src_rtx, ptr_mode,
@@ -9149,12 +9213,12 @@ expand_builtin (exp, target, subtarget, mode, ignore)
break;
dest_rtx = expand_expr (dest, NULL_RTX, ptr_mode, EXPAND_SUM);
- dest_mem = gen_rtx (MEM, BLKmode,
- memory_address (BLKmode, dest_rtx));
+ dest_mem = gen_rtx_MEM (BLKmode,
+ memory_address (BLKmode, dest_rtx));
len_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0);
/* Just check DST is writable and mark it as readable. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
dest_rtx, ptr_mode,
len_rtx, TYPE_MODE (sizetype),
@@ -9186,7 +9250,7 @@ expand_builtin (exp, target, subtarget, mode, ignore)
break;
/* If we need to check memory accesses, call the library function. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
break;
if (arglist == 0
@@ -9243,7 +9307,7 @@ expand_builtin (exp, target, subtarget, mode, ignore)
break;
/* If we need to check memory accesses, call the library function. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
break;
if (arglist == 0
@@ -9285,14 +9349,14 @@ expand_builtin (exp, target, subtarget, mode, ignore)
result = gen_reg_rtx (insn_mode);
emit_insn (gen_cmpstrsi (result,
- gen_rtx (MEM, BLKmode,
- expand_expr (arg1, NULL_RTX,
- ptr_mode,
- EXPAND_NORMAL)),
- gen_rtx (MEM, BLKmode,
- expand_expr (arg2, NULL_RTX,
- ptr_mode,
- EXPAND_NORMAL)),
+ gen_rtx_MEM (BLKmode,
+ expand_expr (arg1, NULL_RTX,
+ ptr_mode,
+ EXPAND_NORMAL)),
+ gen_rtx_MEM (BLKmode,
+ expand_expr (arg2, NULL_RTX,
+ ptr_mode,
+ EXPAND_NORMAL)),
expand_expr (len, NULL_RTX, VOIDmode, 0),
GEN_INT (MIN (arg1_align, arg2_align))));
@@ -9350,9 +9414,10 @@ expand_builtin (exp, target, subtarget, mode, ignore)
NULL_RTX,
VOIDmode, 0));
#endif
- rtx fp = gen_rtx (MEM, Pmode, buf_addr);
- rtx lab = gen_rtx (MEM, Pmode,
- plus_constant (buf_addr, GET_MODE_SIZE (Pmode)));
+ rtx fp = gen_rtx_MEM (Pmode, buf_addr);
+ rtx lab = gen_rtx_MEM (Pmode,
+ plus_constant (buf_addr,
+ GET_MODE_SIZE (Pmode)));
enum machine_mode sa_mode
= (
#ifdef HAVE_save_stack_nonlocal
@@ -9369,9 +9434,9 @@ expand_builtin (exp, target, subtarget, mode, ignore)
sa_mode = STACK_SAVEAREA_MODE (sa_mode, SAVE_NONLOCAL);
#endif
- stack = gen_rtx (MEM, sa_mode,
- plus_constant (buf_addr,
- 2 * GET_MODE_SIZE (Pmode)));
+ stack = gen_rtx_MEM (sa_mode,
+ plus_constant (buf_addr,
+ 2 * GET_MODE_SIZE (Pmode)));
DECL_EXTERNAL (dummy_decl) = 1;
TREE_PUBLIC (dummy_decl) = 1;
make_decl_rtl (dummy_decl, NULL_PTR, 1);
@@ -9399,9 +9464,9 @@ expand_builtin (exp, target, subtarget, mode, ignore)
/* Put in the static chain register the address of the dummy
function. */
emit_move_insn (static_chain_rtx, XEXP (DECL_RTL (dummy_decl), 0));
- emit_insn (gen_rtx (USE, VOIDmode, hard_frame_pointer_rtx));
- emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
- emit_insn (gen_rtx (USE, VOIDmode, static_chain_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, static_chain_rtx));
emit_indirect_jump (lab);
}
@@ -9632,15 +9697,15 @@ result_vector (savep, result)
align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT;
if (size % align != 0)
size = CEIL (size, align) * align;
- reg = gen_rtx (REG, mode, savep ? regno : INCOMING_REGNO (regno));
+ reg = gen_rtx_REG (mode, savep ? regno : INCOMING_REGNO (regno));
mem = change_address (result, mode,
plus_constant (XEXP (result, 0), size));
savevec[nelts++] = (savep
- ? gen_rtx (SET, VOIDmode, mem, reg)
- : gen_rtx (SET, VOIDmode, reg, mem));
+ ? gen_rtx_SET (VOIDmode, mem, reg)
+ : gen_rtx_SET (VOIDmode, reg, mem));
size += GET_MODE_SIZE (mode);
}
- return gen_rtx (PARALLEL, VOIDmode, gen_rtvec_v (nelts, savevec));
+ return gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (nelts, savevec));
}
#endif /* HAVE_untyped_call or HAVE_untyped_return */
@@ -9673,13 +9738,13 @@ expand_builtin_apply_args ()
if (size % align != 0)
size = CEIL (size, align) * align;
- tem = gen_rtx (REG, mode, INCOMING_REGNO (regno));
+ tem = gen_rtx_REG (mode, INCOMING_REGNO (regno));
#ifdef STACK_REGS
/* For reg-stack.c's stack register household.
Compare with a similar piece of code in function.c. */
- emit_insn (gen_rtx (USE, mode, tem));
+ emit_insn (gen_rtx_USE (mode, tem));
#endif
emit_move_insn (change_address (registers, mode,
@@ -9730,7 +9795,7 @@ expand_builtin_apply (function, arguments, argsize)
/* Fetch the arg pointer from the ARGUMENTS block. */
incoming_args = gen_reg_rtx (Pmode);
emit_move_insn (incoming_args,
- gen_rtx (MEM, Pmode, arguments));
+ gen_rtx_MEM (Pmode, arguments));
#ifndef STACK_GROWS_DOWNWARD
incoming_args = expand_binop (Pmode, sub_optab, incoming_args, argsize,
incoming_args, 0, OPTAB_LIB_WIDEN);
@@ -9756,14 +9821,14 @@ expand_builtin_apply (function, arguments, argsize)
but it's likely that the source and/or destination addresses in
the block copy will need updating in machine specific ways. */
dest = allocate_dynamic_stack_space (argsize, 0, 0);
- emit_block_move (gen_rtx (MEM, BLKmode, dest),
- gen_rtx (MEM, BLKmode, incoming_args),
+ emit_block_move (gen_rtx_MEM (BLKmode, dest),
+ gen_rtx_MEM (BLKmode, incoming_args),
argsize,
PARM_BOUNDARY / BITS_PER_UNIT);
/* Refer to the argument block. */
apply_args_size ();
- arguments = gen_rtx (MEM, BLKmode, arguments);
+ arguments = gen_rtx_MEM (BLKmode, arguments);
/* Walk past the arg-pointer and structure value address. */
size = GET_MODE_SIZE (Pmode);
@@ -9778,7 +9843,7 @@ expand_builtin_apply (function, arguments, argsize)
align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT;
if (size % align != 0)
size = CEIL (size, align) * align;
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
emit_move_insn (reg,
change_address (arguments, mode,
plus_constant (XEXP (arguments, 0),
@@ -9816,7 +9881,7 @@ expand_builtin_apply (function, arguments, argsize)
/* Generate the actual call instruction and save the return value. */
#ifdef HAVE_untyped_call
if (HAVE_untyped_call)
- emit_call_insn (gen_untyped_call (gen_rtx (MEM, FUNCTION_MODE, function),
+ emit_call_insn (gen_untyped_call (gen_rtx_MEM (FUNCTION_MODE, function),
result, result_vector (1, result)));
else
#endif
@@ -9834,11 +9899,11 @@ expand_builtin_apply (function, arguments, argsize)
{
if (valreg)
abort (); /* HAVE_untyped_call required. */
- valreg = gen_rtx (REG, mode, regno);
+ valreg = gen_rtx_REG (mode, regno);
}
emit_call_insn (gen_call_value (valreg,
- gen_rtx (MEM, FUNCTION_MODE, function),
+ gen_rtx_MEM (FUNCTION_MODE, function),
const0_rtx, NULL_RTX, const0_rtx));
emit_move_insn (change_address (result, GET_MODE (valreg),
@@ -9897,7 +9962,7 @@ expand_builtin_return (result)
rtx call_fusage = 0;
apply_result_size ();
- result = gen_rtx (MEM, BLKmode, result);
+ result = gen_rtx_MEM (BLKmode, result);
#ifdef HAVE_untyped_return
if (HAVE_untyped_return)
@@ -9916,14 +9981,14 @@ expand_builtin_return (result)
align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT;
if (size % align != 0)
size = CEIL (size, align) * align;
- reg = gen_rtx (REG, mode, INCOMING_REGNO (regno));
+ reg = gen_rtx_REG (mode, INCOMING_REGNO (regno));
emit_move_insn (reg,
change_address (result, mode,
plus_constant (XEXP (result, 0),
size)));
push_to_sequence (call_fusage);
- emit_insn (gen_rtx (USE, VOIDmode, reg));
+ emit_insn (gen_rtx_USE (VOIDmode, reg));
call_fusage = get_insns ();
end_sequence ();
size += GET_MODE_SIZE (mode);
@@ -10137,7 +10202,7 @@ expand_increment (exp, post, ignore)
/* Increment however we can. */
op1 = expand_binop (mode, this_optab, value, op1,
- flag_check_memory_usage ? NULL_RTX : op0,
+ current_function_check_memory_usage ? NULL_RTX : op0,
TREE_UNSIGNED (TREE_TYPE (exp)), OPTAB_LIB_WIDEN);
/* Make sure the value is stored into OP0. */
if (op1 != op0)
@@ -11408,10 +11473,12 @@ do_tablejump (index, mode, range, table_label, default_label)
GET_MODE_SIZE, because this indicates how large insns are. The other
uses should all be Pmode, because they are addresses. This code
could fail if addresses and insns are not the same size. */
- index = gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode, index,
- GEN_INT (GET_MODE_SIZE (CASE_VECTOR_MODE))),
- gen_rtx (LABEL_REF, Pmode, table_label));
+ index
+ = gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode, index,
+ GEN_INT (GET_MODE_SIZE (CASE_VECTOR_MODE))),
+ gen_rtx_LABEL_REF (Pmode, table_label));
+
#ifdef PIC_CASE_VECTOR_ADDRESS
if (flag_pic)
index = PIC_CASE_VECTOR_ADDRESS (index);
@@ -11419,7 +11486,7 @@ do_tablejump (index, mode, range, table_label, default_label)
#endif
index = memory_address_noforce (CASE_VECTOR_MODE, index);
temp = gen_reg_rtx (CASE_VECTOR_MODE);
- vector = gen_rtx (MEM, CASE_VECTOR_MODE, index);
+ vector = gen_rtx_MEM (CASE_VECTOR_MODE, index);
RTX_UNCHANGING_P (vector) = 1;
convert_move (temp, vector, 0);
diff --git a/gcc/expr.h b/gcc/expr.h
index c150e6b0f7f..2257570e8eb 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -90,6 +90,10 @@ extern int current_function_uses_pic_offset_table;
/* The arg pointer hard register, or the pseudo into which it was copied. */
extern rtx current_function_internal_arg_pointer;
+/* This is nonzero if memory access checking is to be enabled in the current
+ function. */
+extern int current_function_check_memory_usage;
+
/* Nonzero means stack pops must not be deferred, and deferred stack
pops must not be output. It is nonzero inside a function call,
inside a conditional expression, inside a statement expression,
@@ -324,7 +328,7 @@ typedef struct optab
#define GEN_FCN(CODE) (*insn_gen_function[(int) (CODE)])
#endif
-extern rtx (*const insn_gen_function[]) ();
+extern rtx (*const insn_gen_function[]) PVPROTO((rtx, ...));
extern optab add_optab;
extern optab sub_optab;
@@ -516,7 +520,7 @@ extern rtx chkr_copy_bitmap_libfunc;
extern rtx chkr_check_exec_libfunc;
extern rtx chkr_check_str_libfunc;
-typedef rtx (*rtxfun) ();
+typedef rtx (*rtxfun) PROTO((rtx));
/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
gives the gen_function to make a branch to test that condition. */
@@ -604,6 +608,7 @@ rtx emit_conditional_move PROTO((rtx, enum rtx_code, rtx, rtx,
/* Return non-zero if the conditional move is supported. */
int can_conditionally_move_p PROTO((enum machine_mode mode));
+
#endif
/* Create but don't emit one rtl instruction to add one rtx into another.
@@ -723,7 +728,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. */
@@ -938,7 +943,9 @@ extern rtx assemble_static_space PROTO((int));
/* Hook called by expand_expr for language-specific tree codes.
It is up to the language front end to install a hook
if it has any such codes that expand_expr needs to know about. */
-extern rtx (*lang_expand_expr) ();
+extern rtx (*lang_expand_expr) PROTO((union tree_node *, rtx,
+ enum machine_mode,
+ enum expand_modifier modifier));
#ifdef TREE_CODE
/* Build bytecode call descriptor for function SUBR. */
@@ -949,3 +956,10 @@ extern rtx bc_build_calldesc PROTO((tree));
plus the minimal alignment shifted left 8 bits. */
extern tree bc_runtime_type_code PROTO((tree));
#endif
+
+extern void init_all_optabs PROTO((void));
+extern void init_mov_optab PROTO((void));
+extern void bc_adjust_stack PROTO((int));
+extern void bc_load_localaddr PROTO((rtx));
+extern void do_jump_by_parts_greater_rtx PROTO((enum machine_mode, int,
+ rtx, rtx, rtx, rtx));
diff --git a/gcc/extend.texi b/gcc/extend.texi
index 7625f310952..138bb8699b1 100644
--- a/gcc/extend.texi
+++ b/gcc/extend.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 1988,89,92,93,94,96 Free Software Foundation, Inc.
+@c Copyright (C) 1988, 89, 92, 93, 94, 96, 1998 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -33,6 +33,7 @@ C++ Language}, for extensions that apply @emph{only} to C++.
* Conditionals:: Omitting the middle operand of a @samp{?:} expression.
* Long Long:: Double-word integers---@code{long long int}.
* Complex:: Data types for complex numbers.
+* Hex Floats:: Hexadecimal floating-point constants.
* Zero Length:: Zero-length arrays.
* Variable Length:: Arrays whose length is computed at run time.
* Macro Varargs:: Macros with variable number of arguments.
@@ -63,6 +64,7 @@ C++ Language}, for extensions that apply @emph{only} to C++.
* Function Names:: Printable strings which are the name of the current
function.
* Return Address:: Getting the return or frame address of a function.
+* Other Builtins:: Other built-in functions.
@end menu
@end ifset
@ifclear INTERNALS
@@ -78,6 +80,7 @@ C++ Language}, for extensions that apply @emph{only} to C++.
* Conditionals:: Omitting the middle operand of a @samp{?:} expression.
* Long Long:: Double-word integers---@code{long long int}.
* Complex:: Data types for complex numbers.
+* Hex Floats:: Hexadecimal floating-point constants.
* Zero Length:: Zero-length arrays.
* Variable Length:: Arrays whose length is computed at run time.
* Macro Varargs:: Macros with variable number of arguments.
@@ -109,6 +112,7 @@ C++ Language}, for extensions that apply @emph{only} to C++.
* Function Names:: Printable strings which are the name of the current
function.
* Return Address:: Getting the return or frame address of a function.
+* Other Builtins:: Other built-in functions.
@end menu
@end ifclear
@@ -790,6 +794,19 @@ examine and set these two fictitious variables with your debugger.
A future version of GDB will know how to recognize such pairs and treat
them as a single variable with a complex type.
+@node Hex Floats
+@section Hex Floats
+@cindex hex floats
+
+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
+mandatory. The exponent is a decimal number that indicates the power of
+2 by which the significand part will be multiplied. Thus @code{0x1.f} is
+1 15/16, @code{p3} multiplies it by 8, and the value of @code{0x1.fp3}
+is the same as @code{1.55e1}.
+
@node Zero Length
@section Arrays of Length Zero
@cindex arrays of length zero
@@ -1510,6 +1527,22 @@ mangled name for the target must be used.
Not all target machines support this attribute.
+@item no_check_memory_usage
+@cindex @code{no_check_memory_usage} function attribute
+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 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
On the Intel 386, the @code{regparm} attribute causes the compiler to
@@ -2380,6 +2413,16 @@ asm volatile ("movc3 %0,%1,%2"
: "r0", "r1", "r2", "r3", "r4", "r5");
@end example
+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
tell the compiler the register's value is modified. In some assemblers,
@@ -2846,6 +2889,7 @@ These functions may be used to get information about the callers of a
function.
@table @code
+@findex __builtin_return_address
@item __builtin_return_address (@var{level})
This function returns the return address of the current function, or of
one of its callers. The @var{level} argument is number of frames to
@@ -2862,6 +2906,7 @@ of the stack has been reached, this function will return @code{0}.
This function should only be used with a non-zero argument for debugging
purposes.
+@findex __builtin_frame_address
@item __builtin_frame_address (@var{level})
This function is similar to @code{__builtin_return_address}, but it
returns the address of the function frame rather than the return address
@@ -2882,6 +2927,56 @@ The caveats that apply to @code{__builtin_return_address} apply to this
function as well.
@end table
+@node Other Builtins
+@section Other built-in functions provided by GNU CC
+
+GNU CC provides a large number of built-in functions other than the ones
+mentioned above. Some of these are for internal use in the processing
+of exceptions or variable-length argument lists and will not be
+documented here because they may change from time to time; we do not
+recommend general use of these functions.
+
+The remaining functions are provided for optimization purposes.
+
+GNU CC includes builtin versions of many of the functions in the
+standard C library. These will always be treated as having the same
+meaning as the C library function even if you specify the
+@samp{-fno-builtin} (@pxref{C Dialect Options}) option. These functions
+correspond to the C library functions @code{alloca}, @code{ffs},
+@code{abs}, @code{fabsf}, @code{fabs}, @code{fabsl}, @code{labs},
+@code{memcpy}, @code{memcmp}, @code{strcmp}, @code{strcpy},
+@code{strlen}, @code{sqrtf}, @code{sqrt}, @code{sqrtl}, @code{sinf},
+@code{sin}, @code{sinl}, @code{cosf}, @code{cos}, and @code{cosl}.
+
+@findex __builtin_constant_p
+You can use the builtin function @code{__builtin_constant_p} to
+determine if a value is known to be constant at compile-time and hence
+that GNU CC can perform constant-folding on expressions involving that
+value. The argument of the function is the value to test. The function
+returns the integer 1 if the argument is known to be a compile-time
+constant and 0 if it is not known to be a compile-time constant. A
+return of 0 does not indicate that the value is @emph{not} a constant,
+but merely that GNU CC cannot prove it is a constant with the specified
+value of the @samp{-O} option.
+
+You would typically use this function in an embedded application where
+memory was a critical resource. If you have some complex calculation,
+you may want it to be folded if it involves constants, but need to call
+a function if it does not. For example:
+
+@smallexample
+#define Scale_Value(X) \
+ (__builtin_constant_p (X) ? ((X) * SCALE + OFFSET) : Scale (X))
+@end smallexample
+
+You may use this builtin function in either a macro or an inline
+function. However, if you use it in an inlined function and pass an
+argument of the function as the argument to the builtin, GNU CC will
+never return 1 when you call the inline function with a string constant
+or constructor expression (@pxref{Constructors}) and will not return 1
+when you pass a constant numeric value to the inline function unless you
+specify the @samp{-O} option.
+
@node C++ Extensions
@chapter Extensions to the C++ Language
@cindex extensions, C++ language
diff --git a/gcc/final.c b/gcc/final.c
index d3578bed5f4..0bf34b3faa0 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -45,13 +45,7 @@ Boston, MA 02111-1307, USA. */
FUNCTION_EPILOGUE. Those instructions never exist as rtl. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include <stdio.h>
-
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "regs.h"
@@ -369,11 +363,11 @@ end_final (filename)
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
- assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), pointer_bytes, 1);
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
/* address of count table */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2);
- assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), pointer_bytes, 1);
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
/* count of the # of basic blocks or # of instrumented arcs */
if (profile_block_flag)
@@ -389,7 +383,7 @@ end_final (filename)
if (profile_block_flag)
{
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3);
- assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), pointer_bytes,
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes,
1);
}
else
@@ -402,7 +396,7 @@ end_final (filename)
if (profile_block_flag)
{
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 4);
- assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), pointer_bytes,
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes,
1);
}
else
@@ -412,9 +406,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
{
@@ -499,7 +495,7 @@ end_final (filename)
for (i = 0; i < count_basic_blocks; i++)
{
ASM_GENERATE_INTERNAL_LABEL (name, "LPB", i);
- assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name),
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
pointer_bytes, 1);
}
}
@@ -514,7 +510,7 @@ end_final (filename)
{
ASM_GENERATE_INTERNAL_LABEL (name, "LPBC",
ptr->func_label_num);
- assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name),
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
pointer_bytes, 1);
}
else
@@ -543,7 +539,7 @@ end_final (filename)
{
ASM_GENERATE_INTERNAL_LABEL (name, "LPBC",
ptr->file_label_num);
- assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name),
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
pointer_bytes, 1);
}
else
@@ -559,7 +555,7 @@ end_final (filename)
if (profile_block_flag)
{
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3);
- assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), pointer_bytes,
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes,
1);
}
}
@@ -2901,7 +2897,7 @@ output_addr_const (file, x)
void
asm_fprintf VPROTO((FILE *file, char *p, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
FILE *file;
char *p;
#endif
@@ -2912,7 +2908,7 @@ asm_fprintf VPROTO((FILE *file, char *p, ...))
VA_START (argptr, p);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
file = va_arg (argptr, FILE *);
p = va_arg (argptr, char *);
#endif
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index 32ab31c7188..d998114d3e0 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -1,5 +1,5 @@
/* fix-header.c - Make C header file suitable for C++.
- Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 1998 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
@@ -70,18 +70,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
Written by Per Bothner <bothner@cygnus.com>, July 1993. */
-#include <stdio.h>
-#include <ctype.h>
#include "hconfig.h"
+#include "system.h"
#include "obstack.h"
#include "scan.h"
#include "cpplib.h"
#include "gansidecl.h"
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
extern void cpp_fatal ();
#if !__STDC__ && !defined(const)
diff --git a/gcc/flow.c b/gcc/flow.c
index 62713d9b7e0..35e1285c2e5 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -109,7 +109,7 @@ Boston, MA 02111-1307, USA. */
reg_n_calls_crosses and reg_basic_block. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "basic-block.h"
#include "insn-config.h"
@@ -118,8 +118,8 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "output.h"
#include "except.h"
-
#include "obstack.h"
+
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
@@ -444,8 +444,8 @@ find_basic_blocks (f, nonlocal_label_list)
/* Make a list of all labels referred to other than by jumps. */
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
if (REG_NOTE_KIND (note) == REG_LABEL)
- label_value_list = gen_rtx (EXPR_LIST, VOIDmode, XEXP (note, 0),
- label_value_list);
+ label_value_list = gen_rtx_EXPR_LIST (VOIDmode, XEXP (note, 0),
+ label_value_list);
}
BLOCK_NUM (insn) = i;
@@ -512,11 +512,11 @@ find_basic_blocks (f, nonlocal_label_list)
}
for (x = label_value_list; x; x = XEXP (x, 1))
- mark_label_ref (gen_rtx (LABEL_REF, VOIDmode, XEXP (x, 0)),
+ mark_label_ref (gen_rtx_LABEL_REF (VOIDmode, XEXP (x, 0)),
insn, 0);
for (x = forced_labels; x; x = XEXP (x, 1))
- mark_label_ref (gen_rtx (LABEL_REF, VOIDmode, XEXP (x, 0)),
+ mark_label_ref (gen_rtx_LABEL_REF (VOIDmode, XEXP (x, 0)),
insn, 0);
}
@@ -528,7 +528,7 @@ find_basic_blocks (f, nonlocal_label_list)
&& ! find_reg_note (insn, REG_RETVAL, NULL_RTX))
{
for (x = nonlocal_label_list; x; x = XEXP (x, 1))
- mark_label_ref (gen_rtx (LABEL_REF, VOIDmode, XEXP (x, 0)),
+ mark_label_ref (gen_rtx_LABEL_REF (VOIDmode, XEXP (x, 0)),
insn, 0);
/* ??? This could be made smarter:
@@ -1544,7 +1544,7 @@ propagate_block (old, first, last, final, significant, bnum)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (global_regs[i])
mark_used_regs (old, live,
- gen_rtx (REG, reg_raw_mode[i], i),
+ gen_rtx_REG (reg_raw_mode[i], i),
final, insn);
/* Calls also clobber memory. */
@@ -1996,7 +1996,7 @@ mark_set_1 (needed, dead, x, insn, significant)
&& (regno >= FIRST_PSEUDO_REGISTER
|| asm_noperands (PATTERN (y)) < 0))
LOG_LINKS (y)
- = gen_rtx (INSN_LIST, VOIDmode, insn, LOG_LINKS (y));
+ = gen_rtx_INSN_LIST (VOIDmode, insn, LOG_LINKS (y));
}
else if (! some_needed)
{
@@ -2005,7 +2005,7 @@ mark_set_1 (needed, dead, x, insn, significant)
be eliminated (because the same insn does something useful).
Indicate this by marking the reg being set as dying here. */
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_UNUSED, reg, REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST (REG_UNUSED, reg, REG_NOTES (insn));
REG_N_DEATHS (REGNO (reg))++;
}
else
@@ -2022,10 +2022,10 @@ mark_set_1 (needed, dead, x, insn, significant)
i >= 0; i--)
if (!REGNO_REG_SET_P (needed, regno + i))
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_UNUSED,
- gen_rtx (REG, reg_raw_mode[regno + i],
- regno + i),
- REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST (REG_UNUSED,
+ gen_rtx_REG (reg_raw_mode[regno + i],
+ regno + i),
+ REG_NOTES (insn));
}
}
}
@@ -2037,7 +2037,7 @@ mark_set_1 (needed, dead, x, insn, significant)
else if (GET_CODE (reg) == SCRATCH && insn != 0)
{
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_UNUSED, reg, REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST (REG_UNUSED, reg, REG_NOTES (insn));
num_scratch++;
}
}
@@ -2199,7 +2199,7 @@ find_auto_inc (needed, x, insn)
has an implicit side effect. */
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_INC, addr, REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST (REG_INC, addr, REG_NOTES (insn));
/* Modify the old increment-insn to simply copy
the already-incremented value of our register. */
@@ -2438,7 +2438,7 @@ mark_used_regs (needed, live, x, final, insn)
if (! some_needed)
{
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_DEAD, x, REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST (REG_DEAD, x, REG_NOTES (insn));
REG_N_DEATHS (regno)++;
}
else
@@ -2453,10 +2453,10 @@ mark_used_regs (needed, live, x, final, insn)
if (!REGNO_REG_SET_P (needed, regno + i)
&& ! dead_or_set_regno_p (insn, regno + i))
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_DEAD,
- gen_rtx (REG, reg_raw_mode[regno + i],
- regno + i),
- REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST
+ (REG_DEAD,
+ gen_rtx_REG (reg_raw_mode[regno + i], regno + i),
+ REG_NOTES (insn));
}
}
}
@@ -2706,7 +2706,7 @@ try_pre_increment (insn, reg, amount)
return 0;
/* Record that this insn now has an implicit side effect on X. */
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_INC, reg, REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_INC, reg, REG_NOTES (insn));
return 1;
}
@@ -2963,4 +2963,12 @@ print_rtl_with_bb (outf, rtx_first)
}
}
}
+
+ 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 7e648e30cdd..4d01b7b431d 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */
forces the value to fit the type. It returns an overflow indicator. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include <setjmp.h>
#include "flags.h"
#include "tree.h"
@@ -93,6 +93,7 @@ static tree unextend PROTO((tree, int, int, tree));
static tree fold_truthop PROTO((enum tree_code, tree, tree, tree));
static tree strip_compound_expr PROTO((tree, tree));
static int count_cond PROTO((tree, int));
+static int multiple_of_p PROTO((tree, tree, tree));
#ifndef BRANCH_COST
#define BRANCH_COST 1
@@ -961,6 +962,235 @@ fail:
*r = y.d;
return 1;
}
+
+
+/* Convert C9X hexadecimal floating point string constant S. Return
+ real value type in mode MODE. This function uses the host computer's
+ fp arithmetic when there is no REAL_ARITHMETIC. */
+
+REAL_VALUE_TYPE
+real_hex_to_f (s, mode)
+ char *s;
+ enum machine_mode mode;
+{
+ REAL_VALUE_TYPE ip;
+ char *p = s;
+ unsigned HOST_WIDE_INT low, high;
+ int frexpon, expon, shcount, nrmcount, k;
+ int sign, expsign, decpt, isfloat, isldouble, gotp, lost;
+ char c;
+
+ isldouble = 0;
+ isfloat = 0;
+ frexpon = 0;
+ expon = 0;
+ expsign = 1;
+ ip = 0.0;
+
+ while (*p == ' ' || *p == '\t')
+ ++p;
+
+ /* Sign, if any, comes first. */
+ sign = 1;
+ if (*p == '-')
+ {
+ sign = -1;
+ ++p;
+ }
+
+ /* The string is supposed to start with 0x or 0X . */
+ if (*p == '0')
+ {
+ ++p;
+ if (*p == 'x' || *p == 'X')
+ ++p;
+ else
+ abort ();
+ }
+ else
+ abort ();
+
+ while (*p == '0')
+ ++p;
+
+ high = 0;
+ low = 0;
+ lost = 0; /* Nonzero low order bits shifted out and discarded. */
+ frexpon = 0; /* Bits after the decimal point. */
+ expon = 0; /* Value of exponent. */
+ decpt = 0; /* How many decimal points. */
+ gotp = 0; /* How many P's. */
+ shcount = 0;
+ while ((c = *p) != '\0')
+ {
+ if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')
+ || (c >= 'a' && c <= 'f'))
+ {
+ k = c & 0x7f;
+ if (k >= 'a')
+ k = k - 'a' + 10;
+ else if (k >= 'A')
+ k = k - 'A' + 10;
+ else
+ k = k - '0';
+
+ if ((high & 0xf0000000) == 0)
+ {
+ high = (high << 4) + ((low >> 28) & 15);
+ low = (low << 4) + k;
+ shcount += 4;
+ if (decpt)
+ frexpon += 4;
+ }
+ else
+ {
+ /* Record nonzero lost bits. */
+ lost |= k;
+ if (!decpt)
+ frexpon -= 4;
+ }
+ ++p;
+ }
+ else if ( c == '.')
+ {
+ ++decpt;
+ ++p;
+ }
+ else if (c == 'p' || c == 'P')
+ {
+ ++gotp;
+ ++p;
+ /* Sign of exponent. */
+ if (*p == '-')
+ {
+ expsign = -1;
+ ++p;
+ }
+ /* Value of exponent.
+ The exponent field is a decimal integer. */
+ while (isdigit(*p))
+ {
+ k = (*p++ & 0x7f) - '0';
+ expon = 10 * expon + k;
+ }
+ expon *= expsign;
+ /* F suffix is ambiguous in the significand part
+ so it must appear after the decimal exponent field. */
+ if (*p == 'f' || *p == 'F')
+ {
+ isfloat = 1;
+ ++p;
+ break;
+ }
+ }
+ else if (c == 'l' || c == 'L')
+ {
+ isldouble = 1;
+ ++p;
+ break;
+ }
+ else
+ break;
+ }
+ /* Abort if last character read was not legitimate. */
+ c = *p;
+ if ((c != '\0' && c != ' ' && c != '\n' && c != '\r') || (decpt > 1))
+ abort ();
+ /* There must be either one decimal point or one p. */
+ if (decpt == 0 && gotp == 0)
+ abort ();
+ shcount -= 4;
+ if ((high == 0) && (low == 0))
+ {
+ return dconst0;
+ }
+
+ /* Normalize. */
+ nrmcount = 0;
+ if (high == 0)
+ {
+ high = low;
+ low = 0;
+ nrmcount += 32;
+ }
+ /* Leave a high guard bit for carry-out. */
+ if ((high & 0x80000000) != 0)
+ {
+ lost |= low & 1;
+ low = (low >> 1) | (high << 31);
+ high = high >> 1;
+ nrmcount -= 1;
+ }
+ if ((high & 0xffff8000) == 0)
+ {
+ high = (high << 16) + ((low >> 16) & 0xffff);
+ low = low << 16;
+ nrmcount += 16;
+ }
+ while ((high & 0xc0000000) == 0)
+ {
+ high = (high << 1) + ((low >> 31) & 1);
+ low = low << 1;
+ nrmcount += 1;
+ }
+ if (isfloat || GET_MODE_SIZE(mode) == UNITS_PER_WORD)
+ {
+ /* Keep 24 bits precision, bits 0x7fffff80.
+ Rounding bit is 0x40. */
+ lost = lost | low | (high & 0x3f);
+ low = 0;
+ if (high & 0x40)
+ {
+ if ((high & 0x80) || lost)
+ high += 0x40;
+ }
+ high &= 0xffffff80;
+ }
+ else
+ {
+ /* We need real.c to do long double formats, so here default
+ to double precision. */
+#if HOST_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
+ /* IEEE double.
+ Keep 53 bits precision, bits 0x7fffffff fffffc00.
+ Rounding bit is low word 0x200. */
+ lost = lost | (low & 0x1ff);
+ if (low & 0x200)
+ {
+ if ((low & 0x400) || lost)
+ {
+ low = (low + 0x200) & 0xfffffc00;
+ if (low == 0)
+ high += 1;
+ }
+ }
+ low &= 0xfffffc00;
+#else
+ /* Assume it's a VAX with 56-bit significand,
+ bits 0x7fffffff ffffff80. */
+ lost = lost | (low & 0x7f);
+ if (low & 0x40)
+ {
+ if ((low & 0x80) || lost)
+ {
+ low = (low + 0x40) & 0xffffff80;
+ if (low == 0)
+ high += 1;
+ }
+ }
+ low &= 0xffffff80;
+#endif
+ }
+ ip = (double) high;
+ ip = REAL_VALUE_LDEXP (ip, 32) + (double) low;
+ /* Apply shifts and exponent value as power of 2. */
+ ip = REAL_VALUE_LDEXP (ip, expon - (nrmcount + frexpon));
+
+ if (sign < 0)
+ ip = -ip;
+ return ip;
+}
+
#endif /* no REAL_ARITHMETIC */
/* Split a tree IN into a constant and a variable part
@@ -3224,7 +3454,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);
@@ -3902,7 +4132,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;
@@ -3937,7 +4167,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)))
@@ -3977,7 +4207,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;
@@ -3998,7 +4228,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)))
@@ -4543,7 +4773,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);
@@ -4712,6 +4942,17 @@ fold (expr)
if (integer_zerop (arg1))
return t;
+ /* If arg0 is a multiple of arg1, rewrite to the fastest div operation,
+ EXACT_DIV_EXPR.
+
+ ??? Note that only CEIL_DIV_EXPR is rewritten now, only because the
+ others seem to be faster in some cases. This is probably just due
+ to more work being done to optimize others in expmed.c than on
+ EXACT_DIV_EXPR. */
+ if (code == CEIL_DIV_EXPR
+ && multiple_of_p (type, arg0, arg1))
+ return fold (build (EXACT_DIV_EXPR, type, arg0, arg1));
+
/* If we have ((a / C1) / C2) where both division are the same type, try
to simplify. First see if C1 * C2 overflows or not. */
if (TREE_CODE (arg0) == code && TREE_CODE (arg1) == INTEGER_CST
@@ -5988,3 +6229,91 @@ fold (expr)
return t;
} /* switch (code) */
}
+
+/* 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
+
+ SAVE_EXPR (I) * SAVE_EXPR (J * 8)
+
+ is a multiple of
+
+ SAVE_EXPR (J * 8)
+
+ 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 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 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
+
+ SAVE_EXPR (I) * SAVE_EXPR (J)
+
+ (where the same SAVE_EXPR (J) is used in the original and the
+ transformed version). */
+
+static int
+multiple_of_p (type, top, bottom)
+ tree type;
+ tree top;
+ tree bottom;
+{
+ if (operand_equal_p (top, bottom, 0))
+ return 1;
+
+ if (TREE_CODE (type) != INTEGER_TYPE)
+ return 0;
+
+ switch (TREE_CODE (top))
+ {
+ case MULT_EXPR:
+ return (multiple_of_p (type, TREE_OPERAND (top, 0), bottom)
+ || multiple_of_p (type, TREE_OPERAND (top, 1), bottom));
+
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ return (multiple_of_p (type, TREE_OPERAND (top, 0), bottom)
+ && multiple_of_p (type, TREE_OPERAND (top, 1), bottom));
+
+ case NOP_EXPR:
+ /* 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 ... */
+
+ case SAVE_EXPR:
+ return multiple_of_p (type, TREE_OPERAND (top, 0), bottom);
+
+ case INTEGER_CST:
+ if ((TREE_CODE (bottom) != INTEGER_CST)
+ || (tree_int_cst_sgn (top) < 0)
+ || (tree_int_cst_sgn (bottom) < 0))
+ return 0;
+ return integer_zerop (const_binop (TRUNC_MOD_EXPR,
+ top, bottom, 0));
+
+ default:
+ return 0;
+ }
+}
diff --git a/gcc/function.c b/gcc/function.c
index 1dedbdcfa72..0271f0a706c 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -39,7 +39,7 @@ Boston, MA 02111-1307, USA. */
then scans all the RTL instructions so far generated to correct them. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -213,6 +213,10 @@ int current_function_uses_pic_offset_table;
/* The arg pointer hard register, or the pseudo into which it was copied. */
rtx current_function_internal_arg_pointer;
+/* Nonzero if memory access checking should be enabled in the current
+ function. */
+int current_function_check_memory_usage;
+
/* The FUNCTION_DECL for an inline function currently being expanded. */
tree inline_function_decl;
@@ -466,7 +470,7 @@ static int all_blocks PROTO((tree, tree *));
static int *record_insns PROTO((rtx));
static int contains PROTO((rtx, int *));
static void put_addressof_into_stack PROTO((rtx));
-static void purge_addressof_1 PROTO((rtx *, rtx, int));
+static void purge_addressof_1 PROTO((rtx *, rtx, int, int));
/* Pointer to chain of `struct function' for containing functions. */
struct function *outer_function_chain;
@@ -552,6 +556,7 @@ push_function_context_to (context)
p->fixup_var_refs_queue = 0;
p->epilogue_delay_list = current_function_epilogue_delay_list;
p->args_info = current_function_args_info;
+ p->check_memory_usage = current_function_check_memory_usage;
save_tree_status (p, context);
save_storage_status (p);
@@ -636,6 +641,7 @@ pop_function_context_from (context)
current_function_epilogue_delay_list = p->epilogue_delay_list;
reg_renumber = 0;
current_function_args_info = p->args_info;
+ current_function_check_memory_usage = p->check_memory_usage;
restore_tree_status (p, context);
restore_storage_status (p);
@@ -748,9 +754,9 @@ assign_stack_local (mode, size, align)
frame_offset += size;
#endif
- x = gen_rtx (MEM, mode, addr);
+ x = gen_rtx_MEM (mode, addr);
- stack_slot_list = gen_rtx (EXPR_LIST, VOIDmode, x, stack_slot_list);
+ stack_slot_list = gen_rtx_EXPR_LIST (VOIDmode, x, stack_slot_list);
return x;
}
@@ -810,10 +816,10 @@ assign_outer_stack_local (mode, size, align, function)
function->frame_offset += size;
#endif
- x = gen_rtx (MEM, mode, addr);
+ x = gen_rtx_MEM (mode, addr);
function->stack_slot_list
- = gen_rtx (EXPR_LIST, VOIDmode, x, function->stack_slot_list);
+ = gen_rtx_EXPR_LIST (VOIDmode, x, function->stack_slot_list);
pop_obstacks ();
@@ -880,16 +886,16 @@ assign_stack_temp (mode, size, keep)
p->size = best_p->size - rounded_size;
p->base_offset = best_p->base_offset + rounded_size;
p->full_size = best_p->full_size - rounded_size;
- p->slot = gen_rtx (MEM, BLKmode,
- plus_constant (XEXP (best_p->slot, 0),
- rounded_size));
+ p->slot = gen_rtx_MEM (BLKmode,
+ plus_constant (XEXP (best_p->slot, 0),
+ rounded_size));
p->address = 0;
p->rtl_expr = 0;
p->next = temp_slots;
temp_slots = p;
- stack_slot_list = gen_rtx (EXPR_LIST, VOIDmode, p->slot,
- stack_slot_list);
+ stack_slot_list = gen_rtx_EXPR_LIST (VOIDmode, p->slot,
+ stack_slot_list);
best_p->size = rounded_size;
best_p->full_size = rounded_size;
@@ -1121,9 +1127,9 @@ update_temp_slot_address (old, new)
else
{
if (GET_CODE (p->address) != EXPR_LIST)
- p->address = gen_rtx (EXPR_LIST, VOIDmode, p->address, NULL_RTX);
+ p->address = gen_rtx_EXPR_LIST (VOIDmode, p->address, NULL_RTX);
- p->address = gen_rtx (EXPR_LIST, VOIDmode, new, p->address);
+ p->address = gen_rtx_EXPR_LIST (VOIDmode, new, p->address);
}
}
@@ -1495,7 +1501,7 @@ put_var_into_stack (decl)
else
return;
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
XEXP (reg, 0), ptr_mode,
GEN_INT (GET_MODE_SIZE (GET_MODE (reg))),
@@ -1632,7 +1638,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)
@@ -2002,8 +2008,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));
+ newmem = gen_rtx_MEM (wanted_mode,
+ plus_constant (XEXP (tem, 0), offset));
RTX_UNCHANGING_P (newmem) = RTX_UNCHANGING_P (tem);
MEM_VOLATILE_P (newmem) = MEM_VOLATILE_P (tem);
MEM_IN_STRUCT_P (newmem) = MEM_IN_STRUCT_P (tem);
@@ -2190,8 +2196,9 @@ 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));
+ newmem = gen_rtx_MEM (wanted_mode,
+ plus_constant (XEXP (tem, 0),
+ offset));
RTX_UNCHANGING_P (newmem) = RTX_UNCHANGING_P (tem);
MEM_VOLATILE_P (newmem) = MEM_VOLATILE_P (tem);
MEM_IN_STRUCT_P (newmem) = MEM_IN_STRUCT_P (tem);
@@ -2743,9 +2750,9 @@ gen_mem_addressof (reg, decl)
tree decl;
{
tree type = TREE_TYPE (decl);
+ rtx r = gen_rtx_ADDRESSOF (Pmode, gen_reg_rtx (GET_MODE (reg)), REGNO (reg));
- rtx r = gen_rtx (ADDRESSOF, Pmode, gen_reg_rtx (GET_MODE (reg)));
- ADDRESSOF_REGNO (r) = REGNO (reg);
+ REG_USERVAR_P (XEXP (r, 0)) = REG_USERVAR_P (reg);
SET_ADDRESSOF_DECL (r, decl);
XEXP (reg, 0) = r;
@@ -2794,13 +2801,14 @@ put_addressof_into_stack (r)
/* Helper function for purge_addressof. See if the rtx expression at *LOC
in INSN needs to be changed. If FORCE, always put any ADDRESSOFs into
- the stack. */
+ the stack. IN_DEST is nonzero if we are in the destination of a SET. */
static void
-purge_addressof_1 (loc, insn, force)
+purge_addressof_1 (loc, insn, force, in_dest)
rtx *loc;
rtx insn;
int force;
+ int in_dest;
{
rtx x;
RTX_CODE code;
@@ -2816,20 +2824,31 @@ purge_addressof_1 (loc, insn, force)
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);
+ purge_addressof_1 (&SET_SRC (x), insn, force, 0);
+ 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))
+ if (validate_change (insn, loc, sub, 0)
+ || validate_replace_rtx (x, sub, insn))
return;
start_sequence ();
- if (! validate_change (insn, loc,
- force_operand (sub, NULL_RTX),
- 0))
+ sub = force_operand (sub, NULL_RTX);
+ if (! validate_change (insn, loc, sub, 0)
+ && ! validate_replace_rtx (x, sub, insn))
abort ();
insns = get_insns ();
@@ -2837,6 +2856,7 @@ purge_addressof_1 (loc, insn, force)
emit_insns_before (insns, insn);
return;
}
+
else if (code == MEM && GET_CODE (XEXP (x, 0)) == ADDRESSOF && ! force)
{
rtx sub = XEXP (XEXP (x, 0), 0);
@@ -2844,31 +2864,33 @@ purge_addressof_1 (loc, insn, force)
if (GET_CODE (sub) == MEM)
{
- sub2 = gen_rtx (MEM, GET_MODE (x), copy_rtx (XEXP (sub, 0)));
+ sub2 = gen_rtx_MEM (GET_MODE (x), copy_rtx (XEXP (sub, 0)));
MEM_IN_STRUCT_P (sub2) = MEM_IN_STRUCT_P (sub);
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));
- 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))
{
if (! BYTES_BIG_ENDIAN && ! WORDS_BIG_ENDIAN)
{
- sub2 = gen_rtx (SUBREG, GET_MODE (x), sub, 0);
+ sub2 = gen_rtx_SUBREG (GET_MODE (x), sub, 0);
+ if (in_dest && GET_MODE_SIZE (GET_MODE (x)) < UNITS_PER_WORD)
+ sub2 = gen_rtx_STRICT_LOW_PART (GET_MODE (sub2), sub2);
+
if (validate_change (insn, loc, sub2, 0))
goto restart;
}
}
+
else if (validate_change (insn, loc, sub, 0))
goto restart;
- /* else give up and put it into the stack */
+
}
+
else if (code == ADDRESSOF)
{
put_addressof_into_stack (x);
@@ -2880,10 +2902,10 @@ purge_addressof_1 (loc, insn, force)
for (i = 0; i < GET_RTX_LENGTH (code); i++, fmt++)
{
if (*fmt == 'e')
- purge_addressof_1 (&XEXP (x, i), insn, force);
+ purge_addressof_1 (&XEXP (x, i), insn, force, in_dest);
else if (*fmt == 'E')
for (j = 0; j < XVECLEN (x, i); j++)
- purge_addressof_1 (&XVECEXP (x, i, j), insn, force);
+ purge_addressof_1 (&XVECEXP (x, i, j), insn, force, in_dest);
}
}
@@ -2901,8 +2923,8 @@ purge_addressof (insns)
|| GET_CODE (insn) == CALL_INSN)
{
purge_addressof_1 (&PATTERN (insn), insn,
- asm_noperands (PATTERN (insn)) > 0);
- purge_addressof_1 (&REG_NOTES (insn), NULL_RTX, 0);
+ asm_noperands (PATTERN (insn)) > 0, 0);
+ purge_addressof_1 (&REG_NOTES (insn), NULL_RTX, 0, 0);
}
}
@@ -3214,7 +3236,7 @@ instantiate_virtual_regs_1 (loc, object, extra_insns)
instantiate_virtual_regs_1 (&XEXP (XEXP (x, 0), 1), object,
extra_insns);
- new = gen_rtx (PLUS, Pmode, new, XEXP (XEXP (x, 0), 1));
+ new = gen_rtx_PLUS (Pmode, new, XEXP (XEXP (x, 0), 1));
}
else if (XEXP (x, 0) == virtual_incoming_args_rtx)
@@ -3277,7 +3299,7 @@ instantiate_virtual_regs_1 (loc, object, extra_insns)
register containing the sum. */
XEXP (x, 0) = old;
- new = gen_rtx (PLUS, Pmode, new, new_offset);
+ new = gen_rtx_PLUS (Pmode, new, new_offset);
start_sequence ();
temp = force_operand (new, NULL_RTX);
@@ -3544,7 +3566,7 @@ nonlocal_label_rtx_list ()
rtx x = 0;
for (t = nonlocal_labels; t; t = TREE_CHAIN (t))
- x = gen_rtx (EXPR_LIST, VOIDmode, label_rtx (TREE_VALUE (t)), x);
+ x = gen_rtx_EXPR_LIST (VOIDmode, label_rtx (TREE_VALUE (t)), x);
return x;
}
@@ -3559,14 +3581,14 @@ use_variable (rtl)
{
if (GET_CODE (rtl) == REG)
/* This is a register variable. */
- emit_insn (gen_rtx (USE, VOIDmode, rtl));
+ emit_insn (gen_rtx_USE (VOIDmode, rtl));
else if (GET_CODE (rtl) == MEM
&& GET_CODE (XEXP (rtl, 0)) == REG
&& (REGNO (XEXP (rtl, 0)) < FIRST_VIRTUAL_REGISTER
|| REGNO (XEXP (rtl, 0)) > LAST_VIRTUAL_REGISTER)
&& XEXP (rtl, 0) != current_function_internal_arg_pointer)
/* This is a variable-sized structure. */
- emit_insn (gen_rtx (USE, VOIDmode, XEXP (rtl, 0)));
+ emit_insn (gen_rtx_USE (VOIDmode, XEXP (rtl, 0)));
}
/* Like use_variable except that it outputs the USEs after INSN
@@ -3578,14 +3600,14 @@ use_variable_after (rtl, insn)
{
if (GET_CODE (rtl) == REG)
/* This is a register variable. */
- emit_insn_after (gen_rtx (USE, VOIDmode, rtl), insn);
+ emit_insn_after (gen_rtx_USE (VOIDmode, rtl), insn);
else if (GET_CODE (rtl) == MEM
&& GET_CODE (XEXP (rtl, 0)) == REG
&& (REGNO (XEXP (rtl, 0)) < FIRST_VIRTUAL_REGISTER
|| REGNO (XEXP (rtl, 0)) > LAST_VIRTUAL_REGISTER)
&& XEXP (rtl, 0) != current_function_internal_arg_pointer)
/* This is a variable-sized structure. */
- emit_insn_after (gen_rtx (USE, VOIDmode, XEXP (rtl, 0)), insn);
+ emit_insn_after (gen_rtx_USE (VOIDmode, XEXP (rtl, 0)), insn);
}
int
@@ -3794,8 +3816,8 @@ assign_parms (fndecl, second_time)
|| TREE_CODE (parm) != PARM_DECL
|| passed_type == NULL)
{
- DECL_INCOMING_RTL (parm) = DECL_RTL (parm) = gen_rtx (MEM, BLKmode,
- const0_rtx);
+ DECL_INCOMING_RTL (parm) = DECL_RTL (parm)
+ = gen_rtx_MEM (BLKmode, const0_rtx);
TREE_USED (parm) = 1;
continue;
}
@@ -3897,7 +3919,7 @@ assign_parms (fndecl, second_time)
In this case, we call FUNCTION_ARG with NAMED set to 1 instead of
0 as it was the previous time. */
- locate_and_pad_parm (nominal_mode, passed_type,
+ locate_and_pad_parm (promoted_mode, passed_type,
#ifdef STACK_PARMS_IN_REG_PARM_AREA
1,
#else
@@ -3919,11 +3941,12 @@ assign_parms (fndecl, second_time)
rtx offset_rtx = ARGS_SIZE_RTX (stack_offset);
if (offset_rtx == const0_rtx)
- stack_parm = gen_rtx (MEM, nominal_mode, internal_arg_pointer);
+ stack_parm = gen_rtx_MEM (promoted_mode, internal_arg_pointer);
else
- stack_parm = gen_rtx (MEM, nominal_mode,
- gen_rtx (PLUS, Pmode,
- internal_arg_pointer, offset_rtx));
+ stack_parm = gen_rtx_MEM (promoted_mode,
+ gen_rtx_PLUS (Pmode,
+ internal_arg_pointer,
+ offset_rtx));
/* If this is a memory ref that contains aggregate components,
mark it as such for cse and loop optimize. Likewise if it
@@ -3963,8 +3986,7 @@ assign_parms (fndecl, second_time)
/* Handle calls that pass values in multiple non-contiguous
locations. The Irix 6 ABI has examples of this. */
if (GET_CODE (entry_parm) == PARALLEL)
- emit_group_store (validize_mem (stack_parm),
- entry_parm);
+ emit_group_store (validize_mem (stack_parm), entry_parm);
else
move_block_from_reg (REGNO (entry_parm),
validize_mem (stack_parm), nregs,
@@ -4058,24 +4080,12 @@ assign_parms (fndecl, second_time)
offset_rtx = ARGS_SIZE_RTX (stack_offset);
if (offset_rtx == const0_rtx)
- stack_parm = gen_rtx (MEM, nominal_mode, internal_arg_pointer);
+ stack_parm = gen_rtx_MEM (nominal_mode, internal_arg_pointer);
else
- stack_parm = gen_rtx (MEM, nominal_mode,
- gen_rtx (PLUS, Pmode,
- if (flag_check_memory_usage)
- {
- push_to_sequence (conversion_insns);
- emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
- XEXP (stack_parm, 0), ptr_mode,
- GEN_INT (int_size_in_bytes
- (TREE_TYPE (parm))),
- TYPE_MODE (sizetype),
- GEN_INT (MEMORY_USE_RW),
- TYPE_MODE (integer_type_node));
- conversion_insns = get_insns ();
- end_sequence ();
- }
- internal_arg_pointer, offset_rtx));
+ stack_parm = gen_rtx_MEM (nominal_mode,
+ gen_rtx_PLUS (Pmode,
+ internal_arg_pointer,
+ offset_rtx));
/* If this is a memory ref that contains aggregate components,
mark it as such for cse and loop optimize. */
@@ -4091,7 +4101,7 @@ assign_parms (fndecl, second_time)
have been optimised away. */
if (GET_CODE (entry_parm) == REG && !(hide_last_arg && last_named))
- emit_insn (gen_rtx (USE, GET_MODE (entry_parm), entry_parm));
+ emit_insn (gen_rtx_USE (GET_MODE (entry_parm), entry_parm));
#endif
/* ENTRY_PARM is an RTX for the parameter as it arrives,
@@ -4189,7 +4199,7 @@ assign_parms (fndecl, second_time)
if (passed_pointer)
{
DECL_RTL (parm)
- = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (passed_type)), parmreg);
+ = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (passed_type)), parmreg);
MEM_IN_STRUCT_P (DECL_RTL (parm)) = aggregate;
}
else
@@ -4284,10 +4294,10 @@ assign_parms (fndecl, second_time)
if (TYPE_SIZE (type) == 0
|| TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
/* This is a variable sized object. */
- copy = gen_rtx (MEM, BLKmode,
- allocate_dynamic_stack_space
- (expr_size (parm), NULL_RTX,
- TYPE_ALIGN (type)));
+ copy = gen_rtx_MEM (BLKmode,
+ allocate_dynamic_stack_space
+ (expr_size (parm), NULL_RTX,
+ TYPE_ALIGN (type)));
else
copy = assign_stack_temp (TYPE_MODE (type),
int_size_in_bytes (type), 1);
@@ -4296,7 +4306,7 @@ assign_parms (fndecl, second_time)
store_expr (parm, copy, 0);
emit_move_insn (parmreg, XEXP (copy, 0));
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
XEXP (copy, 0), ptr_mode,
GEN_INT (int_size_in_bytes (type)),
@@ -4388,21 +4398,21 @@ assign_parms (fndecl, second_time)
if (set != 0
&& SET_DEST (set) == regno_reg_rtx [regnoi])
REG_NOTES (sinsn)
- = gen_rtx (EXPR_LIST, REG_EQUIV,
- parm_reg_stack_loc[regnoi],
- REG_NOTES (sinsn));
+ = gen_rtx_EXPR_LIST (REG_EQUIV,
+ parm_reg_stack_loc[regnoi],
+ REG_NOTES (sinsn));
else if (set != 0
&& SET_DEST (set) == regno_reg_rtx [regnor])
REG_NOTES (sinsn)
- = gen_rtx (EXPR_LIST, REG_EQUIV,
- parm_reg_stack_loc[regnor],
- REG_NOTES (sinsn));
+ = gen_rtx_EXPR_LIST (REG_EQUIV,
+ parm_reg_stack_loc[regnor],
+ REG_NOTES (sinsn));
}
else if ((set = single_set (linsn)) != 0
&& SET_DEST (set) == parmreg)
REG_NOTES (linsn)
- = gen_rtx (EXPR_LIST, REG_EQUIV,
- stack_parm, REG_NOTES (linsn));
+ = gen_rtx_EXPR_LIST (REG_EQUIV,
+ stack_parm, REG_NOTES (linsn));
}
/* For pointer data type, suggest pointer register. */
@@ -4455,7 +4465,7 @@ assign_parms (fndecl, second_time)
emit_move_insn (validize_mem (stack_parm),
validize_mem (entry_parm));
}
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
{
push_to_sequence (conversion_insns);
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
@@ -4480,7 +4490,7 @@ assign_parms (fndecl, second_time)
tree restype = TREE_TYPE (result);
DECL_RTL (result)
- = gen_rtx (MEM, DECL_MODE (result), DECL_RTL (parm));
+ = gen_rtx_MEM (DECL_MODE (result), DECL_RTL (parm));
MEM_IN_STRUCT_P (DECL_RTL (result)) = AGGREGATE_TYPE_P (restype);
}
@@ -4988,7 +4998,7 @@ fix_lexical_addr (addr, var)
addr = fix_lexical_addr (XEXP (fp->arg_pointer_save_area, 0), var);
addr = memory_address (Pmode, addr);
- base = copy_to_reg (gen_rtx (MEM, Pmode, addr));
+ base = copy_to_reg (gen_rtx_MEM (Pmode, addr));
#else
displacement += (FIRST_PARM_OFFSET (context) - STARTING_FRAME_OFFSET);
base = lookup_static_chain (var);
@@ -5503,7 +5513,7 @@ expand_main_function ()
/* The zero below avoids a possible parse error */
0;
#if !defined (HAS_INIT_SECTION)
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, NAME__MAIN), 0,
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, NAME__MAIN), 0,
VOIDmode, 0);
#endif /* not HAS_INIT_SECTION */
}
@@ -5616,6 +5626,11 @@ expand_function_start (subr, parms_have_cleanups)
valid operands of arithmetic insns. */
init_recog_no_volatile ();
+ /* Set this before generating any memory accesses. */
+ current_function_check_memory_usage
+ = (flag_check_memory_usage
+ && ! DECL_NO_CHECK_MEMORY_USAGE (current_function_decl));
+
/* If function gets a static chain arg, store it in the stack frame.
Do this first, so it gets the first stack slot offset. */
if (current_function_needs_context)
@@ -5682,7 +5697,7 @@ expand_function_start (subr, parms_have_cleanups)
if (value_address)
{
DECL_RTL (DECL_RESULT (subr))
- = gen_rtx (MEM, DECL_MODE (DECL_RESULT (subr)), value_address);
+ = gen_rtx_MEM (DECL_MODE (DECL_RESULT (subr)), value_address);
MEM_IN_STRUCT_P (DECL_RTL (DECL_RESULT (subr)))
= AGGREGATE_TYPE_P (TREE_TYPE (DECL_RESULT (subr)));
}
@@ -5797,14 +5812,15 @@ expand_function_start (subr, parms_have_cleanups)
#ifdef FRAME_GROWS_DOWNWARD
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)));
+ last_ptr = copy_to_reg (gen_rtx_MEM (Pmode,
+ 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. */
if (! optimize)
- save_expr_regs = gen_rtx (EXPR_LIST, VOIDmode, last_ptr,
- save_expr_regs);
+ save_expr_regs = gen_rtx_EXPR_LIST (VOIDmode, last_ptr,
+ save_expr_regs);
}
}
@@ -5887,7 +5903,7 @@ expand_function_end (filename, line, end_bindings)
{
end_temporary_allocation ();
initial_trampoline
- = gen_rtx (MEM, BLKmode, assemble_trampoline_template ());
+ = gen_rtx_MEM (BLKmode, assemble_trampoline_template ());
resume_temporary_allocation ();
}
#endif
@@ -6065,7 +6081,7 @@ expand_function_end (filename, line, end_bindings)
GET_MODE (DECL_RTL (DECL_RESULT (current_function_decl))));
emit_move_insn (real_decl_result,
DECL_RTL (DECL_RESULT (current_function_decl)));
- emit_insn (gen_rtx (USE, VOIDmode, real_decl_result));
+ emit_insn (gen_rtx_USE (VOIDmode, real_decl_result));
/* The delay slot scheduler assumes that current_function_return_rtx
holds the hard register containing the return value, not a temporary
diff --git a/gcc/function.h b/gcc/function.h
index 737a0f3be80..6f5b9fe6ce4 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -148,6 +148,7 @@ struct function
rtx saveregs_value;
rtx apply_args_value;
rtx forced_labels;
+ int check_memory_usage;
/* For emit-rtl.c. */
int reg_rtx_no;
diff --git a/gcc/gansidecl.h b/gcc/gansidecl.h
index d4a8e38865a..555490a7409 100644
--- a/gcc/gansidecl.h
+++ b/gcc/gansidecl.h
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */
#endif
#ifndef VPROTO
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
#define PVPROTO(ARGS) ARGS
#define VPROTO(ARGS) ARGS
#define VA_START(va_list,var) va_start(va_list,var)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index d6eb4ffce73..7e72fee1b91 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -30,36 +30,15 @@ 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 <sys/types.h>
-#include <ctype.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <errno.h>
-#ifdef HAVE_SYS_FILE_H
-#include <sys/file.h> /* May get R_OK, etc. on some systems. */
-#endif
+#include "config.h"
+#include "system.h"
+#include <signal.h>
#include "obstack.h"
#include "gansidecl.h"
#include "intl.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include <stdio.h>
-
-#ifndef R_OK
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#endif
-
/* ??? Need to find a GCC header to put these in. */
extern int pexecute PROTO ((const char *, char * const *, const char *,
const char *, char **, char **, int));
@@ -71,42 +50,11 @@ extern char *update_path PROTO((char *, char *));
#define PEXECUTE_SEARCH 4
#define PEXECUTE_VERBOSE 8
-#ifndef WIFSIGNALED
-#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
-#endif
-#ifndef WTERMSIG
-#define WTERMSIG(S) ((S) & 0x7f)
-#endif
-#ifndef WIFEXITED
-#define WIFEXITED(S) (((S) & 0xff) == 0)
-#endif
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
-#endif
#ifdef VMS
#define exit __posix_exit
#endif
-/* Define O_RDONLY if the system hasn't defined it for us. */
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
-#ifdef USG
-#define vfork fork
-#endif /* USG */
-
-/* Test if something is a normal file. */
-#ifndef S_ISREG
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif
-
-/* Test if something is a directory. */
-#ifndef S_ISDIR
-#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#endif
-
/* By default there is no special suffix for executables. */
#ifdef EXECUTABLE_SUFFIX
#define HAVE_EXECUTABLE_SUFFIX
@@ -135,22 +83,8 @@ static char dir_separator_str[] = {DIR_SEPARATOR, 0};
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free ();
-extern char *getenv ();
-
extern char *choose_temp_base PROTO((void));
-#ifndef errno
-extern int errno;
-#endif
-
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#else
-extern char *strerror();
-#endif
-
#ifndef HAVE_KILL
#define kill(p,s) raise(s)
#endif
@@ -4937,14 +4871,14 @@ concat VPROTO((char *first, ...))
register char *end;
register char *arg;
va_list args;
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *first;
#endif
/* First compute the size of the result and get sufficient memory. */
VA_START (args, first);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
first = va_arg (args, char *);
#endif
@@ -4963,7 +4897,7 @@ concat VPROTO((char *first, ...))
/* Now copy the individual pieces to the result string. */
VA_START (args, first);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
first = va_arg (args, char *);
#endif
@@ -5045,14 +4979,14 @@ fancy_abort ()
static void
fatal VPROTO((char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, char *);
#endif
@@ -5067,14 +5001,14 @@ fatal VPROTO((char *msgid, ...))
static void
error VPROTO((char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, char *);
#endif
@@ -5088,14 +5022,14 @@ error VPROTO((char *msgid, ...))
static void
notice VPROTO((char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, char *);
#endif
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 2d372f0d849..ea11144bb92 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -1,6 +1,6 @@
/* Gcov.c: prepend line execution counts and branch probabilities to a
source file.
- Copyright (C) 1990, 91, 92, 93, 94, 96, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92-97, 1998 Free Software Foundation, Inc.
Contributed by James E. Wilson of Cygnus Support.
Mangled by Bob Manson of Cygnus Support.
@@ -42,33 +42,18 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
only get execution counts for one or the other of the including files. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "gansidecl.h"
-#include <sys/types.h>
-#include <sys/stat.h>
#include "intl.h"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
+#include "gcov-io.h"
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
#endif
+void fancy_abort ();
-#include "gcov-io.h"
-
-#ifdef NEED_DECLARATION_RINDEX
-extern char *rindex ();
-#endif
/* The .bb file format consists of several lists of 4-byte integers
which are the line numbers of each basic block in the file. Each
@@ -264,7 +249,8 @@ main (argc, argv)
return 0;
}
-#if defined __STDC__ && defined HAVE_VPRINTF
+#if defined (__STDC__) && defined (HAVE_VPRINTF)
+
static void
fnotice (FILE *file, char *msgid, ...)
{
@@ -273,7 +259,9 @@ fnotice (FILE *file, char *msgid, ...)
vfprintf (file, _(msgid), args);
va_end (args);
}
+
#else
+
static void
fnotice (file, msgid, arg1, arg2, arg3, arg4)
FILE *file;
@@ -297,6 +285,40 @@ xmalloc (size)
return value;
}
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genattrtab: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
+fatal (s, a1, a2)
+ char *s;
+{
+ fprintf (stderr, "genattrtab: ");
+ fprintf (stderr, s, a1, a2);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#endif /* not HAVE_VPRINTF */
+
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
diff --git a/gcc/gen-protos.c b/gcc/gen-protos.c
index 0284c18ba4a..cf35cffd55c 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, 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 1998 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
@@ -15,9 +15,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include <stdio.h>
-#include <ctype.h>
#include "hconfig.h"
+#include "system.h"
#include "scan.h"
#include "cpplib.h"
#include "cpphash.h"
diff --git a/gcc/genattr.c b/gcc/genattr.c
index c351fc5ad5f..92bb469ab91 100644
--- a/gcc/genattr.c
+++ b/gcc/genattr.c
@@ -1,5 +1,5 @@
/* Generate attribute information (insn-attr.h) from machine description.
- Copyright (C) 1991, 1994, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1994, 1996, 1998 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GNU CC.
@@ -20,8 +20,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
@@ -31,12 +31,18 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free PROTO((void *));
extern rtx read_rtx PROTO((FILE *));
char *xmalloc PROTO((unsigned));
-static void fatal ();
-void fancy_abort PROTO((void));
+
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
+
+void fancy_abort ();
/* A range of values. */
@@ -213,6 +219,30 @@ xrealloc (ptr, size)
return result;
}
+#ifdef HAVE_VPRINTF
+
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genattr: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
static void
fatal (s, a1, a2)
char *s;
@@ -222,6 +252,7 @@ fatal (s, a1, a2)
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index f8c96fe85ba..041072d5f9b 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -96,27 +96,10 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h"
-/* varargs must always be included after *config.h. */
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "insn-config.h" /* For REGISTER_CONSTRAINTS */
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-#endif
-#endif
-
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
@@ -139,7 +122,12 @@ char **insn_name_ptr = 0;
extern void free ();
extern rtx read_rtx ();
-static void fatal ();
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
void fancy_abort ();
/* enough space to reserve for printing out ints */
@@ -553,7 +541,7 @@ attr_hash_add_string (hashcode, str)
static rtx
attr_rtx VPROTO((enum rtx_code code, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
enum rtx_code code;
#endif
va_list p;
@@ -566,7 +554,7 @@ attr_rtx VPROTO((enum rtx_code code, ...))
VA_START (p, code);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
code = va_arg (p, enum rtx_code);
#endif
@@ -752,7 +740,7 @@ attr_rtx VPROTO((enum rtx_code code, ...))
static char *
attr_printf VPROTO((register int len, char *fmt, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
register int len;
char *fmt;
#endif
@@ -761,7 +749,7 @@ attr_printf VPROTO((register int len, char *fmt, ...))
VA_START (p, fmt);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
len = va_arg (p, int);
fmt = va_arg (p, char *);
#endif
@@ -5526,16 +5514,39 @@ copy_rtx_unchanging (orig)
#endif
}
-static void
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genattrtab: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
fatal (s, a1, a2)
char *s;
- char *a1, *a2;
{
fprintf (stderr, "genattrtab: ");
fprintf (stderr, s, a1, a2);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
@@ -5701,7 +5712,7 @@ from the machine description file `md'. */\n\n");
expand_units ();
printf ("#include \"config.h\"\n");
- printf ("#include <stdio.h>\n");
+ printf ("#include \"system.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"insn-config.h\"\n");
printf ("#include \"recog.h\"\n");
diff --git a/gcc/gencheck.c b/gcc/gencheck.c
index 301e946b9b9..de86c680211 100644
--- a/gcc/gencheck.c
+++ b/gcc/gencheck.c
@@ -18,8 +18,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 <stdio.h>
#include "hconfig.h"
+#include "system.h"
#ifdef __STDC__
#define DEFTREECODE(SYM, NAME, TYPE, LEN) #SYM,
diff --git a/gcc/gencodes.c b/gcc/gencodes.c
index 8baf3b83e0b..d2f4ece469d 100644
--- a/gcc/gencodes.c
+++ b/gcc/gencodes.c
@@ -1,8 +1,7 @@
/* 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 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1991, 1995, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -22,8 +21,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
@@ -33,11 +32,16 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free ();
-extern rtx read_rtx ();
char *xmalloc ();
-static void fatal ();
+
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
+
void fancy_abort ();
static int insn_code_number;
@@ -76,7 +80,30 @@ xrealloc (ptr, size)
return result;
}
-static void
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "gencodes: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
fatal (s, a1, a2)
char *s;
{
@@ -85,6 +112,7 @@ fatal (s, a1, a2)
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index 7bcf0f2b9cd..337f8737d87 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -1,6 +1,6 @@
/* Generate from machine description:
- some #define configuration flags.
- Copyright (C) 1987, 1991, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1991, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,8 +20,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
@@ -31,7 +31,6 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free ();
extern rtx read_rtx ();
/* flags to determine output of machine description dependent #define's. */
@@ -41,6 +40,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;
/* Maximum number of insns seen in a split. */
@@ -50,7 +50,12 @@ static int clobbers_seen_this_insn;
static int dup_operands_seen_this_insn;
char *xmalloc ();
-static void fatal ();
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
void fancy_abort ();
/* RECOG_P will be non-zero if this pattern was seen in a context where it will
@@ -130,12 +135,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:
@@ -261,7 +275,30 @@ xrealloc (ptr, size)
return result;
}
-static void
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genconfig: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
fatal (s, a1, a2)
char *s;
{
@@ -270,6 +307,7 @@ fatal (s, a1, a2)
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
@@ -348,6 +386,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 0f596d004cb..e57a30e9c63 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -19,8 +19,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
@@ -30,11 +30,17 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free ();
extern rtx read_rtx ();
char *xmalloc ();
-static void fatal ();
+
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
+
void fancy_abort ();
static int max_opno;
@@ -188,7 +194,7 @@ gen_exp (x)
return;
case MATCH_SCRATCH:
- printf ("gen_rtx (SCRATCH, %smode, 0)", GET_MODE_NAME (GET_MODE (x)));
+ printf ("gen_rtx_SCRATCH (%smode)", GET_MODE_NAME (GET_MODE (x)));
return;
case ADDRESS:
@@ -227,9 +233,9 @@ gen_exp (x)
abort ();
}
- printf ("gen_rtx (");
+ printf ("gen_rtx_");
print_code (code);
- printf (", %smode", GET_MODE_NAME (GET_MODE (x)));
+ printf (" (%smode", GET_MODE_NAME (GET_MODE (x)));
fmt = GET_RTX_FORMAT (code);
len = GET_RTX_LENGTH (code);
@@ -368,7 +374,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");
@@ -691,7 +699,30 @@ xrealloc (ptr, size)
return result;
}
-static void
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genemit: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
fatal (s, a1, a2)
char *s;
{
@@ -700,6 +731,7 @@ fatal (s, a1, a2)
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
@@ -743,7 +775,7 @@ main (argc, argv)
from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
- printf ("#include <stdio.h>\n");
+ printf ("#include \"system.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"expr.h\"\n");
printf ("#include \"real.h\"\n");
diff --git a/gcc/genextract.c b/gcc/genextract.c
index b0c0b2751b9..bb839073bee 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -1,5 +1,5 @@
/* Generate code from machine description to extract operands from insn as rtl.
- Copyright (C) 1987, 1991, 1992, 1993, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 92, 93, 97, 1988 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -19,8 +19,9 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
+#include <stdio.h>
#include "rtl.h"
#include "obstack.h"
#include "insn-config.h"
@@ -31,7 +32,6 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free ();
extern rtx read_rtx ();
/* Names for patterns. Need to allow linking with print-rtl. */
@@ -102,7 +102,12 @@ static void walk_rtx ();
static void print_path ();
char *xmalloc ();
char *xrealloc ();
-static void fatal ();
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
static char *copystr ();
static void mybzero ();
void fancy_abort ();
@@ -364,7 +369,30 @@ xrealloc (ptr, size)
return result;
}
-static void
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genextract: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
fatal (s, a1, a2)
char *s;
{
@@ -373,6 +401,7 @@ fatal (s, a1, a2)
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
@@ -441,7 +470,7 @@ main (argc, argv)
from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
- printf ("#include <stdio.h>\n");
+ printf ("#include \"system.h\"\n");
printf ("#include \"rtl.h\"\n\n");
/* This variable exists only so it can be the "location"
diff --git a/gcc/genflags.c b/gcc/genflags.c
index f8b39833f65..c6f602d1cd1 100644
--- a/gcc/genflags.c
+++ b/gcc/genflags.c
@@ -1,8 +1,7 @@
/* Generate from machine description:
-
- some flags HAVE_... saying which simple standard instructions are
available for this machine.
- Copyright (C) 1987, 1991, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1991, 1995, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -22,8 +21,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
@@ -33,11 +32,17 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free ();
extern rtx read_rtx ();
char *xmalloc ();
-static void fatal ();
+
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
+
void fancy_abort ();
/* Names for patterns. Need to allow linking with print-rtl. */
@@ -195,7 +200,31 @@ xrealloc (ptr, size)
return result;
}
-static void
+
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genflags: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
fatal (s, a1, a2)
char *s;
{
@@ -204,6 +233,7 @@ fatal (s, a1, a2)
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c
index 977305d9a82..b5a01993193 100644
--- a/gcc/gengenrtl.c
+++ b/gcc/gengenrtl.c
@@ -1,5 +1,5 @@
/* Generate code to allocate RTL structures.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,75 +20,150 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h"
-#include <stdio.h>
-
-#include "obstack.h"
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
+#include "system.h"
#define NO_GENRTL_H
#include "rtl.h"
+struct rtx_definition {char *enumname, *name, *format; };
-struct rtx_definition
-{
- const char *enumname, *name, *format;
-};
-
-#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { # ENUM, NAME, FORMAT },
+#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { STRINGIFY(ENUM), NAME, FORMAT },
struct rtx_definition defs[] =
{
#include "rtl.def" /* rtl expressions are documented here */
};
-const char *formats[NUM_RTX_CODE];
+char *formats[NUM_RTX_CODE];
+
+static char *type_from_format PROTO((int));
+static char *accessor_from_format PROTO((int));
+static int special_format PROTO((char *));
+static int special_rtx PROTO((int));
+static void find_formats PROTO((void));
+static void gendecl PROTO((char *));
+static void genmacro PROTO((int));
+static void gendef PROTO((char *));
+static void genlegend PROTO((void));
+static void genheader PROTO((void));
+static void gencode PROTO((void));
+
+/* Handle fatal errors. The macro "abort" calls this. */
+
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genconfig: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
+fatal (s, a1, a2)
+ char *s;
+{
+ fprintf (stderr, "genconfig: ");
+ fprintf (stderr, s, a1, a2);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#endif /* not HAVE_VPRINTF */
+
+
+/* Given a format character used in the type of an RTL parameter, return
+ a string giving the C datatype to be used when passing that parameter to
+ a function. We include a trailing blank when the last character is
+ not '*'. */
-static const char *
-type_from_format (char c)
+static char *
+type_from_format (c)
+ int 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 ";
+
+ /* ?!? These should be bitmap and tree respectively, but those types are
+ not available in many of the files which include the output of
+ gengenrtl. However, these are only used in prototypes, so void *
+ is usable. */
+ case 'b': case 't':
+ return "void *";
+
default:
abort ();
}
}
-static const char *
-accessor_from_format (char c)
+/* Similar to above routine, but give the name of the macro used to access
+ that type field in a piece of RTL. */
+
+static char *
+accessor_from_format (c)
+ int c;
{
switch (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 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)
- const char *fmt;
+ char *fmt;
{
return (strchr (fmt, '*') != 0
|| strchr (fmt, 'V') != 0
@@ -96,192 +171,205 @@ special_format (fmt)
|| strchr (fmt, 'n') != 0);
}
+/* 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)
int idx;
{
return (strcmp (defs[idx].enumname, "CONST_INT") == 0
- || strcmp (defs[idx].enumname, "REG") == 0);
+ || strcmp (defs[idx].enumname, "REG") == 0
+ || strcmp (defs[idx].enumname, "MEM") == 0);
}
+/* 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;
+ char **f;
if (special_format (defs[i].format))
continue;
- for (f = formats; *f ; ++f)
- if (!strcmp(*f, defs[i].format))
+ for (f = formats; *f; f++)
+ if (! strcmp (*f, defs[i].format))
break;
- if (!*f)
+ if (*f == 0)
*f = defs[i].format;
}
}
+/* Write the declarations for the routine to allocate RTL with FORMAT. */
+
static void
-gendecl (f, format)
- FILE *f;
- const char *format;
+gendecl (format)
+ char *format;
{
- const char *p;
- int i;
+ char *p;
+ 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");
}
+/* 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;
+ 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");
}
+/* Generate the code for the function to generate RTL whose
+ format is FORMAT. */
+
static void
-gendef (f, format)
- FILE *f;
- const char *format;
+gendef (format)
+ char *format;
{
- const char *p;
+ char *p;
int i, j;
- fprintf (f, "rtx\ngen_rtx_fmt_%s (code, mode", format);
- for (p = format, i = 0; *p ; ++p)
+ /* Start by writing the definition of the function name and the types
+ of the arguments. */
+
+ printf ("rtx\ngen_rtx_fmt_%s (code, mode", format);
+ for (p = format, i = 0; *p != 0; p++)
if (*p != '0')
- fprintf (f, ", arg%d", i++);
+ printf (", arg%d", i++);
- fprintf (f, ")\n RTX_CODE code;\n enum machine_mode mode;\n");
- for (p = format, i = 0; *p ; ++p)
+ printf (")\n RTX_CODE code;\n enum machine_mode mode;\n");
+ for (p = format, i = 0; *p != 0; p++)
if (*p != '0')
- fprintf (f, " %s arg%d;\n", type_from_format (*p), i++);
+ printf (" %sarg%d;\n", type_from_format (*p), i++);
- /* See rtx_alloc in rtl.c for comments. */
- fprintf (f, "{\n");
- fprintf (f, " register int length = sizeof (struct rtx_def)");
- fprintf (f, " + %d * sizeof (rtunion);\n", strlen (format) - 1);
- fprintf (f, " rtx rt = (rtx)obstack_alloc (rtl_obstack, length);\n");
+ /* Now write out the body of the function itself, which allocates
+ the memory and initializes it. */
+ printf ("{\n");
+ printf (" rtx rt = obstack_alloc_rtx (sizeof (struct rtx_def) + %d",
+ strlen (format) - 1);
- fprintf (f, " if (sizeof(struct rtx_def) - sizeof(rtunion) == sizeof(int))\n");
- fprintf (f, " *(int *)rt = 0;\n");
- fprintf (f, " else if (sizeof(struct rtx_def) - sizeof(rtunion) == sizeof(HOST_WIDE_INT))\n");
- fprintf (f, " *(HOST_WIDE_INT *)rt = 0;\n");
- fprintf (f, " else\n");
- fprintf (f, " bzero(rt, sizeof(struct rtx_def) - sizeof(rtunion));\n\n");
+ printf (" * sizeof (rtunion));\n\n");
- 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");
}
+/* Generate the documentation header for files we write. */
+
static void
-genlegend (f)
- FILE *f;
+genlegend ()
{
- fprintf (f, "/* Generated automaticaly by the program `gengenrtl'\n");
- fprintf (f, " from the RTL description file `rtl.def' */\n\n");
+ printf ("/* Generated automaticaly by the program `gengenrtl'\n");
+ printf (" from the RTL description file `rtl.def' */\n\n");
}
+/* Generate the text of the header file we make, genrtl.h. */
+
static void
-genheader (f)
- FILE *f;
+genheader ()
{
int i;
- const char **fmt;
-
+ 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);
}
+/* Generate the text of the code file we write, genrtl.c. */
+
static void
-gencode (f)
- FILE *f;
+gencode ()
{
- const char **fmt;
+ char **fmt;
- fprintf(f, "#include \"config.h\"\n");
- fprintf(f, "#include \"obstack.h\"\n");
- fprintf(f, "#include \"rtl.h\"\n\n");
- fprintf(f, "extern struct obstack *rtl_obstack;\n\n");
+ printf ("#include \"config.h\"\n");
+ printf ("#include \"system.h\"\n");
+ printf ("#include \"obstack.h\"\n");
+ printf ("#include \"rtl.h\"\n\n");
- for (fmt = formats; *fmt; ++fmt)
- gendef (f, *fmt);
+ for (fmt = formats; *fmt != 0; fmt++)
+ gendef (*fmt);
}
+/* 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/genopinit.c b/gcc/genopinit.c
index 1d4c0a4b76f..1558c221329 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -1,5 +1,5 @@
/* Generate code to initialize optabs from machine description.
- Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -19,11 +19,10 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
-#include <ctype.h>
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
@@ -31,11 +30,18 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free ();
+
extern rtx read_rtx ();
char *xmalloc ();
-static void fatal ();
+
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
+
void fancy_abort ();
/* Many parts of GCC use arrays that are indexed by machine mode and
@@ -306,7 +312,30 @@ xrealloc (ptr, size)
return result;
}
-static void
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genopinit: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
fatal (s, a1, a2)
char *s;
{
@@ -315,6 +344,7 @@ fatal (s, a1, a2)
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
@@ -354,7 +384,7 @@ main (argc, argv)
from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
- printf ("#include <stdio.h>\n");
+ printf ("#include \"system.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"flags.h\"\n");
printf ("#include \"insn-flags.h\"\n");
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index 4520267c548..8f3bd910ee1 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -1,5 +1,5 @@
/* Generate code from to output assembler insns as recognized from rtl.
- Copyright (C) 1987, 88, 92, 94, 95, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 92, 94, 95, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -90,8 +90,8 @@ insn_template[24] to be "clrd %0", and insn_n_operands[24] to be 1.
It would not make an case in output_insn_hairy because the template
given in the entry is a constant (it does not start with `*'). */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
@@ -111,7 +111,12 @@ extern void free ();
extern rtx read_rtx ();
char *xmalloc ();
-static void fatal ();
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
void fancy_abort ();
static void error ();
static void mybcopy ();
@@ -180,7 +185,7 @@ output_prologue ()
from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
- printf ("#include <stdio.h>\n");
+ printf ("#include \"system.h\"\n");
printf ("#include \"flags.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"regs.h\"\n");
@@ -911,7 +916,30 @@ mybcopy (b1, b2, length)
*b2++ = *b1++;
}
-static void
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genoutput: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
fatal (s, a1, a2, a3, a4)
char *s;
{
@@ -920,6 +948,7 @@ fatal (s, a1, a2, a3, a4)
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
diff --git a/gcc/genpeep.c b/gcc/genpeep.c
index b20fd0d0220..0dc667463e9 100644
--- a/gcc/genpeep.c
+++ b/gcc/genpeep.c
@@ -1,5 +1,5 @@
/* Generate code from machine description to perform peephole optimizations.
- Copyright (C) 1987, 1989, 1992, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1989, 1992, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -19,8 +19,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
@@ -30,7 +30,6 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free ();
extern rtx read_rtx ();
/* While tree-walking an instruction pattern, we keep a chain
@@ -48,7 +47,12 @@ struct link
char *xmalloc ();
static void match_rtx ();
-static void fatal ();
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
void fancy_abort ();
static int max_opno;
@@ -122,7 +126,7 @@ gen_peephole (peep)
So use a simple regular form: a PARALLEL containing a vector
of all the operands. */
- printf (" PATTERN (ins1) = gen_rtx (PARALLEL, VOIDmode, gen_rtvec_v (%d, operands));\n", n_operands);
+ printf (" PATTERN (ins1) = gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (%d, operands));\n", n_operands);
#if 0
printf (" if (want_jump && GET_CODE (ins1) != JUMP_INSN)\n");
@@ -409,7 +413,30 @@ xrealloc (ptr, size)
return result;
}
-static void
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genpeep: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
fatal (s, a1, a2)
char *s;
{
@@ -418,6 +445,7 @@ fatal (s, a1, a2)
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
@@ -457,7 +485,7 @@ main (argc, argv)
from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
- printf ("#include <stdio.h>\n");
+ printf ("#include \"system.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"regs.h\"\n");
printf ("#include \"output.h\"\n");
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index f75f1b4be8f..4db93230fcc 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -1,5 +1,5 @@
/* Generate code from machine description to recognize rtl as insns.
- Copyright (C) 1987, 88, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 92-97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -46,8 +46,8 @@ Boston, MA 02111-1307, USA. */
which returns 0 if the rtl could not be split, or
it returns the split rtl in a SEQUENCE. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
@@ -57,7 +57,6 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free ();
extern rtx read_rtx ();
/* Data structure for a listhead of decision trees. The alternatives
@@ -192,10 +191,15 @@ static char *copystr PROTO((char *));
static void mybzero PROTO((char *, unsigned));
static void mybcopy PROTO((char *, char *, unsigned));
static char *concat PROTO((char *, char *));
-static void fatal PROTO((char *));
char *xrealloc PROTO((char *, unsigned));
char *xmalloc PROTO((unsigned));
void fancy_abort PROTO((void));
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
/* Construct and return a sequence of decisions
that will recognize INSN.
@@ -1691,16 +1695,39 @@ xmalloc (size)
return val;
}
-static void
-fatal (s)
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genrecog: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
+fatal (s, a1, a2)
char *s;
{
fprintf (stderr, "genrecog: ");
- fprintf (stderr, s);
+ fprintf (stderr, s, a1, a2);
fprintf (stderr, "\n");
- fprintf (stderr, "after %d definitions\n", next_index);
exit (FATAL_EXIT_CODE);
}
+#endif /* not HAVE_VPRINTF */
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
@@ -1743,7 +1770,7 @@ main (argc, argv)
from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
- printf ("#include <stdio.h>\n");
+ printf ("#include \"system.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"insn-config.h\"\n");
printf ("#include \"recog.h\"\n");
diff --git a/gcc/global.c b/gcc/global.c
index 3ab4d708af6..830cfcbb6db 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -1,5 +1,5 @@
/* Allocate registers for pseudo-registers that span basic blocks.
- Copyright (C) 1987, 88, 91, 94, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 91, 94, 96, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "flags.h"
#include "basic-block.h"
diff --git a/gcc/halfpic.c b/gcc/halfpic.c
index a853a12fbf4..dcca345e0a3 100644
--- a/gcc/halfpic.c
+++ b/gcc/halfpic.c
@@ -1,5 +1,5 @@
/* OSF/rose half-pic support functions.
- Copyright (C) 1992, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1997,1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -32,7 +32,7 @@ Boston, MA 02111-1307, USA. */
#ifdef HALF_PIC_INIT
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "obstack.h"
@@ -41,7 +41,6 @@ Boston, MA 02111-1307, USA. */
#define obstack_chunk_free free
extern char *xmalloc ();
-extern void free ();
extern rtx eliminate_constant_term ();
extern void assemble_name ();
extern void output_addr_const ();
@@ -188,7 +187,7 @@ half_pic_finish (stream)
if (p->pointer_p)
{
ASM_OUTPUT_LABEL (stream, p->ref_name);
- ASM_OUTPUT_INT (stream, gen_rtx (SYMBOL_REF, Pmode, p->real_name));
+ ASM_OUTPUT_INT (stream, gen_rtx_SYMBOL_REF (Pmode, p->real_name));
}
}
}
@@ -394,7 +393,7 @@ half_pic_ptr (operand)
}
half_pic_number_refs++;
- return gen_rtx (SYMBOL_REF, Pmode, p->ref_name);
+ return gen_rtx_SYMBOL_REF (Pmode, p->ref_name);
}
#endif /* HALF_PIC_INIT */
diff --git a/gcc/integrate.c b/gcc/integrate.c
index adf3fcb9d6c..7038b2f7d5c 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
@@ -924,7 +924,7 @@ save_constants (px)
&& CONSTANT_POOL_ADDRESS_P (XEXP (x,0)))
{
enum machine_mode const_mode = get_pool_mode (XEXP (x, 0));
- rtx new = gen_rtx (CONST, const_mode, get_pool_constant (XEXP (x, 0)));
+ rtx new = gen_rtx_CONST (const_mode, get_pool_constant (XEXP (x, 0)));
RTX_INTEGRATED_P (new) = 1;
/* If the MEM was in a different mode than the constant (perhaps we
@@ -933,7 +933,7 @@ save_constants (px)
if (GET_MODE (x) != const_mode)
{
- new = gen_rtx (SUBREG, GET_MODE (x), new, 0);
+ new = gen_rtx_SUBREG (GET_MODE (x), new, 0);
RTX_INTEGRATED_P (new) = 1;
}
@@ -943,9 +943,9 @@ save_constants (px)
else if (GET_CODE (x) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (x))
{
- *px = gen_rtx (ADDRESS, GET_MODE (x),
- gen_rtx (CONST, get_pool_mode (x),
- get_pool_constant (x)));
+ *px = gen_rtx_ADDRESS (GET_MODE (x),
+ gen_rtx_CONST (get_pool_mode (x),
+ get_pool_constant (x)));
save_constants (&XEXP (*px, 0));
RTX_INTEGRATED_P (*px) = 1;
}
@@ -1139,9 +1139,9 @@ copy_for_inline (orig)
case LABEL_REF:
/* If this is a non-local label, just make a new LABEL_REF.
Otherwise, use the new label as well. */
- x = gen_rtx (LABEL_REF, GET_MODE (orig),
- LABEL_REF_NONLOCAL_P (orig) ? XEXP (orig, 0)
- : label_map[CODE_LABEL_NUMBER (XEXP (orig, 0))]);
+ x = gen_rtx_LABEL_REF (GET_MODE (orig),
+ LABEL_REF_NONLOCAL_P (orig) ? XEXP (orig, 0)
+ : label_map[CODE_LABEL_NUMBER (XEXP (orig, 0))]);
LABEL_REF_NONLOCAL_P (x) = LABEL_REF_NONLOCAL_P (orig);
LABEL_OUTSIDE_LOOP_P (x) = LABEL_OUTSIDE_LOOP_P (orig);
return x;
@@ -1775,7 +1775,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
target = gen_lowpart (departing_mode, reg_to_map);
}
else
- reg_to_map = gen_rtx (SUBREG, arriving_mode, target, 0);
+ reg_to_map = gen_rtx_SUBREG (arriving_mode, target, 0);
}
else
reg_to_map = target;
@@ -2096,8 +2096,9 @@ expand_inline_function (fndecl, parms, target, ignore, type,
if (structure_value_addr)
{
- target = gen_rtx (MEM, TYPE_MODE (type),
- memory_address (TYPE_MODE (type), structure_value_addr));
+ target = gen_rtx_MEM (TYPE_MODE (type),
+ memory_address (TYPE_MODE (type),
+ structure_value_addr));
MEM_IN_STRUCT_P (target) = 1;
}
@@ -2389,18 +2390,20 @@ copy_rtx_and_substitute (orig, map)
copy = copy_rtx_and_substitute (SUBREG_REG (orig), map);
/* SUBREG is ordinary, but don't make nested SUBREGs. */
if (GET_CODE (copy) == SUBREG)
- return gen_rtx (SUBREG, GET_MODE (orig), SUBREG_REG (copy),
- SUBREG_WORD (orig) + SUBREG_WORD (copy));
+ return gen_rtx_SUBREG (GET_MODE (orig), SUBREG_REG (copy),
+ SUBREG_WORD (orig) + SUBREG_WORD (copy));
else if (GET_CODE (copy) == CONCAT)
return (subreg_realpart_p (orig) ? XEXP (copy, 0) : XEXP (copy, 1));
else
- return gen_rtx (SUBREG, GET_MODE (orig), copy,
- SUBREG_WORD (orig));
+ return gen_rtx_SUBREG (GET_MODE (orig), copy,
+ SUBREG_WORD (orig));
case ADDRESSOF:
- copy = gen_rtx (ADDRESSOF, mode,
- copy_rtx_and_substitute (XEXP (orig, 0), map));
+ copy = gen_rtx_ADDRESSOF (mode,
+ copy_rtx_and_substitute (XEXP (orig, 0), map),
+ 0);
SET_ADDRESSOF_DECL (copy, ADDRESSOF_DECL (orig));
+
regno = ADDRESSOF_REGNO (orig);
if (map->reg_map[regno])
regno = REGNO (map->reg_map[regno]);
@@ -2438,10 +2441,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
@@ -2585,10 +2590,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
@@ -2612,12 +2620,12 @@ copy_rtx_and_substitute (orig, map)
HOST_WIDE_INT 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
- (copy_rtx_and_substitute (SET_SRC (orig), map),
- - loc_offset),
- NULL_RTX));
+ return gen_rtx_SET (VOIDmode, SET_DEST (orig),
+ force_operand
+ (plus_constant
+ (copy_rtx_and_substitute (SET_SRC (orig), map),
+ - loc_offset),
+ NULL_RTX));
}
break;
diff --git a/gcc/invoke.texi b/gcc/invoke.texi
index 6e02bffb10a..223c3f273dd 100644
--- a/gcc/invoke.texi
+++ b/gcc/invoke.texi
@@ -1316,7 +1316,8 @@ unused variables and parameters, 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
@@ -1375,6 +1376,17 @@ Some spurious warnings can be avoided if you declare all the functions
you use that never return as @code{noreturn}. @xref{Function
Attributes}.
+@cindex @code{longjmp} warnings
+A nonvolatile automatic variable might be 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
+call it at any point in the code. As a result, you may get a warning
+even when there is in fact no problem because @code{longjmp} cannot
+in fact be called at the place which would cause a problem.
+
@item -Wreorder (C++ only)
@cindex reordering, warning
@cindex warning for reordering of member initializers
@@ -1417,18 +1429,6 @@ the warning.
Print extra warning messages for these events:
@itemize @bullet
-@cindex @code{longjmp} warnings
-@item
-A nonvolatile automatic variable might be 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
-call it at any point in the code. As a result, you may get a warning
-even when there is in fact no problem because @code{longjmp} cannot
-in fact be called at the place which would cause a problem.
-
@item
A function can return either with or without a value. (Falling
off the end of the function body is considered returning without
@@ -1599,8 +1599,7 @@ cases where multiple declaration is valid and changes nothing.
Warn if an @code{extern} declaration is encountered within an function.
@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 -Wold-style-cast
Warn if an old-style (C-style) cast is used within a program.
@@ -5235,14 +5234,17 @@ it.
@table @code
@item -fexceptions
-Enable exception handling, and generate extra code needed to propagate
-exceptions. If you do not specify this option, GNU CC enables it by
-default for languages like C++ that 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.
+Enable exception handling. Generates extra code needed to propagate
+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
@@ -5284,7 +5286,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.
@@ -5409,8 +5411,7 @@ the offsets of structure members won't agree with system libraries.
@item -fcheck-memory-usage
Generate extra code to check each memory access. GNU CC will generate
code that is suitable for a detector of bad memory accesses such as
-@file{Checker}. If you specify this option, you can not use the
-@code{asm} or @code{__asm__} keywords.
+@file{Checker}.
You must also specify this option when you compile functions you call that
have side effects. If you do not, you may get erroneous messages from
@@ -5425,6 +5426,22 @@ which are provided by the detector. If you cannot find or build
stubs for every function you call, you may 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. 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.
+
@item -fprefix-function-name
Request GNU CC to add a prefix to the symbols generated for function names.
GNU CC adds a prefix to the names of functions defined as well as
diff --git a/gcc/jump.c b/gcc/jump.c
index 5377eb3e284..2d9559d1e44 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -52,7 +52,7 @@ Boston, MA 02111-1307, USA. */
from other passes as well. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "flags.h"
#include "hard-reg-set.h"
@@ -263,7 +263,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
}
}
- if (!optimize)
+ if (optimize == 0)
{
/* See if there is still a NOTE_INSN_FUNCTION_END in this function.
If so record that this function can drop off the end. */
@@ -478,7 +478,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
/* Change this into a USE so that we won't emit
code for it, but still can keep the note. */
PATTERN (insn)
- = gen_rtx (USE, VOIDmode, XEXP (trial, 0));
+ = gen_rtx_USE (VOIDmode, XEXP (trial, 0));
INSN_CODE (insn) = -1;
/* Remove all reg notes but the REG_DEAD one. */
REG_NOTES (insn) = trial;
@@ -596,19 +596,6 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
rtx nlabel;
int this_is_simplejump, this_is_condjump, reversep;
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);
@@ -644,6 +631,11 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
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. */
@@ -676,18 +668,18 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
}
}
- 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);
@@ -695,6 +687,81 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
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
@@ -702,21 +769,22 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
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)
{
@@ -728,6 +796,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
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
@@ -862,6 +931,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
redirect_jump (p, target);
changed = 1;
+ next = NEXT_INSN (insn);
continue;
}
}
@@ -956,7 +1026,8 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
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
@@ -967,6 +1038,10 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
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.
@@ -1121,8 +1196,127 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
}
#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;
@@ -1144,6 +1338,11 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
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
@@ -1865,93 +2064,11 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
}
}
#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;
- }
- }
- /* 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;
@@ -2102,7 +2219,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
/* Make the old conditional jump
into an unconditional one. */
SET_SRC (PATTERN (insn))
- = gen_rtx (LABEL_REF, VOIDmode, JUMP_LABEL (insn));
+ = gen_rtx_LABEL_REF (VOIDmode, JUMP_LABEL (insn));
INSN_CODE (insn) = -1;
emit_barrier_after (insn);
/* Add to jump_chain unless this is a new label
@@ -2409,8 +2526,10 @@ duplicate_loop_exit_test (loop_start)
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
if (REG_NOTE_KIND (link) != REG_LABEL)
REG_NOTES (copy)
- = copy_rtx (gen_rtx (EXPR_LIST, REG_NOTE_KIND (link),
- XEXP (link, 0), REG_NOTES (copy)));
+ = copy_rtx (gen_rtx_EXPR_LIST (REG_NOTE_KIND (link),
+ XEXP (link, 0),
+ REG_NOTES (copy)));
+
if (reg_map && REG_NOTES (copy))
replace_regs (REG_NOTES (copy), reg_map, max_reg, 1);
break;
@@ -2875,16 +2994,30 @@ can_reverse_comparison_p (comparison, insn)
#endif
)
{
- rtx prev = prev_nonnote_insn (insn);
- rtx set = single_set (prev);
-
- if (set == 0 || SET_DEST (set) != arg0)
- return 0;
-
- arg0 = SET_SRC (set);
+ rtx prev, 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);
+ }
}
/* We can reverse this if ARG0 is a CONST_INT or if its mode is
@@ -3119,27 +3252,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)
@@ -3147,27 +3280,23 @@ condjump_in_parallel_p (insn)
{
register rtx x = PATTERN (insn);
- if (GET_CODE (x) != PARALLEL)
+ if (GET_CODE (x) != PARALLEL
+ || GET_CODE (XVECEXP (x, 0, 0)) != SET
+ || GET_CODE (SET_DEST (XVECEXP (x, 0, 0))) != PC)
return 0;
- else
- x = XVECEXP (x, 0, 0);
- 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)
- 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 (XVECEXP (x, 0, 0));
+
+ 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;
}
@@ -3398,8 +3527,8 @@ mark_jump_label (x, insn, cross_jump)
|| ! (GET_CODE (next) == JUMP_INSN
&& (GET_CODE (PATTERN (next)) == ADDR_VEC
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC)))
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_LABEL, label,
- REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, label,
+ REG_NOTES (insn));
}
}
return;
@@ -3486,15 +3615,16 @@ delete_computation (insn)
delete_computation (prev);
else
/* Otherwise, show that cc0 won't be used. */
- REG_NOTES (prev) = gen_rtx (EXPR_LIST, REG_UNUSED,
- cc0_rtx, REG_NOTES (prev));
+ REG_NOTES (prev) = gen_rtx_EXPR_LIST (REG_UNUSED,
+ cc0_rtx, REG_NOTES (prev));
}
}
#endif
for (note = REG_NOTES (insn); note; note = next)
{
- rtx our_prev;
+ rtx our_prev, our_next;
+ int fail = 0;
next = XEXP (note, 1);
@@ -3503,6 +3633,27 @@ delete_computation (insn)
|| GET_CODE (XEXP (note, 0)) != REG)
continue;
+ /* We can't trust REG_DEAD notes until the next label since both
+ the second sched pass and reload don't bother trying to keep
+ them accurate. So scan ahead until we set the register or
+ we reach a label. If we have no use before that, we're OK. */
+ for (our_next = next_nonnote_insn (insn);
+ ! fail && our_next && GET_CODE (our_next) != CODE_LABEL;
+ our_next = next_nonnote_insn (our_next))
+ {
+ if (GET_RTX_CLASS (GET_CODE (our_next)) == 'i'
+ && reg_set_p (XEXP (note, 0), our_next)
+ && ! reg_referenced_p (XEXP (note, 0), PATTERN (our_next)))
+ break;
+
+ if (GET_RTX_CLASS (GET_CODE (our_next)) == 'i'
+ && reg_referenced_p (XEXP (note, 0), PATTERN (our_next)))
+ fail = 1;
+ }
+
+ if (fail)
+ continue;
+
for (our_prev = prev_nonnote_insn (insn);
our_prev && GET_CODE (our_prev) == INSN;
our_prev = prev_nonnote_insn (our_prev))
@@ -3979,22 +4130,22 @@ redirect_exp (loc, olabel, nlabel, insn)
if (nlabel)
XEXP (x, 0) = nlabel;
else
- return validate_change (insn, loc, gen_rtx (RETURN, VOIDmode), 0);
+ return validate_change (insn, loc, gen_rtx_RETURN (VOIDmode), 0);
return 1;
}
}
else if (code == RETURN && olabel == 0)
{
- x = gen_rtx (LABEL_REF, VOIDmode, nlabel);
+ x = gen_rtx_LABEL_REF (VOIDmode, nlabel);
if (loc == &PATTERN (insn))
- x = gen_rtx (SET, VOIDmode, pc_rtx, x);
+ x = gen_rtx_SET (VOIDmode, pc_rtx, x);
return validate_change (insn, loc, x, 0);
}
if (code == SET && nlabel == 0 && SET_DEST (x) == pc_rtx
&& GET_CODE (SET_SRC (x)) == LABEL_REF
&& XEXP (SET_SRC (x), 0) == olabel)
- return validate_change (insn, loc, gen_rtx (RETURN, VOIDmode), 0);
+ return validate_change (insn, loc, gen_rtx_RETURN (VOIDmode), 0);
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index d9ecbb0f348..d48f5128574 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -2060,12 +2060,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. */
@@ -2147,7 +2147,10 @@ __bb_init_prg ()
bb_hashbuckets = (struct bb_edge **)
malloc (BB_BUCKETS * sizeof (struct bb_edge *));
if (bb_hashbuckets)
- bzero ((char *) bb_hashbuckets, BB_BUCKETS);
+ /* 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 58e5a81e385..edfb6a92390 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -60,7 +60,7 @@ Boston, MA 02111-1307, USA. */
here if their preferred class is likely to be used by spills. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "flags.h"
#include "basic-block.h"
@@ -337,6 +337,7 @@ alloc_qty_for_scratch (scratch, n, insn, insn_code_num, insn_number)
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':
@@ -817,8 +818,8 @@ update_equiv_regs ()
&& ! memref_used_between_p (SET_DEST (set),
reg_equiv_init_insn[regno], insn))
REG_NOTES (reg_equiv_init_insn[regno])
- = gen_rtx (EXPR_LIST, REG_EQUIV, dest,
- REG_NOTES (reg_equiv_init_insn[regno]));
+ = gen_rtx_EXPR_LIST (REG_EQUIV, dest,
+ REG_NOTES (reg_equiv_init_insn[regno]));
/* We only handle the case of a pseudo register being set
once and only if neither the source nor the destination are
@@ -862,8 +863,8 @@ update_equiv_regs ()
if (note == 0 && REG_BASIC_BLOCK (regno) >= 0
&& GET_CODE (SET_SRC (set)) == MEM
&& validate_equiv_mem (insn, dest, SET_SRC (set)))
- REG_NOTES (insn) = note = gen_rtx (EXPR_LIST, REG_EQUIV, SET_SRC (set),
- REG_NOTES (insn));
+ REG_NOTES (insn) = note = gen_rtx_EXPR_LIST (REG_EQUIV, SET_SRC (set),
+ REG_NOTES (insn));
if (note)
{
@@ -1425,8 +1426,8 @@ block_alloc (b)
{
if (GET_CODE (qty_scratch_rtx[q]) == REG)
abort ();
- qty_scratch_rtx[q] = gen_rtx (REG, GET_MODE (qty_scratch_rtx[q]),
- qty_phys_reg[q]);
+ qty_scratch_rtx[q] = gen_rtx_REG (GET_MODE (qty_scratch_rtx[q]),
+ qty_phys_reg[q]);
scratch_block[scratch_index] = b;
scratch_list[scratch_index++] = qty_scratch_rtx[q];
@@ -2168,7 +2169,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 87d5ccf532e..4d27b8a7ee9 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */
while to do these things. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
#include "expr.h"
@@ -305,9 +305,9 @@ void
init_loop ()
{
char *free_point = (char *) oballoc (1);
- rtx reg = gen_rtx (REG, word_mode, LAST_VIRTUAL_REGISTER + 1);
+ rtx reg = gen_rtx_REG (word_mode, LAST_VIRTUAL_REGISTER + 1);
- add_cost = rtx_cost (gen_rtx (PLUS, word_mode, reg, reg), SET);
+ add_cost = rtx_cost (gen_rtx_PLUS (word_mode, reg, reg), SET);
/* We multiply by 2 to reconcile the difference in scale between
these two ways of computing costs. Otherwise the cost of a copy
@@ -1008,7 +1008,7 @@ record_excess_regs (in_this, not_in_this, output)
case REG:
if (REGNO (in_this) >= FIRST_PSEUDO_REGISTER
&& ! reg_mentioned_p (in_this, not_in_this))
- *output = gen_rtx (EXPR_LIST, VOIDmode, in_this, *output);
+ *output = gen_rtx_EXPR_LIST (VOIDmode, in_this, *output);
return;
default:
@@ -1515,8 +1515,8 @@ add_label_notes (x, insns)
{
for (insn = insns; insn; insn = NEXT_INSN (insn))
if (reg_mentioned_p (XEXP (x, 0), insn))
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_LABEL, XEXP (x, 0),
- REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, XEXP (x, 0),
+ REG_NOTES (insn));
}
return;
}
@@ -1667,9 +1667,10 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
REG_NOTES (i1) = REG_NOTES (m->insn);
r1 = SET_DEST (PATTERN (m->insn));
r2 = SET_DEST (PATTERN (m1->insn));
- regs_may_share = gen_rtx (EXPR_LIST, VOIDmode, r1,
- gen_rtx (EXPR_LIST, VOIDmode, r2,
- regs_may_share));
+ regs_may_share
+ = gen_rtx_EXPR_LIST (VOIDmode, r1,
+ gen_rtx_EXPR_LIST (VOIDmode, r2,
+ regs_may_share));
delete_insn (m->insn);
if (new_start == 0)
@@ -1719,9 +1720,8 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
i1 = emit_insns_before (temp, loop_start);
if (! find_reg_note (i1, REG_EQUAL, NULL_RTX))
REG_NOTES (i1)
- = gen_rtx (EXPR_LIST,
- m->is_equiv ? REG_EQUIV : REG_EQUAL,
- m->set_src, REG_NOTES (i1));
+ = gen_rtx_EXPR_LIST (m->is_equiv ? REG_EQUIV : REG_EQUAL,
+ m->set_src, REG_NOTES (i1));
if (loop_dump_stream)
fprintf (loop_dump_stream, " moved to %d", INSN_UID (i1));
@@ -1887,13 +1887,16 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
/* This isn't needed because REG_NOTES is copied
below and is wrong since P might be a PARALLEL. */
if (REG_NOTES (i1) == 0
- && ! m->partial /* But not if it's a zero-extend clr. */
+ && ! m->partial /* But not if it's a zero-extend
+ clear. */
&& ! m->global /* and not if used outside the loop
- (since it might get set outside). */
+ (since it might get set
+ outside). */
&& CONSTANT_P (SET_SRC (PATTERN (p))))
REG_NOTES (i1)
- = gen_rtx (EXPR_LIST, REG_EQUAL,
- SET_SRC (PATTERN (p)), REG_NOTES (i1));
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ SET_SRC (PATTERN (p)),
+ REG_NOTES (i1));
#endif
/* If library call, now fix the REG_NOTES that contain
@@ -2142,12 +2145,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)
@@ -2155,9 +2161,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. */
@@ -3535,8 +3540,8 @@ strength_reduce (scan_start, end, loop_top, insn_count,
if (GET_CODE (test) == NE)
{
bl->init_insn = p;
- bl->init_set = gen_rtx (SET, VOIDmode,
- XEXP (test, 0), XEXP (test, 1));
+ bl->init_set = gen_rtx_SET (VOIDmode,
+ XEXP (test, 0), XEXP (test, 1));
}
else
bl->initial_test = test;
@@ -3603,6 +3608,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)
{
@@ -3683,8 +3689,8 @@ strength_reduce (scan_start, end, loop_top, insn_count,
}
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);
}
}
@@ -3694,8 +3700,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
@@ -3704,6 +3710,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
@@ -4331,13 +4380,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;
@@ -4384,7 +4435,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);
}
@@ -4400,12 +4451,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.
@@ -4522,7 +4573,8 @@ record_biv (v, insn, dest_reg, inc_val, mult_val,
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;
@@ -4530,7 +4582,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;
{
@@ -4549,7 +4601,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;
@@ -4946,15 +4998,16 @@ update_giv_derive (p)
tem = 0;
if (biv->mult_val == const1_rtx)
- tem = simplify_giv_expr (gen_rtx (MULT, giv->mode,
- biv->add_val,
- giv->mult_val),
+ tem = simplify_giv_expr (gen_rtx_MULT (giv->mode,
+ biv->add_val,
+ giv->mult_val),
&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
@@ -5292,7 +5345,7 @@ simplify_giv_expr (x, benefit)
{
tem = plus_constant (arg0, INTVAL (arg1));
if (GET_CODE (tem) != CONST_INT)
- tem = gen_rtx (USE, mode, tem);
+ tem = gen_rtx_USE (mode, tem);
}
return tem;
@@ -5300,15 +5353,17 @@ simplify_giv_expr (x, benefit)
case REG:
case MULT:
/* biv + invar or mult + invar. Return sum. */
- return gen_rtx (PLUS, mode, arg0, arg1);
+ return gen_rtx_PLUS (mode, arg0, arg1);
case PLUS:
/* (a + invar_1) + invar_2. Associate. */
- return simplify_giv_expr (gen_rtx (PLUS, mode,
+ return
+ simplify_giv_expr (gen_rtx_PLUS (mode,
XEXP (arg0, 0),
- gen_rtx (PLUS, mode,
- XEXP (arg0, 1), arg1)),
- benefit);
+ gen_rtx_PLUS (mode,
+ XEXP (arg0, 1),
+ arg1)),
+ benefit);
default:
abort ();
@@ -5317,9 +5372,9 @@ simplify_giv_expr (x, benefit)
/* Each argument must be either REG, PLUS, or MULT. Convert REG to
MULT to reduce cases. */
if (GET_CODE (arg0) == REG)
- arg0 = gen_rtx (MULT, mode, arg0, const1_rtx);
+ arg0 = gen_rtx_MULT (mode, arg0, const1_rtx);
if (GET_CODE (arg1) == REG)
- arg1 = gen_rtx (MULT, mode, arg1, const1_rtx);
+ arg1 = gen_rtx_MULT (mode, arg1, const1_rtx);
/* Now have PLUS + PLUS, PLUS + MULT, MULT + PLUS, or MULT + MULT.
Put a MULT first, leaving PLUS + PLUS, MULT + PLUS, or MULT + MULT.
@@ -5328,11 +5383,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)),
+ return
+ simplify_giv_expr (gen_rtx_PLUS (mode,
+ gen_rtx_PLUS (mode, arg0,
+ XEXP (arg1, 0)),
XEXP (arg1, 1)),
- benefit);
+ benefit);
/* Now must have MULT + MULT. Distribute if same biv, else not giv. */
if (GET_CODE (arg0) != MULT || GET_CODE (arg1) != MULT)
@@ -5341,19 +5397,20 @@ simplify_giv_expr (x, benefit)
if (XEXP (arg0, 0) != XEXP (arg1, 0))
return 0;
- return simplify_giv_expr (gen_rtx (MULT, mode,
- XEXP (arg0, 0),
- gen_rtx (PLUS, mode,
- XEXP (arg0, 1),
- XEXP (arg1, 1))),
+ return simplify_giv_expr (gen_rtx_MULT (mode,
+ XEXP (arg0, 0),
+ gen_rtx_PLUS (mode,
+ XEXP (arg0, 1),
+ XEXP (arg1, 1))),
benefit);
case MINUS:
/* 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), constm1_rtx)),
+ return simplify_giv_expr (gen_rtx_PLUS (mode,
+ XEXP (x, 0),
+ gen_rtx_MULT (mode,
+ XEXP (x, 1),
+ constm1_rtx)),
benefit);
case MULT:
@@ -5382,7 +5439,7 @@ simplify_giv_expr (x, benefit)
{
case REG:
/* biv * invar. Done. */
- return gen_rtx (MULT, mode, arg0, arg1);
+ return gen_rtx_MULT (mode, arg0, arg1);
case CONST_INT:
/* Product of two constants. */
@@ -5394,19 +5451,22 @@ simplify_giv_expr (x, benefit)
case MULT:
/* (a * invar_1) * invar_2. Associate. */
- return simplify_giv_expr (gen_rtx (MULT, mode,
- XEXP (arg0, 0),
- gen_rtx (MULT, mode,
- XEXP (arg0, 1), arg1)),
+ return simplify_giv_expr (gen_rtx_MULT (mode,
+ XEXP (arg0, 0),
+ gen_rtx_MULT (mode,
+ XEXP (arg0, 1),
+ arg1)),
benefit);
case PLUS:
/* (a + invar_1) * invar_2. Distribute. */
- return simplify_giv_expr (gen_rtx (PLUS, mode,
- gen_rtx (MULT, mode,
- XEXP (arg0, 0), arg1),
- gen_rtx (MULT, mode,
- XEXP (arg0, 1), arg1)),
+ return simplify_giv_expr (gen_rtx_PLUS (mode,
+ gen_rtx_MULT (mode,
+ XEXP (arg0, 0),
+ arg1),
+ gen_rtx_MULT (mode,
+ XEXP (arg0, 1),
+ arg1)),
benefit);
default:
@@ -5418,22 +5478,23 @@ simplify_giv_expr (x, benefit)
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
return 0;
- return simplify_giv_expr (gen_rtx (MULT, mode,
+ return
+ simplify_giv_expr (gen_rtx_MULT (mode,
XEXP (x, 0),
GEN_INT ((HOST_WIDE_INT) 1
<< INTVAL (XEXP (x, 1)))),
- benefit);
+ benefit);
case NEG:
/* "-a" is "a * (-1)" */
- return simplify_giv_expr (gen_rtx (MULT, mode, XEXP (x, 0), constm1_rtx),
+ return simplify_giv_expr (gen_rtx_MULT (mode, XEXP (x, 0), constm1_rtx),
benefit);
case NOT:
/* "~a" is "-a - 1". Silly, but easy. */
- return simplify_giv_expr (gen_rtx (MINUS, mode,
- gen_rtx (NEG, mode, XEXP (x, 0)),
- const1_rtx),
+ return simplify_giv_expr (gen_rtx_MINUS (mode,
+ gen_rtx_NEG (mode, XEXP (x, 0)),
+ const1_rtx),
benefit);
case USE:
@@ -5460,11 +5521,12 @@ 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);
+ tem = gen_rtx_MINUS (mode, tem, v->derive_adjustment);
return simplify_giv_expr (tem, benefit);
}
@@ -5484,7 +5546,7 @@ simplify_giv_expr (x, benefit)
if (GET_CODE (x) == CONST_INT)
return x;
else
- return gen_rtx (USE, mode, x);
+ return gen_rtx_USE (mode, x);
}
else
return 0;
@@ -5632,12 +5694,12 @@ express_from (g1, g2)
else if (mult == const1_rtx)
mult = g1->dest_reg;
else
- mult = gen_rtx (MULT, g2->mode, g1->dest_reg, mult);
+ mult = gen_rtx_MULT (g2->mode, g1->dest_reg, mult);
if (add == const0_rtx)
return mult;
else
- return gen_rtx (PLUS, g2->mode, mult, add);
+ return gen_rtx_PLUS (g2->mode, mult, add);
}
#endif
@@ -5963,8 +6025,8 @@ check_dbra_loop (loop_end, insn_count, loop_start)
{
/* register always nonnegative, add REG_NOTE to branch */
REG_NOTES (PREV_INSN (loop_end))
- = gen_rtx (EXPR_LIST, REG_NONNEG, NULL_RTX,
- REG_NOTES (PREV_INSN (loop_end)));
+ = gen_rtx_EXPR_LIST (REG_NONNEG, NULL_RTX,
+ REG_NOTES (PREV_INSN (loop_end)));
bl->nonneg = 1;
return 1;
@@ -5988,8 +6050,8 @@ check_dbra_loop (loop_end, insn_count, loop_start)
&& INTVAL (bl->biv->add_val) == -1)
{
REG_NOTES (PREV_INSN (loop_end))
- = gen_rtx (EXPR_LIST, REG_NONNEG, NULL_RTX,
- REG_NOTES (PREV_INSN (loop_end)));
+ = gen_rtx_EXPR_LIST (REG_NONNEG, NULL_RTX,
+ REG_NOTES (PREV_INSN (loop_end)));
bl->nonneg = 1;
return 1;
@@ -6192,8 +6254,8 @@ check_dbra_loop (loop_end, insn_count, loop_start)
/* Increment of LABEL_NUSES done above. */
/* Register is now always nonnegative,
so add REG_NONNEG note to the branch. */
- REG_NOTES (tem) = gen_rtx (EXPR_LIST, REG_NONNEG, NULL_RTX,
- REG_NOTES (tem));
+ REG_NOTES (tem) = gen_rtx_EXPR_LIST (REG_NONNEG, NULL_RTX,
+ REG_NOTES (tem));
}
bl->nonneg = 1;
@@ -6347,8 +6409,8 @@ maybe_eliminate_biv_1 (x, insn, bl, eliminate_p, where)
/* If the giv has the opposite direction of change,
then reverse the comparison. */
if (INTVAL (v->mult_val) < 0)
- new = gen_rtx (COMPARE, GET_MODE (v->new_reg),
- const0_rtx, v->new_reg);
+ new = gen_rtx_COMPARE (GET_MODE (v->new_reg),
+ const0_rtx, v->new_reg);
else
new = v->new_reg;
@@ -6390,11 +6452,11 @@ maybe_eliminate_biv_1 (x, insn, bl, eliminate_p, where)
/* If the giv has the opposite direction of change,
then reverse the comparison. */
if (INTVAL (v->mult_val) < 0)
- new = gen_rtx (COMPARE, VOIDmode, copy_rtx (v->add_val),
- v->new_reg);
+ new = gen_rtx_COMPARE (VOIDmode, copy_rtx (v->add_val),
+ v->new_reg);
else
- new = gen_rtx (COMPARE, VOIDmode, v->new_reg,
- copy_rtx (v->add_val));
+ new = gen_rtx_COMPARE (VOIDmode, v->new_reg,
+ copy_rtx (v->add_val));
/* Replace biv with the giv's reduced register. */
update_reg_last_use (v->add_val, insn);
diff --git a/gcc/mbchar.c b/gcc/mbchar.c
index d54a49749ce..84c9f97b137 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
@@ -33,36 +31,29 @@ Boston, MA 02111-1307, USA. */
#ifdef MULTIBYTE_CHARS
#include "config.h"
-#include "system.h"
#include "gansidecl.h"
+#include "system.h"
#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},
@@ -76,87 +67,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"))
@@ -169,12 +185,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)
@@ -214,59 +231,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 a4b82c0558d..5eef303b0a4 100644
--- a/gcc/mbchar.h
+++ b/gcc/mbchar.h
@@ -1,12 +1,27 @@
-/* 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.
- */
-#ifndef __GCC_MBCHAR_H__
-#define __GCC_MBCHAR_H__
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
#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)
@@ -14,12 +29,10 @@
#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 732182cd8ad..d9a61384e7d 100644
--- a/gcc/md.texi
+++ b/gcc/md.texi
@@ -1118,6 +1118,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 edebf022c1e..3ccdc0a4a26 100644
--- a/gcc/mips-tdump.c
+++ b/gcc/mips-tdump.c
@@ -1,5 +1,5 @@
/* Read and manage MIPS symbol tables from object modules.
- Copyright (C) 1991, 1994, 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
Contributed by hartzell@boulder.colorado.edu,
Rewritten by meissner@osf.org.
@@ -21,17 +21,8 @@ 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 <sys/file.h>
-#include <time.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#ifdef index
-#undef index
-#undef rindex
-#endif
+#include "system.h"
+
#ifndef CROSS_COMPILE
#include <a.out.h>
#else
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index 20271722c4b..d757b9b087a 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -600,12 +600,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include <stdio.h>
+#include "system.h"
#ifndef __SABER__
#define saber_stop()
@@ -615,7 +610,7 @@ Boston, MA 02111-1307, USA. */
#define __LINE__ 0
#endif
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
typedef void *PTR_T;
typedef const void *CPTR_T;
#define __proto(x) x
@@ -5609,14 +5604,14 @@ free_thead (ptr)
void
fatal VPROTO((const char *format, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *format;
#endif
va_list ap;
VA_START (ap, format);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
#endif
@@ -5639,14 +5634,14 @@ fatal VPROTO((const char *format, ...))
void
error VPROTO((const char *format, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *format;
#endif
va_list ap;
VA_START (ap, format);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
format = va_arg (ap, char *);
#endif
diff --git a/gcc/objc/Makefile.in b/gcc/objc/Makefile.in
index 9d521f54cdc..5e1662a21b5 100644
--- a/gcc/objc/Makefile.in
+++ b/gcc/objc/Makefile.in
@@ -1,5 +1,5 @@
# GNU Objective C Runtime Makefile
-# Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
#
# This file is part of GNU CC.
#
@@ -72,6 +72,7 @@ objc-runtime:
copy-headers:
-rm -fr $(incinstalldir)/objc
-mkdir $(incinstalldir)/objc
+ -chmod a+rx $(incinstalldir)/objc
for file in $(OBJC_H); do \
realfile=$(srcdir)/$${file}; \
cp $${realfile} $(incinstalldir)/objc; \
diff --git a/gcc/objc/objc-parse.c b/gcc/objc/objc-parse.c
index 8795b6fc3c0..79d156691e2 100644
--- a/gcc/objc/objc-parse.c
+++ b/gcc/objc/objc-parse.c
@@ -68,11 +68,8 @@
#line 33 "objc-parse.y"
#include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
#include <setjmp.h>
-
#include "tree.h"
#include "input.h"
#include "c-lex.h"
@@ -102,10 +99,10 @@ void yyerror ();
/* Cause the `yydebug' variable to be defined. */
#define YYDEBUG 1
-#line 72 "objc-parse.y"
+#line 69 "objc-parse.y"
typedef union {long itype; tree ttype; enum tree_code code;
char *filename; int lineno; int ends_in_label; } YYSTYPE;
-#line 199 "objc-parse.y"
+#line 196 "objc-parse.y"
/* Number of statements (loosely speaking) and compound statements
seen so far. */
@@ -434,62 +431,62 @@ static const short yyrhs[] = { -1,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 239, 244, 258, 260, 260, 261, 263, 265, 266, 267,
- 275, 279, 290, 295, 300, 302, 304, 305, 306, 311,
- 318, 320, 325, 330, 336, 338, 343, 348, 354, 356,
- 361, 368, 370, 371, 372, 375, 377, 379, 381, 383,
- 385, 387, 391, 395, 398, 401, 404, 408, 410, 413,
- 416, 420, 448, 454, 457, 460, 463, 465, 469, 473,
- 477, 479, 482, 486, 513, 515, 517, 519, 521, 523,
- 525, 527, 529, 531, 533, 535, 537, 539, 543, 545,
- 549, 551, 554, 558, 560, 567, 570, 573, 579, 739,
- 740, 742, 748, 750, 764, 787, 789, 791, 803, 817,
- 819, 821, 823, 825, 827, 829, 834, 836, 842, 844,
- 848, 850, 851, 861, 866, 868, 869, 870, 877, 883,
- 888, 891, 899, 904, 906, 907, 908, 915, 926, 930,
- 936, 941, 946, 951, 953, 955, 964, 967, 971, 973,
- 975, 980, 984, 987, 991, 994, 996, 1008, 1011, 1013,
- 1015, 1019, 1023, 1025, 1028, 1041, 1044, 1048, 1050, 1058,
- 1059, 1060, 1064, 1066, 1071, 1073, 1075, 1081, 1082, 1083,
- 1086, 1088, 1091, 1093, 1096, 1099, 1105, 1112, 1114, 1121,
- 1128, 1131, 1138, 1141, 1145, 1148, 1152, 1157, 1160, 1164,
- 1167, 1169, 1171, 1173, 1180, 1182, 1183, 1184, 1189, 1191,
- 1196, 1204, 1209, 1213, 1216, 1218, 1223, 1226, 1228, 1230,
- 1234, 1237, 1237, 1240, 1242, 1253, 1261, 1265, 1276, 1284,
- 1291, 1293, 1298, 1301, 1306, 1308, 1310, 1317, 1319, 1320,
- 1328, 1334, 1336, 1338, 1345, 1347, 1353, 1359, 1361, 1363,
- 1365, 1372, 1374, 1377, 1382, 1384, 1388, 1390, 1392, 1394,
- 1398, 1400, 1403, 1406, 1409, 1412, 1416, 1418, 1421, 1423,
- 1427, 1430, 1435, 1437, 1439, 1443, 1467, 1474, 1479, 1485,
- 1490, 1492, 1497, 1499, 1503, 1507, 1511, 1521, 1523, 1528,
- 1533, 1536, 1540, 1543, 1547, 1550, 1553, 1556, 1560, 1563,
- 1567, 1571, 1573, 1575, 1577, 1579, 1581, 1583, 1585, 1595,
- 1603, 1605, 1607, 1611, 1613, 1616, 1619, 1632, 1634, 1639,
- 1641, 1644, 1658, 1661, 1664, 1666, 1668, 1676, 1684, 1695,
- 1700, 1703, 1717, 1726, 1730, 1734, 1738, 1744, 1748, 1753,
- 1756, 1761, 1764, 1765, 1782, 1787, 1790, 1802, 1804, 1814,
- 1824, 1825, 1833, 1836, 1848, 1852, 1869, 1879, 1888, 1893,
- 1898, 1903, 1907, 1911, 1922, 1929, 1936, 1943, 1954, 1960,
- 1963, 1968, 1991, 2025, 2056, 2087, 2102, 2113, 2117, 2121,
- 2124, 2129, 2131, 2134, 2136, 2140, 2145, 2148, 2154, 2159,
- 2164, 2166, 2175, 2176, 2182, 2184, 2194, 2196, 2200, 2203,
- 2209, 2219, 2228, 2237, 2247, 2261, 2266, 2271, 2273, 2282,
- 2285, 2290, 2293, 2297, 2305, 2307, 2308, 2309, 2310, 2311,
- 2325, 2328, 2332, 2338, 2344, 2351, 2356, 2362, 2369, 2375,
- 2381, 2386, 2392, 2399, 2405, 2411, 2417, 2425, 2431, 2437,
- 2445, 2452, 2458, 2467, 2474, 2482, 2487, 2490, 2500, 2502,
- 2505, 2507, 2508, 2511, 2516, 2517, 2534, 2541, 2547, 2551,
- 2554, 2555, 2558, 2566, 2572, 2581, 2591, 2598, 2602, 2607,
- 2616, 2623, 2627, 2637, 2639, 2640, 2642, 2644, 2645, 2646,
- 2647, 2649, 2651, 2654, 2660, 2665, 2665, 2670, 2674, 2676,
- 2682, 2687, 2692, 2701, 2703, 2709, 2711, 2714, 2716, 2717,
- 2718, 2721, 2727, 2729, 2733, 2736, 2743, 2749, 2754, 2761,
- 2766, 2771, 2776, 2783, 2787, 2790, 2796, 2798, 2799, 2800,
- 2803, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813,
- 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823,
- 2823, 2826, 2832, 2837, 2842, 2848, 2850, 2853, 2855, 2862,
- 2874, 2879, 2885, 2887, 2893, 2897, 2898, 2904, 2906, 2909,
- 2911, 2917, 2922, 2928, 2935, 2944
+ 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, 466, 470,
+ 474, 476, 479, 483, 510, 512, 514, 516, 518, 520,
+ 522, 524, 526, 528, 530, 532, 534, 536, 540, 542,
+ 546, 548, 551, 555, 557, 564, 567, 570, 576, 736,
+ 737, 739, 745, 747, 761, 784, 786, 788, 800, 814,
+ 816, 818, 820, 822, 824, 826, 831, 833, 839, 841,
+ 845, 847, 848, 858, 863, 865, 866, 867, 874, 880,
+ 885, 888, 896, 901, 903, 904, 905, 912, 923, 927,
+ 933, 938, 943, 948, 950, 952, 961, 964, 968, 970,
+ 972, 977, 981, 984, 988, 991, 993, 1005, 1008, 1010,
+ 1012, 1016, 1020, 1022, 1025, 1038, 1041, 1045, 1047, 1055,
+ 1056, 1057, 1061, 1063, 1068, 1070, 1072, 1078, 1079, 1080,
+ 1083, 1085, 1088, 1090, 1093, 1096, 1102, 1109, 1111, 1118,
+ 1125, 1128, 1135, 1138, 1142, 1145, 1149, 1154, 1157, 1161,
+ 1164, 1166, 1168, 1170, 1177, 1179, 1180, 1181, 1186, 1188,
+ 1193, 1201, 1206, 1210, 1213, 1215, 1220, 1223, 1225, 1227,
+ 1231, 1234, 1234, 1237, 1239, 1250, 1258, 1262, 1273, 1281,
+ 1288, 1290, 1295, 1298, 1303, 1305, 1307, 1314, 1316, 1317,
+ 1325, 1331, 1333, 1335, 1342, 1344, 1350, 1356, 1358, 1360,
+ 1362, 1369, 1371, 1374, 1379, 1381, 1385, 1387, 1389, 1391,
+ 1395, 1397, 1400, 1403, 1406, 1409, 1413, 1415, 1418, 1420,
+ 1424, 1427, 1432, 1434, 1436, 1440, 1464, 1471, 1476, 1482,
+ 1487, 1489, 1494, 1496, 1500, 1504, 1508, 1518, 1520, 1525,
+ 1530, 1533, 1537, 1540, 1544, 1547, 1550, 1553, 1557, 1560,
+ 1564, 1568, 1570, 1572, 1574, 1576, 1578, 1580, 1582, 1592,
+ 1600, 1602, 1604, 1608, 1610, 1613, 1616, 1629, 1631, 1636,
+ 1638, 1641, 1655, 1658, 1661, 1663, 1665, 1673, 1681, 1692,
+ 1697, 1700, 1714, 1723, 1727, 1731, 1735, 1741, 1745, 1750,
+ 1753, 1758, 1761, 1762, 1779, 1784, 1787, 1799, 1801, 1811,
+ 1821, 1822, 1830, 1833, 1845, 1849, 1866, 1876, 1885, 1890,
+ 1895, 1900, 1904, 1908, 1919, 1926, 1933, 1940, 1951, 1957,
+ 1960, 1965, 1988, 2022, 2053, 2084, 2099, 2110, 2114, 2118,
+ 2121, 2126, 2128, 2131, 2133, 2137, 2142, 2145, 2151, 2156,
+ 2161, 2163, 2172, 2173, 2179, 2181, 2191, 2193, 2197, 2200,
+ 2206, 2216, 2225, 2234, 2244, 2258, 2263, 2268, 2270, 2279,
+ 2282, 2287, 2290, 2294, 2302, 2304, 2305, 2306, 2307, 2308,
+ 2322, 2325, 2329, 2335, 2341, 2348, 2353, 2359, 2366, 2372,
+ 2378, 2383, 2389, 2396, 2402, 2408, 2414, 2422, 2428, 2434,
+ 2442, 2449, 2455, 2464, 2471, 2479, 2484, 2487, 2497, 2499,
+ 2502, 2504, 2505, 2508, 2513, 2514, 2531, 2538, 2544, 2548,
+ 2551, 2552, 2555, 2563, 2569, 2578, 2588, 2595, 2599, 2604,
+ 2613, 2620, 2624, 2634, 2636, 2637, 2639, 2641, 2642, 2643,
+ 2644, 2646, 2648, 2651, 2657, 2662, 2662, 2667, 2671, 2673,
+ 2679, 2684, 2689, 2698, 2700, 2706, 2708, 2711, 2713, 2714,
+ 2715, 2718, 2724, 2726, 2730, 2733, 2740, 2746, 2751, 2758,
+ 2763, 2768, 2773, 2780, 2784, 2787, 2793, 2795, 2796, 2797,
+ 2800, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810,
+ 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820,
+ 2820, 2823, 2829, 2834, 2839, 2845, 2847, 2850, 2852, 2859,
+ 2871, 2876, 2882, 2884, 2890, 2894, 2895, 2901, 2903, 2906,
+ 2908, 2914, 2919, 2925, 2932, 2941
};
#endif
@@ -2131,14 +2128,14 @@ yyreduce:
switch (yyn) {
case 1:
-#line 240 "objc-parse.y"
+#line 237 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids an empty source file");
finish_file ();
;
break;}
case 2:
-#line 245 "objc-parse.y"
+#line 242 "objc-parse.y"
{
/* In case there were missing closebraces,
get us back to the global binding level. */
@@ -2148,15 +2145,15 @@ case 2:
;
break;}
case 3:
-#line 259 "objc-parse.y"
+#line 256 "objc-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
case 5:
-#line 260 "objc-parse.y"
+#line 257 "objc-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
case 10:
-#line 268 "objc-parse.y"
+#line 265 "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)
@@ -2166,11 +2163,11 @@ case 10:
error ("argument of `asm' is not a constant string"); ;
break;}
case 11:
-#line 276 "objc-parse.y"
+#line 273 "objc-parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
case 12:
-#line 281 "objc-parse.y"
+#line 278 "objc-parse.y"
{ if (pedantic)
error ("ANSI C forbids data definition with no type or storage class");
else if (!flag_traditional)
@@ -2182,45 +2179,45 @@ case 12:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 13:
-#line 291 "objc-parse.y"
+#line 288 "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 296 "objc-parse.y"
+#line 293 "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 301 "objc-parse.y"
+#line 298 "objc-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 16:
-#line 303 "objc-parse.y"
+#line 300 "objc-parse.y"
{ shadow_tag (yyvsp[-1].ttype); ;
break;}
case 19:
-#line 307 "objc-parse.y"
+#line 304 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C does not allow extra `;' outside of a function"); ;
break;}
case 20:
-#line 313 "objc-parse.y"
+#line 310 "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 318 "objc-parse.y"
+#line 315 "objc-parse.y"
{ store_parm_decls (); ;
break;}
case 22:
-#line 320 "objc-parse.y"
+#line 317 "objc-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -2228,25 +2225,25 @@ case 22:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 23:
-#line 326 "objc-parse.y"
+#line 323 "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 331 "objc-parse.y"
+#line 328 "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 336 "objc-parse.y"
+#line 333 "objc-parse.y"
{ store_parm_decls (); ;
break;}
case 26:
-#line 338 "objc-parse.y"
+#line 335 "objc-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -2254,25 +2251,25 @@ case 26:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 27:
-#line 344 "objc-parse.y"
+#line 341 "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 349 "objc-parse.y"
+#line 346 "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 354 "objc-parse.y"
+#line 351 "objc-parse.y"
{ store_parm_decls (); ;
break;}
case 30:
-#line 356 "objc-parse.y"
+#line 353 "objc-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -2280,72 +2277,72 @@ case 30:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 31:
-#line 362 "objc-parse.y"
+#line 359 "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 376 "objc-parse.y"
+#line 373 "objc-parse.y"
{ yyval.code = ADDR_EXPR; ;
break;}
case 37:
-#line 378 "objc-parse.y"
+#line 375 "objc-parse.y"
{ yyval.code = NEGATE_EXPR; ;
break;}
case 38:
-#line 380 "objc-parse.y"
+#line 377 "objc-parse.y"
{ yyval.code = CONVERT_EXPR; ;
break;}
case 39:
-#line 382 "objc-parse.y"
+#line 379 "objc-parse.y"
{ yyval.code = PREINCREMENT_EXPR; ;
break;}
case 40:
-#line 384 "objc-parse.y"
+#line 381 "objc-parse.y"
{ yyval.code = PREDECREMENT_EXPR; ;
break;}
case 41:
-#line 386 "objc-parse.y"
+#line 383 "objc-parse.y"
{ yyval.code = BIT_NOT_EXPR; ;
break;}
case 42:
-#line 388 "objc-parse.y"
+#line 385 "objc-parse.y"
{ yyval.code = TRUTH_NOT_EXPR; ;
break;}
case 43:
-#line 392 "objc-parse.y"
+#line 389 "objc-parse.y"
{ yyval.ttype = build_compound_expr (yyvsp[0].ttype); ;
break;}
case 44:
-#line 397 "objc-parse.y"
+#line 394 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 46:
-#line 403 "objc-parse.y"
+#line 400 "objc-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 47:
-#line 405 "objc-parse.y"
+#line 402 "objc-parse.y"
{ chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 49:
-#line 411 "objc-parse.y"
+#line 408 "objc-parse.y"
{ yyval.ttype = build_indirect_ref (yyvsp[0].ttype, "unary *"); ;
break;}
case 50:
-#line 414 "objc-parse.y"
+#line 411 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
case 51:
-#line 417 "objc-parse.y"
+#line 414 "objc-parse.y"
{ yyval.ttype = build_unary_op (yyvsp[-1].code, yyvsp[0].ttype, 0);
overflow_warning (yyval.ttype); ;
break;}
case 52:
-#line 421 "objc-parse.y"
+#line 418 "objc-parse.y"
{ tree label = lookup_label (yyvsp[0].ttype);
if (pedantic)
pedwarn ("ANSI C forbids `&&'");
@@ -2360,7 +2357,7 @@ case 52:
;
break;}
case 53:
-#line 449 "objc-parse.y"
+#line 446 "objc-parse.y"
{ skip_evaluation--;
if (TREE_CODE (yyvsp[0].ttype) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (yyvsp[0].ttype, 1)))
@@ -2368,49 +2365,49 @@ case 53:
yyval.ttype = c_sizeof (TREE_TYPE (yyvsp[0].ttype)); ;
break;}
case 54:
-#line 455 "objc-parse.y"
+#line 452 "objc-parse.y"
{ skip_evaluation--;
yyval.ttype = c_sizeof (groktypename (yyvsp[-1].ttype)); ;
break;}
case 55:
-#line 458 "objc-parse.y"
+#line 455 "objc-parse.y"
{ skip_evaluation--;
yyval.ttype = c_alignof_expr (yyvsp[0].ttype); ;
break;}
case 56:
-#line 461 "objc-parse.y"
+#line 458 "objc-parse.y"
{ skip_evaluation--;
yyval.ttype = c_alignof (groktypename (yyvsp[-1].ttype)); ;
break;}
case 57:
-#line 464 "objc-parse.y"
+#line 461 "objc-parse.y"
{ yyval.ttype = build_unary_op (REALPART_EXPR, yyvsp[0].ttype, 0); ;
break;}
case 58:
-#line 466 "objc-parse.y"
+#line 463 "objc-parse.y"
{ yyval.ttype = build_unary_op (IMAGPART_EXPR, yyvsp[0].ttype, 0); ;
break;}
case 59:
-#line 470 "objc-parse.y"
+#line 467 "objc-parse.y"
{ skip_evaluation++; ;
break;}
case 60:
-#line 474 "objc-parse.y"
+#line 471 "objc-parse.y"
{ skip_evaluation++; ;
break;}
case 62:
-#line 480 "objc-parse.y"
+#line 477 "objc-parse.y"
{ tree type = groktypename (yyvsp[-2].ttype);
yyval.ttype = build_c_cast (type, yyvsp[0].ttype); ;
break;}
case 63:
-#line 483 "objc-parse.y"
+#line 480 "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 64:
-#line 487 "objc-parse.y"
+#line 484 "objc-parse.y"
{ char *name;
tree result = pop_init_level (0);
tree type = yyvsp[-5].ttype;
@@ -2437,90 +2434,90 @@ case 64:
;
break;}
case 66:
-#line 516 "objc-parse.y"
+#line 513 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 67:
-#line 518 "objc-parse.y"
+#line 515 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 68:
-#line 520 "objc-parse.y"
+#line 517 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 69:
-#line 522 "objc-parse.y"
+#line 519 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 70:
-#line 524 "objc-parse.y"
+#line 521 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 71:
-#line 526 "objc-parse.y"
+#line 523 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 72:
-#line 528 "objc-parse.y"
+#line 525 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 73:
-#line 530 "objc-parse.y"
+#line 527 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 74:
-#line 532 "objc-parse.y"
+#line 529 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 75:
-#line 534 "objc-parse.y"
+#line 531 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 76:
-#line 536 "objc-parse.y"
+#line 533 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 77:
-#line 538 "objc-parse.y"
+#line 535 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 78:
-#line 540 "objc-parse.y"
+#line 537 "objc-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_false_node; ;
break;}
case 79:
-#line 543 "objc-parse.y"
+#line 540 "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 80:
-#line 546 "objc-parse.y"
+#line 543 "objc-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_true_node; ;
break;}
case 81:
-#line 549 "objc-parse.y"
+#line 546 "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 82:
-#line 552 "objc-parse.y"
+#line 549 "objc-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_false_node; ;
break;}
case 83:
-#line 555 "objc-parse.y"
+#line 552 "objc-parse.y"
{ skip_evaluation += ((yyvsp[-4].ttype == boolean_true_node)
- (yyvsp[-4].ttype == boolean_false_node)); ;
break;}
case 84:
-#line 558 "objc-parse.y"
+#line 555 "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 85:
-#line 561 "objc-parse.y"
+#line 558 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids omitting the middle term of a ?: expression");
/* Make sure first operand is calculated only once. */
@@ -2529,23 +2526,23 @@ case 85:
skip_evaluation += yyvsp[-1].ttype == boolean_true_node; ;
break;}
case 86:
-#line 568 "objc-parse.y"
+#line 565 "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 87:
-#line 571 "objc-parse.y"
+#line 568 "objc-parse.y"
{ yyval.ttype = build_modify_expr (yyvsp[-2].ttype, NOP_EXPR, yyvsp[0].ttype);
C_SET_EXP_ORIGINAL_CODE (yyval.ttype, MODIFY_EXPR); ;
break;}
case 88:
-#line 574 "objc-parse.y"
+#line 571 "objc-parse.y"
{ yyval.ttype = build_modify_expr (yyvsp[-2].ttype, yyvsp[-1].code, yyvsp[0].ttype);
/* This inhibits warnings in truthvalue_conversion. */
C_SET_EXP_ORIGINAL_CODE (yyval.ttype, ERROR_MARK); ;
break;}
case 89:
-#line 581 "objc-parse.y"
+#line 578 "objc-parse.y"
{
yyval.ttype = lastiddecl;
if (!yyval.ttype || yyval.ttype == error_mark_node)
@@ -2706,11 +2703,11 @@ case 89:
;
break;}
case 91:
-#line 741 "objc-parse.y"
+#line 738 "objc-parse.y"
{ yyval.ttype = combine_strings (yyvsp[0].ttype); ;
break;}
case 92:
-#line 743 "objc-parse.y"
+#line 740 "objc-parse.y"
{ char class = TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype));
if (class == 'e' || class == '1'
|| class == '2' || class == '<')
@@ -2718,11 +2715,11 @@ case 92:
yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 93:
-#line 749 "objc-parse.y"
+#line 746 "objc-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 94:
-#line 751 "objc-parse.y"
+#line 748 "objc-parse.y"
{ if (current_function_decl == 0)
{
error ("braced-group within expression allowed only inside a function");
@@ -2738,7 +2735,7 @@ case 94:
yyval.ttype = expand_start_stmt_expr (); ;
break;}
case 95:
-#line 765 "objc-parse.y"
+#line 762 "objc-parse.y"
{ tree rtl_exp;
if (pedantic)
pedwarn ("ANSI C forbids braced-groups within expressions");
@@ -2763,15 +2760,15 @@ case 95:
;
break;}
case 96:
-#line 788 "objc-parse.y"
+#line 785 "objc-parse.y"
{ yyval.ttype = build_function_call (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 97:
-#line 790 "objc-parse.y"
+#line 787 "objc-parse.y"
{ yyval.ttype = build_array_ref (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 98:
-#line 792 "objc-parse.y"
+#line 789 "objc-parse.y"
{
if (doing_objc_thang)
{
@@ -2785,7 +2782,7 @@ case 98:
;
break;}
case 99:
-#line 804 "objc-parse.y"
+#line 801 "objc-parse.y"
{
tree expr = build_indirect_ref (yyvsp[-2].ttype, "->");
@@ -2801,80 +2798,80 @@ case 99:
;
break;}
case 100:
-#line 818 "objc-parse.y"
+#line 815 "objc-parse.y"
{ yyval.ttype = build_unary_op (POSTINCREMENT_EXPR, yyvsp[-1].ttype, 0); ;
break;}
case 101:
-#line 820 "objc-parse.y"
+#line 817 "objc-parse.y"
{ yyval.ttype = build_unary_op (POSTDECREMENT_EXPR, yyvsp[-1].ttype, 0); ;
break;}
case 102:
-#line 822 "objc-parse.y"
+#line 819 "objc-parse.y"
{ yyval.ttype = build_message_expr (yyvsp[0].ttype); ;
break;}
case 103:
-#line 824 "objc-parse.y"
+#line 821 "objc-parse.y"
{ yyval.ttype = build_selector_expr (yyvsp[0].ttype); ;
break;}
case 104:
-#line 826 "objc-parse.y"
+#line 823 "objc-parse.y"
{ yyval.ttype = build_protocol_expr (yyvsp[0].ttype); ;
break;}
case 105:
-#line 828 "objc-parse.y"
+#line 825 "objc-parse.y"
{ yyval.ttype = build_encode_expr (yyvsp[0].ttype); ;
break;}
case 106:
-#line 830 "objc-parse.y"
+#line 827 "objc-parse.y"
{ yyval.ttype = build_objc_string_object (yyvsp[0].ttype); ;
break;}
case 108:
-#line 837 "objc-parse.y"
+#line 834 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 110:
-#line 845 "objc-parse.y"
+#line 842 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 113:
-#line 853 "objc-parse.y"
+#line 850 "objc-parse.y"
{ c_mark_varargs ();
if (pedantic)
pedwarn ("ANSI C does not permit use of `varargs.h'"); ;
break;}
case 114:
-#line 863 "objc-parse.y"
+#line 860 "objc-parse.y"
{ ;
break;}
case 119:
-#line 879 "objc-parse.y"
+#line 876 "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 120:
-#line 884 "objc-parse.y"
+#line 881 "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 889 "objc-parse.y"
+#line 886 "objc-parse.y"
{ shadow_tag_warned (yyvsp[-1].ttype, 1);
pedwarn ("empty declaration"); ;
break;}
case 122:
-#line 892 "objc-parse.y"
+#line 889 "objc-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 123:
-#line 901 "objc-parse.y"
+#line 898 "objc-parse.y"
{ ;
break;}
case 128:
-#line 916 "objc-parse.y"
+#line 913 "objc-parse.y"
{ yyval.itype = suspend_momentary ();
pending_xref_error ();
declspec_stack = tree_cons (prefix_attributes,
@@ -2884,131 +2881,131 @@ case 128:
&current_declspecs, &prefix_attributes); ;
break;}
case 129:
-#line 927 "objc-parse.y"
+#line 924 "objc-parse.y"
{ prefix_attributes = chainon (prefix_attributes, yyvsp[0].ttype); ;
break;}
case 130:
-#line 932 "objc-parse.y"
+#line 929 "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 131:
-#line 937 "objc-parse.y"
+#line 934 "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 942 "objc-parse.y"
+#line 939 "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 133:
-#line 947 "objc-parse.y"
+#line 944 "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 952 "objc-parse.y"
+#line 949 "objc-parse.y"
{ shadow_tag (yyvsp[-1].ttype); ;
break;}
case 135:
-#line 954 "objc-parse.y"
+#line 951 "objc-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 136:
-#line 956 "objc-parse.y"
+#line 953 "objc-parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
case 137:
-#line 966 "objc-parse.y"
+#line 963 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 138:
-#line 968 "objc-parse.y"
+#line 965 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 139:
-#line 972 "objc-parse.y"
+#line 969 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 140:
-#line 974 "objc-parse.y"
+#line 971 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 141:
-#line 976 "objc-parse.y"
+#line 973 "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 142:
-#line 981 "objc-parse.y"
+#line 978 "objc-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 143:
-#line 986 "objc-parse.y"
+#line 983 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 144:
-#line 988 "objc-parse.y"
+#line 985 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 145:
-#line 993 "objc-parse.y"
+#line 990 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 146:
-#line 995 "objc-parse.y"
+#line 992 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 147:
-#line 997 "objc-parse.y"
+#line 994 "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 148:
-#line 1010 "objc-parse.y"
+#line 1007 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 149:
-#line 1012 "objc-parse.y"
+#line 1009 "objc-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, NULL_TREE); ;
break;}
case 150:
-#line 1014 "objc-parse.y"
+#line 1011 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 151:
-#line 1016 "objc-parse.y"
+#line 1013 "objc-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 152:
-#line 1021 "objc-parse.y"
+#line 1018 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE);
TREE_STATIC (yyval.ttype) = 1; ;
break;}
case 153:
-#line 1024 "objc-parse.y"
+#line 1021 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 154:
-#line 1026 "objc-parse.y"
+#line 1023 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype);
TREE_STATIC (yyval.ttype) = 1; ;
break;}
case 155:
-#line 1029 "objc-parse.y"
+#line 1026 "objc-parse.y"
{ if (extra_warnings && TREE_STATIC (yyvsp[-1].ttype))
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyvsp[0].ttype));
@@ -3016,150 +3013,150 @@ case 155:
TREE_STATIC (yyval.ttype) = TREE_STATIC (yyvsp[-1].ttype); ;
break;}
case 156:
-#line 1043 "objc-parse.y"
+#line 1040 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 157:
-#line 1045 "objc-parse.y"
+#line 1042 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 158:
-#line 1049 "objc-parse.y"
+#line 1046 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 159:
-#line 1051 "objc-parse.y"
+#line 1048 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 162:
-#line 1061 "objc-parse.y"
+#line 1058 "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 163:
-#line 1065 "objc-parse.y"
+#line 1062 "objc-parse.y"
{ yyval.ttype = get_static_reference (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 164:
-#line 1067 "objc-parse.y"
+#line 1064 "objc-parse.y"
{ yyval.ttype = get_object_reference (yyvsp[0].ttype); ;
break;}
case 165:
-#line 1072 "objc-parse.y"
+#line 1069 "objc-parse.y"
{ yyval.ttype = get_object_reference (yyvsp[0].ttype); ;
break;}
case 166:
-#line 1074 "objc-parse.y"
+#line 1071 "objc-parse.y"
{ yyval.ttype = TREE_TYPE (yyvsp[-1].ttype); ;
break;}
case 167:
-#line 1076 "objc-parse.y"
+#line 1073 "objc-parse.y"
{ yyval.ttype = groktypename (yyvsp[-1].ttype); ;
break;}
case 175:
-#line 1098 "objc-parse.y"
+#line 1095 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 176:
-#line 1100 "objc-parse.y"
+#line 1097 "objc-parse.y"
{ if (TREE_CHAIN (yyvsp[-1].ttype)) yyvsp[-1].ttype = combine_strings (yyvsp[-1].ttype);
yyval.ttype = yyvsp[-1].ttype;
;
break;}
case 177:
-#line 1107 "objc-parse.y"
+#line 1104 "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 178:
-#line 1112 "objc-parse.y"
+#line 1109 "objc-parse.y"
{ finish_init ();
finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype); ;
break;}
case 179:
-#line 1115 "objc-parse.y"
+#line 1112 "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 180:
-#line 1123 "objc-parse.y"
+#line 1120 "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 181:
-#line 1128 "objc-parse.y"
+#line 1125 "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 182:
-#line 1132 "objc-parse.y"
+#line 1129 "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 183:
-#line 1140 "objc-parse.y"
+#line 1137 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 184:
-#line 1142 "objc-parse.y"
+#line 1139 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 185:
-#line 1147 "objc-parse.y"
+#line 1144 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 186:
-#line 1149 "objc-parse.y"
+#line 1146 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 187:
-#line 1154 "objc-parse.y"
+#line 1151 "objc-parse.y"
{ yyval.ttype = yyvsp[-2].ttype; ;
break;}
case 188:
-#line 1159 "objc-parse.y"
+#line 1156 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 189:
-#line 1161 "objc-parse.y"
+#line 1158 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 190:
-#line 1166 "objc-parse.y"
+#line 1163 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 191:
-#line 1168 "objc-parse.y"
+#line 1165 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 192:
-#line 1170 "objc-parse.y"
+#line 1167 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, build_tree_list (NULL_TREE, yyvsp[-1].ttype)); ;
break;}
case 193:
-#line 1172 "objc-parse.y"
+#line 1169 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-5].ttype, tree_cons (NULL_TREE, yyvsp[-3].ttype, yyvsp[-1].ttype)); ;
break;}
case 194:
-#line 1174 "objc-parse.y"
+#line 1171 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 200:
-#line 1192 "objc-parse.y"
+#line 1189 "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 201:
-#line 1197 "objc-parse.y"
+#line 1194 "objc-parse.y"
{ yyval.ttype = pop_init_level (0);
if (yyval.ttype == error_mark_node
&& ! (yychar == STRING || yychar == CONSTANT))
@@ -3168,36 +3165,36 @@ case 201:
pop_momentary_nofree (); ;
break;}
case 202:
-#line 1205 "objc-parse.y"
+#line 1202 "objc-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 203:
-#line 1211 "objc-parse.y"
+#line 1208 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids empty initializer braces"); ;
break;}
case 207:
-#line 1225 "objc-parse.y"
+#line 1222 "objc-parse.y"
{ process_init_element (yyvsp[0].ttype); ;
break;}
case 208:
-#line 1227 "objc-parse.y"
+#line 1224 "objc-parse.y"
{ push_init_level (0); ;
break;}
case 209:
-#line 1229 "objc-parse.y"
+#line 1226 "objc-parse.y"
{ process_init_element (pop_init_level (0)); ;
break;}
case 211:
-#line 1235 "objc-parse.y"
+#line 1232 "objc-parse.y"
{ set_init_label (yyvsp[-1].ttype); ;
break;}
case 213:
-#line 1238 "objc-parse.y"
+#line 1235 "objc-parse.y"
{ set_init_label (yyvsp[-1].ttype); ;
break;}
case 215:
-#line 1244 "objc-parse.y"
+#line 1241 "objc-parse.y"
{ push_c_function_context ();
if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 1))
@@ -3208,16 +3205,16 @@ case 215:
reinit_parse_for_function (); ;
break;}
case 216:
-#line 1253 "objc-parse.y"
+#line 1250 "objc-parse.y"
{ store_parm_decls (); ;
break;}
case 217:
-#line 1261 "objc-parse.y"
+#line 1258 "objc-parse.y"
{ finish_function (1);
pop_c_function_context (); ;
break;}
case 218:
-#line 1267 "objc-parse.y"
+#line 1264 "objc-parse.y"
{ push_c_function_context ();
if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 1))
@@ -3228,172 +3225,172 @@ case 218:
reinit_parse_for_function (); ;
break;}
case 219:
-#line 1276 "objc-parse.y"
+#line 1273 "objc-parse.y"
{ store_parm_decls (); ;
break;}
case 220:
-#line 1284 "objc-parse.y"
+#line 1281 "objc-parse.y"
{ finish_function (1);
pop_c_function_context (); ;
break;}
case 223:
-#line 1300 "objc-parse.y"
+#line 1297 "objc-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 224:
-#line 1302 "objc-parse.y"
+#line 1299 "objc-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 225:
-#line 1307 "objc-parse.y"
+#line 1304 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 226:
-#line 1309 "objc-parse.y"
+#line 1306 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 227:
-#line 1311 "objc-parse.y"
+#line 1308 "objc-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 228:
-#line 1318 "objc-parse.y"
+#line 1315 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 231:
-#line 1330 "objc-parse.y"
+#line 1327 "objc-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 232:
-#line 1335 "objc-parse.y"
+#line 1332 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 233:
-#line 1337 "objc-parse.y"
+#line 1334 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 234:
-#line 1339 "objc-parse.y"
+#line 1336 "objc-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 235:
-#line 1346 "objc-parse.y"
+#line 1343 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 237:
-#line 1355 "objc-parse.y"
+#line 1352 "objc-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 238:
-#line 1360 "objc-parse.y"
+#line 1357 "objc-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 239:
-#line 1362 "objc-parse.y"
+#line 1359 "objc-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 240:
-#line 1364 "objc-parse.y"
+#line 1361 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 241:
-#line 1366 "objc-parse.y"
+#line 1363 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 242:
-#line 1373 "objc-parse.y"
+#line 1370 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 244:
-#line 1379 "objc-parse.y"
+#line 1376 "objc-parse.y"
{ yyval.ttype = start_struct (RECORD_TYPE, yyvsp[-1].ttype);
/* Start scope of tag before parsing components. */
;
break;}
case 245:
-#line 1383 "objc-parse.y"
+#line 1380 "objc-parse.y"
{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 246:
-#line 1385 "objc-parse.y"
+#line 1382 "objc-parse.y"
{ yyval.ttype = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
case 247:
-#line 1389 "objc-parse.y"
+#line 1386 "objc-parse.y"
{ yyval.ttype = xref_tag (RECORD_TYPE, yyvsp[0].ttype); ;
break;}
case 248:
-#line 1391 "objc-parse.y"
+#line 1388 "objc-parse.y"
{ yyval.ttype = start_struct (UNION_TYPE, yyvsp[-1].ttype); ;
break;}
case 249:
-#line 1393 "objc-parse.y"
+#line 1390 "objc-parse.y"
{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 250:
-#line 1395 "objc-parse.y"
+#line 1392 "objc-parse.y"
{ yyval.ttype = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
case 251:
-#line 1399 "objc-parse.y"
+#line 1396 "objc-parse.y"
{ yyval.ttype = xref_tag (UNION_TYPE, yyvsp[0].ttype); ;
break;}
case 252:
-#line 1401 "objc-parse.y"
+#line 1398 "objc-parse.y"
{ yyvsp[0].itype = suspend_momentary ();
yyval.ttype = start_enum (yyvsp[-1].ttype); ;
break;}
case 253:
-#line 1404 "objc-parse.y"
+#line 1401 "objc-parse.y"
{ yyval.ttype = finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), yyvsp[0].ttype);
resume_momentary (yyvsp[-5].itype); ;
break;}
case 254:
-#line 1407 "objc-parse.y"
+#line 1404 "objc-parse.y"
{ yyvsp[0].itype = suspend_momentary ();
yyval.ttype = start_enum (NULL_TREE); ;
break;}
case 255:
-#line 1410 "objc-parse.y"
+#line 1407 "objc-parse.y"
{ yyval.ttype = finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), yyvsp[0].ttype);
resume_momentary (yyvsp[-5].itype); ;
break;}
case 256:
-#line 1413 "objc-parse.y"
+#line 1410 "objc-parse.y"
{ yyval.ttype = xref_tag (ENUMERAL_TYPE, yyvsp[0].ttype); ;
break;}
case 260:
-#line 1424 "objc-parse.y"
+#line 1421 "objc-parse.y"
{ if (pedantic) pedwarn ("comma at end of enumerator list"); ;
break;}
case 261:
-#line 1429 "objc-parse.y"
+#line 1426 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 262:
-#line 1431 "objc-parse.y"
+#line 1428 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype);
pedwarn ("no semicolon at end of struct or union"); ;
break;}
case 263:
-#line 1436 "objc-parse.y"
+#line 1433 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 264:
-#line 1438 "objc-parse.y"
+#line 1435 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 265:
-#line 1440 "objc-parse.y"
+#line 1437 "objc-parse.y"
{ if (pedantic)
pedwarn ("extra semicolon in struct or union specified"); ;
break;}
case 266:
-#line 1444 "objc-parse.y"
+#line 1441 "objc-parse.y"
{
tree interface = lookup_interface (yyvsp[-1].ttype);
@@ -3408,7 +3405,7 @@ case 266:
;
break;}
case 267:
-#line 1469 "objc-parse.y"
+#line 1466 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -3416,14 +3413,14 @@ case 267:
resume_momentary (yyvsp[-1].itype); ;
break;}
case 268:
-#line 1475 "objc-parse.y"
+#line 1472 "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 269:
-#line 1480 "objc-parse.y"
+#line 1477 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -3431,140 +3428,140 @@ case 269:
resume_momentary (yyvsp[-1].itype); ;
break;}
case 270:
-#line 1486 "objc-parse.y"
+#line 1483 "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 271:
-#line 1491 "objc-parse.y"
+#line 1488 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 272:
-#line 1493 "objc-parse.y"
+#line 1490 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
case 274:
-#line 1500 "objc-parse.y"
+#line 1497 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 275:
-#line 1505 "objc-parse.y"
+#line 1502 "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 276:
-#line 1509 "objc-parse.y"
+#line 1506 "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 277:
-#line 1512 "objc-parse.y"
+#line 1509 "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 279:
-#line 1524 "objc-parse.y"
+#line 1521 "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 280:
-#line 1529 "objc-parse.y"
+#line 1526 "objc-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 281:
-#line 1535 "objc-parse.y"
+#line 1532 "objc-parse.y"
{ yyval.ttype = build_enumerator (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 282:
-#line 1537 "objc-parse.y"
+#line 1534 "objc-parse.y"
{ yyval.ttype = build_enumerator (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 283:
-#line 1542 "objc-parse.y"
+#line 1539 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 284:
-#line 1544 "objc-parse.y"
+#line 1541 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 285:
-#line 1549 "objc-parse.y"
+#line 1546 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 287:
-#line 1555 "objc-parse.y"
+#line 1552 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 288:
-#line 1557 "objc-parse.y"
+#line 1554 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 289:
-#line 1562 "objc-parse.y"
+#line 1559 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 290:
-#line 1564 "objc-parse.y"
+#line 1561 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 291:
-#line 1569 "objc-parse.y"
+#line 1566 "objc-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 292:
-#line 1572 "objc-parse.y"
+#line 1569 "objc-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 293:
-#line 1574 "objc-parse.y"
+#line 1571 "objc-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 294:
-#line 1576 "objc-parse.y"
+#line 1573 "objc-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 295:
-#line 1578 "objc-parse.y"
+#line 1575 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 296:
-#line 1580 "objc-parse.y"
+#line 1577 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 297:
-#line 1582 "objc-parse.y"
+#line 1579 "objc-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 298:
-#line 1584 "objc-parse.y"
+#line 1581 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 299:
-#line 1586 "objc-parse.y"
+#line 1583 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, NULL_TREE, NULL_TREE); ;
break;}
case 300:
-#line 1597 "objc-parse.y"
+#line 1594 "objc-parse.y"
{
if (pedantic && yyvsp[0].ends_in_label)
pedwarn ("ANSI C forbids label at end of compound statement");
;
break;}
case 302:
-#line 1606 "objc-parse.y"
+#line 1603 "objc-parse.y"
{ yyval.ends_in_label = yyvsp[0].ends_in_label; ;
break;}
case 303:
-#line 1608 "objc-parse.y"
+#line 1605 "objc-parse.y"
{ yyval.ends_in_label = 0; ;
break;}
case 307:
-#line 1620 "objc-parse.y"
+#line 1617 "objc-parse.y"
{ emit_line_note (input_filename, lineno);
pushlevel (0);
clear_last_expr ();
@@ -3575,12 +3572,12 @@ case 307:
;
break;}
case 309:
-#line 1635 "objc-parse.y"
+#line 1632 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids label declarations"); ;
break;}
case 312:
-#line 1646 "objc-parse.y"
+#line 1643 "objc-parse.y"
{ tree link;
for (link = yyvsp[-1].ttype; link; link = TREE_CHAIN (link))
{
@@ -3591,19 +3588,19 @@ case 312:
;
break;}
case 313:
-#line 1660 "objc-parse.y"
+#line 1657 "objc-parse.y"
{;
break;}
case 315:
-#line 1664 "objc-parse.y"
+#line 1661 "objc-parse.y"
{ compstmt_count++; ;
break;}
case 316:
-#line 1667 "objc-parse.y"
+#line 1664 "objc-parse.y"
{ yyval.ttype = convert (void_type_node, integer_zero_node); ;
break;}
case 317:
-#line 1669 "objc-parse.y"
+#line 1666 "objc-parse.y"
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), 1, 0);
yyval.ttype = poplevel (1, 1, 0);
@@ -3613,7 +3610,7 @@ case 317:
pop_momentary (); ;
break;}
case 318:
-#line 1677 "objc-parse.y"
+#line 1674 "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);
@@ -3623,7 +3620,7 @@ case 318:
pop_momentary (); ;
break;}
case 319:
-#line 1685 "objc-parse.y"
+#line 1682 "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);
@@ -3633,7 +3630,7 @@ case 319:
pop_momentary (); ;
break;}
case 322:
-#line 1705 "objc-parse.y"
+#line 1702 "objc-parse.y"
{ emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
c_expand_start_cond (truthvalue_conversion (yyvsp[-1].ttype), 0,
compstmt_count);
@@ -3643,7 +3640,7 @@ case 322:
position_after_white_space (); ;
break;}
case 323:
-#line 1719 "objc-parse.y"
+#line 1716 "objc-parse.y"
{ stmt_count++;
compstmt_count++;
emit_line_note (yyvsp[-2].filename, yyvsp[-1].lineno);
@@ -3653,43 +3650,43 @@ case 323:
position_after_white_space (); ;
break;}
case 324:
-#line 1727 "objc-parse.y"
+#line 1724 "objc-parse.y"
{ expand_loop_continue_here (); ;
break;}
case 325:
-#line 1731 "objc-parse.y"
+#line 1728 "objc-parse.y"
{ yyval.filename = input_filename; ;
break;}
case 326:
-#line 1735 "objc-parse.y"
+#line 1732 "objc-parse.y"
{ yyval.lineno = lineno; ;
break;}
case 327:
-#line 1740 "objc-parse.y"
+#line 1737 "objc-parse.y"
{ ;
break;}
case 328:
-#line 1745 "objc-parse.y"
+#line 1742 "objc-parse.y"
{ ;
break;}
case 329:
-#line 1750 "objc-parse.y"
+#line 1747 "objc-parse.y"
{ yyval.ends_in_label = yyvsp[0].ends_in_label; ;
break;}
case 330:
-#line 1755 "objc-parse.y"
+#line 1752 "objc-parse.y"
{ yyval.ends_in_label = 0; ;
break;}
case 331:
-#line 1757 "objc-parse.y"
+#line 1754 "objc-parse.y"
{ yyval.ends_in_label = 1; ;
break;}
case 332:
-#line 1763 "objc-parse.y"
+#line 1760 "objc-parse.y"
{ stmt_count++; ;
break;}
case 334:
-#line 1766 "objc-parse.y"
+#line 1763 "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
@@ -3708,19 +3705,19 @@ case 334:
clear_momentary (); ;
break;}
case 335:
-#line 1783 "objc-parse.y"
+#line 1780 "objc-parse.y"
{ c_expand_start_else ();
yyvsp[-1].itype = stmt_count;
position_after_white_space (); ;
break;}
case 336:
-#line 1787 "objc-parse.y"
+#line 1784 "objc-parse.y"
{ c_expand_end_cond ();
if (extra_warnings && stmt_count == yyvsp[-3].itype)
warning ("empty body in an else-statement"); ;
break;}
case 337:
-#line 1791 "objc-parse.y"
+#line 1788 "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
@@ -3731,11 +3728,11 @@ case 337:
"empty body in an if-statement"); ;
break;}
case 338:
-#line 1803 "objc-parse.y"
+#line 1800 "objc-parse.y"
{ c_expand_end_cond (); ;
break;}
case 339:
-#line 1805 "objc-parse.y"
+#line 1802 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-2].filename, yyvsp[-1].lineno);
/* The emit_nop used to come before emit_line_note,
@@ -3747,7 +3744,7 @@ case 339:
emit_nop (); ;
break;}
case 340:
-#line 1815 "objc-parse.y"
+#line 1812 "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. */
@@ -3758,11 +3755,11 @@ case 340:
position_after_white_space (); ;
break;}
case 341:
-#line 1824 "objc-parse.y"
+#line 1821 "objc-parse.y"
{ expand_end_loop (); ;
break;}
case 342:
-#line 1827 "objc-parse.y"
+#line 1824 "objc-parse.y"
{ emit_line_note (input_filename, lineno);
expand_exit_loop_if_false (NULL_PTR,
truthvalue_conversion (yyvsp[-2].ttype));
@@ -3770,12 +3767,12 @@ case 342:
clear_momentary (); ;
break;}
case 343:
-#line 1834 "objc-parse.y"
+#line 1831 "objc-parse.y"
{ expand_end_loop ();
clear_momentary (); ;
break;}
case 344:
-#line 1838 "objc-parse.y"
+#line 1835 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
/* See comment in `while' alternative, above. */
@@ -3788,12 +3785,12 @@ case 344:
;
break;}
case 345:
-#line 1850 "objc-parse.y"
+#line 1847 "objc-parse.y"
{ yyvsp[0].lineno = lineno;
yyval.filename = input_filename; ;
break;}
case 346:
-#line 1853 "objc-parse.y"
+#line 1850 "objc-parse.y"
{
/* Start the loop. Doing this after parsing
all the expressions ensures we will end the loop. */
@@ -3811,7 +3808,7 @@ case 346:
position_after_white_space (); ;
break;}
case 347:
-#line 1869 "objc-parse.y"
+#line 1866 "objc-parse.y"
{ /* Emit the increment expression, with a line number. */
emit_line_note (yyvsp[-4].filename, yyvsp[-5].lineno);
expand_loop_continue_here ();
@@ -3824,7 +3821,7 @@ case 347:
expand_end_loop (); ;
break;}
case 348:
-#line 1880 "objc-parse.y"
+#line 1877 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
c_expand_start_case (yyvsp[-1].ttype);
@@ -3834,7 +3831,7 @@ case 348:
position_after_white_space (); ;
break;}
case 349:
-#line 1888 "objc-parse.y"
+#line 1885 "objc-parse.y"
{ expand_end_case (yyvsp[-3].ttype);
if (yychar == CONSTANT || yychar == STRING)
pop_momentary_nofree ();
@@ -3842,33 +3839,33 @@ case 349:
pop_momentary (); ;
break;}
case 350:
-#line 1894 "objc-parse.y"
+#line 1891 "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 351:
-#line 1899 "objc-parse.y"
+#line 1896 "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 352:
-#line 1904 "objc-parse.y"
+#line 1901 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno);
c_expand_return (NULL_TREE); ;
break;}
case 353:
-#line 1908 "objc-parse.y"
+#line 1905 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-4].filename, yyvsp[-3].lineno);
c_expand_return (yyvsp[-1].ttype); ;
break;}
case 354:
-#line 1912 "objc-parse.y"
+#line 1909 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-7].filename, yyvsp[-6].lineno);
STRIP_NOPS (yyvsp[-2].ttype);
@@ -3880,7 +3877,7 @@ case 354:
error ("argument of `asm' is not a constant string"); ;
break;}
case 355:
-#line 1923 "objc-parse.y"
+#line 1920 "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,
@@ -3888,7 +3885,7 @@ case 355:
input_filename, lineno); ;
break;}
case 356:
-#line 1930 "objc-parse.y"
+#line 1927 "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,
@@ -3896,7 +3893,7 @@ case 356:
input_filename, lineno); ;
break;}
case 357:
-#line 1938 "objc-parse.y"
+#line 1935 "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,
@@ -3904,7 +3901,7 @@ case 357:
input_filename, lineno); ;
break;}
case 358:
-#line 1944 "objc-parse.y"
+#line 1941 "objc-parse.y"
{ tree decl;
stmt_count++;
emit_line_note (yyvsp[-4].filename, yyvsp[-3].lineno);
@@ -3917,7 +3914,7 @@ case 358:
;
break;}
case 359:
-#line 1955 "objc-parse.y"
+#line 1952 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids `goto *expr;'");
stmt_count++;
@@ -3925,7 +3922,7 @@ case 359:
expand_computed_goto (convert (ptr_type_node, yyvsp[-1].ttype)); ;
break;}
case 362:
-#line 1970 "objc-parse.y"
+#line 1967 "objc-parse.y"
{
/* The value returned by this action is */
/* 1 if everything is OK */
@@ -3948,14 +3945,14 @@ case 362:
;
break;}
case 363:
-#line 1991 "objc-parse.y"
+#line 1988 "objc-parse.y"
{
if (yyvsp[-1].itype)
iterator_for_loop_end (yyvsp[-3].ttype);
;
break;}
case 364:
-#line 2026 "objc-parse.y"
+#line 2023 "objc-parse.y"
{ register tree value = check_case_value (yyvsp[-1].ttype);
register tree label
= build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
@@ -3988,7 +3985,7 @@ case 364:
position_after_white_space (); ;
break;}
case 365:
-#line 2057 "objc-parse.y"
+#line 2054 "objc-parse.y"
{ register tree value1 = check_case_value (yyvsp[-3].ttype);
register tree value2 = check_case_value (yyvsp[-1].ttype);
register tree label
@@ -4021,7 +4018,7 @@ case 365:
position_after_white_space (); ;
break;}
case 366:
-#line 2088 "objc-parse.y"
+#line 2085 "objc-parse.y"
{
tree duplicate;
register tree label
@@ -4038,7 +4035,7 @@ case 366:
position_after_white_space (); ;
break;}
case 367:
-#line 2103 "objc-parse.y"
+#line 2100 "objc-parse.y"
{ tree label = define_label (input_filename, lineno, yyvsp[-1].ttype);
stmt_count++;
emit_nop ();
@@ -4047,52 +4044,52 @@ case 367:
position_after_white_space (); ;
break;}
case 368:
-#line 2115 "objc-parse.y"
+#line 2112 "objc-parse.y"
{ emit_line_note (input_filename, lineno);
yyval.ttype = NULL_TREE; ;
break;}
case 369:
-#line 2118 "objc-parse.y"
+#line 2115 "objc-parse.y"
{ emit_line_note (input_filename, lineno); ;
break;}
case 370:
-#line 2123 "objc-parse.y"
+#line 2120 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 372:
-#line 2130 "objc-parse.y"
+#line 2127 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 375:
-#line 2137 "objc-parse.y"
+#line 2134 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 376:
-#line 2142 "objc-parse.y"
+#line 2139 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 377:
-#line 2147 "objc-parse.y"
+#line 2144 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, combine_strings (yyvsp[0].ttype), NULL_TREE); ;
break;}
case 378:
-#line 2149 "objc-parse.y"
+#line 2146 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, combine_strings (yyvsp[0].ttype), yyvsp[-2].ttype); ;
break;}
case 379:
-#line 2155 "objc-parse.y"
+#line 2152 "objc-parse.y"
{ pushlevel (0);
clear_parm_order ();
declare_parm_level (0); ;
break;}
case 380:
-#line 2159 "objc-parse.y"
+#line 2156 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
parmlist_tags_warning ();
poplevel (0, 0, 0); ;
break;}
case 382:
-#line 2167 "objc-parse.y"
+#line 2164 "objc-parse.y"
{ tree parm;
if (pedantic)
pedwarn ("ANSI C forbids forward parameter declarations");
@@ -4102,19 +4099,19 @@ case 382:
clear_parm_order (); ;
break;}
case 383:
-#line 2175 "objc-parse.y"
+#line 2172 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 384:
-#line 2177 "objc-parse.y"
+#line 2174 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE); ;
break;}
case 385:
-#line 2183 "objc-parse.y"
+#line 2180 "objc-parse.y"
{ yyval.ttype = get_parm_info (0); ;
break;}
case 386:
-#line 2185 "objc-parse.y"
+#line 2182 "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.
@@ -4126,23 +4123,23 @@ case 386:
;
break;}
case 387:
-#line 2195 "objc-parse.y"
+#line 2192 "objc-parse.y"
{ yyval.ttype = get_parm_info (1); ;
break;}
case 388:
-#line 2197 "objc-parse.y"
+#line 2194 "objc-parse.y"
{ yyval.ttype = get_parm_info (0); ;
break;}
case 389:
-#line 2202 "objc-parse.y"
+#line 2199 "objc-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
case 390:
-#line 2204 "objc-parse.y"
+#line 2201 "objc-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
case 391:
-#line 2211 "objc-parse.y"
+#line 2208 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -4153,7 +4150,7 @@ case 391:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 392:
-#line 2220 "objc-parse.y"
+#line 2217 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -4164,7 +4161,7 @@ case 392:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 393:
-#line 2229 "objc-parse.y"
+#line 2226 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -4175,7 +4172,7 @@ case 393:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 394:
-#line 2238 "objc-parse.y"
+#line 2235 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -4186,7 +4183,7 @@ case 394:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 395:
-#line 2248 "objc-parse.y"
+#line 2245 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -4197,19 +4194,19 @@ case 395:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 396:
-#line 2262 "objc-parse.y"
+#line 2259 "objc-parse.y"
{ pushlevel (0);
clear_parm_order ();
declare_parm_level (1); ;
break;}
case 397:
-#line 2266 "objc-parse.y"
+#line 2263 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
parmlist_tags_warning ();
poplevel (0, 0, 0); ;
break;}
case 399:
-#line 2274 "objc-parse.y"
+#line 2271 "objc-parse.y"
{ tree t;
for (t = yyvsp[-1].ttype; t; t = TREE_CHAIN (t))
if (TREE_VALUE (t) == NULL_TREE)
@@ -4217,28 +4214,28 @@ case 399:
yyval.ttype = tree_cons (NULL_TREE, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 400:
-#line 2284 "objc-parse.y"
+#line 2281 "objc-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 401:
-#line 2286 "objc-parse.y"
+#line 2283 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 402:
-#line 2292 "objc-parse.y"
+#line 2289 "objc-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 403:
-#line 2294 "objc-parse.y"
+#line 2291 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 404:
-#line 2299 "objc-parse.y"
+#line 2296 "objc-parse.y"
{ yyval.itype = pedantic;
pedantic = 0; ;
break;}
case 410:
-#line 2312 "objc-parse.y"
+#line 2309 "objc-parse.y"
{
if (objc_implementation_context)
{
@@ -4251,27 +4248,27 @@ case 410:
;
break;}
case 411:
-#line 2327 "objc-parse.y"
+#line 2324 "objc-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 412:
-#line 2329 "objc-parse.y"
+#line 2326 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 413:
-#line 2334 "objc-parse.y"
+#line 2331 "objc-parse.y"
{
objc_declare_class (yyvsp[-1].ttype);
;
break;}
case 414:
-#line 2340 "objc-parse.y"
+#line 2337 "objc-parse.y"
{
objc_declare_alias (yyvsp[-2].ttype, yyvsp[-1].ttype);
;
break;}
case 415:
-#line 2346 "objc-parse.y"
+#line 2343 "objc-parse.y"
{
objc_interface_context = objc_ivar_context
= start_class (CLASS_INTERFACE_TYPE, yyvsp[-2].ttype, NULL_TREE, yyvsp[-1].ttype);
@@ -4279,20 +4276,20 @@ case 415:
;
break;}
case 416:
-#line 2352 "objc-parse.y"
+#line 2349 "objc-parse.y"
{
continue_class (objc_interface_context);
;
break;}
case 417:
-#line 2357 "objc-parse.y"
+#line 2354 "objc-parse.y"
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
case 418:
-#line 2363 "objc-parse.y"
+#line 2360 "objc-parse.y"
{
objc_interface_context
= start_class (CLASS_INTERFACE_TYPE, yyvsp[-1].ttype, NULL_TREE, yyvsp[0].ttype);
@@ -4300,14 +4297,14 @@ case 418:
;
break;}
case 419:
-#line 2370 "objc-parse.y"
+#line 2367 "objc-parse.y"
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
case 420:
-#line 2376 "objc-parse.y"
+#line 2373 "objc-parse.y"
{
objc_interface_context = objc_ivar_context
= start_class (CLASS_INTERFACE_TYPE, yyvsp[-4].ttype, yyvsp[-2].ttype, yyvsp[-1].ttype);
@@ -4315,20 +4312,20 @@ case 420:
;
break;}
case 421:
-#line 2382 "objc-parse.y"
+#line 2379 "objc-parse.y"
{
continue_class (objc_interface_context);
;
break;}
case 422:
-#line 2387 "objc-parse.y"
+#line 2384 "objc-parse.y"
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
case 423:
-#line 2393 "objc-parse.y"
+#line 2390 "objc-parse.y"
{
objc_interface_context
= start_class (CLASS_INTERFACE_TYPE, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype);
@@ -4336,14 +4333,14 @@ case 423:
;
break;}
case 424:
-#line 2400 "objc-parse.y"
+#line 2397 "objc-parse.y"
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
case 425:
-#line 2406 "objc-parse.y"
+#line 2403 "objc-parse.y"
{
objc_implementation_context = objc_ivar_context
= start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[-1].ttype, NULL_TREE, NULL_TREE);
@@ -4351,14 +4348,14 @@ case 425:
;
break;}
case 426:
-#line 2412 "objc-parse.y"
+#line 2409 "objc-parse.y"
{
objc_ivar_chain
= continue_class (objc_implementation_context);
;
break;}
case 427:
-#line 2418 "objc-parse.y"
+#line 2415 "objc-parse.y"
{
objc_implementation_context
= start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[0].ttype, NULL_TREE, NULL_TREE);
@@ -4367,7 +4364,7 @@ case 427:
;
break;}
case 428:
-#line 2426 "objc-parse.y"
+#line 2423 "objc-parse.y"
{
objc_implementation_context = objc_ivar_context
= start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[-3].ttype, yyvsp[-1].ttype, NULL_TREE);
@@ -4375,14 +4372,14 @@ case 428:
;
break;}
case 429:
-#line 2432 "objc-parse.y"
+#line 2429 "objc-parse.y"
{
objc_ivar_chain
= continue_class (objc_implementation_context);
;
break;}
case 430:
-#line 2438 "objc-parse.y"
+#line 2435 "objc-parse.y"
{
objc_implementation_context
= start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE);
@@ -4391,7 +4388,7 @@ case 430:
;
break;}
case 431:
-#line 2446 "objc-parse.y"
+#line 2443 "objc-parse.y"
{
objc_interface_context
= start_class (CATEGORY_INTERFACE_TYPE, yyvsp[-4].ttype, yyvsp[-2].ttype, yyvsp[0].ttype);
@@ -4399,14 +4396,14 @@ case 431:
;
break;}
case 432:
-#line 2453 "objc-parse.y"
+#line 2450 "objc-parse.y"
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
case 433:
-#line 2459 "objc-parse.y"
+#line 2456 "objc-parse.y"
{
objc_implementation_context
= start_class (CATEGORY_IMPLEMENTATION_TYPE, yyvsp[-3].ttype, yyvsp[-1].ttype, NULL_TREE);
@@ -4415,7 +4412,7 @@ case 433:
;
break;}
case 434:
-#line 2469 "objc-parse.y"
+#line 2466 "objc-parse.y"
{
remember_protocol_qualifiers ();
objc_interface_context
@@ -4423,7 +4420,7 @@ case 434:
;
break;}
case 435:
-#line 2475 "objc-parse.y"
+#line 2472 "objc-parse.y"
{
forget_protocol_qualifiers();
finish_protocol(objc_interface_context);
@@ -4431,13 +4428,13 @@ case 435:
;
break;}
case 436:
-#line 2484 "objc-parse.y"
+#line 2481 "objc-parse.y"
{
yyval.ttype = NULL_TREE;
;
break;}
case 438:
-#line 2492 "objc-parse.y"
+#line 2489 "objc-parse.y"
{
if (yyvsp[-2].code == LT_EXPR && yyvsp[0].code == GT_EXPR)
yyval.ttype = yyvsp[-1].ttype;
@@ -4446,32 +4443,32 @@ case 438:
;
break;}
case 441:
-#line 2506 "objc-parse.y"
+#line 2503 "objc-parse.y"
{ objc_public_flag = 2; ;
break;}
case 442:
-#line 2507 "objc-parse.y"
+#line 2504 "objc-parse.y"
{ objc_public_flag = 0; ;
break;}
case 443:
-#line 2508 "objc-parse.y"
+#line 2505 "objc-parse.y"
{ objc_public_flag = 1; ;
break;}
case 444:
-#line 2513 "objc-parse.y"
+#line 2510 "objc-parse.y"
{
yyval.ttype = NULL_TREE;
;
break;}
case 446:
-#line 2518 "objc-parse.y"
+#line 2515 "objc-parse.y"
{
if (pedantic)
pedwarn ("extra semicolon in struct or union specified");
;
break;}
case 447:
-#line 2536 "objc-parse.y"
+#line 2533 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -4479,7 +4476,7 @@ case 447:
resume_momentary (yyvsp[-1].itype); ;
break;}
case 448:
-#line 2542 "objc-parse.y"
+#line 2539 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -4487,15 +4484,15 @@ case 448:
resume_momentary (yyvsp[-1].itype); ;
break;}
case 449:
-#line 2548 "objc-parse.y"
+#line 2545 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 450:
-#line 2553 "objc-parse.y"
+#line 2550 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 453:
-#line 2560 "objc-parse.y"
+#line 2557 "objc-parse.y"
{
yyval.ttype = add_instance_variable (objc_ivar_context,
objc_public_flag,
@@ -4504,7 +4501,7 @@ case 453:
;
break;}
case 454:
-#line 2567 "objc-parse.y"
+#line 2564 "objc-parse.y"
{
yyval.ttype = add_instance_variable (objc_ivar_context,
objc_public_flag,
@@ -4512,7 +4509,7 @@ case 454:
;
break;}
case 455:
-#line 2573 "objc-parse.y"
+#line 2570 "objc-parse.y"
{
yyval.ttype = add_instance_variable (objc_ivar_context,
objc_public_flag,
@@ -4521,7 +4518,7 @@ case 455:
;
break;}
case 456:
-#line 2583 "objc-parse.y"
+#line 2580 "objc-parse.y"
{
remember_protocol_qualifiers ();
if (objc_implementation_context)
@@ -4531,7 +4528,7 @@ case 456:
;
break;}
case 457:
-#line 2591 "objc-parse.y"
+#line 2588 "objc-parse.y"
{
forget_protocol_qualifiers ();
add_class_method (objc_implementation_context, yyvsp[0].ttype);
@@ -4540,20 +4537,20 @@ case 457:
;
break;}
case 458:
-#line 2598 "objc-parse.y"
+#line 2595 "objc-parse.y"
{
continue_method_def ();
;
break;}
case 459:
-#line 2602 "objc-parse.y"
+#line 2599 "objc-parse.y"
{
finish_method_def ();
objc_method_context = NULL_TREE;
;
break;}
case 460:
-#line 2608 "objc-parse.y"
+#line 2605 "objc-parse.y"
{
remember_protocol_qualifiers ();
if (objc_implementation_context)
@@ -4563,7 +4560,7 @@ case 460:
;
break;}
case 461:
-#line 2616 "objc-parse.y"
+#line 2613 "objc-parse.y"
{
forget_protocol_qualifiers ();
add_instance_method (objc_implementation_context, yyvsp[0].ttype);
@@ -4572,139 +4569,139 @@ case 461:
;
break;}
case 462:
-#line 2623 "objc-parse.y"
+#line 2620 "objc-parse.y"
{
continue_method_def ();
;
break;}
case 463:
-#line 2627 "objc-parse.y"
+#line 2624 "objc-parse.y"
{
finish_method_def ();
objc_method_context = NULL_TREE;
;
break;}
case 465:
-#line 2639 "objc-parse.y"
+#line 2636 "objc-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
case 470:
-#line 2646 "objc-parse.y"
+#line 2643 "objc-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
case 474:
-#line 2656 "objc-parse.y"
+#line 2653 "objc-parse.y"
{
objc_inherit_code = CLASS_METHOD_DECL;
;
break;}
case 475:
-#line 2660 "objc-parse.y"
+#line 2657 "objc-parse.y"
{
add_class_method (objc_interface_context, yyvsp[0].ttype);
;
break;}
case 477:
-#line 2666 "objc-parse.y"
+#line 2663 "objc-parse.y"
{
objc_inherit_code = INSTANCE_METHOD_DECL;
;
break;}
case 478:
-#line 2670 "objc-parse.y"
+#line 2667 "objc-parse.y"
{
add_instance_method (objc_interface_context, yyvsp[0].ttype);
;
break;}
case 480:
-#line 2678 "objc-parse.y"
+#line 2675 "objc-parse.y"
{
yyval.ttype = build_method_decl (objc_inherit_code, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE);
;
break;}
case 481:
-#line 2683 "objc-parse.y"
+#line 2680 "objc-parse.y"
{
yyval.ttype = build_method_decl (objc_inherit_code, NULL_TREE, yyvsp[0].ttype, NULL_TREE);
;
break;}
case 482:
-#line 2688 "objc-parse.y"
+#line 2685 "objc-parse.y"
{
yyval.ttype = build_method_decl (objc_inherit_code, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 483:
-#line 2693 "objc-parse.y"
+#line 2690 "objc-parse.y"
{
yyval.ttype = build_method_decl (objc_inherit_code, NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 492:
-#line 2723 "objc-parse.y"
+#line 2720 "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 493:
-#line 2728 "objc-parse.y"
+#line 2725 "objc-parse.y"
{ shadow_tag (yyvsp[-1].ttype); ;
break;}
case 494:
-#line 2730 "objc-parse.y"
+#line 2727 "objc-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 495:
-#line 2735 "objc-parse.y"
+#line 2732 "objc-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
case 496:
-#line 2737 "objc-parse.y"
+#line 2734 "objc-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
case 497:
-#line 2745 "objc-parse.y"
+#line 2742 "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 498:
-#line 2750 "objc-parse.y"
+#line 2747 "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 499:
-#line 2755 "objc-parse.y"
+#line 2752 "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 500:
-#line 2763 "objc-parse.y"
+#line 2760 "objc-parse.y"
{
yyval.ttype = NULL_TREE;
;
break;}
case 501:
-#line 2767 "objc-parse.y"
+#line 2764 "objc-parse.y"
{
/* oh what a kludge! */
yyval.ttype = (tree)1;
;
break;}
case 502:
-#line 2772 "objc-parse.y"
+#line 2769 "objc-parse.y"
{
pushlevel (0);
;
break;}
case 503:
-#line 2776 "objc-parse.y"
+#line 2773 "objc-parse.y"
{
/* returns a tree list node generated by get_parm_info */
yyval.ttype = yyvsp[0].ttype;
@@ -4712,119 +4709,119 @@ case 503:
;
break;}
case 506:
-#line 2791 "objc-parse.y"
+#line 2788 "objc-parse.y"
{
yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 511:
-#line 2804 "objc-parse.y"
+#line 2801 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 512:
-#line 2805 "objc-parse.y"
+#line 2802 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 513:
-#line 2806 "objc-parse.y"
+#line 2803 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 514:
-#line 2807 "objc-parse.y"
+#line 2804 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 515:
-#line 2808 "objc-parse.y"
+#line 2805 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 516:
-#line 2809 "objc-parse.y"
+#line 2806 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 517:
-#line 2810 "objc-parse.y"
+#line 2807 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 518:
-#line 2811 "objc-parse.y"
+#line 2808 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 519:
-#line 2812 "objc-parse.y"
+#line 2809 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 520:
-#line 2813 "objc-parse.y"
+#line 2810 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 521:
-#line 2814 "objc-parse.y"
+#line 2811 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 522:
-#line 2815 "objc-parse.y"
+#line 2812 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 523:
-#line 2816 "objc-parse.y"
+#line 2813 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 524:
-#line 2817 "objc-parse.y"
+#line 2814 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 525:
-#line 2818 "objc-parse.y"
+#line 2815 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 526:
-#line 2819 "objc-parse.y"
+#line 2816 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 527:
-#line 2820 "objc-parse.y"
+#line 2817 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 528:
-#line 2821 "objc-parse.y"
+#line 2818 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 529:
-#line 2822 "objc-parse.y"
+#line 2819 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 532:
-#line 2828 "objc-parse.y"
+#line 2825 "objc-parse.y"
{
yyval.ttype = build_keyword_decl (yyvsp[-5].ttype, yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
case 533:
-#line 2833 "objc-parse.y"
+#line 2830 "objc-parse.y"
{
yyval.ttype = build_keyword_decl (yyvsp[-2].ttype, NULL_TREE, yyvsp[0].ttype);
;
break;}
case 534:
-#line 2838 "objc-parse.y"
+#line 2835 "objc-parse.y"
{
yyval.ttype = build_keyword_decl (NULL_TREE, yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
case 535:
-#line 2843 "objc-parse.y"
+#line 2840 "objc-parse.y"
{
yyval.ttype = build_keyword_decl (NULL_TREE, NULL_TREE, yyvsp[0].ttype);
;
break;}
case 539:
-#line 2856 "objc-parse.y"
+#line 2853 "objc-parse.y"
{
yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 540:
-#line 2864 "objc-parse.y"
+#line 2861 "objc-parse.y"
{
if (TREE_CHAIN (yyvsp[0].ttype) == NULL_TREE)
/* just return the expr., remove a level of indirection */
@@ -4835,69 +4832,69 @@ case 540:
;
break;}
case 541:
-#line 2876 "objc-parse.y"
+#line 2873 "objc-parse.y"
{
yyval.ttype = build_tree_list (yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
case 542:
-#line 2880 "objc-parse.y"
+#line 2877 "objc-parse.y"
{
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype);
;
break;}
case 544:
-#line 2888 "objc-parse.y"
+#line 2885 "objc-parse.y"
{
yyval.ttype = get_class_reference (yyvsp[0].ttype);
;
break;}
case 545:
-#line 2895 "objc-parse.y"
+#line 2892 "objc-parse.y"
{ objc_receiver_context = 1; ;
break;}
case 546:
-#line 2897 "objc-parse.y"
+#line 2894 "objc-parse.y"
{ objc_receiver_context = 0; ;
break;}
case 547:
-#line 2899 "objc-parse.y"
+#line 2896 "objc-parse.y"
{
yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype);
;
break;}
case 551:
-#line 2912 "objc-parse.y"
+#line 2909 "objc-parse.y"
{
yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 552:
-#line 2919 "objc-parse.y"
+#line 2916 "objc-parse.y"
{
yyval.ttype = build_tree_list (yyvsp[-1].ttype, NULL_TREE);
;
break;}
case 553:
-#line 2923 "objc-parse.y"
+#line 2920 "objc-parse.y"
{
yyval.ttype = build_tree_list (NULL_TREE, NULL_TREE);
;
break;}
case 554:
-#line 2930 "objc-parse.y"
+#line 2927 "objc-parse.y"
{
yyval.ttype = yyvsp[-1].ttype;
;
break;}
case 555:
-#line 2937 "objc-parse.y"
+#line 2934 "objc-parse.y"
{
yyval.ttype = yyvsp[-1].ttype;
;
break;}
case 556:
-#line 2946 "objc-parse.y"
+#line 2943 "objc-parse.y"
{
yyval.ttype = groktypename (yyvsp[-1].ttype);
;
@@ -5100,5 +5097,5 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 2951 "objc-parse.y"
+#line 2948 "objc-parse.y"
diff --git a/gcc/objc/objc-parse.y b/gcc/objc/objc-parse.y
index 10709c0a1f4..95edbf3b5d9 100644
--- a/gcc/objc/objc-parse.y
+++ b/gcc/objc/objc-parse.y
@@ -32,11 +32,8 @@ Boston, MA 02111-1307, USA. */
%{
#include "config.h"
-
-#include <stdio.h>
-#include <errno.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 0c9a023cfc4..9c7c6f99c00 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -30,7 +30,6 @@ Boston, MA 02111-1307, USA. */
#include "insn-config.h"
#include "recog.h"
#include "reload.h"
-#include <ctype.h>
/* Each optab contains info on how this target machine
can perform a particular operation
@@ -297,8 +296,8 @@ add_equal_note (seq, target, code, op0, op1)
note = gen_rtx (code, GET_MODE (target), copy_rtx (op0), copy_rtx (op1));
REG_NOTES (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1))
- = gen_rtx (EXPR_LIST, REG_EQUAL, note,
- REG_NOTES (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1)));
+ = gen_rtx_EXPR_LIST (REG_EQUAL, note,
+ REG_NOTES (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1)));
return 1;
}
@@ -329,13 +328,13 @@ widen_operand (op, mode, oldmode, unsignedp, no_extend)
/* If MODE is no wider than a single word, we return a paradoxical
SUBREG. */
if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
- return gen_rtx (SUBREG, mode, force_reg (GET_MODE (op), op), 0);
+ return gen_rtx_SUBREG (mode, force_reg (GET_MODE (op), op), 0);
/* Otherwise, get an object of MODE, clobber it, and set the low-order
part to OP. */
result = gen_reg_rtx (mode);
- emit_insn (gen_rtx (CLOBBER, VOIDmode, result));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, result));
emit_move_insn (gen_lowpart (GET_MODE (op), result), op);
return result;
}
@@ -911,7 +910,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
/* Indicate for flow that the entire target reg is being set. */
if (GET_CODE (target) == REG)
- emit_insn (gen_rtx (CLOBBER, VOIDmode, target));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
/* Do the actual arithmetic. */
for (i = 0; i < nwords; i++)
@@ -980,14 +979,17 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
{
rtx temp = emit_move_insn (target, target);
- REG_NOTES (temp) = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (binoptab->code, mode,
- copy_rtx (xop0),
- copy_rtx (xop1)),
- REG_NOTES (temp));
+ REG_NOTES (temp)
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx (binoptab->code, mode,
+ copy_rtx (xop0),
+ copy_rtx (xop1)),
+ REG_NOTES (temp));
}
+
return target;
}
+
else
delete_insns_since (last);
}
@@ -1162,12 +1164,14 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
{
temp = emit_move_insn (product, product);
- REG_NOTES (temp) = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (MULT, mode,
+ REG_NOTES (temp)
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_MULT (mode,
copy_rtx (op0),
copy_rtx (op1)),
- REG_NOTES (temp));
+ REG_NOTES (temp));
}
+
return product;
}
}
@@ -2480,7 +2484,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)
{
@@ -2514,7 +2519,7 @@ emit_no_conflict_block (insns, target, op0, op1, equiv)
/* Now write the CLOBBER of the output, followed by the setting of each
of the words, followed by the final copy. */
if (target != op0 && target != op1)
- emit_insn (gen_rtx (CLOBBER, VOIDmode, target));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
for (insn = insns; insn; insn = next)
{
@@ -2522,12 +2527,12 @@ emit_no_conflict_block (insns, target, op0, op1, equiv)
add_insn (insn);
if (op1 && GET_CODE (op1) == REG)
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_NO_CONFLICT, op1,
- REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_NO_CONFLICT, op1,
+ REG_NOTES (insn));
if (op0 && GET_CODE (op0) == REG)
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_NO_CONFLICT, op0,
- REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_NO_CONFLICT, op0,
+ REG_NOTES (insn));
}
if (mov_optab->handlers[(int) GET_MODE (target)].insn_code
@@ -2536,7 +2541,7 @@ emit_no_conflict_block (insns, target, op0, op1, equiv)
last = emit_move_insn (target, target);
if (equiv)
REG_NOTES (last)
- = gen_rtx (EXPR_LIST, REG_EQUAL, equiv, REG_NOTES (last));
+ = gen_rtx_EXPR_LIST (REG_EQUAL, equiv, REG_NOTES (last));
}
else
last = get_last_insn ();
@@ -2547,9 +2552,9 @@ emit_no_conflict_block (insns, target, op0, op1, equiv)
first = NEXT_INSN (prev);
/* Encapsulate the block so it gets manipulated as a unit. */
- REG_NOTES (first) = gen_rtx (INSN_LIST, REG_LIBCALL, last,
- REG_NOTES (first));
- REG_NOTES (last) = gen_rtx (INSN_LIST, REG_RETVAL, first, REG_NOTES (last));
+ REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
+ REG_NOTES (first));
+ REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last));
return last;
}
@@ -2634,8 +2639,8 @@ emit_libcall_block (insns, target, result, equiv)
last = emit_move_insn (target, result);
if (mov_optab->handlers[(int) GET_MODE (target)].insn_code
!= CODE_FOR_nothing)
- REG_NOTES (last) = gen_rtx (EXPR_LIST,
- REG_EQUAL, copy_rtx (equiv), REG_NOTES (last));
+ REG_NOTES (last) = gen_rtx_EXPR_LIST (REG_EQUAL, copy_rtx (equiv),
+ REG_NOTES (last));
if (prev == 0)
first = get_insns ();
@@ -2643,9 +2648,9 @@ emit_libcall_block (insns, target, result, equiv)
first = NEXT_INSN (prev);
/* Encapsulate the block so it gets manipulated as a unit. */
- REG_NOTES (first) = gen_rtx (INSN_LIST, REG_LIBCALL, last,
- REG_NOTES (first));
- REG_NOTES (last) = gen_rtx (INSN_LIST, REG_RETVAL, first, REG_NOTES (last));
+ REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
+ REG_NOTES (first));
+ REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last));
}
/* Generate code to store zero in X. */
@@ -3178,6 +3183,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);
@@ -3379,7 +3392,7 @@ gen_move_insn (x, y)
x = gen_lowpart_common (tmode, x1);
if (x == 0 && GET_CODE (x1) == MEM)
{
- x = gen_rtx (MEM, tmode, XEXP (x1, 0));
+ x = gen_rtx_MEM (tmode, XEXP (x1, 0));
RTX_UNCHANGING_P (x) = RTX_UNCHANGING_P (x1);
MEM_IN_STRUCT_P (x) = MEM_IN_STRUCT_P (x1);
MEM_VOLATILE_P (x) = MEM_VOLATILE_P (x1);
@@ -3389,7 +3402,7 @@ gen_move_insn (x, y)
y = gen_lowpart_common (tmode, y1);
if (y == 0 && GET_CODE (y1) == MEM)
{
- y = gen_rtx (MEM, tmode, XEXP (y1, 0));
+ y = gen_rtx_MEM (tmode, XEXP (y1, 0));
RTX_UNCHANGING_P (y) = RTX_UNCHANGING_P (y1);
MEM_IN_STRUCT_P (y) = MEM_IN_STRUCT_P (y1);
MEM_VOLATILE_P (y) = MEM_VOLATILE_P (y1);
@@ -3717,7 +3730,7 @@ expand_float (to, from, unsignedp)
end_sequence ();
emit_libcall_block (insns, target, value,
- gen_rtx (FLOAT, GET_MODE (to), from));
+ gen_rtx_FLOAT (GET_MODE (to), from));
}
done:
@@ -3863,11 +3876,13 @@ expand_fix (to, from, unsignedp)
{
/* Make a place for a REG_NOTE and add it. */
insn = emit_move_insn (to, to);
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (UNSIGNED_FIX, GET_MODE (to),
- copy_rtx (from)),
- REG_NOTES (insn));
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_UNSIGNED_FIX (GET_MODE (to),
+ copy_rtx (from)),
+ REG_NOTES (insn));
}
+
return;
}
#endif
@@ -4029,7 +4044,7 @@ init_libfuncs (optable, first_mode, last_mode, opname, suffix)
*p++ = suffix;
*p++ = '\0';
optable->handlers[(int) mode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, libfunc_name);
+ = gen_rtx_SYMBOL_REF (Pmode, libfunc_name);
}
}
@@ -4219,181 +4234,181 @@ init_optabs ()
#ifdef MULSI3_LIBCALL
smul_optab->handlers[(int) SImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, MULSI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, MULSI3_LIBCALL);
#endif
#ifdef MULDI3_LIBCALL
smul_optab->handlers[(int) DImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, MULDI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, MULDI3_LIBCALL);
#endif
#ifdef DIVSI3_LIBCALL
sdiv_optab->handlers[(int) SImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, DIVSI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, DIVSI3_LIBCALL);
#endif
#ifdef DIVDI3_LIBCALL
sdiv_optab->handlers[(int) DImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, DIVDI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, DIVDI3_LIBCALL);
#endif
#ifdef UDIVSI3_LIBCALL
udiv_optab->handlers[(int) SImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, UDIVSI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, UDIVSI3_LIBCALL);
#endif
#ifdef UDIVDI3_LIBCALL
udiv_optab->handlers[(int) DImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, UDIVDI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, UDIVDI3_LIBCALL);
#endif
#ifdef MODSI3_LIBCALL
smod_optab->handlers[(int) SImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, MODSI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, MODSI3_LIBCALL);
#endif
#ifdef MODDI3_LIBCALL
smod_optab->handlers[(int) DImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, MODDI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, MODDI3_LIBCALL);
#endif
#ifdef UMODSI3_LIBCALL
umod_optab->handlers[(int) SImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, UMODSI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, UMODSI3_LIBCALL);
#endif
#ifdef UMODDI3_LIBCALL
umod_optab->handlers[(int) DImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, UMODDI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, UMODDI3_LIBCALL);
#endif
/* Use cabs for DC complex abs, since systems generally have cabs.
Don't define any libcall for SCmode, so that cabs will be used. */
abs_optab->handlers[(int) DCmode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, "cabs");
+ = gen_rtx_SYMBOL_REF (Pmode, "cabs");
/* The ffs function operates on `int'. */
#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
- = gen_rtx (SYMBOL_REF, Pmode, "ffs");
-
- extendsfdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__extendsfdf2");
- extendsfxf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__extendsfxf2");
- extendsftf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__extendsftf2");
- extenddfxf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__extenddfxf2");
- extenddftf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__extenddftf2");
-
- truncdfsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__truncdfsf2");
- truncxfsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__truncxfsf2");
- trunctfsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__trunctfsf2");
- truncxfdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__truncxfdf2");
- trunctfdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__trunctfdf2");
-
- memcpy_libfunc = gen_rtx (SYMBOL_REF, Pmode, "memcpy");
- bcopy_libfunc = gen_rtx (SYMBOL_REF, Pmode, "bcopy");
- memcmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "memcmp");
- bcmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gcc_bcmp");
- memset_libfunc = gen_rtx (SYMBOL_REF, Pmode, "memset");
- bzero_libfunc = gen_rtx (SYMBOL_REF, Pmode, "bzero");
-
- throw_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__throw");
- sjthrow_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__sjthrow");
- sjpopnthrow_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__sjpopnthrow");
- terminate_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__terminate");
+ 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");
+ extendsfxf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__extendsfxf2");
+ extendsftf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__extendsftf2");
+ extenddfxf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__extenddfxf2");
+ extenddftf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__extenddftf2");
+
+ truncdfsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__truncdfsf2");
+ truncxfsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__truncxfsf2");
+ trunctfsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__trunctfsf2");
+ truncxfdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__truncxfdf2");
+ trunctfdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__trunctfdf2");
+
+ memcpy_libfunc = gen_rtx_SYMBOL_REF (Pmode, "memcpy");
+ bcopy_libfunc = gen_rtx_SYMBOL_REF (Pmode, "bcopy");
+ memcmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "memcmp");
+ bcmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gcc_bcmp");
+ memset_libfunc = gen_rtx_SYMBOL_REF (Pmode, "memset");
+ bzero_libfunc = gen_rtx_SYMBOL_REF (Pmode, "bzero");
+
+ throw_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__throw");
+ sjthrow_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__sjthrow");
+ sjpopnthrow_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__sjpopnthrow");
+ terminate_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__terminate");
#ifndef DONT_USE_BUILTIN_SETJMP
- setjmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__builtin_setjmp");
- longjmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__builtin_longjmp");
+ setjmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__builtin_setjmp");
+ longjmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__builtin_longjmp");
#else
- setjmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "setjmp");
- longjmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "longjmp");
+ setjmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "setjmp");
+ longjmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "longjmp");
#endif
- eqhf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__eqhf2");
- nehf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__nehf2");
- gthf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gthf2");
- gehf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gehf2");
- lthf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__lthf2");
- lehf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__lehf2");
-
- eqsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__eqsf2");
- nesf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__nesf2");
- gtsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gtsf2");
- gesf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gesf2");
- ltsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__ltsf2");
- lesf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__lesf2");
-
- eqdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__eqdf2");
- nedf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__nedf2");
- gtdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gtdf2");
- gedf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gedf2");
- ltdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__ltdf2");
- ledf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__ledf2");
-
- eqxf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__eqxf2");
- nexf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__nexf2");
- gtxf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gtxf2");
- gexf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gexf2");
- ltxf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__ltxf2");
- lexf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__lexf2");
-
- eqtf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__eqtf2");
- netf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__netf2");
- gttf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gttf2");
- getf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__getf2");
- lttf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__lttf2");
- letf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__letf2");
-
- floatsisf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatsisf");
- floatdisf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatdisf");
- floattisf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floattisf");
-
- floatsidf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatsidf");
- floatdidf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatdidf");
- floattidf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floattidf");
-
- floatsixf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatsixf");
- floatdixf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatdixf");
- floattixf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floattixf");
-
- floatsitf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatsitf");
- floatditf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatditf");
- floattitf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floattitf");
-
- fixsfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixsfsi");
- fixsfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixsfdi");
- fixsfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixsfti");
-
- fixdfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixdfsi");
- fixdfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixdfdi");
- fixdfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixdfti");
-
- fixxfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixxfsi");
- fixxfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixxfdi");
- fixxfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixxfti");
-
- fixtfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixtfsi");
- fixtfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixtfdi");
- fixtfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixtfti");
-
- fixunssfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunssfsi");
- fixunssfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunssfdi");
- fixunssfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunssfti");
-
- fixunsdfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsdfsi");
- fixunsdfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsdfdi");
- fixunsdfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsdfti");
-
- fixunsxfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsxfsi");
- fixunsxfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsxfdi");
- fixunsxfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsxfti");
-
- fixunstfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunstfsi");
- fixunstfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunstfdi");
- fixunstfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunstfti");
+ eqhf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eqhf2");
+ nehf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__nehf2");
+ gthf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gthf2");
+ gehf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gehf2");
+ lthf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__lthf2");
+ lehf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__lehf2");
+
+ eqsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eqsf2");
+ nesf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__nesf2");
+ gtsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gtsf2");
+ gesf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gesf2");
+ ltsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__ltsf2");
+ lesf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__lesf2");
+
+ eqdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eqdf2");
+ nedf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__nedf2");
+ gtdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gtdf2");
+ gedf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gedf2");
+ ltdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__ltdf2");
+ ledf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__ledf2");
+
+ eqxf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eqxf2");
+ nexf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__nexf2");
+ gtxf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gtxf2");
+ gexf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gexf2");
+ ltxf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__ltxf2");
+ lexf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__lexf2");
+
+ eqtf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eqtf2");
+ netf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__netf2");
+ gttf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gttf2");
+ getf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__getf2");
+ lttf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__lttf2");
+ letf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__letf2");
+
+ floatsisf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatsisf");
+ floatdisf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatdisf");
+ floattisf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floattisf");
+
+ floatsidf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatsidf");
+ floatdidf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatdidf");
+ floattidf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floattidf");
+
+ floatsixf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatsixf");
+ floatdixf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatdixf");
+ floattixf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floattixf");
+
+ floatsitf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatsitf");
+ floatditf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatditf");
+ floattitf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floattitf");
+
+ fixsfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixsfsi");
+ fixsfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixsfdi");
+ fixsfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixsfti");
+
+ fixdfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixdfsi");
+ fixdfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixdfdi");
+ fixdfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixdfti");
+
+ fixxfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixxfsi");
+ fixxfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixxfdi");
+ fixxfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixxfti");
+
+ fixtfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixtfsi");
+ fixtfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixtfdi");
+ fixtfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixtfti");
+
+ fixunssfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunssfsi");
+ fixunssfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunssfdi");
+ fixunssfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunssfti");
+
+ fixunsdfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsdfsi");
+ fixunsdfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsdfdi");
+ fixunsdfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsdfti");
+
+ fixunsxfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsxfsi");
+ fixunsxfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsxfdi");
+ fixunsxfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsxfti");
+
+ fixunstfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunstfsi");
+ fixunstfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunstfdi");
+ fixunstfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunstfti");
/* For check-memory-usage. */
- chkr_check_addr_libfunc = gen_rtx (SYMBOL_REF, VOIDmode, "chkr_check_addr");
- chkr_set_right_libfunc = gen_rtx (SYMBOL_REF, VOIDmode, "chkr_set_right");
- chkr_copy_bitmap_libfunc = gen_rtx (SYMBOL_REF, VOIDmode, "chkr_copy_bitmap");
- chkr_check_exec_libfunc = gen_rtx (SYMBOL_REF, VOIDmode, "chkr_check_exec");
- chkr_check_str_libfunc = gen_rtx (SYMBOL_REF, VOIDmode, "chkr_check_str");
+ chkr_check_addr_libfunc = gen_rtx_SYMBOL_REF (Pmode, "chkr_check_addr");
+ chkr_set_right_libfunc = gen_rtx_SYMBOL_REF (Pmode, "chkr_set_right");
+ chkr_copy_bitmap_libfunc = gen_rtx_SYMBOL_REF (Pmode, "chkr_copy_bitmap");
+ chkr_check_exec_libfunc = gen_rtx_SYMBOL_REF (Pmode, "chkr_check_exec");
+ chkr_check_str_libfunc = gen_rtx_SYMBOL_REF (Pmode, "chkr_check_str");
#ifdef INIT_TARGET_OPTABS
/* Allow the target to add more libcalls or rename some, etc. */
diff --git a/gcc/po/POTFILES.in b/gcc/po/POTFILES.in
index a0727132e96..e72aa3bb864 100644
--- a/gcc/po/POTFILES.in
+++ b/gcc/po/POTFILES.in
@@ -614,6 +614,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
@@ -647,6 +649,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
@@ -723,6 +726,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/NXConstStr.h
@@ -804,6 +809,7 @@ stor-layout.c
stupid.c
sys-protos.h
sys-types.h
+system.h
toplev.c
tree.c
tree.h
diff --git a/gcc/prefix.c b/gcc/prefix.c
index aa6cf51ed18..d14859cdfd9 100644
--- a/gcc/prefix.c
+++ b/gcc/prefix.c
@@ -64,12 +64,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
+#include "system.h"
#include "gansidecl.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#ifdef _WIN32
#include <windows.h>
@@ -117,14 +113,14 @@ concat VPROTO((char *first, ...))
register char *end;
register char *arg;
va_list args;
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *first;
#endif
/* First compute the size of the result and get sufficient memory. */
VA_START (args, first);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
first = va_arg (args, char *);
#endif
@@ -143,7 +139,7 @@ concat VPROTO((char *first, ...))
/* Now copy the individual pieces to the result string. */
VA_START (args, first);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
first = va_arg (args, char *);
#endif
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 60405bd8a81..701bc41a24f 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -1,5 +1,5 @@
/* Print RTL for GNU C Compiler.
- Copyright (C) 1987, 1988, 1992, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1992, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,8 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <ctype.h>
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index b2ef8f33507..0691619f359 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
extern char **tree_code_name;
diff --git a/gcc/profile.c b/gcc/profile.c
index 970eac5466e..ba8b3e10499 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -41,7 +41,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
achieve this, see Dain Sample's UC Berkeley thesis. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "flags.h"
#include "insn-flags.h"
@@ -53,7 +53,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "gcov-io.h"
extern char * xmalloc ();
-extern void free ();
/* One of these is dynamically created whenever we identify an arc in the
function. */
@@ -362,7 +361,7 @@ instrument_arcs (f, num_blocks, dump_file)
emit_barrier_after (arcptr->branch_insn);
/* Fix up the table jump. */
- new_lref = gen_rtx (LABEL_REF, Pmode, new_label);
+ new_lref = gen_rtx_LABEL_REF (Pmode, new_label);
XVECEXP (PATTERN (arcptr->branch_insn),
(code == ADDR_DIFF_VEC), index) = new_lref;
}
@@ -1134,8 +1133,8 @@ branch_prob (f, dump_file)
num_branches++;
REG_NOTES (arcptr->branch_insn)
- = gen_rtx (EXPR_LIST, REG_BR_PROB, GEN_INT (prob),
- REG_NOTES (arcptr->branch_insn));
+ = gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (prob),
+ REG_NOTES (arcptr->branch_insn));
}
}
@@ -1154,8 +1153,8 @@ branch_prob (f, dump_file)
else
{
REG_NOTES (binfo->first_insn)
- = gen_rtx (EXPR_LIST, REG_EXEC_COUNT, GEN_INT (total),
- REG_NOTES (binfo->first_insn));
+ = gen_rtx_EXPR_LIST (REG_EXEC_COUNT, GEN_INT (total),
+ REG_NOTES (binfo->first_insn));
if (i == num_blocks - 1)
return_label_execution_count = total;
}
@@ -1493,7 +1492,7 @@ init_arc_profiler ()
/* Generate and save a copy of this so it can be shared. */
char *name = xmalloc (20);
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2);
- profiler_label = gen_rtx (SYMBOL_REF, Pmode, name);
+ profiler_label = gen_rtx_SYMBOL_REF (Pmode, name);
}
/* Output instructions as RTL to increment the arc execution count. */
@@ -1504,11 +1503,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_rtx (CONST_INT, VOIDmode,
- 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);
@@ -1564,14 +1560,14 @@ output_arc_profiler (arcno, insert_after)
start_sequence ();
emit_move_insn (address_reg, profiler_target_addr);
- mem_ref = gen_rtx (MEM, mode, address_reg);
+ mem_ref = gen_rtx_MEM (mode, address_reg);
emit_move_insn (profiler_reg, mem_ref);
- add_ref = gen_rtx (PLUS, mode, profiler_reg, GEN_INT (1));
+ add_ref = gen_rtx_PLUS (mode, profiler_reg, GEN_INT (1));
emit_move_insn (profiler_reg, add_ref);
/* This is the same rtx as above, but it is not legal to share this rtx. */
- mem_ref = gen_rtx (MEM, mode, address_reg);
+ mem_ref = gen_rtx_MEM (mode, address_reg);
emit_move_insn (mem_ref, profiler_reg);
sequence = gen_sequence ();
@@ -1633,8 +1629,8 @@ output_func_start_profiler ()
/* Actually generate the code to call __bb_init_func. */
name = xmalloc (20);
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 0);
- table_address = force_reg (Pmode, gen_rtx (SYMBOL_REF, Pmode, name));
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__bb_init_func"), 0,
+ table_address = force_reg (Pmode, gen_rtx_SYMBOL_REF (Pmode, name));
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__bb_init_func"), 0,
mode, 1, table_address, Pmode);
expand_function_end (input_filename, lineno, 0);
diff --git a/gcc/protoize.c b/gcc/protoize.c
index 7d55f8a23fb..bc642a34861 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -18,14 +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. */
-/* Any reasonable C++ compiler should have all of the same features
- as __STDC__ plus more, so make sure that __STDC__ is defined if
- __cplusplus is defined. */
-
-#if defined(__cplusplus) && !defined(__STDC__)
-#define __STDC__ 1
-#endif /* defined(__cplusplus) && !defined(__STDC__) */
-
#if defined(__GNUC__) || defined (__GNUG__)
#define VOLATILE volatile
#else
@@ -38,7 +30,7 @@ Boston, MA 02111-1307, USA. */
#endif
#include "config.h"
-
+#include "system.h"
#include "intl.h"
#if 0
@@ -59,35 +51,13 @@ Boston, MA 02111-1307, USA. */
#define _POSIX_SOURCE
#endif
-#include <varargs.h>
-/* On some systems stdio.h includes stdarg.h;
- we must bring in varargs.h first. */
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#if ! defined (_WIN32) || defined (__CYGWIN32__)
#if defined(POSIX) || defined(CONCURRENT)
#include <dirent.h>
#else
#include <sys/dir.h>
#endif
-#endif
#include <setjmp.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
#include "gansidecl.h"
/* Include getopt.h for the sake of getopt_long.
@@ -97,17 +67,6 @@ Boston, MA 02111-1307, USA. */
#include "getopt.h"
#undef getopt
-#ifndef errno
-extern int errno;
-#endif
-
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#else
-extern char *strerror();
-#endif
-
extern char *version_string;
/* Systems which are compatible only with POSIX 1003.1-1988 (but *not*
@@ -154,39 +113,10 @@ typedef char * const_pointer_type;
#if defined(POSIX)
-#include <stdlib.h>
-#include <unistd.h>
#include <signal.h>
-#include <fcntl.h>
-#include <sys/wait.h>
#else /* !defined(POSIX) */
-#define R_OK 4 /* Test for Read permission */
-#define W_OK 2 /* Test for Write permission */
-#define X_OK 1 /* Test for eXecute permission */
-#define F_OK 0 /* Test for existence of File */
-
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
-#ifndef O_WRONLY
-#define O_WRONLY 1
-#endif
-
-#ifndef WIFSIGNALED
-#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
-#endif
-#ifndef WTERMSIG
-#define WTERMSIG(S) ((S) & 0x7f)
-#endif
-#ifndef WIFEXITED
-#define WIFEXITED(S) (((S) & 0xff) == 0)
-#endif
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
-#endif
/* Declaring stat or __flsbuf with a prototype
causes conflicts with system headers on some systems. */
@@ -229,20 +159,20 @@ extern char *rindex ();
#define NONCONST
-/* Define a STRINGIFY macro that's right for ANSI or traditional C. */
-
-#ifdef __STDC__
-#define STRINGIFY(STRING) #STRING
-#else
-#define STRINGIFY(STRING) "STRING"
-#endif
-
/* Define a default place to find the SYSCALLS.X file. */
#ifndef STD_PROTO_DIR
#define STD_PROTO_DIR "/usr/local/lib"
#endif /* !defined (STD_PROTO_DIR) */
+#ifdef HAVE_VPRINTF
+void fatal PVPROTO((char *, ...));
+#else
+/* We must not provide any prototype here, even if ANSI C. */
+void fatal PROTO(());
+#endif
+void fancy_abort ();
+
/* Suffix of aux_info files. */
static const char * const aux_info_suffix = ".X";
@@ -755,6 +685,41 @@ savestring2 (input1, size1, input2, size2)
return output;
}
+
+#ifdef HAVE_VPRINTF
+void
+fatal VPROTO((char *s, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
+
+#ifndef ANSI_PROTOTYPES
+ s = va_arg (ap, char *);
+#endif
+
+ fprintf (stderr, "genattrtab: ");
+ vfprintf (stderr, s, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#else /* not HAVE_VPRINTF */
+
+void
+fatal (s, a1, a2)
+ char *s;
+{
+ fprintf (stderr, "genattrtab: ");
+ fprintf (stderr, s, a1, a2);
+ fprintf (stderr, "\n");
+ exit (FATAL_EXIT_CODE);
+}
+#endif /* not HAVE_VPRINTF */
+
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
diff --git a/gcc/real.c b/gcc/real.c
index ec9f3b7434b..6f12d499380 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -21,14 +21,9 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
#include "tree.h"
-#ifndef errno
-extern int errno;
-#endif
-
/* To enable support of XFmode extended real floating point, define
LONG_DOUBLE_TYPE_SIZE 96 in the tm.h file (m68k.h or i386.h).
@@ -667,9 +662,9 @@ etruncui (x)
}
-/* This is the REAL_VALUE_ATOF function. It converts a decimal string to
- binary, rounding off as indicated by the machine_mode argument. Then it
- promotes the rounded value to REAL_VALUE_TYPE. */
+/* This is the REAL_VALUE_ATOF function. It converts a decimal or hexadecimal
+ string to binary, rounding off as indicated by the machine_mode argument.
+ Then it promotes the rounded value to REAL_VALUE_TYPE. */
REAL_VALUE_TYPE
ereal_atof (s, t)
@@ -5025,7 +5020,7 @@ asctoe (s, y)
}
/* Convert ASCII string SS to e type Y, with a specified rounding precision
- of OPREC bits. */
+ of OPREC bits. BASE is 16 for C9X hexadecimal floating constants. */
static void
asctoeg (ss, y, oprec)
@@ -5039,9 +5034,11 @@ asctoeg (ss, y, oprec)
EMULONG lexp;
unsigned EMUSHORT nsign, *p;
char *sp, *s, *lstr;
+ int base = 10;
/* Copy the input string. */
lstr = (char *) alloca (strlen (ss) + 1);
+
s = ss;
while (*s == ' ') /* skip leading spaces */
++s;
@@ -5050,6 +5047,13 @@ asctoeg (ss, y, oprec)
;
s = lstr;
+
+ if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X'))
+ {
+ base = 16;
+ s += 2;
+ }
+
rndsav = rndprc;
rndprc = NBITS; /* Set to full precision */
lost = 0;
@@ -5063,8 +5067,13 @@ asctoeg (ss, y, oprec)
trail = 0;
nxtcom:
- k = *s - '0';
- if ((k >= 0) && (k <= 9))
+ if (*s >= '0' && *s <= '9')
+ k = *s - '0';
+ else if (*s >= 'a')
+ k = 10 + *s - 'a';
+ else
+ k = 10 + *s - 'A';
+ if ((k >= 0) && (k < base))
{
/* Ignore leading zeros */
if ((prec == 0) && (decflg == 0) && (k == 0))
@@ -5073,11 +5082,15 @@ asctoeg (ss, y, oprec)
if ((trail == 0) && (decflg != 0))
{
sp = s;
- while ((*sp >= '0') && (*sp <= '9'))
+ while ((*sp >= '0' && *sp <= '9')
+ || (base == 16 && ((*sp >= 'a' && *sp <= 'f')
+ || (*sp >= 'A' && *sp <= 'F'))))
++sp;
/* Check for syntax error */
c = *sp & 0x7f;
- if ((c != 'e') && (c != 'E') && (c != '\0')
+ if ((base != 10 || ((c != 'e') && (c != 'E')))
+ && (base != 16 || ((c != 'p') && (c != 'P')))
+ && (c != '\0')
&& (c != '\n') && (c != '\r') && (c != ' ')
&& (c != ','))
goto error;
@@ -5096,13 +5109,27 @@ asctoeg (ss, y, oprec)
if (yy[2] == 0)
{
- if (decflg)
- nexp += 1; /* count digits after decimal point */
- eshup1 (yy); /* multiply current number by 10 */
- emovz (yy, xt);
- eshup1 (xt);
- eshup1 (xt);
- eaddm (xt, yy);
+ if (base == 16)
+ {
+ if (decflg)
+ nexp += 4; /* count digits after decimal point */
+
+ eshup1 (yy); /* multiply current number by 16 */
+ eshup1 (yy);
+ eshup1 (yy);
+ eshup1 (yy);
+ }
+ else
+ {
+ if (decflg)
+ nexp += 1; /* count digits after decimal point */
+
+ eshup1 (yy); /* multiply current number by 10 */
+ emovz (yy, xt);
+ eshup1 (xt);
+ eshup1 (xt);
+ eaddm (xt, yy);
+ }
ecleaz (xt);
xt[NI - 2] = (unsigned EMUSHORT) k;
eaddm (xt, yy);
@@ -5113,7 +5140,12 @@ asctoeg (ss, y, oprec)
lost |= k;
/* Count lost digits before the decimal point. */
if (decflg == 0)
- nexp -= 1;
+ {
+ if (base == 10)
+ nexp -= 1;
+ else
+ nexp -= 4;
+ }
}
prec += 1;
goto donchr;
@@ -5125,6 +5157,8 @@ asctoeg (ss, y, oprec)
break;
case 'E':
case 'e':
+ case 'P':
+ case 'p':
goto expnt;
case '.': /* decimal point */
if (decflg)
@@ -5191,24 +5225,19 @@ read_expnt:
{
exp *= 10;
exp += *s++ - '0';
- if (exp > -(MINDECEXP))
- {
- if (esign < 0)
- goto zero;
- else
- goto infinite;
- }
+ if (exp > 999999)
+ break;
}
if (esign < 0)
exp = -exp;
- if (exp > MAXDECEXP)
+ if ((exp > MAXDECEXP) && (base == 10))
{
infinite:
ecleaz (yy);
yy[E] = 0x7fff; /* infinity */
goto aexit;
}
- if (exp < MINDECEXP)
+ if ((exp < MINDECEXP) && (base == 10))
{
zero:
ecleaz (yy);
@@ -5216,6 +5245,25 @@ read_expnt:
}
daldone:
+ if (base == 16)
+ {
+ /* Base 16 hexadecimal floating constant. */
+ if ((k = enormlz (yy)) > NBITS)
+ {
+ ecleaz (yy);
+ goto aexit;
+ }
+ /* Adjust the exponent. NEXP is the number of hex digits,
+ EXP is a power of 2. */
+ lexp = (EXONE - 1 + NBITS) - k + yy[E] + exp - nexp;
+ if (lexp > 0x7fff)
+ goto infinite;
+ if (lexp < 0)
+ goto zero;
+ yy[E] = lexp;
+ goto expdon;
+ }
+
nexp = exp - nexp;
/* Pad trailing zeros to minimize power of 10, per IEEE spec. */
while ((nexp > 0) && (yy[2] == 0))
@@ -5237,6 +5285,7 @@ read_expnt:
}
lexp = (EXONE - 1 + NBITS) - k;
emdnorm (yy, lost, 0, lexp, 64);
+ lost = 0;
/* Convert to external format:
@@ -5292,6 +5341,7 @@ read_expnt:
k = emulm (tt, yy);
lexp -= EXONE - 1;
}
+ lost = k;
expdon:
@@ -5315,7 +5365,7 @@ read_expnt:
lexp -= EXONE - 0201;
#endif
rndprc = oprec;
- emdnorm (yy, k, 0, lexp, 64);
+ emdnorm (yy, lost, 0, lexp, 64);
aexit:
diff --git a/gcc/real.h b/gcc/real.h
index ca26e61ea3b..5a208881426 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -1,5 +1,5 @@
/* Definitions of floating-point access for GNU compiler.
- Copyright (C) 1989, 1991, 1994, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1989, 91, 94, 96, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -165,7 +165,8 @@ extern REAL_VALUE_TYPE ereal_from_double PROTO((HOST_WIDE_INT *));
/* These return REAL_VALUE_TYPE: */
#define REAL_VALUE_RNDZINT(x) (etrunci (x))
#define REAL_VALUE_UNSIGNED_RNDZINT(x) (etruncui (x))
-extern REAL_VALUE_TYPE real_value_truncate ();
+extern REAL_VALUE_TYPE real_value_truncate PROTO((enum machine_mode,
+ REAL_VALUE_TYPE));
#define REAL_VALUE_TRUNCATE(mode, x) real_value_truncate (mode, x)
/* These return HOST_WIDE_INT: */
@@ -175,7 +176,11 @@ extern REAL_VALUE_TYPE real_value_truncate ();
toward zero. */
#define REAL_VALUE_UNSIGNED_FIX(x) (efixui (x))
-#define REAL_VALUE_ATOF ereal_atof
+/* Convert ASCII string S to floating point in mode M.
+ Decimal input uses ATOF. Hexadecimal uses HTOF. */
+#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
#define REAL_VALUE_MINUS_ZERO(x) \
@@ -336,6 +341,9 @@ extern double ldexp ();
/* Use real.c to convert decimal numbers to binary, ... */
REAL_VALUE_TYPE ereal_atof ();
#define REAL_VALUE_ATOF(x, s) ereal_atof (x, s)
+/* Could use ereal_atof here for hexadecimal floats too, but real_hex_to_f
+ is OK and it uses faster native fp arithmetic. */
+/* #define REAL_VALUE_HTOF(x, s) ereal_atof (x, s) */
#else
/* ... or, if you like the host computer's atof, go ahead and use it: */
#define REAL_VALUE_ATOF(x, s) atof (x)
@@ -350,6 +358,13 @@ extern double (atof) ();
#endif
#endif
+/* Hexadecimal floating constant input for use with host computer's
+ fp arithmetic. */
+#ifndef REAL_VALUE_HTOF
+extern REAL_VALUE_TYPE real_hex_to_f PROTO((char *, enum machine_mode));
+#define REAL_VALUE_HTOF(s,m) real_hex_to_f(s,m)
+#endif
+
/* Negate the floating-point value X. */
#ifndef REAL_VALUE_NEGATE
#define REAL_VALUE_NEGATE(x) (- (x))
@@ -360,7 +375,8 @@ extern double (atof) ();
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) \
@@ -383,9 +399,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
@@ -427,9 +443,9 @@ union real_extract
/* Function to return a real value (not a tree node)
from a given integer constant. */
-REAL_VALUE_TYPE real_value_from_int_cst ();
-
-/* Given a CONST_DOUBLE in FROM, store into TO the value it represents. */
+union tree_node;
+REAL_VALUE_TYPE real_value_from_int_cst PROTO((union tree_node *,
+ union tree_node *));
#define REAL_VALUE_FROM_CONST_DOUBLE(to, from) \
do { union real_extract u; \
@@ -451,11 +467,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 1af2dfcd03a..2b6471b1d7e 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1,5 +1,5 @@
/* Subroutines used by or related to instruction recognition.
- Copyright (C) 1987, 1988, 91-6, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 91-97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "insn-config.h"
#include "insn-attr.h"
@@ -259,8 +259,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);
}
@@ -412,7 +413,7 @@ validate_replace_rtx_1 (loc, from, to, object)
rtx new = simplify_unary_operation (code, GET_MODE (x), to,
GET_MODE (from));
if (new == 0)
- new = gen_rtx (CLOBBER, GET_MODE (x), const0_rtx);
+ new = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
validate_change (object, loc, new, 1);
return;
@@ -441,7 +442,7 @@ validate_replace_rtx_1 (loc, from, to, object)
GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
- MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode)));
- new = gen_rtx (MEM, mode, plus_constant (XEXP (to, 0), offset));
+ new = gen_rtx_MEM (mode, plus_constant (XEXP (to, 0), offset));
MEM_VOLATILE_P (new) = MEM_VOLATILE_P (to);
RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (to);
MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (to);
@@ -492,8 +493,8 @@ validate_replace_rtx_1 (loc, from, to, object)
pos %= GET_MODE_BITSIZE (wanted_mode);
- newmem = gen_rtx (MEM, wanted_mode,
- plus_constant (XEXP (to, 0), offset));
+ newmem = gen_rtx_MEM (wanted_mode,
+ plus_constant (XEXP (to, 0), offset));
RTX_UNCHANGING_P (newmem) = RTX_UNCHANGING_P (to);
MEM_VOLATILE_P (newmem) = MEM_VOLATILE_P (to);
MEM_IN_STRUCT_P (newmem) = MEM_IN_STRUCT_P (to);
@@ -1576,7 +1577,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;
}
@@ -1596,7 +1598,7 @@ adj_offsettable_operand (op, offset)
}
}
- 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;
}
@@ -1702,10 +1704,7 @@ constrain_operands (insn_code_num, strict)
while (*p && (c = *p++) != ',')
switch (c)
{
- case '?':
- case '!':
- case '*':
- case '%':
+ case '?': case '!': case '*': case '%':
break;
case '#':
@@ -1727,11 +1726,9 @@ constrain_operands (insn_code_num, strict)
earlyclobber[opno] = 1;
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':
+
/* 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 bab0e309444..4a6faf2b544 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -158,7 +158,7 @@ Boston, MA 02111-1307, USA. */
*/
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "insn-config.h"
@@ -383,10 +383,10 @@ reg_to_stack (first, file)
{
for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
- FP_MODE_REG (i, mode) = gen_rtx (REG, mode, i);
+ FP_MODE_REG (i, mode) = gen_rtx_REG (mode, i);
for (mode = GET_CLASS_NARROWEST_MODE (MODE_COMPLEX_FLOAT); mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
- FP_MODE_REG (i, mode) = gen_rtx (REG, mode, i);
+ FP_MODE_REG (i, mode) = gen_rtx_REG (mode, i);
}
}
}
@@ -654,13 +654,8 @@ constrain_asm_operands (n_operands, operands, operand_constraints,
while (*p && (c = *p++) != ',')
switch (c)
{
- case '=':
- case '+':
- case '?':
- case '&':
- case '!':
- case '*':
- case '%':
+ case '=': case '+': case '?': case '&': case '!':
+ case '*': case '%':
/* Ignore these. */
break;
@@ -669,12 +664,9 @@ constrain_asm_operands (n_operands, operands, operand_constraints,
while (*p && *p != ',') p++;
break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
+ 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.
@@ -1026,7 +1018,7 @@ record_asm_reg_life (insn, regstack, operands, constraints,
if (malformed_asm)
{
/* Avoid further trouble with this insn. */
- PATTERN (insn) = gen_rtx (USE, VOIDmode, const0_rtx);
+ PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx);
PUT_MODE (insn, VOIDmode);
return;
}
@@ -1047,8 +1039,8 @@ record_asm_reg_life (insn, regstack, operands, constraints,
REG_UNUSED. */
if (! TEST_HARD_REG_BIT (regstack->reg_set, REGNO (op)))
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_UNUSED, op,
- REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_UNUSED, op,
+ REG_NOTES (insn));
CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (op));
}
@@ -1069,8 +1061,8 @@ record_asm_reg_life (insn, regstack, operands, constraints,
if (! TEST_HARD_REG_BIT (regstack->reg_set, REGNO (operands[i]))
&& operand_matches[i] == -1
&& find_regno_note (insn, REG_DEAD, REGNO (operands[i])) == NULL_RTX)
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_DEAD, operands[i],
- REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_DEAD, operands[i],
+ REG_NOTES (insn));
SET_HARD_REG_BIT (regstack->reg_set, REGNO (operands[i]));
}
@@ -1235,13 +1227,13 @@ record_reg_life (insn, block, regstack)
{
if (TEST_HARD_REG_BIT (src, regno)
&& ! TEST_HARD_REG_BIT (dest, regno))
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_DEAD,
- FP_MODE_REG (regno, DFmode),
- REG_NOTES (insn));
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_DEAD, FP_MODE_REG (regno, DFmode),
+ REG_NOTES (insn));
else if (TEST_HARD_REG_BIT (dest, regno))
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_UNUSED,
- FP_MODE_REG (regno, DFmode),
- REG_NOTES (insn));
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_UNUSED, FP_MODE_REG (regno, DFmode),
+ REG_NOTES (insn));
}
if (GET_CODE (insn) == CALL_INSN)
@@ -1263,8 +1255,8 @@ record_reg_life (insn, block, regstack)
cannot be used on these insns, because they do not appear in
block_number[]. */
- pat = gen_rtx (SET, VOIDmode, FP_MODE_REG (reg, DFmode),
- CONST0_RTX (DFmode));
+ pat = gen_rtx_SET (VOIDmode, FP_MODE_REG (reg, DFmode),
+ CONST0_RTX (DFmode));
init = emit_insn_after (pat, insn);
PUT_MODE (init, QImode);
@@ -1331,8 +1323,8 @@ find_blocks (first)
/* Make a list of all labels referred to other than by jumps. */
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
if (REG_NOTE_KIND (note) == REG_LABEL)
- label_value_list = gen_rtx (EXPR_LIST, VOIDmode, XEXP (note, 0),
- label_value_list);
+ label_value_list = gen_rtx_EXPR_LIST (VOIDmode, XEXP (note, 0),
+ label_value_list);
}
block_number[INSN_UID (insn)] = block;
@@ -1358,13 +1350,13 @@ find_blocks (first)
{
for (x = label_value_list; x; x = XEXP (x, 1))
record_label_references (insn,
- gen_rtx (LABEL_REF, VOIDmode,
- XEXP (x, 0)));
+ gen_rtx_LABEL_REF (VOIDmode,
+ XEXP (x, 0)));
for (x = forced_labels; x; x = XEXP (x, 1))
record_label_references (insn,
- gen_rtx (LABEL_REF, VOIDmode,
- XEXP (x, 0)));
+ gen_rtx_LABEL_REF (VOIDmode,
+ XEXP (x, 0)));
}
record_label_references (insn, pat);
@@ -1590,8 +1582,8 @@ stack_reg_life_analysis (first, stackentry)
{
rtx init_rtx;
- init_rtx = gen_rtx (SET, VOIDmode, FP_MODE_REG(reg, DFmode),
- CONST0_RTX (DFmode));
+ init_rtx = gen_rtx_SET (VOIDmode, FP_MODE_REG(reg, DFmode),
+ CONST0_RTX (DFmode));
block_begin[0] = emit_insn_after (init_rtx, first);
PUT_MODE (block_begin[0], QImode);
@@ -1707,16 +1699,16 @@ emit_pop_insn (insn, regstack, reg, when)
if (hard_regno < FIRST_STACK_REG)
abort ();
- pop_rtx = gen_rtx (SET, VOIDmode, FP_MODE_REG (hard_regno, DFmode),
- FP_MODE_REG (FIRST_STACK_REG, DFmode));
+ pop_rtx = gen_rtx_SET (VOIDmode, FP_MODE_REG (hard_regno, DFmode),
+ FP_MODE_REG (FIRST_STACK_REG, DFmode));
pop_insn = (*when) (pop_rtx, insn);
/* ??? This used to be VOIDmode, but that seems wrong. */
PUT_MODE (pop_insn, QImode);
- 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];
@@ -1921,8 +1913,8 @@ move_for_stack_reg (insn, regstack, pat)
push_rtx = gen_movxf (top_stack_reg, top_stack_reg);
push_insn = emit_insn_before (push_rtx, insn);
PUT_MODE (push_insn, QImode);
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_DEAD, top_stack_reg,
- REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_DEAD, top_stack_reg,
+ REG_NOTES (insn));
}
replace_reg (psrc, FIRST_STACK_REG);
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 95420c29189..4bfbe7a8dba 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
and a function init_reg_sets to initialize the tables. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "hard-reg-set.h"
#include "flags.h"
@@ -440,7 +440,7 @@ init_regs ()
memory_move_secondary_cost. */
int i;
for (i = 0; i < MAX_MACHINE_MODE; i++)
- top_of_stack[i] = gen_rtx (MEM, i, stack_pointer_rtx);
+ top_of_stack[i] = gen_rtx_MEM (i, stack_pointer_rtx);
}
#endif
}
@@ -727,7 +727,7 @@ regclass (f, nregs)
for (i = 0; i < N_REG_CLASSES; i++)
{
- rtx r = gen_rtx (REG, VOIDmode, 0);
+ rtx r = gen_rtx_REG (VOIDmode, 0);
enum machine_mode m;
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
@@ -1122,6 +1122,9 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn)
int win = 0;
char c;
+ /* Initially show we know nothing about the register class. */
+ classes[i] = NO_REGS;
+
/* If this operand has no constraints at all, we can conclude
nothing about it since anything is valid. */
@@ -1133,12 +1136,20 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn)
continue;
}
- if (*p == '%')
- p++;
-
/* If this alternative is only relevant when this operand
matches a previous operand, we do different things depending
- on whether this operand is a pseudo-reg or not. */
+ on whether this operand is a pseudo-reg or not. We must process
+ any modifiers for the operand before we can make this test. */
+
+ while (*p == '%' || *p == '=' || *p == '+' || *p == '&')
+ {
+ if (*p == '=')
+ op_types[i] = OP_WRITE;
+ else if (*p == '+')
+ op_types[i] = OP_READ_WRITE;
+
+ p++;
+ }
if (p[0] >= '0' && p[0] <= '0' + i && (p[1] == ',' || p[1] == 0))
{
@@ -1200,32 +1211,22 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn)
}
}
- /* Scan all the constraint letters. See if the operand matches
- any of the constraints. Collect the valid register classes
- and see if this operand accepts memory. */
+ /* Scan all the remaining constraint letters. See if the operand
+ matches any of the constraints. Collect the valid register
+ classes and see if this operand accepts memory. */
- classes[i] = NO_REGS;
while (*p && (c = *p++) != ',')
switch (c)
{
- case '=':
- op_types[i] = OP_WRITE;
- break;
-
- case '+':
- op_types[i] = OP_READ_WRITE;
- break;
-
case '*':
/* Ignore the next letter for this pass. */
p++;
break;
- case '%':
- case '?': case '!': case '#':
- case '&':
+ case '=': case '+': case '?': case '!': case '#':
+ case '&': case 'p':
case '0': case '1': case '2': case '3': case '4':
- case 'p':
+ case '5': case '6': case '7': case '8': case '9':
break;
case 'm': case 'o': case 'V':
@@ -1464,7 +1465,8 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn)
{
for (nr = 0; nr < HARD_REGNO_NREGS(regno, mode); nr++)
{
- if (!TEST_HARD_REG_BIT (reg_class_contents[class], regno + nr))
+ if (! TEST_HARD_REG_BIT (reg_class_contents[class],
+ regno + nr))
break;
}
@@ -1717,22 +1719,22 @@ auto_inc_dec_reg_p (reg, mode)
enum machine_mode mode;
{
#ifdef HAVE_POST_INCREMENT
- if (memory_address_p (mode, gen_rtx (POST_INC, Pmode, reg)))
+ if (memory_address_p (mode, gen_rtx_POST_INC (Pmode, reg)))
return 1;
#endif
#ifdef HAVE_POST_DECREMENT
- if (memory_address_p (mode, gen_rtx (POST_DEC, Pmode, reg)))
+ if (memory_address_p (mode, gen_rtx_POST_DEC (Pmode, reg)))
return 1;
#endif
#ifdef HAVE_PRE_INCREMENT
- if (memory_address_p (mode, gen_rtx (PRE_INC, Pmode, reg)))
+ if (memory_address_p (mode, gen_rtx_PRE_INC (Pmode, reg)))
return 1;
#endif
#ifdef HAVE_PRE_DECREMENT
- if (memory_address_p (mode, gen_rtx (PRE_DEC, Pmode, reg)))
+ if (memory_address_p (mode, gen_rtx_PRE_DEC (Pmode, reg)))
return 1;
#endif
@@ -1885,8 +1887,13 @@ reg_scan_mark_refs (x, insn, note_flag)
switch (code)
{
- case CONST_INT:
case CONST:
+ if (GET_CODE (XEXP (x, 0)) == CONSTANT_P_RTX)
+ reg_scan_mark_refs (XEXP (XEXP (x, 0), 0), insn, note_flag);
+
+ /* ... fall through ... */
+
+ case CONST_INT:
case CONST_DOUBLE:
case CC0:
case PC:
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 06fd04e15ad..b9b6a936ae7 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -24,7 +24,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
instruction to avoid the move instruction. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "insn-config.h"
#include "recog.h"
@@ -60,10 +60,10 @@ enum operand_use {READ, WRITE, READWRITE};
struct match
{
- char with[MAX_RECOG_OPERANDS];
+ int with[MAX_RECOG_OPERANDS];
enum operand_use use[MAX_RECOG_OPERANDS];
- char commutative[MAX_RECOG_OPERANDS];
- char early_clobber[MAX_RECOG_OPERANDS];
+ int commutative[MAX_RECOG_OPERANDS];
+ int early_clobber[MAX_RECOG_OPERANDS];
};
static rtx next_insn_for_regmove PROTO((rtx));
@@ -191,7 +191,7 @@ try_auto_increment (insn, inc_insn, inc_set, reg, increment, pre)
if (! apply_change_group ())
return 0;
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_INC, reg, REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_INC, reg, REG_NOTES (insn));
if (inc_set == 0)
{
@@ -818,6 +818,7 @@ find_matches (insn, matchp)
break;
case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
c -= '0';
if (c < operand_number && likely_spilled[c])
break;
@@ -1410,8 +1411,8 @@ regmove_optimize (f, nregs, regmove_dump_file)
>= GET_MODE_SIZE (GET_MODE (SUBREG_REG (dst))))
{
src_subreg
- = gen_rtx (SUBREG, GET_MODE (SUBREG_REG (dst)),
- src, SUBREG_WORD (dst));
+ = gen_rtx_SUBREG (GET_MODE (SUBREG_REG (dst)),
+ src, SUBREG_WORD (dst));
dst = SUBREG_REG (dst);
}
@@ -1762,9 +1763,16 @@ regmove_profitable_p ()
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);
+ reg0 = gen_rtx_REG (insn_operand_mode[icode][0], i);
+ reg1 = gen_rtx_REG (insn_operand_mode[icode][1], i + 1);
+
+ /* Use CONST_INT for a shift since some machines do odd things
+ in the register case (e.g., PA). */
+ if (tstoptab->code == ASHIFT)
+ reg2 = const1_rtx;
+ else
+ 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))
@@ -1787,13 +1795,17 @@ regmove_profitable_p ()
break;
if (find_matches (pat, &match) >= 0)
- return 1;
+ {
+ obfree (free_point);
+ return 1;
+ }
break;
}
while (tstoptab != ashl_optab && (tstoptab = ashl_optab, 1));
-#endif /* REGISTER_CONSTRAINTS */
obfree (free_point);
+#endif /* REGISTER_CONSTRAINTS */
+
return 0;
}
diff --git a/gcc/reload.c b/gcc/reload.c
index 4e1830c4d4f..7c14d39b1ab 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -88,7 +88,7 @@ a register with any other reload. */
#define REG_OK_STRICT
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "insn-config.h"
#include "insn-codes.h"
@@ -835,10 +835,10 @@ push_reload (in, out, inloc, outloc, class,
{
if (GET_CODE (XEXP (in, 0)) == POST_INC
|| GET_CODE (XEXP (in, 0)) == POST_DEC)
- in = gen_rtx (MEM, GET_MODE (in), XEXP (XEXP (in, 0), 0));
+ in = gen_rtx_MEM (GET_MODE (in), XEXP (XEXP (in, 0), 0));
if (GET_CODE (XEXP (in, 0)) == PRE_INC
|| GET_CODE (XEXP (in, 0)) == PRE_DEC)
- out = gen_rtx (MEM, GET_MODE (out), XEXP (XEXP (out, 0), 0));
+ out = gen_rtx_MEM (GET_MODE (out), XEXP (XEXP (out, 0), 0));
}
/* If we are reloading a (SUBREG constant ...), really reload just the
@@ -1080,16 +1080,16 @@ push_reload (in, out, inloc, outloc, class,
if (in != 0 && GET_CODE (in) == SUBREG && GET_CODE (SUBREG_REG (in)) == REG
&& REGNO (SUBREG_REG (in)) < FIRST_PSEUDO_REGISTER
&& ! dont_remove_subreg)
- in = gen_rtx (REG, GET_MODE (in),
- REGNO (SUBREG_REG (in)) + SUBREG_WORD (in));
+ in = gen_rtx_REG (GET_MODE (in),
+ REGNO (SUBREG_REG (in)) + SUBREG_WORD (in));
/* Similarly for OUT. */
if (out != 0 && GET_CODE (out) == SUBREG
&& GET_CODE (SUBREG_REG (out)) == REG
&& REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER
&& ! dont_remove_subreg)
- out = gen_rtx (REG, GET_MODE (out),
- REGNO (SUBREG_REG (out)) + SUBREG_WORD (out));
+ out = gen_rtx_REG (GET_MODE (out),
+ REGNO (SUBREG_REG (out)) + SUBREG_WORD (out));
/* Narrow down the class of register wanted if that is
desirable on this machine for efficiency. */
@@ -1445,7 +1445,7 @@ push_reload (in, out, inloc, outloc, class,
&& TEST_HARD_REG_BIT (reg_class_contents[(int) class], regno)
&& !fixed_regs[regno])
{
- reload_reg_rtx[i] = gen_rtx (REG, inmode, regno);
+ reload_reg_rtx[i] = gen_rtx_REG (inmode, regno);
break;
}
}
@@ -1661,9 +1661,9 @@ combine_reloads ()
REGNO (XEXP (note, 0)))))))
&& ! fixed_regs[REGNO (XEXP (note, 0))])
{
- reload_reg_rtx[output_reload] = gen_rtx (REG,
- reload_outmode[output_reload],
- REGNO (XEXP (note, 0)));
+ reload_reg_rtx[output_reload]
+ = gen_rtx_REG (reload_outmode[output_reload],
+ REGNO (XEXP (note, 0)));
return;
}
}
@@ -1767,7 +1767,7 @@ find_dummy_reload (real_in, real_out, inloc, outloc,
if (GET_CODE (real_out) == REG)
value = real_out;
else
- value = gen_rtx (REG, outmode, regno);
+ value = gen_rtx_REG (outmode, regno);
}
}
@@ -1821,7 +1821,7 @@ find_dummy_reload (real_in, real_out, inloc, outloc,
if (GET_CODE (real_in) == REG)
value = real_in;
else
- value = gen_rtx (REG, inmode, regno);
+ value = gen_rtx_REG (inmode, regno);
}
}
}
@@ -2113,28 +2113,28 @@ decompose (x)
{
if (GET_CODE (XEXP (offset, 0)) == CONST_INT)
{
- base = gen_rtx (PLUS, GET_MODE (base), base, XEXP (offset, 1));
+ base = gen_rtx_PLUS (GET_MODE (base), base, XEXP (offset, 1));
offset = XEXP (offset, 0);
}
else if (GET_CODE (XEXP (offset, 1)) == CONST_INT)
{
- base = gen_rtx (PLUS, GET_MODE (base), base, XEXP (offset, 0));
+ base = gen_rtx_PLUS (GET_MODE (base), base, XEXP (offset, 0));
offset = XEXP (offset, 1);
}
else
{
- base = gen_rtx (PLUS, GET_MODE (base), base, offset);
+ base = gen_rtx_PLUS (GET_MODE (base), base, offset);
offset = const0_rtx;
}
}
else if (GET_CODE (offset) != CONST_INT)
{
- base = gen_rtx (PLUS, GET_MODE (base), base, offset);
+ base = gen_rtx_PLUS (GET_MODE (base), base, offset);
offset = const0_rtx;
}
if (all_const && GET_CODE (base) == PLUS)
- base = gen_rtx (CONST, GET_MODE (base), base);
+ base = gen_rtx_CONST (GET_MODE (base), base);
if (GET_CODE (offset) != CONST_INT)
abort ();
@@ -2316,7 +2316,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
enum machine_mode operand_mode[MAX_RECOG_OPERANDS];
/* 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;
+ int previous_last_output_reload_regno = last_output_reload_regno;
this_insn = insn;
this_insn_is_asm = 0; /* Tentative. */
@@ -2327,6 +2327,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
replace_reloads = replace;
hard_regs_live_known = live_known;
static_reload_reg_p = reload_reg_p;
+ last_output_reload_regno = -1;
/* JUMP_INSNs and CALL_INSNs are not allowed to have any output reloads;
neither are insns that SET cc0. Insns that use CC0 are not allowed
@@ -2404,7 +2405,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
{
error_for_asm (insn, "operand constraints differ in number of alternatives");
/* Avoid further trouble with this insn. */
- PATTERN (insn) = gen_rtx (USE, VOIDmode, const0_rtx);
+ PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx);
n_reloads = 0;
return;
}
@@ -2623,13 +2624,13 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
after it. */
if (modified[i] != RELOAD_READ)
- PUT_MODE (emit_insn_after (gen_rtx (CLOBBER, VOIDmode,
- recog_operand[i]),
+ PUT_MODE (emit_insn_after (gen_rtx_CLOBBER (VOIDmode,
+ recog_operand[i]),
insn),
DImode);
*recog_operand_loc[i] = recog_operand[i]
- = gen_rtx (MEM, GET_MODE (recog_operand[i]), address);
+ = gen_rtx_MEM (GET_MODE (recog_operand[i]), address);
RTX_UNCHANGING_P (recog_operand[i])
= RTX_UNCHANGING_P (regno_reg_rtx[regno]);
find_reloads_address (GET_MODE (recog_operand[i]),
@@ -2817,9 +2818,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 '%':
@@ -2842,11 +2841,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.
@@ -3154,7 +3151,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
make this case cheaper. */
if (GET_CODE (operand) == REG
&& REGNO (operand) >= FIRST_PSEUDO_REGISTER
- && REGNO (operand) == last_output_reload_regno)
+ && REGNO (operand) == previous_last_output_reload_regno)
reject--;
/* If this is a constant that is reloaded into the desired
@@ -3438,7 +3435,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
abort ();
error_for_asm (insn, "inconsistent operand constraints in an `asm'");
/* Avoid further trouble with this insn. */
- PATTERN (insn) = gen_rtx (USE, VOIDmode, const0_rtx);
+ PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx);
n_reloads = 0;
return;
}
@@ -3545,7 +3542,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])
{
@@ -3611,7 +3607,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
0, i, operand_type[i]);
if (modified[i] != RELOAD_READ
&& GET_CODE (recog_operand[i]) == REG)
- last_output_reload_regno = REGNO (recog_operand[i]);
+ previous_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.
@@ -3630,7 +3626,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
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
+ previous_last_output_reload_regno
= REGNO (recog_operand[goal_alternative_matched[i]]);
}
else if (modified[i] == RELOAD_WRITE
@@ -3647,7 +3643,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
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]);
+ previous_last_output_reload_regno = REGNO (recog_operand[i]);
}
else if (insn_code_number >= 0)
abort ();
@@ -3655,7 +3651,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
{
error_for_asm (insn, "inconsistent operand constraints in an `asm'");
/* Avoid further trouble with this insn. */
- PATTERN (insn) = gen_rtx (USE, VOIDmode, const0_rtx);
+ PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx);
n_reloads = 0;
return;
}
@@ -4191,7 +4187,7 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest)
if (rtx_varies_p (addr))
addr = copy_rtx (addr);
- x = gen_rtx (MEM, GET_MODE (x), addr);
+ x = gen_rtx_MEM (GET_MODE (x), addr);
RTX_UNCHANGING_P (x) = RTX_UNCHANGING_P (regno_reg_rtx[regno]);
find_reloads_address (GET_MODE (x), NULL_PTR,
XEXP (x, 0),
@@ -4280,7 +4276,7 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest)
offset -= MIN (size, UNITS_PER_WORD);
}
addr = plus_constant (addr, offset);
- x = gen_rtx (MEM, GET_MODE (x), addr);
+ x = gen_rtx_MEM (GET_MODE (x), addr);
RTX_UNCHANGING_P (x) = RTX_UNCHANGING_P (regno_reg_rtx[regno]);
find_reloads_address (GET_MODE (x), NULL_PTR,
XEXP (x, 0),
@@ -4327,7 +4323,7 @@ make_memloc (ad, regno)
if (rtx_varies_p (tem))
tem = copy_rtx (tem);
- tem = gen_rtx (MEM, GET_MODE (ad), tem);
+ tem = gen_rtx_MEM (GET_MODE (ad), tem);
RTX_UNCHANGING_P (tem) = RTX_UNCHANGING_P (regno_reg_rtx[regno]);
memlocs[n_memlocs++] = tem;
return tem;
@@ -4598,10 +4594,10 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
|| XEXP (XEXP (ad, 0), 0) == stack_pointer_rtx)
&& ! memory_address_p (mode, ad))
{
- *loc = ad = gen_rtx (PLUS, GET_MODE (ad),
- plus_constant (XEXP (XEXP (ad, 0), 0),
- INTVAL (XEXP (ad, 1))),
- XEXP (XEXP (ad, 0), 1));
+ *loc = ad = gen_rtx_PLUS (GET_MODE (ad),
+ plus_constant (XEXP (XEXP (ad, 0), 0),
+ INTVAL (XEXP (ad, 1))),
+ XEXP (XEXP (ad, 0), 1));
find_reloads_address_part (XEXP (ad, 0), &XEXP (ad, 0),
reload_address_base_reg_class,
GET_MODE (ad), opnum, type, ind_levels);
@@ -4623,10 +4619,10 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
|| XEXP (XEXP (ad, 0), 1) == stack_pointer_rtx)
&& ! memory_address_p (mode, ad))
{
- *loc = ad = gen_rtx (PLUS, GET_MODE (ad),
- XEXP (XEXP (ad, 0), 0),
- plus_constant (XEXP (XEXP (ad, 0), 1),
- INTVAL (XEXP (ad, 1))));
+ *loc = ad = gen_rtx_PLUS (GET_MODE (ad),
+ XEXP (XEXP (ad, 0), 0),
+ plus_constant (XEXP (XEXP (ad, 0), 1),
+ INTVAL (XEXP (ad, 1))));
find_reloads_address_part (XEXP (ad, 1), &XEXP (ad, 1),
reload_address_base_reg_class,
GET_MODE (ad), opnum, type, ind_levels);
@@ -4741,13 +4737,15 @@ subst_reg_equivs (ad)
/* Compute the sum of X and Y, making canonicalizations assumed in an
address, namely: sum constant integers, surround the sum of two
constants with a CONST, put the constant as the second operand, and
- group the constant on the outermost sum.
+ group the constant on the outermost sum. If DIFF_P is nonzero,
+ compute the difference instead.
- This routine assumes both inputs are already in canonical form. */
+ This routine assumes X and Y are already in canonical form. */
rtx
-form_sum (x, y)
+form_sum (x, y, diff_p)
rtx x, y;
+ int diff_p;
{
rtx tem;
enum machine_mode mode = GET_MODE (x);
@@ -4758,20 +4756,20 @@ form_sum (x, y)
if (mode == VOIDmode)
mode = Pmode;
- if (GET_CODE (x) == CONST_INT)
+ if (! diff_p && GET_CODE (x) == CONST_INT)
return plus_constant (y, INTVAL (x));
else if (GET_CODE (y) == CONST_INT)
- return plus_constant (x, INTVAL (y));
- else if (CONSTANT_P (x))
+ return plus_constant (x, diff_p ? - INTVAL (y) : INTVAL (y));
+ else if (! diff_p && CONSTANT_P (x))
tem = x, x = y, y = tem;
if (GET_CODE (x) == PLUS && CONSTANT_P (XEXP (x, 1)))
- return form_sum (XEXP (x, 0), form_sum (XEXP (x, 1), y));
+ return form_sum (XEXP (x, 0), form_sum (y, XEXP (x, 1), diff_p), 0);
/* Note that if the operands of Y are specified in the opposite
order in the recursive calls below, infinite recursion will occur. */
if (GET_CODE (y) == PLUS && CONSTANT_P (XEXP (y, 1)))
- return form_sum (form_sum (x, XEXP (y, 0)), XEXP (y, 1));
+ return form_sum (form_sum (x, XEXP (y, 0), diff_p), XEXP (y, 1), diff_p);
/* If both constant, encapsulate sum. Otherwise, just form sum. A
constant will have been placed second. */
@@ -4782,10 +4780,11 @@ form_sum (x, y)
if (GET_CODE (y) == CONST)
y = XEXP (y, 0);
- return gen_rtx (CONST, VOIDmode, gen_rtx (PLUS, mode, x, y));
+ return gen_rtx_CONST (VOIDmode,
+ gen_rtx (diff_p ? MINUS: PLUS, mode, x, y));
}
- return gen_rtx (PLUS, mode, x, y);
+ return gen_rtx (diff_p ? MINUS: PLUS, mode, x, y);
}
/* If ADDR is a sum containing a pseudo register that should be
@@ -4839,9 +4838,9 @@ subst_indexed_address (addr)
/* Compute the sum. */
if (op2 != 0)
- op1 = form_sum (op1, op2);
+ op1 = form_sum (op1, op2, 0);
if (op1 != 0)
- op0 = form_sum (op0, op1);
+ op0 = form_sum (op0, op1, 0);
return op0;
}
@@ -4901,8 +4900,8 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
op0 = SUBREG_REG (op0);
code0 = GET_CODE (op0);
if (code0 == REG && REGNO (op0) < FIRST_PSEUDO_REGISTER)
- op0 = gen_rtx (REG, word_mode,
- REGNO (op0) + SUBREG_WORD (orig_op0));
+ op0 = gen_rtx_REG (word_mode,
+ REGNO (op0) + SUBREG_WORD (orig_op0));
}
if (GET_CODE (op1) == SUBREG)
@@ -4910,8 +4909,8 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
op1 = SUBREG_REG (op1);
code1 = GET_CODE (op1);
if (code1 == REG && REGNO (op1) < FIRST_PSEUDO_REGISTER)
- op1 = gen_rtx (REG, GET_MODE (op1),
- REGNO (op1) + SUBREG_WORD (orig_op1));
+ op1 = gen_rtx_REG (GET_MODE (op1),
+ REGNO (op1) + SUBREG_WORD (orig_op1));
}
if (code0 == MULT || code0 == SIGN_EXTEND || code0 == TRUNCATE
@@ -5322,7 +5321,7 @@ find_reloads_address_part (x, loc, class, mode, opnum, type, ind_levels)
{
rtx tem = force_const_mem (GET_MODE (x), XEXP (x, 1));
- x = gen_rtx (PLUS, GET_MODE (x), XEXP (x, 0), tem);
+ x = gen_rtx_PLUS (GET_MODE (x), XEXP (x, 0), tem);
find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0),
opnum, type, ind_levels, 0);
}
@@ -5354,7 +5353,7 @@ subst_reloads ()
do the wrong thing if RELOADREG is multi-word. RELOADREG
will always be a REG here. */
if (GET_MODE (reloadreg) != r->mode && r->mode != VOIDmode)
- reloadreg = gen_rtx (REG, r->mode, REGNO (reloadreg));
+ reloadreg = gen_rtx_REG (r->mode, REGNO (reloadreg));
/* If we are putting this into a SUBREG and RELOADREG is a
SUBREG, we would be making nested SUBREGs, so we have to fix
@@ -5438,7 +5437,7 @@ find_replacement (loc)
if (reloadreg && r->where == loc)
{
if (r->mode != VOIDmode && GET_MODE (reloadreg) != r->mode)
- reloadreg = gen_rtx (REG, r->mode, REGNO (reloadreg));
+ reloadreg = gen_rtx_REG (r->mode, REGNO (reloadreg));
return reloadreg;
}
@@ -5449,13 +5448,14 @@ find_replacement (loc)
??? Is it actually still ever a SUBREG? If so, why? */
if (GET_CODE (reloadreg) == REG)
- return gen_rtx (REG, GET_MODE (*loc),
- REGNO (reloadreg) + SUBREG_WORD (*loc));
+ return gen_rtx_REG (GET_MODE (*loc),
+ REGNO (reloadreg) + SUBREG_WORD (*loc));
else if (GET_MODE (reloadreg) == GET_MODE (*loc))
return reloadreg;
else
- return gen_rtx (SUBREG, GET_MODE (*loc), SUBREG_REG (reloadreg),
- SUBREG_WORD (reloadreg) + SUBREG_WORD (*loc));
+ return
+ gen_rtx_SUBREG (GET_MODE (*loc), SUBREG_REG (reloadreg),
+ SUBREG_WORD (reloadreg) + SUBREG_WORD (*loc));
}
}
diff --git a/gcc/reload.h b/gcc/reload.h
index 140eaa63855..573c0601cad 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -121,6 +121,8 @@ extern rtx reload_earlyclobbers[MAX_RECOG_OPERANDS];
/* Save the number of operands. */
extern int reload_n_operands;
+extern int last_output_reload_regno;
+
/* First uid used by insns created by reload in this function.
Used in find_equiv_reg. */
extern int reload_first_uid;
@@ -176,8 +178,9 @@ extern void find_reloads PROTO((rtx, int, int, int, short *));
/* Compute the sum of X and Y, making canonicalizations assumed in an
address, namely: sum constant integers, surround the sum of two
constants with a CONST, put the constant as the second operand, and
- group the constant on the outermost sum. */
-extern rtx form_sum PROTO((rtx, rtx));
+ group the constant on the outermost sum. If DIFF_P is nonzero, compute
+ the difference instead. */
+extern rtx form_sum PROTO((rtx, rtx, int));
/* Substitute into the current INSN the registers into which we have reloaded
the things that need reloading. */
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 8cdfdec9e3b..9e6bd508a23 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
#include "insn-config.h"
@@ -266,6 +266,11 @@ enum reg_class reload_address_index_reg_class;
int reload_in_progress = 0;
+/* Set to the register number that was reloaded in the last insn or
+ -1 if none; this is used to better choose which alternative to reload. */
+
+int last_output_reload_regno;
+
/* These arrays record the insn_code of insns that may be needed to
perform input and output reloads of special objects. They provide a
place to pass a scratch register. */
@@ -412,30 +417,32 @@ init_reload ()
permitted, zero if it is not permitted at all. */
register rtx tem
- = gen_rtx (MEM, Pmode,
- gen_rtx (PLUS, Pmode,
- gen_rtx (REG, Pmode, LAST_VIRTUAL_REGISTER + 1),
- GEN_INT (4)));
+ = gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode,
+ gen_rtx_REG (Pmode,
+ LAST_VIRTUAL_REGISTER + 1),
+ GEN_INT (4)));
spill_indirect_levels = 0;
while (memory_address_p (QImode, tem))
{
spill_indirect_levels++;
- tem = gen_rtx (MEM, Pmode, tem);
+ tem = gen_rtx_MEM (Pmode, tem);
}
/* See if indirect addressing is valid for (MEM (SYMBOL_REF ...)). */
- tem = gen_rtx (MEM, Pmode, gen_rtx (SYMBOL_REF, Pmode, "foo"));
+ tem = gen_rtx_MEM (Pmode, gen_rtx_SYMBOL_REF (Pmode, "foo"));
indirect_symref_ok = memory_address_p (QImode, tem);
/* See if reg+reg is a valid (and offsettable) address. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
- tem = gen_rtx (PLUS, Pmode,
- gen_rtx (REG, Pmode, HARD_FRAME_POINTER_REGNUM),
- gen_rtx (REG, Pmode, i));
+ 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);
@@ -747,8 +754,8 @@ reload (first, global, dumpfile)
for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
{
num_eliminable += ep->can_eliminate;
- ep->from_rtx = gen_rtx (REG, Pmode, ep->from);
- ep->to_rtx = gen_rtx (REG, Pmode, ep->to);
+ ep->from_rtx = gen_rtx_REG (Pmode, ep->from);
+ ep->to_rtx = gen_rtx_REG (Pmode, ep->to);
}
num_labels = max_label_num () - get_first_label_num ();
@@ -1035,6 +1042,8 @@ reload (first, global, dumpfile)
&& REG_NOTES (insn) != 0))
set_label_offsets (insn, insn, 0);
+ last_output_reload_regno = -1;
+
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
{
/* Nonzero means don't use a reload reg that overlaps
@@ -2540,10 +2549,10 @@ alter_reg (i, from_reg)
below. */
adjust = GET_MODE_SIZE (mode) - total_size;
if (adjust)
- stack_slot = gen_rtx (MEM, mode_for_size (total_size
- * BITS_PER_UNIT,
- MODE_INT, 1),
- plus_constant (XEXP (x, 0), adjust));
+ stack_slot = gen_rtx_MEM (mode_for_size (total_size
+ * BITS_PER_UNIT,
+ MODE_INT, 1),
+ plus_constant (XEXP (x, 0), adjust));
}
spill_stack_slot[from_reg] = stack_slot;
spill_stack_slot_width[from_reg] = total_size;
@@ -2558,8 +2567,8 @@ alter_reg (i, from_reg)
wrong mode, make a new stack slot. */
if (adjust != 0 || GET_MODE (x) != GET_MODE (regno_reg_rtx[i]))
{
- x = gen_rtx (MEM, GET_MODE (regno_reg_rtx[i]),
- plus_constant (XEXP (x, 0), adjust));
+ x = gen_rtx_MEM (GET_MODE (regno_reg_rtx[i]),
+ plus_constant (XEXP (x, 0), adjust));
/* If this was shared among registers, must ensure we never
set it readonly since that can cause scheduling
@@ -2872,6 +2881,7 @@ eliminate_regs (x, mem_mode, insn, storing)
address in case it is shared. */
new = eliminate_regs (reg_equiv_memory_loc[regno],
mem_mode, insn, 0);
+
if (new != reg_equiv_memory_loc[regno])
{
cannot_omit_stores[regno] = 1;
@@ -2881,11 +2891,12 @@ eliminate_regs (x, mem_mode, insn, storing)
return x;
case PLUS:
+ case MINUS:
/* If this is the sum of an eliminable register and a constant, rework
the sum. */
if (GET_CODE (XEXP (x, 0)) == REG
&& REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
- && CONSTANT_P (XEXP (x, 1)))
+ && code == PLUS && CONSTANT_P (XEXP (x, 1)))
{
for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS];
ep++)
@@ -2909,9 +2920,9 @@ eliminate_regs (x, mem_mode, insn, storing)
&& INTVAL (XEXP (x, 1)) == - ep->previous_offset)
return ep->to_rtx;
else
- return gen_rtx (PLUS, Pmode, ep->to_rtx,
- plus_constant (XEXP (x, 1),
- ep->previous_offset));
+ return gen_rtx_PLUS (Pmode, ep->to_rtx,
+ plus_constant (XEXP (x, 1),
+ ep->previous_offset));
}
/* If the register is not eliminable, we are done since the other
@@ -2954,13 +2965,13 @@ eliminate_regs (x, mem_mode, insn, storing)
&& reg_equiv_constant[REGNO (new0)] != 0)
new0 = reg_equiv_constant[REGNO (new0)];
- new = form_sum (new0, new1);
+ new = form_sum (new0, new1, code == MINUS);
/* As above, if we are not inside a MEM we do not want to
turn a PLUS into something else. We might try to do so here
for an addition of 0 if we aren't optimizing. */
- if (! mem_mode && GET_CODE (new) != PLUS)
- return gen_rtx (PLUS, GET_MODE (x), new, const0_rtx);
+ if (! mem_mode && GET_CODE (new) != PLUS && GET_CODE (new) != code)
+ return gen_rtx_PLUS (GET_MODE (x), new, const0_rtx);
else
return new;
}
@@ -2987,7 +2998,7 @@ eliminate_regs (x, mem_mode, insn, storing)
ep->ref_outside_mem = 1;
return
- plus_constant (gen_rtx (MULT, Pmode, ep->to_rtx, XEXP (x, 1)),
+ plus_constant (gen_rtx_MULT (Pmode, ep->to_rtx, XEXP (x, 1)),
ep->previous_offset * INTVAL (XEXP (x, 1)));
}
@@ -2995,7 +3006,6 @@ eliminate_regs (x, mem_mode, insn, storing)
case CALL:
case COMPARE:
- case MINUS:
case DIV: case UDIV:
case MOD: case UMOD:
case AND: case IOR: case XOR:
@@ -3020,7 +3030,7 @@ eliminate_regs (x, mem_mode, insn, storing)
{
new = eliminate_regs (XEXP (x, 0), mem_mode, insn, 0);
if (new != XEXP (x, 0))
- x = gen_rtx (EXPR_LIST, REG_NOTE_KIND (x), new, XEXP (x, 1));
+ x = gen_rtx_EXPR_LIST (REG_NOTE_KIND (x), new, XEXP (x, 1));
}
/* ... fall through ... */
@@ -3101,7 +3111,7 @@ eliminate_regs (x, mem_mode, insn, storing)
insn so that delete_output_reload will do the right thing. */
if (insn != 0 && GET_CODE (insn) != EXPR_LIST
&& GET_CODE (insn) != INSN_LIST)
- emit_insn_before (gen_rtx (USE, VOIDmode, SUBREG_REG (x)),
+ emit_insn_before (gen_rtx_USE (VOIDmode, SUBREG_REG (x)),
insn);
}
}
@@ -3151,7 +3161,7 @@ eliminate_regs (x, mem_mode, insn, storing)
return new;
}
else
- return gen_rtx (SUBREG, GET_MODE (x), new, SUBREG_WORD (x));
+ return gen_rtx_SUBREG (GET_MODE (x), new, SUBREG_WORD (x));
}
return x;
@@ -3212,12 +3222,13 @@ eliminate_regs (x, mem_mode, insn, storing)
if (new_asm_operands_vec == old_asm_operands_vec)
return x;
- new = gen_rtx (ASM_OPERANDS, VOIDmode, ASM_OPERANDS_TEMPLATE (x),
- ASM_OPERANDS_OUTPUT_CONSTRAINT (x),
- ASM_OPERANDS_OUTPUT_IDX (x), new_asm_operands_vec,
- ASM_OPERANDS_INPUT_CONSTRAINT_VEC (x),
- ASM_OPERANDS_SOURCE_FILE (x),
- ASM_OPERANDS_SOURCE_LINE (x));
+ new = gen_rtx_ASM_OPERANDS (VOIDmode, ASM_OPERANDS_TEMPLATE (x),
+ ASM_OPERANDS_OUTPUT_CONSTRAINT (x),
+ ASM_OPERANDS_OUTPUT_IDX (x),
+ new_asm_operands_vec,
+ ASM_OPERANDS_INPUT_CONSTRAINT_VEC (x),
+ ASM_OPERANDS_SOURCE_FILE (x),
+ ASM_OPERANDS_SOURCE_LINE (x));
new->volatil = x->volatil;
return new;
}
@@ -3274,10 +3285,10 @@ eliminate_regs (x, mem_mode, insn, storing)
if (GET_CODE (SET_DEST (x)) == REG && GET_CODE (new0) == MEM
&& insn != 0 && GET_CODE (insn) != EXPR_LIST
&& GET_CODE (insn) != INSN_LIST)
- emit_insn_after (gen_rtx (CLOBBER, VOIDmode, SET_DEST (x)), insn);
+ emit_insn_after (gen_rtx_CLOBBER (VOIDmode, SET_DEST (x)), insn);
if (new0 != SET_DEST (x) || new1 != SET_SRC (x))
- return gen_rtx (SET, VOIDmode, new0, new1);
+ return gen_rtx_SET (VOIDmode, new0, new1);
}
return x;
@@ -3295,7 +3306,7 @@ eliminate_regs (x, mem_mode, insn, storing)
new = eliminate_regs (XEXP (x, 0), GET_MODE (x), insn, 0);
if (new != XEXP (x, 0))
{
- new = gen_rtx (MEM, GET_MODE (x), new);
+ new = gen_rtx_MEM (GET_MODE (x), new);
new->volatil = x->volatil;
new->unchanging = x->unchanging;
new->in_struct = x->in_struct;
@@ -3469,7 +3480,7 @@ eliminate_regs_in_insn (insn, replace)
in the insn is the negative of the offset in FROM. Substitute
(set (reg) (reg to)) for the insn and change its code.
- We have to do this here, rather than in eliminate_regs, do that we can
+ We have to do this here, rather than in eliminate_regs, so that we can
change the insn code. */
if (GET_CODE (SET_SRC (old_set)) == PLUS
@@ -3489,8 +3500,9 @@ eliminate_regs_in_insn (insn, replace)
/* We assume here that we don't need a PARALLEL of
any CLOBBERs for this assignment. There's not
much we can do if we do need it. */
- PATTERN (insn) = gen_rtx (SET, VOIDmode,
- SET_DEST (old_set), ep->to_rtx);
+ PATTERN (insn) = gen_rtx_SET (VOIDmode,
+ SET_DEST (old_set),
+ ep->to_rtx);
INSN_CODE (insn) = -1;
val = 1;
goto done;
@@ -3541,7 +3553,8 @@ eliminate_regs_in_insn (insn, replace)
|| (GET_CODE (SET_DEST (old_set)) == MEM
&& SET_DEST (old_set) != recog_operand[0])))
/* If this was an add insn before, rerecognize. */
- || GET_CODE (SET_SRC (old_set)) == PLUS))
+ || GET_CODE (SET_SRC (old_set)) == PLUS
+ || GET_CODE (SET_SRC (old_set)) == MINUS))
{
if (! validate_change (insn, &PATTERN (insn), new_body, 0))
/* If recognition fails, store the new body anyway.
@@ -4013,6 +4026,7 @@ reload_as_needed (first, live_known)
spill_reg_order[spill_regs[i]] = i;
}
+ last_output_reload_regno = -1;
for (insn = first; insn;)
{
register rtx next = NEXT_INSN (insn);
@@ -4088,7 +4102,11 @@ reload_as_needed (first, live_known)
}
if (GET_MODE (insn) == VOIDmode)
- n_reloads = 0;
+ {
+ n_reloads = 0;
+ last_output_reload_regno = -1;
+ }
+
/* First find the pseudo regs that must be reloaded for this insn.
This info is returned in the tables reload_... (see reload.h).
Also modify the body of INSN by substituting RELOAD
@@ -5151,7 +5169,7 @@ allocate_reload_reg (r, insn, last_reload, noerror)
if (new == 0 || GET_MODE (new) != reload_mode[r])
spill_reg_rtx[i] = new
- = gen_rtx (REG, reload_mode[r], spill_regs[i]);
+ = gen_rtx_REG (reload_mode[r], spill_regs[i]);
regno = true_regnum (new);
@@ -5608,7 +5626,7 @@ choose_reload_regs (insn, avoid_return_reg)
address and not all machines support SUBREGs
there. */
regno = REGNO (SUBREG_REG (equiv)) + SUBREG_WORD (equiv);
- equiv = gen_rtx (REG, reload_mode[r], regno);
+ equiv = gen_rtx_REG (reload_mode[r], regno);
}
else
abort ();
@@ -6168,12 +6186,12 @@ emit_reload_insns (insn)
must always be a REG here. */
if (GET_MODE (reloadreg) != mode)
- reloadreg = gen_rtx (REG, mode, REGNO (reloadreg));
+ reloadreg = gen_rtx_REG (mode, REGNO (reloadreg));
while (GET_CODE (oldequiv) == SUBREG && GET_MODE (oldequiv) != mode)
oldequiv = SUBREG_REG (oldequiv);
if (GET_MODE (oldequiv) != VOIDmode
&& mode != GET_MODE (oldequiv))
- oldequiv = gen_rtx (SUBREG, mode, oldequiv, 0);
+ oldequiv = gen_rtx_SUBREG (mode, oldequiv, 0);
/* Switch to the right place to emit the reload insns. */
switch (reload_when_needed[j])
@@ -6356,8 +6374,8 @@ emit_reload_insns (insn)
oldequiv = old, real_oldequiv = real_old;
else
second_reload_reg
- = gen_rtx (REG, new_mode,
- REGNO (second_reload_reg));
+ = gen_rtx_REG
+ (new_mode, REGNO (second_reload_reg));
}
}
}
@@ -6424,9 +6442,9 @@ emit_reload_insns (insn)
&& reg_overlap_mentioned_for_reload_p (second_reload_reg,
PATTERN (prev)))
{
- REG_NOTES (prev) = gen_rtx (EXPR_LIST, REG_DEAD,
- second_reload_reg,
- REG_NOTES (prev));
+ REG_NOTES (prev)
+ = gen_rtx_EXPR_LIST (REG_DEAD, second_reload_reg,
+ REG_NOTES (prev));
break;
}
}
@@ -6467,8 +6485,7 @@ emit_reload_insns (insn)
|| reload_when_needed[j] == RELOAD_FOR_INPUT)
&& ! dead_or_set_p (insn, reloadreg))
REG_NOTES (insn)
- = gen_rtx (EXPR_LIST, REG_DEAD,
- reloadreg, REG_NOTES (insn));
+ = gen_rtx_EXPR_LIST (REG_DEAD, reloadreg, REG_NOTES (insn));
}
/* When we inherit a reload, the last marked death of the reload reg
@@ -6536,17 +6553,19 @@ emit_reload_insns (insn)
{
for (prev1 = this_reload_insn;
prev1; prev1 = PREV_INSN (prev1))
- if (GET_RTX_CLASS (GET_CODE (prev1) == 'i')
- && reg_overlap_mentioned_for_reload_p (oldequiv_reg,
- PATTERN (prev1)))
- {
- REG_NOTES (prev1) = gen_rtx (EXPR_LIST, REG_DEAD,
- oldequiv_reg,
- REG_NOTES (prev1));
- break;
- }
+ if (GET_RTX_CLASS (GET_CODE (prev1)) == 'i'
+ && (reg_overlap_mentioned_for_reload_p
+ (oldequiv_reg, PATTERN (prev1))))
+ {
+ REG_NOTES (prev1)
+ = gen_rtx_EXPR_LIST (REG_DEAD, oldequiv_reg,
+ REG_NOTES (prev1));
+ break;
+ }
+
remove_death (REGNO (oldequiv_reg), prev);
}
+
break;
}
}
@@ -6649,11 +6668,11 @@ emit_reload_insns (insn)
error_for_asm (insn, "output operand is constant in `asm'");
/* Prevent crash--use something we know is valid. */
mode = word_mode;
- old = gen_rtx (REG, mode, REGNO (reloadreg));
+ old = gen_rtx_REG (mode, REGNO (reloadreg));
}
if (GET_MODE (reloadreg) != mode)
- reloadreg = gen_rtx (REG, mode, REGNO (reloadreg));
+ reloadreg = gen_rtx_REG (mode, REGNO (reloadreg));
#ifdef SECONDARY_OUTPUT_RELOAD_CLASS
@@ -6694,7 +6713,7 @@ emit_reload_insns (insn)
= reload_secondary_out_icode[secondary_reload];
if (GET_MODE (reloadreg) != mode)
- reloadreg = gen_rtx (REG, mode, REGNO (reloadreg));
+ reloadreg = gen_rtx_REG (mode, REGNO (reloadreg));
if (tertiary_icode != CODE_FOR_nothing)
{
@@ -6749,8 +6768,8 @@ emit_reload_insns (insn)
if (GET_RTX_CLASS (GET_CODE (p)) == 'i'
&& reg_overlap_mentioned_for_reload_p (reloadreg,
PATTERN (p)))
- REG_NOTES (p) = gen_rtx (EXPR_LIST, REG_DEAD,
- reloadreg, REG_NOTES (p));
+ REG_NOTES (p) = gen_rtx_EXPR_LIST (REG_DEAD,
+ reloadreg, REG_NOTES (p));
#ifdef SECONDARY_OUTPUT_RELOAD_CLASS
if (! special && second_reloadreg
@@ -6759,8 +6778,9 @@ emit_reload_insns (insn)
if (GET_RTX_CLASS (GET_CODE (p)) == 'i'
&& reg_overlap_mentioned_for_reload_p (second_reloadreg,
PATTERN (p)))
- REG_NOTES (p) = gen_rtx (EXPR_LIST, REG_DEAD,
- second_reloadreg, REG_NOTES (p));
+ REG_NOTES (p)
+ = gen_rtx_EXPR_LIST (REG_DEAD,
+ second_reloadreg, REG_NOTES (p));
#endif
#endif
/* Look at all insns we emitted, just to be safe. */
@@ -6948,9 +6968,9 @@ emit_reload_insns (insn)
for (k = 1; k < nnr; k++)
reg_last_reload_reg[nregno + k]
= (nr == nnr
- ? gen_rtx (REG,
- reg_raw_mode[REGNO (reload_reg_rtx[r]) + k],
- REGNO (reload_reg_rtx[r]) + k)
+ ? gen_rtx_REG
+ (reg_raw_mode[REGNO (reload_reg_rtx[r]) + k],
+ REGNO (reload_reg_rtx[r]) + k)
: 0);
/* Now do the inverse operation. */
@@ -6992,9 +7012,9 @@ emit_reload_insns (insn)
for (k = 1; k < nnr; k++)
reg_last_reload_reg[nregno + k]
= (nr == nnr
- ? gen_rtx (REG,
- reg_raw_mode[REGNO (reload_reg_rtx[r]) + k],
- REGNO (reload_reg_rtx[r]) + k)
+ ? (gen_rtx_REG
+ (reg_raw_mode[REGNO (reload_reg_rtx[r]) + k],
+ REGNO (reload_reg_rtx[r]) + k))
: 0);
/* Unless we inherited this reload, show we haven't
@@ -7148,9 +7168,9 @@ gen_reload (out, in, opnum, type)
tem = op0, op0 = op1, op1 = tem;
if (op0 != XEXP (in, 0) || op1 != XEXP (in, 1))
- in = gen_rtx (PLUS, GET_MODE (in), op0, op1);
+ in = gen_rtx_PLUS (GET_MODE (in), op0, op1);
- insn = emit_insn (gen_rtx (SET, VOIDmode, out, in));
+ insn = emit_insn (gen_rtx_SET (VOIDmode, out, in));
code = recog_memoized (insn);
if (code >= 0)
@@ -7223,10 +7243,10 @@ gen_reload (out, in, opnum, type)
rtx loc = get_secondary_mem (in, GET_MODE (out), opnum, type);
if (GET_MODE (loc) != GET_MODE (out))
- out = gen_rtx (REG, GET_MODE (loc), REGNO (out));
+ out = gen_rtx_REG (GET_MODE (loc), REGNO (out));
if (GET_MODE (loc) != GET_MODE (in))
- in = gen_rtx (REG, GET_MODE (loc), REGNO (in));
+ in = gen_rtx_REG (GET_MODE (loc), REGNO (in));
gen_reload (loc, in, opnum, type);
gen_reload (out, loc, opnum, type);
@@ -7244,7 +7264,7 @@ gen_reload (out, in, opnum, type)
/* Otherwise, just write (set OUT IN) and hope for the best. */
else
- emit_insn (gen_rtx (SET, VOIDmode, out, in));
+ emit_insn (gen_rtx_SET (VOIDmode, out, in));
/* Return the first insn emitted.
We can not just return get_last_insn, because there may have
@@ -7400,9 +7420,9 @@ inc_for_reload (reloadreg, value, inc_amount)
in gen_reload. */
last = get_last_insn ();
- add_insn = emit_insn (gen_rtx (SET, VOIDmode, incloc,
- gen_rtx (PLUS, GET_MODE (incloc),
- incloc, inc)));
+ add_insn = emit_insn (gen_rtx_SET (VOIDmode, incloc,
+ gen_rtx_PLUS (GET_MODE (incloc),
+ incloc, inc)));
code = recog_memoized (add_insn);
if (code >= 0)
@@ -7880,11 +7900,11 @@ reload_cse_regs (first)
/* We pass this to reload_cse_invalidate_mem to invalidate all of
memory for a non-const call instruction. */
- callmem = gen_rtx (MEM, BLKmode, const0_rtx);
+ callmem = gen_rtx_MEM (BLKmode, const0_rtx);
/* This is used in reload_cse_invalidate_regno to avoid consing a
new REG in a loop in that function. */
- invalidate_regno_rtx = gen_rtx (REG, VOIDmode, 0);
+ invalidate_regno_rtx = gen_rtx_REG (VOIDmode, 0);
for (insn = first; insn; insn = NEXT_INSN (insn))
{
@@ -8209,7 +8229,7 @@ reload_cse_simplify_set (set, insn)
pop_obstacks ();
validated = validate_change (insn, &SET_SRC (set),
- gen_rtx (REG, dest_mode, i), 1);
+ gen_rtx_REG (dest_mode, i), 1);
/* Go back to the obstack we are using for temporary
storage. */
@@ -8338,6 +8358,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':
@@ -8364,7 +8385,7 @@ reload_cse_simplify_operands (insn)
replacement register if we don't have one for this
alternative yet. */
if (op_alt_regno[i][j] == -1
- && reg_fits_class_p (gen_rtx (REG, mode, regno), class,
+ && reg_fits_class_p (gen_rtx_REG (mode, regno), class,
0, mode))
{
alternative_nregs[j]++;
@@ -8431,7 +8452,7 @@ reload_cse_simplify_operands (insn)
reload_cse_no_longer_dead (op_alt_regno[i][j], mode);
validate_change (insn, recog_operand_loc[i],
- gen_rtx (REG, mode, op_alt_regno[i][j]), 1);
+ gen_rtx_REG (mode, op_alt_regno[i][j]), 1);
}
for (i = insn_n_dups[insn_code_number] - 1; i >= 0; i--)
@@ -8444,7 +8465,7 @@ reload_cse_simplify_operands (insn)
reload_cse_no_longer_dead (op_alt_regno[op][j], mode);
validate_change (insn, recog_dup_loc[i],
- gen_rtx (REG, mode, op_alt_regno[op][j]), 1);
+ gen_rtx_REG (mode, op_alt_regno[op][j]), 1);
}
/* Go back to the obstack we are using for temporary
@@ -8588,12 +8609,12 @@ reload_cse_record_set (set, body)
else
tmp = gen_lowpart_common (dest_mode, XEXP (x, 0));
if (tmp)
- reg_values[dreg] = gen_rtx (EXPR_LIST, dest_mode, tmp,
- reg_values[dreg]);
+ reg_values[dreg] = gen_rtx_EXPR_LIST (dest_mode, tmp,
+ reg_values[dreg]);
}
}
else
- reg_values[dreg] = gen_rtx (EXPR_LIST, dest_mode, src, NULL_RTX);
+ reg_values[dreg] = gen_rtx_EXPR_LIST (dest_mode, src, NULL_RTX);
/* We've changed DREG, so invalidate any values held by other
registers that depend upon it. */
@@ -8612,8 +8633,8 @@ reload_cse_record_set (set, body)
/* If we're storing a register to memory, add DEST to the list
in REG_VALUES. */
if (sreg >= 0 && ! side_effects_p (dest))
- reg_values[sreg] = gen_rtx (EXPR_LIST, dest_mode, dest,
- reg_values[sreg]);
+ reg_values[sreg] = gen_rtx_EXPR_LIST (dest_mode, dest,
+ reg_values[sreg]);
}
else
{
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 44bf09a01c4..02269b6a6c9 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -116,7 +116,7 @@ Boston, MA 02111-1307, USA. */
effect to the ARM, differing mostly in which insn is "in charge". */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "insn-config.h"
#include "conditions.h"
@@ -875,7 +875,7 @@ emit_delay_sequence (insn, list, length, avail)
/* Allocate the the rtvec to hold the insns and the SEQUENCE. */
rtvec seqv = rtvec_alloc (length + 1);
- rtx seq = gen_rtx (SEQUENCE, VOIDmode, seqv);
+ rtx seq = gen_rtx_SEQUENCE (VOIDmode, seqv);
rtx seq_insn = make_insn_raw (seq);
rtx first = get_insns ();
rtx last = get_last_insn ();
@@ -988,7 +988,7 @@ add_to_delay_list (insn, delay_list)
if (tinfo)
tinfo->block = -1;
- return gen_rtx (INSN_LIST, VOIDmode, insn, NULL_RTX);
+ return gen_rtx_INSN_LIST (VOIDmode, insn, NULL_RTX);
}
/* Otherwise this must be an INSN_LIST. Add INSN to the end of the
@@ -1185,7 +1185,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)
@@ -1926,7 +1927,7 @@ try_merge_delay_insns (insn, thread)
INSN_FROM_TARGET_P (next_to_match) = 0;
}
else
- merged_insns = gen_rtx (INSN_LIST, VOIDmode, trial, merged_insns);
+ merged_insns = gen_rtx_INSN_LIST (VOIDmode, trial, merged_insns);
if (++slot_number == num_slots)
break;
@@ -1978,8 +1979,8 @@ try_merge_delay_insns (insn, thread)
INSN_FROM_TARGET_P (next_to_match) = 0;
}
else
- merged_insns = gen_rtx (INSN_LIST, SImode, dtrial,
- merged_insns);
+ merged_insns = gen_rtx_INSN_LIST (SImode, dtrial,
+ merged_insns);
if (++slot_number == num_slots)
break;
@@ -2340,7 +2341,7 @@ update_block (insn, where)
if (INSN_FROM_TARGET_P (insn))
return;
- emit_insn_before (gen_rtx (USE, VOIDmode, insn), where);
+ emit_insn_before (gen_rtx_USE (VOIDmode, insn), where);
/* INSN might be making a value live in a block where it didn't use to
be. So recompute liveness information for this block. */
@@ -3052,13 +3053,13 @@ fill_simple_delay_slots (first, 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);
if (slots_to_fill == 0)
- abort ();
+ continue;
/* This insn needs, or can use, some delay slots. SLOTS_TO_FILL
says how many. After initialization, first try optimizing
@@ -3081,6 +3082,11 @@ fill_simple_delay_slots (first, 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)
@@ -3153,8 +3159,7 @@ fill_simple_delay_slots (first, 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 (cc0_rtx, pat))
+ && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat))
#endif
)
{
@@ -3168,8 +3173,8 @@ fill_simple_delay_slots (first, non_jumps_p)
tail, of the list. */
update_reg_dead_notes (trial, insn);
- delay_list = gen_rtx (INSN_LIST, VOIDmode,
- trial, delay_list);
+ delay_list = gen_rtx_INSN_LIST (VOIDmode,
+ trial, delay_list);
update_block (trial, trial);
delete_insn (trial);
if (slots_to_fill == ++slots_filled)
@@ -3458,8 +3463,8 @@ fill_simple_delay_slots (first, non_jumps_p)
insns we find on the head of the list. */
current_function_epilogue_delay_list
- = gen_rtx (INSN_LIST, VOIDmode, trial,
- current_function_epilogue_delay_list);
+ = gen_rtx_INSN_LIST (VOIDmode, trial,
+ current_function_epilogue_delay_list);
mark_referenced_resources (trial, &end_of_function_needs, 1);
update_block (trial, trial);
delete_insn (trial);
@@ -3825,7 +3830,7 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely,
new_arith = gen_rtx (GET_CODE (src) == PLUS ? MINUS : PLUS,
GET_MODE (src), dest, other);
- ninsn = emit_insn_after (gen_rtx (SET, VOIDmode, dest, new_arith),
+ ninsn = emit_insn_after (gen_rtx_SET (VOIDmode, dest, new_arith),
insn);
if (recog_memoized (ninsn) < 0
@@ -3929,7 +3934,7 @@ fill_eager_delay_slots (first)
slots_to_fill = num_delay_slots (insn);
if (slots_to_fill == 0)
- abort ();
+ continue;
slots_filled = 0;
target_label = JUMP_LABEL (insn);
diff --git a/gcc/rtl.c b/gcc/rtl.c
index b5602437c8c..8802b504b03 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -1,5 +1,5 @@
/* Allocate and read RTL for GNU C Compiler.
- Copyright (C) 1987, 1988, 1991, 1994, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 91, 94, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,8 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <ctype.h>
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "real.h"
@@ -36,10 +35,6 @@ Boston, MA 02111-1307, USA. */
During optimization and output, this is function_obstack. */
extern struct obstack *rtl_obstack;
-
-#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
-extern long atol();
-#endif
/* Indexed by rtx code, gives number of operands for an rtx with that code.
Does NOT include rtx header data (code and links).
@@ -233,7 +228,8 @@ rtx_alloc (code)
if (ob->chunk_limit - ob->next_free < length)
_obstack_newchunk (ob, length);
- rt = (rtx)ob->object_base;
+
+ rt = (rtx) ob->object_base;
ob->next_free += length;
ob->object_base = ob->next_free;
@@ -241,15 +237,60 @@ rtx_alloc (code)
one int, but we don't want to assume that and it isn't very portable
anyway; this is. */
- length = (sizeof (struct rtx_def) - sizeof (rtunion) - 1) / sizeof (int);
- for (; length >= 0; length--)
- ((int *) rt)[length] = 0;
+ if (sizeof (struct rtx_def) - sizeof (rtunion) == sizeof (int))
+ *(int *) rt = 0;
+ else if (sizeof (struct rtx_def) - sizeof (rtunion)
+ == sizeof (HOST_WIDE_INT))
+ *(HOST_WIDE_INT *) rt = 0;
+ else
+ bzero((char *) rt, sizeof (struct rtx_def) - sizeof (rtunion));
PUT_CODE (rt, 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. */
+
+ if (sizeof (struct rtx_def) - sizeof (rtunion) == sizeof (int))
+ *(int *) rt = 0;
+ else if (sizeof (struct rtx_def) - sizeof (rtunion)
+ == sizeof (HOST_WIDE_INT))
+ *(HOST_WIDE_INT *) rt = 0;
+ else
+ bzero((char *) rt, 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 12c9c3b9be9..3a6e817f865 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -1,7 +1,7 @@
/* 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, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 92, 94, 95, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -385,7 +385,7 @@ DEF_RTL_EXPR(NOTE, "note", "iuusn", 'x')
it contains helps to build the mapping function between the rtx's of
the function to be inlined and the current function being expanded. */
-DEF_RTL_EXPR(INLINE_HEADER, "inline_header", "iuuuiiiiiieeiiEeEsse", 'x')
+DEF_RTL_EXPR(INLINE_HEADER, "inline_header", "iuuuiiiiiieeiiEeEssE", 'x')
/* ----------------------------------------------------------------------
Top level constituents of INSN, JUMP_INSN and CALL_INSN.
@@ -500,9 +500,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')
diff --git a/gcc/rtl.h b/gcc/rtl.h
index f4acf67f798..4b2ebe0c588 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -669,8 +669,6 @@ extern char *note_insn_name[];
extern rtx plus_constant_wide PROTO((rtx, HOST_WIDE_INT));
extern rtx plus_constant_for_output_wide PROTO((rtx, HOST_WIDE_INT));
-#define GEN_INT(N) gen_rtx (CONST_INT, VOIDmode, (HOST_WIDE_INT) (N))
-
extern rtx bc_gen_rtx ();
extern rtx gen_rtx PVPROTO((enum rtx_code,
@@ -692,10 +690,8 @@ extern char *xrealloc ();
extern char *oballoc PROTO((int));
extern char *permalloc PROTO((int));
-#ifdef NEED_DECLARATION_FREE
-extern void free PROTO((void *));
-#endif
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));
@@ -895,6 +891,25 @@ extern rtx struct_value_incoming_rtx;
extern rtx static_chain_rtx;
extern rtx static_chain_incoming_rtx;
+/* Include the RTL generation functions. */
+
+#ifndef NO_GENRTL_H
+#include "genrtl.h"
+#endif
+
+/* There are some RTL codes that require special attention; the
+ generation functions included above do the raw handling. If you
+ add to this list, modify special_rtx in gengenrtl.c as well. You
+ should also modify gen_rtx to use the special function. */
+
+extern rtx gen_rtx_CONST_INT PROTO((enum machine_mode, HOST_WIDE_INT));
+extern rtx gen_rtx_REG PROTO((enum machine_mode, int));
+extern rtx gen_rtx_MEM PROTO((enum machine_mode, rtx));
+
+/* We need the cast here to ensure that we get the same result both with
+ 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/rtlanal.c b/gcc/rtlanal.c
index 4df251bb3b7..99475855f63 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
static int rtx_addr_can_trap_p PROTO((rtx));
diff --git a/gcc/scan-decls.c b/gcc/scan-decls.c
index a5fb8741fd6..4a3443b5d70 100644
--- a/gcc/scan-decls.c
+++ b/gcc/scan-decls.c
@@ -1,5 +1,5 @@
/* scan-decls.c - Extracts declarations from cpp output.
- Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1997, 1998 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
@@ -17,9 +17,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Written by Per Bothner <bothner@cygnus.com>, July 1993. */
-#include <stdio.h>
-#include <ctype.h>
#include "hconfig.h"
+#include "system.h"
#include "cpplib.h"
int brace_nesting = 0;
diff --git a/gcc/scan.c b/gcc/scan.c
index 4f575b38a9f..89930278f40 100644
--- a/gcc/scan.c
+++ b/gcc/scan.c
@@ -1,5 +1,5 @@
/* Utility functions for scan-decls and fix-header programs.
- Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1998 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
@@ -15,9 +15,9 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "scan.h"
#include "hconfig.h"
-#include <ctype.h>
+#include "system.h"
+#include "scan.h"
int lineno = 1;
int source_lineno = 1;
diff --git a/gcc/sched.c b/gcc/sched.c
index abc98ddd68a..30f7d0b05f4 100644
--- a/gcc/sched.c
+++ b/gcc/sched.c
@@ -118,7 +118,7 @@ Boston, MA 02111-1307, USA. */
beginning of basic blocks that have been scheduled. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "basic-block.h"
#include "regs.h"
@@ -321,7 +321,8 @@ static void sched_analyze_2 PROTO((rtx, rtx));
static void sched_analyze_insn PROTO((rtx, rtx, rtx));
static int sched_analyze PROTO((rtx, rtx));
static void sched_note_set PROTO((int, rtx, int));
-static int rank_for_schedule PROTO((rtx *, rtx *));
+static int rank_for_schedule PROTO((const GENERIC_PTR,
+ const GENERIC_PTR));
static void swap_sort PROTO((rtx *, int));
static void queue_insn PROTO((rtx, int));
static int birthing_insn_p PROTO((rtx));
@@ -391,7 +392,7 @@ canon_rtx (x)
return plus_constant_for_output (x1, INTVAL (x0));
else if (GET_CODE (x1) == CONST_INT)
return plus_constant_for_output (x0, INTVAL (x1));
- return gen_rtx (PLUS, GET_MODE (x), x0, x1);
+ return gen_rtx_PLUS (GET_MODE (x), x0, x1);
}
}
/* This gives us much better alias analysis when called from
@@ -844,6 +845,12 @@ true_dependence (mem, x)
return 0;
return ((MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
+ /* If we have two memrefs whose MEM_IN_STRUCT_P values differ and
+ one is volatile, show they conflict. This isn't quite right, but
+ works around the fact that MEM_IN_STRUCT_P cannot be set
+ totally accurately. */
+ || (MEM_IN_STRUCT_P (x) != MEM_IN_STRUCT_P (mem)
+ && (MEM_VOLATILE_P (x) || MEM_VOLATILE_P (mem)))
|| (memrefs_conflict_p (SIZE_FOR_MODE (mem), XEXP (mem, 0),
SIZE_FOR_MODE (x), XEXP (x, 0), 0)
&& ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem)
@@ -872,6 +879,8 @@ anti_dependence (mem, x)
return 0;
return ((MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
+ || (MEM_IN_STRUCT_P (x) != MEM_IN_STRUCT_P (mem)
+ && (MEM_VOLATILE_P (x) || MEM_VOLATILE_P (mem)))
|| (memrefs_conflict_p (SIZE_FOR_MODE (mem), XEXP (mem, 0),
SIZE_FOR_MODE (x), XEXP (x, 0), 0)
&& ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem)
@@ -894,6 +903,8 @@ output_dependence (mem, x)
x = canon_rtx (x);
mem = canon_rtx (mem);
return ((MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
+ || (MEM_IN_STRUCT_P (x) != MEM_IN_STRUCT_P (mem)
+ && (MEM_VOLATILE_P (x) || MEM_VOLATILE_P (mem)))
|| (memrefs_conflict_p (SIZE_FOR_MODE (mem), XEXP (mem, 0),
SIZE_FOR_MODE (x), XEXP (x, 0), 0)
&& ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem)
@@ -1892,8 +1903,8 @@ sched_analyze_2 (x, insn)
while (--i >= 0)
{
reg_last_uses[regno + i]
- = gen_rtx (INSN_LIST, VOIDmode,
- insn, reg_last_uses[regno + i]);
+ = gen_rtx_INSN_LIST (VOIDmode,
+ insn, reg_last_uses[regno + i]);
if (reg_last_sets[regno + i])
add_dependence (insn, reg_last_sets[regno + i], 0);
if ((call_used_regs[regno + i] || global_regs[regno + i])
@@ -1905,7 +1916,7 @@ sched_analyze_2 (x, insn)
else
{
reg_last_uses[regno]
- = gen_rtx (INSN_LIST, VOIDmode, insn, reg_last_uses[regno]);
+ = gen_rtx_INSN_LIST (VOIDmode, insn, reg_last_uses[regno]);
if (reg_last_sets[regno])
add_dependence (insn, reg_last_sets[regno], 0);
@@ -2243,12 +2254,12 @@ sched_analyze (head, tail)
convert back into a NOTE_INSN_SETJMP note. See
reemit_notes for why we use a pair of of NOTEs. */
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_DEAD,
- GEN_INT (0),
- REG_NOTES (insn));
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_DEAD,
- GEN_INT (NOTE_INSN_SETJMP),
- REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_DEAD,
+ GEN_INT (0),
+ REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_DEAD,
+ GEN_INT (NOTE_INSN_SETJMP),
+ REG_NOTES (insn));
}
else
{
@@ -2298,10 +2309,12 @@ sched_analyze (head, tail)
|| (NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP
&& GET_CODE (PREV_INSN (insn)) != CALL_INSN)))
{
- loop_notes = gen_rtx (EXPR_LIST, REG_DEAD,
- GEN_INT (NOTE_BLOCK_NUMBER (insn)), loop_notes);
- loop_notes = gen_rtx (EXPR_LIST, REG_DEAD,
- GEN_INT (NOTE_LINE_NUMBER (insn)), loop_notes);
+ loop_notes = gen_rtx_EXPR_LIST (REG_DEAD,
+ GEN_INT (NOTE_BLOCK_NUMBER (insn)),
+ loop_notes);
+ loop_notes = gen_rtx_EXPR_LIST (REG_DEAD,
+ GEN_INT (NOTE_LINE_NUMBER (insn)),
+ loop_notes);
CONST_CALL_P (loop_notes) = CONST_CALL_P (insn);
}
@@ -2404,7 +2417,8 @@ sched_note_set (b, x, death)
do { if ((NEW_READY) - (OLD_READY) == 1) \
swap_sort (READY, NEW_READY); \
else if ((NEW_READY) - (OLD_READY) > 1) \
- qsort (READY, NEW_READY, sizeof (rtx), rank_for_schedule); } \
+ qsort ((char *) READY, NEW_READY, sizeof (rtx), \
+ rank_for_schedule); } \
while (0)
/* Returns a positive value if y is preferred; returns a negative value if
@@ -2413,10 +2427,11 @@ sched_note_set (b, x, death)
static int
rank_for_schedule (x, y)
- rtx *x, *y;
+ const GENERIC_PTR x;
+ const GENERIC_PTR y;
{
- rtx tmp = *y;
- rtx tmp2 = *x;
+ rtx tmp = *(rtx *) y;
+ rtx tmp2 = *(rtx *) x;
rtx link;
int tmp_class, tmp2_class;
int value;
@@ -2468,7 +2483,8 @@ swap_sort (a, n)
rtx insn = a[n-1];
int i = n-2;
- while (i >= 0 && rank_for_schedule (a+i, &insn) >= 0)
+ while (i >= 0 && rank_for_schedule ((const GENERIC_PTR) (a + i),
+ (const GENERIC_PTR) &insn) >= 0)
{
a[i+1] = a[i];
i -= 1;
@@ -2788,7 +2804,7 @@ create_reg_dead_note (reg, insn)
{
rtx temp_reg, temp_link;
- temp_reg = gen_rtx (REG, word_mode, 0);
+ temp_reg = gen_rtx_REG (word_mode, 0);
temp_link = rtx_alloc (EXPR_LIST);
PUT_REG_NOTE_KIND (temp_link, REG_DEAD);
XEXP (temp_link, 0) = temp_reg;
@@ -2919,9 +2935,9 @@ attach_deaths (x, insn, set_p)
i >= 0; i--)
if (! REGNO_REG_SET_P (old_live_regs, regno + i)
&& ! dead_or_set_regno_p (insn, regno + i))
- create_reg_dead_note (gen_rtx (REG,
- reg_raw_mode[regno + i],
- regno + i),
+ create_reg_dead_note (gen_rtx_REG
+ (reg_raw_mode[regno + i],
+ regno + i),
insn);
}
}
@@ -4545,8 +4561,9 @@ update_flow_info (notes, first, last, orig_insn)
for (insn = first; insn != NEXT_INSN (last); insn = NEXT_INSN (insn))
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
&& reg_mentioned_p (XEXP (note, 0), PATTERN (insn)))
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_LABEL,
- XEXP (note, 0), REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL,
+ XEXP (note, 0),
+ REG_NOTES (insn));
break;
case REG_CC_SETTER:
@@ -4796,8 +4813,8 @@ schedule_insns (dump_file)
/* Create an insn here so that we can hang dependencies off of it later. */
sched_before_next_call
- = gen_rtx (INSN, VOIDmode, 0, NULL_RTX, NULL_RTX,
- NULL_RTX, 0, NULL_RTX, NULL_RTX);
+ = gen_rtx_INSN (VOIDmode, 0, NULL_RTX, NULL_RTX,
+ NULL_RTX, 0, NULL_RTX, NULL_RTX);
/* Initialize the unused_*_lists. We can't use the ones left over from
the previous function, because gcc has freed that memory. We can use
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 3a5d7a4ac1b..c415a07e382 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -44,7 +44,7 @@ AT&T C compiler. From the example below I would conclude the following:
#ifdef SDB_DEBUGGING_INFO
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "regs.h"
diff --git a/gcc/stmt.c b/gcc/stmt.c
index b797d90a405..85946b9f710 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -34,10 +34,7 @@ Boston, MA 02111-1307, USA. */
after parsing the then-clause. */
#include "config.h"
-
-#include <stdio.h>
-#include <ctype.h>
-
+#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -635,7 +632,7 @@ expand_computed_goto (exp)
emit_queue ();
/* Be sure the function is executable. */
- if (flag_check_memory_usage)
+ if (current_function_check_memory_usage)
emit_library_call (chkr_check_exec_libfunc, 1,
VOIDmode, 1, x, ptr_mode);
@@ -726,7 +723,7 @@ expand_goto (label)
if (context != 0 && context != current_function_decl)
{
struct function *p = find_function_data (context);
- rtx label_ref = gen_rtx (LABEL_REF, Pmode, label_rtx (label));
+ rtx label_ref = gen_rtx_LABEL_REF (Pmode, label_rtx (label));
rtx temp;
p->has_nonlocal_label = 1;
@@ -779,9 +776,9 @@ expand_goto (label)
emit_move_insn (static_chain_rtx, label_ref);
/* USE of hard_frame_pointer_rtx added for consistency; not clear if
really needed. */
- emit_insn (gen_rtx (USE, VOIDmode, hard_frame_pointer_rtx));
- emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
- emit_insn (gen_rtx (USE, VOIDmode, static_chain_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, static_chain_rtx));
emit_indirect_jump (temp);
}
}
@@ -1364,17 +1361,17 @@ expand_asm (body)
return;
}
- if (flag_check_memory_usage)
+ 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;
}
if (TREE_CODE (body) == ADDR_EXPR)
body = TREE_OPERAND (body, 0);
- emit_insn (gen_rtx (ASM_INPUT, VOIDmode,
- TREE_STRING_POINTER (body)));
+ emit_insn (gen_rtx_ASM_INPUT (VOIDmode,
+ TREE_STRING_POINTER (body)));
last_expr_type = 0;
}
@@ -1426,9 +1423,9 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
return;
}
- if (flag_check_memory_usage)
+ 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;
}
@@ -1561,9 +1558,9 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
argvec = rtvec_alloc (ninputs);
constraints = rtvec_alloc (ninputs);
- body = gen_rtx (ASM_OPERANDS, VOIDmode,
- TREE_STRING_POINTER (string), "", 0, argvec, constraints,
- filename, line);
+ body = gen_rtx_ASM_OPERANDS (VOIDmode,
+ TREE_STRING_POINTER (string), "", 0, argvec,
+ constraints, filename, line);
MEM_VOLATILE_P (body) = vol;
@@ -1664,8 +1661,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
}
XVECEXP (body, 4, i) /* constraints */
- = gen_rtx (ASM_INPUT, TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))),
- TREE_STRING_POINTER (TREE_PURPOSE (tail)));
+ = gen_rtx_ASM_INPUT (TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))),
+ TREE_STRING_POINTER (TREE_PURPOSE (tail)));
i++;
}
@@ -1688,7 +1685,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
XVECEXP (body, 3, ninputs - ninout + i) /* argvec */
= output_rtx[j];
XVECEXP (body, 4, ninputs - ninout + i) /* constraints */
- = gen_rtx (ASM_INPUT, inout_mode[j], match[j]);
+ = gen_rtx_ASM_INPUT (inout_mode[j], match[j]);
}
/* Now, for each output, construct an rtx
@@ -1699,7 +1696,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
if (noutputs == 1 && nclobbers == 0)
{
XSTR (body, 1) = TREE_STRING_POINTER (TREE_PURPOSE (outputs));
- insn = emit_insn (gen_rtx (SET, VOIDmode, output_rtx[0], body));
+ insn = emit_insn (gen_rtx_SET (VOIDmode, output_rtx[0], body));
}
else if (noutputs == 0 && nclobbers == 0)
{
@@ -1711,20 +1708,22 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
rtx obody = body;
int num = noutputs;
if (num == 0) num = 1;
- body = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (num + nclobbers));
+ body = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (num + nclobbers));
/* For each output operand, store a SET. */
for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++)
{
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_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));
+
MEM_VOLATILE_P (SET_SRC (XVECEXP (body, 0, i))) = vol;
}
@@ -1749,9 +1748,10 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
if (j == -4) /* `memory', don't cache memory across asm */
{
XVECEXP (body, 0, i++)
- = gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (MEM, BLKmode,
- gen_rtx (SCRATCH, VOIDmode, 0)));
+ = gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_MEM
+ (BLKmode,
+ gen_rtx_SCRATCH (VOIDmode)));
continue;
}
@@ -1761,7 +1761,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
/* Use QImode since that's guaranteed to clobber just one reg. */
XVECEXP (body, 0, i++)
- = gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, QImode, j));
+ = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (QImode, j));
}
insn = emit_insn (body);
@@ -2622,7 +2622,7 @@ expand_value_return (val)
}
if (GET_CODE (return_reg) == REG
&& REGNO (return_reg) < FIRST_PSEUDO_REGISTER)
- emit_insn (gen_rtx (USE, VOIDmode, return_reg));
+ emit_insn (gen_rtx_USE (VOIDmode, return_reg));
/* Handle calls that return values in multiple non-contiguous locations.
The Irix 6 ABI has examples of this. */
else if (GET_CODE (return_reg) == PARALLEL)
@@ -2635,7 +2635,7 @@ expand_value_return (val)
if (GET_CODE (x) == REG
&& REGNO (x) < FIRST_PSEUDO_REGISTER)
- emit_insn (gen_rtx (USE, VOIDmode, x));
+ emit_insn (gen_rtx_USE (VOIDmode, x));
}
}
@@ -2925,7 +2925,7 @@ expand_return (retval)
result_pseudos[xbitpos / BITS_PER_WORD] = dst;
/* Clobber the destination before we move anything into it. */
- emit_insn (gen_rtx (CLOBBER, VOIDmode, dst));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, dst));
}
/* We need a new source operand each time bitpos is on a word
@@ -3324,7 +3324,7 @@ expand_end_bindings (vars, mark_ends, dont_jump_in)
start_sequence ();
emit_move_insn (nonlocal_goto_handler_slot,
- gen_rtx (LABEL_REF, Pmode, handler_label));
+ gen_rtx_LABEL_REF (Pmode, handler_label));
insns = get_insns ();
end_sequence ();
emit_insns_before (insns, thisblock->data.block.first_insn);
@@ -3399,7 +3399,8 @@ expand_end_bindings (vars, mark_ends, dont_jump_in)
rtx not_this = gen_label_rtx ();
rtx this = gen_label_rtx ();
do_jump_if_equal (static_chain_rtx,
- gen_rtx (LABEL_REF, Pmode, DECL_RTL (TREE_VALUE (link))),
+ gen_rtx_LABEL_REF (Pmode,
+ DECL_RTL (TREE_VALUE (link))),
this, 0);
emit_jump (not_this);
emit_label (this);
@@ -3407,7 +3408,7 @@ expand_end_bindings (vars, mark_ends, dont_jump_in)
emit_label (not_this);
}
/* If label is not recognized, abort. */
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "abort"), 0,
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "abort"), 0,
VOIDmode, 0);
emit_barrier ();
emit_label (afterward);
@@ -3574,7 +3575,7 @@ expand_decl (decl)
/* Create the RTL representation for the variable. */
if (type == error_mark_node)
- DECL_RTL (decl) = gen_rtx (MEM, BLKmode, const0_rtx);
+ DECL_RTL (decl) = gen_rtx_MEM (BLKmode, const0_rtx);
else if (DECL_SIZE (decl) == 0)
/* Variable with incomplete type. */
{
@@ -3584,7 +3585,7 @@ expand_decl (decl)
else
/* An initializer is going to decide the size of this array.
Until we know the size, represent its address with a reg. */
- DECL_RTL (decl) = gen_rtx (MEM, BLKmode, gen_reg_rtx (Pmode));
+ DECL_RTL (decl) = gen_rtx_MEM (BLKmode, gen_reg_rtx (Pmode));
MEM_IN_STRUCT_P (DECL_RTL (decl)) = AGGREGATE_TYPE_P (type);
}
else if (DECL_MODE (decl) != BLKmode
@@ -3596,7 +3597,7 @@ expand_decl (decl)
&& ! TREE_ADDRESSABLE (decl)
&& (DECL_REGISTER (decl) || ! obey_regdecls)
/* if -fcheck-memory-usage, check all variables. */
- && ! flag_check_memory_usage)
+ && ! current_function_check_memory_usage)
{
/* Automatic variable that can go in a register. */
int unsignedp = TREE_UNSIGNED (type);
@@ -3695,7 +3696,7 @@ expand_decl (decl)
TYPE_ALIGN (TREE_TYPE (decl)));
/* Reference the variable indirect through that rtx. */
- DECL_RTL (decl) = gen_rtx (MEM, DECL_MODE (decl), address);
+ DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), address);
/* If this is a memory ref that contains aggregate components,
mark it as such for cse and loop optimize. */
@@ -4157,7 +4158,7 @@ expand_anon_union_decl (decl, cleanup, decl_elts)
DECL_RTL (decl_elt) = x;
else
{
- DECL_RTL (decl_elt) = gen_rtx (MEM, mode, copy_rtx (XEXP (x, 0)));
+ DECL_RTL (decl_elt) = gen_rtx_MEM (mode, copy_rtx (XEXP (x, 0)));
MEM_IN_STRUCT_P (DECL_RTL (decl_elt)) = MEM_IN_STRUCT_P (x);
RTX_UNCHANGING_P (DECL_RTL (decl_elt)) = RTX_UNCHANGING_P (x);
}
@@ -4167,7 +4168,7 @@ expand_anon_union_decl (decl, cleanup, decl_elts)
if (mode == GET_MODE (x))
DECL_RTL (decl_elt) = x;
else
- DECL_RTL (decl_elt) = gen_rtx (SUBREG, mode, x, 0);
+ DECL_RTL (decl_elt) = gen_rtx_SUBREG (mode, x, 0);
}
else
abort ();
@@ -5185,7 +5186,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 malloc here - not xmalloc. */
+ /* We deliberately use malloc here, not xmalloc, 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 *) malloc (bytes_needed)) != NULL)
{
long i;
@@ -5674,7 +5677,7 @@ expand_end_case (orig_index)
while (1)
{
labelvec[i]
- = gen_rtx (LABEL_REF, Pmode, label_rtx (n->code_label));
+ = gen_rtx_LABEL_REF (Pmode, label_rtx (n->code_label));
if (i + TREE_INT_CST_LOW (orig_minval)
== TREE_INT_CST_LOW (n->high))
break;
@@ -5685,7 +5688,7 @@ expand_end_case (orig_index)
/* Fill in the gaps with the default. */
for (i = 0; i < ncases; i++)
if (labelvec[i] == 0)
- labelvec[i] = gen_rtx (LABEL_REF, Pmode, default_label);
+ labelvec[i] = gen_rtx_LABEL_REF (Pmode, default_label);
/* Output the table */
emit_label (table_label);
@@ -5697,12 +5700,13 @@ expand_end_case (orig_index)
1 ||
#endif
flag_pic)
- emit_jump_insn (gen_rtx (ADDR_DIFF_VEC, CASE_VECTOR_MODE,
- gen_rtx (LABEL_REF, Pmode, table_label),
- gen_rtvec_v (ncases, labelvec)));
+ emit_jump_insn (gen_rtx_ADDR_DIFF_VEC
+ (CASE_VECTOR_MODE,
+ gen_rtx_LABEL_REF (Pmode, table_label),
+ gen_rtvec_v (ncases, labelvec)));
else
- emit_jump_insn (gen_rtx (ADDR_VEC, CASE_VECTOR_MODE,
- gen_rtvec_v (ncases, labelvec)));
+ emit_jump_insn (gen_rtx_ADDR_VEC (CASE_VECTOR_MODE,
+ gen_rtvec_v (ncases, labelvec)));
/* If the case insn drops through the table,
after the table we must jump to the default-label.
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index a4698157cc7..4ac26a20912 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -1,5 +1,5 @@
/* C-compiler utilities for types and variables storage layout
- Copyright (C) 1987, 88, 92-96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 92-97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,8 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
-
+#include "system.h"
#include "tree.h"
#include "flags.h"
#include "except.h"
diff --git a/gcc/stupid.c b/gcc/stupid.c
index 77cbab2ed60..e6d21661e6b 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, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */
and assigned hard regs in priority order. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "hard-reg-set.h"
#include "regs.h"
@@ -528,8 +528,9 @@ stupid_mark_refs (x, insn)
&& REGNO_LAST_UID (regno) == INSN_UID (insn)
&& (code == CLOBBER || ! reg_mentioned_p (SET_DEST (x),
SET_SRC (x))))
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_UNUSED,
- SET_DEST (x), REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_UNUSED,
+ SET_DEST (x),
+ REG_NOTES (insn));
}
}
diff --git a/gcc/system.h b/gcc/system.h
index 920e5128c68..7e4e54bf8bd 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -1,17 +1,49 @@
-/* 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 Free Software Foundation, Inc.
- */
+This file is part of GNU CC.
-#ifndef __GCC_SYSTEM_H__
-#define __GCC_SYSTEM_H__
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+
+
+/* All these system support ANSI prototypes. */
+#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
+#define ANSI_PROTOTYPES
+#endif
+
+/* We must include stdarg.h/varargs.h before stdio.h. */
+#ifdef ANSI_PROTOTYPES
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
#include <stdio.h>
+
+/* Define a generic NULL if one hasn't already been defined. */
+#ifndef NULL
+#define NULL 0
+#endif
+
#include <ctype.h>
/* Jim Meyering writes:
-
+
"... Some ctype macros are valid only for character codes that
isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
using /bin/cc or gcc but without giving an ansi option). So, all
@@ -20,21 +52,21 @@
macros don't need to be guarded with references to isascii. ...
Defining isascii to 1 should let any compiler worth its salt
eliminate the && through constant folding."
-
+
Bruno Haible adds:
-
+
"... Furthermore, isupper(c) etc. have an undefined result if c is
outside the range -1 <= c <= 255. One is tempted to write isupper(c)
with c being of type `char', but this is wrong if c is an 8-bit
character >= 128 which gets sign-extended to a negative value.
The macro ISUPPER protects against this as well." */
-
+
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define IN_CTYPE_DOMAIN(c) 1
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
#endif
-
+
#ifdef isblank
# define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (c))
#else
@@ -45,7 +77,7 @@
#else
# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint (c) && !isspace (c))
#endif
-
+
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
@@ -56,7 +88,7 @@
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
-
+
/* ISDIGIT differs from ISDIGIT_LOCALE, as follows:
- Its arg may be any int or unsigned int; it need not be an unsigned char.
- It's guaranteed to evaluate its argument exactly once.
@@ -68,19 +100,26 @@
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
+#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
-#include <sys/stat.h>
+#endif
+
#include <errno.h>
#ifndef errno
extern int errno;
#endif
-#ifdef HAVE_STRING_H
+#ifdef STRING_WITH_STRINGS
# include <string.h>
+# include <strings.h>
#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
+# ifdef HAVE_STRING_H
+# include <string.h>
+# else
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
# endif
#endif
@@ -105,16 +144,20 @@ extern int errno;
# include <time.h>
#else
# if HAVE_SYS_TIME_H
-# include <sys/time.h>
+# include <sys/time.h>
# else
-# include <time.h>
-#endif
+# ifdef HAVE_TIME_H
+# include <time.h>
+# endif
+# endif
#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#else
-# include <sys/file.h>
+# ifdef HAVE_SYS_FILE_H
+# include <sys/file.h>
+# endif
#endif
#ifndef SEEK_SET
@@ -128,13 +171,34 @@ extern int errno;
# define W_OK 2
# define R_OK 4
#endif
+#ifndef O_RDONLY
+# define O_RDONLY 0
+#endif
+#ifndef O_WRONLY
+# define O_WRONLY 1
+#endif
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#ifndef WIFSIGNALED
+#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
+#endif
+#ifndef WTERMSIG
+#define WTERMSIG(S) ((S) & 0x7f)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(S) (((S) & 0xff) == 0)
+#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
+#endif
#ifndef bcopy
# ifdef HAVE_BCOPY
# ifdef NEED_DECLARATION_BCOPY
-void bcopy ();
+extern void bcopy ();
# endif
# else /* ! HAVE_BCOPY */
# define bcopy(src,dst,len) memcpy ((dst),(src),(len))
@@ -144,7 +208,7 @@ void bcopy ();
#ifndef bcmp
# ifdef HAVE_BCMP
# ifdef NEED_DECLARATION_BCMP
-void bcmp ();
+extern int bcmp ();
# endif
# else /* ! HAVE_BCMP */
# define bcmp(left,right,len) memcmp ((left),(right),(len))
@@ -154,7 +218,7 @@ void bcmp ();
#ifndef bzero
# ifdef HAVE_BZERO
# ifdef NEED_DECLARATION_BZERO
-void bzero ();
+extern void bzero ();
# endif
# else /* ! HAVE_BZERO */
# define bzero(dst,len) memset ((dst),0,(len))
@@ -181,8 +245,157 @@ extern char *rindex ();
# endif
#endif
+#ifdef NEED_DECLARATION_ATOF
+extern double atof ();
+#endif
+
+#ifdef NEED_DECLARATION_ATOL
+extern long atol();
+#endif
+
+#ifdef NEED_DECLARATION_GETCWD
+extern char *getcwd ();
+#endif
+
+#ifdef NEED_DECLARATION_GETENV
+extern char *getenv ();
+#endif
+
+#ifdef NEED_DECLARATION_GETWD
+extern char *getwd ();
+#endif
+
+#ifdef NEED_DECLARATION_SBRK
+extern char *sbrk ();
+#endif
+
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+
#ifdef NEED_DECLARATION_FREE
extern void free ();
#endif
-#endif /* __GCC_SYSTEM_H__ */
+#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
+extern char *strerror ();
+# endif
+# endif
+#else /* ! HAVE_STRERROR */
+extern int sys_nerr;
+extern char *sys_errlist[];
+#endif /* HAVE_STRERROR */
+
+#ifdef HAVE_STRSIGNAL
+# ifdef NEED_DECLARATION_STRSIGNAL
+# ifndef strsignal
+extern char * strsignal ();
+# endif
+# endif
+#else /* ! HAVE_STRSIGNAL */
+# ifndef SYS_SIGLIST_DECLARED
+# ifndef NO_SYS_SIGLIST
+extern char * sys_siglist[];
+# endif
+# endif
+#endif /* HAVE_STRSIGNAL */
+
+#ifdef HAVE_GETRLIMIT
+# ifdef NEED_DECLARATION_GETRLIMIT
+# ifndef getrlimit
+extern int getrlimit ();
+# endif
+# endif
+#endif
+
+#ifdef HAVE_SETRLIMIT
+# ifdef NEED_DECLARATION_SETRLIMIT
+# ifndef setrlimit
+extern int setrlimit ();
+# endif
+# endif
+#endif
+
+/* HAVE_VOLATILE only refers to the stage1 compiler. We also check
+ __STDC__ and assume gcc sets it and has volatile in stage >=2. */
+#if !defined(HAVE_VOLATILE) && !defined(__STDC__) && !defined(volatile)
+#define volatile
+#endif
+
+/* Redefine abort to report an internal error w/o coredump, and reporting the
+ location of the error in the source file. */
+#ifndef abort
+#ifndef __STDC__
+#ifndef __GNUC__
+#ifndef USE_SYSTEM_ABORT
+#define USE_SYSTEM_ABORT
+#endif /* !USE_SYSTEM_ABORT */
+#endif /* !__GNUC__ */
+#endif /* !__STDC__ */
+
+#ifdef USE_SYSTEM_ABORT
+# ifdef NEED_DECLARATION_ABORT
+extern void abort ();
+# endif
+#else
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+#define abort() \
+ fatal ("%s:%d: Internal compiler error\n", __FILE__, __LINE__)
+#else
+#define abort() \
+ fatal ("%s:%d: Internal compiler error in function %s\n", \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#endif /* recent gcc */
+#endif /* USE_SYSTEM_ABORT */
+#endif /* !abort */
+
+
+/* Define a STRINGIFY macro that's right for ANSI or traditional C.
+ HAVE_CPP_STRINGIFY only refers to the stage1 compiler. Assume that
+ (non-traditional) gcc used in stage2 or later has this feature.
+
+ Note: if the argument passed to STRINGIFY is itself a macro, eg
+ #define foo bar, STRINGIFY(foo) will produce "foo", not "bar".
+ Although the __STDC__ case could be made to expand this via a layer
+ of indirection, the traditional C case can not do so. Therefore
+ this behavior is not supported. */
+#ifndef STRINGIFY
+# if defined(HAVE_CPP_STRINGIFY) || (defined(__GNUC__) && defined(__STDC__))
+# define STRINGIFY(STRING) #STRING
+# else
+# define STRINGIFY(STRING) "STRING"
+# endif
+#endif /* ! STRINGIFY */
+
+
+/* These macros are here in preparation for the use of gettext in egcs. */
+#define _(String) String
+#define N_(String) String
+
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+/* Test if something is a normal file. */
+#ifndef S_ISREG
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
+
+/* Test if something is a directory. */
+#ifndef S_ISDIR
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
diff --git a/gcc/texinfo.tex b/gcc/texinfo.tex
index 06b8f82a498..2b8a9cccbda 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 2.258 1998/09/17 17:25:42 karl 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: 2.258 $
-\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.
@@ -192,13 +187,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.
@@ -221,13 +219,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
@@ -849,7 +849,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.}
@@ -983,7 +983,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
@@ -2411,6 +2411,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}}%
@@ -2426,6 +2431,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
@@ -2489,6 +2495,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
@@ -5208,7 +5219,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
@@ -5448,5 +5459,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 bc0df20961b..dd2ad2a2af2 100644
--- a/gcc/tm.texi
+++ b/gcc/tm.texi
@@ -3089,9 +3089,9 @@ must live across calls.
@item DEFAULT_CALLER_SAVES
Define this macro if function calls on the target machine do not preserve
any registers; in other words, if @code{CALL_USED_REGISTERS} has 1
-for all registers. This macro enables @samp{-fcaller-saves} by default.
-Eventually that option will be enabled by default on all machines and both
-the option and this macro will be eliminated.
+for all registers. When defined, this macro enables @samp{-fcaller-saves}
+by default for all optimization levels. It has no effect for optimization
+levels 2 and higher, where @samp{-fcaller-saves} is the default.
@findex CALLER_SAVE_PROFITABLE
@item CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
@@ -4592,10 +4592,15 @@ than good.)
@findex MOVE_RATIO
@item MOVE_RATIO
-The number of scalar move insns which should be generated instead of a
+The threshold of number of scalar memory-to-memory move insns, @emph{below}
+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 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.
@findex NO_FUNCTION_CSE
@@ -4816,7 +4821,7 @@ necessary).
@item PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
Define this macro if the register defined by
@code{PIC_OFFSET_TABLE_REGNUM} is clobbered by calls. Do not define
-this macro if @code{PPIC_OFFSET_TABLE_REGNUM} is not defined.
+this macro if @code{PIC_OFFSET_TABLE_REGNUM} is not defined.
@findex FINALIZE_PIC
@item FINALIZE_PIC
diff --git a/gcc/toplev.c b/gcc/toplev.c
index b4df835c884..5fb4687e4e5 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1,5 +1,5 @@
/* Top level of GNU C compiler
- Copyright (C) 1987, 88, 89, 92-7, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 92-97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -24,39 +24,9 @@ Boston, MA 02111-1307, USA. */
Error messages and low-level interface to malloc also handled here. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include <stdio.h>
+#include "system.h"
#include <signal.h>
#include <setjmp.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#undef FLOAT
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-
-#undef FLOAT /* This is for hpux. They should change hpux. */
-#undef FFS /* Some systems define this in param.h. */
-
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-#endif
-#endif
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
@@ -1234,12 +1204,13 @@ vnotice (file, msgid, ap)
vfprintf (file, _(msgid), ap);
#else
{
- HOST_WIDE_INT v1 = va_arg(ap, HOST_WIDE_INT);
- HOST_WIDE_INT v2 = va_arg(ap, HOST_WIDE_INT);
- HOST_WIDE_INT v3 = va_arg(ap, HOST_WIDE_INT);
- HOST_WIDE_INT v4 = va_arg(ap, HOST_WIDE_INT);
- HOST_WIDE_INT v5 = va_arg(ap, HOST_WIDE_INT);
- HOST_WIDE_INT v6 = va_arg(ap, HOST_WIDE_INT);
+ HOST_WIDE_INT v1 = va_arg (ap, HOST_WIDE_INT);
+ HOST_WIDE_INT v2 = va_arg (ap, HOST_WIDE_INT);
+ HOST_WIDE_INT v3 = va_arg (ap, HOST_WIDE_INT);
+ HOST_WIDE_INT v4 = va_arg (ap, HOST_WIDE_INT);
+ HOST_WIDE_INT v5 = va_arg (ap, HOST_WIDE_INT);
+ HOST_WIDE_INT v6 = va_arg (ap, HOST_WIDE_INT);
+
fprintf (file, _(msgid), v1, v2, v3, v4, v5, v6);
}
#endif
@@ -1248,14 +1219,14 @@ vnotice (file, msgid, ap)
void
notice VPROTO((char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, char *);
#endif
@@ -1266,7 +1237,7 @@ notice VPROTO((char *msgid, ...))
void
fnotice VPROTO((FILE *file, char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
FILE *file;
char *msgid;
#endif
@@ -1274,7 +1245,7 @@ fnotice VPROTO((FILE *file, char *msgid, ...))
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
file = va_arg (ap, FILE *);
msgid = va_arg (ap, char *);
#endif
@@ -1354,10 +1325,11 @@ v_message_with_decl (decl, warn, msgid, ap)
vfprintf (stderr, p + 2, ap);
#else
{
- HOST_WIDE_INT v1 = va_arg(ap, HOST_WIDE_INT);
- HOST_WIDE_INT v2 = va_arg(ap, HOST_WIDE_INT);
- HOST_WIDE_INT v3 = va_arg(ap, HOST_WIDE_INT);
- HOST_WIDE_INT v4 = va_arg(ap, HOST_WIDE_INT);
+ HOST_WIDE_INT v1 = va_arg (ap, HOST_WIDE_INT);
+ HOST_WIDE_INT v2 = va_arg (ap, HOST_WIDE_INT);
+ HOST_WIDE_INT v3 = va_arg (ap, HOST_WIDE_INT);
+ HOST_WIDE_INT v4 = va_arg (ap, HOST_WIDE_INT);
+
fprintf (stderr, p + 2, v1, v2, v3, v4);
}
#endif
@@ -1425,7 +1397,7 @@ v_error_with_file_and_line (file, line, msgid, ap)
void
error_with_file_and_line VPROTO((char *file, int line, char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *file;
int line;
char *msgid;
@@ -1434,7 +1406,7 @@ error_with_file_and_line VPROTO((char *file, int line, char *msgid, ...))
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
file = va_arg (ap, char *);
line = va_arg (ap, int);
msgid = va_arg (ap, char *);
@@ -1462,7 +1434,7 @@ v_error_with_decl (decl, msgid, ap)
void
error_with_decl VPROTO((tree decl, char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
tree decl;
char *msgid;
#endif
@@ -1470,7 +1442,7 @@ error_with_decl VPROTO((tree decl, char *msgid, ...))
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
decl = va_arg (ap, tree);
msgid = va_arg (ap, char *);
#endif
@@ -1501,7 +1473,7 @@ v_error_for_asm (insn, msgid, ap)
void
error_for_asm VPROTO((rtx insn, char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
rtx insn;
char *msgid;
#endif
@@ -1509,7 +1481,7 @@ error_for_asm VPROTO((rtx insn, char *msgid, ...))
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
insn = va_arg (ap, rtx);
msgid = va_arg (ap, char *);
#endif
@@ -1531,14 +1503,14 @@ verror (msgid, ap)
void
error VPROTO((char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, char *);
#endif
@@ -1546,13 +1518,28 @@ error VPROTO((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((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)
char *msgid;
va_list ap;
{
+ if (fatal_function != 0)
+ (*fatal_function) (_(msgid), ap);
+
verror (msgid, ap);
exit (FATAL_EXIT_CODE);
}
@@ -1560,14 +1547,14 @@ vfatal (msgid, ap)
void
fatal VPROTO((char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, char *);
#endif
@@ -1594,7 +1581,7 @@ v_warning_with_file_and_line (file, line, msgid, ap)
void
warning_with_file_and_line VPROTO((char *file, int line, char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *file;
int line;
char *msgid;
@@ -1603,7 +1590,7 @@ warning_with_file_and_line VPROTO((char *file, int line, char *msgid, ...))
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
file = va_arg (ap, char *);
line = va_arg (ap, int);
msgid = va_arg (ap, char *);
@@ -1633,7 +1620,7 @@ v_warning_with_decl (decl, msgid, ap)
void
warning_with_decl VPROTO((tree decl, char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
tree decl;
char *msgid;
#endif
@@ -1641,7 +1628,7 @@ warning_with_decl VPROTO((tree decl, char *msgid, ...))
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
decl = va_arg (ap, tree);
msgid = va_arg (ap, char *);
#endif
@@ -1674,7 +1661,7 @@ v_warning_for_asm (insn, msgid, ap)
void
warning_for_asm VPROTO((rtx insn, char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
rtx insn;
char *msgid;
#endif
@@ -1682,7 +1669,7 @@ warning_for_asm VPROTO((rtx insn, char *msgid, ...))
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
insn = va_arg (ap, rtx);
msgid = va_arg (ap, char *);
#endif
@@ -1704,14 +1691,14 @@ vwarning (msgid, ap)
void
warning VPROTO((char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, char *);
#endif
@@ -1736,14 +1723,14 @@ vpedwarn (msgid, ap)
void
pedwarn VPROTO((char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, char *);
#endif
@@ -1776,7 +1763,7 @@ v_pedwarn_with_decl (decl, msgid, ap)
void
pedwarn_with_decl VPROTO((tree decl, char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
tree decl;
char *msgid;
#endif
@@ -1784,7 +1771,7 @@ pedwarn_with_decl VPROTO((tree decl, char *msgid, ...))
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
decl = va_arg (ap, tree);
msgid = va_arg (ap, char *);
#endif
@@ -1809,7 +1796,7 @@ v_pedwarn_with_file_and_line (file, line, msgid, ap)
void
pedwarn_with_file_and_line VPROTO((char *file, int line, char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *file;
int line;
char *msgid;
@@ -1818,7 +1805,7 @@ pedwarn_with_file_and_line VPROTO((char *file, int line, char *msgid, ...))
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
file = va_arg (ap, char *);
line = va_arg (ap, int);
msgid = va_arg (ap, char *);
@@ -1848,14 +1835,14 @@ vsorry (msgid, ap)
void
sorry VPROTO((char *msgid, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
char *msgid;
#endif
va_list ap;
VA_START (ap, msgid);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
msgid = va_arg (ap, char *);
#endif
@@ -2236,7 +2223,7 @@ compile_file (name)
if (flag_caller_saves)
init_caller_save ();
- /* How that we can emit RTL, see if the value of flag_regmove was
+ /* Now that we can emit RTL, see if the value of flag_regmove was
defaulted from -O2 and, if so, set its proper default. */
if (flag_regmove == 2)
flag_regmove = regmove_profitable_p ();
@@ -3244,13 +3231,15 @@ 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, cse_dump_file));
TIMEVAR (cse_time, delete_dead_from_cse (insns, max_reg_num ()));
+ /* We are no longer anticipating cse in this function, at least. */
+ cse_not_expected = 1;
+
if (tem || optimize > 1)
TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 0));
}
@@ -3336,6 +3325,7 @@ rest_of_compilation (decl)
TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
TIMEVAR (jump_time, thread_jumps (insns, max_reg_num (), 0));
}
+
/* Dump rtl code after cse, if we are doing that. */
if (cse2_dump)
@@ -3366,15 +3356,12 @@ rest_of_compilation (decl)
if (! quiet_flag)
fflush (branch_prob_dump_file);
});
- /* We are no longer anticipating cse in this function, at least. */
-
- cse_not_expected = 1;
/* Now we choose between stupid (pcc-like) register allocation
(if we got the -noreg switch and not -opt)
and smart register allocation. */
- if (optimize > 0) /* Stupid allocation probably won't work */
+ if (optimize > 0) /* Stupid allocation probably won't work */
obey_regdecls = 0; /* if optimizations being done. */
regclass_init ();
diff --git a/gcc/tree.c b/gcc/tree.c
index d26359a4098..7c7aa226f50 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -34,22 +34,13 @@ Boston, MA 02111-1307, USA. */
by all passes of the compiler. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include <setjmp.h>
#include "flags.h"
#include "tree.h"
#include "except.h"
#include "function.h"
#include "obstack.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
@@ -2920,7 +2911,7 @@ stabilize_reference_1 (e)
tree
build VPROTO((enum tree_code code, tree tt, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
enum tree_code code;
tree tt;
#endif
@@ -2931,7 +2922,7 @@ build 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
@@ -3044,7 +3035,7 @@ build1 (code, type, node)
tree
build_nt VPROTO((enum tree_code code, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
enum tree_code code;
#endif
va_list p;
@@ -3054,7 +3045,7 @@ build_nt VPROTO((enum tree_code code, ...))
VA_START (p, code);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
code = va_arg (p, enum tree_code);
#endif
@@ -3074,7 +3065,7 @@ build_nt VPROTO((enum tree_code code, ...))
tree
build_parse_node VPROTO((enum tree_code code, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
enum tree_code code;
#endif
register struct obstack *ambient_obstack = expression_obstack;
@@ -3085,7 +3076,7 @@ build_parse_node VPROTO((enum tree_code code, ...))
VA_START (p, code);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
code = va_arg (p, enum tree_code);
#endif
diff --git a/gcc/tree.h b/gcc/tree.h
index 652d1941623..f11ac870989 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1133,6 +1133,10 @@ struct tree_type
multiple translation units should be merged. */
#define DECL_ONE_ONLY(NODE) (DECL_CHECK (NODE)->decl.transparent_union)
+/* 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. */
#define DECL_LANG_FLAG_0(NODE) (DECL_CHECK (NODE)->decl.lang_flag_0)
#define DECL_LANG_FLAG_1(NODE) (DECL_CHECK (NODE)->decl.lang_flag_1)
@@ -1173,7 +1177,9 @@ struct tree_decl
unsigned static_dtor_flag : 1;
unsigned artificial_flag : 1;
unsigned weak_flag : 1;
- /* room for no more */
+
+ unsigned no_check_memory_usage : 1;
+ /* room for 31 more */
unsigned lang_flag_0 : 1;
unsigned lang_flag_1 : 1;
@@ -1265,9 +1271,6 @@ extern char *oballoc PROTO((int));
extern char *permalloc PROTO((int));
extern char *savealloc PROTO((int));
extern char *expralloc PROTO((int));
-#ifdef NEED_DECLARATION_FREE
-extern void free PROTO((void *));
-#endif
/* Lowest level primitive for allocating a node.
The TREE_CODE is the only argument. Contents are initialized
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 63db55ad16d..8df046b1425 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -147,7 +147,7 @@ struct _factor { int factor, count; } factors[NUM_FACTORS]
enum unroll_types { UNROLL_COMPLETELY, UNROLL_MODULO, UNROLL_NAIVE };
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "insn-config.h"
#include "integrate.h"
@@ -1207,7 +1207,7 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
tem = get_label_from_map (map,
CODE_LABEL_NUMBER
(XEXP (SET_SRC (pattern), 0)));
- SET_SRC (pattern) = gen_rtx (LABEL_REF, VOIDmode, tem);
+ SET_SRC (pattern) = gen_rtx_LABEL_REF (VOIDmode, tem);
/* Set the jump label so that it can be used by later loop unrolling
passes. */
@@ -2214,7 +2214,7 @@ fold_rtx_mult_add (mult1, mult2, add1, mode)
mult_res = simplify_binary_operation (MULT, mode, mult1, mult2);
if (! mult_res)
- mult_res = gen_rtx (MULT, mode, mult1, mult2);
+ mult_res = gen_rtx_MULT (mode, mult1, mult2);
/* Again, put the constant second. */
if (GET_CODE (add1) == CONST_INT)
@@ -2226,7 +2226,7 @@ fold_rtx_mult_add (mult1, mult2, add1, mode)
result = simplify_binary_operation (PLUS, mode, add1, mult_res);
if (! result)
- result = gen_rtx (PLUS, mode, add1, mult_res);
+ result = gen_rtx_PLUS (mode, add1, mult_res);
return result;
}
@@ -2904,8 +2904,8 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
instruction on machines with complex addressing modes.
If we can't recognize it, then delete it and emit insns
to calculate the value from scratch. */
- emit_insn_before (gen_rtx (SET, VOIDmode, tem,
- copy_rtx (v->new_reg)),
+ emit_insn_before (gen_rtx_SET (VOIDmode, tem,
+ copy_rtx (v->new_reg)),
loop_start);
if (recog_memoized (PREV_INSN (loop_start)) < 0)
{
@@ -3069,7 +3069,7 @@ reg_dead_after_loop (reg, loop_start, loop_end)
/* HACK: Must also search the loop fall through exit, create a label_ref
here which points to the loop_end, and append the loop_number_exit_labels
list to it. */
- label = gen_rtx (LABEL_REF, VOIDmode, loop_end);
+ label = gen_rtx_LABEL_REF (VOIDmode, loop_end);
LABEL_NEXTREF (label) = loop_number_exit_labels[this_loop_num];
for ( ; label; label = LABEL_NEXTREF (label))
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 929f4497f4e..6f4db63907d 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -27,9 +27,8 @@ Boston, MA 02111-1307, USA. */
and are responsible for combining constants with the same value. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include <setjmp.h>
-/* #include <stab.h> */
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -42,7 +41,6 @@ Boston, MA 02111-1307, USA. */
#include "defaults.h"
#include "real.h"
#include "bytecode.h"
-
#include "obstack.h"
#include "c-pragma.h"
@@ -541,8 +539,8 @@ make_function_rtl (decl)
if (DECL_RTL (decl) == 0)
{
DECL_RTL (decl)
- = gen_rtx (MEM, DECL_MODE (decl),
- gen_rtx (SYMBOL_REF, Pmode, name));
+ = gen_rtx_MEM (DECL_MODE (decl),
+ gen_rtx_SYMBOL_REF (Pmode, name));
/* Optionally set flags or add text to the name to record information
such as that it is a function name. If the name is changed, the macro
@@ -762,7 +760,7 @@ make_decl_rtl (decl, asmspec, top_level)
kludge to avoid setting DECL_RTL to frame_pointer_rtx. */
DECL_RTL (decl)
- = gen_rtx (REG, DECL_MODE (decl), FIRST_PSEUDO_REGISTER);
+ = gen_rtx_REG (DECL_MODE (decl), FIRST_PSEUDO_REGISTER);
REGNO (DECL_RTL (decl)) = reg_number;
REG_USERVAR_P (DECL_RTL (decl)) = 1;
@@ -816,8 +814,8 @@ make_decl_rtl (decl, asmspec, top_level)
new_name, strlen (new_name));
}
- DECL_RTL (decl) = gen_rtx (MEM, DECL_MODE (decl),
- gen_rtx (SYMBOL_REF, Pmode, name));
+ DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl),
+ gen_rtx_SYMBOL_REF (Pmode, name));
/* If this variable is to be treated as volatile, show its
tree node has side effects. If it has side effects, either
@@ -1885,7 +1883,7 @@ assemble_static_space (size)
if (output_bytecode)
x = bc_gen_rtx (namestring, 0, (struct bc_label *) 0);
else
- x = gen_rtx (SYMBOL_REF, Pmode, namestring);
+ x = gen_rtx_SYMBOL_REF (Pmode, namestring);
if (output_bytecode)
{
@@ -1943,7 +1941,7 @@ assemble_trampoline_template ()
ASM_GENERATE_INTERNAL_LABEL (label, "LTRAMP", 0);
name
= (char *) obstack_copy0 (&permanent_obstack, label, strlen (label));
- return gen_rtx (SYMBOL_REF, Pmode, name);
+ return gen_rtx_SYMBOL_REF (Pmode, name);
}
#endif
@@ -2212,7 +2210,7 @@ immed_double_const (i0, i1, mode)
push_obstacks_nochange ();
rtl_in_saveable_obstack ();
- r = gen_rtx (CONST_DOUBLE, mode, NULL_RTX, i0, i1);
+ r = gen_rtx_CONST_DOUBLE (mode, NULL_RTX, i0, i1);
pop_obstacks ();
/* Don't touch const_double_chain in nested function; see force_const_mem.
@@ -2394,9 +2392,10 @@ decode_addr_const (exp, value)
/* FIXME: this may not be correct, check it */
x = bc_gen_rtx (TREE_STRING_POINTER (target), 0, (struct bc_label *) 0);
else
- x = gen_rtx (MEM, FUNCTION_MODE,
- gen_rtx (LABEL_REF, VOIDmode,
- label_rtx (TREE_OPERAND (exp, 0))));
+ x = gen_rtx_MEM (FUNCTION_MODE,
+ gen_rtx_LABEL_REF
+ (VOIDmode,
+ label_rtx (TREE_OPERAND (exp, 0))));
break;
case REAL_CST:
@@ -3153,10 +3152,10 @@ output_constant_def (exp)
if (TREE_PERMANENT (exp))
end_temporary_allocation ();
- def = gen_rtx (SYMBOL_REF, Pmode, desc->label);
+ def = gen_rtx_SYMBOL_REF (Pmode, desc->label);
TREE_CST_RTL (exp)
- = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)), def);
+ = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (exp)), def);
RTX_UNCHANGING_P (TREE_CST_RTL (exp)) = 1;
if (AGGREGATE_TYPE_P (TREE_TYPE (exp)))
MEM_IN_STRUCT_P (TREE_CST_RTL (exp)) = 1;
@@ -3654,10 +3653,10 @@ force_const_mem (mode, x)
rtl_in_saveable_obstack ();
if (GET_CODE (x) == CONST)
- x = gen_rtx (CONST, GET_MODE (x),
- gen_rtx (PLUS, GET_MODE (x),
- XEXP (XEXP (x, 0), 0),
- XEXP (XEXP (x, 0), 1)));
+ x = gen_rtx_CONST (GET_MODE (x),
+ gen_rtx_PLUS (GET_MODE (x),
+ XEXP (XEXP (x, 0), 0),
+ XEXP (XEXP (x, 0), 1)));
else
x = GEN_INT (INTVAL (x));
@@ -3703,7 +3702,7 @@ force_const_mem (mode, x)
/* We have a symbol name; construct the SYMBOL_REF and the MEM. */
- def = gen_rtx (MEM, mode, gen_rtx (SYMBOL_REF, Pmode, found));
+ def = gen_rtx_MEM (mode, gen_rtx_SYMBOL_REF (Pmode, found));
RTX_UNCHANGING_P (def) = 1;
/* Mark the symbol_ref as belonging to this constants pool. */
diff --git a/gcc/version.c b/gcc/version.c
index 1fd9441e056..b1cccf13273 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -1 +1 @@
-char *version_string = "testgcc-2.8.1 980929 experimental";
+char *version_string = "testgcc-2.8.1 990109 experimental";
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index eeface41e1a..6748ccf6530 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -25,13 +25,14 @@ Boston, MA 02111-1307, USA. */
sdbout.c. */
#include "config.h"
-#include <stdio.h>
+
+#ifdef XCOFF_DEBUGGING_INFO
+
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "flags.h"
-#ifdef XCOFF_DEBUGGING_INFO
-
/* This defines the C_* storage classes. */
#include <dbxstclass.h>